diff --git a/#jpgraph/VERSION b/#jpgraph/VERSION deleted file mode 100644 index 4f1f823c..00000000 --- a/#jpgraph/VERSION +++ /dev/null @@ -1 +0,0 @@ -Version: v4.0.2 diff --git a/#jpgraph/src/Examples/accbarex1.php b/#jpgraph/src/Examples/accbarex1.php deleted file mode 100644 index 01796295..00000000 --- a/#jpgraph/src/Examples/accbarex1.php +++ /dev/null @@ -1,40 +0,0 @@ -SetScale("textlin"); - -$graph->SetShadow(); -$graph->img->SetMargin(40,30,20,40); - -// Create the bar plots -$b1plot = new BarPlot($data1y); -$b1plot->SetFillColor("orange"); -$b1plot->value->Show(); -$b2plot = new BarPlot($data2y); -$b2plot->SetFillColor("blue"); -$b2plot->value->Show(); - -// Create the grouped bar plot -$gbplot = new AccBarPlot(array($b1plot,$b2plot)); - -// ...and add it to the graPH -$graph->Add($gbplot); - -$graph->title->Set("Accumulated bar plots"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/accbarframeex01.php b/#jpgraph/src/Examples/accbarframeex01.php deleted file mode 100644 index 8b56876c..00000000 --- a/#jpgraph/src/Examples/accbarframeex01.php +++ /dev/null @@ -1,31 +0,0 @@ -SetScale('textlin'); -$graph->SetMarginColor('white'); - -// Setup title -$graph->title->Set('Acc bar with gradient'); - -// Create the first bar -$bplot = new BarPlot($datay1); -$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT); -$bplot->SetColor('darkred'); - -// Create the second bar -$bplot2 = new BarPlot($datay2); -$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT); -$bplot2->SetColor('darkgreen'); - -// And join them in an accumulated bar -$accbplot = new AccBarPlot(array($bplot,$bplot2)); -$graph->Add($accbplot); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/accbarframeex02.php b/#jpgraph/src/Examples/accbarframeex02.php deleted file mode 100644 index aa150dec..00000000 --- a/#jpgraph/src/Examples/accbarframeex02.php +++ /dev/null @@ -1,33 +0,0 @@ -SetScale('textlin'); -$graph->SetMarginColor('white'); - -// Setup title -$graph->title->Set('Acc bar with gradient'); - -// Create the first bar -$bplot = new BarPlot($datay1); -$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT); -$bplot->SetColor('darkred'); - -// Create the second bar -$bplot2 = new BarPlot($datay2); -$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT); -$bplot2->SetColor('darkgreen'); - -// And join them in an accumulated bar -$accbplot = new AccBarPlot(array($bplot,$bplot2)); -$accbplot->SetColor('red'); -$accbplot->SetWeight(1); -$graph->Add($accbplot); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/accbarframeex03.php b/#jpgraph/src/Examples/accbarframeex03.php deleted file mode 100644 index 37f3157b..00000000 --- a/#jpgraph/src/Examples/accbarframeex03.php +++ /dev/null @@ -1,35 +0,0 @@ -SetScale('textlin'); -$graph->SetMarginColor('white'); - -// Setup title -$graph->title->Set('Acc bar with gradient'); - -// Create the first bar -$bplot = new BarPlot($datay1); -$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT); -$bplot->SetColor('darkred'); -$bplot->SetWeight(0); - -// Create the second bar -$bplot2 = new BarPlot($datay2); -$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT); -$bplot2->SetColor('darkgreen'); -$bplot2->SetWeight(0); - -// And join them in an accumulated bar -$accbplot = new AccBarPlot(array($bplot,$bplot2)); -$accbplot->SetColor('darkgray'); -$accbplot->SetWeight(1); -$graph->Add($accbplot); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/alphabarex1.php b/#jpgraph/src/Examples/alphabarex1.php deleted file mode 100644 index 81c821cc..00000000 --- a/#jpgraph/src/Examples/alphabarex1.php +++ /dev/null @@ -1,75 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(40,80,30,40); - -// Adjust the position of the legend box -$graph->legend->Pos(0.02,0.15); - -// Adjust the color for theshadow of the legend -$graph->legend->SetShadow('darkgray@0.5'); -$graph->legend->SetFillColor('lightblue@0.3'); - -// Get localised version of the month names -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -// Set a nice summer (in Stockholm) image -$graph->SetBackgroundImage('stship.jpg',BGIMG_COPY); - -// Set axis titles and fonts -$graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetColor('white'); - -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->SetColor('white'); - -$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->SetColor('white'); - -//$graph->ygrid->Show(false); -$graph->ygrid->SetColor('white@0.5'); - -// Setup graph title -$graph->title->Set('Using alpha blending with a background'); -// Some extra margin (from the top) -$graph->title->SetMargin(3); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); - -// Create the three var series we will combine -$bplot1 = new BarPlot($datay1); -$bplot2 = new BarPlot($datay2); -$bplot3 = new BarPlot($datay3); - -// Setup the colors with 40% transparency (alpha channel) -$bplot1->SetFillColor('orange@0.4'); -$bplot2->SetFillColor('brown@0.4'); -$bplot3->SetFillColor('darkgreen@0.4'); - -// Setup legends -$bplot1->SetLegend('Label 1'); -$bplot2->SetLegend('Label 2'); -$bplot3->SetLegend('Label 3'); - -// Setup each bar with a shadow of 50% transparency -$bplot1->SetShadow('black@0.4'); -$bplot2->SetShadow('black@0.4'); -$bplot3->SetShadow('black@0.4'); - -$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3)); -$gbarplot->SetWidth(0.6); -$graph->Add($gbarplot); - -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/antispamex01.php b/#jpgraph/src/Examples/antispamex01.php deleted file mode 100644 index 57fe6099..00000000 --- a/#jpgraph/src/Examples/antispamex01.php +++ /dev/null @@ -1,18 +0,0 @@ -Rand(5); - -// Stroke random cahllenge -if( $spam->Stroke() === false ) { - die('Illegal or no data to plot'); -} - -?> - diff --git a/#jpgraph/src/Examples/aqua_example.php b/#jpgraph/src/Examples/aqua_example.php deleted file mode 100644 index 9c5a650b..00000000 --- a/#jpgraph/src/Examples/aqua_example.php +++ /dev/null @@ -1,58 +0,0 @@ - array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), - 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), - 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), - 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), - 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), - 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), - 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), - 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), - 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), -); - - -// Create the graph. These two calls are always required -$graph = new Graph(400,300); - -$graph->SetScale("textlin"); -if ($theme) { - $graph->SetTheme(new $theme()); -} -$theme_class = new AquaTheme; -$graph->SetTheme($theme_class); - -$plot = array(); -// Create the bar plots -for ($i = 0; $i < 4; $i++) { - $plot[$i] = new BarPlot($data[$i]); - $plot[$i]->SetLegend('plot'.($i+1)); -} -//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); -//$acc1->value->Show(); -$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); - -for ($i = 4; $i < 8; $i++) { - $plot[$i] = new LinePlot($data[$i]); - $plot[$i]->SetLegend('plot'.$i); - $plot[$i]->value->Show(); -} - -$graph->Add($gbplot); -$graph->Add($plot[4]); - -$title = "AquaTheme Example"; -$title = mb_convert_encoding($title,'UTF-8'); -$graph->title->Set($title); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/axislabelbkgex01.php b/#jpgraph/src/Examples/axislabelbkgex01.php deleted file mode 100644 index 99c098c2..00000000 --- a/#jpgraph/src/Examples/axislabelbkgex01.php +++ /dev/null @@ -1,35 +0,0 @@ -SetScale('intlin'); -$graph->SetMargin(30,15,40,30); -$graph->SetMarginColor('white'); -$graph->SetFrame(true,'blue',3); - -$graph->title->Set('Label background'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->subtitle->SetColor('darkred'); -$graph->subtitle->Set('"LABELBKG_NONE"'); - -$graph->SetAxisLabelBackground(LABELBKG_NONE,'orange','red','lightblue','red'); - -// Use Ariel font -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new LinePlot($ydata); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/axislabelbkgex02.php b/#jpgraph/src/Examples/axislabelbkgex02.php deleted file mode 100644 index 2b1740fd..00000000 --- a/#jpgraph/src/Examples/axislabelbkgex02.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale('intlin'); -$graph->SetMargin(30,15,40,30); -$graph->SetMarginColor('white'); -$graph->SetFrame(true,'blue',3); - -$graph->title->Set('Label background'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->subtitle->SetColor('darkred'); -$graph->subtitle->Set('"LABELBKG_XAXIS"'); - -$graph->SetAxisLabelBackground(LABELBKG_XAXIS,'orange','red','lightblue','red'); - -// Use Ariel font -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new LinePlot($ydata); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/axislabelbkgex03.php b/#jpgraph/src/Examples/axislabelbkgex03.php deleted file mode 100644 index 9e557112..00000000 --- a/#jpgraph/src/Examples/axislabelbkgex03.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale('intlin'); -$graph->SetMargin(30,15,40,30); -$graph->SetMarginColor('white'); -$graph->SetFrame(true,'blue',3); - -$graph->title->Set('Label background'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->subtitle->SetColor('darkred'); -$graph->subtitle->Set('"LABELBKG_YAXIS"'); - -$graph->SetAxisLabelBackground(LABELBKG_YAXIS,'orange','red','lightblue','red'); - -// Use Ariel font -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new LinePlot($ydata); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/axislabelbkgex04.php b/#jpgraph/src/Examples/axislabelbkgex04.php deleted file mode 100644 index eb55a5ff..00000000 --- a/#jpgraph/src/Examples/axislabelbkgex04.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale('intlin'); -$graph->SetMargin(30,15,40,30); -$graph->SetMarginColor('white'); -$graph->SetFrame(true,'blue',3); - -$graph->title->Set('Label background'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->subtitle->SetColor('darkred'); -$graph->subtitle->Set('"LABELBKG_YAXISFULL"'); - -$graph->SetAxisLabelBackground(LABELBKG_YAXISFULL,'orange','red','lightblue','red'); - -// Use Ariel font -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new LinePlot($ydata); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/axislabelbkgex05.php b/#jpgraph/src/Examples/axislabelbkgex05.php deleted file mode 100644 index 29a04f07..00000000 --- a/#jpgraph/src/Examples/axislabelbkgex05.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale('intlin'); -$graph->SetMargin(30,15,40,30); -$graph->SetMarginColor('white'); -$graph->SetFrame(true,'blue',3); - -$graph->title->Set('Label background'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->subtitle->SetColor('darkred'); -$graph->subtitle->Set('"LABELBKG_XAXISFULL"'); - -$graph->SetAxisLabelBackground(LABELBKG_XAXISFULL,'orange','red','lightblue','red'); - -// Use Ariel font -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new LinePlot($ydata); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/axislabelbkgex06.php b/#jpgraph/src/Examples/axislabelbkgex06.php deleted file mode 100644 index 8ad0d812..00000000 --- a/#jpgraph/src/Examples/axislabelbkgex06.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale('intlin'); -$graph->SetMargin(30,15,40,30); -$graph->SetMarginColor('white'); -$graph->SetFrame(true,'blue',3); - -$graph->title->Set('Label background'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->subtitle->SetColor('darkred'); -$graph->subtitle->Set('"LABELBKG_XYFULL"'); - -$graph->SetAxisLabelBackground(LABELBKG_XYFULL,'orange','red','lightblue','red'); - -// Use Ariel font -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new LinePlot($ydata); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/axislabelbkgex07.php b/#jpgraph/src/Examples/axislabelbkgex07.php deleted file mode 100644 index c23d07fc..00000000 --- a/#jpgraph/src/Examples/axislabelbkgex07.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale('intlin'); -$graph->SetMargin(30,15,40,30); -$graph->SetMarginColor('white'); -$graph->SetFrame(true,'blue',3); - -$graph->title->Set('Label background'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->subtitle->SetColor('darkred'); -$graph->subtitle->Set('"LABELBKG_XY"'); - -$graph->SetAxisLabelBackground(LABELBKG_XY,'orange','red','lightblue','red'); - -// Use Ariel font -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new LinePlot($ydata); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/background_type_ex0.php b/#jpgraph/src/Examples/background_type_ex0.php deleted file mode 100644 index 1c4e7456..00000000 --- a/#jpgraph/src/Examples/background_type_ex0.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(40,40,50,50); - -// Setup the grid and plotarea box -$graph->ygrid->SetLineStyle('dashed'); -$graph->ygrid->setColor('darkgray'); -$graph->SetBox(true); - -// Steup graph titles -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->Set('Using background image'); -$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11); -$graph->subtitle->Set('"BGIMG_COPY"'); -$graph->subtitle->SetColor('darkred'); - -// Add background with 25% mix -$graph->SetBackgroundImage('heat1.jpg',BGIMG_COPY); -$graph->SetBackgroundImageMix(25); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor("blue"); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/background_type_ex1.php b/#jpgraph/src/Examples/background_type_ex1.php deleted file mode 100644 index cdd3cced..00000000 --- a/#jpgraph/src/Examples/background_type_ex1.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(40,40,50,50); - -// Setup the grid and plotarea box -$graph->ygrid->SetLineStyle('dashed'); -$graph->ygrid->setColor('darkgray'); -$graph->SetBox(true); - -// Steup graph titles -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->Set('Using background image'); -$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11); -$graph->subtitle->Set('"BGIMG_CENTER"'); -$graph->subtitle->SetColor('darkred'); - -// Add background with 25% mix -$graph->SetBackgroundImage('heat1.jpg',BGIMG_CENTER); -$graph->SetBackgroundImageMix(25); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor("blue"); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/background_type_ex2.php b/#jpgraph/src/Examples/background_type_ex2.php deleted file mode 100644 index 932f7a52..00000000 --- a/#jpgraph/src/Examples/background_type_ex2.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(40,40,50,50); - -// Setup the grid and plotarea box -$graph->ygrid->SetLineStyle('dashed'); -$graph->ygrid->setColor('darkgray'); -$graph->SetBox(true); - -// Steup graph titles -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->Set('Using background image'); -$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11); -$graph->subtitle->Set('"BGIMG_FREE"'); -$graph->subtitle->SetColor('darkred'); - -// Add background with 25% mix -$graph->SetBackgroundImage('heat1.jpg',BGIMG_FREE); -$graph->SetBackgroundImageMix(25); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor("blue"); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/background_type_ex3.php b/#jpgraph/src/Examples/background_type_ex3.php deleted file mode 100644 index 8b265c85..00000000 --- a/#jpgraph/src/Examples/background_type_ex3.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(40,40,50,50); - -// Setup the grid and plotarea box -$graph->ygrid->SetLineStyle('dashed'); -$graph->ygrid->setColor('darkgray'); -$graph->SetBox(true); - -// Steup graph titles -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->Set('Using background image'); -$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11); -$graph->subtitle->Set('"BGIMG_FILLPLOT"'); -$graph->subtitle->SetColor('darkred'); - -// Add background with 25% mix -$graph->SetBackgroundImage('heat1.jpg',BGIMG_FILLPLOT); -$graph->SetBackgroundImageMix(25); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor("blue"); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/background_type_ex4.php b/#jpgraph/src/Examples/background_type_ex4.php deleted file mode 100644 index 3ff1ceba..00000000 --- a/#jpgraph/src/Examples/background_type_ex4.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(40,40,50,50); - -// Setup the grid and plotarea box -$graph->ygrid->SetLineStyle('dashed'); -$graph->ygrid->setColor('darkgray'); -$graph->SetBox(true); - -// Steup graph titles -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->Set('Using background image'); -$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11); -$graph->subtitle->Set('"BGIMG_FILLFRAME"'); -$graph->subtitle->SetColor('darkred'); - -// Add background with 25% mix -$graph->SetBackgroundImage('heat1.jpg',BGIMG_FILLFRAME); -$graph->SetBackgroundImageMix(25); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor("blue"); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/backgroundex01.php b/#jpgraph/src/Examples/backgroundex01.php deleted file mode 100644 index fac8e937..00000000 --- a/#jpgraph/src/Examples/backgroundex01.php +++ /dev/null @@ -1,51 +0,0 @@ -img->SetMargin(40,180,40,40); -$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLPLOT); - -$graph->img->SetAntiAliasing("white"); -$graph->SetScale("textlin"); -$graph->SetShadow(); -$graph->title->Set("Background image"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Slightly adjust the legend from it's default position in the -// top right corner. -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Create the first line -$p1 = new LinePlot($datay); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$p1->SetColor("blue"); -$p1->SetCenter(); -$p1->SetLegend("Triumph Tiger -98"); -$graph->Add($p1); - -// ... and the second -$p2 = new LinePlot($data2y); -$p2->mark->SetType(MARK_STAR); -$p2->mark->SetFillColor("red"); -$p2->mark->SetWidth(4); -$p2->SetColor("red"); -$p2->SetCenter(); -$p2->SetLegend("New tiger -99"); -$graph->Add($p2); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/backgroundex02.php b/#jpgraph/src/Examples/backgroundex02.php deleted file mode 100644 index 542be5d1..00000000 --- a/#jpgraph/src/Examples/backgroundex02.php +++ /dev/null @@ -1,51 +0,0 @@ -img->SetMargin(40,180,40,40); -$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); - -$graph->img->SetAntiAliasing(); -$graph->SetScale("textlin"); -$graph->SetShadow(); -$graph->title->Set("Background image"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Slightly adjust the legend from it's default position in the -// top right corner. -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Create the first line -$p1 = new LinePlot($datay); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$p1->SetColor("blue"); -$p1->SetCenter(); -$p1->SetLegend("Triumph Tiger -98"); -$graph->Add($p1); - -// ... and the second -$p2 = new LinePlot($data2y); -$p2->mark->SetType(MARK_STAR); -$p2->mark->SetFillColor("red"); -$p2->mark->SetWidth(4); -$p2->SetColor("red"); -$p2->SetCenter(); -$p2->SetLegend("New tiger -99"); -$graph->Add($p2); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/backgroundex03.php b/#jpgraph/src/Examples/backgroundex03.php deleted file mode 100644 index a1c1337d..00000000 --- a/#jpgraph/src/Examples/backgroundex03.php +++ /dev/null @@ -1,51 +0,0 @@ -img->SetMargin(40,180,40,40); -$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_COPY); - -$graph->img->SetAntiAliasing("white"); -$graph->SetScale("textlin"); -$graph->SetShadow(); -$graph->title->Set("Background image"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Slightly adjust the legend from it's default position in the -// top right corner. -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Create the first line -$p1 = new LinePlot($datay); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$p1->SetColor("blue"); -$p1->SetCenter(); -$p1->SetLegend("Triumph Tiger -98"); -$graph->Add($p1); - -// ... and the second -$p2 = new LinePlot($data2y); -$p2->mark->SetType(MARK_STAR); -$p2->mark->SetFillColor("red"); -$p2->mark->SetWidth(4); -$p2->SetColor("red"); -$p2->SetCenter(); -$p2->SetLegend("New tiger -99"); -$graph->Add($p2); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/balloonex1.php b/#jpgraph/src/Examples/balloonex1.php deleted file mode 100644 index c963d76c..00000000 --- a/#jpgraph/src/Examples/balloonex1.php +++ /dev/null @@ -1,56 +0,0 @@ -SetScale("linlin"); -$graph->img->SetMargin(40,100,40,40); -$graph->SetShadow(); -$graph->title->Set("Example of ballon scatter plot"); -// Use a lot of grace to get large scales -$graph->yaxis->scale->SetGrace(50,10); - -// Make sure X-axis as at the bottom of the graph -$graph->xaxis->SetPos('min'); - -// Create the scatter plot -$sp1 = new ScatterPlot($datay,$datax); -$sp1->mark->SetType(MARK_FILLEDCIRCLE); - -// Uncomment the following two lines to display the values -$sp1->value->Show(); -$sp1->value->SetFont(FF_FONT1,FS_BOLD); - -// Specify the callback -$sp1->mark->SetCallback("FCallback"); - -// Setup the legend for plot -$sp1->SetLegend('Year 2002'); - -// Add the scatter plot to the graph -$graph->Add($sp1); - -// ... and send to browser -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/balloonex2.php b/#jpgraph/src/Examples/balloonex2.php deleted file mode 100644 index 257a6648..00000000 --- a/#jpgraph/src/Examples/balloonex2.php +++ /dev/null @@ -1,81 +0,0 @@ -SetScale("intlin"); -$graph->SetMargin(40,40,40,40); -$graph->SetMarginColor('wheat'); - -$graph->title->Set("Example of ballon scatter plot with X,Y callback"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->SetMargin(10); - -// Use a lot of grace to get large scales since the ballon have -// size and we don't want them to collide with the X-axis -$graph->yaxis->scale->SetGrace(50,10); -$graph->xaxis->scale->SetGrace(50,10); - -// Make sure X-axis as at the bottom of the graph and not at the default Y=0 -$graph->xaxis->SetPos('min'); - -// Set X-scale to start at 0 -$graph->xscale->SetAutoMin(0); - -// Create the scatter plot -$sp1 = new ScatterPlot($datay,$datax); -$sp1->mark->SetType(MARK_FILLEDCIRCLE); - -// Uncomment the following two lines to display the values -$sp1->value->Show(); -$sp1->value->SetFont(FF_FONT1,FS_BOLD); - -// Specify the callback -$sp1->mark->SetCallbackYX("FCallback"); - -// Add the scatter plot to the graph -$graph->Add($sp1); - -// ... and send to browser -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/bar2scalesex1.php b/#jpgraph/src/Examples/bar2scalesex1.php deleted file mode 100644 index 9248e7c1..00000000 --- a/#jpgraph/src/Examples/bar2scalesex1.php +++ /dev/null @@ -1,48 +0,0 @@ -title->Set('Example with 2 scale bars'); - -// Setup Y and Y2 scales with some "grace" -$graph->SetScale("textlin"); -$graph->SetY2Scale("lin"); -$graph->yaxis->scale->SetGrace(30); -$graph->y2axis->scale->SetGrace(30); - -//$graph->ygrid->Show(true,true); -$graph->ygrid->SetColor('gray','lightgray@0.5'); - -// Setup graph colors -$graph->SetMarginColor('white'); -$graph->y2axis->SetColor('darkred'); - - -// Create the "dummy" 0 bplot -$bplotzero = new BarPlot($datazero); - -// Create the "Y" axis group -$ybplot1 = new BarPlot($datay); -$ybplot1->value->Show(); -$ybplot = new GroupBarPlot(array($ybplot1,$bplotzero)); - -// Create the "Y2" axis group -$ybplot2 = new BarPlot($datay2); -$ybplot2->value->Show(); -$ybplot2->value->SetColor('darkred'); -$ybplot2->SetFillColor('darkred'); -$y2bplot = new GroupBarPlot(array($bplotzero,$ybplot2)); - -// Add the grouped bar plots to the graph -$graph->Add($ybplot); -$graph->AddY2($y2bplot); - -// .. and finally stroke the image back to browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bar_csimex1.php b/#jpgraph/src/Examples/bar_csimex1.php deleted file mode 100644 index 6ae7dbfe..00000000 --- a/#jpgraph/src/Examples/bar_csimex1.php +++ /dev/null @@ -1,52 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(60,30,20,40); -$graph->yaxis->SetTitleMargin(45); -$graph->yaxis->scale->SetGrace(30); -$graph->SetShadow(); - -// Turn the tickmarks -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Create targets for the image maps. One for each column -$targ=array("bar_clsmex1.php#1","bar_clsmex1.php#2","bar_clsmex1.php#3","bar_clsmex1.php#4","bar_clsmex1.php#5","bar_clsmex1.php#6"); -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); -$bplot->SetCSIMTargets($targ,$alts); -$bplot->SetFillColor("orange"); - -// Use a shadow on the bar graphs (just use the default settings) -$bplot->SetShadow(); -$bplot->value->SetFormat(" $ %2.1f",70); -$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9); -$bplot->value->SetColor("blue"); -$bplot->value->Show(); - -$graph->Add($bplot); - -$graph->title->Set("Image maps barex1"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Send back the HTML page which will call this script again -// to retrieve the image. -$graph->StrokeCSIM(); - - -?> diff --git a/#jpgraph/src/Examples/bar_csimex2.php b/#jpgraph/src/Examples/bar_csimex2.php deleted file mode 100644 index 5a0cbce8..00000000 --- a/#jpgraph/src/Examples/bar_csimex2.php +++ /dev/null @@ -1,51 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(40,30,20,40); -$graph->SetShadow(); - -// Create the bar plots -$b1plot = new BarPlot($data1y); -$b1plot->SetFillColor("orange"); -$targ=array("bar_clsmex2.php#1","bar_clsmex2.php#2","bar_clsmex2.php#3", -"bar_clsmex2.php#4","bar_clsmex2.php#5","bar_clsmex2.php#6"); -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); -$b1plot->SetCSIMTargets($targ,$alts); - -$b2plot = new BarPlot($data2y); -$b2plot->SetFillColor("blue"); -$targ=array("bar_clsmex2.php#7","bar_clsmex2.php#8","bar_clsmex2.php#9", -"bar_clsmex2.php#10","bar_clsmex2.php#11","bar_clsmex2.php#12"); -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); -$b2plot->SetCSIMTargets($targ,$alts); - -// Create the grouped bar plot -$abplot = new AccBarPlot(array($b1plot,$b2plot)); - -$abplot->SetShadow(); -$abplot->value->Show(); - -// ...and add it to the graPH -$graph->Add($abplot); - -$graph->title->Set("Image map barex2"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - - -// Send back the HTML page which will call this script again -// to retrieve the image. -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/bar_csimex3.php b/#jpgraph/src/Examples/bar_csimex3.php deleted file mode 100644 index 6640319d..00000000 --- a/#jpgraph/src/Examples/bar_csimex3.php +++ /dev/null @@ -1,88 +0,0 @@ -SetAngle(90); -$graph->SetScale("textlin"); - -// The negative margins are necessary since we -// have rotated the image 90 degress and shifted the -// meaning of width, and height. This means that the -// left and right margins now becomes top and bottom -// calculated with the image width and not the height. -$graph->img->SetMargin(-80,-80,210,210); - -$graph->SetMarginColor('white'); - -// Setup title for graph -$graph->title->Set('Horizontal bar graph'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->subtitle->Set("With image map\nNote: The URL just points back to this image"); - -// Setup X-axis. -$graph->xaxis->SetTitle("X-title",'center'); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetAngle(90); -$graph->xaxis->SetTitleMargin(30); -$graph->xaxis->SetLabelMargin(15); -$graph->xaxis->SetLabelAlign('right','center'); - -// Setup Y-axis - -// First we want it at the bottom, i.e. the 'max' value of the -// x-axis -$graph->yaxis->SetPos('max'); - -// Arrange the title -$graph->yaxis->SetTitle("Turnaround (mkr)",'center'); -$graph->yaxis->SetTitleSide(SIDE_RIGHT); -$graph->yaxis->title->SetFont(FF_FONT2,FS_BOLD); -$graph->yaxis->title->SetAngle(0); -$graph->yaxis->title->Align('center','top'); -$graph->yaxis->SetTitleMargin(30); - -// Arrange the labels -$graph->yaxis->SetLabelSide(SIDE_RIGHT); -$graph->yaxis->SetLabelAlign('center','top'); - -// Create the bar plots with image maps -$b1plot = new BarPlot($data1y); -$b1plot->SetFillColor("orange"); -$targ=array("bar_clsmex2.php#1","bar_clsmex2.php#2","bar_clsmex2.php#3", - "bar_clsmex2.php#4","bar_clsmex2.php#5","bar_clsmex2.php#6"); -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); -$b1plot->SetCSIMTargets($targ,$alts); - -$b2plot = new BarPlot($data2y); -$b2plot->SetFillColor("blue"); -$targ=array("bar_clsmex2.php#7","bar_clsmex2.php#8","bar_clsmex2.php#9", - "bar_clsmex2.php#10","bar_clsmex2.php#11","bar_clsmex2.php#12"); -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); -$b2plot->SetCSIMTargets($targ,$alts); - -// Create the accumulated bar plot -$abplot = new AccBarPlot(array($b1plot,$b2plot)); -$abplot->SetShadow(); - -// We want to display the value of each bar at the top -$abplot->value->Show(); -$abplot->value->SetFont(FF_FONT1,FS_NORMAL); -$abplot->value->SetAlign('left','center'); -$abplot->value->SetColor("black","darkred"); -$abplot->value->SetFormat('%.1f mkr'); - -// ...and add it to the graph -$graph->Add($abplot); - -// Send back the HTML page which will call this script again -// to retrieve the image. -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/barcode_errhandling_ex0.php b/#jpgraph/src/Examples/barcode_errhandling_ex0.php deleted file mode 100644 index 4f5b5393..00000000 --- a/#jpgraph/src/Examples/barcode_errhandling_ex0.php +++ /dev/null @@ -1,16 +0,0 @@ -Stroke('abc123'); -} catch( JpGraphException $e ) { - //echo 'Error: ' . $e->getMessage()."\n"; - JpGraphError::Raise($e->getMessage()); -} - -?> diff --git a/#jpgraph/src/Examples/barcode_ex0.php b/#jpgraph/src/Examples/barcode_ex0.php deleted file mode 100644 index 021b5c7c..00000000 --- a/#jpgraph/src/Examples/barcode_ex0.php +++ /dev/null @@ -1,11 +0,0 @@ -Stroke('ABC123'); - -?> diff --git a/#jpgraph/src/Examples/barcode_ex1.php b/#jpgraph/src/Examples/barcode_ex1.php deleted file mode 100644 index df7653b5..00000000 --- a/#jpgraph/src/Examples/barcode_ex1.php +++ /dev/null @@ -1,14 +0,0 @@ -SetModuleWidth(2); -$e->SetHeight(20); -echo nl2br($e->Stroke('3125134772')); - - -?> diff --git a/#jpgraph/src/Examples/barcode_ex2.php b/#jpgraph/src/Examples/barcode_ex2.php deleted file mode 100644 index 8fce58e6..00000000 --- a/#jpgraph/src/Examples/barcode_ex2.php +++ /dev/null @@ -1,14 +0,0 @@ -SetModuleWidth(2); -$e->SetHeight(70); -$ps = $e->Stroke('3125134772'); -echo nl2br(htmlspecialchars($ps)); - -?> diff --git a/#jpgraph/src/Examples/barcode_ex3.php b/#jpgraph/src/Examples/barcode_ex3.php deleted file mode 100644 index a63f4ad4..00000000 --- a/#jpgraph/src/Examples/barcode_ex3.php +++ /dev/null @@ -1,17 +0,0 @@ -"; -$encoder = BarcodeFactory::Create(ENCODING_CODEI25); -$e = BackendFactory::Create(BACKEND_PS,$encoder); -$e->SetModuleWidth(2); -$e->SetHeight(70); -$e->SetEPS(); -$ps = $e->Stroke('3125134772'); -echo nl2br(htmlspecialchars($ps)); - - -?> diff --git a/#jpgraph/src/Examples/barcode_ex4.php b/#jpgraph/src/Examples/barcode_ex4.php deleted file mode 100644 index 721b56ba..00000000 --- a/#jpgraph/src/Examples/barcode_ex4.php +++ /dev/null @@ -1,12 +0,0 @@ -SetModuleWidth(2); -$e->Stroke('1234'); - -?> diff --git a/#jpgraph/src/Examples/barcode_usps_example.php b/#jpgraph/src/Examples/barcode_usps_example.php deleted file mode 100644 index 80469bea..00000000 --- a/#jpgraph/src/Examples/barcode_usps_example.php +++ /dev/null @@ -1,74 +0,0 @@ -_USPS_chkd(substr($data,8)); - $data = '420'. $aZIP . '~191' . $aServiceType . $aDUNS . $aSeqNbr; - return $data . $cd; - } - - // Get type 2 of confirmation code (without ZIP) - function GetPIC($aServiceType,$aDUNS,$aSeqNbr) { - // Convert to USPS format with AI=91 - $data = '91' . $aServiceType . $aDUNS . $aSeqNbr; - $cd = $this->_USPS_chkd($data); - return $data . $cd; - } - -} - -$usps = new USPS_Confirmation(); -$zip = '92663'; -$service = '21'; -$DUNS = '805213907'; -$seqnr = '04508735'; -$data = $usps->GetPICwithZIP($zip,$service,$DUNS,$seqnr); -//$data = $usps->GetPIC('01','123456789','00000001'); - -$encoder = BarcodeFactory::Create(ENCODING_EAN128); -$e = BackendFactory::Create(BACKEND_IMAGE,$encoder); -$e->SetModuleWidth(2); -$e->SetFont(FF_ARIAL,FS_NORMAL,14); -$e->Stroke($data); - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/barcsim_details.php b/#jpgraph/src/Examples/barcsim_details.php deleted file mode 100644 index 68fb2166..00000000 --- a/#jpgraph/src/Examples/barcsim_details.php +++ /dev/null @@ -1,10 +0,0 @@ -'.basename(__FILE__).'.'; -} -else { - echo 'Some details on bar with id='.$_GET['id']; -} - -?> diff --git a/#jpgraph/src/Examples/barcsim_popup.php b/#jpgraph/src/Examples/barcsim_popup.php deleted file mode 100644 index 57864584..00000000 --- a/#jpgraph/src/Examples/barcsim_popup.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Create targets for the image maps so that the details are opened in a separate window -$fmtStr = "javascript:window.open('barcsim_details.php?id=%d','_new','width=500,height=300');void(0)"; -$n = count($datay); -$targ=array(); -$alts=array(); -for($i=0; $i < $n; ++$i) { - $targ[$i] = sprintf($fmtStr,$i+1); - $alts[$i] = 'val=%d'; - // Note: The format placeholder val=%d will be replaced by the actual value in the ouput HTML by the - // library so that when the user hoovers the mouse over the bar the actual numerical value of the bar - // will be dísplayed -} -$bplot->SetCSIMTargets($targ,$alts); - -// Add plot to graph -$graph->Add($bplot); - -// Setup the title, also wih a CSIM area -$graph->title->Set("CSIM with popup windows"); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -// Assume we can give more details on the graph -$graph->title->SetCSIMTarget(sprintf($fmtStr,-1),'Title for Bar'); - -// Send back the HTML page which will call this script again to retrieve the image. -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/barformatcallbackex1.php b/#jpgraph/src/Examples/barformatcallbackex1.php deleted file mode 100644 index f49a9e28..00000000 --- a/#jpgraph/src/Examples/barformatcallbackex1.php +++ /dev/null @@ -1,30 +0,0 @@ -SetScale("textlin"); - -// Create a bar plots -$bar1 = new BarPlot($data); - -// Setup the callback function -$bar1->value->SetFormatCallback("cbFmtPercentage"); -$bar1->value->Show(); - -// Add the plot to the graph -$graph->Add($bar1); - -// .. and send the graph back to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradex1.php b/#jpgraph/src/Examples/bargradex1.php deleted file mode 100644 index e325223f..00000000 --- a/#jpgraph/src/Examples/bargradex1.php +++ /dev/null @@ -1,47 +0,0 @@ -img->SetMargin(60,20,35,75); -$graph->SetScale("textlin"); -$graph->SetMarginColor("lightblue:1.1"); -$graph->SetShadow(); - -// Set up the title for the graph -$graph->title->Set("Bar gradient with left reflection"); -$graph->title->SetMargin(8); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor("darkred"); - -// Setup font for axis -$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); -$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10); - -// Show 0 label on Y-axis (default is not to show) -$graph->yscale->ticks->SupressZeroLabel(false); - -// Setup X-axis labels -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetLabelAngle(50); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy:0.9","navy:1.85",GRAD_LEFT_REFLECTION); - -// Set color for the frame of each bar -$bplot->SetColor("white"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradex2.php b/#jpgraph/src/Examples/bargradex2.php deleted file mode 100644 index 02da925d..00000000 --- a/#jpgraph/src/Examples/bargradex2.php +++ /dev/null @@ -1,48 +0,0 @@ -img->SetMargin(60,20,30,50); -$graph->SetScale("textlin"); -$graph->SetMarginColor("silver"); -$graph->SetShadow(); - -// Set up the title for the graph -$graph->title->Set("Example negative bars"); -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,18); -$graph->title->SetColor("darkred"); - -// Setup font for axis -$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,12); -$graph->xaxis->SetColor("black","red"); -$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,11); - -// Show 0 label on Y-axis (default is not to show) -$graph->yscale->ticks->SupressZeroLabel(false); - -// Setup X-axis labels -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetLabelAngle(50); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy","steelblue",GRAD_MIDVER); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradex3.php b/#jpgraph/src/Examples/bargradex3.php deleted file mode 100644 index 8a3f99d5..00000000 --- a/#jpgraph/src/Examples/bargradex3.php +++ /dev/null @@ -1,50 +0,0 @@ -img->SetMargin(60,20,30,50); -$graph->SetScale("textlin"); -$graph->SetMarginColor("silver"); -$graph->SetShadow(); - -// Set up the title for the graph -$graph->title->Set("Example negative bars"); -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,16); -$graph->title->SetColor("darkred"); - -// Setup font for axis -$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); -$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10); - -// Show 0 label on Y-axis (default is not to show) -$graph->yscale->ticks->SupressZeroLabel(false); - -// Setup X-axis labels -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetLabelAngle(50); - -// Set X-axis at the minimum value of Y-axis (default will be at 0) -$graph->xaxis->SetPos("min"); // "min" will position the x-axis at the minimum value of the Y-axis - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy","steelblue",GRAD_MIDVER); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradex4.php b/#jpgraph/src/Examples/bargradex4.php deleted file mode 100644 index 7de203ab..00000000 --- a/#jpgraph/src/Examples/bargradex4.php +++ /dev/null @@ -1,47 +0,0 @@ -img->SetMargin(60,30,30,40); -$graph->SetScale("textlin"); -$graph->SetMarginColor("teal"); -$graph->SetShadow(); - -// Set up the title for the graph -$graph->title->Set("Bargraph with small variations"); -$graph->title->SetColor("white"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); - -// Setup color for axis and labels -$graph->xaxis->SetColor("black","white"); -$graph->yaxis->SetColor("black","white"); - -// Setup font for axis -$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); -$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10); - -// Setup X-axis title (color & font) -$graph->xaxis->title->Set("X-axis"); -$graph->xaxis->title->SetColor("white"); -$graph->xaxis->title->SetFont(FF_VERDANA,FS_BOLD,10); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$tcol=array(100,100,255); -$fcol=array(255,100,100); -$bplot->SetFillGradient($fcol,$tcol,GRAD_HOR); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradex5.php b/#jpgraph/src/Examples/bargradex5.php deleted file mode 100644 index e0122925..00000000 --- a/#jpgraph/src/Examples/bargradex5.php +++ /dev/null @@ -1,52 +0,0 @@ -img->SetMargin(60,30,30,40); -$graph->SetScale("textlin"); -$graph->SetMarginColor("teal"); -$graph->SetShadow(); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// This is how you make the bar graph start from something other than 0 -$bplot->SetYMin(0.302); - -// Setup color for gradient fill style -$tcol=array(100,100,255); -$fcol=array(255,100,100); -$bplot->SetFillGradient($fcol,$tcol,GRAD_HOR); -$bplot->SetFillColor("orange"); -$graph->Add($bplot); - -// Set up the title for the graph -$graph->title->Set("Bargraph which doesn't start from y=0"); -$graph->title->SetColor("yellow"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); - -// Setup color for axis and labels -$graph->xaxis->SetColor("black","white"); -$graph->yaxis->SetColor("black","white"); - -// Setup font for axis -$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); -$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10); - -// Setup X-axis title (color & font) -$graph->xaxis->title->Set("X-axis"); -$graph->xaxis->title->SetColor("white"); -$graph->xaxis->title->SetFont(FF_VERDANA,FS_BOLD,10); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradex6.php b/#jpgraph/src/Examples/bargradex6.php deleted file mode 100644 index 43bf9664..00000000 --- a/#jpgraph/src/Examples/bargradex6.php +++ /dev/null @@ -1,51 +0,0 @@ -img->SetMargin(60,150,30,50); -$graph->SetScale("textlin"); -$graph->SetMarginColor("silver"); -$graph->SetShadow(); - -// Set up the title for the graph -$graph->title->Set("Example negative bars"); -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,16); -$graph->title->SetColor("darkred"); - -// Setup font for axis -$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); -$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10); - -// Show 0 label on Y-axis (default is not to show) -$graph->yscale->ticks->SupressZeroLabel(false); - -// Setup X-axis labels -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetLabelAngle(50); - -// Set X-axis at the minimum value of Y-axis (default will be at 0) -$graph->xaxis->SetPos("min"); // "min" will position the x-axis at the minimum value of the Y-axis - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); -$bplot->SetLegend("Result 1999","blue"); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy","steelblue",GRAD_MIDVER); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradsmallex1.php b/#jpgraph/src/Examples/bargradsmallex1.php deleted file mode 100644 index 83908a97..00000000 --- a/#jpgraph/src/Examples/bargradsmallex1.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(25,15,25,25); - -$graph->title->Set('"GRAD_MIDVER"'); -$graph->title->SetColor('darkred'); - -// Setup font for axis -$graph->xaxis->SetFont(FF_FONT1); -$graph->yaxis->SetFont(FF_FONT1); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy","lightsteelblue",GRAD_MIDVER); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradsmallex2.php b/#jpgraph/src/Examples/bargradsmallex2.php deleted file mode 100644 index 1aa1037a..00000000 --- a/#jpgraph/src/Examples/bargradsmallex2.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(25,15,25,25); - -$graph->title->Set('"GRAD_MIDHOR"'); -$graph->title->SetColor('darkred'); - -// Setup font for axis -$graph->xaxis->SetFont(FF_FONT1); -$graph->yaxis->SetFont(FF_FONT1); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy","lightsteelblue",GRAD_MIDHOR); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradsmallex3.php b/#jpgraph/src/Examples/bargradsmallex3.php deleted file mode 100644 index c5d31c13..00000000 --- a/#jpgraph/src/Examples/bargradsmallex3.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(25,15,25,25); - -$graph->title->Set('"GRAD_HOR"'); -$graph->title->SetColor('darkred'); - -// Setup font for axis -$graph->xaxis->SetFont(FF_FONT1); -$graph->yaxis->SetFont(FF_FONT1); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy","lightsteelblue",GRAD_HOR); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradsmallex4.php b/#jpgraph/src/Examples/bargradsmallex4.php deleted file mode 100644 index 030942d5..00000000 --- a/#jpgraph/src/Examples/bargradsmallex4.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(25,15,25,25); - -$graph->title->Set('"GRAD_VER"'); -$graph->title->SetColor('darkred'); - -// Setup font for axis -$graph->xaxis->SetFont(FF_FONT1); -$graph->yaxis->SetFont(FF_FONT1); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy","lightsteelblue",GRAD_VER); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradsmallex5.php b/#jpgraph/src/Examples/bargradsmallex5.php deleted file mode 100644 index 8028269f..00000000 --- a/#jpgraph/src/Examples/bargradsmallex5.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(25,15,25,25); - -$graph->title->Set('"GRAD_WIDE_MIDVER"'); -$graph->title->SetColor('darkred'); - -// Setup font for axis -$graph->xaxis->SetFont(FF_FONT1); -$graph->yaxis->SetFont(FF_FONT1); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy","lightsteelblue",GRAD_WIDE_MIDVER); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradsmallex6.php b/#jpgraph/src/Examples/bargradsmallex6.php deleted file mode 100644 index 9b1e45b8..00000000 --- a/#jpgraph/src/Examples/bargradsmallex6.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(25,15,25,25); - -$graph->title->Set('"GRAD_WIDE_MIDHOR"'); -$graph->title->SetColor('darkred'); - -// Setup font for axis -$graph->xaxis->SetFont(FF_FONT1); -$graph->yaxis->SetFont(FF_FONT1); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy","lightsteelblue",GRAD_WIDE_MIDHOR); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradsmallex7.php b/#jpgraph/src/Examples/bargradsmallex7.php deleted file mode 100644 index 5f011aa9..00000000 --- a/#jpgraph/src/Examples/bargradsmallex7.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(25,15,25,25); - -$graph->title->Set('"GRAD_CENTER"'); -$graph->title->SetColor('darkred'); - -// Setup font for axis -$graph->xaxis->SetFont(FF_FONT1); -$graph->yaxis->SetFont(FF_FONT1); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient("navy","lightsteelblue",GRAD_CENTER); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bargradsmallex8.php b/#jpgraph/src/Examples/bargradsmallex8.php deleted file mode 100644 index f95cb49a..00000000 --- a/#jpgraph/src/Examples/bargradsmallex8.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(25,15,25,25); - -$graph->title->Set('"GRAD_RAISED_PANEL"'); -$graph->title->SetColor('darkred'); - -// Setup font for axis -$graph->xaxis->SetFont(FF_FONT1); -$graph->yaxis->SetFont(FF_FONT1); - -// Create the bar pot -$bplot = new BarPlot($datay); -$bplot->SetWidth(0.6); - -// Setup color for gradient fill style -$bplot->SetFillGradient('navy','orange',GRAD_RAISED_PANEL); - -// Set color for the frame of each bar -$bplot->SetColor("navy"); -$graph->Add($bplot); - -// Finally send the graph to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/barimgex1.php b/#jpgraph/src/Examples/barimgex1.php deleted file mode 100644 index 76aee8f9..00000000 --- a/#jpgraph/src/Examples/barimgex1.php +++ /dev/null @@ -1,29 +0,0 @@ -SetScale("textlin"); - -$graph->title->Set('Images on top of bars'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,13); - -$graph->SetTitleBackground('lightblue:1.1',TITLEBKG_STYLE1,TITLEBKG_FRAME_BEVEL); - -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); -$bplot->SetWidth(0.5); - -$lplot = new LinePlot($datay); -$lplot->SetColor('white@1'); -$lplot->SetBarCenter(); -$lplot->mark->SetType(MARK_IMG_LBALL,'red'); - -$graph->Add($bplot); -$graph->Add($lplot); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/barintex1.php b/#jpgraph/src/Examples/barintex1.php deleted file mode 100644 index 9ba063d5..00000000 --- a/#jpgraph/src/Examples/barintex1.php +++ /dev/null @@ -1,48 +0,0 @@ -img->SetMargin(40,30,30,40); -$graph->SetScale("textint"); -$graph->SetShadow(); -$graph->SetFrame(false); // No border around the graph - -// Add some grace to the top so that the scale doesn't -// end exactly at the max value. -$graph->yaxis->scale->SetGrace(100); - -// Setup X-axis labels -$a = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(FF_FONT2); - -// Setup graph title ands fonts -$graph->title->Set("Example of integer Y-scale"); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->xaxis->title->Set("Year 2002"); -$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); -$bplot->SetWidth(0.5); -$bplot->SetShadow(); - -// Setup the values that are displayed on top of each bar -$bplot->value->Show(); -// Must use TTF fonts if we want text at an arbitrary angle -$bplot->value->SetFont(FF_ARIAL,FS_BOLD); -$bplot->value->SetAngle(45); -// Black color for positive values and darkred for negative values -$bplot->value->SetColor("black","darkred"); -$graph->Add($bplot); - -// Finally stroke the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/barintex2.php b/#jpgraph/src/Examples/barintex2.php deleted file mode 100644 index 59f3b73b..00000000 --- a/#jpgraph/src/Examples/barintex2.php +++ /dev/null @@ -1,57 +0,0 @@ -img->SetMargin(40,30,40,40); -$graph->SetScale("textint"); -$graph->SetFrame(true,'blue',1); -$graph->SetColor('lightblue'); -$graph->SetMarginColor('lightblue'); - -// Add some grace to the top so that the scale doesn't -// end exactly at the max value. -//$graph->yaxis->scale->SetGrace(20); - -// Setup X-axis labels -$a = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(FF_FONT1); -$graph->xaxis->SetColor('darkblue','black'); - -// Stup "hidden" y-axis by given it the same color -// as the background -$graph->yaxis->SetColor('lightblue','darkblue'); -$graph->ygrid->SetColor('white'); - -// Setup graph title ands fonts -$graph->title->Set('Example of integer Y-scale'); -$graph->subtitle->Set('(With "hidden" y-axis)'); - -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->xaxis->title->Set("Year 2002"); -$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor('darkblue'); -$bplot->SetColor('darkblue'); -$bplot->SetWidth(0.5); -$bplot->SetShadow('darkgray'); - -// Setup the values that are displayed on top of each bar -$bplot->value->Show(); -// Must use TTF fonts if we want text at an arbitrary angle -$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8); -$bplot->value->SetFormat('$%d'); -// Black color for positive values and darkred for negative values -$bplot->value->SetColor("black","darkred"); -$graph->Add($bplot); - -// Finally stroke the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/barline_csimex1.php b/#jpgraph/src/Examples/barline_csimex1.php deleted file mode 100644 index 1ab37ec5..00000000 --- a/#jpgraph/src/Examples/barline_csimex1.php +++ /dev/null @@ -1,42 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(40,20,30,40); -$graph->title->Set("CSIM example with bar and line"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Setup axis titles -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->mark->SetType(MARK_FILLEDCIRCLE); -$lineplot->mark->SetWidth(5); -$lineplot->mark->SetColor('black'); -$lineplot->mark->SetFillColor('red'); -$lineplot->SetCSIMTargets($targ,$alt); - -// Create line plot -$barplot=new barPlot($ydata2); -$barplot->SetCSIMTargets($targ,$alt); - -// Add the plots to the graph -$graph->Add($lineplot); -$graph->Add($barplot); - -$graph->StrokeCSIM(); - -?> - - diff --git a/#jpgraph/src/Examples/barlinealphaex1.php b/#jpgraph/src/Examples/barlinealphaex1.php deleted file mode 100644 index 95c8b98e..00000000 --- a/#jpgraph/src/Examples/barlinealphaex1.php +++ /dev/null @@ -1,74 +0,0 @@ -GetShortMonth(); - -// Create the graph. -$graph = new Graph(300,200); -$graph->SetScale("textlin"); -$graph->SetMarginColor('white'); - -// Adjust the margin slightly so that we use the -// entire area (since we don't use a frame) -$graph->SetMargin(30,1,20,5); - -// Box around plotarea -$graph->SetBox(); - -// No frame around the image -$graph->SetFrame(false); - -// Setup the tab title -$graph->tabtitle->Set('Year 2003'); -$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,10); - -// Setup the X and Y grid -$graph->ygrid->SetFill(true,'#DDDDDD@0.5','#BBBBBB@0.5'); -$graph->ygrid->SetLineStyle('dashed'); -$graph->ygrid->SetColor('gray'); -$graph->xgrid->Show(); -$graph->xgrid->SetLineStyle('dashed'); -$graph->xgrid->SetColor('gray'); - -// Setup month as labels on the X-axis -$graph->xaxis->SetTickLabels($months); -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8); -$graph->xaxis->SetLabelAngle(45); - -// Create a bar pot -$bplot = new BarPlot($ydata); -$bplot->SetWidth(0.6); -$fcol='#440000'; -$tcol='#FF9090'; - -$bplot->SetFillGradient($fcol,$tcol,GRAD_LEFT_REFLECTION); - -// Set line weigth to 0 so that there are no border -// around each bar -$bplot->SetWeight(0); - -$graph->Add($bplot); - -// Create filled line plot -$lplot = new LinePlot($ydata2); -$lplot->SetFillColor('skyblue@0.5'); -$lplot->SetColor('navy@0.7'); -$lplot->SetBarCenter(); - -$lplot->mark->SetType(MARK_SQUARE); -$lplot->mark->SetColor('blue@0.5'); -$lplot->mark->SetFillColor('lightblue'); -$lplot->mark->SetSize(6); - -$graph->Add($lplot); - -// .. and finally send it back to the browser -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/barlinefreq_csimex1.php b/#jpgraph/src/Examples/barlinefreq_csimex1.php deleted file mode 100644 index 00c5977d..00000000 --- a/#jpgraph/src/Examples/barlinefreq_csimex1.php +++ /dev/null @@ -1,100 +0,0 @@ -CheckCSIMCache('auto'); - -// Setup some basic graph parameters -$graph->SetScale("textlin"); -$graph->SetY2Scale('lin',0,100); -$graph->img->SetMargin(50,70,30,40); -$graph->yaxis->SetTitleMargin(30); -$graph->SetMarginColor('#EEEEEE'); - -// Setup titles and fonts -$graph->title->Set("Frequence plot"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Turn the tickmarks -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -$graph->y2axis->SetTickSide(SIDE_RIGHT); -$graph->y2axis->SetColor('black','blue'); -$graph->y2axis->SetLabelFormat('%3d.0%%'); - -// Create a bar pot -$bplot = new BarPlot($data_freq); - -// Create targets and alt texts for the image maps. One for each bar -// (In this example this is just "dummy" targets) -$targ=array("#1","#2","#3","#4","#5","#6","#7"); -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); -$bplot->SetCSIMTargets($targ,$alts); - - -// Create accumulative graph -$lplot = new LinePlot($data_accfreq); - -// We want the line plot data point in the middle of the bars -$lplot->SetBarCenter(); - -// Use transperancy -$lplot->SetFillColor('lightblue@0.6'); -$lplot->SetColor('blue@0.6'); -//$lplot->SetColor('blue'); -$graph->AddY2($lplot); - - -// Setup the bars -$bplot->SetFillColor("orange@0.2"); -$bplot->SetValuePos('center'); -$bplot->value->SetFormat("%d"); -$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9); -$bplot->value->Show(); - -// Add it to the graph -$graph->Add($bplot); - -// Send back the HTML page which will call this script again -// to retrieve the image. -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/barlinefreqex1.php b/#jpgraph/src/Examples/barlinefreqex1.php deleted file mode 100644 index c5966bba..00000000 --- a/#jpgraph/src/Examples/barlinefreqex1.php +++ /dev/null @@ -1,83 +0,0 @@ -SetScale("textlin"); -$graph->SetY2Scale('lin',0,100); -$graph->img->SetMargin(50,70,30,40); -$graph->yaxis->SetTitleMargin(30); -$graph->SetMarginColor('#EEEEEE'); - -// Setup titles and fonts -$graph->title->Set("Frequence plot"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Turn the tickmarks -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -$graph->y2axis->SetTickSide(SIDE_RIGHT); -$graph->y2axis->SetColor('black','blue'); -$graph->y2axis->SetLabelFormat('%3d.0%%'); - -// Create a bar pot -$bplot = new BarPlot($data_freq); - -// Create accumulative graph -$lplot = new LinePlot($data_accfreq); - -// We want the line plot data point in the middle of the bars -$lplot->SetBarCenter(); - -// Use transperancy -$lplot->SetFillColor('lightblue@0.6'); -$lplot->SetColor('blue@0.6'); -$graph->AddY2($lplot); - -// Setup the bars -$bplot->SetFillColor("orange@0.2"); -$bplot->SetValuePos('center'); -$bplot->value->SetFormat("%d"); -$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9); -$bplot->value->Show(); - -// Add it to the graph -$graph->Add($bplot); - -// Send back the HTML page which will call this script again -// to retrieve the image. -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/barpatternex1.php b/#jpgraph/src/Examples/barpatternex1.php deleted file mode 100644 index f0be38e1..00000000 --- a/#jpgraph/src/Examples/barpatternex1.php +++ /dev/null @@ -1,33 +0,0 @@ -SetScale("textlin"); - -$graph->SetMarginColor('navy:1.9'); -$graph->SetBox(); - -$graph->title->Set('Bar Pattern'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,20); - -$graph->SetTitleBackground('lightblue:1.3',TITLEBKG_STYLE2,TITLEBKG_FRAME_BEVEL); -$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'lightblue','blue'); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor('darkorange'); -$bplot->SetWidth(0.6); - -$bplot->SetPattern(PATTERN_CROSS1,'navy'); - -$graph->Add($bplot); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/barscalecallbackex1.php b/#jpgraph/src/Examples/barscalecallbackex1.php deleted file mode 100644 index 7e73f201..00000000 --- a/#jpgraph/src/Examples/barscalecallbackex1.php +++ /dev/null @@ -1,63 +0,0 @@ -img->SetMargin(80,30,30,40); -$graph->SetScale('textint'); -$graph->SetShadow(); -$graph->SetFrame(false); // No border around the graph - -// Add some grace to the top so that the scale doesn't -// end exactly at the max value. -// The grace value is the percetage of additional scale -// value we add. Specifying 50 means that we add 50% of the -// max value -$graph->yaxis->scale->SetGrace(50); -$graph->yaxis->SetLabelFormatCallback('separator1000'); - -// Setup X-axis labels -$a = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(FF_FONT2); - -// Setup graph title ands fonts -$graph->title->Set('Example of Y-scale callback formatting'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor('orange'); -$bplot->SetWidth(0.5); -$bplot->SetShadow(); - -// Setup the values that are displayed on top of each bar -$bplot->value->Show(); - -// Must use TTF fonts if we want text at an arbitrary angle -$bplot->value->SetFont(FF_ARIAL,FS_BOLD); -$bplot->value->SetAngle(45); -$bplot->value->SetFormatCallback('separator1000_usd'); - -// Black color for positive values and darkred for negative values -$bplot->value->SetColor('black','darkred'); -$graph->Add($bplot); - -// Finally stroke the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/bartutex1.php b/#jpgraph/src/Examples/bartutex1.php deleted file mode 100644 index 0c0f9c51..00000000 --- a/#jpgraph/src/Examples/bartutex1.php +++ /dev/null @@ -1,35 +0,0 @@ -SetShadow(); - -// Use a "text" X-scale -$graph->SetScale("textlin"); - -// Set title and subtitle -$graph->title->Set("Elementary barplot with a text scale"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend("Temperature"); -//$b1->SetAbsWidth(6); -//$b1->SetShadow(); - -// The order the plots are added determines who's ontop -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/bartutex12.php b/#jpgraph/src/Examples/bartutex12.php deleted file mode 100644 index 6f97c5c6..00000000 --- a/#jpgraph/src/Examples/bartutex12.php +++ /dev/null @@ -1,90 +0,0 @@ -SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); -$graph->SetShadow(); - -// Use text X-scale so we can text labels on the X-axis -$graph->SetScale("textlin"); - -// Y2-axis is linear -$graph->SetY2Scale("lin"); - -// Color the two Y-axis to make them easier to associate -// to the corresponding plot (we keep the axis black though) -$graph->yaxis->SetColor("black","red"); -$graph->y2axis->SetColor("black","orange"); - -// Set title and subtitle -$graph->title->Set("Combined bar and line plot"); -$graph->subtitle->Set("100 data points, X-Scale: 'text'"); - -// Use built in font (don't need TTF support) -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Make the margin around the plot a little bit bigger then default -$graph->img->SetMargin(40,140,40,80); - -// Slightly adjust the legend from it's default position in the -// top right corner to middle right side -$graph->legend->Pos(0.03,0.5,"right","center"); - -// Display every 6:th tickmark -$graph->xaxis->SetTextTickInterval(6); - -// Label every 2:nd tick mark -$graph->xaxis->SetTextLabelInterval(2); - -// Setup the labels -$graph->xaxis->SetTickLabels($databarx); -$graph->xaxis->SetLabelAngle(90); - -// Create a red line plot -$p1 = new LinePlot($datay); -$p1->SetColor("red"); -$p1->SetLegend("Pressure"); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend("Temperature"); -$b1->SetFillColor("orange"); -$b1->SetAbsWidth(8); - -// Drop shadow on bars adjust the default values a little bit -$b1->SetShadow("steelblue",2,2); - -// The order the plots are added determines who's ontop -$graph->Add($p1); -$graph->AddY2($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/bartutex2.php b/#jpgraph/src/Examples/bartutex2.php deleted file mode 100644 index a911c337..00000000 --- a/#jpgraph/src/Examples/bartutex2.php +++ /dev/null @@ -1,40 +0,0 @@ -GetShortMonth(); - -// New graph with a drop shadow -$graph = new Graph(300,200,'auto'); -$graph->SetShadow(); - -// Use a "text" X-scale -$graph->SetScale("textlin"); - -// Specify X-labels -$graph->xaxis->SetTickLabels($months); - -// Set title and subtitle -$graph->title->Set("Textscale with specified labels"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend("Temperature"); - -//$b1->SetAbsWidth(6); -//$b1->SetShadow(); - -// The order the plots are added determines who's ontop -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/bartutex3.php b/#jpgraph/src/Examples/bartutex3.php deleted file mode 100644 index addb91c4..00000000 --- a/#jpgraph/src/Examples/bartutex3.php +++ /dev/null @@ -1,44 +0,0 @@ -GetShortMonth(); - -srand ((double) microtime() * 1000000); -for( $i=0; $i<25; ++$i) { - $databary[]=rand(1,50); - $databarx[]=$months[$i%12]; -} - -// New graph with a drop shadow -$graph = new Graph(300,200,'auto'); -$graph->SetShadow(); - -// Use a "text" X-scale -$graph->SetScale("textlin"); - -// Specify X-labels -$graph->xaxis->SetTickLabels($databarx); - -// Set title and subtitle -$graph->title->Set("Bar tutorial example 3"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend("Temperature"); -//$b1->SetAbsWidth(6); -//$b1->SetShadow(); - -// The order the plots are added determines who's ontop -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/bartutex4.php b/#jpgraph/src/Examples/bartutex4.php deleted file mode 100644 index dffe16ab..00000000 --- a/#jpgraph/src/Examples/bartutex4.php +++ /dev/null @@ -1,47 +0,0 @@ -GetShortMonth(); - -srand ((double) microtime() * 1000000); -for( $i=0; $i<25; ++$i) { - $databary[]=rand(1,50); - $databarx[]=$months[$i%12]; -} - -// New graph with a drop shadow -$graph = new Graph(300,200,'auto'); -$graph->SetShadow(); - -// Use a "text" X-scale -$graph->SetScale("textlin"); - -// Specify X-labels -//$databarx = array('tXi','','','xxx','','','iXii','','','OOO','','','tOO'); -$graph->xaxis->SetFont(FF_FONT1,FS_NORMAL); -$graph->xaxis->SetTickLabels($databarx); -$graph->xaxis->SetTextLabelInterval(3); - -// Set title and subtitle -$graph->title->Set("Displaying only every third label"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend("Temperature"); -//$b1->SetAbsWidth(6); -//$b1->SetShadow(); - -// The order the plots are added determines who's ontop -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/bartutex5.php b/#jpgraph/src/Examples/bartutex5.php deleted file mode 100644 index e41a47b5..00000000 --- a/#jpgraph/src/Examples/bartutex5.php +++ /dev/null @@ -1,45 +0,0 @@ -GetShortMonth(); - -srand ((double) microtime() * 1000000); -for( $i=0; $i<25; ++$i) { - $databary[]=rand(1,50); - $databarx[]=$months[$i%12]; -} - -// New graph with a drop shadow -$graph = new Graph(300,200,'auto'); -$graph->SetShadow(); - -// Use a "text" X-scale -$graph->SetScale("textlin"); - -// Specify X-labels -$graph->xaxis->SetTickLabels($databarx); -$graph->xaxis->SetTextLabelInterval(1); -$graph->xaxis->SetTextTickInterval(3); - -// Set title and subtitle -$graph->title->Set("Bar tutorial example 5"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend("Temperature"); -$b1->SetWidth(0.4); - -// The order the plots are added determines who's ontop -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/bartutex6.php b/#jpgraph/src/Examples/bartutex6.php deleted file mode 100644 index 13b0557f..00000000 --- a/#jpgraph/src/Examples/bartutex6.php +++ /dev/null @@ -1,47 +0,0 @@ -GetShortMonth(); -srand ((double) microtime() * 1000000); -for( $i=0; $i<25; ++$i) { - $databary[]=rand(1,50); - $databarx[]=$months[$i%12]; -} - -// New graph with a drop shadow -$graph = new Graph(300,200,'auto'); -$graph->SetShadow(); - -// Use a "text" X-scale -$graph->SetScale("textlin"); - -// Specify X-labels -$graph->xaxis->SetTickLabels($databarx); -$graph->xaxis->SetTextLabelInterval(3); - -// Hide the tick marks -$graph->xaxis->HideTicks(); - -// Set title and subtitle -$graph->title->Set("Bar tutorial example 6"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend("Temperature"); -$b1->SetWidth(0.4); - - -// The order the plots are added determines who's ontop -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/basic_contourex01.php b/#jpgraph/src/Examples/basic_contourex01.php deleted file mode 100644 index 75d765a9..00000000 --- a/#jpgraph/src/Examples/basic_contourex01.php +++ /dev/null @@ -1,40 +0,0 @@ -SetScale('intint'); - -// Adjust the margins to fit the margin -$graph->SetMargin(30,100,40,30); - -// Setup -$graph->title->Set('Basic contour plot'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// A simple contour plot with default arguments (e.g. 10 isobar lines) -$cp = new ContourPlot($data); - -// Display the legend -$cp->ShowLegend(); - -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/basic_contourex02.php b/#jpgraph/src/Examples/basic_contourex02.php deleted file mode 100644 index f63a650d..00000000 --- a/#jpgraph/src/Examples/basic_contourex02.php +++ /dev/null @@ -1,43 +0,0 @@ -SetScale('intint'); - -// Show axis on all sides -$graph->SetAxisStyle(AXSTYLE_BOXOUT); - -// Adjust the margins to fit the margin -$graph->SetMargin(30,100,40,30); - -// Setup -$graph->title->Set('Basic contour plot with multiple axis'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// A simple contour plot with default arguments (e.g. 10 isobar lines) -$cp = new ContourPlot($data); - -// Display the legend -$cp->ShowLegend(); - -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/basic_contourex03-1.php b/#jpgraph/src/Examples/basic_contourex03-1.php deleted file mode 100644 index 26a01de6..00000000 --- a/#jpgraph/src/Examples/basic_contourex03-1.php +++ /dev/null @@ -1,40 +0,0 @@ -SetScale('intint'); - -// Show axis on all sides -$graph->SetAxisStyle(AXSTYLE_BOXOUT); - -// Adjust the margins to fit the margin -$graph->SetMargin(30,100,40,30); - -// Setup -$graph->title->Set('Basic contour plot with multiple axis'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// A simple contour plot with default arguments (e.g. 10 isobar lines) -$cp = new ContourPlot($data,10,1); - -// Display the legend -$cp->ShowLegend(); - -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/basic_contourex03-2.php b/#jpgraph/src/Examples/basic_contourex03-2.php deleted file mode 100644 index 02b9376c..00000000 --- a/#jpgraph/src/Examples/basic_contourex03-2.php +++ /dev/null @@ -1,40 +0,0 @@ -SetScale('intint'); - -// Show axis on all sides -$graph->SetAxisStyle(AXSTYLE_BOXOUT); - -// Adjust the margins to fit the margin -$graph->SetMargin(30,100,40,30); - -// Setup -$graph->title->Set('Basic contour plot with multiple axis'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// A simple contour plot with default arguments (e.g. 10 isobar lines) -$cp = new ContourPlot($data,10,2); - -// Display the legend -$cp->ShowLegend(); - -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/basic_contourex03-3.php b/#jpgraph/src/Examples/basic_contourex03-3.php deleted file mode 100644 index 1de30b70..00000000 --- a/#jpgraph/src/Examples/basic_contourex03-3.php +++ /dev/null @@ -1,40 +0,0 @@ -SetScale('intint'); - -// Show axis on all sides -$graph->SetAxisStyle(AXSTYLE_BOXOUT); - -// Adjust the margins to fit the margin -$graph->SetMargin(30,100,40,30); - -// Setup -$graph->title->Set('Basic contour plot with multiple axis'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// A simple contour plot with default arguments (e.g. 10 isobar lines) -$cp = new ContourPlot($data,10,3); - -// Display the legend -$cp->ShowLegend(); - -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/basic_contourex04.php b/#jpgraph/src/Examples/basic_contourex04.php deleted file mode 100644 index c32e8384..00000000 --- a/#jpgraph/src/Examples/basic_contourex04.php +++ /dev/null @@ -1,43 +0,0 @@ -SetScale('intint'); - -// Show axis on all sides -$graph->SetAxisStyle(AXSTYLE_BOXOUT); - -// Adjust the margins to fit the margin -$graph->SetMargin(30,100,40,30); - -// Setup -$graph->title->Set('Basic contour plot with multiple axis'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// A simple contour plot with default arguments (e.g. 10 isobar lines) -$cp = new ContourPlot($data,5); - -// Display the legend -$cp->ShowLegend(); - -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/basic_contourex05.php b/#jpgraph/src/Examples/basic_contourex05.php deleted file mode 100644 index 61936fce..00000000 --- a/#jpgraph/src/Examples/basic_contourex05.php +++ /dev/null @@ -1,46 +0,0 @@ -SetScale('intint'); - -// Show axis on all sides -$graph->SetAxisStyle(AXSTYLE_BOXOUT); - -// Adjust the margins to fit the margin -$graph->SetMargin(30,100,40,30); - -// Setup -$graph->title->Set('Basic contour plot with multiple axis'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// A simple contour plot with default arguments (e.g. 10 isobar lines) -$cp = new ContourPlot($data); - -// Flip the data around its center line -$cp->SetInvert(); - -// Display the legend -$cp->ShowLegend(); - -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/bezierex1.php b/#jpgraph/src/Examples/bezierex1.php deleted file mode 100644 index 50fad510..00000000 --- a/#jpgraph/src/Examples/bezierex1.php +++ /dev/null @@ -1,54 +0,0 @@ -Get(50); - -// Create the graph -$g = new Graph(300,200); -$g->SetMargin(30,20,40,30); -$g->title->Set("Bezier interpolation"); -$g->title->SetFont(FF_ARIAL,FS_NORMAL,12); -$g->subtitle->Set('(Control points shown in red)'); -$g->subtitle->SetColor('darkred'); -$g->SetMarginColor('lightblue'); - -//$g->img->SetAntiAliasing(); - -// We need a linlin scale since we provide both -// x and y coordinates for the data points. -$g->SetScale('linlin'); - -// We want 1 decimal for the X-label -$g->xaxis->SetLabelFormat('%1.1f'); - -// We use a scatterplot to illustrate the original -// contro points. -$bplot = new ScatterPlot($ydata,$xdata); -$bplot->mark->SetFillColor('red@0.3'); -$bplot->mark->SetColor('red@0.5'); - -// And a line plot to stroke the smooth curve we got -// from the original control points -$lplot = new LinePlot($newy,$newx); -$lplot->SetColor('navy'); - -// Add the plots to the graph and stroke -$g->Add($lplot); -$g->Add($bplot); -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/bkgimgflagex1.php b/#jpgraph/src/Examples/bkgimgflagex1.php deleted file mode 100644 index 1e479383..00000000 --- a/#jpgraph/src/Examples/bkgimgflagex1.php +++ /dev/null @@ -1,79 +0,0 @@ -SetScale('textlin'); -$graph->SetMargin(40,20,20,40); -$graph->SetMarginColor('white:0.9'); -$graph->SetColor('white'); -$graph->SetShadow(); - -// Adjust the position of the legend box -$graph->legend->Pos(0.03,0.10); - -// Adjust the color for theshadow of the legend -$graph->legend->SetShadow('darkgray@0.5'); -$graph->legend->SetFillColor('lightblue@0.1'); -$graph->legend->Hide(); - -// Get localised version of the month names -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); -$graph->SetBackgroundCountryFlag('mais',BGIMG_COPY,50); - -// Set axis titles and fonts -$graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetColor('white'); - -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->SetColor('navy'); - -$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->SetColor('navy'); - -//$graph->ygrid->Show(false); -$graph->ygrid->SetColor('white@0.5'); - -// Setup graph title -$graph->title->Set('Using a country flag background'); - -// Some extra margin (from the top) -$graph->title->SetMargin(3); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); - -// Create the three var series we will combine -$bplot1 = new BarPlot($datay1); -$bplot2 = new BarPlot($datay2); -$bplot3 = new BarPlot($datay3); - -// Setup the colors with 40% transparency (alpha channel) -$bplot1->SetFillColor('yellow@0.4'); -$bplot2->SetFillColor('red@0.4'); -$bplot3->SetFillColor('darkgreen@0.4'); - -// Setup legends -$bplot1->SetLegend('Label 1'); -$bplot2->SetLegend('Label 2'); -$bplot3->SetLegend('Label 3'); - -// Setup each bar with a shadow of 50% transparency -$bplot1->SetShadow('black@0.4'); -$bplot2->SetShadow('black@0.4'); -$bplot3->SetShadow('black@0.4'); - -$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3)); -$gbarplot->SetWidth(0.6); -$graph->Add($gbarplot); - -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/bkgimgflagex2.php b/#jpgraph/src/Examples/bkgimgflagex2.php deleted file mode 100644 index c6a27b3d..00000000 --- a/#jpgraph/src/Examples/bkgimgflagex2.php +++ /dev/null @@ -1,83 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(40,20,20,40); -$graph->SetMarginColor('white:0.9'); -$graph->SetColor('white'); -$graph->SetShadow(); - -// Apply a perspective transformation at the end -$graph->Set3DPerspective(SKEW3D_UP,100,180); - -// Adjust the position of the legend box -$graph->legend->Pos(0.03,0.10); - -// Adjust the color for theshadow of the legend -$graph->legend->SetShadow('darkgray@0.5'); -$graph->legend->SetFillColor('lightblue@0.1'); -$graph->legend->Hide(); - -// Get localised version of the month names -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -$graph->SetBackgroundCountryFlag('mais',BGIMG_COPY,50); - -// Set axis titles and fonts -$graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetColor('white'); - -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->SetColor('navy'); - -$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->SetColor('navy'); - -//$graph->ygrid->Show(false); -$graph->ygrid->SetColor('white@0.5'); - -// Setup graph title -$graph->title->Set('Using a country flag background'); - -// Some extra margin (from the top) -$graph->title->SetMargin(3); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); - -// Create the three var series we will combine -$bplot1 = new BarPlot($datay1); -$bplot2 = new BarPlot($datay2); -$bplot3 = new BarPlot($datay3); - -// Setup the colors with 40% transparency (alpha channel) -$bplot1->SetFillColor('yellow@0.4'); -$bplot2->SetFillColor('red@0.4'); -$bplot3->SetFillColor('darkgreen@0.4'); - -// Setup legends -$bplot1->SetLegend('Label 1'); -$bplot2->SetLegend('Label 2'); -$bplot3->SetLegend('Label 3'); - -// Setup each bar with a shadow of 50% transparency -$bplot1->SetShadow('black@0.4'); -$bplot2->SetShadow('black@0.4'); -$bplot3->SetShadow('black@0.4'); - -$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3)); -$gbarplot->SetWidth(0.6); -$graph->Add($gbarplot); - -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/bkgimgflagex3.php b/#jpgraph/src/Examples/bkgimgflagex3.php deleted file mode 100644 index be9afb73..00000000 --- a/#jpgraph/src/Examples/bkgimgflagex3.php +++ /dev/null @@ -1,83 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(40,20,20,40); -$graph->SetMarginColor('white:0.9'); -$graph->SetColor('white'); -$graph->SetShadow(); - -// Apply a perspective transformation at the end -$graph->Set3DPerspective(SKEW3D_DOWN,100,180); - -// Adjust the position of the legend box -$graph->legend->Pos(0.03,0.10); - -// Adjust the color for theshadow of the legend -$graph->legend->SetShadow('darkgray@0.5'); -$graph->legend->SetFillColor('lightblue@0.1'); -$graph->legend->Hide(); - -// Get localised version of the month names -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -$graph->SetBackgroundCountryFlag('mais',BGIMG_COPY,50); - -// Set axis titles and fonts -$graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetColor('white'); - -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->SetColor('navy'); - -$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->SetColor('navy'); - -//$graph->ygrid->Show(false); -$graph->ygrid->SetColor('white@0.5'); - -// Setup graph title -$graph->title->Set('Using a country flag background'); - -// Some extra margin (from the top) -$graph->title->SetMargin(3); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); - -// Create the three var series we will combine -$bplot1 = new BarPlot($datay1); -$bplot2 = new BarPlot($datay2); -$bplot3 = new BarPlot($datay3); - -// Setup the colors with 40% transparency (alpha channel) -$bplot1->SetFillColor('yellow@0.4'); -$bplot2->SetFillColor('red@0.4'); -$bplot3->SetFillColor('darkgreen@0.4'); - -// Setup legends -$bplot1->SetLegend('Label 1'); -$bplot2->SetLegend('Label 2'); -$bplot3->SetLegend('Label 3'); - -// Setup each bar with a shadow of 50% transparency -$bplot1->SetShadow('black@0.4'); -$bplot2->SetShadow('black@0.4'); -$bplot3->SetShadow('black@0.4'); - -$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3)); -$gbarplot->SetWidth(0.6); -$graph->Add($gbarplot); - -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/bkgimgflagex4.php b/#jpgraph/src/Examples/bkgimgflagex4.php deleted file mode 100644 index d7db486a..00000000 --- a/#jpgraph/src/Examples/bkgimgflagex4.php +++ /dev/null @@ -1,83 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(40,20,20,40); -$graph->SetMarginColor('white:0.9'); -$graph->SetColor('white'); -$graph->SetShadow(); - -// Apply a perspective transformation at the end -$graph->Set3DPerspective(SKEW3D_LEFT,350,320,true); - -// Adjust the position of the legend box -$graph->legend->Pos(0.03,0.10); - -// Adjust the color for theshadow of the legend -$graph->legend->SetShadow('darkgray@0.5'); -$graph->legend->SetFillColor('lightblue@0.1'); -$graph->legend->Hide(); - -// Get localised version of the month names -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -$graph->SetBackgroundCountryFlag('mais',BGIMG_COPY,50); - -// Set axis titles and fonts -$graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetColor('white'); - -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->SetColor('navy'); - -$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->SetColor('navy'); - -//$graph->ygrid->Show(false); -$graph->ygrid->SetColor('white@0.5'); - -// Setup graph title -$graph->title->Set('Using a country flag background'); - -// Some extra margin (from the top) -$graph->title->SetMargin(3); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); - -// Create the three var series we will combine -$bplot1 = new BarPlot($datay1); -$bplot2 = new BarPlot($datay2); -$bplot3 = new BarPlot($datay3); - -// Setup the colors with 40% transparency (alpha channel) -$bplot1->SetFillColor('yellow@0.4'); -$bplot2->SetFillColor('red@0.4'); -$bplot3->SetFillColor('darkgreen@0.4'); - -// Setup legends -$bplot1->SetLegend('Label 1'); -$bplot2->SetLegend('Label 2'); -$bplot3->SetLegend('Label 3'); - -// Setup each bar with a shadow of 50% transparency -$bplot1->SetShadow('black@0.4'); -$bplot2->SetShadow('black@0.4'); -$bplot3->SetShadow('black@0.4'); - -$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3)); -$gbarplot->SetWidth(0.6); -$graph->Add($gbarplot); - -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/bkgimgflagex5.php b/#jpgraph/src/Examples/bkgimgflagex5.php deleted file mode 100644 index f45a85a0..00000000 --- a/#jpgraph/src/Examples/bkgimgflagex5.php +++ /dev/null @@ -1,83 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(40,20,20,40); -$graph->SetMarginColor('white:0.9'); -$graph->SetColor('white'); -$graph->SetShadow(); - -// Apply a perspective transformation at the end -$graph->Set3DPerspective(SKEW3D_RIGHT,350,320,true); - -// Adjust the position of the legend box -$graph->legend->Pos(0.03,0.10); - -// Adjust the color for theshadow of the legend -$graph->legend->SetShadow('darkgray@0.5'); -$graph->legend->SetFillColor('lightblue@0.1'); -$graph->legend->Hide(); - -// Get localised version of the month names -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -$graph->SetBackgroundCountryFlag('mais',BGIMG_COPY,50); - -// Set axis titles and fonts -$graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetColor('white'); - -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->SetColor('navy'); - -$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->SetColor('navy'); - -//$graph->ygrid->Show(false); -$graph->ygrid->SetColor('white@0.5'); - -// Setup graph title -$graph->title->Set('Using a country flag background'); - -// Some extra margin (from the top) -$graph->title->SetMargin(3); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); - -// Create the three var series we will combine -$bplot1 = new BarPlot($datay1); -$bplot2 = new BarPlot($datay2); -$bplot3 = new BarPlot($datay3); - -// Setup the colors with 40% transparency (alpha channel) -$bplot1->SetFillColor('yellow@0.4'); -$bplot2->SetFillColor('red@0.4'); -$bplot3->SetFillColor('darkgreen@0.4'); - -// Setup legends -$bplot1->SetLegend('Label 1'); -$bplot2->SetLegend('Label 2'); -$bplot3->SetLegend('Label 3'); - -// Setup each bar with a shadow of 50% transparency -$bplot1->SetShadow('black@0.4'); -$bplot2->SetShadow('black@0.4'); -$bplot3->SetShadow('black@0.4'); - -$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3)); -$gbarplot->SetWidth(0.6); -$graph->Add($gbarplot); - -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/blueblack400x300grad.png b/#jpgraph/src/Examples/blueblack400x300grad.png deleted file mode 100644 index 8852862a..00000000 Binary files a/#jpgraph/src/Examples/blueblack400x300grad.png and /dev/null differ diff --git a/#jpgraph/src/Examples/boxstockcsimex1.php b/#jpgraph/src/Examples/boxstockcsimex1.php deleted file mode 100644 index 1cb765d3..00000000 --- a/#jpgraph/src/Examples/boxstockcsimex1.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale("textlin"); -$graph->SetMarginColor('lightblue'); -$graph->title->Set('Box Stock chart example'); - -// Create a new stock plot -$p1 = new BoxPlot($datay); - -// Setup URL target for image map -$p1->SetCSIMTargets(array('#1','#2','#3','#4','#5')); - -// Width of the bars (in pixels) -$p1->SetWidth(9); - -//$p1->SetCenter(); -// Uncomment the following line to hide the horizontal end lines -//$p1->HideEndLines(); - -// Add the plot to the graph and send it back to the browser -$graph->Add($p1); -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/boxstockex1.php b/#jpgraph/src/Examples/boxstockex1.php deleted file mode 100644 index 4e09833e..00000000 --- a/#jpgraph/src/Examples/boxstockex1.php +++ /dev/null @@ -1,33 +0,0 @@ -SetScale('textlin'); -$graph->SetMarginColor('lightblue'); -$graph->title->Set('Box Stock chart example'); - -// Create a new stock plot -$p1 = new BoxPlot($datay); - -// Width of the bars (in pixels) -$p1->SetWidth(9); - -// Uncomment the following line to hide the horizontal end lines -//$p1->HideEndLines(); - -// Add the plot to the graph and send it back to the browser -$graph->Add($p1); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/boxstockex2.php b/#jpgraph/src/Examples/boxstockex2.php deleted file mode 100644 index d3531f48..00000000 --- a/#jpgraph/src/Examples/boxstockex2.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale("textlin"); -$graph->SetMarginColor('lightblue'); -$graph->title->Set('Box Stock chart example'); -$graph->subtitle->Set('(Indented X-axis)'); - -// Create a new stock plot -$p1 = new BoxPlot($datay); - -// Width of the bars (in pixels) -$p1->SetWidth(9); - -// Indent bars so they dont start and end at the edge of the -// plot area -$p1->SetCenter(); - -// Uncomment the following line to hide the horizontal end lines -//$p1->HideEndLines(); - -// Add the plot to the graph and send it back to the browser -$graph->Add($p1); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/builtinplotmarksex1.php b/#jpgraph/src/Examples/builtinplotmarksex1.php deleted file mode 100644 index 5d265fac..00000000 --- a/#jpgraph/src/Examples/builtinplotmarksex1.php +++ /dev/null @@ -1,66 +0,0 @@ -SetMargin(30,20,60,20); -$graph->SetMarginColor('white'); -$graph->SetScale("linlin"); - -// Hide the frame around the graph -$graph->SetFrame(false); - -// Setup title -$graph->title->Set("Using Builtin PlotMarks"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); - -// Note: requires jpgraph 1.12p or higher -// $graph->SetBackgroundGradient('blue','navy:0.5',GRAD_HOR,BGRAD_PLOT); -$graph->tabtitle->Set('Region 1' ); -$graph->tabtitle->SetWidth(TABTITLE_WIDTHFULL); - -// Enable X and Y Grid -$graph->xgrid->Show(); -$graph->xgrid->SetColor('gray@0.5'); -$graph->ygrid->SetColor('gray@0.5'); - -// Format the legend box -$graph->legend->SetColor('navy'); -$graph->legend->SetFillColor('lightgreen'); -$graph->legend->SetLineWeight(1); -$graph->legend->SetFont(FF_ARIAL,FS_BOLD,8); -$graph->legend->SetShadow('gray@0.4',3); -$graph->legend->SetAbsPos(15,120,'right','bottom'); - -// Create the line plots - -$p1 = new LinePlot($datay1); -$p1->SetColor("red"); -$p1->SetFillColor("yellow@0.5"); -$p1->SetWeight(2); -$p1->mark->SetType(MARK_IMG_DIAMOND,5,0.6); -$p1->SetLegend('2006'); -$graph->Add($p1); - -$p2 = new LinePlot($datay2); -$p2->SetColor("darkgreen"); -$p2->SetWeight(2); -$p2->SetLegend('2001'); -$p2->mark->SetType(MARK_IMG_MBALL,'red'); -$graph->Add($p2); - -// Add a vertical line at the end scale position '7' -$l1 = new PlotLine(VERTICAL,7); -$graph->Add($l1); - -// Output the graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/canvas_jpgarchex.php b/#jpgraph/src/Examples/canvas_jpgarchex.php deleted file mode 100644 index a67c0cbe..00000000 --- a/#jpgraph/src/Examples/canvas_jpgarchex.php +++ /dev/null @@ -1,143 +0,0 @@ -SetMargin(2,3,2,3); -$g->SetMarginColor("teal"); -$g->InitFrame(); - -// ... and a scale -$scale = new CanvasScale($g); -$scale->Set(0,$xmax,0,$ymax); - -// ... we need shape since we want the indented rectangle -$shape = new Shape($g,$scale); -$shape->SetColor('black'); - -// ... basic parameters for the overall image -$l = 2; // Left margin -$r = 18; // Row number to start the lowest line on -$width = 16; // Total width - -// Setup the two basic rectangle text object we will use -$tt = new CanvasRectangleText(); -$tt->SetFont(FF_ARIAL,FS_NORMAL,14); -$tt->SetFillColor(''); -$tt->SetColor(''); -$tt->SetFontColor('navy'); - -$t = new CanvasRectangleText(); -$t->SetFont(FF_ARIAL,FS_NORMAL,14); -$t->SetFillColor('goldenrod1'); -$t->SetFontColor('navy'); - - -// Now start drawing the arch overview from the bottom and up -// This is all pretty manual and one day I will write a proper -// framework to make it easy to construct these types of architecture -// overviews. But for now, just plain old coordinates.. - -// Line: GD Library and image libraries -$h=3; -$s = 3; $d=$l + $width-9; -$t->SetFillColor('cadetblue3'); -$t->Set("TTF",$d,$r+2,$s,1); -$t->Stroke($g->img,$scale); -$t->Set("PNG",$d+$s,$r+2,$s,1); -$t->Stroke($g->img,$scale); -$t->Set("JPEG",$d+2*$s,$r+2,$s,1); -$t->Stroke($g->img,$scale); -$shape->IndentedRectangle($l,$r,$width,$h,$s*3,1,2,'lightgreen'); -$tt->Set("GD Basic library\n(1.8.x or 2.x)",$l,$r,$width,$h-1); -$tt->Stroke($g->img,$scale); - - -// Area: Basic internal JpGraph architecture -$t->SetFillColor('goldenrod1'); -$h = 2; -$r -= $h; $d=8; -$t->Set("Image primitives\n(RGB, Anti-aliasing,\nGD Abstraction)",$l,$r-0.5,$width*0.5,$h+0.5); -$t->Stroke($g->img,$scale); -$t->Set("Image Cache &\nStreaming",$l+0.5*$width,$r,$width*0.4,$h); -$t->Stroke($g->img,$scale); - -$r -= $h; $d=8; -$t->Set("2D Rot & Transformation",$l,$r,$width*0.5,$h-0.5); $t->Stroke($g->img,$scale); - - -$r -= 2; $h = 4; -$shape->IndentedRectangle($l,$r,$width*0.9,$h,$d,2,3,'goldenrod1'); -$tt->Set("Axis, Labelling, (Auto)-Scaling",$l,$r,$width*0.9,$h-2); $tt->Stroke($g->img,$scale); - -$r -= 1; -$shape->IndentedRectangle($l,$r,$width,7,$width*0.9,6,3,'goldenrod1'); -$tt->Set("Error handling & Utility classes",$l,$r,$width,1); $tt->Stroke($g->img,$scale); - - -// Area: Top area with graph components -$t->SetFillColor('gold1'); -$r -= 3; -$w = $width*0.55/4; $h = 2; -$t->Set("Gantt\nGraph",$l,$r,$w,$h); -$t->Stroke($g->img,$scale); - -$t->Set("Pie\nGraph",$l+$w,$r,$w,$h); -$t->Stroke($g->img,$scale); -$t->Set("Radar\nGraph",$l+$w*2,$r,$w,$h); -$t->Stroke($g->img,$scale); - -$shape->IndentedRectangle($l,$r,$width,3,4*$w,2,0,'gold1'); -$tt->Set("Base Graph\n(Orthogonal\ncoordinate system)",$l+4*$w,$r,$width-$w*4,3); -$tt->Stroke($g->img,$scale); - -$r -= 2; -$d = 0.7; -$shape->IndentedRectangle($l+3*$w,$r,$w,4, $w*$d,2,0,'gold1'); -$t->Set("Canv\nUtil",$l+3*$w,$r,$w*$d,$h); $t->Stroke($g->img,$scale); -$tt->Set("Canvas\nGraph",$l+3*$w,$r+2,$w,2); $tt->Stroke($g->img,$scale); - -// Top line of plotting plugins -$t->SetFillColor('cyan'); -$t->Set("Gantt\nPlot",$l,$r,$w,$h); $t->Stroke($g->img,$scale); -$t->Set("2D\nPlot",$l+$w,$r,$w/2,$h); $t->Stroke($g->img,$scale); -$t->Set("3D\nPlot",$l+$w+$w/2,$r,$w/2,$h);$t->Stroke($g->img,$scale); -$t->Set("Radar\nPlot",$l+2*$w,$r,$w,$h); $t->Stroke($g->img,$scale); - -$wp = ($width - 4*$w)/4; -$t->Set("Error\nPlot",$l+4*$w,$r,$wp,$h); $t->Stroke($g->img,$scale); -$t->Set("Line\nPlot",$l+4*$w+$wp,$r,$wp,$h); $t->Stroke($g->img,$scale); -$t->Set("Bar\nPlot",$l+4*$w+2*$wp,$r,$wp,$h); $t->Stroke($g->img,$scale); -$t->Set("Scatter\nPlot",$l+4*$w+3*$wp,$r,$wp,$h); $t->Stroke($g->img,$scale); - -// Show application top -$r -= 2.5; $h=2; -$t->SetFillColor('blue'); -$t->SetFontColor('white'); -$t->SetFont(FF_ARIAL,FS_BOLD,20); -$t->Set("PHP Application",$l,$r,$width,$h); $t->Stroke($g->img,$scale); - -// Stroke title -$r = 0.5; -$tt->SetFontColor('black'); -$tt->SetFont(FF_TIMES,FS_BOLD,28); -$tt->Set("JpGraph Architecture Overview",$l,$r,$width,1); -$tt->Stroke($g->img,$scale); - -// Stroke footer -$tt->SetFont(FF_VERDANA,FS_NORMAL,10); -$tt->Set("Generated: ".date("ymd H:m",time()),0.1,$ymax*0.95); -$tt->Stroke($g->img,$scale); - -// .. and stream it all back -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/canvasbezierex1.php b/#jpgraph/src/Examples/canvasbezierex1.php deleted file mode 100644 index 36febdf5..00000000 --- a/#jpgraph/src/Examples/canvasbezierex1.php +++ /dev/null @@ -1,40 +0,0 @@ -title->Set('Bezier line with control points'); - -// Setup control point for bezier -$p = array(3,6, - 6,9, - 5,3, - 7,4); - -// Visualize control points -$shape->SetColor('blue'); -$shape->Line($p[0],$p[1],$p[2],$p[3]); -$shape->FilledCircle($p[2],$p[3],-6); - -$shape->SetColor('red'); -$shape->Line($p[4],$p[5],$p[6],$p[7]); -$shape->FilledCircle($p[4],$p[5],-6); - -// Draw bezier -$shape->SetColor('black'); -$shape->Bezier($p); - -// Frame it with a square -$shape->SetColor('navy'); -$shape->Rectangle(0.5,2,9.5,9.5); - -// ... and stroke it -$g->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/canvasex01.php b/#jpgraph/src/Examples/canvasex01.php deleted file mode 100644 index 68839155..00000000 --- a/#jpgraph/src/Examples/canvasex01.php +++ /dev/null @@ -1,37 +0,0 @@ -SetMargin(5,11,6,11); -$g->SetShadow(); -$g->SetMarginColor("teal"); - -// We need to stroke the plotarea and margin before we add the -// text since we otherwise would overwrite the text. -$g->InitFrame(); - -// Draw a text box in the middle -$txt="This\nis\na TEXT!!!"; -$t = new Text($txt,200,10); -$t->SetFont(FF_ARIAL,FS_BOLD,40); - -// How should the text box interpret the coordinates? -$t->Align('center','top'); - -// How should the paragraph be aligned? -$t->ParagraphAlign('center'); - -// Add a box around the text, white fill, black border and gray shadow -$t->SetBox("white","black","gray"); - -// Stroke the text -$t->Stroke($g->img); - -// Stroke the graph -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/canvasex02.php b/#jpgraph/src/Examples/canvasex02.php deleted file mode 100644 index 20807622..00000000 --- a/#jpgraph/src/Examples/canvasex02.php +++ /dev/null @@ -1,42 +0,0 @@ -SetMargin(5,11,6,11); -$g->SetShadow(); -$g->SetMarginColor("teal"); - -// We need to stroke the plotarea and margin before we add the -// text since we otherwise would overwrite the text. -$g->InitFrame(); - -// Add a black line -$g->img->SetColor('black'); -$g->img->Line(0,0,100,100); - -// .. and a circle (x,y,diameter) -$g->img->Circle(100,100,50); - -// .. and a filled circle (x,y,diameter) -$g->img->SetColor('red'); -$g->img->FilledCircle(200,100,50); - -// .. add a rectangle -$g->img->SetColor('green'); -$g->img->FilledRectangle(10,10,50,50); - -// .. add a filled rounded rectangle -$g->img->SetColor('green'); -$g->img->FilledRoundedRectangle(300,30,350,80,10); -// .. with a darker border -$g->img->SetColor('darkgreen'); -$g->img->RoundedRectangle(300,30,350,80,10); - -// Stroke the graph -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/canvasex03.php b/#jpgraph/src/Examples/canvasex03.php deleted file mode 100644 index dad3c55b..00000000 --- a/#jpgraph/src/Examples/canvasex03.php +++ /dev/null @@ -1,58 +0,0 @@ -SetMargin(5,11,6,11); -$g->SetShadow(); -$g->SetMarginColor("teal"); - -// We need to stroke the plotarea and margin before we add the -// text since we otherwise would overwrite the text. -$g->InitFrame(); - -// Create a new scale -$scale = new CanvasScale($g); -$scale->Set(0,$xmax,0,$ymax); - -// The shape class is wrapper around the Imgae class which translates -// the coordinates for us -$shape = new Shape($g,$scale); -$shape->SetColor('black'); - - -// Add a black line -$shape->SetColor('black'); -$shape->Line(0,0,20,20); - -// .. and a circle (x,y,diameter) -$shape->Circle(5,14,2); - -// .. and a filled circle (x,y,diameter) -$shape->SetColor('red'); -$shape->FilledCircle(11,8,3); - -// .. add a rectangle -$shape->SetColor('green'); -$shape->FilledRectangle(15,8,19,14); - -// .. add a filled rounded rectangle -$shape->SetColor('green'); -$shape->FilledRoundedRectangle(2,3,8,6); -// .. with a darker border -$shape->SetColor('darkgreen'); -$shape->RoundedRectangle(2,3,8,6); - - -// Stroke the graph -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/canvasex04.php b/#jpgraph/src/Examples/canvasex04.php deleted file mode 100644 index 3e6ac9f9..00000000 --- a/#jpgraph/src/Examples/canvasex04.php +++ /dev/null @@ -1,58 +0,0 @@ -SetMargin(5,11,6,11); -$g->SetShadow(); -$g->SetMarginColor("teal"); - -// We need to stroke the plotarea and margin before we add the -// text since we otherwise would overwrite the text. -$g->InitFrame(); - -// Create a new scale -$scale = new CanvasScale($g); -$scale->Set(0,$xmax,0,$ymax); - -// The shape class is wrapper around the Imgae class which translates -// the coordinates for us -$shape = new Shape($g,$scale); -$shape->SetColor('black'); - - -// Add a black line -$shape->SetColor('black'); -$shape->Line(0,0,20,20); - -// .. and a circle (x,y,diameter) -$shape->Circle(5,14,2); - -// .. and a filled circle (x,y,diameter) -$shape->SetColor('red'); -$shape->FilledCircle(11,8,3); - -// .. add a rectangle -$shape->SetColor('green'); -$shape->FilledRectangle(15,8,19,14); - -// .. add a filled rounded rectangle -$shape->SetColor('green'); -$shape->FilledRoundedRectangle(2,3,8,6); -// .. with a darker border -$shape->SetColor('darkgreen'); -$shape->RoundedRectangle(2,3,8,6); - - -// Stroke the graph -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/canvasex05.php b/#jpgraph/src/Examples/canvasex05.php deleted file mode 100644 index 46139842..00000000 --- a/#jpgraph/src/Examples/canvasex05.php +++ /dev/null @@ -1,58 +0,0 @@ -SetMargin(5,11,6,11); -$g->SetShadow(); -$g->SetMarginColor("teal"); - -// We need to stroke the plotarea and margin before we add the -// text since we otherwise would overwrite the text. -$g->InitFrame(); - -// Create a new scale -$scale = new CanvasScale($g); -$scale->Set(0,$xmax,0,$ymax); - -// The shape class is wrapper around the Imgae class which translates -// the coordinates for us -$shape = new Shape($g,$scale); -$shape->SetColor('black'); - - -// Add a black line -$shape->SetColor('black'); -$shape->Line(0,0,20,20); - -// .. and a circle (x,y,diameter) -$shape->Circle(5,14,2); - -// .. and a filled circle (x,y,diameter) -$shape->SetColor('red'); -$shape->FilledCircle(11,8,3); - -// .. add a rectangle -$shape->SetColor('green'); -$shape->FilledRectangle(15,8,19,14); - -// .. add a filled rounded rectangle -$shape->SetColor('green'); -$shape->FilledRoundedRectangle(2,3,8,6); -// .. with a darker border -$shape->SetColor('darkgreen'); -$shape->RoundedRectangle(2,3,8,6); - - -// Stroke the graph -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/canvasex06.php b/#jpgraph/src/Examples/canvasex06.php deleted file mode 100644 index b475c68d..00000000 --- a/#jpgraph/src/Examples/canvasex06.php +++ /dev/null @@ -1,42 +0,0 @@ -SetMargin(5,11,6,11); -$g->SetShadow(); -$g->SetMarginColor("teal"); - -// We need to stroke the plotarea and margin before we add the -// text since we otherwise would overwrite the text. -$g->InitFrame(); - -// Create a new scale -$scale = new CanvasScale($g); -$scale->Set(0,$xmax,0,$ymax); - -// The shape class is wrapper around the Imgae class which translates -// the coordinates for us -$shape = new Shape($g,$scale); -$shape->SetColor('black'); - -$shape->IndentedRectangle(1,2,15,15,8,8,CORNER_TOPLEFT,'khaki'); - -$shape->IndentedRectangle(1,20,15,15,8,8,CORNER_BOTTOMLEFT,'khaki'); - -$shape->IndentedRectangle(20,2,15,15,8,8,CORNER_TOPRIGHT,'khaki'); - -$shape->IndentedRectangle(20,20,15,15,8,8,CORNER_BOTTOMRIGHT,'khaki'); - -// Stroke the graph -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/canvaspiralex1.php b/#jpgraph/src/Examples/canvaspiralex1.php deleted file mode 100644 index 5d72b920..00000000 --- a/#jpgraph/src/Examples/canvaspiralex1.php +++ /dev/null @@ -1,78 +0,0 @@ -SetColor($color1); - $img->Line($x,$y,$x+$s1*$w,$y); - } - else { - $x = $x + $s2*$w*$r; - $w = (1-$r)*$w; - $h = $h / (1-$r) * $r; - $s2 *= -1; - $img->SetColor($color1); - $img->Line($x,$y,$x,$y-$s2*$h); - } - $img->SetColor($color2); - $img->FilledRectangle($x-1,$y-1,$x+1,$y+1); - $img->Arc($x,$y,2*$w+1,2*$h+1,$sa,$ea); - $img->Arc($x,$y,2*$w,2*$h,$sa,$ea); - $img->Arc($x,$y,2*$w-1,2*$h-1,$sa,$ea); - $img->Line($x_old,$y_old,$x,$y); - $x_old=$x; $y_old=$y; - } -} - -$g = new CanvasGraph($w,$h); -//$gr = 1.61803398874989484820; - -$p = SeaShell($g->img,0,20,$w-1,$h-21,$r,19); -$g->img->SetColor('black'); -$g->img->Rectangle(0,20,$w-1,$h-1); -$g->img->SetFont(FF_FONT2,FS_BOLD); -$g->img->SetTextAlign('center','top'); -$g->img->StrokeText($w/2,0,"Canvas Spiral"); - -$g->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/ccbp_ex1.php b/#jpgraph/src/Examples/ccbp_ex1.php deleted file mode 100644 index 5071fd34..00000000 --- a/#jpgraph/src/Examples/ccbp_ex1.php +++ /dev/null @@ -1,36 +0,0 @@ -SetTitle('Buffer penetration','(history added)'); -$graph->SetColorMap(0); - - // Two "fake tasks with hostory -$datax=array(75,83); $datay=array(110,64); -$datax1 = array(33,50,67,83); $datay1 = array(86,76,80,64); -$datax2 = array(18,47,58,75); $datay2 = array(80,97,105,110); - -$sp = new ScatterPlot($datay,$datax); -$sp->mark->SetType(MARK_DIAMOND); -$sp->mark->SetFillColor('white'); -$sp->mark->SetSize(12); - -$sp_hist = array(); -$sp_hist[0] = new LinePlot($datay1,$datax1); -$sp_hist[0]->SetWeight(1); -$sp_hist[0]->SetColor('white'); - -$sp_hist[1] = new LinePlot($datay2,$datax2); -$sp_hist[1]->SetWeight(1); -$sp_hist[1]->SetColor('white'); - -$graph->Add($sp_hist); -$graph->Add($sp); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/ccbp_ex2.php b/#jpgraph/src/Examples/ccbp_ex2.php deleted file mode 100644 index c5decd30..00000000 --- a/#jpgraph/src/Examples/ccbp_ex2.php +++ /dev/null @@ -1,36 +0,0 @@ -SetTitle('Buffer penetration','(history added)'); -$graph->SetColorMap(1); - - // Two "fake tasks with hostory -$datax=array(75,83); $datay=array(110,64); -$datax1 = array(33,50,67,83); $datay1 = array(86,76,80,64); -$datax2 = array(18,47,58,75); $datay2 = array(80,97,105,110); - -$sp = new ScatterPlot($datay,$datax); -$sp->mark->SetType(MARK_DIAMOND); -$sp->mark->SetFillColor('white'); -$sp->mark->SetSize(12); - -$sp_hist = array(); -$sp_hist[0] = new LinePlot($datay1,$datax1); -$sp_hist[0]->SetWeight(1); -$sp_hist[0]->SetColor('white'); - -$sp_hist[1] = new LinePlot($datay2,$datax2); -$sp_hist[1]->SetWeight(1); -$sp_hist[1]->SetColor('white'); - -$graph->Add($sp_hist); -$graph->Add($sp); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/ccbpgraph.class.php b/#jpgraph/src/Examples/ccbpgraph.class.php deleted file mode 100644 index 91954e1e..00000000 --- a/#jpgraph/src/Examples/ccbpgraph.class.php +++ /dev/null @@ -1,257 +0,0 @@ -iWidth = $aWidth; - $this->iHeight = $aHeight; - } - /** - * Set the title and subtitle for the graph - * - * @param string $aTitle - * @param string $aSubTitle - */ - public function SetTitle($aTitle, $aSubTitle) { - $this->iTitle = $aTitle; - $this->iSubTitle = $aSubTitle; - } - /** - * Set the x-axis min and max values - * - * @param int $aMin - * @param int $aMax - */ - public function SetXMinMax($aMin, $aMax) { - $this->iXMin = floor($aMin/CCBPGraph::TickStep)*CCBPGraph::TickStep; - $this->iXMax = ceil($aMax/CCBPGraph::TickStep)*CCBPGraph::TickStep; - } - /** - * Specify what color map to use - * - * @param int $aMap - */ - public function SetColorMap($aMap) { - $this->iColorMap = $aMap % CCBPGraph::NColorMaps; - } - /** - * Set the y-axis min and max values - * - * @param int $aMin - * @param int $aMax - */ - public function SetYMinMax($aMin,$aMax) { - $this->iYMin = floor($aMin/CCBPGraph::TickStep)*CCBPGraph::TickStep; - $this->iYMax = ceil($aMax/CCBPGraph::TickStep)*CCBPGraph::TickStep; - } - /** - * Set the specification of the color backgrounds and also the - * optional exact colors to be used - * - * @param mixed $aSpec An array of 3 1x2 arrays. Each array specify the - * color indication value at x=0 and x=max x in order to determine the slope - * @param mixed $aColors An array with four elements specifying the colors - * of each color indicator - */ - public function SetColorIndication(array $aSpec,array $aColors=null) { - if( count($aSpec) !== 3 ) { - JpgraphError::Raise('Specification of scale values for background indicators must be an array with three elements.'); - } - $this->iColorInd = $aSpec; - if( $aColors !== null ) { - if( is_array($aColors) && count($aColors) == 4 ) { - $this->iColorSpec = $aColors; - } - else { - JpGraphError::Raise('Color specification for background indication must have four colors.'); - } - } - } - /** - * Construct the graph - * - */ - private function Init() { - - // Setup limits for color indications - $lowx = $this->iXMin; $highx= $this->iXMax; - $lowy = $this->iYMin; $highy = $this->iYMax; - $width=$this->iWidth; $height=$this->iHeight; - - // Margins - $lm=50; $rm=40; - $tm=60; $bm=40; - - if( $width <= 300 || $height <= 250 ) { - $labelsize = 8; - $lm=25; $rm=25; - $tm=45; $bm=25; - } - elseif( $width <= 450 || $height <= 300 ) { - $labelsize = 8; - $lm=30; $rm=30; - $tm=50; $bm=30; - } - elseif( $width <= 600 || $height <= 400 ) { - $labelsize = 9; - } - else { - $labelsize = 11; - } - - if( $this->iSubTitle == '' ) { - $tm -= $labelsize+4; - } - - $graph = new Graph($width,$height); - $graph->SetScale('intint',$lowy,$highy,$lowx,$highx); - $graph->SetMargin($lm,$rm,$tm,$bm); - $graph->SetMarginColor($this->iMarginColor[$this->iColorMap]); - $graph->SetClipping(); - - $graph->title->Set($this->iTitle); - $graph->subtitle->Set($this->iSubTitle); - - $graph->title->SetFont(FF_ARIAL,FS_BOLD,$labelsize+4); - $graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,$labelsize+1); - - $graph->SetBox(true,'black@0.3'); - - $graph->xaxis->SetFont(FF_ARIAL,FS_BOLD,$labelsize); - $graph->yaxis->SetFont(FF_ARIAL,FS_BOLD,$labelsize); - - $graph->xaxis->scale->ticks->Set(CCBPGraph::TickStep,CCBPGraph::TickStep); - $graph->yaxis->scale->ticks->Set(CCBPGraph::TickStep,CCBPGraph::TickStep); - - $graph->xaxis->HideZeroLabel(); - $graph->yaxis->HideZeroLabel(); - - $graph->xaxis->SetLabelFormatString('%d%%'); - $graph->yaxis->SetLabelFormatString('%d%%'); - - // For the x-axis we adjust the color so labels on the left of the Y-axis are in black - $n1 = floor(abs($this->iXMin/25))+1; - $n2 = floor($this->iXMax/25); - if( $this->iColorMap == 0 ) { - $xlcolors=array(); - for( $i = 0; $i < $n1; ++$i ) { - $xlcolors[$i] = 'black'; - } - for( $i = 0; $i < $n2; ++$i ) { - $xlcolors[$n1+$i] = 'lightgray:1.5'; - } - $graph->xaxis->SetColor('gray',$xlcolors); - $graph->yaxis->SetColor('gray','lightgray:1.5'); - } - else { - $graph->xaxis->SetColor('darkgray','darkgray:0.8'); - $graph->yaxis->SetColor('darkgray','darkgray:0.8'); - } - $graph->SetGridDepth(DEPTH_FRONT); - $graph->ygrid->SetColor('gray@0.6'); - $graph->ygrid->SetLineStyle('dotted'); - - $graph->ygrid->Show(); - - $graph->xaxis->SetWeight(1); - $graph->yaxis->SetWeight(1); - - $ytitle = new Text(CCBPGraph::YTitle,floor($lm*.75),($height-$tm-$bm)/2+$tm); - #$ytitle->SetFont(FF_VERA,FS_BOLD,$labelsize+1); - $ytitle->SetAlign('right','center'); - $ytitle->SetAngle(90); - $graph->Add($ytitle); - - $xtitle = new Text(CCBPGraph::XTitle,($width-$lm-$rm)/2+$lm,$height - 10); - #$xtitle->SetFont(FF_VERA,FS_BOLD,$labelsize); - $xtitle->SetAlign('center','bottom'); - $graph->Add($xtitle); - - $df = 'D j:S M, Y'; - if( $width < 400 ) { - $df = 'D j:S M'; - } - - $time = new Text(date($df),$width-10,$height-10); - $time->SetAlign('right','bottom'); - #$time->SetFont(FF_VERA,FS_NORMAL,$labelsize-1); - $time->SetColor('darkgray'); - $graph->Add($time); - - // Use an accumulated fille line graph to create the colored bands - - $n = 3; - for( $i=0; $i < $n; ++$i ) { - $b = $this->iColorInd[$i][0]; - $k = ($this->iColorInd[$i][1] - $this->iColorInd[$i][0])/$this->iXMax; - $colarea[$i] = array( array($lowx,$lowx*$k+$b), array($highx,$highx*$k+$b) ); - } - $colarea[3] = array( array($lowx,$highy), array($highx,$highy) ); - - - $cb = array(); - for( $i=0; $i < 4; ++$i ) { - $cb[$i] = new LinePlot(array($colarea[$i][0][1],$colarea[$i][1][1]), - array($colarea[$i][0][0],$colarea[$i][1][0])); - $cb[$i]->SetFillColor($this->iColorSpec[$this->iColorMap][$i]); - $cb[$i]->SetFillFromYMin(); - } - - $graph->Add(array_slice(array_reverse($cb),0,4)); - $this->graph = $graph; - } - /** - * Add a line or scatter plot to the graph - * - * @param mixed $aPlots - */ - public function Add($aPlots) { - if( is_array($aPlots) ) { - $this->iPlots = array_merge($this->iPlots,$aPlots); - } - else { - $this->iPlots[] = $aPlots; - } - } - /** - * Stroke the graph back to the client or to a file - * - * @param mixed $aFile - */ - public function Stroke($aFile='') { - $this->Init(); - if( count($this->iPlots) > 0 ) { - $this->graph->Add($this->iPlots); - } - $this->graph->Stroke($aFile); - } -} -?> diff --git a/#jpgraph/src/Examples/centeredlineex01.php b/#jpgraph/src/Examples/centeredlineex01.php deleted file mode 100644 index 3642f3a4..00000000 --- a/#jpgraph/src/Examples/centeredlineex01.php +++ /dev/null @@ -1,35 +0,0 @@ -img->SetMargin(40,40,40,40); -$graph->img->SetAntiAliasing(); -$graph->SetScale("textlin"); -$graph->SetShadow(); -$graph->title->Set("Example of line centered plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - - -// Use 20% "grace" to get slightly larger scale then min/max of -// data -$graph->yscale->SetGrace(20); - - -$p1 = new LinePlot($datay); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$p1->SetColor("blue"); -$p1->SetCenter(); -$graph->Add($p1); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/centeredlineex02.php b/#jpgraph/src/Examples/centeredlineex02.php deleted file mode 100644 index 2b742290..00000000 --- a/#jpgraph/src/Examples/centeredlineex02.php +++ /dev/null @@ -1,30 +0,0 @@ -img->SetMargin(40,40,40,40); -$graph->img->SetAntiAliasing(); -$graph->SetScale("textlin"); -$graph->SetShadow(); -$graph->title->Set("Example of filled line centered plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new LinePlot($datay); -$p1->SetFillColor("green"); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$p1->SetColor("blue"); -$p1->SetCenter(); -$graph->Add($p1); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/centeredlineex03.php b/#jpgraph/src/Examples/centeredlineex03.php deleted file mode 100644 index 9c182a74..00000000 --- a/#jpgraph/src/Examples/centeredlineex03.php +++ /dev/null @@ -1,31 +0,0 @@ -img->SetMargin(40,40,40,80); -$graph->img->SetAntiAliasing(); -$graph->SetScale("textlin"); -$graph->SetShadow(); -$graph->title->Set("Example slanted X-labels"); -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,14); - -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,11); -$graph->xaxis->SetTickLabels($labels); -$graph->xaxis->SetLabelAngle(45); - -$p1 = new LinePlot($datay); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$p1->SetColor("blue"); -$p1->SetCenter(); -$graph->Add($p1); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/centerlinebarex1.php b/#jpgraph/src/Examples/centerlinebarex1.php deleted file mode 100644 index d686bc6b..00000000 --- a/#jpgraph/src/Examples/centerlinebarex1.php +++ /dev/null @@ -1,35 +0,0 @@ -img->SetMargin(40,80,40,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -$graph->title->Set('Center the line points in bars'); - -$line = new LinePlot($ydata); -$line->SetBarCenter(); -$line->SetWeight(2); - -$bar = new BarPlot($ydata); -$bar2 = new BarPlot($ydata); -$bar2->SetFillColor("red"); - -$gbar = new GroupbarPlot(array($bar,$bar2)); - -$graph->Add($gbar); -$graph->Add($line); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/checkgd.php b/#jpgraph/src/Examples/checkgd.php deleted file mode 100644 index ad252bd2..00000000 --- a/#jpgraph/src/Examples/checkgd.php +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/#jpgraph/src/Examples/checkgd2.php b/#jpgraph/src/Examples/checkgd2.php deleted file mode 100644 index e5e7b3c5..00000000 --- a/#jpgraph/src/Examples/checkgd2.php +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/#jpgraph/src/Examples/checkttf.php b/#jpgraph/src/Examples/checkttf.php deleted file mode 100644 index 5efe737f..00000000 --- a/#jpgraph/src/Examples/checkttf.php +++ /dev/null @@ -1,22 +0,0 @@ - diff --git a/#jpgraph/src/Examples/classroom.jpg b/#jpgraph/src/Examples/classroom.jpg deleted file mode 100644 index f4cc06c4..00000000 Binary files a/#jpgraph/src/Examples/classroom.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/clipping_ex1.php b/#jpgraph/src/Examples/clipping_ex1.php deleted file mode 100644 index 8629fce4..00000000 --- a/#jpgraph/src/Examples/clipping_ex1.php +++ /dev/null @@ -1,36 +0,0 @@ -SetScale('intlin',0,10); -$graph->SetMargin(30,20,70,40); -$graph->SetMarginColor(array(177,191,174)); - -$graph->SetClipping(false); - -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); - -$graph->ygrid->SetLineStyle('dashed'); - -$graph->title->Set("Manual scale"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->title->SetColor('white'); -$graph->subtitle->Set("(No clipping)"); -$graph->subtitle->SetColor('white'); -$graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor("red"); -$lineplot->SetWeight(2); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/clipping_ex2.php b/#jpgraph/src/Examples/clipping_ex2.php deleted file mode 100644 index aba939f9..00000000 --- a/#jpgraph/src/Examples/clipping_ex2.php +++ /dev/null @@ -1,36 +0,0 @@ -SetScale('intlin',0,10); -$graph->SetMargin(30,20,70,40); -$graph->SetMarginColor(array(177,191,174)); - -$graph->SetClipping(true); - -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); - -$graph->ygrid->SetLineStyle('dashed'); - -$graph->title->Set("Manual scale"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->title->SetColor('white'); -$graph->subtitle->Set("(With clipping)"); -$graph->subtitle->SetColor('white'); -$graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor("red"); -$lineplot->SetWeight(2); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/colormaps.php b/#jpgraph/src/Examples/colormaps.php deleted file mode 100644 index 2f9470f0..00000000 --- a/#jpgraph/src/Examples/colormaps.php +++ /dev/null @@ -1,133 +0,0 @@ -img->SetColor('darkgray'); - $graph->img->Rectangle(0,0,$width-1,$height-1); - - $t = new Text($aTitle, $width/2,5); - $t->SetAlign('center','top'); - $t->SetFont(FF_ARIAL,FS_BOLD,14); - $t->Stroke($graph->img); - - // Instantiate a colormap - $cm = new ColorMap(); - $cm->InitRGB($graph->img->rgb); - - for( $mapidx=$aStart; $mapidx <= $aEnd; ++$mapidx, $ys += $ymarg ) { - - $cm->SetMap($mapidx,$aReverse); - $n = $cm->SetNumColors($n); - list( $mapidx, $maparray ) = $cm->GetCurrMap(); - $ncols = count($maparray); - $colbuckets = $cm->GetBuckets(); - - // The module width will depend on the actual number of colors - $mw = round(($width-$lmarg-$rmarg)/$n); - - // Draw color map title (name) - $t->Set('Basic colors: '.$ncols.', Total colors: '.$n); - $t->SetAlign('center','bottom'); - $t->SetAngle(0); - $t->SetFont(FF_TIMES,FS_NORMAL,14); - $t->Stroke($graph->img,$width/2,$ys-3); - - // Add the name/number of the map to the left - $t->SetAlign('right','center'); - $t->Set('Map: '.$mapidx); - $t->SetFont(FF_ARIAL,FS_NORMAL,14); - $t->Stroke($graph->img,$xs-20,round($ys+$mh/2)); - - // Setup text properties for the color names - if( $addColorNames ) { - $t->SetAngle(30); - $t->SetFont(FF_ARIAL,FS_NORMAL,12); - $t->SetAlign('right','top'); - } - - // Loop through all colors in the map - $x = $xs; $y = $ys; $k=0; - for($i=0; $i < $n; ++$i){ - $graph->img->SetColor($colbuckets[$i]); - $graph->img->FilledRectangle($x,$y,$x+$mw,$y+$mh); - - // Mark all basic colors in the map with a bar and name - if( $i % (($n-$ncols)/($ncols-1)+1) == 0 ) { - $graph->img->SetColor('black'); - $graph->img->FilledRectangle($x,$y+$mh+4,$x+$mw-1,$y+$mh+6); - if( $addColorNames ) { - $t->Set($maparray[$k++]); - $t->Stroke($graph->img,$x+$mw/2,$y+$mh+10); - } - } - $x += $mw; - } - - // Draw a border around the map - $graph->img->SetColor('black'); - $graph->img->Rectangle($xs,$ys,$xs+$mw*$n,$ys+$mh); - - } - - // Send back to client - $graph->Stroke(); - } - -} - -$driver = new ColorMapDriver(); - -$title = "Standard maps"; -$reverse = false; -$n = 64; $s=0; $e=9; -$showNames = false; - - -/* -$title = "Center maps"; -$reverse = false; -$n = 64; $s=10; $e=14; -$showNames = false; -*/ - -/* -$title = "Continues maps"; -$reverse = false; -$n = 64; $s=15; $e=21; -$showNames = false; -*/ -$driver->Draw($title,$s,$e,$n,$reverse,$showNames); - -?> diff --git a/#jpgraph/src/Examples/comb90dategraphex01.php b/#jpgraph/src/Examples/comb90dategraphex01.php deleted file mode 100644 index 32948225..00000000 --- a/#jpgraph/src/Examples/comb90dategraphex01.php +++ /dev/null @@ -1,96 +0,0 @@ - 359) - $data_winddirection[$i+1] = 0; - - $data_windspeed[$i+1] = $data_windspeed[$i] + rand(-2,2); - if($data_windspeed[$i+1] < 0 ) - $data_windspeed[$i+1] = 0; - - $xdata[$i] = $start + $i * SAMPLERATE; -} -$xdata[$i] = $start + $i * SAMPLERATE; - - -// Setup the Wind direction graph -$graph = new Graph(300,800); -$graph->SetMarginColor('lightgray:1.7'); -$graph->SetScale('datlin',0,360); -$graph->Set90AndMargin(50,30,60,30); -$graph->SetFrame(true,'white',0); -$graph->SetBox(); - -$graph->title->Set('Wind direction'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->title->SetMargin(10); - -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->xaxis->scale->SetDateFormat('h:i'); -$graph->xgrid->Show(); - -$graph->yaxis->SetLabelAngle(45); -$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->yaxis->SetLabelMargin(0); -$graph->yaxis->scale->SetAutoMin(0); - -$line = new LinePlot($data_winddirection,$xdata); -$line->SetStepStyle(); -$line->SetColor('blue'); - -$graph->Add($line); - -// Setup the wind speed graph -$graph2 = new Graph(300,800); -$graph2->SetScale('datlin'); -$graph2->Set90AndMargin(50,30,60,30); -$graph2->SetMarginColor('lightgray:1.7'); -$graph2->SetFrame(true,'white',0); -$graph2->SetBox(); - -$graph2->title->Set('Windspeed'); -$graph2->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph2->title->SetMargin(10); - -$graph2->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph2->xaxis->scale->SetDateFormat('h:i'); -$graph2->xgrid->Show(); - -$graph2->yaxis->SetLabelAngle(45); -$graph2->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph2->yaxis->SetLabelMargin(0); -$graph2->yaxis->scale->SetAutoMin(0); - -$line2 = new LinePlot($data_windspeed,$xdata); -$line2->SetStepStyle(); -$line2->SetColor('red'); - -$graph2->Add($line2); - -//----------------------- -// Create a multigraph -//---------------------- -$mgraph = new MGraph(); -$mgraph->SetMargin(2,2,2,2); -$mgraph->SetFrame(true,'darkgray',2); -$mgraph->SetFillColor('lightgray'); -$mgraph->Add($graph); -$mgraph->Add($graph2,300,0); -$mgraph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/comb90dategraphex02.php b/#jpgraph/src/Examples/comb90dategraphex02.php deleted file mode 100644 index b6671811..00000000 --- a/#jpgraph/src/Examples/comb90dategraphex02.php +++ /dev/null @@ -1,103 +0,0 @@ - 359) - $data_winddirection[$i+1] = 0; - - $data_windspeed[$i+1] = $data_windspeed[$i] + rand(-2,2); - if($data_windspeed[$i+1] < 0 ) - $data_windspeed[$i+1] = 0; - - $xdata[$i] = $start + $i * SAMPLERATE; -} -$xdata[$i] = $start + $i * SAMPLERATE; - - -DEFINE('BKG_COLOR','lightgray:1.7'); -DEFINE('WIND_HEIGHT',800); -DEFINE('WIND_WIDTH',280); - -// Setup the Wind direction graph -$graph = new Graph(WIND_WIDTH,WIND_HEIGHT); -$graph->SetMarginColor(BKG_COLOR); -$graph->SetScale('datlin',0,360); -$graph->Set90AndMargin(50,10,60,30); -$graph->SetFrame(true,'white',0); -$graph->SetBox(); - -$graph->title->Set('Wind direction'); -$graph->title->SetColor('blue'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->title->SetMargin(5); - -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->xaxis->scale->SetDateFormat('h:i'); -$graph->xgrid->Show(); - -$graph->yaxis->SetLabelAngle(90); -$graph->yaxis->SetColor('blue'); -$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->yaxis->SetLabelMargin(0); -$graph->yaxis->scale->SetAutoMin(0); - -$line = new LinePlot($data_winddirection,$xdata); -$line->SetStepStyle(); -$line->SetColor('blue'); - -$graph->Add($line); - -// Setup the wind speed graph -$graph2 = new Graph(WIND_WIDTH-30,WIND_HEIGHT); -$graph2->SetScale('datlin'); -$graph2->Set90AndMargin(5,20,60,30); -$graph2->SetMarginColor(BKG_COLOR); -$graph2->SetFrame(true,'white',0); -$graph2->SetBox(); - -$graph2->title->Set('Windspeed'); -$graph2->title->SetColor('red'); -$graph2->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph2->title->SetMargin(5); - -$graph2->xaxis->HideLabels(); -$graph2->xgrid->Show(); - -$graph2->yaxis->SetLabelAngle(90); -$graph2->yaxis->SetColor('red'); -$graph2->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph2->yaxis->SetLabelMargin(0); -$graph2->yaxis->scale->SetAutoMin(0); - -$line2 = new LinePlot($data_windspeed,$xdata); -$line2->SetStepStyle(); -$line2->SetColor('red'); - -$graph2->Add($line2); - -//----------------------- -// Create a multigraph -//---------------------- -$mgraph = new MGraph(); -$mgraph->SetMargin(2,2,2,2); -$mgraph->SetFrame(true,'darkgray',2); -$mgraph->SetFillColor(BKG_COLOR); -$mgraph->Add($graph); -$mgraph->Add($graph2,280,0); -$mgraph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/comb90dategraphex03.php b/#jpgraph/src/Examples/comb90dategraphex03.php deleted file mode 100644 index 2911f8b7..00000000 --- a/#jpgraph/src/Examples/comb90dategraphex03.php +++ /dev/null @@ -1,147 +0,0 @@ - 359) - $data_winddirection[$i+1] = 0; - - $data_windspeed[$i+1] = $data_windspeed[$i] + rand(-2,2); - if($data_windspeed[$i+1] < 0 ) - $data_windspeed[$i+1] = 0; - - $data_windtemp[$i+1] = $data_windtemp[$i] + rand(-1.5,1.5); - - $xdata[$i] = $start + $i * SAMPLERATE; -} -$xdata[$i] = $start + $i * SAMPLERATE; - - -//DEFINE('BKG_COLOR','lightgray:1.7'); -DEFINE('BKG_COLOR','green:1.98'); -DEFINE('WIND_HEIGHT',800); -DEFINE('WIND_WIDTH',250); - -//------------------------------------------------------------------ -// Setup the Wind direction graph -//------------------------------------------------------------------ -$graph = new Graph(WIND_WIDTH,WIND_HEIGHT); -$graph->SetMarginColor(BKG_COLOR); -$graph->SetScale('datlin',0,360); -$graph->Set90AndMargin(50,10,70,30); -$graph->SetFrame(true,'white',0); -$graph->SetBox(); - -$graph->title->Set('Wind direction'); -$graph->title->SetColor('blue'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->title->SetMargin(5); - -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->xaxis->scale->SetDateFormat('H:i'); -$graph->xgrid->Show(); - -$graph->yaxis->SetLabelAngle(90); -$graph->yaxis->SetColor('blue'); -$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph->yaxis->SetLabelMargin(0); -$graph->yaxis->scale->SetAutoMin(0); - -$line = new LinePlot($data_winddirection,$xdata); -$line->SetStepStyle(); -$line->SetColor('blue'); - -$graph->Add($line); - -//------------------------------------------------------------------ -// Setup the wind speed graph -//------------------------------------------------------------------ -$graph2 = new Graph(WIND_WIDTH-30,WIND_HEIGHT); -$graph2->SetScale('datlin'); -$graph2->Set90AndMargin(5,20,70,30); -$graph2->SetMarginColor(BKG_COLOR); -$graph2->SetFrame(true,'white',0); -$graph2->SetBox(); - -$graph2->title->Set('Windspeed'); -$graph2->title->SetColor('red'); -$graph2->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph2->title->SetMargin(5); - -$graph2->xaxis->HideLabels(); -$graph2->xgrid->Show(); - -$graph2->yaxis->SetLabelAngle(90); -$graph2->yaxis->SetColor('red'); -$graph2->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph2->yaxis->SetLabelMargin(0); -$graph2->yaxis->scale->SetAutoMin(0); - -$line2 = new LinePlot($data_windspeed,$xdata); -$line2->SetStepStyle(); -$line2->SetColor('red'); - -$graph2->Add($line2); - -//------------------------------------------------------------------ -// Setup the wind temp graph -//------------------------------------------------------------------ -$graph3 = new Graph(WIND_WIDTH-30,WIND_HEIGHT); -$graph3->SetScale('datlin'); -$graph3->Set90AndMargin(5,20,70,30); -$graph3->SetMarginColor(BKG_COLOR); -$graph3->SetFrame(true,'white',0); -$graph3->SetBox(); - -$graph3->title->Set('Temperature'); -$graph3->title->SetColor('black'); -$graph3->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph3->title->SetMargin(5); - -$graph3->xaxis->HideLabels(); -$graph3->xgrid->Show(); - -$graph3->yaxis->SetLabelAngle(90); -$graph3->yaxis->SetColor('black'); -$graph3->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); -$graph3->yaxis->SetLabelMargin(0); -$graph3->yaxis->scale->SetAutoMin(-10); - -$line3 = new LinePlot($data_windtemp,$xdata); -$line3->SetStepStyle(); -$line3->SetColor('black'); - -$graph3->Add($line3); - -//----------------------- -// Create a multigraph -//---------------------- -$mgraph = new MGraph(); -$mgraph->SetMargin(2,2,2,2); -$mgraph->SetFrame(true,'darkgray',2); -$mgraph->SetFillColor(BKG_COLOR); -$mgraph->Add($graph,0,50); -$mgraph->Add($graph2,250,50); -$mgraph->Add($graph3,460,50); -$mgraph->title->Set('Climate diagram 12 March 2009'); -$mgraph->title->SetFont(FF_ARIAL,FS_BOLD,20); -$mgraph->title->SetMargin(8); -$mgraph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/combgraphex1.php b/#jpgraph/src/Examples/combgraphex1.php deleted file mode 100644 index b03b14bb..00000000 --- a/#jpgraph/src/Examples/combgraphex1.php +++ /dev/null @@ -1,89 +0,0 @@ -getTicks($datax,DSUTILS_MONTH1); - -// Now create the real graph -// Combine a line and a bar graph - -// We add some grace to the end of the X-axis scale so that the first and last -// data point isn't exactly at the very end or beginning of the scale -$grace = 400000; -$xmin = $datax[0]-$grace; -$xmax = $datax[$n-1]+$grace;; - -// Overall width of graphs -$w = 450; -// Left and right margin for each graph -$lm=25; $rm=15; - -//---------------------- -// Setup the line graph -//---------------------- -$graph = new Graph($w,250); -$graph->SetScale('linlin',0,0,$xmin,$xmax); -$graph->SetMargin($lm,$rm,10,30); -$graph->SetMarginColor('white'); -$graph->SetFrame(false); -$graph->SetBox(true); -$graph->title->Set('Example of combined graph'); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,14); -$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions); -$graph->xaxis->SetLabelFormatString('My',true); -$graph->xgrid->Show(); -$p1 = new LinePlot($datay,$datax); -$graph->Add($p1); - -//---------------------- -// Setup the bar graph -//---------------------- -$graph2 = new Graph($w,110); -$graph2->SetScale('linlin',0,0,$xmin,$xmax); -$graph2->SetMargin($lm,$rm,5,10); -$graph2->SetMarginColor('white'); -$graph2->SetFrame(false); -$graph2->SetBox(true); -$graph2->xgrid->Show(); -$graph2->xaxis->SetTickPositions($tickPositions,$minTickPositions); -$graph2->xaxis->SetLabelFormatString('My',true); -$graph2->xaxis->SetPos('max'); -$graph2->xaxis->HideLabels(); -$graph2->xaxis->SetTickSide(SIDE_DOWN); -$b1 = new BarPlot($datay2,$datax); -$b1->SetFillColor('teal'); -$b1->SetColor('teal:1.2'); -$graph2->Add($b1); - -//----------------------- -// Create a multigraph -//---------------------- -$mgraph = new MGraph(); -$mgraph->SetMargin(2,2,2,2); -$mgraph->SetFrame(true,'darkgray',2); -$mgraph->Add($graph); -$mgraph->Add($graph2,0,240); -$mgraph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/combgraphex2.php b/#jpgraph/src/Examples/combgraphex2.php deleted file mode 100644 index 27afa832..00000000 --- a/#jpgraph/src/Examples/combgraphex2.php +++ /dev/null @@ -1,90 +0,0 @@ -SetScale('linlin',0,0,$xmin,$xmax); -$graph->SetMargin($lm,$rm,10,30); -$graph->SetMarginColor('white'); -$graph->SetFrame(false); -$graph->SetBox(true); -$graph->title->Set('Example of combined graph with background'); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,14); -$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions); -$graph->xaxis->SetLabelFormatString('My',true); -$graph->xgrid->Show(); -$p1 = new LinePlot($datay,$datax); -$graph->Add($p1); - -//---------------------- -// Setup the bar graph -//---------------------- -$graph2 = new Graph($w,110); -$graph2->SetScale('linlin',0,0,$xmin,$xmax); -$graph2->SetMargin($lm,$rm,5,10); -$graph2->SetMarginColor('white'); -$graph2->SetFrame(false); -$graph2->SetBox(true); -$graph2->xgrid->Show(); -$graph2->xaxis->SetTickPositions($tickPositions,$minTickPositions); -$graph2->xaxis->SetLabelFormatString('My',true); -$graph2->xaxis->SetPos('max'); -$graph2->xaxis->HideLabels(); -$graph2->xaxis->SetTickSide(SIDE_DOWN); -$b1 = new BarPlot($datay2,$datax); -$b1->SetFillColor('teal'); -$b1->SetColor('teal:1.2'); -$graph2->Add($b1); - -//----------------------- -// Create a multigraph -//---------------------- -$mgraph = new MGraph(); -$mgraph->SetImgFormat('jpeg',60); -$mgraph->SetMargin(2,2,2,2); -$mgraph->SetFrame(true,'darkgray',2); -$mgraph->SetBackgroundImage('tiger1.jpg'); -$mgraph->AddMix($graph,0,0,85); -$mgraph->AddMix($graph2,0,250,85); -$mgraph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/contour2_ex1.php b/#jpgraph/src/Examples/contour2_ex1.php deleted file mode 100644 index 764a8f29..00000000 --- a/#jpgraph/src/Examples/contour2_ex1.php +++ /dev/null @@ -1,50 +0,0 @@ -SetMargin(30, 30, 40, 30); -$graph->SetScale('intint'); -$graph->SetMarginColor('white'); - -// Setup title of graph -$graph->title->Set('Filled contour plot'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); - -$graph->subtitle->Set('(With lines and labels)'); -$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); - -// Create a new contour plot -$cp = new FilledContourPlot($data); - -// Use only blue/red color schema -$cp->UseHighContrastColor(true); - -// Flip visually -$cp->SetInvert(); - -// Fill the contours -$cp->SetFilled(true); - -// Display the labels -$cp->ShowLabels(true,true); -$cp->SetFont(FF_ARIAL,FS_BOLD,9); -$cp->SetFontColor('white'); - -// And add the plot to the graph -$graph->Add($cp); - -// Send it back to the client -$graph->stroke(); - -?> diff --git a/#jpgraph/src/Examples/contour2_ex2.php b/#jpgraph/src/Examples/contour2_ex2.php deleted file mode 100644 index b702626b..00000000 --- a/#jpgraph/src/Examples/contour2_ex2.php +++ /dev/null @@ -1,51 +0,0 @@ -SetMargin(30, 30, 40, 30); -$graph->SetScale('intint'); -$graph->SetMarginColor('white'); - -// Setup title of graph -$graph->title->Set('Filled contour plot'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); - -$graph->subtitle->Set('(No lines, no labels)'); -$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); - -// Create a new contour plot -$cp = new FilledContourPlot($data); - -// Use only blue/red color schema -$cp->UseHighContrastColor(true); - -// Flip visually -$cp->SetInvert(); - -// Fill the contours -$cp->SetFilled(true); - -// No labels -$cp->ShowLabels(false); - -// No lines -$cp->ShowLines(false); - -// And add the plot to the graph -$graph->Add($cp); - -// Send it back to the client -$graph->stroke(); - -?> diff --git a/#jpgraph/src/Examples/contour2_ex3.php b/#jpgraph/src/Examples/contour2_ex3.php deleted file mode 100644 index 93f7611d..00000000 --- a/#jpgraph/src/Examples/contour2_ex3.php +++ /dev/null @@ -1,55 +0,0 @@ -SetMargin(30, 30, 40, 30); -$graph->SetScale('intint'); -$graph->SetMarginColor('white'); - -// Setup title of graph -$graph->title->Set('Filled contour plot'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); - -$graph->subtitle->Set('(Manual colors)'); -$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); - -// Create a new contour plot with only 3 isobars -$cp = new FilledContourPlot($data,3); - -// Specify the colors manually -$isobar_colors = array('lightgray','teal:1.3','orange','red'); -$cp->SetIsobarColors($isobar_colors); - -// Use only blue/red color schema -$cp->UseHighContrastColor(true); - -// Flip visually -$cp->SetInvert(); - -// Fill the contours -$cp->SetFilled(true); - -// Display labels -$cp->ShowLabels(true); - -// No lines -$cp->ShowLines(false); - -// And add the plot to the graph -$graph->Add($cp); - -// Send it back to the client -$graph->stroke(); - -?> diff --git a/#jpgraph/src/Examples/contour2_ex4.php b/#jpgraph/src/Examples/contour2_ex4.php deleted file mode 100644 index 79e43e89..00000000 --- a/#jpgraph/src/Examples/contour2_ex4.php +++ /dev/null @@ -1,47 +0,0 @@ -SetMargin(30, 30, 40, 30); -$graph->SetScale('intint'); -$graph->SetMarginColor('white'); - -// Setup title of graph -$graph->title->Set('Filled contour plot'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); - -$graph->subtitle->Set('(labels follows gradients)'); -$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); - -// Create a new contour plot -$cp = new FilledContourPlot($data,8); - -// Flip visually -$cp->SetInvert(); - -// Fill the contours -$cp->SetFilled(true); - -// Display the labels -$cp->ShowLabels(true,true); -$cp->SetFont(FF_ARIAL,FS_BOLD,9); -$cp->SetFontColor('black'); - -// And add the plot to the graph -$graph->Add($cp); - -// Send it back to the client -$graph->stroke(); - -?> diff --git a/#jpgraph/src/Examples/contour2_ex5.php b/#jpgraph/src/Examples/contour2_ex5.php deleted file mode 100644 index 1d3ac433..00000000 --- a/#jpgraph/src/Examples/contour2_ex5.php +++ /dev/null @@ -1,52 +0,0 @@ -SetMargin(30, 30, 40, 30); -$graph->SetScale('intint'); -$graph->SetMarginColor('white'); - -// Setup title of graph -$graph->title->Set('Filled contour plot'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); - -$graph->subtitle->Set('(horizontal labels)'); -$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); - -// Create a new contour plot -$cp = new FilledContourPlot($data,8); - -// Use only black/and white schema -$cp->UseHighContrastColor(true,true); - -// Flip visually -$cp->SetInvert(); - -// Fill the contours -$cp->SetFilled(true); -// Show lines in red -$cp->ShowLines(true,'red'); - -// Display the labels -$cp->ShowLabels(true,false); -$cp->SetFont(FF_ARIAL,FS_BOLD,9); -$cp->SetFontColor('white'); - -// And add the plot to the graph -$graph->Add($cp); - -// Send it back to the client -$graph->stroke(); - -?> diff --git a/#jpgraph/src/Examples/contour2_ex6.php b/#jpgraph/src/Examples/contour2_ex6.php deleted file mode 100644 index 49755bee..00000000 --- a/#jpgraph/src/Examples/contour2_ex6.php +++ /dev/null @@ -1,53 +0,0 @@ -SetMargin(30, 30, 40, 30); -$graph->SetScale('intint'); -$graph->SetMarginColor('white'); - -// Setup title of graph -$graph->title->Set('Filled contour plot'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); - -$graph->subtitle->Set('(With lines and labels)'); -$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); - -// Create a new contour plot -$cp = new FilledContourPlot($data,7); - -// Use only blue/red color schema -$cp->UseHighContrastColor(true); - -// Flip visually -$cp->SetInvert(); - -// Fill the contours -$cp->SetFilled(true); - -// Specify method to use -$cp->SetMethod('rect'); - -// Display the labels -$cp->ShowLabels(true,true); -$cp->SetFont(FF_ARIAL,FS_BOLD,9); -$cp->SetFontColor('white'); - -// And add the plot to the graph -$graph->Add($cp); - -// Send it back to the client -$graph->stroke(); - -?> diff --git a/#jpgraph/src/Examples/contour2_ex7.php b/#jpgraph/src/Examples/contour2_ex7.php deleted file mode 100644 index b83d3dd9..00000000 --- a/#jpgraph/src/Examples/contour2_ex7.php +++ /dev/null @@ -1,53 +0,0 @@ -SetMargin(30, 30, 40, 30); -$graph->SetScale('intint'); -$graph->SetMarginColor('white'); - -// Setup title of graph -$graph->title->Set('Filled contour plot'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); - -$graph->subtitle->Set('(With lines and labels)'); -$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); - -// Create a new contour plot -$cp = new FilledContourPlot($data,7); - -// Use only blue/red color schema -$cp->UseHighContrastColor(true); - -// Flip visually -$cp->SetInvert(); - -// Fill the contours -$cp->SetFilled(true); - -// Specify method to use -$cp->SetMethod('tri'); - -// Display the labels -$cp->ShowLabels(true,true); -$cp->SetFont(FF_ARIAL,FS_BOLD,9); -$cp->SetFontColor('white'); - -// And add the plot to the graph -$graph->Add($cp); - -// Send it back to the client -$graph->stroke(); - -?> diff --git a/#jpgraph/src/Examples/contourex01.php b/#jpgraph/src/Examples/contourex01.php deleted file mode 100644 index eb2cb99c..00000000 --- a/#jpgraph/src/Examples/contourex01.php +++ /dev/null @@ -1,48 +0,0 @@ -SetMargin(40,140,60,40); - -$graph->title->Set('Example of contour plot'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -// For contour plots it is custom to use a box style ofr the axis -$graph->legend->SetPos(0.05,0.5,'right','center'); -$graph->SetScale('intint'); -$graph->SetAxisStyle(AXSTYLE_BOXOUT); -$graph->xgrid->Show(); -$graph->ygrid->Show(); - - -// A simple contour plot with default arguments (e.g. 10 isobar lines) -$cp = new ContourPlot($data); - -// Display the legend -$cp->ShowLegend(); - -// Make the isobar lines slightly thicker -$cp->SetLineWeight(2); -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/contourex02.php b/#jpgraph/src/Examples/contourex02.php deleted file mode 100644 index 73dee150..00000000 --- a/#jpgraph/src/Examples/contourex02.php +++ /dev/null @@ -1,42 +0,0 @@ -SetMargin(40,140,60,40); - -$graph->title->Set("Example of contour plot"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -// For contour plots it is custom to use a box style ofr the axis -$graph->legend->SetPos(0.05,0.5,'right','center'); -$graph->SetScale('intint'); -$graph->SetAxisStyle(AXSTYLE_BOXOUT); -$graph->xgrid->Show(); -$graph->ygrid->Show(); - - -// A simple contour plot with 12 isobar lines and flipped Y-coordinates -$cp = new ContourPlot($data,12,true); - -// Display the legend -$cp->ShowLegend(); - -// Make the isobar lines slightly thicker -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/contourex03.php b/#jpgraph/src/Examples/contourex03.php deleted file mode 100644 index ea430812..00000000 --- a/#jpgraph/src/Examples/contourex03.php +++ /dev/null @@ -1,51 +0,0 @@ -SetMargin(40,140,60,40); - -// Enable antialias. Note with antiaaliasing only line weight=1 is supported. -$graph->img->SetAntiAliasing(); - -$graph->title->Set("Example of contour plot"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -// For contour plots it is custom to use a box style ofr the axis -$graph->legend->SetPos(0.05,0.5,'right','center'); -$graph->SetScale('intint'); -$graph->SetAxisStyle(AXSTYLE_BOXOUT); -$graph->xgrid->Show(); -$graph->ygrid->Show(); - - -// A simple contour plot with 19 isobars and flipped vertical range -$cp = new ContourPlot($data,10,true); - -// Display the legend -$cp->ShowLegend(); - -// Invert the legend to th lowest isobar is on top -$cp->Invertlegend(); -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/contourex04.php b/#jpgraph/src/Examples/contourex04.php deleted file mode 100644 index d37f13b5..00000000 --- a/#jpgraph/src/Examples/contourex04.php +++ /dev/null @@ -1,50 +0,0 @@ -SetMargin(40,140,60,40); - -$graph->title->Set("Example of interpolated contour plot"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->title->SetMargin(10); - -// For contour plots it is custom to use a box style ofr the axis -$graph->legend->SetPos(0.05,0.5,'right','center'); -$graph->SetScale('intint'); - -// Setup axis and grids -$graph->SetAxisStyle(AXSTYLE_BOXOUT); -$graph->xgrid->SetLineStyle('dashed'); -$graph->xgrid->Show(true); -$graph->ygrid->SetLineStyle('dashed'); -$graph->ygrid->Show(true); - -// A simple contour plot with 10 isobar lines and flipped Y-coordinates -// Make the data smoother by interpolate the original matrice by a factor of two -// which will make each grid cell half the original size -$cp = new ContourPlot($data,10, 2); - -$cp->UseHighContrastColor(true); - -// Display the legend -$cp->ShowLegend(); - -// Make the isobar lines slightly thicker -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/contourex05.php b/#jpgraph/src/Examples/contourex05.php deleted file mode 100644 index 4af9ca8b..00000000 --- a/#jpgraph/src/Examples/contourex05.php +++ /dev/null @@ -1,59 +0,0 @@ -SetMargin(40,120,60,50); - -$graph->title->Set("Contour plot, high contrast color"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->SetMargin(10); - -// For contour plots it is custom to use a box style ofr the axis -$graph->SetScale('intint',0,56,0,56); - -// Setup axis and grids -$graph->SetAxisStyle(AXSTYLE_BOXOUT); -$graph->xgrid->Show(true); -$graph->ygrid->Show(true); - -// A simple contour plot with 10 isobar lines and flipped Y-coordinates -// Make the data smoother by interpolate the original matrice by a factor of two -// which will make each grid cell half the original size -$cp = new ContourPlot($data,10, 3); - -$cp->UseHighContrastColor(true); - -// Display the legend -$cp->ShowLegend(); - -// Make the isobar lines slightly thicker -$graph->Add($cp); - -// ... and send the graph back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/csim_in_html_ex1.php b/#jpgraph/src/Examples/csim_in_html_ex1.php deleted file mode 100644 index 2c08e095..00000000 --- a/#jpgraph/src/Examples/csim_in_html_ex1.php +++ /dev/null @@ -1,61 +0,0 @@ - - - -GetHTMLImageMap($_mapname); -echo $imgmap; - -?> - -

This is an example page with CSIM graphs with arbitrary HTML text

- -Clicked on bar: <none>'; -} -else { - echo 'Clicked on bar: '.$_GET['clickedon'].''; -} -echo '

'; -?> - -

First we need to get hold of the image map and include it in the HTML - page.

-

For this graph it is:

-'.htmlentities($imgmap).'';?> - - tag and rebuild the -$imgtag = $graph->GetCSIMImgHTML($_mapname,$_graphfilename); -?> -

The graph is then be displayed as shown in figure 1. With the following - created <img> tag:

-

-
-
- - -

- -
Figure 1. The included CSIM graph. -

- - - diff --git a/#jpgraph/src/Examples/csim_in_html_ex2.php b/#jpgraph/src/Examples/csim_in_html_ex2.php deleted file mode 100644 index c94bda3c..00000000 --- a/#jpgraph/src/Examples/csim_in_html_ex2.php +++ /dev/null @@ -1,100 +0,0 @@ - - - -GetHTMLImageMap($_mapname1); -$imgmap2 = $piegraph->GetHTMLImageMap($_mapname2); -echo $imgmap1; -echo $imgmap2; - -?> - -

This is an example page with CSIM graphs with arbitrary HTML text

- -Clicked on bar: <none>'; -} -else { - echo 'Clicked on bar: '.$_GET['clickedon'].''; -} -echo '

'; -if( empty($_GET['pie_clickedon']) ) { - echo 'Clicked on pie slice: <none>'; -} -else { - echo 'Clicked on pie slice: '.$_GET['pie_clickedon'].''; -} -echo '

'; -?> - -

First we need to get hold of the image maps and include them in the HTML - page.

-

For these graphs the maps are:

-
'.htmlentities($imgmap1).'
'; -?> -

-and -

-
'.htmlentities($imgmap2).'
'; -?> - - tags for Figure 1 & 2 and rebuild the URL arguments -$imgtag1 = $graph->GetCSIMImgHTML($_mapname1,$_graphfilename1); -$imgtag2 = $piegraph->GetCSIMImgHTML($_mapname2,$_graphfilename2); -?> -

The graphs are then displayed as shown in figure 1 & 2. With the following - created <img> tags:

-
-
-
- -

-Note: For the Pie the center is counted as the first slice. -

- -

- - - - -
- -
Figure 1. The included Bar CSIM graph. -

-
- -
Figure 2. The included Pie CSIM graph. -

-
- - diff --git a/#jpgraph/src/Examples/csim_in_html_graph_ex1.php b/#jpgraph/src/Examples/csim_in_html_graph_ex1.php deleted file mode 100644 index b734c860..00000000 --- a/#jpgraph/src/Examples/csim_in_html_graph_ex1.php +++ /dev/null @@ -1,46 +0,0 @@ -SetScale('textlin'); -$graph->SetMargin(50,80,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); - -$n = count($datay) ; // Number of bars - -global $_wrapperfilename; - -// Create targets for the image maps. One for each column -$targ = array(); $alt = array(); $wtarg = array(); -for( $i=0; $i < $n; ++$i ) { - $urlarg = 'clickedon='.($i+1); - $targ[] = $_wrapperfilename.'?'.$urlarg; - $alt[] = 'val=%d'; - $wtarg[] = ''; -} -$bplot->SetCSIMTargets($targ,$alt,$wtarg); - -$graph->Add($bplot); - -$graph->title->Set('Multiple Image maps'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->title->SetCSIMTarget('#45','Title for Bar','_blank'); - -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetCSIMTarget('#55','Y-axis title'); -$graph->yaxis->title->Set("Y-title"); - -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetCSIMTarget('#55','X-axis title'); -$graph->xaxis->title->Set("X-title"); - -// Send back the image when we are called from within the tag -$graph->StrokeCSIMImage(); - -?> diff --git a/#jpgraph/src/Examples/csim_in_html_graph_ex2.php b/#jpgraph/src/Examples/csim_in_html_graph_ex2.php deleted file mode 100644 index 8c59c0c3..00000000 --- a/#jpgraph/src/Examples/csim_in_html_graph_ex2.php +++ /dev/null @@ -1,75 +0,0 @@ -SetFrame(false); - -// Setup title -$piegraph->title->Set("CSIM Center Pie plot"); -$piegraph->title->SetFont(FF_ARIAL,FS_BOLD,18); -$piegraph->title->SetMargin(8); // Add a little bit more margin from the top - -// Create the pie plot -$p1 = new PiePlotC($data); - -// Set the radius of pie (as fraction of image size) -$p1->SetSize(0.32); - -// Label font and color setup -$p1->value->SetFont(FF_ARIAL,FS_BOLD,11); -$p1->value->SetColor('white'); - -// Setup the title on the center circle -$p1->midtitle->Set("Distribution\n2008 H1"); -$p1->midtitle->SetFont(FF_ARIAL,FS_NORMAL,12); - -// Set color for mid circle -$p1->SetMidColor('yellow'); - -// Use percentage values in the legends values (This is also the default) -$p1->SetLabelType(PIE_VALUE_PER); - -// The label array values may have printf() formatting in them. The argument to the -// form,at string will be the value of the slice (either the percetage or absolute -// depending on what was specified in the SetLabelType() above. -$lbl = array("Jan\n%.1f%%","Feb\n%.1f%%","March\n%.1f%%", - "Apr\n%.1f%%","May\n%.1f%%","Jun\n%.1f%%"); -$p1->SetLabels($lbl); - -// Add drop shadow to slices -$p1->SetShadow(); - -// Explode all slices 15 pixels -$p1->ExplodeAll(15); - -// Setup the CSIM targets -global $_wrapperfilename; -$targ = array(); $alt = array(); $wtarg = array(); -for( $i=0; $i <= $n; ++$i ) { - $urlarg = 'pie_clickedon='.($i+1); - $targ[] = $_wrapperfilename.'?'.$urlarg; - $alt[] = 'val=%d'; - $wtarg[] = ''; -} -$p1->SetCSIMTargets($targ,$alt,$wtarg); -$p1->SetMidCSIM($targ[0],$alt[0],$wtarg[0]); - -// Add plot to pie graph -$piegraph->Add($p1); - -// Send back the image when we are called from within the tag -$piegraph->StrokeCSIMImage(); - -?> - - diff --git a/#jpgraph/src/Examples/datamatrix_ex0.php b/#jpgraph/src/Examples/datamatrix_ex0.php deleted file mode 100644 index 8de25222..00000000 --- a/#jpgraph/src/Examples/datamatrix_ex0.php +++ /dev/null @@ -1,18 +0,0 @@ -SetEncoding(ENCODING_ASCII); -$backend = DatamatrixBackendFactory::Create($encoder); - -// We increase the module width to 3 pixels -$backend->SetModuleWidth(3); - -try { - $backend->Stroke($data); -} catch (Exception $e) { - echo 'Datamatrix error: '.$e->GetMessage()."\n"; - exit(1); -} -?> diff --git a/#jpgraph/src/Examples/datamatrix_ex00.php b/#jpgraph/src/Examples/datamatrix_ex00.php deleted file mode 100644 index 1aec89f3..00000000 --- a/#jpgraph/src/Examples/datamatrix_ex00.php +++ /dev/null @@ -1,9 +0,0 @@ -Stroke($data); -?> diff --git a/#jpgraph/src/Examples/datamatrix_ex1.php b/#jpgraph/src/Examples/datamatrix_ex1.php deleted file mode 100644 index a2e73583..00000000 --- a/#jpgraph/src/Examples/datamatrix_ex1.php +++ /dev/null @@ -1,18 +0,0 @@ -SetModuleWidth(3); - -// Create the barcode from the given data string and write to output file -try { - $backend->Stroke($data); -} catch (Exception $e) { - $errstr = $e->GetMessage(); - echo "Datamatrix error message: $errstr\n"; -} - -?> diff --git a/#jpgraph/src/Examples/datamatrix_ex2.php b/#jpgraph/src/Examples/datamatrix_ex2.php deleted file mode 100644 index e7c9462b..00000000 --- a/#jpgraph/src/Examples/datamatrix_ex2.php +++ /dev/null @@ -1,21 +0,0 @@ -SetEncoding(ENCODING_BASE256); - -// Create the image backend (default) -$backend = DatamatrixBackendFactory::Create($encoder); -$backend->SetModuleWidth(3); - -try { - $backend->Stroke($data); -} catch (Exception $e) { - $errstr = $e->GetMessage(); - echo "Datamatrix error message: $errstr\n"; -} - -?> diff --git a/#jpgraph/src/Examples/datamatrix_ex3.php b/#jpgraph/src/Examples/datamatrix_ex3.php deleted file mode 100644 index 6b6b8279..00000000 --- a/#jpgraph/src/Examples/datamatrix_ex3.php +++ /dev/null @@ -1,21 +0,0 @@ -SetEncoding(ENCODING_BASE256); - -// Create the image backend (default) -$backend = DatamatrixBackendFactory::Create($encoder); -$backend->SetModuleWidth(3); - -try { - $backend->Stroke($data); -} catch (Exception $e) { - $errstr = $e->GetMessage(); - echo "Datamatrix error message: $errstr\n"; -} - -?> diff --git a/#jpgraph/src/Examples/datamatrix_ex4.php b/#jpgraph/src/Examples/datamatrix_ex4.php deleted file mode 100644 index 77b36674..00000000 --- a/#jpgraph/src/Examples/datamatrix_ex4.php +++ /dev/null @@ -1,25 +0,0 @@ -SetEncoding(ENCODING_TEXT); - -// Create the image backend (default) -$backend = DatamatrixBackendFactory::Create($encoder); -$backend->SetModuleWidth(3); - -// Adjust the Quiet zone -$backend->SetQuietZone(10); - -// Create the barcode from the given data string and write to output file -try { - $backend->Stroke($data); -} catch (Exception $e) { - $errstr = $e->GetMessage(); - echo "Datamatrix error message: $errstr\n"; -} - -?> diff --git a/#jpgraph/src/Examples/datamatrix_ex5.php b/#jpgraph/src/Examples/datamatrix_ex5.php deleted file mode 100644 index 9242252e..00000000 --- a/#jpgraph/src/Examples/datamatrix_ex5.php +++ /dev/null @@ -1,30 +0,0 @@ -SetEncoding(ENCODING_TEXT); - -// Create the image backend (default) -$backend = DatamatrixBackendFactory::Create($encoder); - -// By default the module width is 2 pixel so we increase it a bit -$backend->SetModuleWidth(4); - -// Set Quiet zone -$backend->SetQuietZone(10); - -// Set other than default colors (one, zero, quiet zone/background) -$backend->SetColor('navy','white','lightgray'); - -// Create the barcode from the given data string and write to output file -try { - $backend->Stroke($data); -} catch (Exception $e) { - $errstr = $e->GetMessage(); - echo "Datamatrix error message: $errstr\n"; -} - -?> diff --git a/#jpgraph/src/Examples/datamatrix_ex6.php b/#jpgraph/src/Examples/datamatrix_ex6.php deleted file mode 100644 index 918bc4b1..00000000 --- a/#jpgraph/src/Examples/datamatrix_ex6.php +++ /dev/null @@ -1,33 +0,0 @@ -SetEncoding(ENCODING_TEXT); - -// Create the image backend (default) -$backend = DatamatrixBackendFactory::Create($encoder); -$backend->SetModuleWidth(5); -$backend->SetQuietZone(10); - -// Set other than default colors (one, zero, background) -$backend->SetColor('navy','white'); - -// Create the barcode from the given data string and write to output file -$dir = dirname(__FILE__); -$file = '"'.$dir.'/'.$outputfile.'"'; -try { - $backend->Stroke($data,$outputfile); - echo 'Barcode sucessfully written to file: '.$file; -} catch (Exception $e) { - $errstr = $e->GetMessage(); - $errcode = $e->GetCode(); - echo "Failed writing file: ".$file.'
'; - echo "Datamatrix error ($errcode). Message: $errstr\n"; -} - -?> diff --git a/#jpgraph/src/Examples/datamatrix_ex7.php b/#jpgraph/src/Examples/datamatrix_ex7.php deleted file mode 100644 index a27d42cf..00000000 --- a/#jpgraph/src/Examples/datamatrix_ex7.php +++ /dev/null @@ -1,22 +0,0 @@ -SetEncoding(ENCODING_BASE256); - -// Create the image backend (default) -$backend = DatamatrixBackendFactory::Create($encoder, BACKEND_ASCII); -$backend->SetModuleWidth(3); - -try { - $ps_txt = $backend->Stroke($data); - echo '

'.$ps_txt.'
'; -} catch (Exception $e) { - $errstr = $e->GetMessage(); - echo "Datamatrix error message: $errstr\n"; -} - -?> diff --git a/#jpgraph/src/Examples/dataset01.inc.php b/#jpgraph/src/Examples/dataset01.inc.php deleted file mode 100644 index 6ac7f2b0..00000000 --- a/#jpgraph/src/Examples/dataset01.inc.php +++ /dev/null @@ -1,275 +0,0 @@ - 1.0885908919277, 1 => - 0.99034385297982, 2 => 0.97005467188578, 3 => - 0.99901201350824, 4 => 1.1263167971152, 5 => - 1.0582808133448, 6 => 1.0216740689064, 7 => - 0.96626236356644, 8 => 1.0125912828768, 9 => - 0.99047473992496, 10 => 0.99102472104561, 11 => - 0.98500781573283, 12 => 0.91933668914198, 13 => - 0.92234602792711, 14 => 0.88933863410054, 15 => - 0.94236150975178, 16 => 0.98924287679116, 17 => - 1.0342765545566, 18 => 1.0538510278089, 19 => - 0.93496076181191, 20 => 0.90944479677235, 21 => - 0.80831866316983, 22 => 0.81912434615535, 23 => - 0.83143770042109, 24 => 0.86972168159496, 25 => - 0.92645774571577, 26 => 0.81169120061422, 27 => - 0.84409853057606, 28 => 0.89065856249272, 29 => - 0.83551478929348, 30 => 0.87015680306726, 31 => - 0.76063327042172, 32 => 0.82720958380697, 33 => - 0.86565279505723, 34 => 0.77858966246836, 35 => - 0.81009606378237, 36 => 0.80485136798149, 37 => - 0.82641461943804, 38 => 0.87442020676513, 39 => - 0.89589150146825, 40 => 0.92082995956816, 41 => - 0.92614241931726, 42 => 0.96915564652581, 43 => - 1.003753706293, 44 => 0.97438809368023, 45 => - 1.011556766867, 46 => 1.0785692014115, 47 => - 1.0586915420364, 48 => 1.284210059027, 49 => - 1.3424512661794, 50 => 1.1743365450983, 51 => - 1.2387345559532, 52 => 1.2485728609648, 53 => - 1.2330096418558, 54 => 1.1857882621709, 55 => - 1.2344956522411, 56 => 1.2047675730648, 57 => - 1.292419000136, 58 => 1.3405480219013, 59 => - 1.3971752198648, 60 => 1.4359555309649, 61 => - 1.3243735045701, 62 => 1.2359389187087, 63 => - 1.2201320423161, 64 => 1.3602246705197, 65 => - 1.360886940568, 66 => 1.3493553211075, 67 => - 1.4401769929405, 68 => 1.3979767849951, 69 => - 1.4545882591647, 70 => 1.337801210539, 71 => - 1.3793601365977, 72 => 1.4586769476223, 73 => - 1.5230946076475, 74 => 1.4124735946125, 75 => - 1.4030318592551, 76 => 1.349158816711, 77 => - 1.3994840622105, 78 => 1.4239672612346, 79 => - 1.40812256221, 80 => 1.4583856197192, 81 => - 1.4613314581567, 82 => 1.6756755916668, 83 => - 1.8580313939158, 84 => 1.8342360959805, 85 => - 1.9216082598086, 86 => 1.9478846253628, 87 => - 2.0244872112436, 88 => 1.9560660777181, 89 => - 1.8415152640121, 90 => 1.8471764273372, 91 => - 1.8889886695023, 92 => 1.8195007209252, 93 => - 1.8960270595999, 94 => 1.8644490575386, 95 => - 1.971196340772, 96 => 2.015583152659, 97 => - 1.9959882430428, 98 => 2.1063668082622, 99 => - 2.1719175769191, 100 => 2.1875938345039, 101 => - 2.1587594039981, 102 => 2.1278241823627, 103 => - 2.298793912594, 104 => 2.3723774302753, 105 => - 2.4413392788904, 106 => 2.4834594954125, 107 => - 2.5164271989421, 108 => 2.48274719503, 109 => - 2.4492997581034, 110 => 2.1412357263019, 111 => - 2.0314268112566, 112 => 1.9596098764628, 113 => - 2.0250983127109, 114 => 1.924959829851, 115 => - 1.9603612943993, 116 => 2.0540576271866, 117 => - 2.0568349960689, 118 => 2.0811524692325, 119 => - 2.0581964759165, 120 => 2.020162840272, 121 => - 2.0626517638667, 122 => 1.9286563823225, 123 => - 2.0127912437563, 124 => 1.9491858277931, 125 => - 1.8692310150316, 126 => 1.6993275416762, 127 => - 1.5849680675709, 128 => 1.5422481968304, 129 => - 1.603188853916, 130 => 1.6449504349551, 131 => - 1.6570332084417, 132 => 1.7563884552262, 133 => - 1.7346008663135, 134 => 1.741307942998, 135 => - 1.7415848536123, 136 => 1.7014366147405, 137 => - 1.6719646364256, 138 => 1.7092888030342, 139 => - 1.7371529028402, 140 => 1.7019154041991, 141 => - 1.7662473702497, 142 => 1.8480766044197, 143 => - 1.8355114169662, 144 => 1.7819817315586, 145 => - 1.7148079481036, 146 => 1.6241989833489, 147 => - 1.4624626548138, 148 => 1.5040542012939, 149 => - 1.442295346913, 150 => 1.4187087000604, 151 => - 1.4225097958511, 152 => 1.5001324671865, 153 => - 1.4584802723727, 154 => 1.5342572961469, 155 => - 1.514133174734, 156 => 1.5443934302345, 157 => - 1.5476883863698, 158 => 1.6080128685721, 159 => - 1.5816649899396, 160 => 1.5310436755918, 161 => - 1.518280754595, 162 => 1.5216184249044, 163 => - 1.4393414811719, 164 => 1.409379582707, 165 => - 1.436861898056, 166 => 1.4739894373751, 167 => - 1.4512785421546, 168 => 1.496057581316, 169 => - 1.3817455776456, 170 => 1.2990312802211, 171 => - 1.3073949130374, 172 => 1.2473214566896, 173 => - 1.1105915111374, 174 => 1.0420360580822, 175 => - 1.1744654786356, 176 => 1.0602876800127, 177 => - 1.074408841208, 178 => 1.18387615056, 179 => - 1.1890999077101, 180 => 1.0549293038746, 181 => - 1.0570601708416, 182 => 1.0800216692849, 183 => - 0.96274117702549, 184 => 0.9501673977047, 185 => - 0.97710108451711, 186 => 0.89886322996001, 187 => - 0.9239453369566, 188 => 0.96299807255386, 189 => - 1.0105532418267, 190 => 1.0164009465948, 191 => - 1.0413107606824, 192 => 1.0475248122459, 193 => - 1.0266007451985, 194 => 1.0159556206533, 195 => - 1.0943852922517, 196 => 1.0750418553654, 197 => - 0.97774129938915, 198 => 0.98590717162284, 199 => - 0.87713795242119, 200 => 0.90770624057599, 201 => - 0.87557547650302, 202 => 0.95754187545856, 203 => - 1.0111465867283, 204 => 0.93224663470275, 205 => - 0.93886113881632, 206 => 0.94128877256653, 207 => - 0.9559086414866, 208 => 0.97782683000598, 209 => - 1.0648991708916, 210 => 1.1759619281479, 211 => - 1.1323001889786, 212 => 1.2173222321276, 213 => - 1.192219780365, 214 => 1.1507367671992, 215 => - 1.0062415877475, 216 => 1.0017043563084, 217 => - 0.94468309902865, 218 => 0.99384124056529, 219 => - 1.0514822705943, 220 => 1.0451723914426, 221 => - 1.0776122119814, 222 => 1.2013601009631, 223 => - 1.1765086398423, 224 => 1.2387735028784, 225 => - 1.2441365026242, 226 => 1.2694500268723, 227 => - 1.2789962941485, 228 => 1.2442094256309, 229 => - 1.2352688438234, 230 => 1.2571277155372, 231 => - 1.3291795377077, 232 => 1.2703480599183, 233 => - 1.30729508393, 234 => 1.3233030218068, 235 => - 1.2861232143244, 236 => 1.3168684998023, 237 => - 1.2499001566772, 238 => 1.2622769692485, 239 => - 1.2160789893735, 240 => 1.2288877111321, 241 => - 1.222967255453, 242 => 1.2998243638567, 243 => - 1.3443008723449, 244 => 1.339680674028, 245 => - 1.3779965791538, 246 => 1.3560080691721, 247 => - 1.3470544172094, 248 => 1.3166882067851, 249 => - 1.4452459865932, 250 => 1.4514278120119, 251 => - 1.413690283372, 252 => 1.4178934332405, 253 => - 1.4237414657565, 254 => 1.3777636409301, 255 => - 1.4041849448389, 256 => 1.4049533546771, 257 => - 1.4277375831259, 258 => 1.4224090113077, 259 => - 1.4647907974628, 260 => 1.4243190632657, 261 => - 1.4286580133998, 262 => 1.4348828641501, 263 => - 1.415409243977, 264 => 1.4476028555859, 265 => - 1.4538821661641, 266 => 1.4883184435336, 267 => - 1.4205032194634, 268 => 1.3856543933372, 269 => - 1.2716906168086, 270 => 1.3462117624752, 271 => - 1.3003015423298, 272 => 1.2148491725878, 273 => - 1.2605381058318, 274 => 1.2690047369619, 275 => - 1.3327723638582, 276 => 1.3118643588249, 277 => - 1.293007944258, 278 => 1.2548761810876, 279 => - 1.3335015938603, 280 => 1.3152744239077, 281 => - 1.2564376463182, 282 => 1.2478417859372, 283 => - 1.2518821298414, 284 => 1.2036453589032, 285 => - 1.1798564480155, 286 => 1.2062515260098, 287 => - 1.2129817801455, 288 => 1.1405762096618, 289 => - 1.0161049810033, 290 => 1.0030124197677, 291 => - 1.0111565082559, 292 => 1.0084286839061, 293 => - 0.95068297130577, 294 => 1.0450005357207, 295 => - 1.211596899292, 296 => 1.3762615912002, 297 => - 1.530127116787, 298 => 1.5167370832585, 299 => - 1.6259521507076, 300 => 1.6518467383405, 301 => - 1.7713043850286, 302 => 1.6396708687084, 303 => - 1.6116177484122, 304 => 1.5225729470695, 305 => - 1.6101471149808); - - -$xdata = array( - - 0 => 444348000, 1 => 446853600, 2 => - 449532000, 3 => 452124000, 4 => 454802400, 5 => - 457394400, 6 => 460072800, 7 => 462751200, 8 => - 465343200, 9 => 468021600, 10 => 470613600, 11 => - 473292000, 12 => 475970400, 13 => 478389600, 14 => - 481068000, 15 => 483660000, 16 => 486338400, 17 => - 488930400, 18 => 491608800, 19 => 494287200, 20 => - 496879200, 21 => 499557600, 22 => 502149600, 23 => - 504828000, 24 => 507506400, 25 => 509925600, 26 => - 512604000, 27 => 515196000, 28 => 517874400, 29 => - 520466400, 30 => 523144800, 31 => 525823200, 32 => - 528415200, 33 => 531093600, 34 => 533685600, 35 => - 536364000, 36 => 539042400, 37 => 541461600, 38 => - 544140000, 39 => 546732000, 40 => 549410400, 41 => - 552002400, 42 => 554680800, 43 => 557359200, 44 => - 559951200, 45 => 562629600, 46 => 565221600, 47 => - 567900000, 48 => 570578400, 49 => 573084000, 50 => - 575762400, 51 => 578354400, 52 => 581032800, 53 => - 583624800, 54 => 586303200, 55 => 588981600, 56 => - 591573600, 57 => 594252000, 58 => 596844000, 59 => - 599522400, 60 => 602200800, 61 => 604620000, 62 => - 607298400, 63 => 609890400, 64 => 612568800, 65 => - 615160800, 66 => 617839200, 67 => 620517600, 68 => - 623109600, 69 => 625788000, 70 => 628380000, 71 => - 631058400, 72 => 633736800, 73 => 636156000, 74 => - 638834400, 75 => 641426400, 76 => 644104800, 77 => - 646696800, 78 => 649375200, 79 => 652053600, 80 => - 654645600, 81 => 657324000, 82 => 659916000, 83 => - 662594400, 84 => 665272800, 85 => 667692000, 86 => - 670370400, 87 => 672962400, 88 => 675640800, 89 => - 678232800, 90 => 680911200, 91 => 683589600, 92 => - 686181600, 93 => 688860000, 94 => 691452000, 95 => - 694130400, 96 => 696808800, 97 => 699314400, 98 => - 701992800, 99 => 704584800, 100 => 707263200, 101 => - 709855200, 102 => 712533600, 103 => 715212000, 104 => - 717804000, 105 => 720482400, 106 => 723074400, 107 => - 725752800, 108 => 728431200, 109 => 730850400, 110 => - 733528800, 111 => 736120800, 112 => 738799200, 113 => - 741391200, 114 => 744069600, 115 => 746748000, 116 => - 749340000, 117 => 752018400, 118 => 754610400, 119 => - 757288800, 120 => 759967200, 121 => 762386400, 122 => - 765064800, 123 => 767656800, 124 => 770335200, 125 => - 772927200, 126 => 775605600, 127 => 778284000, 128 => - 780876000, 129 => 783554400, 130 => 786146400, 131 => - 788824800, 132 => 791503200, 133 => 793922400, 134 => - 796600800, 135 => 799192800, 136 => 801871200, 137 => - 804463200, 138 => 807141600, 139 => 809820000, 140 => - 812412000, 141 => 815090400, 142 => 817682400, 143 => - 820360800, 144 => 823039200, 145 => 825544800, 146 => - 828223200, 147 => 830815200, 148 => 833493600, 149 => - 836085600, 150 => 838764000, 151 => 841442400, 152 => - 844034400, 153 => 846712800, 154 => 849304800, 155 => - 851983200, 156 => 854661600, 157 => 857080800, 158 => - 859759200, 159 => 862351200, 160 => 865029600, 161 => - 867621600, 162 => 870300000, 163 => 872978400, 164 => - 875570400, 165 => 878248800, 166 => 880840800, 167 => - 883519200, 168 => 886197600, 169 => 888616800, 170 => - 891295200, 171 => 893887200, 172 => 896565600, 173 => - 899157600, 174 => 901836000, 175 => 904514400, 176 => - 907106400, 177 => 909784800, 178 => 912376800, 179 => - 915055200, 180 => 917733600, 181 => 920152800, 182 => - 922831200, 183 => 925423200, 184 => 928101600, 185 => - 930693600, 186 => 933372000, 187 => 936050400, 188 => - 938642400, 189 => 941320800, 190 => 943912800, 191 => - 946591200, 192 => 949269600, 193 => 951775200, 194 => - 954453600, 195 => 957045600, 196 => 959724000, 197 => - 962316000, 198 => 964994400, 199 => 967672800, 200 => - 970264800, 201 => 972943200, 202 => 975535200, 203 => - 978213600, 204 => 980892000, 205 => 983311200, 206 => - 985989600, 207 => 988581600, 208 => 991260000, 209 => - 993852000, 210 => 996530400, 211 => 999208800, 212 => - 1001800800, 213 => 1004479200, 214 => 1007071200, - 215 => 1009749600, 216 => 1012428000, 217 => - 1014847200, 218 => 1017525600, 219 => 1020117600, - 220 => 1022796000, 221 => 1025388000, 222 => - 1028066400, 223 => 1030744800, 224 => 1033336800, - 225 => 1036015200, 226 => 1038607200, 227 => - 1041285600, 228 => 1043964000, 229 => 1046383200, - 230 => 1049061600, 231 => 1051653600, 232 => - 1054332000, 233 => 1056924000, 234 => 1059602400, - 235 => 1062280800, 236 => 1064872800, 237 => - 1067551200, 238 => 1070143200, 239 => 1072821600, - 240 => 1075500000, 241 => 1078005600, 242 => - 1080684000, 243 => 1083276000, 244 => 1085954400, - 245 => 1088546400, 246 => 1091224800, 247 => - 1093903200, 248 => 1096495200, 249 => 1099173600, - 250 => 1101765600, 251 => 1104444000, 252 => - 1107122400, 253 => 1109541600, 254 => 1112220000, - 255 => 1114812000, 256 => 1117490400, 257 => - 1120082400, 258 => 1122760800, 259 => 1125439200, - 260 => 1128031200, 261 => 1130709600, 262 => - 1133301600, 263 => 1135980000, 264 => 1138658400, - 265 => 1141077600, 266 => 1143756000, 267 => - 1146348000, 268 => 1149026400, 269 => 1151618400, - 270 => 1154296800, 271 => 1156975200, 272 => - 1159567200, 273 => 1162245600, 274 => 1164837600, - 275 => 1167516000, 276 => 1170194400, 277 => - 1172613600, 278 => 1175292000, 279 => 1177884000, - 280 => 1180562400, 281 => 1183154400, 282 => - 1185832800, 283 => 1188511200, 284 => 1191103200, - 285 => 1193781600, 286 => 1196373600, 287 => - 1199052000, 288 => 1201730400, 289 => 1204236000, - 290 => 1206914400, 291 => 1209506400, 292 => - 1212184800, 293 => 1214776800, 294 => 1217455200, - 295 => 1220133600, 296 => 1222725600, 297 => - 1225404000, 298 => 1227996000, 299 => 1230674400, - 300 => 1233352800, 301 => 1235772000, 302 => - 1238450400, 303 => 1241042400, 304 => 1243720800, - 305 => 1246312800, - ); - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/dateaxisex1.php b/#jpgraph/src/Examples/dateaxisex1.php deleted file mode 100644 index 58e4348f..00000000 --- a/#jpgraph/src/Examples/dateaxisex1.php +++ /dev/null @@ -1,55 +0,0 @@ -SetMargin(40,40,30,70); -$graph->title->Set('Date: '.date('Y-m-d',$now)); -$graph->SetAlphaBlending(); - -// Setup a manual x-scale (We leave the sentinels for the -// Y-axis at 0 which will then autoscale the Y-axis.) -// We could also use autoscaling for the x-axis but then it -// probably will start a little bit earlier than the first value -// to make the first value an even number as it sees the timestamp -// as an normal integer value. -$graph->SetScale("intlin",0,200,$now,$datax[$n-1]); - -// Setup the x-axis with a format callback to convert the timestamp -// to a user readable time -$graph->xaxis->SetLabelFormatCallback('TimeCallback'); -$graph->xaxis->SetLabelAngle(90); - -// Create the line -$p1 = new LinePlot($datay,$datax); -$p1->SetColor("blue"); - -// Set the fill color partly transparent -$p1->SetFillColor("blue@0.4"); - -// Add lineplot to the graph -$graph->Add($p1); - -// Output line -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/dateaxisex2.php b/#jpgraph/src/Examples/dateaxisex2.php deleted file mode 100644 index c0a306c1..00000000 --- a/#jpgraph/src/Examples/dateaxisex2.php +++ /dev/null @@ -1,38 +0,0 @@ -SetMargin(40,40,30,130); - -// Fix the Y-scale to go between [0,100] and use date for the x-axis -$graph->SetScale('datlin',0,100); -$graph->title->Set("Example on Date scale"); - -// Set the angle for the labels to 90 degrees -$graph->xaxis->SetLabelAngle(90); - -$line = new LinePlot($data,$xdata); -$line->SetLegend('Year 2005'); -$line->SetFillColor('lightblue@0.5'); -$graph->Add($line); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/dateaxisex3.php b/#jpgraph/src/Examples/dateaxisex3.php deleted file mode 100644 index 02db7cc5..00000000 --- a/#jpgraph/src/Examples/dateaxisex3.php +++ /dev/null @@ -1,48 +0,0 @@ -SetMargin(40,40,30,130); - -// Fix the Y-scale to go between [0,100] and use date for the x-axis -$graph->SetScale('datlin',0,100); -$graph->title->Set("Example on Date scale"); - -// Set the angle for the labels to 90 degrees -$graph->xaxis->SetLabelAngle(90); - -// It is possible to adjust the density for the X-axis as well -// The following call makes the dates a little more sparse -// $graph->SetTickDensity(TICKD_NORMAL,TICKD_SPARSE); - -// The automatic format string for dates can be overridden -// $graph->xaxis->scale->SetDateFormat('h:i'); - -// Adjust the start/end to a specific alignment -$graph->xaxis->scale->SetTimeAlign(MINADJ_15); - -$line = new LinePlot($data,$xdata); -$line->SetLegend('Year 2005'); -$line->SetFillColor('lightblue@0.5'); -$graph->Add($line); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/dateaxisex4.php b/#jpgraph/src/Examples/dateaxisex4.php deleted file mode 100644 index dab6cd6f..00000000 --- a/#jpgraph/src/Examples/dateaxisex4.php +++ /dev/null @@ -1,44 +0,0 @@ -SetMargin(40,40,30,130); - -// Fix the Y-scale to go between [0,100] and use date for the x-axis -$graph->SetScale('datlin',0,100); -$graph->title->Set("Example on Date scale"); - -// Set the angle for the labels to 90 degrees -$graph->xaxis->SetLabelAngle(90); - -// The automatic format string for dates can be overridden -$graph->xaxis->scale->SetDateFormat('H:i'); - -// Adjust the start/end to a specific alignment -$graph->xaxis->scale->SetTimeAlign(MINADJ_10); - -$line = new LinePlot($data,$xdata); -$line->SetLegend('Year 2005'); -$line->SetFillColor('lightblue@0.5'); -$graph->Add($line); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/datescaleticksex01.php b/#jpgraph/src/Examples/datescaleticksex01.php deleted file mode 100644 index 5bdcbe54..00000000 --- a/#jpgraph/src/Examples/datescaleticksex01.php +++ /dev/null @@ -1,63 +0,0 @@ -SetMargin(80,30,50,40); -$graph->SetMarginColor('white'); -$graph->SetScale('dateint'); -$graph->title->Set('Current Bids'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set('(Updated every 5 minutes)'); -$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10); - -// Enable antialias -$graph->img->SetAntiAliasing(); - -// Setup the y-axis to show currency values -$graph->yaxis->SetLabelFormatCallback('number_format'); -$graph->yaxis->SetLabelFormat('$%s'); - -//Use hour:minute format for the labels -$graph->xaxis->scale->SetDateFormat('H:i'); - -// Force labels to only be displayed every 5 minutes -$graph->xaxis->scale->ticks->Set(INTERVAL); - -// Adjust the start time for an "even" 5 minute, i.e. 5,10,15,20,25, ... -$graph->xaxis->scale->SetTimeAlign(MINADJ_5); - -// Create the plots using the dummy data created at the beginning -$line = array(); -for( $i=0; $i < $m; ++$i ) { - $line[$i] = new LinePlot($bids[$i],$times); - $line[$i]->mark->SetType(MARK_SQUARE); -} -$graph->Add($line); - -// Send the graph back to the client -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/dateutilex01.php b/#jpgraph/src/Examples/dateutilex01.php deleted file mode 100644 index 75f0d331..00000000 --- a/#jpgraph/src/Examples/dateutilex01.php +++ /dev/null @@ -1,53 +0,0 @@ -SetScale('intlin',0,0,min($xdata),max($xdata)); -$graph->SetMargin(60,20,40,60); - -// Setup the titles -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->Set('Development since 1984'); -$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10); -$graph->subtitle->Set('(Example using DateScaleUtils class)'); - -// Setup the labels to be correctly format on the X-axis -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8); -$graph->xaxis->SetLabelAngle(30); - -// The second paramter set to 'true' will make the library interpret the -// format string as a date format. We use a Month + Year format -$graph->xaxis->SetLabelFormatString('M, Y',true); - -// Get manual tick every second year -list($tickPos,$minTickPos) = $dateUtils->getTicks($xdata,DSUTILS_YEAR2); -$graph->xaxis->SetTickPositions($tickPos,$minTickPos); - -// First add an area plot -$lp1 = new LinePlot($ydata,$xdata); -$lp1->SetWeight(0); -$lp1->SetFillColor('orange@0.85'); -$graph->Add($lp1); - -// And then add line. We use two plots in order to get a -// more distinct border on the graph -$lp2 = new LinePlot($ydata,$xdata); -$lp2->SetColor('orange'); -$graph->Add($lp2); - -// And send back to the client -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/dateutilex02.php b/#jpgraph/src/Examples/dateutilex02.php deleted file mode 100644 index f95db471..00000000 --- a/#jpgraph/src/Examples/dateutilex02.php +++ /dev/null @@ -1,47 +0,0 @@ -SetScale('datlin'); -$graph->SetMargin(60,20,40,60); - -// Setup the titles -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->Set('Development since 1984'); -$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10); -$graph->subtitle->Set('(Example using the builtin date scale)'); - -// Setup the labels to be correctly format on the X-axis -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8); -$graph->xaxis->SetLabelAngle(30); - -// The second paramter set to 'true' will make the library interpret the -// format string as a date format. We use a Month + Year format -// $graph->xaxis->SetLabelFormatString('M, Y',true); - -// First add an area plot -$lp1 = new LinePlot($ydata,$xdata); -$lp1->SetWeight(0); -$lp1->SetFillColor('orange@0.85'); -$graph->Add($lp1); - -// And then add line. We use two plots in order to get a -// more distinct border on the graph -$lp2 = new LinePlot($ydata,$xdata); -$lp2->SetColor('orange'); -$graph->Add($lp2); - -// And send back to the client -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/dm_ex6.png b/#jpgraph/src/Examples/dm_ex6.png deleted file mode 100644 index b389990b..00000000 Binary files a/#jpgraph/src/Examples/dm_ex6.png and /dev/null differ diff --git a/#jpgraph/src/Examples/dupyaxisex1.php b/#jpgraph/src/Examples/dupyaxisex1.php deleted file mode 100644 index b4b63fe7..00000000 --- a/#jpgraph/src/Examples/dupyaxisex1.php +++ /dev/null @@ -1,31 +0,0 @@ -E(-M_PI,M_PI,25); - -$graph = new Graph(300,200); -$graph->SetScale("linlin"); -$graph->SetMargin(50,50,20,30); -$graph->SetFrame(false); -$graph->SetBox(true,'black',2); -$graph->SetMarginColor('white'); -$graph->SetColor('lightyellow'); - -$graph->title->Set('Duplicating Y-axis'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->SetAxisStyle(AXSTYLE_YBOXIN); -$graph->xgrid->Show(); - -$lp1 = new LinePlot($ydata,$xdata); -$lp1->SetColor("blue"); -$lp1->SetWeight(2); -$graph->Add($lp1); - -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/example0-0.php b/#jpgraph/src/Examples/example0-0.php deleted file mode 100644 index d281824a..00000000 --- a/#jpgraph/src/Examples/example0-0.php +++ /dev/null @@ -1,25 +0,0 @@ -SetScale('intlin'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example0.php b/#jpgraph/src/Examples/example0.php deleted file mode 100644 index 2667e9f8..00000000 --- a/#jpgraph/src/Examples/example0.php +++ /dev/null @@ -1,21 +0,0 @@ -SetScale('textlin'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor('blue'); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example1.1.php b/#jpgraph/src/Examples/example1.1.php deleted file mode 100644 index e171e3ba..00000000 --- a/#jpgraph/src/Examples/example1.1.php +++ /dev/null @@ -1,25 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(30,90,40,50); -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->title->Set("Example 1.1 same y-values"); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetLegend("Test 1"); -$lineplot->SetColor("blue"); -$lineplot->SetWeight(5); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example1.2.php b/#jpgraph/src/Examples/example1.2.php deleted file mode 100644 index bbac21f1..00000000 --- a/#jpgraph/src/Examples/example1.2.php +++ /dev/null @@ -1,29 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(30,90,40,50); -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->title->Set("Dashed lineplot"); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetLegend("Test 1"); -$lineplot->SetColor("blue"); - -// Style can also be specified as SetStyle([1|2|3|4]) or -// SetStyle("solid"|"dotted"|"dashed"|"lobgdashed") -$lineplot->SetStyle("dashed"); - - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example1.php b/#jpgraph/src/Examples/example1.php deleted file mode 100644 index 31437f2d..00000000 --- a/#jpgraph/src/Examples/example1.php +++ /dev/null @@ -1,25 +0,0 @@ -SetScale("textlin"); -$graph->img->SetMargin(50,90,40,50); -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->title->Set("Examples for graph"); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetLegend("Test 1"); -$lineplot->SetColor("blue"); - - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example10.php b/#jpgraph/src/Examples/example10.php deleted file mode 100644 index 8b9d4c6e..00000000 --- a/#jpgraph/src/Examples/example10.php +++ /dev/null @@ -1,59 +0,0 @@ -img->SetMargin(40,110,20,40); -$graph->SetScale("textlog"); -$graph->SetY2Scale("log"); -$graph->SetShadow(); - -$graph->ygrid->Show(true,true); -$graph->xgrid->Show(true,false); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot2=new LinePlot($y2data); - -$graph->yaxis->scale->ticks->SupressFirst(); -$graph->y2axis->scale->ticks->SupressFirst(); -// Add the plot to the graph -$graph->Add($lineplot); -$graph->AddY2($lineplot2); -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); -$graph->y2axis->SetColor("orange"); - -$graph->title->Set("Example 10"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); - -$graph->yaxis->SetColor("blue"); - -$lineplot->SetLegend("Plot 1"); -$lineplot2->SetLegend("Plot 2"); - -$graph->legend->Pos(0.05,0.5,"right","center"); - -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetTextTickInterval(2); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example11.php b/#jpgraph/src/Examples/example11.php deleted file mode 100644 index 898447a2..00000000 --- a/#jpgraph/src/Examples/example11.php +++ /dev/null @@ -1,50 +0,0 @@ -Push(); - -// Create the graph. These two calls are always required -$graph = new Graph(300,200); -$graph->SetScale("textlin"); - -$graph->SetMargin(40,20,20,60); - -$graph->title->Set("Timing a graph"); -$graph->footer->right->Set('Timer (ms): '); -$graph->footer->right->SetFont(FF_COURIER,FS_ITALIC); -$graph->footer->SetTimer($timer); - -// Create the linear plot -$lineplot=new LinePlot($ydata); - -$lineplot2=new LinePlot($ydata2); - -// Add the plot to the graph -$graph->Add($lineplot); -$graph->Add($lineplot2); - -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); - -$graph->yaxis->SetColor("red"); -$graph->yaxis->SetWeight(2); -$graph->SetShadow(); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example13.php b/#jpgraph/src/Examples/example13.php deleted file mode 100644 index ae0eb952..00000000 --- a/#jpgraph/src/Examples/example13.php +++ /dev/null @@ -1,36 +0,0 @@ -SetScale("textlin"); - -$graph->img->SetMargin(40,30,20,40); -$graph->SetShadow(); - -// Create the error plot -$errplot=new ErrorPlot($errdatay); -$errplot->SetColor("red"); -$errplot->SetWeight(2); - -// Add the plot to the graph -$graph->Add($errplot); - -$graph->title->Set("Simple error plot"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$datax = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($datax); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example14.php b/#jpgraph/src/Examples/example14.php deleted file mode 100644 index cc591cbf..00000000 --- a/#jpgraph/src/Examples/example14.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale("textlin"); - -$graph->img->SetMargin(40,30,20,40); -$graph->SetShadow(); - -// Create the error plot -$errplot=new ErrorPlot($errdatay); -$errplot->SetColor("red"); -$errplot->SetWeight(2); -$errplot->SetCenter(); - -// Add the plot to the graph -$graph->Add($errplot); - -$graph->title->Set("Simple error plot"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$datax = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($datax); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example15.php b/#jpgraph/src/Examples/example15.php deleted file mode 100644 index 79ebb9ea..00000000 --- a/#jpgraph/src/Examples/example15.php +++ /dev/null @@ -1,40 +0,0 @@ -SetScale("textlin"); - -$graph->img->SetMargin(40,30,20,40); -$graph->SetShadow(); - -// Create the linear plot -$errplot=new ErrorLinePlot($errdatay); -$errplot->SetColor("red"); -$errplot->SetWeight(2); -$errplot->SetCenter(); -$errplot->line->SetWeight(2); -$errplot->line->SetColor("blue"); - -// Add the plot to the graph -$graph->Add($errplot); - -$graph->title->Set("Linear error plot"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$datax = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($datax); - - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example16.1.php b/#jpgraph/src/Examples/example16.1.php deleted file mode 100644 index edbb010f..00000000 --- a/#jpgraph/src/Examples/example16.1.php +++ /dev/null @@ -1,44 +0,0 @@ -SetScale('textlin'); - -$graph->img->SetMargin(40,130,20,40); -$graph->SetShadow(); - -// Create the linear error plot -$l1plot=new LinePlot($l1datay); -$l1plot->SetColor('red'); -$l1plot->SetWeight(2); -$l1plot->SetLegend('Prediction'); - -// Create the bar plot -$l2plot = new LinePlot($l2datay); -$l2plot->SetFillColor('orange'); -$l2plot->SetLegend('Result'); - -// Add the plots to the graph -$graph->Add($l2plot); -$graph->Add($l1plot); - -$graph->title->Set('Mixing line and filled line'); -$graph->xaxis->title->Set('X-title'); -$graph->yaxis->title->Set('Y-title'); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -//$graph->xaxis->SetTickLabels($datax); -//$graph->xaxis->SetTextTickInterval(2); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example16.2.php b/#jpgraph/src/Examples/example16.2.php deleted file mode 100644 index 649a7a94..00000000 --- a/#jpgraph/src/Examples/example16.2.php +++ /dev/null @@ -1,46 +0,0 @@ -SetScale("textlin"); - -$graph->img->SetMargin(40,130,20,40); -$graph->SetShadow(); - -// Create the linear error plot -$l1plot=new LinePlot($l1datay); -$l1plot->SetColor("red"); -$l1plot->SetWeight(2); -$l1plot->SetLegend("Prediction"); - -// Create the bar plot -$bplot = new BarPlot($l2datay); -$bplot->SetFillColor("orange"); -$bplot->SetLegend("Result"); - -// Add the plots to t'he graph -$graph->Add($l1plot); -$graph->Add($bplot); - - -$graph->title->Set("Adding a line plot to a bar graph v1"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -//$graph->xaxis->SetTickLabels($datax); -//$graph->xaxis->SetTextTickInterval(2); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example16.3.php b/#jpgraph/src/Examples/example16.3.php deleted file mode 100644 index f184fa2c..00000000 --- a/#jpgraph/src/Examples/example16.3.php +++ /dev/null @@ -1,45 +0,0 @@ -SetScale('textlin'); - -$graph->img->SetMargin(40,130,20,40); -$graph->SetShadow(); - -// Create the linear error plot -$l1plot=new LinePlot($l1datay); -$l1plot->SetColor('red'); -$l1plot->SetWeight(2); -$l1plot->SetLegend('Prediction'); - -// Create the bar plot -$bplot = new BarPlot($l2datay); -$bplot->SetFillColor('orange'); -$bplot->SetLegend('Result'); - -// Add the plots to t'he graph -$graph->Add($bplot); -$graph->Add($l1plot); - -$graph->title->Set('Adding a line plot to a bar graph v1'); -$graph->xaxis->title->Set('X-title'); -$graph->yaxis->title->Set('Y-title'); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->xaxis->SetTickLabels($datax); -//$graph->xaxis->SetTextTickInterval(2); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example16.4.php b/#jpgraph/src/Examples/example16.4.php deleted file mode 100644 index a23c2a54..00000000 --- a/#jpgraph/src/Examples/example16.4.php +++ /dev/null @@ -1,46 +0,0 @@ -SetScale('intlin'); - -$graph->img->SetMargin(40,130,20,40); -$graph->SetShadow(); - -// Create the linear error plot -$l1plot=new LinePlot($l1datay); -$l1plot->SetColor('red'); -$l1plot->SetWeight(2); -$l1plot->SetLegend('Prediction'); - -// Create the bar plot -$bplot = new BarPlot($l2datay); -$bplot->SetFillColor('orange'); -$bplot->SetLegend('Result'); - -// Add the plots to t'he graph -$graph->Add($bplot); -$graph->Add($l1plot); - -$graph->title->Set('Adding a line plot to a bar graph v3'); -$graph->xaxis->title->Set('X-title'); -$graph->yaxis->title->Set('Y-title'); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$datax = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($datax); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example16.5.php b/#jpgraph/src/Examples/example16.5.php deleted file mode 100644 index bfad3ce8..00000000 --- a/#jpgraph/src/Examples/example16.5.php +++ /dev/null @@ -1,57 +0,0 @@ -img->SetMargin(40,70,20,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); -$graph->SetColor(array(250,250,250)); - -$graph->img->SetTransparent("white"); - -$t1 = new Text("This is a text"); -$t1->SetPos(0.5,0.5); -$t1->SetOrientation("h"); -$t1->SetFont(FF_FONT1,FS_BOLD); -$t1->SetBox("white","black","gray"); -$t1->SetColor("black"); -$graph->AddText($t1); - -// Create the linear error plot -$l1plot=new LinePlot($l1datay); -$l1plot->SetColor("blue"); -$l1plot->SetWeight(2); -$l1plot->SetLegend("Prediction"); - -// Create the bar plot -$l2plot = new BarPlot($l2datay); -$l2plot->SetFillColor("orange"); -$l2plot->SetLegend("Result"); - -// Add the plots to the graph -$graph->Add($l1plot); -$graph->Add($l2plot); - - -$graph->title->Set("Example 16.3"); -$graph->xaxis->title->Set("Month"); -$graph->yaxis->title->Set("x10,000 US$"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->xaxis->SetTickLabels($datax); -//$graph->xaxis->SetTextTickInterval(2); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example16.6.php b/#jpgraph/src/Examples/example16.6.php deleted file mode 100644 index 8dac3128..00000000 --- a/#jpgraph/src/Examples/example16.6.php +++ /dev/null @@ -1,59 +0,0 @@ -GetStat(); -list( $xd, $yd ) = $lr->GetY(0,19); - -// Create the graph -$graph = new Graph(300,250); -$graph->SetScale('linlin'); - -// Setup title -$graph->title->Set("Linear regression"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -$graph->subtitle->Set('(stderr='.sprintf('%.2f',$stderr).', corr='.sprintf('%.2f',$corr).')'); -$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,12); - -// make sure that the X-axis is always at the -// bottom at the plot and not just at Y=0 which is -// the default position -$graph->xaxis->SetPos('min'); - -// Create the scatter plot with some nice colors -$sp1 = new ScatterPlot($datay,$datax); -$sp1->mark->SetType(MARK_FILLEDCIRCLE); -$sp1->mark->SetFillColor("red"); -$sp1->SetColor("blue"); -$sp1->SetWeight(3); -$sp1->mark->SetWidth(4); - -// Create the regression line -$lplot = new LinePlot($yd); -$lplot->SetWeight(2); -$lplot->SetColor('navy'); - -// Add the pltos to the line -$graph->Add($sp1); -$graph->Add($lplot); - -// ... and stroke -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example16.php b/#jpgraph/src/Examples/example16.php deleted file mode 100644 index 04c24272..00000000 --- a/#jpgraph/src/Examples/example16.php +++ /dev/null @@ -1,44 +0,0 @@ -SetScale("textlin"); - -$graph->img->SetMargin(40,30,20,40); -$graph->SetShadow(); - -// Create the linear plot -$errplot=new ErrorLinePlot($errdatay); -$errplot->SetColor("red"); -$errplot->SetWeight(2); -$errplot->SetCenter(); -$errplot->line->SetWeight(2); -$errplot->line->SetColor("blue"); - -// Setup the legends -$errplot->SetLegend("Min/Max"); -$errplot->line->SetLegend("Average"); - -// Add the plot to the graph -$graph->Add($errplot); - -$graph->title->Set("Linear error plot"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$datax = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($datax); - - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example17.php b/#jpgraph/src/Examples/example17.php deleted file mode 100644 index a394ddf7..00000000 --- a/#jpgraph/src/Examples/example17.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->SetShadow(); -$graph->img->SetMargin(40,30,20,40); - -// Create the linear plots for each category -$dplot[] = new LinePLot($datay1); -$dplot[] = new LinePLot($datay2); -$dplot[] = new LinePLot($datay3); - -$dplot[0]->SetFillColor("red"); -$dplot[1]->SetFillColor("blue"); -$dplot[2]->SetFillColor("green"); - -// Create the accumulated graph -$accplot = new AccLinePlot($dplot); - -// Add the plot to the graph -$graph->Add($accplot); - -$graph->xaxis->SetTextTickInterval(2); -$graph->title->Set("Example 17"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example18.php b/#jpgraph/src/Examples/example18.php deleted file mode 100644 index 458219c8..00000000 --- a/#jpgraph/src/Examples/example18.php +++ /dev/null @@ -1,32 +0,0 @@ -SetScale("textlin"); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->img->SetMargin(40,30,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); -$graph->Add($bplot); - -// Setup the titles -$graph->title->Set("A simple bar graph"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example19.1.php b/#jpgraph/src/Examples/example19.1.php deleted file mode 100644 index feddf707..00000000 --- a/#jpgraph/src/Examples/example19.1.php +++ /dev/null @@ -1,35 +0,0 @@ -SetScale('intlin'); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->SetMargin(40,30,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Adjust fill color -$bplot->SetFillColor('orange'); -$graph->Add($bplot); - -// Setup the titles -$graph->title->Set('A basic bar graph'); -$graph->xaxis->title->Set('X-title'); -$graph->yaxis->title->Set('Y-title'); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example19.php b/#jpgraph/src/Examples/example19.php deleted file mode 100644 index 13af5c01..00000000 --- a/#jpgraph/src/Examples/example19.php +++ /dev/null @@ -1,35 +0,0 @@ -SetScale('textlin'); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->SetMargin(40,30,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Adjust fill color -$bplot->SetFillColor('orange'); -$graph->Add($bplot); - -// Setup the titles -$graph->title->Set('A basic bar graph'); -$graph->xaxis->title->Set('X-title'); -$graph->yaxis->title->Set('Y-title'); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example2.1.php b/#jpgraph/src/Examples/example2.1.php deleted file mode 100644 index 1114b1a0..00000000 --- a/#jpgraph/src/Examples/example2.1.php +++ /dev/null @@ -1,30 +0,0 @@ -SetScale("textlin"); - -// Create the linear plot -$lineplot=new LinePlot($ydata); - -$lineplot->value->Show(); -$lineplot->value->SetColor("red"); -$lineplot->value->SetFont(FF_FONT1,FS_BOLD); - - -// Add the plot to the graph -$graph->Add($lineplot); - -$graph->img->SetMargin(40,20,20,40); -$graph->title->Set("Example 2.1"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example2.5.php b/#jpgraph/src/Examples/example2.5.php deleted file mode 100644 index a6e5535c..00000000 --- a/#jpgraph/src/Examples/example2.5.php +++ /dev/null @@ -1,26 +0,0 @@ -SetScale("textlin"); - -// Create the linear plot -$lineplot=new LinePlot($ydata); - -// Add the plot to the graph -$graph->Add($lineplot); - -$graph->img->SetMargin(40,20,20,40); -$graph->title->Set("Example 2.5"); -$graph->xaxis->title->Set("X-title"); -$graph->xaxis->SetPos("min"); -$graph->yaxis->title->Set("Y-title"); - - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example2.6.php b/#jpgraph/src/Examples/example2.6.php deleted file mode 100644 index 215eb4a5..00000000 --- a/#jpgraph/src/Examples/example2.6.php +++ /dev/null @@ -1,27 +0,0 @@ -SetScale("textlin"); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetStepStyle(); - -// Add the plot to the graph -$graph->Add($lineplot); - -$graph->img->SetMargin(40,20,20,40); -$graph->title->Set("Example 2.6 (Line with stepstyle)"); -$graph->xaxis->title->Set("X-title"); -$graph->xaxis->SetPos("min"); -$graph->yaxis->title->Set("Y-title"); - - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example2.php b/#jpgraph/src/Examples/example2.php deleted file mode 100644 index ef3731e7..00000000 --- a/#jpgraph/src/Examples/example2.php +++ /dev/null @@ -1,33 +0,0 @@ -SetScale('intlin'); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('Calls per operator'); -$graph->subtitle->Set('(March 12, 2008)'); -$graph->xaxis->title->Set('Operator'); -$graph->yaxis->title->Set('# of calls'); - - -// Create the linear plot -$lineplot=new LinePlot($ydata); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example20.1.php b/#jpgraph/src/Examples/example20.1.php deleted file mode 100644 index 0b251449..00000000 --- a/#jpgraph/src/Examples/example20.1.php +++ /dev/null @@ -1,36 +0,0 @@ -SetScale("textlin"); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->img->SetMargin(40,30,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Adjust fill color -$bplot->SetFillColor('orange'); -$bplot->value->Show(); -$graph->Add($bplot); - -// Setup the titles -$graph->title->Set("Bar graph"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example20.2.php b/#jpgraph/src/Examples/example20.2.php deleted file mode 100644 index b623219f..00000000 --- a/#jpgraph/src/Examples/example20.2.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale("textlin"); -$graph->yaxis->scale->SetGrace(20); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->img->SetMargin(40,30,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Adjust fill color -$bplot->SetFillColor('orange'); -$bplot->value->Show(); -$graph->Add($bplot); - -// Setup the titles -$graph->title->Set("Bar graph with Y-scale grace"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example20.3.php b/#jpgraph/src/Examples/example20.3.php deleted file mode 100644 index ac2df483..00000000 --- a/#jpgraph/src/Examples/example20.3.php +++ /dev/null @@ -1,40 +0,0 @@ -SetScale("textlin"); -$graph->yaxis->scale->SetGrace(20); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->img->SetMargin(40,30,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Adjust fill color -$bplot->SetFillColor('orange'); -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10); -$bplot->value->SetAngle(45); -$bplot->value->SetFormat('%0.1f'); -$graph->Add($bplot); - -// Setup the titles -$graph->title->Set("Bar graph with Y-scale grace"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example20.4.php b/#jpgraph/src/Examples/example20.4.php deleted file mode 100644 index 6786efbf..00000000 --- a/#jpgraph/src/Examples/example20.4.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->yaxis->scale->SetGrace(20); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->img->SetMargin(40,30,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Adjust fill color -$bplot->SetFillColor('orange'); -$bplot->SetShadow(); -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10); -$bplot->value->SetAngle(45); -$bplot->value->SetFormat('%0.1f'); -$graph->Add($bplot); - -// Setup the titles -$graph->title->Set("Bar graph with drop shadow"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example20.5.php b/#jpgraph/src/Examples/example20.5.php deleted file mode 100644 index a191e5a3..00000000 --- a/#jpgraph/src/Examples/example20.5.php +++ /dev/null @@ -1,47 +0,0 @@ -SetScale("textlin"); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->img->SetMargin(40,30,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Adjust fill color -$bplot->SetFillColor('orange'); - -// Setup values -$bplot->value->Show(); -$bplot->value->SetFormat('%d'); -$bplot->value->SetFont(FF_FONT1,FS_BOLD); - -// Center the values in the bar -$bplot->SetValuePos('center'); - -// Make the bar a little bit wider -$bplot->SetWidth(0.7); - -$graph->Add($bplot); - -// Setup the titles -$graph->title->Set("Centered values for bars"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example20.php b/#jpgraph/src/Examples/example20.php deleted file mode 100644 index 434860f1..00000000 --- a/#jpgraph/src/Examples/example20.php +++ /dev/null @@ -1,36 +0,0 @@ -SetScale("textlin"); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->img->SetMargin(40,30,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Adjust fill color -$bplot->SetFillColor('orange'); -$bplot->SetWidth(1.0); -$graph->Add($bplot); - -// Setup the titles -$graph->title->Set("Bar graph"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example21.php b/#jpgraph/src/Examples/example21.php deleted file mode 100644 index 81debb2d..00000000 --- a/#jpgraph/src/Examples/example21.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale("textlin"); - -$graph->SetShadow(); -$graph->img->SetMargin(40,30,20,40); - -// Create the bar plots -$b1plot = new BarPlot($data1y); -$b1plot->SetFillColor("orange"); -$b2plot = new BarPlot($data2y); -$b2plot->SetFillColor("blue"); - -// Create the grouped bar plot -$gbplot = new GroupBarPlot(array($b1plot,$b2plot)); - -// ...and add it to the graPH -$graph->Add($gbplot); - -$graph->title->Set("Example 21"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example22.php b/#jpgraph/src/Examples/example22.php deleted file mode 100644 index f5223d08..00000000 --- a/#jpgraph/src/Examples/example22.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale("textlin"); -$graph->SetShadow(); - -$graph->img->SetMargin(40,30,20,40); - -// Create the bar plots -$b1plot = new BarPlot($data1y); -$b1plot->SetFillColor("orange"); -$b2plot = new BarPlot($data2y); -$b2plot->SetFillColor("blue"); - -// Create the grouped bar plot -$gbplot = new GroupBarPlot(array($b1plot,$b2plot)); -$gbplot->SetWidth(0.9); - -// ...and add it to the graPH -$graph->Add($gbplot); - -$graph->title->Set("Adjusting the width"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example23.php b/#jpgraph/src/Examples/example23.php deleted file mode 100644 index fcec9de0..00000000 --- a/#jpgraph/src/Examples/example23.php +++ /dev/null @@ -1,39 +0,0 @@ -SetScale("textlin"); - -$graph->SetShadow(); -$graph->img->SetMargin(40,30,20,40); - -// Create the bar plots -$b1plot = new BarPlot($data1y); -$b1plot->SetFillColor("orange"); -$b2plot = new BarPlot($data2y); -$b2plot->SetFillColor("blue"); - -// Create the grouped bar plot -$gbplot = new AccBarPlot(array($b1plot,$b2plot)); - -// ...and add it to the graPH -$graph->Add($gbplot); - -$graph->title->Set("Accumulated bar plots"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example24.php b/#jpgraph/src/Examples/example24.php deleted file mode 100644 index 48d48da5..00000000 --- a/#jpgraph/src/Examples/example24.php +++ /dev/null @@ -1,46 +0,0 @@ -SetScale("textlin"); - -$graph->SetShadow(); -$graph->img->SetMargin(40,30,20,40); - -$b1plot = new BarPlot($data1y); -$b1plot->SetFillColor("orange"); -$b2plot = new BarPlot($data2y); -$b2plot->SetFillColor("blue"); -$b3plot = new BarPlot($data3y); -$b3plot->SetFillColor("green"); -$b4plot = new BarPlot($data4y); -$b4plot->SetFillColor("brown"); - -// Create the accumulated bar plots -$ab1plot = new AccBarPlot(array($b1plot,$b2plot)); -$ab2plot = new AccBarPlot(array($b3plot,$b4plot)); - -// Create the grouped bar plot -$gbplot = new GroupBarPlot(array($ab1plot,$ab2plot)); - -// ...and add it to the graph -$graph->Add($gbplot); - -$graph->title->Set("Grouped Accumulated bar plots"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example25.1.php b/#jpgraph/src/Examples/example25.1.php deleted file mode 100644 index a3afb03a..00000000 --- a/#jpgraph/src/Examples/example25.1.php +++ /dev/null @@ -1,40 +0,0 @@ -SetScale('textlin'); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->img->SetMargin(40,30,40,40); - -// Create a bar pot -$bplot = new BarPlot($datay); -$graph->Add($bplot); - -// Create and add a new text -$txt=new Text('This is a text'); -$txt->SetPos(10,20); -$txt->SetColor('darkred'); -$txt->SetFont(FF_FONT2,FS_BOLD); -$txt->SetBox('yellow','navy','gray@0.5'); -$graph->AddText($txt); - -// Setup the titles -$graph->title->Set("A simple bar graph"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example25.2.php b/#jpgraph/src/Examples/example25.2.php deleted file mode 100644 index 53f8479e..00000000 --- a/#jpgraph/src/Examples/example25.2.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale('textlin'); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->img->SetMargin(40,30,20,40); - -// Create a bar pot -$bplot = new BarPlot($datay); -$graph->Add($bplot); - -// Create and add a new text -$txt=new Text("This is a text\nwith many\nand even\nmore\nlines of text"); -$txt->SetPos(0.5,0.5,'center','center'); -$txt->SetFont(FF_FONT2,FS_BOLD); -$txt->ParagraphAlign('center'); -$txt->SetBox('yellow','navy','gray'); -$txt->SetColor('red'); -$graph->AddText($txt); - -// Setup the titles -$graph->title->Set("A simple bar graph"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example25.php b/#jpgraph/src/Examples/example25.php deleted file mode 100644 index 35802aed..00000000 --- a/#jpgraph/src/Examples/example25.php +++ /dev/null @@ -1,39 +0,0 @@ -SetScale('textlin'); - -// Add a drop shadow -$graph->SetShadow(); - -// Adjust the margin a bit to make more room for titles -$graph->img->SetMargin(40,30,40,40); - -// Create a bar pot -$bplot = new BarPlot($datay); -$graph->Add($bplot); - -// Create and add a new text -$txt=new Text('This is a text'); -$txt->SetPos(0,20); -$txt->SetColor('darkred'); -$txt->SetFont(FF_FONT2,FS_BOLD); -$graph->AddText($txt); - -// Setup the titles -$graph->title->Set("A simple bar graph"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example26.1.php b/#jpgraph/src/Examples/example26.1.php deleted file mode 100644 index 63a9d267..00000000 --- a/#jpgraph/src/Examples/example26.1.php +++ /dev/null @@ -1,22 +0,0 @@ -SetShadow(); - -$graph->title->Set("A simple Pie plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new PiePlot($data); -$p1->SetLegends($gDateLocale->GetShortMonth()); -$p1->SetCenter(0.4); - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example26.php b/#jpgraph/src/Examples/example26.php deleted file mode 100644 index 9cb57ebe..00000000 --- a/#jpgraph/src/Examples/example26.php +++ /dev/null @@ -1,18 +0,0 @@ -SetShadow(); - -$graph->title->Set("A simple Pie plot"); - -$p1 = new PiePlot($data); -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example27.1.php b/#jpgraph/src/Examples/example27.1.php deleted file mode 100644 index 51d52e3a..00000000 --- a/#jpgraph/src/Examples/example27.1.php +++ /dev/null @@ -1,25 +0,0 @@ -SetShadow(); - -$graph->title->Set("A simple Pie plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new PiePlot3D($data); -$p1->SetAngle(20); -$p1->SetSize(0.5); -$p1->SetCenter(0.45); -$p1->SetLegends($gDateLocale->GetShortMonth()); - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example27.2.php b/#jpgraph/src/Examples/example27.2.php deleted file mode 100644 index aad23a38..00000000 --- a/#jpgraph/src/Examples/example27.2.php +++ /dev/null @@ -1,24 +0,0 @@ -SetShadow(); - -$graph->title->Set("A simple Pie plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new PiePlot($data); -$p1->ExplodeSlice(1); -$p1->SetCenter(0.45); -$p1->SetLegends($gDateLocale->GetShortMonth()); - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example27.3.php b/#jpgraph/src/Examples/example27.3.php deleted file mode 100644 index fb2a56ec..00000000 --- a/#jpgraph/src/Examples/example27.3.php +++ /dev/null @@ -1,24 +0,0 @@ -SetShadow(); - -$graph->title->Set("A simple 3D Pie plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new PiePlot3D($data); -$p1->ExplodeSlice(1); -$p1->SetCenter(0.45); -$p1->SetLegends($gDateLocale->GetShortMonth()); - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example27.php b/#jpgraph/src/Examples/example27.php deleted file mode 100644 index 3feee435..00000000 --- a/#jpgraph/src/Examples/example27.php +++ /dev/null @@ -1,24 +0,0 @@ -SetShadow(); - -$graph->title->Set("A simple Pie plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new PiePlot3D($data); -$p1->SetSize(0.5); -$p1->SetCenter(0.45); -$p1->SetLegends($gDateLocale->GetShortMonth()); - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example28.1.php b/#jpgraph/src/Examples/example28.1.php deleted file mode 100644 index 7dce5d8a..00000000 --- a/#jpgraph/src/Examples/example28.1.php +++ /dev/null @@ -1,22 +0,0 @@ -SetShadow(); - -$graph->title->Set("'earth' Theme"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new PiePlot($data); -$p1->SetTheme("earth"); -$p1->SetCenter(0.5,0.55); -$p1->value->Show(false); -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example28.2.php b/#jpgraph/src/Examples/example28.2.php deleted file mode 100644 index 905be8da..00000000 --- a/#jpgraph/src/Examples/example28.2.php +++ /dev/null @@ -1,22 +0,0 @@ -SetShadow(); - -$graph->title->Set("'pastel' Theme"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new PiePlot($data); -$p1->SetTheme("pastel"); -$p1->SetCenter(0.5,0.55); -$p1->value->Show(false); -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example28.3.php b/#jpgraph/src/Examples/example28.3.php deleted file mode 100644 index bc4fdbd1..00000000 --- a/#jpgraph/src/Examples/example28.3.php +++ /dev/null @@ -1,22 +0,0 @@ -SetShadow(); - -$graph->title->Set("'water' Theme"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new PiePlot($data); -$p1->SetTheme("water"); -$p1->SetCenter(0.5,0.55); -$p1->value->Show(false); -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example28.php b/#jpgraph/src/Examples/example28.php deleted file mode 100644 index 08d28bdc..00000000 --- a/#jpgraph/src/Examples/example28.php +++ /dev/null @@ -1,22 +0,0 @@ -SetShadow(); - -$graph->title->Set("'sand' Theme"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new PiePlot($data); -$p1->SetTheme("sand"); -$p1->SetCenter(0.5,0.55); -$p1->value->Show(false); -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/example3.0.1.php b/#jpgraph/src/Examples/example3.0.1.php deleted file mode 100644 index dd10c9e9..00000000 --- a/#jpgraph/src/Examples/example3.0.1.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale('intlin'); -$graph->SetShadow(); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('Calls per operator'); -$graph->subtitle->Set('(March 12, 2008)'); -$graph->xaxis->title->Set('Operator'); -$graph->yaxis->title->Set('# of calls'); - -$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); -$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); - -$graph->yaxis->SetColor('blue'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor( 'blue' ); -$lineplot->SetWeight( 2 ); // Two pixel wide - - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.0.2.php b/#jpgraph/src/Examples/example3.0.2.php deleted file mode 100644 index 3c8b1e62..00000000 --- a/#jpgraph/src/Examples/example3.0.2.php +++ /dev/null @@ -1,40 +0,0 @@ -SetScale('intlin'); -$graph->SetShadow(); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('Interpolated values'); -$graph->xaxis->title->Set('x-title'); -$graph->yaxis->title->Set('y-title'); - -$graph->yaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 ); -$graph->xaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 ); - -$graph->yaxis->SetColor('blue'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor( 'blue' ); -$lineplot->SetWeight( 2 ); // Two pixel wide - - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.0.3.php b/#jpgraph/src/Examples/example3.0.3.php deleted file mode 100644 index cc39f638..00000000 --- a/#jpgraph/src/Examples/example3.0.3.php +++ /dev/null @@ -1,40 +0,0 @@ -SetScale('intlin'); -$graph->SetShadow(); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('NULL values'); -$graph->xaxis->title->Set('x-title'); -$graph->yaxis->title->Set('y-title'); - -$graph->yaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 ); -$graph->xaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 ); - -$graph->yaxis->SetColor('blue'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor( 'blue' ); -$lineplot->SetWeight( 2 ); // Two pixel wide - - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.1.1.php b/#jpgraph/src/Examples/example3.1.1.php deleted file mode 100644 index 32e2cef8..00000000 --- a/#jpgraph/src/Examples/example3.1.1.php +++ /dev/null @@ -1,43 +0,0 @@ -SetScale('intlin'); -$graph->SetShadow(); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('Calls per operator'); -$graph->subtitle->Set('(March 12, 2008)'); -$graph->xaxis->title->Set('Operator'); -$graph->yaxis->title->Set('# of calls'); - -$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); -$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); - -$graph->yaxis->SetColor('blue'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor( 'blue' ); -$lineplot->SetWeight( 2 ); // Two pixel wide - -// Add an image mark scaled to 50% -$lineplot->mark->SetType(MARK_IMG_DIAMOND,'red',0.5); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.1.php b/#jpgraph/src/Examples/example3.1.php deleted file mode 100644 index 1c4e0adc..00000000 --- a/#jpgraph/src/Examples/example3.1.php +++ /dev/null @@ -1,43 +0,0 @@ -SetScale('intlin'); -$graph->SetShadow(); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('Calls per operator'); -$graph->subtitle->Set('(March 12, 2008)'); -$graph->xaxis->title->Set('Operator'); -$graph->yaxis->title->Set('# of calls'); - -$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); -$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); - -$graph->yaxis->SetColor('blue'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor( 'blue' ); -$lineplot->SetWeight( 2 ); // Two pixel wide -$lineplot->mark->SetType(MARK_UTRIANGLE); -$lineplot->mark->SetColor('blue'); -$lineplot->mark->SetFillColor('red'); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.2.1.php b/#jpgraph/src/Examples/example3.2.1.php deleted file mode 100644 index c739ce80..00000000 --- a/#jpgraph/src/Examples/example3.2.1.php +++ /dev/null @@ -1,35 +0,0 @@ -SetScale("textlin"); -$graph->yaxis->scale->SetGrace(10,10); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->mark->SetType(MARK_CIRCLE); - -// Add the plot to the graph -$graph->Add($lineplot); - -$graph->img->SetMargin(40,20,20,40); -$graph->title->Set("Grace value, version 1"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); -$graph->yaxis->SetWeight(2); -$graph->SetShadow(); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.2.2.php b/#jpgraph/src/Examples/example3.2.2.php deleted file mode 100644 index 03d22c8c..00000000 --- a/#jpgraph/src/Examples/example3.2.2.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale("textlin"); -$graph->yaxis->scale->SetGrace(10,10); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->mark->SetType(MARK_CIRCLE); - -// Add the plot to the graph -$graph->Add($lineplot); - -$graph->img->SetMargin(40,20,20,40); -$graph->title->Set("Grace value version 2"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->xaxis->SetPos('min'); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); -$graph->yaxis->SetWeight(2); -$graph->SetShadow(); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.2.php b/#jpgraph/src/Examples/example3.2.php deleted file mode 100644 index f7c05c5c..00000000 --- a/#jpgraph/src/Examples/example3.2.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale("textlin"); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->mark->SetType(MARK_CIRCLE); - -// Add the plot to the graph -$graph->Add($lineplot); - -$graph->img->SetMargin(40,20,20,40); -$graph->title->Set("Example 3.2"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); -$graph->yaxis->SetWeight(2); -$graph->SetShadow(); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.3.php b/#jpgraph/src/Examples/example3.3.php deleted file mode 100644 index c20cd98c..00000000 --- a/#jpgraph/src/Examples/example3.3.php +++ /dev/null @@ -1,45 +0,0 @@ -SetScale('intlin'); -$graph->SetShadow(); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('Calls per operator'); -$graph->subtitle->Set('(March 12, 2008)'); -$graph->xaxis->title->Set('Operator'); -$graph->yaxis->title->Set('# of calls'); - -$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); -$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); - -$graph->yaxis->SetColor('blue'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor( 'blue' ); -$lineplot->SetWeight( 2 ); // Two pixel wide -$lineplot->mark->SetType(MARK_UTRIANGLE); -$lineplot->mark->SetColor('blue'); -$lineplot->mark->SetFillColor('red'); - -$lineplot->value->Show(); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.4.1.php b/#jpgraph/src/Examples/example3.4.1.php deleted file mode 100644 index 77c0b24b..00000000 --- a/#jpgraph/src/Examples/example3.4.1.php +++ /dev/null @@ -1,81 +0,0 @@ - 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, - 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, - 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1); - - foreach ($lookup as $roman => $value) - { - // Determine the number of matches - $matches = intval($n / $value); - - // Store that many characters - $result .= str_repeat($roman, $matches); - - // Substract that from the number - $n = $n % $value; - } - - // The Roman numeral should be built, return it - return $result; -} - -function formatCallback($aVal) { - return '('.numberToRoman($aVal).')'; -} - - - // Some (random) data -$ydata = array(11,3,8,12,5,1,9,13,5,7); - -// Size of the overall graph -$width=350; -$height=250; - -// Create the graph and set a scale. -// These two calls are always required -$graph = new Graph($width,$height); -$graph->SetScale('intlin'); -$graph->SetShadow(); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('Calls per operator'); -$graph->subtitle->Set('(March 12, 2008)'); -$graph->xaxis->title->Set('Operator'); -$graph->yaxis->title->Set('# of calls'); - -$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); -$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); - -$graph->yaxis->SetColor('blue'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor( 'blue' ); -$lineplot->SetWeight( 2 ); // Two pixel wide -$lineplot->mark->SetType(MARK_UTRIANGLE); -$lineplot->mark->SetColor('blue'); -$lineplot->mark->SetFillColor('red'); - -$lineplot->value->Show(); -$lineplot->value->SetFont(FF_ARIAL,FS_BOLD,10); -$lineplot->value->SetColor('darkred'); -$lineplot->value->SetFormatCallback('formatCallback'); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.4.php b/#jpgraph/src/Examples/example3.4.php deleted file mode 100644 index 0d223c17..00000000 --- a/#jpgraph/src/Examples/example3.4.php +++ /dev/null @@ -1,48 +0,0 @@ -SetScale('intlin'); -$graph->SetShadow(); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('Calls per operator'); -$graph->subtitle->Set('(March 12, 2008)'); -$graph->xaxis->title->Set('Operator'); -$graph->yaxis->title->Set('# of calls'); - -$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); -$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); - -$graph->yaxis->SetColor('blue'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor( 'blue' ); -$lineplot->SetWeight( 2 ); // Two pixel wide -$lineplot->mark->SetType(MARK_UTRIANGLE); -$lineplot->mark->SetColor('blue'); -$lineplot->mark->SetFillColor('red'); - -$lineplot->value->Show(); -$lineplot->value->SetFont(FF_ARIAL,FS_BOLD,10); -$lineplot->value->SetColor('darkred'); -$lineplot->value->SetFormat('(%d)'); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example3.php b/#jpgraph/src/Examples/example3.php deleted file mode 100644 index 4c79c1d4..00000000 --- a/#jpgraph/src/Examples/example3.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale('intlin'); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('Calls per operator'); -$graph->subtitle->Set('(March 12, 2008)'); -$graph->xaxis->title->Set('Operator'); -$graph->yaxis->title->Set('# of calls'); - -$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); -$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor( 'blue' ); -$lineplot->SetWeight( 2 ); // Two pixel wide - - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example4.php b/#jpgraph/src/Examples/example4.php deleted file mode 100644 index 42549d88..00000000 --- a/#jpgraph/src/Examples/example4.php +++ /dev/null @@ -1,45 +0,0 @@ -SetScale('intlin'); -$graph->SetShadow(); - -// Setup margin and titles -$graph->SetMargin(40,20,20,40); -$graph->title->Set('Calls per operator (June,July)'); -$graph->subtitle->Set('(March 12, 2008)'); -$graph->xaxis->title->Set('Operator'); -$graph->yaxis->title->Set('# of calls'); - -$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); -$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); - -// Create the first data series -$lineplot=new LinePlot($ydata); -$lineplot->SetWeight( 2 ); // Two pixel wide - -// Add the plot to the graph -$graph->Add($lineplot); - -// Create the second data series -$lineplot2=new LinePlot($ydata2); -$lineplot2->SetWeight( 2 ); // Two pixel wide - -// Add the second plot to the graph -$graph->Add($lineplot2); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example5.1.php b/#jpgraph/src/Examples/example5.1.php deleted file mode 100644 index 38345584..00000000 --- a/#jpgraph/src/Examples/example5.1.php +++ /dev/null @@ -1,47 +0,0 @@ -img->SetMargin(40,40,20,40); -$graph->SetScale("textlin"); -$graph->SetY2Scale("lin"); -$graph->SetShadow(); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot2=new LinePlot($y2data); - -// Add the plot to the graph -$graph->Add($lineplot); -$graph->AddY2($lineplot2); -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); -$graph->y2axis->SetColor("orange"); - -$graph->title->Set("Example 5"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); - -$graph->yaxis->SetColor("blue"); - -$lineplot->SetLegend("Plot 1"); -$lineplot2->SetLegend("Plot 2"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example5.php b/#jpgraph/src/Examples/example5.php deleted file mode 100644 index d4b6838b..00000000 --- a/#jpgraph/src/Examples/example5.php +++ /dev/null @@ -1,44 +0,0 @@ -img->SetMargin(40,40,20,40); -$graph->SetScale("textlin"); -$graph->SetY2Scale("lin"); -$graph->SetShadow(); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot2=new LinePlot($y2data); - -// Add the plot to the graph -$graph->Add($lineplot); -$graph->AddY2($lineplot2); -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); -$graph->y2axis->SetColor("orange"); - -$graph->title->Set("Example 5"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); - -$graph->yaxis->SetColor("blue"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example6.1.php b/#jpgraph/src/Examples/example6.1.php deleted file mode 100644 index 50007592..00000000 --- a/#jpgraph/src/Examples/example6.1.php +++ /dev/null @@ -1,55 +0,0 @@ -SetScale("textlin"); -$graph->SetY2Scale("lin"); -$graph->SetShadow(); - -// Adjust the margin -$graph->img->SetMargin(40,40,20,70); - -// Create the two linear plot -$lineplot=new LinePlot($ydata); -$lineplot2=new LinePlot($y2data); - -// Add the plot to the graph -$graph->Add($lineplot); -$graph->AddY2($lineplot2); -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); - -// Adjust the axis color -$graph->y2axis->SetColor("orange"); -$graph->yaxis->SetColor("blue"); - -$graph->title->Set("Example 6.1"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Set the colors for the plots -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); - -// Set the legends for the plots -$lineplot->SetLegend("Plot 1"); -$lineplot2->SetLegend("Plot 2"); - -// Adjust the legend position -$graph->legend->SetLayout(LEGEND_HOR); -$graph->legend->Pos(0.4,0.95,"center","bottom"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example6.2.php b/#jpgraph/src/Examples/example6.2.php deleted file mode 100644 index 7d0a7556..00000000 --- a/#jpgraph/src/Examples/example6.2.php +++ /dev/null @@ -1,47 +0,0 @@ -SetScale("textlin"); -$graph->SetShadow(); - -// Adjust the margin -$graph->img->SetMargin(40,40,20,70); - -// Create the two linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetStepStyle(); - -// Adjust the axis color -$graph->yaxis->SetColor("blue"); - -$graph->title->Set("Example 6.2"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Set the colors for the plots -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -// Set the legends for the plots -$lineplot->SetLegend("Plot 1"); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Adjust the legend position -$graph->legend->SetLayout(LEGEND_HOR); -$graph->legend->Pos(0.4,0.95,"center","bottom"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example6.php b/#jpgraph/src/Examples/example6.php deleted file mode 100644 index 6cdc6303..00000000 --- a/#jpgraph/src/Examples/example6.php +++ /dev/null @@ -1,54 +0,0 @@ -SetScale('textlin'); -$graph->SetY2Scale('lin'); -$graph->SetShadow(); - -// Adjust the margin -$graph->img->SetMargin(40,140,20,40); - -// Create the two linear plot -$lineplot=new LinePlot($ydata); -$lineplot2=new LinePlot($y2data); - -// Add the plot to the graph -$graph->Add($lineplot); -$graph->AddY2($lineplot2); -$lineplot2->SetColor('orange'); -$lineplot2->SetWeight(2); - -// Adjust the axis color -$graph->y2axis->SetColor('orange'); -$graph->yaxis->SetColor('blue'); - -$graph->title->Set('Example 6'); -$graph->xaxis->title->Set('X-title'); -$graph->yaxis->title->Set('Y-title'); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -// Set the colors for the plots -$lineplot->SetColor('blue'); -$lineplot->SetWeight(2); -$lineplot2->SetColor('orange'); -$lineplot2->SetWeight(2); - -// Set the legends for the plots -$lineplot->SetLegend('Plot 1'); -$lineplot2->SetLegend('Plot 2'); - -// Adjust the legend position -$graph->legend->Pos(0.05,0.5,'right','center'); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example7.php b/#jpgraph/src/Examples/example7.php deleted file mode 100644 index e8f75c4c..00000000 --- a/#jpgraph/src/Examples/example7.php +++ /dev/null @@ -1,44 +0,0 @@ -SetScale("textlin"); -$graph->SetY2Scale("log"); -$graph->SetShadow(); -$graph->img->SetMargin(40,110,20,40); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot2=new LinePlot($y2data); - -// Add the plot to the graph -$graph->Add($lineplot); -$graph->AddY2($lineplot2); -$graph->yaxis->SetColor('blue'); - -$graph->title->Set("Example 7"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); -$lineplot2->SetWeight(2); - -$lineplot->SetLegend("Plot 1"); -$lineplot2->SetLegend("Plot 2"); - -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example8.1.php b/#jpgraph/src/Examples/example8.1.php deleted file mode 100644 index 8cab7e42..00000000 --- a/#jpgraph/src/Examples/example8.1.php +++ /dev/null @@ -1,57 +0,0 @@ -SetScale("textlog"); -$graph->SetY2Scale("log"); - -$graph->SetShadow(); -$graph->SetMargin(40,110,20,40); - -$graph->ygrid->Show(true,true); -$graph->xgrid->Show(true,false); - -// Create the linear plot -$lineplot=new LinePlot($ydata); - -$lineplot2=new LinePlot($y2data); -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); - -$graph->yaxis->scale->ticks->SupressFirst(); - -// Add the plot to the graph -$graph->Add($lineplot); -$graph->AddY2($lineplot2); - -$graph->title->Set("Example 8"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); - -$graph->yaxis->SetColor("blue"); -$graph->y2axis->SetColor("orange"); - -$lineplot->SetLegend("Plot 1"); -$lineplot2->SetLegend("Plot 2"); - -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example8.php b/#jpgraph/src/Examples/example8.php deleted file mode 100644 index 773265bd..00000000 --- a/#jpgraph/src/Examples/example8.php +++ /dev/null @@ -1,48 +0,0 @@ -SetScale("textlog"); -$graph->SetShadow(); -$graph->img->SetMargin(40,110,20,40); - -// Show the gridlines -$graph->ygrid->Show(true,true); -$graph->xgrid->Show(true,false); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot2=new LinePlot($y2data); - -// Add the plot to the graph -$graph->Add($lineplot); - -$graph->title->Set("Example 8"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -// Adjust the color of the Y axis -$graph->yaxis->SetColor("blue"); - -// Specifya a legend -$lineplot->SetLegend("Plot 1"); - -// Adjust the position of the grid box -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example9.1.php b/#jpgraph/src/Examples/example9.1.php deleted file mode 100644 index addcb5f4..00000000 --- a/#jpgraph/src/Examples/example9.1.php +++ /dev/null @@ -1,50 +0,0 @@ -SetScale("textlog"); - -$graph->img->SetMargin(40,110,20,40); -$graph->SetShadow(); - -$graph->ygrid->Show(true,true); -$graph->xgrid->Show(true,false); - -// Specify the tick labels -$a = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetTextLabelInterval(2); - -// Create the linear plot -$lineplot=new LinePlot($ydata); - -// Add the plot to the graph -$graph->Add($lineplot); - -$graph->title->Set("Examples 9"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -$graph->yaxis->SetColor("blue"); - -$lineplot->SetLegend("Plot 1"); - -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example9.2.php b/#jpgraph/src/Examples/example9.2.php deleted file mode 100644 index c765981e..00000000 --- a/#jpgraph/src/Examples/example9.2.php +++ /dev/null @@ -1,52 +0,0 @@ -SetScale("textlog"); - -$graph->img->SetMargin(40,110,20,50); -$graph->SetShadow(); - -$graph->ygrid->Show(true,true); -$graph->xgrid->Show(true,false); - -// Specify the tick labels -$a = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($a); -//$graph->xaxis->SetTextLabelInterval(2); -$graph->xaxis->SetLabelAngle(90); - - -// Create the linear plot -$lineplot=new LinePlot($ydata); - -// Add the plot to the graph -$graph->Add($lineplot); - -$graph->title->Set("Examples 9"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -$graph->yaxis->SetColor("blue"); - -$lineplot->SetLegend("Plot 1"); - -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/example9.php b/#jpgraph/src/Examples/example9.php deleted file mode 100644 index 03c54790..00000000 --- a/#jpgraph/src/Examples/example9.php +++ /dev/null @@ -1,49 +0,0 @@ -SetScale("textlog"); - -$graph->img->SetMargin(40,110,20,40); -$graph->SetShadow(); - -$graph->ygrid->Show(true,true); -$graph->xgrid->Show(true,false); - -// Specify the tick labels -$a = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($a); - -// Create the linear plot -$lineplot=new LinePlot($ydata); - -// Add the plot to the graph -$graph->Add($lineplot); - -$graph->title->Set("Examples 9"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -$graph->yaxis->SetColor("blue"); - -$lineplot->SetLegend("Plot 1"); - -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/exampleex9.php b/#jpgraph/src/Examples/exampleex9.php deleted file mode 100644 index 9d87985f..00000000 --- a/#jpgraph/src/Examples/exampleex9.php +++ /dev/null @@ -1,63 +0,0 @@ -SetScale("textlog"); - -$graph->img->SetMargin(40,110,20,40); - -$graph->SetY2Scale("log"); -$graph->SetShadow(); - -$graph->ygrid->Show(true,true); -$graph->xgrid->Show(true,false); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot2=new LinePlot($y2data); - -$graph->yaxis->scale->ticks->SupressFirst(); -$graph->y2axis->scale->ticks->SupressFirst(); -// Add the plot to the graph -$graph->Add($lineplot); -$graph->AddY2($lineplot2); -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); -$graph->y2axis->SetColor("orange"); - -$graph->title->Set("Examples 9"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); - -$graph->yaxis->SetColor("blue"); - -$lineplot->SetLegend("Plot 1"); -$lineplot2->SetLegend("Plot 2"); - -$graph->legend->Pos(0.05,0.5,"right","center"); - -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetTextTickInterval(2); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/fieldscatterex1.php b/#jpgraph/src/Examples/fieldscatterex1.php deleted file mode 100644 index 94b47fb6..00000000 --- a/#jpgraph/src/Examples/fieldscatterex1.php +++ /dev/null @@ -1,92 +0,0 @@ - 1 ) $f=1; - $red = floor((1-$f)*255); - $blue = floor($f*255); - $color = array($red,0,$blue); - //echo "x=$x, y=$y, blue=$blue, red=$red
"; - return array($color,$size,$arrowsize); -} - -// Create data for a simulated pseudo-magnetic radient field -$datax = array(); -$datay = array(); -$angle = array(); -for($x=1; $x < 10; ++$x ) { - for($y=10; $y<100; $y += 10) { - $a = -1; - if( $x==$polex && $y==$poley ) continue; - if( $x==$polex ) { - if( $y > $poley ) $a=90; - else $a = 270; - } - if( $y==$poley ) { - if( $x > $polex ) $a=0; - else $a=180; - } - if( $a == -1 ) { - $d1 = $y-$poley; - $d2 = ($polex-$x)*20; - if( $y < $poley ) $d2 *= -1; - $h = sqrt($d1*$d1+$d2*$d2); - $t = -$d2/$h; - $ac = acos($t); - if( $y < $poley ) $ac += M_PI; - $a = $ac * 180/M_PI; - } - $datax[] = $x; - $datay[] = $y; - $angle[] = $a; - } -} - -// Setup the graph -$graph = new Graph(300,200); -$graph->SetScale("intlin",0,100,0,10); -$graph->SetMarginColor('lightblue'); - - -// ..and titles -$graph->title->Set("Field plot"); - -// Setup the field plot -$fp = new FieldPlot($datay,$datax,$angle); - -// Setup formatting callback -$fp->SetCallback('FldCallback'); - -// First size argument is length (in pixels of arrow) -// Second size argument is roughly size of arrow. Arrow size is specified as -// an integer in the range [0,9] -$fp->arrow->SetSize(20,2); -$fp->arrow->SetColor('navy'); - -$graph->Add($fp); - -// .. and output -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/filledgridex1.php b/#jpgraph/src/Examples/filledgridex1.php deleted file mode 100644 index 8e863792..00000000 --- a/#jpgraph/src/Examples/filledgridex1.php +++ /dev/null @@ -1,50 +0,0 @@ -SetMarginColor('white'); -$graph->SetScale("textlin"); -$graph->SetFrame(false); -$graph->SetMargin(30,50,30,30); - -$graph->title->Set('Filled Y-grid'); - - -$graph->yaxis->HideZeroLabel(); -$graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5'); -$graph->xgrid->Show(); - -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -// Create the first line -$p1 = new LinePlot($datay1); -$p1->SetColor("navy"); -$p1->SetLegend('Line 1'); -$graph->Add($p1); - -// Create the second line -$p2 = new LinePlot($datay2); -$p2->SetColor("red"); -$p2->SetLegend('Line 2'); -$graph->Add($p2); - -// Create the third line -$p3 = new LinePlot($datay3); -$p3->SetColor("orange"); -$p3->SetLegend('Line 3'); -$graph->Add($p3); - -$graph->legend->SetShadow('gray@0.4',5); -$graph->legend->SetPos(0.1,0.1,'right','top'); -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/filledline01.php b/#jpgraph/src/Examples/filledline01.php deleted file mode 100644 index 4140b299..00000000 --- a/#jpgraph/src/Examples/filledline01.php +++ /dev/null @@ -1,24 +0,0 @@ -img->SetMargin(40,40,40,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); -$graph->title->Set("Example of filled line plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new LinePlot($datay); -$p1->SetFillColor("orange"); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$graph->Add($p1); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/filledlineex01.1.php b/#jpgraph/src/Examples/filledlineex01.1.php deleted file mode 100644 index 547d207e..00000000 --- a/#jpgraph/src/Examples/filledlineex01.1.php +++ /dev/null @@ -1,24 +0,0 @@ -SetScale("textlin"); - -$graph->img->SetMargin(40,40,40,40); -$graph->SetShadow(); -$graph->SetGridDepth(DEPTH_FRONT); - -$graph->title->Set("Example of filled line plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new LinePlot($datay); -$p1->SetFillColor("orange"); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$graph->Add($p1); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/filledlineex01.php b/#jpgraph/src/Examples/filledlineex01.php deleted file mode 100644 index 6ea2c88d..00000000 --- a/#jpgraph/src/Examples/filledlineex01.php +++ /dev/null @@ -1,23 +0,0 @@ -SetScale('textlin'); - -$graph->img->SetMargin(40,40,40,40); -$graph->SetShadow(); - -$graph->title->Set("Example of filled line plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new LinePlot($datay); -$p1->SetFillColor("orange"); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$graph->Add($p1); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/filledlineex02.php b/#jpgraph/src/Examples/filledlineex02.php deleted file mode 100644 index 1b4db02f..00000000 --- a/#jpgraph/src/Examples/filledlineex02.php +++ /dev/null @@ -1,24 +0,0 @@ -img->SetMargin(40,40,40,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); -$graph->title->Set("Example of filled line plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->subtitle->Set("(Starting from Y=0)"); - -$graph->yaxis->scale->SetAutoMin(0); - -$p1 = new LinePlot($datay); -$p1->SetFillColor("orange"); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$graph->Add($p1); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/filledlineex03.php b/#jpgraph/src/Examples/filledlineex03.php deleted file mode 100644 index 084e655d..00000000 --- a/#jpgraph/src/Examples/filledlineex03.php +++ /dev/null @@ -1,23 +0,0 @@ -SetScale('intlin'); -$graph->title->Set('Filled line with NULL values'); -//Make sure data starts from Zero whatever data we have -$graph->yscale->SetAutoMin(0); - -$p1 = new LinePlot($datay); -$p1->SetFillColor('lightblue'); -$graph->Add($p1); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/filledstepstyleex1.php b/#jpgraph/src/Examples/filledstepstyleex1.php deleted file mode 100644 index 75688b5f..00000000 --- a/#jpgraph/src/Examples/filledstepstyleex1.php +++ /dev/null @@ -1,39 +0,0 @@ -SetScale("textlin"); -$graph->SetShadow(true); -$graph->SetMarginColor("antiquewhite"); -$graph->img->SetMargin(60,40,40,50); -$graph->img->setTransparent("white"); -$graph->xaxis->SetFont(FF_FONT1); -$graph->xaxis->setTextTickInterval(1); -$graph->xaxis->SetTextLabelInterval(1); -$graph->legend->SetFillColor("antiquewhite"); -$graph->legend->SetShadow(true); -$graph->legend->SetLayout(LEGEND_VERT); -$graph->legend->Pos(0.02,0.01); -$graph->title->Set("Step Styled Example"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot = new LinePlot($ydata); -$lineplot->SetColor("black"); -$lineplot->setFillColor("gray7"); -$lineplot->SetStepStyle(); -$lineplot->SetLegend(" 2002 "); - -// add plot to the graph -$graph->Add($lineplot); -$graph->ygrid->show(false,false); - -// display graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/fireplace.jpg b/#jpgraph/src/Examples/fireplace.jpg deleted file mode 100644 index 8006e3d0..00000000 Binary files a/#jpgraph/src/Examples/fireplace.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/fixscale_radarex1.php b/#jpgraph/src/Examples/fixscale_radarex1.php deleted file mode 100644 index d663d908..00000000 --- a/#jpgraph/src/Examples/fixscale_radarex1.php +++ /dev/null @@ -1,36 +0,0 @@ -SetScale('lin',0,50); -$graph->yscale->ticks->Set(25,5); -$graph->SetColor('white'); -$graph->SetShadow(); - -$graph->SetCenter(0.5,0.55); - -$graph->axis->SetFont(FF_FONT1,FS_BOLD); -$graph->axis->SetWeight(2); - -// Uncomment the following lines to also show grid lines. -$graph->grid->SetLineStyle('dashed'); -$graph->grid->SetColor('navy@0.5'); -$graph->grid->Show(); - -$graph->ShowMinorTickMarks(); - -$graph->title->Set('Quality result'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->SetTitles(array('One','Two','Three','Four','Five','Sex','Seven','Eight','Nine','Ten')); - -$plot = new RadarPlot(array(12,35,20,30,33,15,37)); -$plot->SetLegend('Goal'); -$plot->SetColor('red','lightred'); -$plot->SetFillColor('lightblue'); -$plot->SetLineWeight(2); - -$graph->Add($plot); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/footerex1.php b/#jpgraph/src/Examples/footerex1.php deleted file mode 100644 index a3d113dc..00000000 --- a/#jpgraph/src/Examples/footerex1.php +++ /dev/null @@ -1,62 +0,0 @@ -SetMarginColor('white'); -$graph->SetScale("textlin"); -$graph->SetFrame(false); -$graph->SetMargin(30,5,25,50); - -// Setup the tab -$graph->tabtitle->Set(' Year 2003 ' ); -$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,13); -$graph->tabtitle->SetColor('darkred','#E1E1FF'); - -// Enable X-grid as well -$graph->xgrid->Show(); - -// Use months as X-labels -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -$graph->footer->left->Set('L. footer'); -$graph->footer->left->SetFont(FF_ARIAL,FS_NORMAL,12); -$graph->footer->left->SetColor('darkred'); -$graph->footer->center->Set('C. footer'); -$graph->footer->center->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->footer->center->SetColor('darkred'); -$graph->footer->right->Set('R. footer'); -$graph->footer->right->SetFont(FF_ARIAL,FS_NORMAL,12); -$graph->footer->right->SetColor('darkred'); - -// Create the plot -$p1 = new LinePlot($datay1); -$p1->SetColor("navy"); - -// Use an image of favourite car as marker -$p1->mark->SetType(MARK_IMG,'saab_95.jpg',0.5); - -// Displayes value on top of marker image -$p1->value->SetFormat('%d mil'); -$p1->value->Show(); -$p1->value->SetColor('darkred'); -$p1->value->SetFont(FF_ARIAL,FS_BOLD,10); -// Increase the margin so that the value is printed avove tje -// img marker -$p1->value->SetMargin(14); - -// Incent the X-scale so the first and last point doesn't -// fall on the edges -$p1->SetCenter(); - -$graph->Add($p1); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/funcex1.php b/#jpgraph/src/Examples/funcex1.php deleted file mode 100644 index de12e616..00000000 --- a/#jpgraph/src/Examples/funcex1.php +++ /dev/null @@ -1,58 +0,0 @@ -E(-1.2*M_PI,1.2*M_PI); - -$f = new FuncGenerator('$x*$x'); -list($x2data,$y2data) = $f->E(-2,2); - -// Setup the basic graph -$graph = new Graph(450,350); -$graph->SetScale("linlin"); -$graph->SetShadow(); -$graph->img->SetMargin(50,50,60,40); -$graph->SetBox(true,'black',2); -$graph->SetMarginColor('white'); -$graph->SetColor('lightyellow'); - -// ... and titles -$graph->title->Set('Example of Function plot'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->subtitle->Set("(With some more advanced axis formatting\nHiding first and last label)"); -$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); -$graph->xgrid->Show(); - -$graph->yaxis->SetPos(0); -$graph->yaxis->SetWeight(2); -$graph->yaxis->HideZeroLabel(); -$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->SetColor('black','darkblue'); -$graph->yaxis->HideTicks(true,false); -$graph->yaxis->HideFirstLastLabel(); - -$graph->xaxis->SetWeight(2); -$graph->xaxis->HideZeroLabel(); -$graph->xaxis->HideFirstLastLabel(); -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->SetColor('black','darkblue'); - -$lp1 = new LinePlot($ydata,$xdata); -$lp1->SetColor('blue'); -$lp1->SetWeight(2); - -$lp2 = new LinePlot($y2data,$x2data); -list($xm,$ym)=$lp2->Max(); -$lp2->SetColor('red'); -$lp2->SetWeight(2); - - -$graph->Add($lp1); -$graph->Add($lp2); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/funcex2.php b/#jpgraph/src/Examples/funcex2.php deleted file mode 100644 index 5715f36a..00000000 --- a/#jpgraph/src/Examples/funcex2.php +++ /dev/null @@ -1,34 +0,0 @@ -E(-M_PI,M_PI,25); - -$graph = new Graph(380,450); -$graph->SetScale("linlin"); -$graph->SetShadow(); -$graph->img->SetMargin(50,50,60,40); -$graph->SetBox(true,'black',2); -$graph->SetMarginColor('white'); -$graph->SetColor('lightyellow'); -$graph->SetAxisStyle(AXSTYLE_SIMPLE); - -//$graph->xaxis->SetLabelFormat('%.1f'); - -$graph->title->Set("Function plot with marker"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->subtitle->Set("(BOXOUT Axis style)"); -$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); - -$lp1 = new LinePlot($ydata,$xdata); -$lp1->mark->SetType(MARK_FILLEDCIRCLE); -$lp1->mark->SetFillColor("red"); -$lp1->SetColor("blue"); - -$graph->Add($lp1); -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/funcex3.php b/#jpgraph/src/Examples/funcex3.php deleted file mode 100644 index a63456ea..00000000 --- a/#jpgraph/src/Examples/funcex3.php +++ /dev/null @@ -1,37 +0,0 @@ -E(-M_PI,M_PI,25); - -$graph = new Graph(350,430); -$graph->SetScale("linlin"); -$graph->SetShadow(); -$graph->img->SetMargin(50,50,60,40); -$graph->SetBox(true,'black',2); -$graph->SetMarginColor('white'); -$graph->SetColor('lightyellow'); -$graph->SetAxisStyle(AXSTYLE_BOXIN); -$graph->xgrid->Show(); - - -//$graph->xaxis->SetLabelFormat('%.0f'); - -$graph->img->SetMargin(50,50,60,40); - -$graph->title->Set("Function plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->subtitle->Set("(BOXIN Axis style)"); -$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); - -$lp1 = new LinePlot($ydata,$xdata); -$lp1->SetColor("blue"); -$lp1->SetWeight(2); - -$graph->Add($lp1); -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/funcex4.php b/#jpgraph/src/Examples/funcex4.php deleted file mode 100644 index bcd8b4dc..00000000 --- a/#jpgraph/src/Examples/funcex4.php +++ /dev/null @@ -1,63 +0,0 @@ -E(-1.2*M_PI,1.2*M_PI); - -$f = new FuncGenerator('$x*$x'); -list($x2data,$y2data) = $f->E(-2,2); - -// Setup the basic graph -$graph = new Graph(450,350); -$graph->SetScale("linlin"); -//$graph->SetShadow(); -$graph->img->SetMargin(5,10,60,9); -$graph->SetBox(true,'green',2); -$graph->SetMarginColor('black'); -$graph->SetColor('black'); - -// ... and titles -$graph->title->Set('Example of Function plot'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->title->SetColor('lightgreen'); -$graph->subtitle->Set("(With some more advanced axis formatting\nHiding first and last label)"); -$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); -$graph->subtitle->SetColor('lightgreen'); - -$graph->xgrid->Show(); -$graph->xgrid->SetColor('darkgreen'); -$graph->ygrid->SetColor('darkgreen'); - -$graph->yaxis->SetPos(0); -$graph->yaxis->SetWeight(2); -$graph->yaxis->HideZeroLabel(); -$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->SetColor('green','green'); -$graph->yaxis->HideTicks(true,true); -$graph->yaxis->HideFirstLastLabel(); - -$graph->xaxis->SetWeight(2); -$graph->xaxis->HideZeroLabel(); -$graph->xaxis->HideFirstLastLabel(); -$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->SetColor('green','green'); - -$lp1 = new LinePlot($ydata,$xdata); -$lp1->SetColor('yellow'); -$lp1->SetWeight(2); - -$lp2 = new LinePlot($y2data,$x2data); -list($xm,$ym)=$lp2->Max(); -$lp2->SetColor('blue'); -$lp2->SetWeight(2); - - -$graph->Add($lp1); -$graph->Add($lp2); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/fusion_example.php b/#jpgraph/src/Examples/fusion_example.php deleted file mode 100644 index 4e4ae00f..00000000 --- a/#jpgraph/src/Examples/fusion_example.php +++ /dev/null @@ -1,57 +0,0 @@ - array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), - 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), - 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), - 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), - 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), - 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), - 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), - 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), - 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), -); - - -// Create the graph. These two calls are always required -$graph = new Graph(400,300); - -$graph->SetScale("textlin"); -if ($theme) { - $graph->SetTheme(new $theme()); -} -$theme_class = new FusionTheme; -$graph->SetTheme($theme_class); - -$plot = array(); -// Create the bar plots -for ($i = 0; $i < 4; $i++) { - $plot[$i] = new BarPlot($data[$i]); - $plot[$i]->SetLegend('plot'.($i+1)); -} -//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); -//$acc1->value->Show(); -$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); - -for ($i = 4; $i < 8; $i++) { - $plot[$i] = new LinePlot($data[$i]); - $plot[$i]->SetLegend('plot'.$i); - $plot[$i]->value->Show(); -} - -$graph->Add($gbplot); -$graph->Add($plot[4]); - -$title = "FusionTheme Example"; -$title = mb_convert_encoding($title,'UTF-8'); -$graph->title->Set($title); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/gantt_samerowex1.php b/#jpgraph/src/Examples/gantt_samerowex1.php deleted file mode 100644 index 6c59cebd..00000000 --- a/#jpgraph/src/Examples/gantt_samerowex1.php +++ /dev/null @@ -1,63 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("Activities on same row"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); // 1=default value - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2001-12-26",""); - -// Yellow diagonal line pattern on a red background -$activity1->SetPattern(BAND_RDIAG,"yellow"); -$activity1->SetFillColor("red"); - -// Set absolute height of activity -$activity1->SetHeight(16); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(0,"","2001-12-31","2002-01-2","[BO]"); - -// ADjust font for caption -$activity2->caption->SetFont(FF_ARIAL,FS_BOLD); -$activity2->caption->SetColor("darkred"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height of activity -$activity2->SetHeight(16); - -// Finally add the bar to the graph -$graph->Add($activity1); -$graph->Add($activity2); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/gantt_samerowex2.php b/#jpgraph/src/Examples/gantt_samerowex2.php deleted file mode 100644 index b3e2702a..00000000 --- a/#jpgraph/src/Examples/gantt_samerowex2.php +++ /dev/null @@ -1,65 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("Activities on same row"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set('Using break style'); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); // 1=default value - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2001-12-26",""); - -// Yellow diagonal line pattern on a red background -$activity1->SetPattern(BAND_RDIAG,"yellow"); -$activity1->SetFillColor("red"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$break1 = new GanttBar(0,'',"2001-12-27","2001-12-30",""); -$break1->SetBreakStyle(true,'dotted',2); -$break1->SetColor('red'); -$graph->Add($break1); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(0,"","2001-12-31","2002-01-2","[BO]"); - -// ADjust font for caption -$activity2->caption->SetFont(FF_ARIAL,FS_BOLD); -$activity2->caption->SetColor("darkred"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Finally add the bar to the graph -$graph->Add($activity1); -$graph->Add($activity2); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/gantt_textex1.php b/#jpgraph/src/Examples/gantt_textex1.php deleted file mode 100644 index dae1d56e..00000000 --- a/#jpgraph/src/Examples/gantt_textex1.php +++ /dev/null @@ -1,96 +0,0 @@ -SetBox(); -$graph->SetShadow(); - -// Add title and subtitle -$graph->title->Set("Example with added texts"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Set table title -$graph->scale->tableTitle->Set("(Rev: 1.22)"); -$graph->scale->tableTitle->SetFont(FF_FONT1,FS_BOLD); -$graph->scale->SetTableTitleBackground("silver"); - -// Modify the appearance of the dividing lines -$graph->scale->divider->SetWeight(3); -$graph->scale->divider->SetColor("navy"); -$graph->scale->dividerh->SetWeight(3); -$graph->scale->dividerh->SetColor("navy"); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Set absolute height -$activity->SetHeight(10); - -// Specify progress to 60% -$activity->progress->Set(0.6); -$activity->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Project","2001-12-21","2001-12-27","[30%]"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height -$activity2->SetHeight(10); - -// Specify progress to 30% -$activity2->progress->Set(0.3); -$activity2->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Add text to top left corner of graph -$txt1 = new Text(); -$txt1->SetPos(5,2); -$txt1->Set("Note:\nEstimate done w148"); -$txt1->SetFont(FF_ARIAL,FS_BOLD,12); -$txt1->SetColor('darkred'); -$graph->Add($txt1); - -// Add text to the top bar -$txt2 = new Text(); -$txt2->SetScalePos("2002-01-01",1); -$txt2->SetFont(FF_ARIAL,FS_BOLD,12); -$txt2->SetAlign('left','center'); -$txt2->Set("Remember this!"); -$txt2->SetBox('yellow'); -$graph->Add($txt2); - - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttcolumnfontsex01.php b/#jpgraph/src/Examples/ganttcolumnfontsex01.php deleted file mode 100644 index a371f875..00000000 --- a/#jpgraph/src/Examples/ganttcolumnfontsex01.php +++ /dev/null @@ -1,68 +0,0 @@ -SetMarginColor('gray:1.7'); -$graph->SetColor('white'); - -// Setup the graph title and title font -$graph->title->Set("Example of column fonts"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); - -// Show three headers -$graph->ShowHeaders(GANTT_HDAY | GANTT_HMONTH| GANTT_HYEAR); - -// Set the column headers and font -$graph->scale->actinfo->SetColTitles( array('Name','Start','End'),array(100)); -$graph->scale->actinfo->SetFont(FF_ARIAL,FS_BOLD,11); - -// Some "dummy" data to be dsiplayed -$data = array( - array(0,'Group 1', '2001-11-27','2001-12-05'), - array(1,' Activity 1', '2001-11-27','2001-11-29'), - array(2,' Activity 2', '2001-11-28','2001-12-05'), - array(3,'Group 2', '2001-11-29','2001-12-10'), - array(4,' Activity 1', '2001-11-29','2001-12-03'), - array(5,' Activity 2', '2001-12-01','2001-12-10'), - -); - -// Format and add the Gantt bars to the chart -$n = count($data); -for($i=0; $i < $n; ++$i) { - if( $i === 0 || $i === 3 ) { - // Format the group bars - $bar = new GanttBar($data[$i][0],array($data[$i][1],$data[$i][2],$data[$i][3]),$data[$i][2],$data[$i][3],'',0.35); - - // For each group make the name bold but keep the dates as the default font - $bar->title->SetColumnFonts(array(array(FF_ARIAL,FS_BOLD,11))); - - // Add group markers - $bar->leftMark->SetType( MARK_LEFTTRIANGLE ); - $bar->leftMark->Show(); - $bar->rightMark->SetType( MARK_RIGHTTRIANGLE ); - $bar->rightMark->Show(); - $bar->SetFillColor('black'); - $bar->SetPattern(BAND_SOLID,'black'); - } - else { - // Format the activity bars - $bar = new GanttBar($data[$i][0],array($data[$i][1],$data[$i][2],$data[$i][3]),$data[$i][2],$data[$i][3],'',0.45); - $bar->SetPattern(BAND_RDIAG,'black'); - $bar->SetFillColor('orange'); - } - // Default font - $bar->title->SetFont(FF_ARIAL,FS_NORMAL,10); - $graph->Add($bar); -} - -// Send back the graph to the client -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/ganttconstrainex0.php b/#jpgraph/src/Examples/ganttconstrainex0.php deleted file mode 100644 index 8f5b72a1..00000000 --- a/#jpgraph/src/Examples/ganttconstrainex0.php +++ /dev/null @@ -1,38 +0,0 @@ -title->Set("Example with grouping and constrains"); - -// Setup scale -$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR); - -// Add the specified activities -$graph->CreateSimple($data,$constrains,$progress); - -// .. and stroke the graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/ganttconstrainex1.php b/#jpgraph/src/Examples/ganttconstrainex1.php deleted file mode 100644 index 7e9a3c1f..00000000 --- a/#jpgraph/src/Examples/ganttconstrainex1.php +++ /dev/null @@ -1,40 +0,0 @@ -title->Set("Example with grouping and constrains"); - -// Setup scale -$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR); - -// Add the specified activities -$graph->CreateSimple($data,$constrains,$progress); - -// .. and stroke the graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/ganttconstrainex2.php b/#jpgraph/src/Examples/ganttconstrainex2.php deleted file mode 100644 index 1e6bbbab..00000000 --- a/#jpgraph/src/Examples/ganttconstrainex2.php +++ /dev/null @@ -1,39 +0,0 @@ -title->Set("Example with grouping and constrains"); -//$graph->SetFrame(false); - -// Setup scale -$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR); - -// Add the specified activities -$graph->CreateSimple($data,$constrains,$progress); - -// .. and stroke the graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/ganttcsimex01.php b/#jpgraph/src/Examples/ganttcsimex01.php deleted file mode 100644 index 997d3473..00000000 --- a/#jpgraph/src/Examples/ganttcsimex01.php +++ /dev/null @@ -1,28 +0,0 @@ -SetCSIMTarget('#','Go back 1'); -$bar1->title->SetCSIMTarget('#','Go back 1 (title)'); -$bar2 = new GanttBar(1,"Activity 2","2002-01-03","2002-01-25"); -$bar2->SetCSIMTarget('#','Go back 2'); -$bar2->title->SetCSIMTarget('#','Go back 2 (title)'); - -$graph = new GanttGraph(500); -$graph->title->Set("Example with image map"); -$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); -$graph->scale->week->SetFont(FF_FONT1); - -$graph->Add(array($bar1,$bar2)); - -// And stroke -$graph->StrokeCSIM(); - - -?> - - diff --git a/#jpgraph/src/Examples/ganttcsimex02.php b/#jpgraph/src/Examples/ganttcsimex02.php deleted file mode 100644 index b9dd4c66..00000000 --- a/#jpgraph/src/Examples/ganttcsimex02.php +++ /dev/null @@ -1,40 +0,0 @@ -title->Set("Example with image map"); -$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); -$graph->scale->week->SetFont(FF_FONT1); - -$graph->CreateSimple($data,$constrains,$progress); - -// Add the specified activities -//SetupSimpleGantt($graph,$data,$constrains,$progress); - -// And stroke -$graph->StrokeCSIM(); - - -?> - - diff --git a/#jpgraph/src/Examples/ganttex00.php b/#jpgraph/src/Examples/ganttex00.php deleted file mode 100644 index 618b7f9d..00000000 --- a/#jpgraph/src/Examples/ganttex00.php +++ /dev/null @@ -1,14 +0,0 @@ -Add($activity); - -// Display the Gantt chart -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex01.php b/#jpgraph/src/Examples/ganttex01.php deleted file mode 100644 index b3b9d535..00000000 --- a/#jpgraph/src/Examples/ganttex01.php +++ /dev/null @@ -1,40 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set('A main title'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set('(Draft version)'); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,'Activity 1','2001-12-21','2002-01-18'); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_LDIAG,'yellow'); -$activity->SetFillColor('red'); - -// Finally add the bar to the graph -$graph->Add($activity); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex02.php b/#jpgraph/src/Examples/ganttex02.php deleted file mode 100644 index 2ac42ed7..00000000 --- a/#jpgraph/src/Examples/ganttex02.php +++ /dev/null @@ -1,42 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("Main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// Show day, week and month scale -//$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); -$graph->ShowHeaders(GANTT_HWEEK ); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_WNBR); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Finally add the bar to the graph -$graph->Add($activity); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex03.php b/#jpgraph/src/Examples/ganttex03.php deleted file mode 100644 index de528a53..00000000 --- a/#jpgraph/src/Examples/ganttex03.php +++ /dev/null @@ -1,42 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("A nice main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(Draft version)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(7,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Finally add the bar to the graph -$graph->Add($activity); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex04.php b/#jpgraph/src/Examples/ganttex04.php deleted file mode 100644 index c9ea4cb9..00000000 --- a/#jpgraph/src/Examples/ganttex04.php +++ /dev/null @@ -1,47 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("A nice main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(Draft version)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Finally add the bar to the graph -$graph->Add($activity); - -// Create a miletone -$milestone = new MileStone(2,"Milestone",'2002-01-09','MS5'); -$milestone->caption->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->Add($milestone); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex05.php b/#jpgraph/src/Examples/ganttex05.php deleted file mode 100644 index 6c0ef36c..00000000 --- a/#jpgraph/src/Examples/ganttex05.php +++ /dev/null @@ -1,48 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("A nice main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(Draft version)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Finally add the bar to the graph -$graph->Add($activity); - -// Create a miletone -$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15"); -$milestone->title->SetColor("black"); -$milestone->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($milestone); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex06.php b/#jpgraph/src/Examples/ganttex06.php deleted file mode 100644 index 8cf4dbb3..00000000 --- a/#jpgraph/src/Examples/ganttex06.php +++ /dev/null @@ -1,52 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("A nice main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(Draft version)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Finally add the bar to the graph -$graph->Add($activity); - -// Create a miletone -$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15"); -$milestone->title->SetColor("black"); -$milestone->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($milestone); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex07.php b/#jpgraph/src/Examples/ganttex07.php deleted file mode 100644 index b1eb27aa..00000000 --- a/#jpgraph/src/Examples/ganttex07.php +++ /dev/null @@ -1,53 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("A nice main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(Draft version)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Finally add the bar to the graph -$graph->Add($activity); - -// Create a miletone -$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15"); -$milestone->title->SetColor("black"); -$milestone->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($milestone); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex08.php b/#jpgraph/src/Examples/ganttex08.php deleted file mode 100644 index 62d8947c..00000000 --- a/#jpgraph/src/Examples/ganttex08.php +++ /dev/null @@ -1,63 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("A nice main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(Draft version)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-01-15"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Add a right marker -$activity->rightMark->Show(); -$activity->rightMark->SetType(MARK_FILLEDCIRCLE); -$activity->rightMark->SetWidth(13); -$activity->rightMark->SetColor("red"); -$activity->rightMark->SetFillColor("red"); -$activity->rightMark->title->Set("M5"); -$activity->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12); -$activity->rightMark->title->SetColor("white"); - -// Finally add the bar to the graph -$graph->Add($activity); - -// Create a miletone -$milestone = new MileStone(2,"Milestone","2002-01-10","2002-01-10"); -$milestone->title->SetColor("black"); -$milestone->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($milestone); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex09.php b/#jpgraph/src/Examples/ganttex09.php deleted file mode 100644 index f5fff1a1..00000000 --- a/#jpgraph/src/Examples/ganttex09.php +++ /dev/null @@ -1,66 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("A nice main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(Draft version)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Add a right marker -$activity->rightMark->Show(); -$activity->rightMark->SetType(MARK_FILLEDCIRCLE); -$activity->rightMark->SetWidth(13); -$activity->rightMark->SetColor("red"); -$activity->rightMark->SetFillColor("red"); -$activity->rightMark->title->Set("M5"); -$activity->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12); -$activity->rightMark->title->SetColor("white"); - -// Set absolute height -$activity->SetHeight(8); - -// Finally add the bar to the graph -$graph->Add($activity); - -// Create a miletone -$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15"); -$milestone->title->SetColor("black"); -$milestone->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($milestone); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex10.php b/#jpgraph/src/Examples/ganttex10.php deleted file mode 100644 index 459920cf..00000000 --- a/#jpgraph/src/Examples/ganttex10.php +++ /dev/null @@ -1,90 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("A nice main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(Draft version)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Add a right marker -$activity->rightMark->Show(); -$activity->rightMark->SetType(MARK_FILLEDCIRCLE); -$activity->rightMark->SetWidth(13); -$activity->rightMark->SetColor("red"); -$activity->rightMark->SetFillColor("red"); -$activity->rightMark->title->Set("M5"); -$activity->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12); -$activity->rightMark->title->SetColor("white"); - -// Set absolute height -$activity->SetHeight(1); - - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Add a right marker -$activity2->rightMark->Show(); -$activity2->rightMark->SetType(MARK_FILLEDCIRCLE); -$activity2->rightMark->SetWidth(13); -$activity2->rightMark->SetColor("red"); -$activity2->rightMark->SetFillColor("red"); -$activity2->rightMark->title->Set("M5"); -$activity2->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12); -$activity2->rightMark->title->SetColor("white"); - -// Set absolute height -$activity2->SetHeight(1); - - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Create a miletone -$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15"); -$milestone->title->SetColor("black"); -$milestone->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($milestone); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex11.php b/#jpgraph/src/Examples/ganttex11.php deleted file mode 100644 index 2fec58bb..00000000 --- a/#jpgraph/src/Examples/ganttex11.php +++ /dev/null @@ -1,89 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("A nice main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(Draft version)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Add a right marker -$activity->rightMark->Show(); -$activity->rightMark->SetType(MARK_FILLEDCIRCLE); -$activity->rightMark->SetWidth(13); -$activity->rightMark->SetColor("red"); -$activity->rightMark->SetFillColor("red"); -$activity->rightMark->title->Set("M5"); -$activity->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12); -$activity->rightMark->title->SetColor("white"); - -// Set absolute height -$activity->SetHeight(10); - - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Add a right marker -$activity2->rightMark->Show(); -$activity2->rightMark->SetType(MARK_FILLEDCIRCLE); -$activity2->rightMark->SetWidth(13); -$activity2->rightMark->SetColor("red"); -$activity2->rightMark->SetFillColor("red"); -$activity2->rightMark->title->Set("M5"); -$activity2->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12); -$activity2->rightMark->title->SetColor("white"); - -// Set absolute height -$activity2->SetHeight(10); - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Create a miletone -$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15"); -$milestone->title->SetColor("black"); -$milestone->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($milestone); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex12.php b/#jpgraph/src/Examples/ganttex12.php deleted file mode 100644 index e7adc7a9..00000000 --- a/#jpgraph/src/Examples/ganttex12.php +++ /dev/null @@ -1,93 +0,0 @@ -SetBox(); -$graph->SetShadow(); - -// Add title and subtitle -$graph->title->Set("A nice main title"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(Draft version)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(0); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Add a right marker -$activity->rightMark->Show(); -$activity->rightMark->SetType(MARK_FILLEDCIRCLE); -$activity->rightMark->SetWidth(13); -$activity->rightMark->SetColor("red"); -$activity->rightMark->SetFillColor("red"); -$activity->rightMark->title->Set("M5"); -$activity->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12); -$activity->rightMark->title->SetColor("white"); - -// Set absolute height -$activity->SetHeight(10); - - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Project","2001-12-21","2002-02-20"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Add a right marker -$activity2->rightMark->Show(); -$activity2->rightMark->SetType(MARK_FILLEDCIRCLE); -$activity2->rightMark->SetWidth(13); -$activity2->rightMark->SetColor("red"); -$activity2->rightMark->SetFillColor("red"); -$activity2->rightMark->title->Set("M5"); -$activity2->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12); -$activity2->rightMark->title->SetColor("white"); - -// Set absolute height -$activity2->SetHeight(10); - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Create a miletone -$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15"); -$milestone->title->SetColor("black"); -$milestone->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($milestone); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex13-zoom1.php b/#jpgraph/src/Examples/ganttex13-zoom1.php deleted file mode 100644 index 9a8457e6..00000000 --- a/#jpgraph/src/Examples/ganttex13-zoom1.php +++ /dev/null @@ -1,67 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("Zooming a graph"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(zoom=0.7)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1.0); // 1=default value - -// Set zoom factor -$graph->SetZoomFactor(0.7); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2002-01-07","[ER,TR]"); - -// Yellow diagonal line pattern on a red background -$activity1->SetPattern(BAND_RDIAG,"yellow"); -$activity1->SetFillColor("red"); - -// Set absolute height of activity -$activity1->SetHeight(16); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Activity 2","2001-12-21","2002-01-01","[BO,SW,JC]"); - -// ADjust font for caption -$activity2->caption->SetFont(FF_ARIAL,FS_BOLD); -$activity2->caption->SetColor("darkred"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height of activity -$activity2->SetHeight(16); - -// Finally add the bar to the graph -$graph->Add($activity1); -$graph->Add($activity2); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex13-zoom2.php b/#jpgraph/src/Examples/ganttex13-zoom2.php deleted file mode 100644 index 882fb7bc..00000000 --- a/#jpgraph/src/Examples/ganttex13-zoom2.php +++ /dev/null @@ -1,67 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("Zooming a graph"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(zoom=1.5)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1.0); // 1=default value - -// Set zoom factor -$graph->SetZoomFactor(1.5); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2002-01-07","[ER,TR]"); - -// Yellow diagonal line pattern on a red background -$activity1->SetPattern(BAND_RDIAG,"yellow"); -$activity1->SetFillColor("red"); - -// Set absolute height of activity -$activity1->SetHeight(16); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Activity 2","2001-12-21","2002-01-01","[BO,SW,JC]"); - -// ADjust font for caption -$activity2->caption->SetFont(FF_ARIAL,FS_BOLD); -$activity2->caption->SetColor("darkred"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height of activity -$activity2->SetHeight(16); - -// Finally add the bar to the graph -$graph->Add($activity1); -$graph->Add($activity2); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex13.php b/#jpgraph/src/Examples/ganttex13.php deleted file mode 100644 index 865a4db0..00000000 --- a/#jpgraph/src/Examples/ganttex13.php +++ /dev/null @@ -1,64 +0,0 @@ -SetShadow(); - -// Add title and subtitle -$graph->title->Set("Example of captions"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(ganttex13.php)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Instead of week number show the date for the first day in the week -// on the week scale -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Make the week scale font smaller than the default -$graph->scale->week->SetFont(FF_FONT0); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); // 1=default value - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2002-01-07","[ER,TR]"); - -// Yellow diagonal line pattern on a red background -$activity1->SetPattern(BAND_RDIAG,"yellow"); -$activity1->SetFillColor("red"); - -// Set absolute height of activity -$activity1->SetHeight(16); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Activity 2","2001-12-21","2002-01-01","[BO,SW,JC]"); - -// ADjust font for caption -$activity2->caption->SetFont(FF_ARIAL,FS_BOLD); -$activity2->caption->SetColor("darkred"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height of activity -$activity2->SetHeight(16); - -// Finally add the bar to the graph -$graph->Add($activity1); -$graph->Add($activity2); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex14.php b/#jpgraph/src/Examples/ganttex14.php deleted file mode 100644 index a53942ba..00000000 --- a/#jpgraph/src/Examples/ganttex14.php +++ /dev/null @@ -1,67 +0,0 @@ -SetBox(); -$graph->SetShadow(); - -// Add title and subtitle -$graph->title->Set("Example of captions"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(ganttex14.php)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Set absolute height -$activity->SetHeight(10); - -// Specify progress to 60% -$activity->progress->Set(0.6); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height -$activity2->SetHeight(10); - -// Specify progress to 30% -$activity2->progress->Set(0.3); - - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex15.php b/#jpgraph/src/Examples/ganttex15.php deleted file mode 100644 index ae759839..00000000 --- a/#jpgraph/src/Examples/ganttex15.php +++ /dev/null @@ -1,68 +0,0 @@ -SetBox(); -$graph->SetShadow(); - -// Add title and subtitle -$graph->title->Set("Example of captions"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(ganttex15.php)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Set absolute height -$activity->SetHeight(10); - -// Specify progress to 60% -$activity->progress->Set(0.6); -$activity->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height -$activity2->SetHeight(10); - -// Specify progress to 30% -$activity2->progress->Set(0.3); -$activity2->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex16.php b/#jpgraph/src/Examples/ganttex16.php deleted file mode 100644 index bf3e06fa..00000000 --- a/#jpgraph/src/Examples/ganttex16.php +++ /dev/null @@ -1,73 +0,0 @@ -SetBox(); -$graph->SetShadow(); - -// Add title and subtitle -$graph->title->Set("Example of captions"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(ganttex16.php)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Set table title -$graph->scale->tableTitle->Set("(Rev: 1.22)"); -$graph->scale->tableTitle->SetFont(FF_FONT1,FS_BOLD); -$graph->scale->SetTableTitleBackground("silver"); -$graph->scale->tableTitle->Show(); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Set absolute height -$activity->SetHeight(10); - -// Specify progress to 60% -$activity->progress->Set(0.6); -$activity->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height -$activity2->SetHeight(10); - -// Specify progress to 30% -$activity2->progress->Set(0.3); -$activity2->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex17-flag.php b/#jpgraph/src/Examples/ganttex17-flag.php deleted file mode 100644 index 17eaca49..00000000 --- a/#jpgraph/src/Examples/ganttex17-flag.php +++ /dev/null @@ -1,88 +0,0 @@ -SetBox(); -$graph->SetShadow(); - -// Add title and subtitle -$graph->title->Set("Example of captions"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(ganttex17.php)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Set table title -$graph->scale->tableTitle->Set("(Rev: 1.22)"); -$graph->scale->tableTitle->SetFont(FF_FONT1,FS_BOLD); -$graph->scale->SetTableTitleBackground("silver"); - -// Modify the appearance of the dividing lines -$graph->scale->divider->SetWeight(3); -$graph->scale->divider->SetColor("navy"); -$graph->scale->dividerh->SetWeight(3); -$graph->scale->dividerh->SetColor("navy"); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Set absolute height -$activity->SetHeight(10); - -// Specify progress to 60% -$activity->progress->Set(0.6); -$activity->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height -$activity2->SetHeight(10); - -// Specify progress to 30% -$activity2->progress->Set(0.3); -$activity2->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Add a coutnry flag -$icon = new IconPlot(); -$icon->SetAnchor('left','top'); -$icon->SetCountryFlag('norway'); -$icon->SetMix(50); -$icon->SetPos(5,5); -$graph->Add($icon); - - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex17.php b/#jpgraph/src/Examples/ganttex17.php deleted file mode 100644 index cc2e7e89..00000000 --- a/#jpgraph/src/Examples/ganttex17.php +++ /dev/null @@ -1,78 +0,0 @@ -SetBox(); -$graph->SetShadow(); - -// Add title and subtitle -$graph->title->Set("Example of captions"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(ganttex17.php)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Set table title -$graph->scale->tableTitle->Set("(Rev: 1.22)"); -$graph->scale->tableTitle->SetFont(FF_FONT1,FS_BOLD); -$graph->scale->SetTableTitleBackground("silver"); - -// Modify the appearance of the dividing lines -$graph->scale->divider->SetWeight(3); -$graph->scale->divider->SetColor("navy"); -$graph->scale->dividerh->SetWeight(3); -$graph->scale->dividerh->SetColor("navy"); - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Set absolute height -$activity->SetHeight(10); - -// Specify progress to 60% -$activity->progress->Set(0.6); -$activity->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height -$activity2->SetHeight(10); - -// Specify progress to 30% -$activity2->progress->Set(0.3); -$activity2->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex18.php b/#jpgraph/src/Examples/ganttex18.php deleted file mode 100644 index 4c4b5d91..00000000 --- a/#jpgraph/src/Examples/ganttex18.php +++ /dev/null @@ -1,82 +0,0 @@ -SetBox(); -$graph->SetShadow(); - -// Add title and subtitle -$graph->title->Set("Example of captions"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set("(ganttex18.php)"); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Set table title -$graph->scale->tableTitle->Set("(Rev: 1.22)"); -$graph->scale->tableTitle->SetFont(FF_FONT1,FS_BOLD); -$graph->scale->SetTableTitleBackground("silver"); - -// Modify the appearance of the dividing lines -$graph->scale->divider->SetWeight(3); -$graph->scale->divider->SetColor("navy"); - -$graph->scale->dividerh->SetWeight(3); -$graph->scale->dividerh->SetColor("navy"); - -$graph->SetBox(true,"navy",3); - - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2); -$graph->scale->month->SetFontColor("white"); -$graph->scale->month->SetBackgroundColor("blue"); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]"); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,"yellow"); -$activity->SetFillColor("red"); - -// Set absolute height -$activity->SetHeight(10); - -// Specify progress to 60% -$activity->progress->Set(0.6); -$activity->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]"); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,"yellow"); -$activity2->SetFillColor("red"); - -// Set absolute height -$activity2->SetHeight(10); - -// Specify progress to 30% -$activity2->progress->Set(0.3); -$activity2->progress->SetPattern(BAND_HVCROSS,"blue"); - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Add a vertical line -$vline = new GanttVLine("2001-12-24","Phase 1"); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex19.php b/#jpgraph/src/Examples/ganttex19.php deleted file mode 100644 index 7528412e..00000000 --- a/#jpgraph/src/Examples/ganttex19.php +++ /dev/null @@ -1,84 +0,0 @@ -SetBox(); -$graph->SetShadow(); - -// Use default locale -$graph->scale->SetDateLocale('sv_SE'); - -// Add title and subtitle -$graph->title->Set('Example of captions'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->subtitle->Set('(ganttex19.php)'); - -// Show day, week and month scale -$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH); - -// Set table title -$graph->scale->tableTitle->Set('(Rev: 1.22)'); -$graph->scale->tableTitle->SetFont(FF_FONT1,FS_BOLD); -$graph->scale->SetTableTitleBackground('silver'); -$graph->scale->tableTitle->Show(); - -$graph->scale->divider->SetStyle('solid'); -$graph->scale->divider->SetWeight(2); -$graph->scale->divider->SetColor('black'); - - -$graph->SetBox(true,'navy',2); - - -// Use the short name of the month together with a 2 digit year -// on the month scale -$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2); -$graph->scale->month->SetFontColor('white'); -$graph->scale->month->SetBackgroundColor('blue'); - -// 0 % vertical label margin -$graph->SetLabelVMarginFactor(1); - -// Format the bar for the first activity -// ($row,$title,$startdate,$enddate) -$activity = new GanttBar(0,'Project','2001-12-21','2002-01-07','[50%]'); - -// Yellow diagonal line pattern on a red background -$activity->SetPattern(BAND_RDIAG,'yellow'); -$activity->SetFillColor('red'); - -// Set absolute height -$activity->SetHeight(10); - -// Specify progress to 60% -$activity->progress->Set(0.6); -$activity->progress->SetPattern(BAND_HVCROSS,'blue'); - -// Format the bar for the second activity -// ($row,$title,$startdate,$enddate) -$activity2 = new GanttBar(1,'Project','2001-12-21','2002-01-02','[30%]'); - -// Yellow diagonal line pattern on a red background -$activity2->SetPattern(BAND_RDIAG,'yellow'); -$activity2->SetFillColor('red'); - -// Set absolute height -$activity2->SetHeight(10); - -// Specify progress to 30% -$activity2->progress->Set(0.3); -$activity2->progress->SetPattern(BAND_HVCROSS,'blue'); - -// Finally add the bar to the graph -$graph->Add($activity); -$graph->Add($activity2); - -// Add a vertical line -$vline = new GanttVLine('2001-12-24','Phase 1'); -$vline->SetDayOffset(0.5); -//$graph->Add($vline); - -// ... and display it -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/ganttex30.php b/#jpgraph/src/Examples/ganttex30.php deleted file mode 100644 index 45cc80b6..00000000 --- a/#jpgraph/src/Examples/ganttex30.php +++ /dev/null @@ -1,87 +0,0 @@ -SetShadow(); -$graph->SetBox(); - -// Titles for chart -$graph->title->Set("General conversion plan"); -$graph->subtitle->Set("(Revision: 2001-11-18)"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// For illustration we enable all headers. -$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); - -// For the week we choose to show the start date of the week -// the default is to show week number (according to ISO 8601) -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Change the scale font -$graph->scale->week->SetFont(FF_FONT0); -$graph->scale->year->SetFont(FF_ARIAL,FS_BOLD,12); - - -// Setup some data for the gantt bars -$data = array( - array(0,"Group 1", "2001-10-29","2001-11-27",FF_FONT1,FS_BOLD,8), - array(1," Label 2", "2001-11-8","2001-12-14"), - array(2," Label 3", "2001-11-01","2001-11-8"), - array(4,"Group 2", "2001-11-07","2001-12-19",FF_FONT1,FS_BOLD,8), - array(5," Label 4", "2001-11-8","2001-12-19"), - array(6," Label 5", "2001-11-01","2001-11-8") - ); - -for($i=0; $i4 ) - $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); - - // If you like each bar can have a shadow - // $bar->SetShadow(true,"darkgray"); - - // For illustration lets make each bar be red with yellow diagonal stripes - $bar->SetPattern(BAND_RDIAG,"yellow"); - $bar->SetFillColor("red"); - - // To indicate progress each bar can have a smaller bar within - // For illustrative purpose just set the progress to 50% for each bar - $bar->progress->Set(0.5); - - // Each bar may also have optional left and right plot marks - // As illustration lets put a filled circle with a number at the end - // of each bar - $bar->rightMark->SetType(MARK_FILLEDCIRCLE); - $bar->rightMark->SetFillColor("red"); - $bar->rightMark->SetColor("red"); - $bar->rightMark->SetWidth(10); - - // Title for the mark - $bar->rightMark->title->Set("".$i+1); - $bar->rightMark->title->SetColor("white"); - $bar->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,10); - $bar->rightMark->Show(); - - // ... and add the bar to the gantt chart - $graph->Add($bar); -} - -// Create a milestone mark -$ms = new MileStone(7,"M5","2001-12-10","10/12"); -$ms->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($ms); - -// Create a vertical line to emphasize the milestone -$vl = new GanttVLine("2001-12-10 13:00","Phase 1","darkred"); -$vl->SetDayOffset(0.5); // Center the line in the day -$graph->Add($vl); - -// Output the graph -$graph->Stroke(); - -// EOF -?> diff --git a/#jpgraph/src/Examples/ganttex_slice.php b/#jpgraph/src/Examples/ganttex_slice.php deleted file mode 100644 index 5ec95bc9..00000000 --- a/#jpgraph/src/Examples/ganttex_slice.php +++ /dev/null @@ -1,78 +0,0 @@ -SetShadow(); -$graph->SetBox(); - -// Only show part of the Gantt -$graph->SetDateRange('2001-11-22','2002-1-24'); - -// Weeks start on Sunday -$graph->scale->SetWeekStart(0); - -$graph->title->Set("General conversion plan"); -$graph->subtitle->Set("(Slice between 2001-11-22 to 2002-01-24)"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,20); - -$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); -$graph->scale->week->SetFont(FF_FONT1); - - -$data = array( - array(0,"Group 1\tJohan", "2002-1-23","2002-01-28",FF_FONT1,FS_BOLD,8), - array(1," Label 2", "2001-10-26","2001-11-16"), - array(2," Label 3", "2001-11-30","2001-12-01"), - array(4,"Group 2", "2001-11-30","2001-12-22",FF_FONT1,FS_BOLD,8), - array(5," Label 4", "2001-11-30","2001-12-1"), - array(6," Label 5", "2001-12-6","2001-12-8"), - array(8," Label 8", "2001-11-30","2002-01-02") - ); - - -// make up some fictionary activity bars -for($i=0; $i4 ) - $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); - - $bar->rightMark->Show(); - $bar->rightMark->SetType(MARK_FILLEDCIRCLE); - $bar->rightMark->SetWidth(8); - $bar->rightMark->SetColor("red"); - $bar->rightMark->SetFillColor("red"); - $bar->rightMark->title->Set($i+1); - $bar->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12); - $bar->rightMark->title->SetColor("white"); - - $bar->SetPattern(BAND_RDIAG,"yellow"); - $bar->SetFillColor("red"); - $bar->progress->Set($i/10); - $bar->progress->SetPattern(GANTT_SOLID,"darkgreen"); - - $graph->Add($bar); -} - - -// The line will NOT be shown since it is outside the specified slice -$vline = new GanttVLine("2002-02-28"); -$vline->title->Set("2002-02-28"); -$vline->title->SetFont(FF_FONT1,FS_BOLD,10); -$graph->Add($vline); - -// The milestone will NOT be shown since it is outside the specified slice -$ms = new MileStone(7,"M5","2002-01-28","28/1"); -$ms->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($ms); - -$graph->Stroke(); - - -?> - - diff --git a/#jpgraph/src/Examples/gantthgridex1.php b/#jpgraph/src/Examples/gantthgridex1.php deleted file mode 100644 index 70a94813..00000000 --- a/#jpgraph/src/Examples/gantthgridex1.php +++ /dev/null @@ -1,63 +0,0 @@ -title->Set("Grid example"); -$graph->subtitle->Set("(Horizontal grid)"); -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,14); - -// Specify what headers to show -$graph->ShowHeaders(GANTT_HMONTH|GANTT_HDAY ); -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); -$graph->scale->week->SetFont(FF_FONT0); - -// Setup a horizontal grid -$graph->hgrid->Show(); -$graph->hgrid->SetRowFillColor('darkblue@0.9'); - - -for($i=0; $i 4 ) - $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); - $bar->SetPattern(BAND_RDIAG,"yellow"); - $bar->SetFillColor("red"); - $graph->Add($bar); -} - -// Setup a vertical marker line -$vline = new GanttVLine("2001-11-01"); -$vline->SetDayOffset(0.5); -$vline->title->Set("2001-11-01"); -$vline->title->SetFont(FF_FONT1,FS_BOLD,10); -$graph->Add($vline); - -// Setup a milestone -$ms = new MileStone(6,"M5","2001-11-28","28/12"); -$ms->title->SetFont(FF_FONT1,FS_BOLD); -$graph->Add($ms); - -// And to show that you can also add an icon we add "Tux" -$icon = new IconPlot('penguin.png',0.05,0.95,1,15); -$icon->SetAnchor('left','bottom'); -$graph->Add($icon); - -// .. and finally send it back to the browser -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/gantthourex1.php b/#jpgraph/src/Examples/gantthourex1.php deleted file mode 100644 index bfe55324..00000000 --- a/#jpgraph/src/Examples/gantthourex1.php +++ /dev/null @@ -1,51 +0,0 @@ -SetMarginColor('blue:1.7'); -$graph->SetColor('white'); - -$graph->SetBackgroundGradient('navy','white',GRAD_HOR,BGRAD_MARGIN); -$graph->scale->hour->SetBackgroundColor('lightyellow:1.5'); -$graph->scale->hour->SetFont(FF_FONT1); -$graph->scale->day->SetBackgroundColor('lightyellow:1.5'); -$graph->scale->day->SetFont(FF_FONT1,FS_BOLD); - -$graph->title->Set("Example of hours in scale"); -$graph->title->SetColor('white'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); - -$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR); - -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); -$graph->scale->week->SetFont(FF_FONT1); -$graph->scale->hour->SetIntervall(4); - -$graph->scale->hour->SetStyle(HOURSTYLE_HM24); -$graph->scale->day->SetStyle(DAYSTYLE_SHORTDAYDATE3); - -$data = array( - array(0," Label 1", "2001-01-26 04:00","2001-01-26 14:00"), - array(1," Label 2", "2001-01-26 10:00","2001-01-26 18:00"), - array(2," Label 3", "2001-01-26","2001-01-27 10:00") -); - - -for($i=0; $i4 ) - $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); - $bar->SetPattern(BAND_RDIAG,"yellow"); - $bar->SetFillColor("red"); - $graph->Add($bar); -} - -$graph->Stroke(); - - - -?> - - diff --git a/#jpgraph/src/Examples/gantthourminex1.php b/#jpgraph/src/Examples/gantthourminex1.php deleted file mode 100644 index 8a76bf12..00000000 --- a/#jpgraph/src/Examples/gantthourminex1.php +++ /dev/null @@ -1,93 +0,0 @@ -SetMarginColor('darkgreen@0.8'); -$graph->SetColor('white'); - -// We want to display day, hour and minute scales -$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR | GANTT_HMIN); - -// We want to have the following titles in our columns -// describing each activity -$graph->scale->actinfo->SetColTitles( - array('Act','Duration','Start','Finish','Resp'));//,array(100,70,70,70)); - -// Uncomment the following line if you don't want the 3D look -// in the columns headers -//$graph->scale->actinfo->SetStyle(ACTINFO_2D); - -$graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10); - -//These are the default values for use in the columns -//$graph->scale->actinfo->SetFontColor('black'); -//$graph->scale->actinfo->SetBackgroundColor('lightgray'); -//$graph->scale->actinfo->vgrid->SetStyle('solid'); - -$graph->scale->actinfo->vgrid->SetColor('gray'); -$graph->scale->actinfo->SetColor('darkgray'); - -// Setup day format -$graph->scale->day->SetBackgroundColor('lightyellow:1.5'); -$graph->scale->day->SetFont(FF_ARIAL); -$graph->scale->day->SetStyle(DAYSTYLE_SHORTDAYDATE1); - -// Setup hour format -$graph->scale->hour->SetIntervall(1); -$graph->scale->hour->SetBackgroundColor('lightyellow:1.5'); -$graph->scale->hour->SetFont(FF_FONT0); -$graph->scale->hour->SetStyle(HOURSTYLE_H24); -$graph->scale->hour->grid->SetColor('gray:0.8'); - -// Setup minute format -$graph->scale->minute->SetIntervall(30); -$graph->scale->minute->SetBackgroundColor('lightyellow:1.5'); -$graph->scale->minute->SetFont(FF_FONT0); -$graph->scale->minute->SetStyle(MINUTESTYLE_MM); -$graph->scale->minute->grid->SetColor('lightgray'); - -$graph->scale->tableTitle->Set('Phase 1'); -$graph->scale->tableTitle->SetFont(FF_ARIAL,FS_NORMAL,12); -$graph->scale->SetTableTitleBackground('darkgreen@0.6'); -$graph->scale->tableTitle->Show(true); - -$graph->title->Set("Example of hours & mins scale"); -$graph->title->SetColor('darkgray'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); - - -for($i=0; $i4 ) - $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); - $bar->SetPattern(BAND_RDIAG,"yellow"); - $bar->SetFillColor("gray"); - $graph->Add($bar); -} - - -//$vline = new GanttVLine("2001-11-27");//d=1006858800, -$vline = new GanttVLine("2001-11-27 9:00");//d=1006858800, -$vline->SetWeight(5); -$vline->SetDayOffset(0); -$vline->title->Set("27/11 9:00"); -$vline->title->SetFont(FF_FONT1,FS_BOLD,10); -$graph->Add($vline); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/gantticonex1.php b/#jpgraph/src/Examples/gantticonex1.php deleted file mode 100644 index b5a31976..00000000 --- a/#jpgraph/src/Examples/gantticonex1.php +++ /dev/null @@ -1,77 +0,0 @@ -title->Set("Gantt chart with title columns and icons"); -$graph->title->SetFont(FF_ARIAL, FS_BOLD,12); -$graph->title->SetMargin(10); - -// Explicitely set the date range -// (Autoscaling will of course also work) -$graph->SetDateRange('2001-10-06','2002-4-10'); - -// 1.5 line spacing to make more room -$graph->SetVMarginFactor(1.5); - -// Setup some nonstandard colors -$graph->SetMarginColor('darkgreen@0.95'); -$graph->SetBox(true,'yellow:0.6',2); -$graph->SetFrame(true,'darkgreen',4); -$graph->scale->divider->SetColor('yellow:0.6'); -$graph->scale->dividerh->SetColor('yellow:0.6'); - -// Display month and year scale with the gridlines -$graph->ShowHeaders(GANTT_HMONTH | GANTT_HYEAR); -$graph->scale->month->grid->SetColor('gray'); -$graph->scale->month->grid->Show(true); -$graph->scale->year->grid->SetColor('gray'); -$graph->scale->year->grid->Show(true); - -// For the titles we also add a minimum width of 100 pixels for the Task name column -$graph->scale->actinfo->SetColTitles( - array('Note','Task','Duration','Start','Finish'),array(30,100)); -$graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5'); -$graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->scale->actinfo->vgrid->SetStyle('solid'); -$graph->scale->actinfo->vgrid->SetColor('gray'); - -// Uncomment this to keep the columns but show no headers -//$graph->scale->actinfo->Show(false); - -// Setup the icons we want to use -$erricon = new IconImage(GICON_FOLDER,0.6); -$startconicon = new IconImage(GICON_FOLDEROPEN,0.6); -$endconicon = new IconImage(GICON_TEXTIMPORTANT,0.5); - -// Store the icons in the first column and use plain text in the others -$data = array( - array(0,array($erricon,"Pre-study","102 days","23 Nov '01","1 Mar '02") - , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8), - array(1,array($startconicon,"Prototype","21 days","26 Oct '01","16 Nov '01"), - "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8), - array(2,array($endconicon,"Report","12 days","1 Mar '02","13 Mar '02"), - "2002-03-01","2002-03-13",FF_ARIAL,FS_NORMAL,8) -); - -// Create the bars and add them to the gantt chart -for($i=0; $i4 ) - $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); - $bar->SetPattern(BAND_RDIAG,"yellow"); - $bar->SetFillColor("gray"); - $bar->progress->Set(0.5); - $bar->progress->SetPattern(GANTT_SOLID,"darkgreen"); - $bar->title->SetCSIMTarget(array('#1'.$i,'#2'.$i,'#3'.$i,'#4'.$i,'#5'.$i),array('11'.$i,'22'.$i,'33'.$i)); - $graph->Add($bar); -} - -// Output the chart -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/ganttmonthyearex1.php b/#jpgraph/src/Examples/ganttmonthyearex1.php deleted file mode 100644 index 6bc7809c..00000000 --- a/#jpgraph/src/Examples/ganttmonthyearex1.php +++ /dev/null @@ -1,50 +0,0 @@ -title->Set("Only month & year scale"); - -// Setup some "very" nonstandard colors -$graph->SetMarginColor('lightgreen@0.8'); -$graph->SetBox(true,'yellow:0.6',2); -$graph->SetFrame(true,'darkgreen',4); -$graph->scale->divider->SetColor('yellow:0.6'); -$graph->scale->dividerh->SetColor('yellow:0.6'); - -// Explicitely set the date range -// (Autoscaling will of course also work) -$graph->SetDateRange('2001-10-06','2002-4-01'); - -// Display month and year scale with the gridlines -$graph->ShowHeaders(GANTT_HMONTH | GANTT_HYEAR); -$graph->scale->month->grid->SetColor('gray'); -$graph->scale->month->grid->Show(true); -$graph->scale->year->grid->SetColor('gray'); -$graph->scale->year->grid->Show(true); - -// Data for our example activities -$data = array( - array(0,"Group 1 Johan", "2001-11-23","2002-03-1",FF_FONT1,FS_BOLD,8), - array(1," Label 2", "2001-10-26","2001-11-16")); - -// Create the bars and add them to the gantt chart -for($i=0; $i4 ) - $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); - $bar->SetPattern(BAND_RDIAG,"yellow"); - $bar->SetFillColor("red"); - $bar->progress->Set(0.5); - $bar->progress->SetPattern(GANTT_SOLID,"darkgreen"); - $graph->Add($bar); -} - -// Output the chart -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/ganttmonthyearex2.php b/#jpgraph/src/Examples/ganttmonthyearex2.php deleted file mode 100644 index 4ed50925..00000000 --- a/#jpgraph/src/Examples/ganttmonthyearex2.php +++ /dev/null @@ -1,66 +0,0 @@ -title->Set("Only month & year scale"); - -// Setup some "very" nonstandard colors -$graph->SetMarginColor('lightgreen@0.8'); -$graph->SetBox(true,'yellow:0.6',2); -$graph->SetFrame(true,'darkgreen',4); -$graph->scale->divider->SetColor('yellow:0.6'); -$graph->scale->dividerh->SetColor('yellow:0.6'); - -// Explicitely set the date range -// (Autoscaling will of course also work) -$graph->SetDateRange('2001-10-06','2002-4-10'); - -// Display month and year scale with the gridlines -$graph->ShowHeaders(GANTT_HMONTH | GANTT_HYEAR); -$graph->scale->month->grid->SetColor('gray'); -$graph->scale->month->grid->Show(true); -$graph->scale->year->grid->SetColor('gray'); -$graph->scale->year->grid->Show(true); - - -// Setup activity info - -// For the titles we also add a minimum width of 100 pixels for the Task name column -$graph->scale->actinfo->SetColTitles( - array('Name','Duration','Start','Finish'),array(100)); -$graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5'); -$graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->scale->actinfo->vgrid->SetStyle('solid'); -$graph->scale->actinfo->vgrid->SetColor('gray'); - -// Data for our example activities -$data = array( - array(0,array("Pre-study","102 days","23 Nov '01","1 Mar '02") - , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8), - array(1,array("Prototype","21 days","26 Oct '01","16 Nov '01"), - "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8), - array(2,array("Report","12 days","1 Mar '02","13 Mar '02"), - "2002-03-01","2002-03-13",FF_ARIAL,FS_NORMAL,8) -); - -// Create the bars and add them to the gantt chart -for($i=0; $i4 ) - $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); - $bar->SetPattern(BAND_RDIAG,"yellow"); - $bar->SetFillColor("gray"); - $bar->progress->Set(0.5); - $bar->progress->SetPattern(GANTT_SOLID,"darkgreen"); - $graph->Add($bar); -} - -// Output the chart -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/ganttmonthyearex3.php b/#jpgraph/src/Examples/ganttmonthyearex3.php deleted file mode 100644 index fa0c3f67..00000000 --- a/#jpgraph/src/Examples/ganttmonthyearex3.php +++ /dev/null @@ -1,66 +0,0 @@ -title->Set("Only month & year scale"); - -// Setup some "very" nonstandard colors -$graph->SetMarginColor('lightgreen@0.8'); -$graph->SetBox(true,'yellow:0.6',2); -$graph->SetFrame(true,'darkgreen',4); -$graph->scale->divider->SetColor('yellow:0.6'); -$graph->scale->dividerh->SetColor('yellow:0.6'); - -// Explicitely set the date range -// (Autoscaling will of course also work) -$graph->SetDateRange('2001-10-06','2002-4-10'); - -// Display month and year scale with the gridlines -$graph->ShowHeaders(GANTT_HMONTH | GANTT_HYEAR); -$graph->scale->month->grid->SetColor('gray'); -$graph->scale->month->grid->Show(true); -$graph->scale->year->grid->SetColor('gray'); -$graph->scale->year->grid->Show(true); - - -// Setup activity info - -// For the titles we also add a minimum width of 100 pixels for the Task name column -$graph->scale->actinfo->SetColTitles( - array('Type','Name','Duration','Start','Finish'),array(40,100)); -$graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5'); -$graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->scale->actinfo->vgrid->SetStyle('solid'); -$graph->scale->actinfo->vgrid->SetColor('gray'); - -// Data for our example activities -$data = array( - array(0,array("","Pre-study","102 days","23 Nov '01","1 Mar '02") - , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8), - array(1,array("","Prototype","21 days","26 Oct '01","16 Nov '01"), - "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8), - array(2,array("","Report","12 days","1 Mar '02","13 Mar '02"), - "2002-03-01","2002-03-13",FF_ARIAL,FS_NORMAL,8) -); - -// Create the bars and add them to the gantt chart -for($i=0; $i4 ) - $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); - $bar->SetPattern(BAND_RDIAG,"yellow"); - $bar->SetFillColor("gray"); - $bar->progress->Set(0.5); - $bar->progress->SetPattern(GANTT_SOLID,"darkgreen"); - $graph->Add($bar); -} - -// Output the chart -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/ganttmonthyearex4.php b/#jpgraph/src/Examples/ganttmonthyearex4.php deleted file mode 100644 index defa2e73..00000000 --- a/#jpgraph/src/Examples/ganttmonthyearex4.php +++ /dev/null @@ -1,71 +0,0 @@ -title->Set("Adding a spaning title"); - -// Setup some "very" nonstandard colors -$graph->SetMarginColor('lightgreen@0.8'); -$graph->SetBox(true,'yellow:0.6',2); -$graph->SetFrame(true,'darkgreen',4); -$graph->scale->divider->SetColor('yellow:0.6'); -$graph->scale->dividerh->SetColor('yellow:0.6'); - -// Explicitely set the date range -// (Autoscaling will of course also work) -$graph->SetDateRange('2001-11-06','2002-1-10'); - -// Display month and year scale with the gridlines -$graph->ShowHeaders(GANTT_HMONTH | GANTT_HYEAR | GANTT_HWEEK ); -$graph->scale->month->grid->SetColor('gray'); -$graph->scale->month->grid->Show(true); -$graph->scale->year->grid->SetColor('gray'); -$graph->scale->year->grid->Show(true); - - -//Setup spanning title -$graph->scale->tableTitle->Set( 'Phase 1' ); -$graph->scale->tableTitle->SetFont( FF_ARIAL , FS_NORMAL , 16 ); -$graph->scale->SetTableTitleBackground( 'darkgreen@0.6' ); -$graph->scale->tableTitle->Show( true ); - -// Setup activity info - -// For the titles we also add a minimum width of 100 pixels for the Task name column -$graph->scale->actinfo->SetColTitles(array('Name','Duration','Start','Finish'),array(100)); -$graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5'); -$graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10); -$graph->scale->actinfo->vgrid->SetStyle('solid'); -$graph->scale->actinfo->vgrid->SetColor('gray'); - -// Data for our example activities -$data = array( - array(0,array("Pre-study","102 days","23 Nov '01","1 Mar '02") - , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8), - array(1,array("Prototype","21 days","26 Oct '01","16 Nov '01"), - "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8), - array(2,array("Report","12 days","1 Mar '02","13 Mar '02"), - "2002-03-01","2002-03-13",FF_ARIAL,FS_NORMAL,8) -); - -// Create the bars and add them to the gantt chart -for($i=0; $i4 ) - $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); - $bar->SetPattern(BAND_RDIAG,"yellow"); - $bar->SetFillColor("gray"); - $bar->progress->Set(0.5); - $bar->progress->SetPattern(GANTT_SOLID,"darkgreen"); - $graph->Add($bar); -} - -// Output the chart -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/ganttsimpleex1.php b/#jpgraph/src/Examples/ganttsimpleex1.php deleted file mode 100644 index 63e4efb6..00000000 --- a/#jpgraph/src/Examples/ganttsimpleex1.php +++ /dev/null @@ -1,31 +0,0 @@ -title->Set("Gantt Graph using CreateSimple()"); - -// Setup scale -$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); - -// Add the specified activities -$graph->CreateSimple($data); - -// .. and stroke the graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/grace_ex0.php b/#jpgraph/src/Examples/grace_ex0.php deleted file mode 100644 index 5358ae51..00000000 --- a/#jpgraph/src/Examples/grace_ex0.php +++ /dev/null @@ -1,58 +0,0 @@ -img->SetMargin(40,30,40,50); -$graph->SetScale("textint"); -$graph->SetFrame(true,'blue',1); -$graph->SetColor('lightblue'); -$graph->SetMarginColor('lightblue'); - -// Setup X-axis labels -$a = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(FF_FONT1); -$graph->xaxis->SetColor('darkblue','black'); - -// Setup "hidden" y-axis by given it the same color -// as the background (this could also be done by setting the weight -// to zero) -$graph->yaxis->SetColor('lightblue','darkblue'); -$graph->ygrid->SetColor('white'); - -// Setup graph title ands fonts -$graph->title->Set('Using grace = 0'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->xaxis->SetTitle('Year 2002','center'); -$graph->xaxis->SetTitleMargin(10); -$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); - -// Add some grace to the top so that the scale doesn't -// end exactly at the max value. -$graph->yaxis->scale->SetGrace(0); - - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor('darkblue'); -$bplot->SetColor('darkblue'); -$bplot->SetWidth(0.5); -$bplot->SetShadow('darkgray'); - -// Setup the values that are displayed on top of each bar -// Must use TTF fonts if we want text at an arbitrary angle -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8); -$bplot->value->SetFormat('$%d'); -$bplot->value->SetColor('darkred'); -$bplot->value->SetAngle(45); -$graph->Add($bplot); - -// Finally stroke the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/grace_ex1.php b/#jpgraph/src/Examples/grace_ex1.php deleted file mode 100644 index 7544b445..00000000 --- a/#jpgraph/src/Examples/grace_ex1.php +++ /dev/null @@ -1,58 +0,0 @@ -img->SetMargin(40,30,40,50); -$graph->SetScale("textint"); -$graph->SetFrame(true,'blue',1); -$graph->SetColor('lightblue'); -$graph->SetMarginColor('lightblue'); - -// Setup X-axis labels -$a = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(FF_FONT1); -$graph->xaxis->SetColor('darkblue','black'); - -// Setup "hidden" y-axis by given it the same color -// as the background (this could also be done by setting the weight -// to zero) -$graph->yaxis->SetColor('lightblue','darkblue'); -$graph->ygrid->SetColor('white'); - -// Setup graph title ands fonts -$graph->title->Set('Using grace = 10%'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->xaxis->SetTitle('Year 2002','center'); -$graph->xaxis->SetTitleMargin(10); -$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); - -// Add some grace to the top so that the scale doesn't -// end exactly at the max value. -$graph->yaxis->scale->SetGrace(10); - - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor('darkblue'); -$bplot->SetColor('darkblue'); -$bplot->SetWidth(0.5); -$bplot->SetShadow('darkgray'); - -// Setup the values that are displayed on top of each bar -// Must use TTF fonts if we want text at an arbitrary angle -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8); -$bplot->value->SetFormat('$%d'); -$bplot->value->SetColor('darkred'); -$bplot->value->SetAngle(45); -$graph->Add($bplot); - -// Finally stroke the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/grace_ex2.php b/#jpgraph/src/Examples/grace_ex2.php deleted file mode 100644 index eff8b8da..00000000 --- a/#jpgraph/src/Examples/grace_ex2.php +++ /dev/null @@ -1,58 +0,0 @@ -img->SetMargin(40,30,40,50); -$graph->SetScale("textint"); -$graph->SetFrame(true,'blue',1); -$graph->SetColor('lightblue'); -$graph->SetMarginColor('lightblue'); - -// Setup X-axis labels -$a = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(FF_FONT1); -$graph->xaxis->SetColor('darkblue','black'); - -// Setup "hidden" y-axis by given it the same color -// as the background (this could also be done by setting the weight -// to zero) -$graph->yaxis->SetColor('lightblue','darkblue'); -$graph->ygrid->SetColor('white'); - -// Setup graph title ands fonts -$graph->title->Set('Using grace = 50%'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->xaxis->SetTitle('Year 2002','center'); -$graph->xaxis->SetTitleMargin(10); -$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); - -// Add some grace to the top so that the scale doesn't -// end exactly at the max value. -$graph->yaxis->scale->SetGrace(50); - - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor('darkblue'); -$bplot->SetColor('darkblue'); -$bplot->SetWidth(0.5); -$bplot->SetShadow('darkgray'); - -// Setup the values that are displayed on top of each bar -// Must use TTF fonts if we want text at an arbitrary angle -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8); -$bplot->value->SetFormat('$%d'); -$bplot->value->SetColor('darkred'); -$bplot->value->SetAngle(45); -$graph->Add($bplot); - -// Finally stroke the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/grace_ex3.php b/#jpgraph/src/Examples/grace_ex3.php deleted file mode 100644 index 40f7daf6..00000000 --- a/#jpgraph/src/Examples/grace_ex3.php +++ /dev/null @@ -1,58 +0,0 @@ -img->SetMargin(40,30,40,50); -$graph->SetScale("textint"); -$graph->SetFrame(true,'blue',1); -$graph->SetColor('lightblue'); -$graph->SetMarginColor('lightblue'); - -// Setup X-axis labels -$a = $gDateLocale->GetShortMonth(); -$graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(FF_FONT1); -$graph->xaxis->SetColor('darkblue','black'); - -// Setup "hidden" y-axis by given it the same color -// as the background (this could also be done by setting the weight -// to zero) -$graph->yaxis->SetColor('lightblue','darkblue'); -$graph->ygrid->SetColor('white'); - -// Setup graph title ands fonts -$graph->title->Set('Using grace = 100%'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->xaxis->SetTitle('Year 2002','center'); -$graph->xaxis->SetTitleMargin(10); -$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); - -// Add some grace to the top so that the scale doesn't -// end exactly at the max value. -$graph->yaxis->scale->SetGrace(100); - - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor('darkblue'); -$bplot->SetColor('darkblue'); -$bplot->SetWidth(0.5); -$bplot->SetShadow('darkgray'); - -// Setup the values that are displayed on top of each bar -// Must use TTF fonts if we want text at an arbitrary angle -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8); -$bplot->value->SetFormat('$%d'); -$bplot->value->SetColor('darkred'); -$bplot->value->SetAngle(45); -$graph->Add($bplot); - -// Finally stroke the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/gradbkgex1.php b/#jpgraph/src/Examples/gradbkgex1.php deleted file mode 100644 index 0509e41e..00000000 --- a/#jpgraph/src/Examples/gradbkgex1.php +++ /dev/null @@ -1,66 +0,0 @@ -SetMarginColor('white'); -$graph->SetScale("textlin",0,50); -$graph->SetMargin(30,50,30,30); - -// We must have the frame enabled to get the gradient -// However, we don't want the frame line so we set it to -// white color which makes it invisible. -$graph->SetFrame(true,'white'); - -// Setup a background gradient image -$graph->SetBackgroundGradient('blue','navy:0.5',GRAD_HOR,BGRAD_PLOT); - -// Setup the tab title -$graph->tabtitle->Set(' 3rd Division ' ); -$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,13); - -// Setup x,Y grid -$graph->xgrid->Show(); -$graph->xgrid->SetColor('gray@0.5'); -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); -$graph->ygrid->SetColor('gray@0.5'); - -// Setup color for axis and labels on axis -$graph->xaxis->SetColor('orange','black'); -$graph->yaxis->SetColor('orange','black'); - -// Ticks on the outsid -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Setup the legend box colors and font -$graph->legend->SetColor('white','navy'); -$graph->legend->SetFillColor('navy@0.25'); -$graph->legend->SetFont(FF_ARIAL,FS_BOLD,8); -$graph->legend->SetShadow('darkgray@0.4',3); -$graph->legend->SetPos(0.05,0.05,'right','top'); - -// Create the first line -$p1 = new LinePlot($datay1); -$p1->SetColor("red"); -$p1->SetWeight(2); -$p1->SetLegend('2002'); -$graph->Add($p1); - -// Create the second line -$p2 = new LinePlot($datay2); -$p2->SetColor("lightyellow"); -$p2->SetLegend('2001'); -$p2->SetWeight(2); -$graph->Add($p2); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/gradlinefillex1.php b/#jpgraph/src/Examples/gradlinefillex1.php deleted file mode 100644 index 06520e2e..00000000 --- a/#jpgraph/src/Examples/gradlinefillex1.php +++ /dev/null @@ -1,29 +0,0 @@ -SetMargin(40,40,20,30); -$graph->SetScale("intlin"); -$graph->SetMarginColor('darkgreen@0.8'); - -$graph->title->Set('Gradient filled line plot'); -$graph->yscale->SetAutoMin(0); - -// Create the line -$p1 = new LinePlot($datay); -$p1->SetColor("blue"); -$p1->SetWeight(0); -$p1->SetFillGradient('red','yellow'); - -$graph->Add($p1); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/gradlinefillex2.php b/#jpgraph/src/Examples/gradlinefillex2.php deleted file mode 100644 index 97887445..00000000 --- a/#jpgraph/src/Examples/gradlinefillex2.php +++ /dev/null @@ -1,30 +0,0 @@ -SetMargin(40,40,20,30); -$graph->SetScale("intlin"); -$graph->SetBox(); -$graph->SetMarginColor('darkgreen@0.8'); - -// Setup a background gradient image -$graph->SetBackgroundGradient('darkred','yellow',GRAD_HOR,BGRAD_PLOT); - -$graph->title->Set('Gradient filled line plot ex2'); -$graph->yscale->SetAutoMin(0); - -// Create the line -$p1 = new LinePlot($datay); -$p1->SetFillGradient('white','darkgreen'); -$graph->Add($p1); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/gradlinefillex3.php b/#jpgraph/src/Examples/gradlinefillex3.php deleted file mode 100644 index 17b6e515..00000000 --- a/#jpgraph/src/Examples/gradlinefillex3.php +++ /dev/null @@ -1,30 +0,0 @@ -SetMargin(40,40,20,30); -$graph->SetScale("intlin"); -$graph->SetBox(); -$graph->SetMarginColor('darkgreen@0.8'); - -// Setup a background gradient image -$graph->SetBackgroundGradient('darkred','yellow',GRAD_HOR,BGRAD_PLOT); - -$graph->title->Set('Gradient filled line plot ex3'); -$graph->yscale->SetAutoMin(0); - -// Create the line -$p1 = new LinePlot($datay); -$p1->SetFillGradient('white','darkgreen',4); -$graph->Add($p1); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/gradlinefillex4.php b/#jpgraph/src/Examples/gradlinefillex4.php deleted file mode 100644 index f921560e..00000000 --- a/#jpgraph/src/Examples/gradlinefillex4.php +++ /dev/null @@ -1,31 +0,0 @@ -SetMargin(40,40,20,30); -$graph->SetScale("intlin"); -$graph->SetBox(); -$graph->SetMarginColor('darkgreen@0.8'); - -// Setup a background gradient image -$graph->SetBackgroundGradient('darkred','yellow',GRAD_HOR,BGRAD_PLOT); - -$graph->title->Set('Gradient filled line plot ex2'); -$graph->yscale->SetAutoMin(0); - -// Create the line -$p1 = new LinePlot($datay); -$p1->SetFillGradient('white','darkgreen'); -$p1->SetStepStyle(); -$graph->Add($p1); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/green_example.php b/#jpgraph/src/Examples/green_example.php deleted file mode 100644 index 4c939d2d..00000000 --- a/#jpgraph/src/Examples/green_example.php +++ /dev/null @@ -1,58 +0,0 @@ - array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), - 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), - 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), - 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), - 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), - 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), - 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), - 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), - 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), -); - - -// Create the graph. These two calls are always required -$graph = new Graph(400,300); - -$graph->SetScale("textlin"); -if ($theme) { - $graph->SetTheme(new $theme()); -} -$theme_class = new GreenTheme; -$graph->SetTheme($theme_class); - -$plot = array(); -// Create the bar plots -for ($i = 0; $i < 4; $i++) { - $plot[$i] = new BarPlot($data[$i]); - $plot[$i]->SetLegend('plot'.($i+1)); -} -//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); -//$acc1->value->Show(); -$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); - -for ($i = 4; $i < 8; $i++) { - $plot[$i] = new LinePlot($data[$i]); - $plot[$i]->SetLegend('plot'.$i); - $plot[$i]->value->Show(); -} - -$graph->Add($gbplot); -$graph->Add($plot[4]); - -$title = "GreenTheme Example"; -$title = mb_convert_encoding($title,'UTF-8'); -$graph->title->Set($title); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/groupbarex1.php b/#jpgraph/src/Examples/groupbarex1.php deleted file mode 100644 index 40f28ee3..00000000 --- a/#jpgraph/src/Examples/groupbarex1.php +++ /dev/null @@ -1,44 +0,0 @@ -SetScale("textlin"); -$graph->SetShadow(); -$graph->img->SetMargin(40,30,40,40); -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -$graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->title->Set('Group bar plot'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$bplot1 = new BarPlot($datay1); -$bplot2 = new BarPlot($datay2); -$bplot3 = new BarPlot($datay3); - -$bplot1->SetFillColor("orange"); -$bplot2->SetFillColor("brown"); -$bplot3->SetFillColor("darkgreen"); - -$bplot1->SetShadow(); -$bplot2->SetShadow(); -$bplot3->SetShadow(); - -$bplot1->SetShadow(); -$bplot2->SetShadow(); -$bplot3->SetShadow(); - -$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3)); -$gbarplot->SetWidth(0.6); -$graph->Add($gbarplot); - -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/heat1.jpg b/#jpgraph/src/Examples/heat1.jpg deleted file mode 100644 index 07f04d76..00000000 Binary files a/#jpgraph/src/Examples/heat1.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/horizbarex1.php b/#jpgraph/src/Examples/horizbarex1.php deleted file mode 100644 index bc5055fc..00000000 --- a/#jpgraph/src/Examples/horizbarex1.php +++ /dev/null @@ -1,63 +0,0 @@ -SetScale('textlin'); - -// Rotate graph 90 degrees and set margin -$graph->Set90AndMargin(50,20,50,30); - -// Nice shadow -$graph->SetShadow(); - -// Setup title -$graph->title->Set('Horizontal bar graph ex 1'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); - -// Setup X-axis -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,12); - -// Some extra margin looks nicer -$graph->xaxis->SetLabelMargin(10); - -// Label align for X-axis -$graph->xaxis->SetLabelAlign('right','center'); - -// Add some grace to y-axis so the bars doesn't go -// all the way to the end of the plot area -$graph->yaxis->scale->SetGrace(20); - -// We don't want to display Y-axis -$graph->yaxis->Hide(); - -// Now create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor('orange'); -$bplot->SetShadow(); - -//You can change the width of the bars if you like -//$bplot->SetWidth(0.5); - -// We want to display the value of each bar at the top -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_BOLD,12); -$bplot->value->SetAlign('left','center'); -$bplot->value->SetColor('black','darkred'); -$bplot->value->SetFormat('%.1f mkr'); - -// Add the bar to the graph -$graph->Add($bplot); - -// .. and stroke the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/horizbarex2.php b/#jpgraph/src/Examples/horizbarex2.php deleted file mode 100644 index d50bb7d4..00000000 --- a/#jpgraph/src/Examples/horizbarex2.php +++ /dev/null @@ -1,70 +0,0 @@ -SetScale("textlin"); - -$top = 80; -$bottom = 30; -$left = 50; -$right = 30; -$graph->Set90AndMargin($left,$right,$top,$bottom); - -// Nice shadow -$graph->SetShadow(); - -// Setup title -$graph->title->Set("Horizontal bar graph ex 2"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); -$graph->subtitle->Set("(Axis at top)"); - -// Setup X-axis -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,12); - -// Some extra margin looks nicer -$graph->xaxis->SetLabelMargin(5); - -// Label align for X-axis -$graph->xaxis->SetLabelAlign('right','center'); - -// Add some grace to y-axis so the bars doesn't go -// all the way to the end of the plot area -$graph->yaxis->scale->SetGrace(20); -$graph->yaxis->SetLabelAlign('center','bottom'); -$graph->yaxis->SetLabelAngle(45); -$graph->yaxis->SetLabelFormat('%d'); -$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,12); - -// We don't want to display Y-axis -//$graph->yaxis->Hide(); - -// Now create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); -$bplot->SetShadow(); - -//You can change the width of the bars if you like -//$bplot->SetWidth(0.5); - -// We want to display the value of each bar at the top -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_BOLD,12); -$bplot->value->SetAlign('left','center'); -$bplot->value->SetColor("black","darkred"); -$bplot->value->SetFormat('%.1f mkr'); - -// Add the bar to the graph -$graph->Add($bplot); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/horizbarex3.php b/#jpgraph/src/Examples/horizbarex3.php deleted file mode 100644 index c0d5a49f..00000000 --- a/#jpgraph/src/Examples/horizbarex3.php +++ /dev/null @@ -1,99 +0,0 @@ -SetScale("textlin"); - -$top = 50; -$bottom = 80; -$left = 50; -$right = 20; -$graph->Set90AndMargin($left,$right,$top,$bottom); - -$graph->xaxis->SetPos('min'); - -// Nice shadow -$graph->SetShadow(); - -// Setup title -$graph->title->Set("Horizontal bar graph ex 3"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); -$graph->subtitle->Set("(Axis at bottom)"); - -// Setup X-axis -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetFont(FF_FONT2,FS_BOLD,12); - -// Some extra margin looks nicer -$graph->xaxis->SetLabelMargin(5); - -// Label align for X-axis -$graph->xaxis->SetLabelAlign('right','center'); - -// Add some grace to y-axis so the bars doesn't go -// all the way to the end of the plot area -$graph->yaxis->scale->SetGrace(20); - -// Setup the Y-axis to be displayed in the bottom of the -// graph. We also finetune the exact layout of the title, -// ticks and labels to make them look nice. -$graph->yaxis->SetPos('max'); - -// First make the labels look right -$graph->yaxis->SetLabelAlign('center','top'); -$graph->yaxis->SetLabelFormat('%d'); -$graph->yaxis->SetLabelSide(SIDE_RIGHT); - -// The fix the tick marks -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Finally setup the title -$graph->yaxis->SetTitleSide(SIDE_RIGHT); -$graph->yaxis->SetTitleMargin(35); - -// To align the title to the right use : -$graph->yaxis->SetTitle('Turnaround 2002','high'); -$graph->yaxis->title->Align('right'); - -// To center the title use : -//$graph->yaxis->SetTitle('Turnaround 2002','center'); -//$graph->yaxis->title->Align('center'); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->yaxis->title->SetAngle(0); - -$graph->yaxis->SetFont(FF_FONT2,FS_NORMAL); -// If you want the labels at an angle other than 0 or 90 -// you need to use TTF fonts -//$graph->yaxis->SetLabelAngle(0); - -// Now create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); -$bplot->SetShadow(); - -//You can change the width of the bars if you like -//$bplot->SetWidth(0.5); - -// We want to display the value of each bar at the top -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_BOLD,12); -$bplot->value->SetAlign('left','center'); -$bplot->value->SetColor("black","darkred"); -$bplot->value->SetFormat('%.1f mkr'); - -// Add the bar to the graph -$graph->Add($bplot); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/horizbarex4.php b/#jpgraph/src/Examples/horizbarex4.php deleted file mode 100644 index 5f51be48..00000000 --- a/#jpgraph/src/Examples/horizbarex4.php +++ /dev/null @@ -1,48 +0,0 @@ -SetScale('textlin'); - -$top = 60; -$bottom = 30; -$left = 80; -$right = 30; -$graph->Set90AndMargin($left,$right,$top,$bottom); - -// Nice shadow -$graph->SetShadow(); - -// Setup labels -$lbl = array("Andrew\nTait","Thomas\nAnderssen","Kevin\nSpacey","Nick\nDavidsson", -"David\nLindquist","Jason\nTait","Lorin\nPersson"); -$graph->xaxis->SetTickLabels($lbl); - -// Label align for X-axis -$graph->xaxis->SetLabelAlign('right','center','right'); - -// Label align for Y-axis -$graph->yaxis->SetLabelAlign('center','bottom'); - -// Titles -$graph->title->Set('Number of incidents'); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor('orange'); -$bplot->SetWidth(0.5); -$bplot->SetYMin(1990); - -$graph->Add($bplot); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/horizbarex6.php b/#jpgraph/src/Examples/horizbarex6.php deleted file mode 100644 index 8ab4cbc6..00000000 --- a/#jpgraph/src/Examples/horizbarex6.php +++ /dev/null @@ -1,83 +0,0 @@ -SetScale("textlin"); - -// No frame around the image -$graph->SetFrame(false); - -// Rotate graph 90 degrees and set margin -$graph->Set90AndMargin(100,20,50,30); - -// Set white margin color -$graph->SetMarginColor('white'); - -// Use a box around the plot area -$graph->SetBox(); - -// Use a gradient to fill the plot area -$graph->SetBackgroundGradient('white','lightblue',GRAD_HOR,BGRAD_PLOT); - -// Setup title -$graph->title->Set("Graphic card performance"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,11); -$graph->subtitle->Set("(Non optimized)"); - -// Setup X-axis -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,8); - -// Some extra margin looks nicer -$graph->xaxis->SetLabelMargin(10); - -// Label align for X-axis -$graph->xaxis->SetLabelAlign('right','center'); - -// Add some grace to y-axis so the bars doesn't go -// all the way to the end of the plot area -$graph->yaxis->scale->SetGrace(20); - -// We don't want to display Y-axis -$graph->yaxis->Hide(); - -// Now create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetShadow(); - -//You can change the width of the bars if you like -//$bplot->SetWidth(0.5); - -// Set gradient fill for bars -$bplot->SetFillGradient('darkred','yellow',GRAD_HOR); - -// We want to display the value of each bar at the top -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10); -//$bplot->value->SetAlign('left','center'); -$bplot->value->SetColor("white"); -$bplot->value->SetFormat('%.1f'); -$bplot->SetValuePos('max'); - -// Add the bar to the graph -$graph->Add($bplot); - -// Add some explanation text -$txt = new Text('Note: Higher value is better.'); -$txt->SetPos(190,399,'center','bottom'); -$txt->SetFont(FF_ARIAL,FS_NORMAL,8); -$graph->Add($txt); - -// .. and stroke the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/icon.jpg b/#jpgraph/src/Examples/icon.jpg deleted file mode 100644 index dc3b3029..00000000 Binary files a/#jpgraph/src/Examples/icon.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/imgmarkercsimex1.php b/#jpgraph/src/Examples/imgmarkercsimex1.php deleted file mode 100644 index 2c91a0dd..00000000 --- a/#jpgraph/src/Examples/imgmarkercsimex1.php +++ /dev/null @@ -1,55 +0,0 @@ -SetMarginColor('white'); -$graph->SetScale("textlin"); -$graph->SetFrame(false); -$graph->SetMargin(30,5,25,20); - -// Setup the tab -$graph->tabtitle->Set(' Year 2003 ' ); -$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,13); -$graph->tabtitle->SetColor('darkred','#E1E1FF'); - -// Enable X-grid as well -$graph->xgrid->Show(); - -// Use months as X-labels -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -// Create the plot -$p1 = new LinePlot($datay1); -$p1->SetColor("navy"); - -$p1->SetCSIMTargets(array('#1','#2','#3','#4','#5')); - -// Use an image of favourite car as -$p1->mark->SetType(MARK_IMG,'saab_95.jpg',0.5); -//$p1->mark->SetType(MARK_SQUARE); - -// Displayes value on top of marker image -$p1->value->SetFormat('%d mil'); -$p1->value->Show(); -$p1->value->SetColor('darkred'); -$p1->value->SetFont(FF_ARIAL,FS_BOLD,10); -// Increase the margin so that the value is printed avove tje -// img marker -$p1->value->SetMargin(14); - -// Incent the X-scale so the first and last point doesn't -// fall on the edges -$p1->SetCenter(); - -$graph->Add($p1); - -$graph->StrokeCSIM(); - -?> - - diff --git a/#jpgraph/src/Examples/imgmarkerex1.php b/#jpgraph/src/Examples/imgmarkerex1.php deleted file mode 100644 index 9f5e8ce6..00000000 --- a/#jpgraph/src/Examples/imgmarkerex1.php +++ /dev/null @@ -1,52 +0,0 @@ -SetMarginColor('white'); -$graph->SetScale("textlin"); -$graph->SetFrame(false); -$graph->SetMargin(30,5,25,20); - -// Setup the tab -$graph->tabtitle->Set(' Year 2003 ' ); -$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,13); -$graph->tabtitle->SetColor('darkred','#E1E1FF'); - -// Enable X-grid as well -$graph->xgrid->Show(); - -// Use months as X-labels -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -// Create the plot -$p1 = new LinePlot($datay1); -$p1->SetColor("navy"); - -// Use an image of favourite car as marker -$p1->mark->SetType(MARK_IMG,'saab_95.jpg',0.5); - -// Displayes value on top of marker image -$p1->value->SetFormat('%d mil'); -$p1->value->Show(); -$p1->value->SetColor('darkred'); -$p1->value->SetFont(FF_ARIAL,FS_BOLD,10); -// Increase the margin so that the value is printed avove tje -// img marker -$p1->value->SetMargin(14); - -// Incent the X-scale so the first and last point doesn't -// fall on the edges -$p1->SetCenter(); - -$graph->Add($p1); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/impulsex1.php b/#jpgraph/src/Examples/impulsex1.php deleted file mode 100644 index ff893833..00000000 --- a/#jpgraph/src/Examples/impulsex1.php +++ /dev/null @@ -1,23 +0,0 @@ -SetScale("textlin"); - -$graph->SetShadow(); -$graph->img->SetMargin(40,40,40,40); - -$graph->title->Set("Simple mpuls plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$sp1 = new ScatterPlot($datay); -$sp1->mark->SetType(MARK_SQUARE); -$sp1->SetImpuls(); - -$graph->Add($sp1); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/impulsex2.php b/#jpgraph/src/Examples/impulsex2.php deleted file mode 100644 index 8ea45973..00000000 --- a/#jpgraph/src/Examples/impulsex2.php +++ /dev/null @@ -1,29 +0,0 @@ -SetScale("textlin"); - -$graph->SetShadow(); -$graph->img->SetMargin(40,40,40,40); - -$graph->title->Set("Impuls plot, variant 2"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->Set("Impuls respons"); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$sp1 = new ScatterPlot($datay);//,$datax); -$sp1->mark->SetType(MARK_FILLEDCIRCLE); -$sp1->mark->SetFillColor("red"); -$sp1->mark->SetWidth(4); -$sp1->SetImpuls(); -$sp1->SetColor("blue"); -$sp1->SetWeight(3); - -$graph->Add($sp1); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/impulsex3.php b/#jpgraph/src/Examples/impulsex3.php deleted file mode 100644 index f7b5182e..00000000 --- a/#jpgraph/src/Examples/impulsex3.php +++ /dev/null @@ -1,53 +0,0 @@ -SetScale("intlin"); -$graph->SetShadow(); -$graph->SetBox(); - -$graph->title->Set("Impuls Example 3"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Set format callback for labels -$graph->yaxis->SetLabelFormatCallback("mycallback"); - -// Set X-axis at the minimum value of Y-axis (default will be at 0) -$graph->xaxis->SetPos("min"); // "min" will position the x-axis at the minimum value of the Y-axis - -// Extend the margin for the labels on the Y-axis and reverse the direction -// of the ticks on the Y-axis -$graph->yaxis->SetLabelMargin(12); -$graph->xaxis->SetLabelMargin(6); -$graph->yaxis->SetTickSide(SIDE_LEFT); -$graph->xaxis->SetTickSide(SIDE_DOWN); - -// Create a new impuls type scatter plot -$sp1 = new ScatterPlot($datay); -$sp1->mark->SetType(MARK_SQUARE); -$sp1->mark->SetFillColor("red"); -$sp1->SetImpuls(); -$sp1->SetColor("blue"); -$sp1->SetWeight(1); -$sp1->mark->SetWidth(3); - -$graph->Add($sp1); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/impulsex4.php b/#jpgraph/src/Examples/impulsex4.php deleted file mode 100644 index ac497ade..00000000 --- a/#jpgraph/src/Examples/impulsex4.php +++ /dev/null @@ -1,76 +0,0 @@ -SetScale("intlin"); - -$graph->SetShadow(); -$graph->SetBox(); -$graph->title->Set("Impuls Example 4"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Set some other color then the boring default -$graph->SetColor("lightyellow"); -$graph->SetMarginColor("khaki"); - -// Set legend box specification -$graph->legend->SetFillColor("white"); -$graph->legend->SetLineWeight(2); - -// Set X-axis at the minimum value of Y-axis (default will be at 0) -$graph->xaxis->SetPos("min"); // "min" will position the x-axis at the minimum value of the Y-axis - -// Extend the margin for the labels on the Y-axis and reverse the direction -// of the ticks on the Y-axis -$graph->yaxis->SetLabelMargin(12); -$graph->xaxis->SetLabelMargin(6); -$graph->yaxis->SetTickSide(SIDE_LEFT); -$graph->xaxis->SetTickSide(SIDE_DOWN); - -// Add mark graph with static lines -$line = new PlotLine(HORIZONTAL,0,"black",2); -$graph->AddLine($line); - -// Create a new impuls type scatter plot -$sp1 = new ScatterPlot($datay,$datax); -$sp1->mark->SetType(MARK_SQUARE); -$sp1->mark->SetFillColor("red"); -$sp1->mark->SetWidth(3); - -$sp1->SetImpuls(); -$sp1->SetColor("blue"); -$sp1->SetWeight(1); -$sp1->SetLegend("Non-causal signal"); - -$graph->Add($sp1); - -// Create the envelope plot -$ep1 = new LinePlot($datayenv,$datax); -$ep1->SetStyle("dotted"); -$ep1->SetLegend("Positive envelope"); - -$graph->Add($ep1); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/index.html b/#jpgraph/src/Examples/index.html deleted file mode 100644 index 6731a850..00000000 --- a/#jpgraph/src/Examples/index.html +++ /dev/null @@ -1,36 +0,0 @@ -

Examples of odometers

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - diff --git a/#jpgraph/src/Examples/interpolation-growth-log.php b/#jpgraph/src/Examples/interpolation-growth-log.php deleted file mode 100644 index c9ecd007..00000000 --- a/#jpgraph/src/Examples/interpolation-growth-log.php +++ /dev/null @@ -1,42 +0,0 @@ -SetScale('intlog'); -$graph->SetMargin(50,50,20,30); -$graph->SetFrame(false); -$graph->SetBox(true,'black',2); -$graph->SetMarginColor('white'); -$graph->SetColor('lightyellow@0.7'); - -$graph->title->Set('Interpolation growth for size 10x10'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->xaxis->SetTitle('Interpolation factor','center'); -$graph->xaxis->SetTitleMargin(10); - -$graph->SetAxisStyle(AXSTYLE_YBOXIN); -$graph->xgrid->Show(); - -$lp1 = new LinePlot($ydata,$xdata); -$lp1->SetColor('darkred'); -$lp1->SetWeight(3); -$graph->Add($lp1); - -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/interpolation-growth.php b/#jpgraph/src/Examples/interpolation-growth.php deleted file mode 100644 index e1fec180..00000000 --- a/#jpgraph/src/Examples/interpolation-growth.php +++ /dev/null @@ -1,42 +0,0 @@ -SetScale('intint'); -$graph->SetMargin(50,50,20,30); -$graph->SetFrame(false); -$graph->SetBox(true,'black',2); -$graph->SetMarginColor('white'); -$graph->SetColor('lightyellow@0.7'); - -$graph->title->Set('Interpolation growth for size 10x10'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->xaxis->SetTitle('Interpolation factor','center'); -$graph->xaxis->SetTitleMargin(10); - -$graph->SetAxisStyle(AXSTYLE_YBOXIN); -$graph->xgrid->Show(); - -$lp1 = new LinePlot($ydata,$xdata); -$lp1->SetColor('darkred'); -$lp1->SetWeight(3); -$graph->Add($lp1); - -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/inyaxisex1.php b/#jpgraph/src/Examples/inyaxisex1.php deleted file mode 100644 index d6e3d416..00000000 --- a/#jpgraph/src/Examples/inyaxisex1.php +++ /dev/null @@ -1,51 +0,0 @@ -SetScale("linlin"); -$graph->img->SetMargin(50,50,60,40); -$graph->SetMarginColor('darkblue'); -$graph->SetColor('darkblue'); -$graph->SetAxisStyle(AXSTYLE_BOXOUT); - -$graph->title->Set("Depth curve. Dive #2"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->title->SetColor("white"); - -$graph->subtitle->Set("(Negated Y-axis)"); -$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); -$graph->subtitle->SetColor("white"); - -// Setup axis -$graph->yaxis->SetLabelFormatCallback("_cb_negate"); -$graph->xaxis->SetColor("lightblue","white"); -$graph->yaxis->SetColor("lightblue","white"); -$graph->ygrid->SetColor("blue"); - - -$lp1 = new LinePlot($ydata); -$lp1->SetColor("yellow"); -$lp1->SetWeight(2); - - -$graph->Add($lp1); -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/inyaxisex2.php b/#jpgraph/src/Examples/inyaxisex2.php deleted file mode 100644 index 5e19d4aa..00000000 --- a/#jpgraph/src/Examples/inyaxisex2.php +++ /dev/null @@ -1,53 +0,0 @@ -SetScale("linlin"); -$graph->img->SetMargin(50,50,60,40); -$graph->SetMarginColor('darkblue'); -$graph->SetColor('darkblue'); -$graph->SetAxisStyle(AXSTYLE_BOXOUT); -$graph->SetBackgroundImage("blueblack400x300grad.png",1); -//$graph->SetBackgroundImage("lightbluedarkblue400x300grad.png",1); - -$graph->title->Set("Depth curve. Dive #2"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->title->SetColor("white"); - -$graph->subtitle->Set("(Negated Y-axis)"); -$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); -$graph->subtitle->SetColor("white"); - -// Setup axis -$graph->yaxis->SetLabelFormatCallback("_cb_negate"); -$graph->xaxis->SetColor("lightblue","white"); -$graph->yaxis->SetColor("lightblue","white"); -$graph->ygrid->SetColor("blue"); - - -$lp1 = new LinePlot($ydata); -$lp1->SetColor("yellow"); -$lp1->SetWeight(2); - - -$graph->Add($lp1); -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/inyaxisex3.php b/#jpgraph/src/Examples/inyaxisex3.php deleted file mode 100644 index e09567ef..00000000 --- a/#jpgraph/src/Examples/inyaxisex3.php +++ /dev/null @@ -1,69 +0,0 @@ -SetScale("linlin"); -$graph->SetY2Scale("lin"); -$graph->SetMargin(50,50,60,40); -$graph->SetMarginColor('darkblue'); -$graph->SetColor('darkblue'); - -// Setup titles -$graph->title->Set("Inverting both Y-axis"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->title->SetColor("white"); - -$graph->subtitle->Set("(Negated Y & Y2 axis)"); -$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); -$graph->subtitle->SetColor("white"); - -// Setup axis -$graph->yaxis->SetLabelFormatCallback("_cb_negate"); -$graph->xaxis->SetColor("lightblue","white"); -$graph->yaxis->SetColor("lightblue","white"); -$graph->ygrid->SetColor("blue"); - -// Setup Y2 axis -$graph->y2axis->SetLabelFormatCallback("_cb_negate"); -$graph->y2axis->SetColor("darkred","white"); -$graph->y2scale->SetAutoMax(0); // To make sure it starts with 0 - -// Setup plot 1 -$lp1 = new LinePlot($ydata); -$lp1->SetColor("yellow"); -$lp1->SetWeight(2); -$graph->Add($lp1); - -// Setup plot 2 -$lp2 = new LinePlot($y2data); -$lp2->SetColor("darkred"); -$lp2->SetWeight(2); -$graph->AddY2($lp2); - -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/ironrod.jpg b/#jpgraph/src/Examples/ironrod.jpg deleted file mode 100644 index 0b9e8d40..00000000 Binary files a/#jpgraph/src/Examples/ironrod.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/jpglogo.jpg b/#jpgraph/src/Examples/jpglogo.jpg deleted file mode 100644 index a7f71211..00000000 Binary files a/#jpgraph/src/Examples/jpglogo.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/ledex1.php b/#jpgraph/src/Examples/ledex1.php deleted file mode 100644 index 8d61f937..00000000 --- a/#jpgraph/src/Examples/ledex1.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_GREEN); - - - -?> diff --git a/#jpgraph/src/Examples/ledex10.php b/#jpgraph/src/Examples/ledex10.php deleted file mode 100644 index 3aa375f9..00000000 --- a/#jpgraph/src/Examples/ledex10.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_KHAKI); - - - -?> diff --git a/#jpgraph/src/Examples/ledex11.php b/#jpgraph/src/Examples/ledex11.php deleted file mode 100644 index 857faa07..00000000 --- a/#jpgraph/src/Examples/ledex11.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_OLIVE); - - - -?> diff --git a/#jpgraph/src/Examples/ledex12.php b/#jpgraph/src/Examples/ledex12.php deleted file mode 100644 index 7756ea13..00000000 --- a/#jpgraph/src/Examples/ledex12.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_LIMEGREEN); - - - -?> diff --git a/#jpgraph/src/Examples/ledex13.php b/#jpgraph/src/Examples/ledex13.php deleted file mode 100644 index add394d3..00000000 --- a/#jpgraph/src/Examples/ledex13.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_FORESTGREEN); - - - -?> diff --git a/#jpgraph/src/Examples/ledex14.php b/#jpgraph/src/Examples/ledex14.php deleted file mode 100644 index 7a505999..00000000 --- a/#jpgraph/src/Examples/ledex14.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_TEAL); - - - -?> diff --git a/#jpgraph/src/Examples/ledex15.php b/#jpgraph/src/Examples/ledex15.php deleted file mode 100644 index 6a5bb1f6..00000000 --- a/#jpgraph/src/Examples/ledex15.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_STEELBLUE); - - - -?> diff --git a/#jpgraph/src/Examples/ledex16.php b/#jpgraph/src/Examples/ledex16.php deleted file mode 100644 index 08ab7312..00000000 --- a/#jpgraph/src/Examples/ledex16.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_NAVY); - - - -?> diff --git a/#jpgraph/src/Examples/ledex17.php b/#jpgraph/src/Examples/ledex17.php deleted file mode 100644 index 34f18cd1..00000000 --- a/#jpgraph/src/Examples/ledex17.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_INVERTGRAY); - - - -?> diff --git a/#jpgraph/src/Examples/ledex2.php b/#jpgraph/src/Examples/ledex2.php deleted file mode 100644 index bd196d38..00000000 --- a/#jpgraph/src/Examples/ledex2.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_RED); - - - -?> diff --git a/#jpgraph/src/Examples/ledex3.php b/#jpgraph/src/Examples/ledex3.php deleted file mode 100644 index 0d81b3d5..00000000 --- a/#jpgraph/src/Examples/ledex3.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_YELLOW); - - - -?> diff --git a/#jpgraph/src/Examples/ledex4.1.php b/#jpgraph/src/Examples/ledex4.1.php deleted file mode 100644 index 81a9d1ff..00000000 --- a/#jpgraph/src/Examples/ledex4.1.php +++ /dev/null @@ -1,13 +0,0 @@ -SetSupersampling(2); -$led->StrokeNumber('123.',LEDC_RED); - - - -?> diff --git a/#jpgraph/src/Examples/ledex4.2.php b/#jpgraph/src/Examples/ledex4.2.php deleted file mode 100644 index 0a25bc02..00000000 --- a/#jpgraph/src/Examples/ledex4.2.php +++ /dev/null @@ -1,13 +0,0 @@ -SetSupersampling(4); -$led->StrokeNumber('123.',LEDC_RED); - - - -?> diff --git a/#jpgraph/src/Examples/ledex4.php b/#jpgraph/src/Examples/ledex4.php deleted file mode 100644 index d8782e25..00000000 --- a/#jpgraph/src/Examples/ledex4.php +++ /dev/null @@ -1,13 +0,0 @@ -SetSupersampling(1); -$led->StrokeNumber('123.',LEDC_RED); - - - -?> diff --git a/#jpgraph/src/Examples/ledex5.php b/#jpgraph/src/Examples/ledex5.php deleted file mode 100644 index 5526063c..00000000 --- a/#jpgraph/src/Examples/ledex5.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_BLUE); - - - -?> diff --git a/#jpgraph/src/Examples/ledex6.php b/#jpgraph/src/Examples/ledex6.php deleted file mode 100644 index eb8c03ba..00000000 --- a/#jpgraph/src/Examples/ledex6.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_GRAY); - - - -?> diff --git a/#jpgraph/src/Examples/ledex7.php b/#jpgraph/src/Examples/ledex7.php deleted file mode 100644 index da6c656b..00000000 --- a/#jpgraph/src/Examples/ledex7.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_CHOCOLATE); - - - -?> diff --git a/#jpgraph/src/Examples/ledex8.php b/#jpgraph/src/Examples/ledex8.php deleted file mode 100644 index 2075e261..00000000 --- a/#jpgraph/src/Examples/ledex8.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_PERU); - - - -?> diff --git a/#jpgraph/src/Examples/ledex9.php b/#jpgraph/src/Examples/ledex9.php deleted file mode 100644 index 82837d1d..00000000 --- a/#jpgraph/src/Examples/ledex9.php +++ /dev/null @@ -1,12 +0,0 @@ -StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_GOLDENROD); - - - -?> diff --git a/#jpgraph/src/Examples/ledex_cyrillic.php b/#jpgraph/src/Examples/ledex_cyrillic.php deleted file mode 100644 index b85f9d31..00000000 --- a/#jpgraph/src/Examples/ledex_cyrillic.php +++ /dev/null @@ -1,27 +0,0 @@ -SetSupersampling(2); -$text = 'А'. - 'Б'. - 'В'. - 'Г'. - 'Д'. - 'Е'. - 'Ё'. - 'З'. - 'И'. - 'Й'. - 'К'. - 'Л'. - 'М'. - 'Н'. - 'О'. - 'П'; -$led->StrokeNumber($text, LEDC_RED); - -?> diff --git a/#jpgraph/src/Examples/ledex_cyrillic2.php b/#jpgraph/src/Examples/ledex_cyrillic2.php deleted file mode 100644 index fb007144..00000000 --- a/#jpgraph/src/Examples/ledex_cyrillic2.php +++ /dev/null @@ -1,27 +0,0 @@ -SetSupersampling(2); -$text = 'Р'. - 'С'. - 'Т'. - 'У'. - 'Ф'. - 'Х'. - 'Ц'. - 'Ч'. - 'Ш'. - 'Щ'. - 'Ъ'. - 'Ы'. - 'Ь'. - 'Э'. - 'Ю'. - 'Я'; -$led->StrokeNumber($text, LEDC_RED); - -?> diff --git a/#jpgraph/src/Examples/lightbluedarkblue400x300grad.png b/#jpgraph/src/Examples/lightbluedarkblue400x300grad.png deleted file mode 100644 index 86092ecf..00000000 Binary files a/#jpgraph/src/Examples/lightbluedarkblue400x300grad.png and /dev/null differ diff --git a/#jpgraph/src/Examples/linebarcentex1.php b/#jpgraph/src/Examples/linebarcentex1.php deleted file mode 100644 index 1b5e1888..00000000 --- a/#jpgraph/src/Examples/linebarcentex1.php +++ /dev/null @@ -1,49 +0,0 @@ -GetShortMonth(); - -// Create the graph. -$graph = new Graph(400,200); -$graph->SetScale("textlin"); -$graph->SetMargin(40,130,20,40); -$graph->SetShadow(); -$graph->xaxis->SetTickLabels($datax); - -// Create the linear error plot -$l1plot=new LinePlot($l1datay); -$l1plot->SetColor("red"); -$l1plot->SetWeight(2); -$l1plot->SetLegend("Prediction"); - -//Center the line plot in the center of the bars -$l1plot->SetBarCenter(); - - -// Create the bar plot -$bplot = new BarPlot($l2datay); -$bplot->SetFillColor("orange"); -$bplot->SetLegend("Result"); - -// Add the plots to t'he graph -$graph->Add($bplot); -$graph->Add($l1plot); - - -$graph->title->Set("Adding a line plot to a bar graph v1"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/linebarex1.php b/#jpgraph/src/Examples/linebarex1.php deleted file mode 100644 index 202491d9..00000000 --- a/#jpgraph/src/Examples/linebarex1.php +++ /dev/null @@ -1,75 +0,0 @@ -SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); -$graph->SetShadow(); - -// Use an integer X-scale -$graph->SetScale("textlin"); - -// Set title and subtitle -$graph->title->Set("Combined bar and line plot"); -$graph->subtitle->Set("100 data points, X-Scale: 'text'"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Make the margin around the plot a little bit bigger -// then default -$graph->img->SetMargin(40,140,40,80); - -// Slightly adjust the legend from it's default position in the -// top right corner to middle right side -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Display every 10:th datalabel -$graph->xaxis->SetTextTickInterval(6); -$graph->xaxis->SetTextLabelInterval(2); -$graph->xaxis->SetTickLabels($databarx); -$graph->xaxis->SetLabelAngle(90); - -// Create a red line plot -$p1 = new LinePlot($datay); -$p1->SetColor("red"); -$p1->SetLegend("Pressure"); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend("Temperature"); -$b1->SetAbsWidth(6); -$b1->SetShadow(); - -// The order the plots are added determines who's ontop -$graph->Add($p1); -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/linebarex2.php b/#jpgraph/src/Examples/linebarex2.php deleted file mode 100644 index efae8e2d..00000000 --- a/#jpgraph/src/Examples/linebarex2.php +++ /dev/null @@ -1,59 +0,0 @@ -SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); -$graph->SetShadow(); - -// Use an integer X-scale -$graph->SetScale("intlin"); - -// Set title and subtitle -$graph->title->Set("Combined bar and line plot"); -$graph->subtitle->Set("(\"left\" aligned bars)"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Make the margin around the plot a little bit bigger -// then default -$graph->img->SetMargin(40,120,40,40); - -// Slightly adjust the legend from it's default position in the -// top right corner to middle right side -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Create a red line plot -$p1 = new LinePlot($datay,$datax); -$p1->SetColor("red"); -$p1->SetLegend("Status one"); -$graph->Add($p1); - -// Create the bar plot -$b1 = new BarPlot($databary,$databarx); -$b1->SetLegend("Status two"); -$b1->SetAlign("left"); -$b1->SetShadow(); -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/linebarex3.php b/#jpgraph/src/Examples/linebarex3.php deleted file mode 100644 index faff220d..00000000 --- a/#jpgraph/src/Examples/linebarex3.php +++ /dev/null @@ -1,52 +0,0 @@ -img->SetMargin(40,180,40,40); -$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); - -//$graph->img->SetAntiAliasing(); - -$graph->SetScale("intlin"); -$graph->SetShadow(); -$graph->title->Set("Combined bar and line plot"); -$graph->subtitle->Set("(\"center\" aligned bars)"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Slightly adjust the legend from it's default position in the -// top right corner. -$graph->legend->Pos(0.05,0.5,"right","center"); - -// Create the first line - -$p1 = new LinePlot($datay,$datax); -$p1->SetWeight(1); -$p1->SetColor("red"); -$p1->SetLegend("Triumph Tiger -98"); -$graph->Add($p1); - -$b1 = new BarPlot($databary,$databarx); -$b1->SetAbsWidth(10); -$b1->SetAlign("center"); -$b1->SetShadow(); -$graph->Add($b1); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/linegraceex.php b/#jpgraph/src/Examples/linegraceex.php deleted file mode 100644 index e64cdc4f..00000000 --- a/#jpgraph/src/Examples/linegraceex.php +++ /dev/null @@ -1,31 +0,0 @@ -img->SetMargin(40,40,40,40); - -$graph->img->SetAntiAliasing(); -$graph->SetScale("textlin"); -$graph->SetShadow(); -$graph->title->Set("Example of 10% top/bottom grace"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Add 10% grace to top and bottom of plot -$graph->yscale->SetGrace(10,10); - -$p1 = new LinePlot($datay); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$p1->SetColor("blue"); -$p1->SetCenter(); -$graph->Add($p1); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/lineiconex1.php b/#jpgraph/src/Examples/lineiconex1.php deleted file mode 100644 index 53f2b00f..00000000 --- a/#jpgraph/src/Examples/lineiconex1.php +++ /dev/null @@ -1,49 +0,0 @@ -SetMargin(40,40,20,30); -$graph->SetScale("textlin"); - -$graph->title->Set('Adding an icon ("tux") in the background'); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); - -//$graph->SetBackgroundGradient('red','blue'); - -$graph->xaxis->SetPos('min'); - -$p1 = new LinePlot($datay); -$p1->SetColor("blue"); -$p1->SetFillGradient('yellow@0.4','red@0.4'); - -$p2 = new LinePlot($datay2); -$p2->SetColor("black"); -$p2->SetFillGradient('green@0.4','white'); - -$p3 = new LinePlot($datay3); -$p3->SetColor("blue"); -$p3->SetFillGradient('navy@0.4','white@0.4'); - -$graph->Add($p1); -$graph->Add($p2); -$graph->Add($p3); - -$icon = new IconPlot('penguin.png',0.2,0.3,1,30); -$icon->SetAnchor('center','center'); -$graph->Add($icon); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/lineiconex2.php b/#jpgraph/src/Examples/lineiconex2.php deleted file mode 100644 index d16ab8b7..00000000 --- a/#jpgraph/src/Examples/lineiconex2.php +++ /dev/null @@ -1,32 +0,0 @@ -SetMargin(40,40,20,30); -$graph->SetScale("textlin"); - -$graph->title->Set('Adding a country flag as a an icon'); - -$p1 = new LinePlot($datay); -$p1->SetColor("blue"); -$p1->SetFillGradient('yellow@0.4','red@0.4'); - -$graph->Add($p1); - -$icon = new IconPlot(); -$icon->SetCountryFlag('iceland',50,30,1.5,40,3); -$icon->SetAnchor('left','top'); -$graph->Add($icon); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/lineimagefillex1.php b/#jpgraph/src/Examples/lineimagefillex1.php deleted file mode 100644 index d2fb60ae..00000000 --- a/#jpgraph/src/Examples/lineimagefillex1.php +++ /dev/null @@ -1,41 +0,0 @@ -title->Set('Education growth'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->SetScale('intlin'); -$graph->SetMarginColor('white'); -$graph->SetBox(); -//$graph->img->SetAntialiasing(); - -$graph->SetGridDepth(DEPTH_FRONT); -$graph->ygrid->SetColor('gray@0.7'); -$graph->SetBackgroundImage('classroom.jpg',BGIMG_FILLPLOT); - -// Masking graph -$p1 = new LinePlot($datay); -$p1->SetFillColor('white'); -$p1->SetFillFromYMax(); -$p1->SetWeight(0); -$graph->Add($p1); - -// Line plot -$p2 = new LinePlot($datay); -$p2->SetColor('black@0.4'); -$p2->SetWeight(3); -$p2->mark->SetType(MARK_SQUARE); -$p2->mark->SetColor('orange@0.5'); -$p2->mark->SetFillColor('orange@0.3'); -$graph->Add($p2); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/linlogex1.php b/#jpgraph/src/Examples/linlogex1.php deleted file mode 100644 index 4c2be9de..00000000 --- a/#jpgraph/src/Examples/linlogex1.php +++ /dev/null @@ -1,64 +0,0 @@ -SetScale("linlog"); -$graph->img->SetMargin(40,20,20,40); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->Set("ab/2"); -$graph->yaxis->title->Set("rho_s"); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->ygrid->Show(true,true); -$graph->xgrid->Show(true,true); - -$errorplot=new ErrorPlot($ydata, $xdata); - -$graph->Add($errorplot); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/listallflags.php b/#jpgraph/src/Examples/listallflags.php deleted file mode 100644 index 0f7a7966..00000000 --- a/#jpgraph/src/Examples/listallflags.php +++ /dev/null @@ -1,29 +0,0 @@ -\n"; -$cols=0; -while( list($key,$val) = each($flags->iCountryNameMap) ) { - - echo '
'; - echo "$key
idx=$val\n"; - - if( ++$cols == 5 ) { - echo "\n"; - $cols=0; - } -} - -echo ""; - -?> - diff --git a/#jpgraph/src/Examples/listallflags_helper.php b/#jpgraph/src/Examples/listallflags_helper.php deleted file mode 100644 index 52ad9f9b..00000000 --- a/#jpgraph/src/Examples/listallflags_helper.php +++ /dev/null @@ -1,25 +0,0 @@ -GetImgByIdx($idx); -header ("Content-type: image/png"); -ImagePng ($img); - -?> diff --git a/#jpgraph/src/Examples/listfontsex1.php b/#jpgraph/src/Examples/listfontsex1.php deleted file mode 100644 index 15ee50d1..00000000 --- a/#jpgraph/src/Examples/listfontsex1.php +++ /dev/null @@ -1,154 +0,0 @@ -Set(0,27,0,85); -$g->SetMargin(5,6,5,6); -$g->SetColor('white'); -$g->SetMarginColor("teal"); -$g->InitFrame(); - - -$t = new CanvasRectangleText(); -$t->SetFont(FF_ARIAL,FS_NORMAL,16); -$t->SetFillColor('lemonchiffon2'); -$t->SetFontColor('black'); -$t->Set("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTTF Fonts (11pt)",0.5,19.5,26,64.5); -$t->Stroke($g->img,$scale); - -$t->SetFillColor('lemonchiffon3'); -$t->Set("\n\n\n\nBitmap Fonts",0.5,5,26,13.5); -$t->Stroke($g->img,$scale); - - -$t = new CanvasRectangleText(); -$t->SetFillColor(''); -$t->SetFontColor('black'); -$t->SetColor(''); -$t->SetShadow(''); - -$t->SetFont(FF_ARIAL,FS_BOLD,18); -$t->Set('Normal',1,1,8); -$t->Stroke($g->img,$scale); - -$t->Set('Italic style',9,1,8); -$t->Stroke($g->img,$scale); - -$t->Set('Bold style',17.5,1,8); -$t->Stroke($g->img,$scale); - - -$t->SetFillColor('yellow'); -$t->SetFontColor('black'); -$t->SetColor('black'); -$t->SetShadow('gray'); - -$r=6;$c=1;$w=7.5;$h=3.5; - -$fonts=array( - array("Font 0",FF_FONT0,FS_NORMAL), - array("",FF_FONT0,FS_ITALIC), - array("",FF_FONT0,FS_BOLD), - - array("Font 1",FF_FONT1,FS_NORMAL), - array("",FF_FONT1,FS_ITALIC), - array("Font 1 bold",FF_FONT1,FS_BOLD), - - array("Font 2",FF_FONT2,FS_NORMAL), - array("",FF_FONT2,FS_ITALIC), - array("Font 2 bold",FF_FONT2,FS_BOLD), - - array("Arial",FF_ARIAL,FS_NORMAL), - array("Arial italic",FF_ARIAL,FS_ITALIC), - array("Arial bold",FF_ARIAL,FS_BOLD), - - array("Verdana",FF_VERDANA,FS_NORMAL), - array("Verdana italic",FF_VERDANA,FS_ITALIC), - array("Verdana bold",FF_VERDANA,FS_BOLD), - - - array("Trebuche",FF_TREBUCHE,FS_NORMAL), - array("Trebuche italic",FF_TREBUCHE,FS_ITALIC), - array("Trebuche bold",FF_TREBUCHE,FS_BOLD), - - array("Georgia",FF_GEORGIA,FS_NORMAL), - array("Georgia italic",FF_GEORGIA,FS_ITALIC), - array("Georgia bold",FF_GEORGIA,FS_BOLD), - - array("Comic",FF_COMIC,FS_NORMAL), - array("",FF_COMIC,FS_ITALIC), - array("Comic bold",FF_COMIC,FS_BOLD), - - array("Courier",FF_COURIER,FS_NORMAL), - array("Courier italic",FF_COURIER,FS_ITALIC), - array("Courier bold",FF_COURIER,FS_BOLD), - - array("Times normal",FF_TIMES,FS_NORMAL), - array("Times italic",FF_TIMES,FS_ITALIC), - array("Times bold",FF_TIMES,FS_BOLD), - - array("Vera normal",FF_VERA,FS_NORMAL), - array("Vera italic",FF_VERA,FS_ITALIC), - array("Vera bold",FF_VERA,FS_BOLD), - - array("Vera mono normal",FF_VERAMONO,FS_NORMAL), - array("Vera mono italic",FF_VERAMONO,FS_ITALIC), - array("Vera mono bold",FF_VERAMONO,FS_BOLD), - - array("Vera serif normal",FF_VERASERIF,FS_NORMAL), - array("",FF_VERASERIF,FS_ITALIC), - array("Vera serif bold",FF_VERASERIF,FS_BOLD), - - array("DejaVu sans serif",FF_DV_SANSSERIF,FS_NORMAL), - array("DejaVu sans serif",FF_DV_SANSSERIF,FS_ITALIC), - array("DejaVu sans serif",FF_DV_SANSSERIF,FS_BOLD), - - array("DejaVu serif",FF_DV_SERIF,FS_NORMAL), - array("DejaVu serif",FF_DV_SERIF,FS_ITALIC), - array("DejaVu serif",FF_DV_SERIF,FS_BOLD), - - array("DejaVuMono sans serif",FF_DV_SANSSERIFMONO,FS_NORMAL), - array("DejaVuMono sans serif",FF_DV_SANSSERIFMONO,FS_ITALIC), - array("DejaVuMono sans serif",FF_DV_SANSSERIFMONO,FS_BOLD), - - array("DejaVuCond serif",FF_DV_SERIFCOND,FS_NORMAL), - array("DejaVuCond serif",FF_DV_SERIFCOND,FS_ITALIC), - array("DejaVuCond serif",FF_DV_SERIFCOND,FS_BOLD), - - array("DejaVuCond sans serif",FF_DV_SANSSERIFCOND,FS_NORMAL), - array("DejaVuCond sans serif",FF_DV_SANSSERIFCOND,FS_ITALIC), - array("DejaVuCond sans serif",FF_DV_SANSSERIFCOND,FS_BOLD), - - ); - - -$n=count($fonts); - -for( $i=0; $i < $n; ++$i ) { - - if( $i==9 ) $r += 3; - - if( $fonts[$i][0] ) { - $t->SetTxt($fonts[$i][0]); - $t->SetPos($c,$r,$w,$h); - $t->SetFont($fonts[$i][1],$fonts[$i][2],11); - $t->Stroke($g->img,$scale); - } - - $c += $w+1; - if( $c > 30-$w-2 ) { - $c = 1; - $r += 4; - } - -} - -$g->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/logbarex1.php b/#jpgraph/src/Examples/logbarex1.php deleted file mode 100644 index a3a8a901..00000000 --- a/#jpgraph/src/Examples/logbarex1.php +++ /dev/null @@ -1,48 +0,0 @@ -img->SetMargin(50,30,50,50); -$graph->SetScale("textlog"); -//$graph->SetShadow(); - -// Setup titles for graph and axis -$graph->title->Set("Bar with logarithmic Y-scale"); -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,18); - -$graph->xaxis->SetTitle("2002"); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_NORMAL,16); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,16); -$graph->yaxis->SetTitle("Y-title",'center'); -$graph->yaxis->SetTitleMargin(30); - -// Setup month on X-scale -//$graph->xaxis->SetTickLabels($datax); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); - -//You can also set a manual base of the bars -//$bplot->SetYBase(0.001); - -/* -$bplot->SetShadow(); -$bplot->value->Show(); -$bplot->value->SetFont(FF_ARIAL,FS_BOLD); -$bplot->value->SetAngle(45); -$bplot->value->SetColor("black","darkred"); -*/ - -$graph->Add($bplot); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/loglogex1.php b/#jpgraph/src/Examples/loglogex1.php deleted file mode 100644 index 31a4a52c..00000000 --- a/#jpgraph/src/Examples/loglogex1.php +++ /dev/null @@ -1,59 +0,0 @@ -SetScale("loglog"); -$graph->SetY2Scale("lin"); -$graph->y2axis->SetColor("blue","blue"); - -$graph->img->SetMargin(50,70,40,50); -$graph->title->Set("Geoelektrik"); -$graph->xaxis->title->Set("Auslage ab/2 [m]"); -$graph->yaxis->title->Set("rho_s [Ohm m]"); -$graph->y2axis->title->Set("mn/2 [m]"); -$graph->y2axis->title->SetColor("blue"); -$graph->y2axis->SetTitleMargin(35); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xgrid->Show(true,true); -$graph->ygrid->Show(true,true); - -// Create the linear plot - -$lineplot=new LinePlot($rhos,$ab2); -$lineplot->SetWeight(1); -$lineplot->mark->SetType(MARK_FILLEDCIRCLE); -$lineplot->mark->SetWidth(2); - -// Create scatter plot - -$scplot=new ScatterPlot($mn2,$ab2); -$scplot->mark->SetType(MARK_FILLEDCIRCLE); -$scplot->mark->SetColor("blue"); -$scplot->mark->SetWidth(2); - -// Add plots to the graph - -$graph->AddY2($scplot); -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/manscaleex1.php b/#jpgraph/src/Examples/manscaleex1.php deleted file mode 100644 index 9a7962aa..00000000 --- a/#jpgraph/src/Examples/manscaleex1.php +++ /dev/null @@ -1,22 +0,0 @@ -SetScale("textlin",3,35); -$graph->yscale->ticks->Set(8,2); - -$graph->title->Set('Manual scale, manual ticks'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$line = new LinePlot($ydata); -$graph->Add($line); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manscaleex2.php b/#jpgraph/src/Examples/manscaleex2.php deleted file mode 100644 index d192ed8f..00000000 --- a/#jpgraph/src/Examples/manscaleex2.php +++ /dev/null @@ -1,21 +0,0 @@ -SetScale("textlin",3,35); - -$graph->title->Set('Manual scale, exact limits'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$line = new LinePlot($ydata); -$graph->Add($line); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manscaleex3.php b/#jpgraph/src/Examples/manscaleex3.php deleted file mode 100644 index 2fdcfa28..00000000 --- a/#jpgraph/src/Examples/manscaleex3.php +++ /dev/null @@ -1,23 +0,0 @@ -SetScale("textlin",3,35); -$graph->SetTickDensity(TICKD_DENSE); -$graph->yscale->SetAutoTicks(); - -$graph->title->Set('Manual scale, auto ticks'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$line = new LinePlot($ydata); -$graph->Add($line); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manscaleex4.php b/#jpgraph/src/Examples/manscaleex4.php deleted file mode 100644 index 4653ede6..00000000 --- a/#jpgraph/src/Examples/manscaleex4.php +++ /dev/null @@ -1,22 +0,0 @@ -SetScale("textlin",3,35); -$graph->yscale->SetAutoTicks(); - -$graph->title->Set('Manual scale, allow adjustment'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$line = new LinePlot($ydata); -$graph->Add($line); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manual_textscale_ex1.php b/#jpgraph/src/Examples/manual_textscale_ex1.php deleted file mode 100644 index a911c337..00000000 --- a/#jpgraph/src/Examples/manual_textscale_ex1.php +++ /dev/null @@ -1,40 +0,0 @@ -GetShortMonth(); - -// New graph with a drop shadow -$graph = new Graph(300,200,'auto'); -$graph->SetShadow(); - -// Use a "text" X-scale -$graph->SetScale("textlin"); - -// Specify X-labels -$graph->xaxis->SetTickLabels($months); - -// Set title and subtitle -$graph->title->Set("Textscale with specified labels"); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend("Temperature"); - -//$b1->SetAbsWidth(6); -//$b1->SetShadow(); - -// The order the plots are added determines who's ontop -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manual_textscale_ex2.php b/#jpgraph/src/Examples/manual_textscale_ex2.php deleted file mode 100644 index 968d9dd2..00000000 --- a/#jpgraph/src/Examples/manual_textscale_ex2.php +++ /dev/null @@ -1,40 +0,0 @@ -GetShortMonth(); - -// New graph with a drop shadow -$graph = new Graph(300,200); -$graph->SetShadow(); - -// Use a "text" X-scale -$graph->SetScale('textlin'); - -// Specify X-labels -$graph->xaxis->SetTickLabels($months); -$graph->xaxis->SetTextTickInterval(2,0); - -// Set title and subtitle -$graph->title->Set('Textscale with tickinterval=2'); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend('Temperature'); - -// The order the plots are added determines who's ontop -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manual_textscale_ex3.php b/#jpgraph/src/Examples/manual_textscale_ex3.php deleted file mode 100644 index 18d718cf..00000000 --- a/#jpgraph/src/Examples/manual_textscale_ex3.php +++ /dev/null @@ -1,40 +0,0 @@ -GetShortMonth(); - -// New graph with a drop shadow -$graph = new Graph(300,200); -$graph->SetShadow(); - -// Use a "text" X-scale -$graph->SetScale('textlin'); - -// Specify X-labels -$graph->xaxis->SetTickLabels($months); -$graph->xaxis->SetTextLabelInterval(2); - -// Set title and subtitle -$graph->title->Set('Textscale with tickinterval=2'); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create the bar plot -$b1 = new BarPlot($databary); -$b1->SetLegend('Temperature'); - -// The order the plots are added determines who's ontop -$graph->Add($b1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manual_textscale_ex4.php b/#jpgraph/src/Examples/manual_textscale_ex4.php deleted file mode 100644 index 99146faf..00000000 --- a/#jpgraph/src/Examples/manual_textscale_ex4.php +++ /dev/null @@ -1,51 +0,0 @@ -GetShortMonth(); -$k=0; -for($i=0; $i < 480; ++$i) { - $datay[$i] = rand(1,40); - if( $i % DATAPERMONTH === 0 ) - $months[$i] = $m[(int)($i/DATAPERMONTH)]; - else - $months[$i] = 'xx'; -} - - -// New graph with a drop shadow -$graph = new Graph(400,200); -//$graph->SetShadow(); - -// Use a "text" X-scale -$graph->SetScale('textlin'); - -// Specify X-labels -$graph->xaxis->SetTickLabels($months); -$graph->xaxis->SetTextTickInterval(DATAPERMONTH,0); -$graph->xaxis->SetTextLabelInterval(2); - -// Set title and subtitle -$graph->title->Set('Textscale with tickinterval=2'); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->SetBox(true,'red'); - -// Create the bar plot -$lp1 = new LinePlot($datay); -$lp1->SetLegend('Temperature'); - -// The order the plots are added determines who's ontop -$graph->Add($lp1); - -// Finally output the image -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manualtickex1.php b/#jpgraph/src/Examples/manualtickex1.php deleted file mode 100644 index 47d0b8d2..00000000 --- a/#jpgraph/src/Examples/manualtickex1.php +++ /dev/null @@ -1,73 +0,0 @@ -GetTicks($datax); - -// We add some grace to the end of the X-axis scale so that the first and last -// data point isn't exactly at the very end or beginning of the scale -$grace = 400000; -$xmin = $datax[0]-$grace; -$xmax = $datax[$n-1]+$grace; - -// -// The code to setup a very basic graph -// -$graph = new Graph(400,200); - -// -// We use an integer scale on the X-axis since the positions on the X axis -// are assumed to be UNI timestamps -$graph->SetScale('intlin',0,0,$xmin,$xmax); -$graph->title->Set('Basic example with manual ticks'); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); - -// -// Make sure that the X-axis is always at the bottom of the scale -// (By default the X-axis is alwys positioned at Y=0 so if the scale -// doesn't happen to include 0 the axis will not be shown) -$graph->xaxis->SetPos('min'); - -// Now set the tic positions -$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions); - -// The labels should be formatted at dates with "Year-month" -$graph->xaxis->SetLabelFormatString('My',true); - -// Use Ariel font -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); - -// Add a X-grid -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new LinePlot($datay,$datax); -$p1->SetColor('teal'); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manualtickex1a.php b/#jpgraph/src/Examples/manualtickex1a.php deleted file mode 100644 index 47d0b8d2..00000000 --- a/#jpgraph/src/Examples/manualtickex1a.php +++ /dev/null @@ -1,73 +0,0 @@ -GetTicks($datax); - -// We add some grace to the end of the X-axis scale so that the first and last -// data point isn't exactly at the very end or beginning of the scale -$grace = 400000; -$xmin = $datax[0]-$grace; -$xmax = $datax[$n-1]+$grace; - -// -// The code to setup a very basic graph -// -$graph = new Graph(400,200); - -// -// We use an integer scale on the X-axis since the positions on the X axis -// are assumed to be UNI timestamps -$graph->SetScale('intlin',0,0,$xmin,$xmax); -$graph->title->Set('Basic example with manual ticks'); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); - -// -// Make sure that the X-axis is always at the bottom of the scale -// (By default the X-axis is alwys positioned at Y=0 so if the scale -// doesn't happen to include 0 the axis will not be shown) -$graph->xaxis->SetPos('min'); - -// Now set the tic positions -$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions); - -// The labels should be formatted at dates with "Year-month" -$graph->xaxis->SetLabelFormatString('My',true); - -// Use Ariel font -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); - -// Add a X-grid -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new LinePlot($datay,$datax); -$p1->SetColor('teal'); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manualtickex2.php b/#jpgraph/src/Examples/manualtickex2.php deleted file mode 100644 index abd7e101..00000000 --- a/#jpgraph/src/Examples/manualtickex2.php +++ /dev/null @@ -1,72 +0,0 @@ -E(0,10); - -// Now get labels at 1/2 PI intervall -$tickPositions = array(); -$tickLabels = array(); -$tickPositions[0] = 0; -$tickLabels[0] = '0'; -for($i=1; $i/2*M_PI < 11 ; ++$i ) { - $tickPositions[$i] = $i/2*M_PI; - if( $i % 2 ) - $tickLabels[$i] = $i.'/2'.SymChar::Get('pi'); - else - $tickLabels[$i] = ($i/2).SymChar::Get('pi'); -} - -$n = count($datax); -$xmin = $datax[0]; -$xmax = $datax[$n-1]; - -// -// The code to setup a very basic graph -// -$graph = new Graph(400,200); - -// -// We use an integer scale on the X-axis since the positions on the X axis -// are assumed to be UNI timestamps -$graph->SetScale('linlin',0,0,$xmin,$xmax); -$graph->title->Set('Example with manual tick labels'); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); - -// -// Make sure that the X-axis is always at the bottom of the scale -// (By default the X-axis is alwys positioned at Y=0 so if the scale -// doesn't happen to include 0 the axis will not be shown) -$graph->xaxis->SetPos('min'); - -// Now set the tic positions -$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels); - -// Use Times font -$graph->xaxis->SetFont(FF_TIMES,FS_NORMAL,10); -$graph->yaxis->SetFont(FF_TIMES,FS_NORMAL,10); - -// Add a X-grid -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new LinePlot($datay,$datax); -$p1->SetColor('teal'); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manualtickex3.php b/#jpgraph/src/Examples/manualtickex3.php deleted file mode 100644 index 0bd03cea..00000000 --- a/#jpgraph/src/Examples/manualtickex3.php +++ /dev/null @@ -1,91 +0,0 @@ -E(0,10); - -// Now get labels at 1/2 PI intervall -$tickPositions = array(); -$tickLabels = array(); -$tickPositions[0] = 0; -$tickLabels[0] = '0'; -for($i=1; $i/2*M_PI < 11 ; ++$i ) { - $tickPositions[$i] = $i/2*M_PI; - if( $i % 2 ) - $tickLabels[$i] = $i.'/2'.SymChar::Get('pi'); - else - $tickLabels[$i] = ($i/2).SymChar::Get('pi'); -} - -$n = count($datax); -$xmin = $datax[0]; -$xmax = $datax[$n-1]; - -// -// The code to setup a very basic graph -// -$graph = new Graph(400,200); - -// We use an integer scale on the X-axis since the positions on the X axis -// are assumed to be UNI timestamps -$graph->SetScale('linlin',0,0,$xmin,$xmax); -$graph->title->Set('Example with manual tick labels'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->SetColor('white'); - -// Setup a abackground gradient -$graph->SetBackgroundGradient('darkred:0.7', 'black', 2, BGRAD_MARGIN); -$graph->SetPlotGradient('black','darkred:0.8', 2); - -// Make sure that the X-axis is always at the bottom of the scale -// (By default the X-axis is alwys positioned at Y=0 so if the scale -// doesn't happen to include 0 the axis will not be shown) -$graph->xaxis->SetPos('min'); - -// Now set the tic positions -$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels); - -// Use Times font -$graph->xaxis->SetFont(FF_TIMES,FS_NORMAL,11); -$graph->yaxis->SetFont(FF_TIMES,FS_NORMAL,9); - -// Set colors for axis -$graph->xaxis->SetColor('lightgray'); -$graph->yaxis->SetColor('lightgray'); - -// Add a X-grid -$graph->xgrid->Show(); - -// Show ticks outwards -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->xaxis->SetLabelMargin(8); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Setup a filled y-grid -//$graph->ygrid->SetFill(true,'darkgray:1.55@0.7','darkgray:1.6@0.7'); -$graph->ygrid->SetStyle('dotted'); -$graph->xgrid->SetStyle('dashed'); - -// Create the plot line -$p1 = new LinePlot($datay,$datax); -$p1->SetWeight(2); -$p1->SetColor('orange:0.9'); -$p1->SetFillColor('white@0.7'); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/manualtickex4.php b/#jpgraph/src/Examples/manualtickex4.php deleted file mode 100644 index f4a80e67..00000000 --- a/#jpgraph/src/Examples/manualtickex4.php +++ /dev/null @@ -1,92 +0,0 @@ -E(0,10); - -// Now get labels at 1/2 PI intervall -$tickPositions = array(); -$tickLabels = array(); -$tickPositions[0] = 0; -$tickLabels[0] = '0'; -for($i=1; $i/2*M_PI < 11 ; ++$i ) { - $tickPositions[$i] = $i/2*M_PI; - if( $i % 2 ) - $tickLabels[$i] = $i.'/2'.SymChar::Get('pi'); - else - $tickLabels[$i] = ($i/2).SymChar::Get('pi'); -} - -$n = count($datax); -$xmin = $datax[0]; -$xmax = $datax[$n-1]; - -// -// The code to setup a very basic graph -// -$graph = new Graph(400,200); - -// We use an integer scale on the X-axis since the positions on the X axis -// are assumed to be UNI timestamps -$graph->SetScale('linlin',0,0,$xmin,$xmax); -$graph->title->Set('Example with manual tick labels'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->SetColor('white'); - -// Setup a abackground gradient -$graph->SetBackgroundGradient('darkred:0.7', 'black', 2, BGRAD_MARGIN); -$graph->SetPlotGradient('black','darkred:0.8', 2); - -// Make sure that the X-axis is always at the bottom of the scale -// (By default the X-axis is alwys positioned at Y=0 so if the scale -// doesn't happen to include 0 the axis will not be shown) -$graph->xaxis->SetPos('min'); - -// Now set the tic positions -$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels); - -// Use Times font -$graph->xaxis->SetFont(FF_TIMES,FS_NORMAL,11); -$graph->yaxis->SetFont(FF_TIMES,FS_NORMAL,9); - -// Set colors for axis -$graph->xaxis->SetColor('lightgray'); -$graph->yaxis->SetColor('lightgray'); - -// Add a X-grid -$graph->xgrid->Show(); - -// Show ticks outwards -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->xaxis->SetLabelMargin(8); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Setup a filled y-grid -//$graph->ygrid->SetFill(true,'darkgray:1.55@0.7','darkgray:1.6@0.7'); -$graph->ygrid->SetStyle('dotted'); -$graph->xgrid->SetStyle('dashed'); - -// Create the plot line -$p1 = new LinePlot($datay,$datax); -$p1->SetWeight(2); -$p1->SetColor('orange:0.9'); -$p1->SetFillColor('white@0.7'); -$p1->SetFillFromYMin(); -$graph->Add($p1); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/markflagex1.php b/#jpgraph/src/Examples/markflagex1.php deleted file mode 100644 index 576134e2..00000000 --- a/#jpgraph/src/Examples/markflagex1.php +++ /dev/null @@ -1,74 +0,0 @@ -SetMarginColor('white'); -$graph->SetScale("textlin"); -$graph->SetFrame(false); -$graph->SetMargin(30,5,25,20); - -// Enable X-grid as well -$graph->xgrid->Show(); - -// Use months as X-labels -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -//------------------------ -// Create the plots -//------------------------ -$p1 = new LinePlot($datay[0]); -$p1->SetColor("navy"); - -// Use a flag -$p1->mark->SetType(MARK_FLAG1,197); - -// Displayes value on top of marker image -$p1->value->SetFormat('%d mil'); -$p1->value->Show(); -$p1->value->SetColor('darkred'); -$p1->value->SetFont(FF_ARIAL,FS_BOLD,10); -// Increase the margin so that the value is printed avove tje -// img marker -$p1->value->SetMargin(14); - -// Incent the X-scale so the first and last point doesn't -// fall on the edges -$p1->SetCenter(); - -$graph->Add($p1); - -//------------ -// 2:nd plot -//------------ -$p2 = new LinePlot($datay[1]); -$p2->SetColor("navy"); - -// Use a flag -$p2->mark->SetType(MARK_FLAG1,'united states'); - -// Displayes value on top of marker image -$p2->value->SetFormat('%d mil'); -$p2->value->Show(); -$p2->value->SetColor('darkred'); -$p2->value->SetFont(FF_ARIAL,FS_BOLD,10); -// Increase the margin so that the value is printed avove tje -// img marker -$p2->value->SetMargin(14); - -// Incent the X-scale so the first and last point doesn't -// fall on the edges -$p2->SetCenter(); -$graph->Add($p2); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/matrix_csimex01.php b/#jpgraph/src/Examples/matrix_csimex01.php deleted file mode 100644 index 76bb0a1e..00000000 --- a/#jpgraph/src/Examples/matrix_csimex01.php +++ /dev/null @@ -1,76 +0,0 @@ -SetBackgroundGradient('lightsteelblue:0.8','lightsteelblue:0.3'); -$graph->title->Set('CSIM with matrix'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->SetColor('white'); - -// Create one matrix plot -$mp = new MatrixPlot($data,1); -$mp->SetModuleSize(13,15); -$mp->SetCenterPos(0.35,0.6); -$mp->colormap->SetNullColor('gray'); - -// Setup column lablels -$mp->collabel->Set($collabels); -$mp->collabel->SetSide('top'); -$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,8); -$mp->collabel->SetFontColor('lightgray'); - -// Setup row lablels -$mp->rowlabel->Set($rowlabels); -$mp->rowlabel->SetSide('right'); -$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,8); -$mp->rowlabel->SetFontColor('lightgray'); - -$mp->rowlabel->SetCSIMTargets($rowlabeltargets); -$mp->collabel->SetCSIMTargets($collabeltargets); - -// Move the legend more to the right -$mp->legend->SetMargin(90); -$mp->legend->SetColor('white'); -$mp->legend->SetFont(FF_VERDANA,FS_BOLD,10); - -$mp->SetCSIMTargets($csimtargets); - -$graph->Add($mp); -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/matrix_edgeex01.php b/#jpgraph/src/Examples/matrix_edgeex01.php deleted file mode 100644 index e66fd77a..00000000 --- a/#jpgraph/src/Examples/matrix_edgeex01.php +++ /dev/null @@ -1,53 +0,0 @@ -SetMarginColor('white'); -$graph->title->Set('Adding labels on the edges'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -// Create one matrix plot -$mp = new MatrixPlot($data,1); -$mp->SetModuleSize(13,15); -$mp->SetCenterPos(0.35,0.45); -$mp->colormap->SetNullColor('gray'); - -// Setup column lablels -$mp->collabel->Set($xlabels); -$mp->collabel->SetSide('bottom'); -$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,8); -$mp->collabel->SetFontColor('darkgray'); - -// Setup row lablels -$mp->rowlabel->Set($ylabels); -$mp->rowlabel->SetSide('right'); -$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,8); -$mp->rowlabel->SetFontColor('darkgray'); - -// Move the legend more to the right -$mp->legend->SetMargin(90); - -$graph->Add($mp); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_edgeex02.php b/#jpgraph/src/Examples/matrix_edgeex02.php deleted file mode 100644 index c07ba6a1..00000000 --- a/#jpgraph/src/Examples/matrix_edgeex02.php +++ /dev/null @@ -1,51 +0,0 @@ -title->Set('Add ine row/col labels'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -$mp = new MatrixPlot($data,1); -$mp->SetSize(0.55); -$mp->SetCenterPos(0.45, 0.45); - -$rowtitles = array(); -for( $i=0; $i < $nrow; ++$i ) { - $rowtitles[$i] = sprintf('Row: %02d',$i); -} -$coltitles = array(); -for( $i=0; $i < $ncol; ++$i ) { - $coltitles[$i] = sprintf('Col: %02d',$i); -} - -$mp->rowlabel->Set($rowtitles); -$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,10); -$mp->rowlabel->SetFontColor('blue'); -$mp->rowlabel->SetSide('left'); - -$mp->collabel->Set($coltitles); -$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,10); -$mp->collabel->SetFontColor('darkred'); -$mp->collabel->SetAngle(70); // 90 is default for col titles -$mp->collabel->SetSide('bottom'); - -$graph->Add($mp); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_ex0.php b/#jpgraph/src/Examples/matrix_ex0.php deleted file mode 100644 index 43777cf8..00000000 --- a/#jpgraph/src/Examples/matrix_ex0.php +++ /dev/null @@ -1,28 +0,0 @@ -title->Set('Basic matrix example'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -// Create a ,atrix plot using all default values -$mp = new MatrixPlot($data); -$graph->Add($mp); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_ex01.php b/#jpgraph/src/Examples/matrix_ex01.php deleted file mode 100644 index d0387dd1..00000000 --- a/#jpgraph/src/Examples/matrix_ex01.php +++ /dev/null @@ -1,38 +0,0 @@ -title->Set('Possible legend positions'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -$mp = array(); -$n = 4; -$pos = array(0.3,0.33, 0.8,0.68, - 0.3,0.68, 0.8,0.33); -for($i=0; $i < $n; ++$i){ - $mp[$i] = new MatrixPlot($data); - $mp[$i]->colormap->SetMap($i); - $mp[$i]->SetModuleSize(4,5); - $mp[$i]->SetLegendLayout($i); - $mp[$i]->SetCenterPos($pos[$i*2],$pos[$i*2+1]); -} - -$graph->Add($mp); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_ex02.php b/#jpgraph/src/Examples/matrix_ex02.php deleted file mode 100644 index f81e59cd..00000000 --- a/#jpgraph/src/Examples/matrix_ex02.php +++ /dev/null @@ -1,32 +0,0 @@ -title->Set('Meshinterpolation=3'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -$mp = new MatrixPlot($data,1); -$mp->colormap->SetMap(0); -$mp->SetSize(200,160); -$mp->SetCenterPos(0.5,0.55); -$mp->legend->Show(false); -$graph->Add($mp); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_ex03.php b/#jpgraph/src/Examples/matrix_ex03.php deleted file mode 100644 index a943acd0..00000000 --- a/#jpgraph/src/Examples/matrix_ex03.php +++ /dev/null @@ -1,36 +0,0 @@ -title->Set('Adding an icon to the background'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -$mp = new MatrixPlot($data,1); -$mp->SetSize(0.6); - -$icon = new IconPlot('icon.jpg',$width-1,$height-1,0.8,50); -$icon->SetAnchor('right','bottom'); -$graph->Add($icon); - -$graph->Add($mp); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_ex04.1.php b/#jpgraph/src/Examples/matrix_ex04.1.php deleted file mode 100644 index 419a437a..00000000 --- a/#jpgraph/src/Examples/matrix_ex04.1.php +++ /dev/null @@ -1,40 +0,0 @@ -title->Set('Adding a background image'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->subtitle->Set('Alphablending = 0.2'); - -// Add a stretched background image -$graph->SetBackgroundImage('ironrod.jpg',BGIMG_FILLFRAME); -$graph->SetBackgroundImageMix(50); - -$mp = new MatrixPlot($data,1); -$mp->SetSize(0.65); -$mp->SetCenterPos(0.5,0.5); -$mp->SetLegendLayout(1); -$mp->SetAlpha(0.2); - -$graph->Add($mp); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_ex04.2.php b/#jpgraph/src/Examples/matrix_ex04.2.php deleted file mode 100644 index 6650444c..00000000 --- a/#jpgraph/src/Examples/matrix_ex04.2.php +++ /dev/null @@ -1,40 +0,0 @@ -title->Set('Adding a background image'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->subtitle->Set('Alphablending = 0.7'); - -// Add a stretched background image -$graph->SetBackgroundImage('ironrod.jpg',BGIMG_FILLFRAME); -$graph->SetBackgroundImageMix(50); - -$mp = new MatrixPlot($data,1); -$mp->SetSize(0.65); -$mp->SetCenterPos(0.5,0.5); -$mp->SetLegendLayout(1); -$mp->SetAlpha(0.7); - -$graph->Add($mp); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_ex04.php b/#jpgraph/src/Examples/matrix_ex04.php deleted file mode 100644 index 2917f15c..00000000 --- a/#jpgraph/src/Examples/matrix_ex04.php +++ /dev/null @@ -1,38 +0,0 @@ -title->Set('Adding a background image'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -// Add a stretched background image -$graph->SetBackgroundImage('ironrod.jpg',BGIMG_FILLFRAME); -$graph->SetBackgroundImageMix(50); - -$mp = new MatrixPlot($data,1); -$mp->SetSize(0.6); -$mp->SetCenterPos(0.5,0.5); -$mp->SetLegendLayout(1); - -$graph->Add($mp); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_ex05.php b/#jpgraph/src/Examples/matrix_ex05.php deleted file mode 100644 index d3f989ea..00000000 --- a/#jpgraph/src/Examples/matrix_ex05.php +++ /dev/null @@ -1,31 +0,0 @@ -title->Set('Using a circular module type'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -$mp = new MatrixPlot($data,2); -$mp->SetSize(0.85); -$mp->SetModuleType(1); -$mp->SetBackgroundColor('teal:1.8'); -$mp->SetCenterPos(0.5,0.45); -$mp->SetLegendLayout(1); - -$graph->Add($mp); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_ex06.php b/#jpgraph/src/Examples/matrix_ex06.php deleted file mode 100644 index 7c3d4727..00000000 --- a/#jpgraph/src/Examples/matrix_ex06.php +++ /dev/null @@ -1,75 +0,0 @@ -SetBackgroundGradient('lightsteelblue:0.8','lightsteelblue:0.3'); -$graph->title->Set('Matrix with lines'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,18); -$graph->title->SetColor('white'); - -// Create two lines to add as markers -$l1 = new PlotLine(VERTICAL, 5, 'lightgray:1.5', 4); -$l2 = new PlotLine(HORIZONTAL, 3, 'lightgray:1.5', 4); - -// Create one matrix plot -$mp = new MatrixPlot($data,1); -$mp->SetModuleSize(13,15); -$mp->SetCenterPos(0.35,0.6); -$mp->colormap->SetNullColor('gray'); - -// Add lines -$mp->AddLine($l1); -$mp->AddLine($l2); -// this could also be done as -// $mp->AddLine(array($l1,$l2)); - -// Setup column lablels -$mp->collabel->Set($collabels); -$mp->collabel->SetSide('top'); -$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,8); -$mp->collabel->SetFontColor('lightgray'); - -// Setup row lablels -$mp->rowlabel->Set($rowlabels); -$mp->rowlabel->SetSide('right'); -$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,8); -$mp->rowlabel->SetFontColor('lightgray'); - -// Move the legend more to the right -$mp->legend->SetMargin(90); -$mp->legend->SetColor('white'); -$mp->legend->SetFont(FF_VERDANA,FS_BOLD,10); - -$graph->Add($mp); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrix_introex.php b/#jpgraph/src/Examples/matrix_introex.php deleted file mode 100644 index fcecc40c..00000000 --- a/#jpgraph/src/Examples/matrix_introex.php +++ /dev/null @@ -1,89 +0,0 @@ -Push(); - -//-------------------------------------------------------------- -// Setup a basic matrix graph -//-------------------------------------------------------------- -$width = 740; $height = 500; -$graph = new MatrixGraph($width,$height); -$graph->SetMargin(1,2,70,1); -$graph->SetColor('white'); -$graph->SetMarginColor('#fafafa'); -$graph->title->Set('Intro matrix graph'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -// Setup the background image -$graph->SetBackgroundImage('fireplace.jpg',BGIMG_FILLPLOT); -$graph->SetBackgroundImageMix(50); - -// Setup the timer in the right footer -$graph->footer->SetTimer($timer); -$graph->footer->right->SetColor('white'); - -//-------------------------------------------------------------- -// Create the 2 matrix plots -//-------------------------------------------------------------- -$mp = array(); $n = 2; -for($i=0; $i < $n; ++$i){ - $mp[$i] = new MatrixPlot($data); - $mp[$i]->colormap->SetMap($i); - $mp[$i]->SetSize(300,250); - $mp[$i]->SetLegendLayout(1); - $mp[$i]->SetAlpha(0.2); - - // Make the legend slightly longer than default - $mp[$i]->legend->SetSize(20,280); -} -$mp[1]->colormap->SetMap(3); - -$hor1 = new LayoutHor(array($mp[0],$mp[1])); -$hor1->SetCenterPos(0.5,0.5); - -$graph->Add($hor1); - -//-------------------------------------------------------------- -// Add texts to the graph -//-------------------------------------------------------------- -$txts = array( - array('Temperature gradient',$width/2,80), - array('Heat color map',200,110), - array('High contrast map',560,110)); - -$n=count($txts); -$t=array(); -for($i=0; $i < $n; ++$i){ - $t[$i] = new Text($txts[$i][0],$txts[$i][1],$txts[$i][2]); - $t[$i]->SetFont(FF_ARIAL,FS_BOLD,14); - $t[$i]->SetColor('white'); - $t[$i]->SetAlign('center','top'); -} -$graph->Add($t); - -//-------------------------------------------------------------- -// Add Jpgraph logo to top left corner -//-------------------------------------------------------------- -$icon = new IconPlot('jpglogo.jpg',2,2,0.9,50); -$graph->Add($icon); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/matrix_layout_ex1.php b/#jpgraph/src/Examples/matrix_layout_ex1.php deleted file mode 100644 index 1fefb1a8..00000000 --- a/#jpgraph/src/Examples/matrix_layout_ex1.php +++ /dev/null @@ -1,44 +0,0 @@ -title->Set('Matrix layout example'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -$mp = array(); -$n = 5; -for($i=0; $i < $n; ++$i){ - $mp[$i] = new MatrixPlot($data); - $mp[$i]->colormap->SetMap($i); - if( $i < 2 ) - $mp[$i]->SetSize(0.35); - else - $mp[$i]->SetSize(0.21); - // We need to make the legend a bit smaller since by - // defalt has a ~45% height - $mp[$i]->legend->SetModuleSize(15,2); -} - -$hor1 = new LayoutHor(array($mp[0],$mp[1])); -$hor2 = new LayoutHor(array($mp[2],$mp[3],$mp[4])); -$vert = new LayoutVert(array($hor1,$hor2)); -$vert->SetCenterPos(0.45,0.5); - -$graph->Add($vert); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/matrixex00.php b/#jpgraph/src/Examples/matrixex00.php deleted file mode 100644 index 2ba5114a..00000000 --- a/#jpgraph/src/Examples/matrixex00.php +++ /dev/null @@ -1,59 +0,0 @@ -title->Set('Matrix example 00'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -//$graph->SetColor('darkgreen@0.8'); - -$mp = array(); -$n = 5; -for($i=0; $i < $n; ++$i){ - $mp[$i] = new MatrixPlot($data); - $mp[$i]->colormap->SetMap($i); - if( $i < 2 ) - $mp[$i]->SetSize(0.35); - else - $mp[$i]->SetSize(0.21); -} - -$hor1 = new LayoutHor(array($mp[0],$mp[1])); -$hor2 = new LayoutHor(array($mp[2],$mp[3],$mp[4])); -$vert = new LayoutVert(array($hor1,$hor2)); -$vert->SetCenterPos(0.45,0.5); - -//$mp = new MatrixPlot($data); -//$mp->colormap->SetMap(2); -//$mp->SetCenterPos(0.5, 0.45); -//$mp->SetLegendLayout(0); -//$mp->SetSize(0.6); -//$mp->legend->Show(false); -//$mp->SetModuleSize(5,5); - -//$mp->legend->SetModuleSize(20,4); -//$mp->legend->SetSize(20,0.5); - -//$t = new Text('A text string',10,10); -//$graph->Add($t); - -//$graph->Add($mp); - -$graph->Add($vert); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/mkgrad.php b/#jpgraph/src/Examples/mkgrad.php deleted file mode 100644 index 3f36b44a..00000000 --- a/#jpgraph/src/Examples/mkgrad.php +++ /dev/null @@ -1,171 +0,0 @@ -iColors = array_keys($rgb->rgb_table); - usort($this->iColors,'_cmp'); - - $this->iGradstyles = array( - "Vertical",2, - "Horizontal",1, - "Vertical from middle",3, - "Horizontal from middle",4, - "Horizontal wider middle",6, - "Vertical wider middle",7, - "Rectangle",5 ); - } - - function Run() { - - echo '

Generate gradient background

'; - echo '
'; - echo ''; - echo "\n"; - echo ''; - echo "\n"; - echo ''; - echo ''; - echo ''; - echo ''; - echo '
Width:
'.$this->GenHTMLInput('w',8,4,300).'
Height:
'.$this->GenHTMLInput('h',8,4,300).'
From Color:
'; - echo $this->GenHTMLSelect('fc',$this->iColors); - echo '
To Color:
'; - echo $this->GenHTMLSelect('tc',$this->iColors); - echo '
Gradient style:
'; - echo $this->GenHTMLSelectCode('s',$this->iGradstyles); - echo '
Filename: (empty to stream)
'; - echo $this->GenHTMLInput('fn',55,100); - echo '
'.$this->GenHTMLSubmit('submit').'
'; - echo '
'; - - } - - function GenHTMLSubmit($name) { - return ''; - } - - - function GenHTMLInput($name,$len,$maxlen=100,$val='') { - return ''; - } - - function GenHTMLSelect($name,$option,$selected="",$size=0) { - $txt="\n"; - } - - function GenHTMLSelectCode($name,$option,$selected="",$size=0) { - $txt="\n"; - } - -} - -// Basic application driver - -class Driver { - var $iGraph, $iGrad; - var $iWidth,$iHeight; - var $iFromColor, $iToColor; - var $iStyle; - var $iForm; - - function Driver() { - $this->iForm = new Form(); - } - - function GenGradImage() { - - $aWidth = (int)@$_POST['w']; - $aHeight = (int)@$_POST['h']; - $aFrom = @$_POST['fc']; - $aTo = @$_POST['tc']; - $aStyle = @$_POST['s']; - $aFileName = @$_POST['fn']; - - $this->iWidth = $aWidth; - $this->iHeight = $aHeight; - $this->iFromColor = $aFrom; - $this->iToColor = $aTo; - $this->iStyle = $aStyle; - - $this->graph = new CanvasGraph($aWidth,$aHeight); - $this->grad = new Gradient($this->graph->img); - $this->grad->FilledRectangle(0,0, - $this->iWidth,$this->iHeight, - $this->iFromColor, - $this->iToColor, - $this->iStyle); - - if( $aFileName != "" ) { - $this->graph->Stroke($aFileName); - echo "Image file '$aFileName' created."; - } - else - $this->graph->Stroke(); - } - - - function Run() { - - global $HTTP_POST_VARS; - - // Two modes: - // 1) If the script is called with no posted arguments - // we show the input form. - // 2) If we have posted arguments we naivly assume that - // we are called to do the image. - - if( @$_POST['ok']===' Ok ' ) { - $this->GenGradImage(); - } - else - $this->iForm->Run(); - } -} - -$driver = new Driver(); -$driver->Run(); - -?> diff --git a/#jpgraph/src/Examples/multconstganttex01.php b/#jpgraph/src/Examples/multconstganttex01.php deleted file mode 100644 index fce986e2..00000000 --- a/#jpgraph/src/Examples/multconstganttex01.php +++ /dev/null @@ -1,30 +0,0 @@ -title->Set("Example with multiple constrains"); - -$bar1 = new GanttBar(0, "Label 1", "2003-06-08", "2003-06-12"); -$bar2 = new GanttBar(1, "Label 2", "2003-06-16", "2003-06-19"); -$bar3 = new GanttBar(2, "Label 3", "2003-06-15", "2003-06-21"); - -//create constraints -$bar1->SetConstrain(1, CONSTRAIN_ENDSTART); -$bar1->SetConstrain(2, CONSTRAIN_ENDSTART); - -// Setup scale -$graph->ShowHeaders(/*GANTT_HYEAR | GANTT_HMONTH |*/ GANTT_HDAY | GANTT_HWEEK); -$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR); - -// Add the specified activities -$graph->Add($bar1); -$graph->Add($bar2); -$graph->Add($bar3); - -// .. and stroke the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/mulyaxiscsimex1.php b/#jpgraph/src/Examples/mulyaxiscsimex1.php deleted file mode 100644 index 516aea34..00000000 --- a/#jpgraph/src/Examples/mulyaxiscsimex1.php +++ /dev/null @@ -1,75 +0,0 @@ -SetMargin(60,180,50,40); -$graph->SetMarginColor('white'); -$graph->title->Set("Multi Y-axes with Image Map"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Setup the scales for all axes -$graph->SetScale("intlin"); -$graph->SetYScale(0,'int'); -$graph->SetYScale(1,'int'); - -// Standard Y-axis plot -$lp1 = new LinePlot($datay1); -$lp1->SetLegend('2001'); -$lp1->mark->SetType(MARK_DIAMOND); -$lp1->mark->SetWidth(15); -$lp1->mark->SetFillColor('orange'); -$lp1->SetCSIMTargets($targ1,$alts1); -$graph->yaxis->title->Set('Basic Rate'); -$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->yaxis->title->SetColor('black'); -$graph->Add($lp1); - -// First multi Y-axis plot -$lp2 = new LinePlot($datay2); -$lp2->SetLegend('2002'); -$lp2->mark->SetType(MARK_DIAMOND); -$lp2->mark->SetWidth(15); -$lp2->mark->SetFillColor('darkred'); -$lp2->SetCSIMTargets($targ2,$alts2); -$graph->ynaxis[0]->SetColor('darkred'); -$graph->ynaxis[0]->title->Set('Rate A'); -$graph->ynaxis[0]->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->ynaxis[0]->title->SetColor('darkred'); -$graph->AddY(0,$lp2); - -// Second multi Y-axis plot -$lp3 = new LinePlot($datay3); -$lp3->SetLegend('2003'); -$lp3->mark->SetType(MARK_DIAMOND); -$lp3->mark->SetWidth(15); -$lp3->mark->SetFillColor('darkgreen'); -$lp3->SetCSIMTargets($targ3,$alts3); -$graph->ynaxis[1]->SetColor('darkgreen'); -$graph->ynaxis[1]->title->Set('Rate B'); -$graph->ynaxis[1]->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->ynaxis[1]->title->SetColor('darkgreen'); -$graph->AddY(1,$lp3); - -// Send back the HTML page which will call this script again -// to retrieve the image. -$graph->StrokeCSIM(); -?> diff --git a/#jpgraph/src/Examples/mulyaxisex1.php b/#jpgraph/src/Examples/mulyaxisex1.php deleted file mode 100644 index 57304eba..00000000 --- a/#jpgraph/src/Examples/mulyaxisex1.php +++ /dev/null @@ -1,48 +0,0 @@ -SetMargin(40,150,40,30); -$graph->SetMarginColor('white'); - -$graph->SetScale('intlin'); -$graph->title->Set('Using multiple Y-axis'); -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,14); - -$graph->SetYScale(0,'lin'); -$graph->SetYScale(1,'lin'); -$graph->SetYScale(2,'lin'); - -$p1 = new LinePlot($datay); -$graph->Add($p1); - -$p2 = new LinePlot($datay2); -$p2->SetColor('teal'); -$graph->AddY(0,$p2); -$graph->ynaxis[0]->SetColor('teal'); - -$p3 = new LinePlot($datay3); -$p3->SetColor('red'); -$graph->AddY(1,$p3); -$graph->ynaxis[1]->SetColor('red'); - -$p4 = new LinePlot($datay4); -$p4->SetColor('blue'); -$graph->AddY(2,$p4); -$graph->ynaxis[2]->SetColor('blue'); - -// Output line -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/negbarvalueex01.php b/#jpgraph/src/Examples/negbarvalueex01.php deleted file mode 100644 index f825a59c..00000000 --- a/#jpgraph/src/Examples/negbarvalueex01.php +++ /dev/null @@ -1,39 +0,0 @@ -img->SetMargin(60,30,40,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); - -// DIsplay value at top of each bar -$bplot->value->Show(); -$bplot->SetShadow(); - -$graph->Add($bplot); - -// Position the scale at the min of the other axis -$graph->xaxis->SetPos("min"); - -// Add 10% more space at top and bottom of graph -$graph->yscale->SetGrace(10,10); - -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,12); -$graph->title->Set("Example of bar plot with absolute labels"); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,16); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/new1.gif b/#jpgraph/src/Examples/new1.gif deleted file mode 100644 index 7c8a2962..00000000 Binary files a/#jpgraph/src/Examples/new1.gif and /dev/null differ diff --git a/#jpgraph/src/Examples/new2.gif b/#jpgraph/src/Examples/new2.gif deleted file mode 100644 index b9620d74..00000000 Binary files a/#jpgraph/src/Examples/new2.gif and /dev/null differ diff --git a/#jpgraph/src/Examples/new_bar1.php b/#jpgraph/src/Examples/new_bar1.php deleted file mode 100644 index 589b4c38..00000000 --- a/#jpgraph/src/Examples/new_bar1.php +++ /dev/null @@ -1,49 +0,0 @@ -SetScale("textlin"); - -$theme_class=new UniversalTheme; -$graph->SetTheme($theme_class); - -$graph->yaxis->SetTickPositions(array(0,30,60,90,120,150), array(15,45,75,105,135)); -$graph->SetBox(false); - -$graph->ygrid->SetFill(false); -$graph->xaxis->SetTickLabels(array('A','B','C','D')); -$graph->yaxis->HideLine(false); -$graph->yaxis->HideTicks(false,false); - -// Create the bar plots -$b1plot = new BarPlot($data1y); -$b2plot = new BarPlot($data2y); -$b3plot = new BarPlot($data3y); - -// Create the grouped bar plot -$gbplot = new GroupBarPlot(array($b1plot,$b2plot,$b3plot)); -// ...and add it to the graPH -$graph->Add($gbplot); - - -$b1plot->SetColor("white"); -$b1plot->SetFillColor("#cc1111"); - -$b2plot->SetColor("white"); -$b2plot->SetFillColor("#11cccc"); - -$b3plot->SetColor("white"); -$b3plot->SetFillColor("#1111cc"); - -$graph->title->Set("Bar Plots"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/new_bar3.php b/#jpgraph/src/Examples/new_bar3.php deleted file mode 100644 index 2d8b9e65..00000000 --- a/#jpgraph/src/Examples/new_bar3.php +++ /dev/null @@ -1,39 +0,0 @@ -SetScale("textlin"); - -//$theme_class="DefaultTheme"; -//$graph->SetTheme(new $theme_class()); - -// set major and minor tick positions manually -$graph->yaxis->SetTickPositions(array(0,30,60,90,120,150), array(15,45,75,105,135)); -$graph->SetBox(false); - -//$graph->ygrid->SetColor('gray'); -$graph->ygrid->SetFill(false); -$graph->xaxis->SetTickLabels(array('A','B','C','D')); -$graph->yaxis->HideLine(false); -$graph->yaxis->HideTicks(false,false); - -// Create the bar plots -$b1plot = new BarPlot($datay); - -// ...and add it to the graPH -$graph->Add($b1plot); - - -$b1plot->SetColor("white"); -$b1plot->SetFillGradient("#4B0082","white",GRAD_LEFT_REFLECTION); -$b1plot->SetWidth(45); -$graph->title->Set("Bar Gradient(Left reflection)"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/new_bar4.php b/#jpgraph/src/Examples/new_bar4.php deleted file mode 100644 index 8415c09f..00000000 --- a/#jpgraph/src/Examples/new_bar4.php +++ /dev/null @@ -1,43 +0,0 @@ -SetScale("textlin"); - -$theme_class=new UniversalTheme; -$graph->SetTheme($theme_class); - -$graph->Set90AndMargin(50,40,40,40); -$graph->img->SetAngle(90); - -// set major and minor tick positions manually -$graph->SetBox(false); - -//$graph->ygrid->SetColor('gray'); -$graph->ygrid->Show(false); -$graph->ygrid->SetFill(false); -$graph->xaxis->SetTickLabels(array('A','B','C','D','E','F')); -$graph->yaxis->HideLine(false); -$graph->yaxis->HideTicks(false,false); - -// For background to be gradient, setfill is needed first. -$graph->SetBackgroundGradient('#00CED1', '#FFFFFF', GRAD_HOR, BGRAD_PLOT); - -// Create the bar plots -$b1plot = new BarPlot($datay); - -// ...and add it to the graPH -$graph->Add($b1plot); - -$b1plot->SetWeight(0); -$b1plot->SetFillGradient("#808000","#90EE90",GRAD_HOR); -$b1plot->SetWidth(17); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/new_bar6.php b/#jpgraph/src/Examples/new_bar6.php deleted file mode 100644 index a439ec76..00000000 --- a/#jpgraph/src/Examples/new_bar6.php +++ /dev/null @@ -1,103 +0,0 @@ -SetScale("textlin"); -$graph->SetY2Scale("lin",0,90); -$graph->SetY2OrderBack(false); - -$graph->SetMargin(35,50,20,5); - -$theme_class = new UniversalTheme; -$graph->SetTheme($theme_class); - -$graph->yaxis->SetTickPositions(array(0,50,100,150,200,250,300,350), array(25,75,125,175,275,325)); -$graph->y2axis->SetTickPositions(array(30,40,50,60,70,80,90)); - -$months = $gDateLocale->GetShortMonth(); -$months = array_merge(array_slice($months,3,9), array_slice($months,0,3)); -$graph->SetBox(false); - -$graph->ygrid->SetFill(false); -$graph->xaxis->SetTickLabels(array('A','B','C','D')); -$graph->yaxis->HideLine(false); -$graph->yaxis->HideTicks(false,false); -// Setup month as labels on the X-axis -$graph->xaxis->SetTickLabels($months); - -// Create the bar plots -$b1plot = new BarPlot($data1y); -$b2plot = new BarPlot($data2y); - -$b3plot = new BarPlot($data3y); -$b4plot = new BarPlot($data4y); -$b5plot = new BarPlot($data5y); - -$lplot = new LinePlot($data6y); - -// Create the grouped bar plot -$gbbplot = new AccBarPlot(array($b3plot,$b4plot,$b5plot)); -$gbplot = new GroupBarPlot(array($b1plot,$b2plot,$gbbplot)); - -// ...and add it to the graPH -$graph->Add($gbplot); -$graph->AddY2($lplot); - -$b1plot->SetColor("#0000CD"); -$b1plot->SetFillColor("#0000CD"); -$b1plot->SetLegend("Cliants"); - -$b2plot->SetColor("#B0C4DE"); -$b2plot->SetFillColor("#B0C4DE"); -$b2plot->SetLegend("Machines"); - -$b3plot->SetColor("#8B008B"); -$b3plot->SetFillColor("#8B008B"); -$b3plot->SetLegend("First Track"); - -$b4plot->SetColor("#DA70D6"); -$b4plot->SetFillColor("#DA70D6"); -$b4plot->SetLegend("All"); - -$b5plot->SetColor("#9370DB"); -$b5plot->SetFillColor("#9370DB"); -$b5plot->SetLegend("Single Only"); - -$lplot->SetBarCenter(); -$lplot->SetColor("yellow"); -$lplot->SetLegend("Houses"); -$lplot->mark->SetType(MARK_X,'',1.0); -$lplot->mark->SetWeight(2); -$lplot->mark->SetWidth(8); -$lplot->mark->setColor("yellow"); -$lplot->mark->setFillColor("yellow"); - -$graph->legend->SetFrameWeight(1); -$graph->legend->SetColumns(6); -$graph->legend->SetColor('#4E4E4E','#00A78A'); - -$band = new PlotBand(VERTICAL,BAND_RDIAG,11,"max",'khaki4'); -$band->ShowFrame(true); -$band->SetOrder(DEPTH_BACK); -$graph->Add($band); - -$graph->title->Set("Combineed Line and Bar plots"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/new_line1.php b/#jpgraph/src/Examples/new_line1.php deleted file mode 100644 index 7a8ae660..00000000 --- a/#jpgraph/src/Examples/new_line1.php +++ /dev/null @@ -1,57 +0,0 @@ -SetScale("textlin"); - -$theme_class=new UniversalTheme; - -$graph->SetTheme($theme_class); -$graph->img->SetAntiAliasing(false); -$graph->title->Set('Filled Y-grid'); -$graph->SetBox(false); - -$graph->img->SetAntiAliasing(); - -$graph->yaxis->HideZeroLabel(); -$graph->yaxis->HideLine(false); -$graph->yaxis->HideTicks(false,false); - -$graph->xgrid->Show(); -$graph->xgrid->SetLineStyle("solid"); -$graph->xaxis->SetTickLabels(array('A','B','C','D')); -$graph->xgrid->SetColor('#E3E3E3'); -/* $graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLPLOT); */ - -// Create the first line -$p1 = new LinePlot($datay1); -$graph->Add($p1); -$p1->SetColor("#6495ED"); -$p1->SetLegend('Line 1'); - -// Create the second line -$p2 = new LinePlot($datay2); -$graph->Add($p2); -$p2->SetColor("#B22222"); -$p2->SetLegend('Line 2'); - -// Create the third line -$p3 = new LinePlot($datay3); -$graph->Add($p3); -$p3->SetColor("#FF1493"); -$p3->SetLegend('Line 3'); - -$graph->legend->SetFrameWeight(1); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/new_line2.php b/#jpgraph/src/Examples/new_line2.php deleted file mode 100644 index 8ccd2710..00000000 --- a/#jpgraph/src/Examples/new_line2.php +++ /dev/null @@ -1,57 +0,0 @@ -SetScale("textlin"); - -$theme_class= new UniversalTheme; -$graph->SetTheme($theme_class); - -$graph->title->Set('Background Image'); -$graph->SetBox(false); - -$graph->yaxis->HideZeroLabel(); -$graph->yaxis->HideLine(false); -$graph->yaxis->HideTicks(false,false); - -$graph->xaxis->SetTickLabels(array('A','B','C','D')); -$graph->ygrid->SetFill(false); -$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); - -$p1 = new LinePlot($datay1); -$graph->Add($p1); - -$p2 = new LinePlot($datay2); -$graph->Add($p2); - -$p1->SetColor("#55bbdd"); -$p1->SetLegend('Line 1'); -$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0); -$p1->mark->SetColor('#55bbdd'); -$p1->mark->SetFillColor('#55bbdd'); -$p1->SetCenter(); - -$p2->SetColor("#aaaaaa"); -$p2->SetLegend('Line 2'); -$p2->mark->SetType(MARK_UTRIANGLE,'',1.0); -$p2->mark->SetColor('#aaaaaa'); -$p2->mark->SetFillColor('#aaaaaa'); -$p2->value->SetMargin(14); -$p2->SetCenter(); - -$graph->legend->SetFrameWeight(1); -$graph->legend->SetColor('#4E4E4E','#00A78A'); -$graph->legend->SetMarkAbsSize(8); - - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/new_line3.php b/#jpgraph/src/Examples/new_line3.php deleted file mode 100644 index cc0ab3e5..00000000 --- a/#jpgraph/src/Examples/new_line3.php +++ /dev/null @@ -1,46 +0,0 @@ -SetScale("textlin",0,50); - -//$theme_class=new DefaultTheme; -//$graph->SetTheme($theme_class); - -$graph->title->Set("Filled Area"); - -$graph->SetBox(false); -$graph->yaxis->HideLine(false); -$graph->yaxis->HideTicks(false,false); -$graph->yaxis->HideZeroLabel(); - -$graph->xaxis->SetTickLabels(array('A','B','C','D','E','F','G')); - -// Create the plot -$p1 = new LinePlot($datay1); -$graph->Add($p1); - -$p2 = new LinePlot($datay2); -$graph->Add($p2); - -// Use an image of favourite car as marker -$p1->mark->SetType(MARK_IMG,'rose.gif',1.0); -$p1->SetLegend('rose'); -$p1->SetColor('#CD5C5C'); - -$p2->mark->SetType(MARK_IMG,'sunflower.gif',1.0); -$p2->SetLegend('sunflower'); -$p2->SetColor('#CD5C5C'); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/new_line4.php b/#jpgraph/src/Examples/new_line4.php deleted file mode 100644 index f50921ea..00000000 --- a/#jpgraph/src/Examples/new_line4.php +++ /dev/null @@ -1,49 +0,0 @@ -SetScale("textlin",0,50); - -$theme_class= new UniversalTheme; -$graph->SetTheme($theme_class); - -$graph->title->Set("Line Plots with Markers"); - -$graph->SetBox(false); -$graph->ygrid->SetFill(false); -$graph->yaxis->HideLine(false); -$graph->yaxis->HideTicks(false,false); -$graph->yaxis->HideZeroLabel(); - -$graph->xaxis->SetTickLabels(array('A','B','C','D','E','F','G')); -// Create the plot -$p1 = new LinePlot($datay1); -$graph->Add($p1); - -$p2 = new LinePlot($datay2); -$graph->Add($p2); - -// Use an image of favourite car as marker -$p1->mark->SetType(MARK_IMG,'new1.gif',0.8); -$p1->SetColor('#aadddd'); -$p1->value->SetFormat('%d'); -$p1->value->Show(); -$p1->value->SetColor('#55bbdd'); - -$p2->mark->SetType(MARK_IMG,'new2.gif',0.8); -$p2->SetColor('#ddaa99'); -$p2->value->SetFormat('%d'); -$p2->value->Show(); -$p2->value->SetColor('#55bbdd'); - - -$graph->Stroke(); - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/new_line5.php b/#jpgraph/src/Examples/new_line5.php deleted file mode 100644 index 7a234a8c..00000000 --- a/#jpgraph/src/Examples/new_line5.php +++ /dev/null @@ -1,44 +0,0 @@ -SetScale("intlin",0,$aYMax=50); - -$theme_class= new UniversalTheme; -$graph->SetTheme($theme_class); - -$graph->SetMargin(40,40,50,40); - -$graph->title->Set('Inverted Y-axis'); -$graph->SetBox(false); -$graph->yaxis->HideLine(false); -$graph->yaxis->HideTicks(false,false); - -// For background to be gradient, setfill is needed first. -$graph->ygrid->SetFill(true,'#FFFFFF@0.5','#FFFFFF@0.5'); -$graph->SetBackgroundGradient('#FFFFFF', '#00FF7F', GRAD_HOR, BGRAD_PLOT); - -$graph->xaxis->SetTickLabels(array('G','F','E','D','C','B','A')); -$graph->xaxis->SetLabelMargin(20); -$graph->yaxis->SetLabelMargin(20); - -$graph->SetAxisStyle(AXSTYLE_BOXOUT); -$graph->img->SetAngle(180); - -// Create the line -$p1 = new LinePlot($datay); -$graph->Add($p1); - -$p1->SetFillGradient('#FFFFFF','#F0F8FF'); -$p1->SetColor('#aadddd'); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/new_pie1.php b/#jpgraph/src/Examples/new_pie1.php deleted file mode 100644 index 3c395e88..00000000 --- a/#jpgraph/src/Examples/new_pie1.php +++ /dev/null @@ -1,28 +0,0 @@ -SetTheme(new $theme_class()); - -// Set A title for the plot -$graph->title->Set("A Simple Pie Plot"); -$graph->SetBox(true); - -// Create -$p1 = new PiePlot($data); -$graph->Add($p1); - -$p1->ShowBorder(); -$p1->SetColor('black'); -$p1->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/new_pie2.php b/#jpgraph/src/Examples/new_pie2.php deleted file mode 100644 index 6e94cbff..00000000 --- a/#jpgraph/src/Examples/new_pie2.php +++ /dev/null @@ -1,55 +0,0 @@ -SetShadow(); - -$theme_class= new UniversalTheme; -//$graph->SetTheme($theme_class); - -// Set A title for the plot -$graph->title->Set("Multiple - Pie plot"); - -// Create plots -$size=0.13; -$p1 = new PiePlot($data); -$graph->Add($p1); - -$p1->SetSize($size); -$p1->SetCenter(0.25,0.32); -$p1->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); -$p1->title->Set("2005"); - -$p2 = new PiePlot($data); -$graph->Add($p2); - -$p2->SetSize($size); -$p2->SetCenter(0.65,0.32); -$p2->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); -$p2->title->Set("2006"); - -$p3 = new PiePlot($data); -$graph->Add($p3); - -$p3->SetSize($size); -$p3->SetCenter(0.25,0.75); -$p3->SetSliceColors(array('#6495ED','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); -$p3->title->Set("2007"); - -$p4 = new PiePlot($data); -$graph->Add($p4); - -$p4->SetSize($size); -$p4->SetCenter(0.65,0.75); -$p4->SetSliceColors(array('#6495ED','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); -$p4->title->Set("2008"); - - -$graph->Stroke(); - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/new_pie3.php b/#jpgraph/src/Examples/new_pie3.php deleted file mode 100644 index 81bc0f2a..00000000 --- a/#jpgraph/src/Examples/new_pie3.php +++ /dev/null @@ -1,28 +0,0 @@ -SetTheme($theme_class); - -// Set A title for the plot -$graph->title->Set("A Simple 3D Pie Plot"); - -// Create -$p1 = new PiePlot3D($data); -$graph->Add($p1); - -$p1->ShowBorder(); -$p1->SetColor('black'); -$p1->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#BA55D3')); -$p1->ExplodeSlice(1); -$graph->Stroke(); - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/new_pie4.php b/#jpgraph/src/Examples/new_pie4.php deleted file mode 100644 index 571f5ae6..00000000 --- a/#jpgraph/src/Examples/new_pie4.php +++ /dev/null @@ -1,65 +0,0 @@ -SetTheme(new $theme_class()); - -// Setup background -$graph->SetBackgroundImage('worldmap1.jpg',BGIMG_FILLFRAME); - -// Setup title -$graph->title->Set("Pie plots with background image"); -$graph->title->SetColor('white'); -$graph->SetTitleBackground('#4169E1',TITLEBKG_STYLE2,TITLEBKG_FRAME_FULL,'#4169E1',10,10,true); - -$p = array(); -// Create the plots -for( $i=0; $i < $n; ++$i ) { - $p[] = new PiePlot3D($data); -} -for( $i=0; $i < $n; ++$i ) { - $graph->Add($p[$i]); -} - -// Position the four pies and change color -for( $i=0; $i < $n; ++$i ) { - $p[$i]->SetCenter($piepos[2*$i],$piepos[2*$i+1]); - $p[$i]->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); -} - -// Set the titles -for( $i=0; $i < $n; ++$i ) { - $p[$i]->title->Set($titles[$i]); - #$p[$i]->title->SetFont(FF_ARIAL,FS_NORMAL,8); -} - -for( $i=0; $i < $n; ++$i ) { - $p[$i]->value->Show(false); -} - -// Size of pie in fraction of the width of the graph -for( $i=0; $i < $n; ++$i ) { - $p[$i]->SetSize(0.13); -} - -for( $i=0; $i < $n; ++$i ) { - $p[$i]->SetEdge(false); - $p[$i]->ExplodeSlice(1,7); -} - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/new_step1.php b/#jpgraph/src/Examples/new_step1.php deleted file mode 100644 index 7bd0ce50..00000000 --- a/#jpgraph/src/Examples/new_step1.php +++ /dev/null @@ -1,36 +0,0 @@ -SetScale("intlin",0,$aYMax=50); -$theme_class=new UniversalTheme; -$graph->SetTheme($theme_class); - -$graph->SetBox(false); - -$graph->title->Set('Step Line'); -$graph->ygrid->Show(true); -$graph->xgrid->Show(false); -$graph->yaxis->HideZeroLabel(); -$graph->ygrid->SetFill(true,'#FFFFFF@0.5','#FFFFFF@0.5'); -$graph->SetBackgroundGradient('blue', '#55eeff', GRAD_HOR, BGRAD_PLOT); -$graph->xaxis->SetTickLabels(array('A','B','C','D','E','F','G')); - -// Create the line -$p1 = new LinePlot($datay); -$graph->Add($p1); - -$p1->SetFillGradient('yellow','red'); -$p1->SetStepStyle(); -$p1->SetColor('#808000'); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/nullvalueex01.php b/#jpgraph/src/Examples/nullvalueex01.php deleted file mode 100644 index 33088117..00000000 --- a/#jpgraph/src/Examples/nullvalueex01.php +++ /dev/null @@ -1,56 +0,0 @@ -img->SetMargin(40,150,40,80); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -//Setup title -$graph->title->Set("Line plot with null values"); - -// Use built in font -$graph->title->SetFont(FF_ARIAL,FS_NORMAL,14); - -// Slightly adjust the legend from it's default position -$graph->legend->Pos(0.03,0.5,"right","center"); -$graph->legend->SetFont(FF_FONT1,FS_BOLD); - -// Setup X-scale -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8); -$graph->xaxis->SetLabelAngle(45); - -// Create the first line -$p1 = new LinePlot($datay); -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); -$p1->SetColor("blue"); -$p1->SetCenter(); -$p1->SetLegend("Undefined\nvariant 1"); -$graph->Add($p1); - -// ... and the second -$p2 = new LinePlot($data2y); -$p2->mark->SetType(MARK_STAR); -$p2->mark->SetFillColor("red"); -$p2->mark->SetWidth(4); -$p2->SetColor("red"); -$p2->SetCenter(); -$p2->SetLegend("Undefined\nvariant 2"); -$graph->Add($p2); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/ocean_example.php b/#jpgraph/src/Examples/ocean_example.php deleted file mode 100644 index 8a09d59c..00000000 --- a/#jpgraph/src/Examples/ocean_example.php +++ /dev/null @@ -1,58 +0,0 @@ - array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), - 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), - 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), - 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), - 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), - 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), - 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), - 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), - 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), -); - - -// Create the graph. These two calls are always required -$graph = new Graph(400,300); - -$graph->SetScale("textlin"); -if ($theme) { - $graph->SetTheme(new $theme()); -} -$theme_class = new OceanTheme; -$graph->SetTheme($theme_class); - -$plot = array(); -// Create the bar plots -for ($i = 0; $i < 4; $i++) { - $plot[$i] = new BarPlot($data[$i]); - $plot[$i]->SetLegend('plot'.($i+1)); -} -//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); -//$acc1->value->Show(); -$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); - -for ($i = 4; $i < 8; $i++) { - $plot[$i] = new LinePlot($data[$i]); - $plot[$i]->SetLegend('plot'.$i); - $plot[$i]->value->Show(); -} - -$graph->Add($gbplot); -$graph->Add($plot[4]); - -$title = "OceanTheme Example"; -$title = mb_convert_encoding($title,'UTF-8'); -$graph->title->Set($title); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/odoex00.php b/#jpgraph/src/Examples/odoex00.php deleted file mode 100644 index e8cef552..00000000 --- a/#jpgraph/src/Examples/odoex00.php +++ /dev/null @@ -1,47 +0,0 @@ -SetColor('white'); -$graph->SetMarginColor('white'); -$graph->SetFrame(false); - -//--------------------------------------------------------------------- -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -//--------------------------------------------------------------------- -$odo = new Odometer(); - -//--------------------------------------------------------------------- -// Set display value for the odometer -//--------------------------------------------------------------------- -$odo->needle->Set(40); - -//--------------------------------------------------------------------- -// Add the odometer to the graph -//--------------------------------------------------------------------- -$graph->Add($odo); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex01.php b/#jpgraph/src/Examples/odoex01.php deleted file mode 100644 index 3d29aa02..00000000 --- a/#jpgraph/src/Examples/odoex01.php +++ /dev/null @@ -1,69 +0,0 @@ -title->Set("Odometer title"); -$graph->title->SetColor("white"); -$graph->subtitle->Set("2002-02-13"); -$graph->subtitle->SetColor("white"); - -//--------------------------------------------------------------------- -// Specify caption. -// * (This is the text at the bottom of the graph.) The margins will -// automatically adjust to fit the height of the text. A caption -// may have multiple lines by including a '\n' character in the -// string. -//--------------------------------------------------------------------- -$graph->caption->Set("First caption row\n... second row"); -$graph->caption->SetColor("white"); - -//--------------------------------------------------------------------- -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -//--------------------------------------------------------------------- -$odo = new Odometer(); - -//--------------------------------------------------------------------- -// Set color indication between values 80 and 100 as red -//--------------------------------------------------------------------- -$odo->AddIndication(80,100,"red"); - -//--------------------------------------------------------------------- -// Set display value for the odometer -//--------------------------------------------------------------------- -$odo->needle->Set(30); - -//--------------------------------------------------------------------- -// Add the odometer to the graph -//--------------------------------------------------------------------- -$graph->Add($odo); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex010.php b/#jpgraph/src/Examples/odoex010.php deleted file mode 100644 index 3c70ad2f..00000000 --- a/#jpgraph/src/Examples/odoex010.php +++ /dev/null @@ -1,75 +0,0 @@ -AddIndication(80,100,"red"); -$odo2->AddIndication(20,30,"green"); -$odo2->AddIndication(65,100,"red"); -$odo3->AddIndication(60,90,"yellow"); -$odo3->AddIndication(90,100,"red"); - -//--------------------------------------------------------------------- -// Set display values for the odometers -//--------------------------------------------------------------------- -$odo1->needle->Set(17); -$odo2->needle->Set(47); -$odo3->needle->Set(86); - -$odo1->needle->SetFillColor("blue"); -$odo2->needle->SetFillColor("yellow:0.7"); -$odo3->needle->SetFillColor("black"); -$odo3->needle->SetColor("black"); - - -//--------------------------------------------------------------------- -// Set scale label properties -//--------------------------------------------------------------------- -$odo1->scale->label->SetColor("navy"); -$odo2->scale->label->SetColor("blue"); -$odo3->scale->label->SetColor("darkred"); - -$odo1->scale->label->SetFont(FF_FONT1); -$odo2->scale->label->SetFont(FF_FONT2,FS_BOLD); -$odo3->scale->label->SetFont(FF_ARIAL,FS_BOLD,11); - -//--------------------------------------------------------------------- -// Add the odometers to the graph using a vertical layout -//--------------------------------------------------------------------- -$l1 = new LayoutVert( array($odo1,$odo2,$odo3) ) ; -$graph->Add( $l1 ); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex011.php b/#jpgraph/src/Examples/odoex011.php deleted file mode 100644 index cc74f4f7..00000000 --- a/#jpgraph/src/Examples/odoex011.php +++ /dev/null @@ -1,108 +0,0 @@ -SetShadow(); - -//--------------------------------------------------------------------- -// Specify title and subtitle using default fonts -// * Note each title may be multilines by using a '\n' as a line -// divider. -//--------------------------------------------------------------------- -$graph->title->Set("Result from 2002"); -$graph->title->SetColor("white"); -$graph->subtitle->Set("O1 - W-Site"); -$graph->subtitle->SetColor("white"); - -//--------------------------------------------------------------------- -// Specify caption. -// * (This is the text at the bottom of the graph.) The margins will -// automatically adjust to fit the height of the text. A caption -// may have multiple lines by including a '\n' character in the -// string. -//--------------------------------------------------------------------- -$graph->caption->Set("Fig1. Values within 85%\nconfidence intervall"); -$graph->caption->SetColor("white"); - -//--------------------------------------------------------------------- -// We will display three odometers stacked vertically -// The first thing to do is to create them -//--------------------------------------------------------------------- -$odo1 = new Odometer(); -$odo2 = new Odometer(); -$odo3 = new Odometer(); - - -//--------------------------------------------------------------------- -// Set caption for each odometer -//--------------------------------------------------------------------- -$odo1->caption->Set("April"); -$odo1->caption->SetFont(FF_FONT2,FS_BOLD); -$odo2->caption->Set("May"); -$odo2->caption->SetFont(FF_FONT2,FS_BOLD); -$odo3->caption->Set("June"); -$odo3->caption->SetFont(FF_FONT2,FS_BOLD); - -//--------------------------------------------------------------------- -// Set Indicator bands for the odometers -//--------------------------------------------------------------------- -$odo1->AddIndication(80,100,"red"); -$odo2->AddIndication(20,30,"green"); -$odo2->AddIndication(65,100,"red"); -$odo3->AddIndication(60,90,"yellow"); -$odo3->AddIndication(90,100,"red"); - -//--------------------------------------------------------------------- -// Set display values for the odometers -//--------------------------------------------------------------------- -$odo1->needle->Set(17); -$odo2->needle->Set(47); -$odo3->needle->Set(86); - -$odo1->needle->SetFillColor("blue"); -$odo2->needle->SetFillColor("yellow:0.7"); -$odo3->needle->SetFillColor("black"); -$odo3->needle->SetColor("black"); - - -//--------------------------------------------------------------------- -// Set scale label properties -//--------------------------------------------------------------------- -$odo1->scale->label->SetColor("navy"); -$odo2->scale->label->SetColor("blue"); -$odo3->scale->label->SetColor("darkred"); - -$odo1->scale->label->SetFont(FF_FONT1); -$odo2->scale->label->SetFont(FF_FONT2,FS_BOLD); -$odo3->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); - -//--------------------------------------------------------------------- -// Add the odometers to the graph using a vertical layout -//--------------------------------------------------------------------- -$l1 = new LayoutVert( array($odo1,$odo2,$odo3) ) ; -$graph->Add( $l1 ); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex012.php b/#jpgraph/src/Examples/odoex012.php deleted file mode 100644 index b54f773d..00000000 --- a/#jpgraph/src/Examples/odoex012.php +++ /dev/null @@ -1,119 +0,0 @@ -SetShadow(); - -//--------------------------------------------------------------------- -// Specify title and subtitle using default fonts -// * Note each title may be multilines by using a '\n' as a line -// divider. -//--------------------------------------------------------------------- -$graph->title->Set("Result from 2002"); -$graph->title->SetColor("white"); -$graph->subtitle->Set("O1 - W-Site"); -$graph->subtitle->SetColor("white"); - -//--------------------------------------------------------------------- -// Specify caption. -// * (This is the text at the bottom of the graph.) The margins will -// automatically adjust to fit the height of the text. A caption -// may have multiple lines by including a '\n' character in the -// string. -//--------------------------------------------------------------------- -$graph->caption->Set("Fig1. Values within 85%\nconfidence intervall"); -$graph->caption->SetColor("white"); - -//--------------------------------------------------------------------- -// We will display two columns where the first column has -// three odometers (same as in example 11) and the second column -// has two odoemters -// The first thing to do is to create them -//--------------------------------------------------------------------- -$odo1 = new Odometer(); -$odo2 = new Odometer(); -$odo3 = new Odometer(); -$odo4 = new Odometer(); -$odo5 = new Odometer(); - - -//--------------------------------------------------------------------- -// Set caption for each odometer -//--------------------------------------------------------------------- -$odo1->caption->Set("April"); -$odo1->caption->SetFont(FF_ARIAL,FS_BOLD); -$odo2->caption->Set("May"); -$odo2->caption->SetFont(FF_FONT2,FS_BOLD); -$odo3->caption->Set("June"); -$odo3->caption->SetFont(FF_FONT2,FS_BOLD); -$odo4->caption->Set("Daily low average"); -$odo4->caption->SetFont(FF_FONT1,FS_BOLD); -$odo5->caption->Set("Daily high average"); -$odo5->caption->SetFont(FF_FONT1,FS_BOLD); - -//--------------------------------------------------------------------- -// Set Indicator bands for the odometers -//--------------------------------------------------------------------- -$odo1->AddIndication(80,100,"red"); -$odo2->AddIndication(20,30,"green"); -$odo2->AddIndication(65,100,"red"); -$odo3->AddIndication(60,90,"yellow"); -$odo3->AddIndication(90,100,"red"); - -//--------------------------------------------------------------------- -// Set display values for the odometers -//--------------------------------------------------------------------- -$odo1->needle->Set(17); -$odo2->needle->Set(47); -$odo3->needle->Set(86); -$odo4->needle->Set(22); -$odo5->needle->Set(77); - -$odo1->needle->SetFillColor("blue"); -$odo2->needle->SetFillColor("yellow:0.7"); -$odo3->needle->SetFillColor("black"); -$odo3->needle->SetColor("black"); - - -//--------------------------------------------------------------------- -// Set scale label properties -//--------------------------------------------------------------------- -$odo1->scale->label->SetColor("navy"); -$odo2->scale->label->SetColor("blue"); -$odo3->scale->label->SetColor("darkred"); - -$odo1->scale->label->SetFont(FF_FONT1); -$odo2->scale->label->SetFont(FF_FONT2,FS_BOLD); -$odo3->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); - -//--------------------------------------------------------------------- -// Add the odometers to the graph using a vertical layout -//--------------------------------------------------------------------- -$l1 = new LayoutVert( array($odo1,$odo2,$odo3) ) ; -$l2 = new LayoutVert( array($odo4,$odo5) ) ; -$l3 = new LayoutHor( array($l1,$l2) ); -$graph->Add( $l3 ); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex02.php b/#jpgraph/src/Examples/odoex02.php deleted file mode 100644 index 47ccc6ba..00000000 --- a/#jpgraph/src/Examples/odoex02.php +++ /dev/null @@ -1,71 +0,0 @@ -title->Set("Odometer title"); -$graph->title->SetColor("white"); -$graph->subtitle->Set("2002-02-13"); -$graph->subtitle->SetColor("white"); - -//--------------------------------------------------------------------- -// Specify caption. -// * (This is the text at the bottom of the graph.) The margins will -// automatically adjust to fit the height of the text. A caption -// may have multiple lines by including a '\n' character in the -// string. -//--------------------------------------------------------------------- -$graph->caption->Set("First caption row\n... second row"); -$graph->caption->SetColor("white"); - -//--------------------------------------------------------------------- -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -//--------------------------------------------------------------------- -$odo = new Odometer(); - -//--------------------------------------------------------------------- -// Set color indication -//--------------------------------------------------------------------- -$odo->AddIndication(0,50,"green"); -$odo->AddIndication(50,80,"yellow"); -$odo->AddIndication(80,100,"red"); - -//--------------------------------------------------------------------- -// Set display value for the odometer -//--------------------------------------------------------------------- -$odo->needle->Set(30); - -//--------------------------------------------------------------------- -// Add the odometer to the graph -//--------------------------------------------------------------------- -$graph->Add($odo); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex03.php b/#jpgraph/src/Examples/odoex03.php deleted file mode 100644 index 91ca401c..00000000 --- a/#jpgraph/src/Examples/odoex03.php +++ /dev/null @@ -1,83 +0,0 @@ -SetShadow(); - -//--------------------------------------------------------------------- -// Specify title and subtitle using default fonts -// * Note each title may be multilines by using a '\n' as a line -// divider. -//--------------------------------------------------------------------- -$graph->title->Set("Odometer title"); -$graph->title->SetColor("white"); -$graph->subtitle->Set("2002-02-13"); -$graph->subtitle->SetColor("white"); - -//--------------------------------------------------------------------- -// Specify caption. -// * (This is the text at the bottom of the graph.) The margins will -// automatically adjust to fit the height of the text. A caption -// may have multiple lines by including a '\n' character in the -// string. -//--------------------------------------------------------------------- -$graph->caption->Set("First caption row\n... second row"); -$graph->caption->SetColor("white"); - -//--------------------------------------------------------------------- -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -//--------------------------------------------------------------------- -$odo = new Odometer(); - -//--------------------------------------------------------------------- -// Set color indication -//--------------------------------------------------------------------- -$odo->AddIndication(0,50,"green"); -$odo->AddIndication(50,80,"yellow"); -$odo->AddIndication(80,100,"red"); - -//--------------------------------------------------------------------- -// Adjust scale ticks to be shown at 10 steps interval and scale -// labels at every second tick -//--------------------------------------------------------------------- -$odo->scale->SetTicks(10,2); - -//--------------------------------------------------------------------- -// Use a bold font for tick labels -//--------------------------------------------------------------------- -$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); - -//--------------------------------------------------------------------- -// Set display value for the odometer -//--------------------------------------------------------------------- -$odo->needle->Set(30); - -//--------------------------------------------------------------------- -// Add the odometer to the graph -//--------------------------------------------------------------------- -$graph->Add($odo); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex04.php b/#jpgraph/src/Examples/odoex04.php deleted file mode 100644 index 9955b7db..00000000 --- a/#jpgraph/src/Examples/odoex04.php +++ /dev/null @@ -1,96 +0,0 @@ -title->Set("Odometer title"); -$graph->title->SetColor("white"); -$graph->subtitle->Set("2002-02-13"); -$graph->subtitle->SetColor("white"); - -//--------------------------------------------------------------------- -// Specify caption. -// * (This is the text at the bottom of the graph.) The margins will -// automatically adjust to fit the height of the text. A caption -// may have multiple lines by including a '\n' character in the -// string. -//--------------------------------------------------------------------- -$graph->caption->Set("First caption row\n... second row"); -$graph->caption->SetColor("white"); - -//--------------------------------------------------------------------- -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -//--------------------------------------------------------------------- -$odo = new Odometer(); - -//--------------------------------------------------------------------- -// Set color indication -//--------------------------------------------------------------------- -$odo->AddIndication(0,50,"green"); -$odo->AddIndication(50,80,"yellow"); -$odo->AddIndication(80,100,"red"); - -//--------------------------------------------------------------------- -// Set the center area that will not be affected by the color bands -//--------------------------------------------------------------------- -$odo->SetCenterAreaWidth(0.4); // Fraction of radius - -//--------------------------------------------------------------------- -// Adjust scale ticks to be shown at 10 steps interval and scale -// labels at every second tick -//--------------------------------------------------------------------- -$odo->scale->SetTicks(10,2); - -//--------------------------------------------------------------------- -// Use a bold font for tick labels -//--------------------------------------------------------------------- -$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); - -//--------------------------------------------------------------------- -// Set display value for the odometer -//--------------------------------------------------------------------- -$odo->needle->Set(30); - -//--------------------------------------------------------------------- -// Set a new style for the needle -//--------------------------------------------------------------------- -$odo->needle->SetStyle(NEEDLE_STYLE_MEDIUM_TRIANGLE); -$odo->needle->SetLength(0.7); // Length as 70% of the radius -$odo->needle->SetFillColor("orange"); - - -//--------------------------------------------------------------------- -// Add the odometer to the graph -//--------------------------------------------------------------------- -$graph->Add($odo); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex05.php b/#jpgraph/src/Examples/odoex05.php deleted file mode 100644 index 379a06e9..00000000 --- a/#jpgraph/src/Examples/odoex05.php +++ /dev/null @@ -1,123 +0,0 @@ -SetColor("lightyellow"); - -//--------------------------------------------------------------------- -// Specify title and subtitle using default fonts -// * Note each title may be multilines by using a '\n' as a line -// divider. -//--------------------------------------------------------------------- -$graph->title->Set("Odometer title"); -$graph->title->SetColor("white"); -$graph->subtitle->Set("2002-02-13"); -$graph->subtitle->SetColor("white"); - -//--------------------------------------------------------------------- -// Specify caption. -// * (This is the text at the bottom of the graph.) The margins will -// automatically adjust to fit the height of the text. A caption -// may have multiple lines by including a '\n' character in the -// string. -//--------------------------------------------------------------------- -$graph->caption->Set("First caption row\n... second row"); -$graph->caption->SetColor("white"); - -//--------------------------------------------------------------------- -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -//--------------------------------------------------------------------- -$odo = new Odometer(); - -//--------------------------------------------------------------------- -// Set color indication -//--------------------------------------------------------------------- -$odo->AddIndication(0,50,"green"); -$odo->AddIndication(50,80,"yellow"); -$odo->AddIndication(80,100,"red"); - -//--------------------------------------------------------------------- -// Set the center area that will not be affected by the color bands -//--------------------------------------------------------------------- -$odo->SetCenterAreaWidth(0.4); // Fraction of radius - -//--------------------------------------------------------------------- -// Adjust scale ticks to be shown at 10 steps interval and scale -// labels at every second tick -//--------------------------------------------------------------------- -$odo->scale->SetTicks(10,2); - -//--------------------------------------------------------------------- -// Make the tick marks 2 pixel wide -//--------------------------------------------------------------------- -$odo->scale->SetTickWeight(2); - -//--------------------------------------------------------------------- -// Use a bold font for tick labels -//--------------------------------------------------------------------- -$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); - -//--------------------------------------------------------------------- -// Set display value for the odometer -//--------------------------------------------------------------------- -$odo->needle->Set(78); - -//--------------------------------------------------------------------- -// Specify scale caption. Note that depending on the position of the -// indicator needle this label might be partially hidden. -//--------------------------------------------------------------------- -$odo->label->Set("% Passed"); - -//--------------------------------------------------------------------- -// Set a new style for the needle -//--------------------------------------------------------------------- -$odo->needle->SetStyle(NEEDLE_STYLE_MEDIUM_TRIANGLE); -$odo->needle->SetLength(0.7); // Length as 70% of the radius -$odo->needle->SetFillColor("orange"); - -//--------------------------------------------------------------------- -// Setup the second indicator needle -//--------------------------------------------------------------------- -$odo->needle2->Set(24); -$odo->needle2->SetStyle(NEEDLE_STYLE_SMALL_TRIANGLE); -$odo->needle2->SetLength(0.55); // Length as 70% of the radius -$odo->needle2->SetFillColor("lightgray"); -$odo->needle2->Show(); - - -//--------------------------------------------------------------------- -// Add the odometer to the graph -//--------------------------------------------------------------------- -$graph->Add($odo); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex06.php b/#jpgraph/src/Examples/odoex06.php deleted file mode 100644 index 305a5eea..00000000 --- a/#jpgraph/src/Examples/odoex06.php +++ /dev/null @@ -1,122 +0,0 @@ -SetColor("lightyellow"); - -//--------------------------------------------------------------------- -// Specify title and subtitle using default fonts -// * Note each title may be multilines by using a '\n' as a line -// divider. -//--------------------------------------------------------------------- -$graph->title->Set("Odometer title"); -$graph->title->SetColor("white"); -$graph->subtitle->Set("2002-02-13"); -$graph->subtitle->SetColor("white"); - -//--------------------------------------------------------------------- -// Specify caption. -// * (This is the text at the bottom of the graph.) The margins will -// automatically adjust to fit the height of the text. A caption -// may have multiple lines by including a '\n' character in the -// string. -//--------------------------------------------------------------------- -$graph->caption->Set("First caption row\n... second row"); -$graph->caption->SetColor("white"); - -//--------------------------------------------------------------------- -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -//--------------------------------------------------------------------- -$odo = new Odometer(ODO_FULL); - -//--------------------------------------------------------------------- -// Set color indication -//--------------------------------------------------------------------- -$odo->AddIndication(0,50,"green"); -$odo->AddIndication(50,80,"yellow"); -$odo->AddIndication(80,100,"red"); - -//--------------------------------------------------------------------- -// Set the center area that will not be affected by the color bands -//--------------------------------------------------------------------- -$odo->SetCenterAreaWidth(0.4); // Fraction of radius - -//--------------------------------------------------------------------- -// Adjust scale ticks to be shown at 10 steps interval and scale -// labels at every second tick -//--------------------------------------------------------------------- -$odo->scale->SetTicks(10,2); - -//--------------------------------------------------------------------- -// Make the tick marks 2 pixel wide -//--------------------------------------------------------------------- -$odo->scale->SetTickWeight(2); - -//--------------------------------------------------------------------- -// Use a bold font for tick labels -//--------------------------------------------------------------------- -$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); - -//--------------------------------------------------------------------- -// Set display value for the odometer -//--------------------------------------------------------------------- -$odo->needle->Set(78); - -//--------------------------------------------------------------------- -// Specify scale caption. Note that depending on the position of the -// indicator needle this label might be partially hidden. -//--------------------------------------------------------------------- -$odo->label->Set("% Passed"); - -//--------------------------------------------------------------------- -// Set a new style for the needle -//--------------------------------------------------------------------- -$odo->needle->SetStyle(NEEDLE_STYLE_MEDIUM_TRIANGLE); -$odo->needle->SetLength(0.7); // Length as 70% of the radius -$odo->needle->SetFillColor("orange"); - -//--------------------------------------------------------------------- -// Setup the second indicator needle -//--------------------------------------------------------------------- -$odo->needle2->Set(24); -$odo->needle2->SetStyle(NEEDLE_STYLE_SMALL_TRIANGLE); -$odo->needle2->SetLength(0.55); // Length as 70% of the radius -$odo->needle2->SetFillColor("lightgray"); -$odo->needle2->Show(); - - -//--------------------------------------------------------------------- -// Add the odometer to the graph -//--------------------------------------------------------------------- -$graph->Add($odo); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex07.php b/#jpgraph/src/Examples/odoex07.php deleted file mode 100644 index eb86ba3c..00000000 --- a/#jpgraph/src/Examples/odoex07.php +++ /dev/null @@ -1,126 +0,0 @@ -SetColor("lightyellow"); - -//--------------------------------------------------------------------- -// Specify title and subtitle using default fonts -// * Note each title may be multilines by using a '\n' as a line -// divider. -//--------------------------------------------------------------------- -$graph->title->Set("Odometer title"); -$graph->title->SetColor("white"); -$graph->subtitle->Set("2002-02-13"); -$graph->subtitle->SetColor("white"); - -//--------------------------------------------------------------------- -// Specify caption. -// * (This is the text at the bottom of the graph.) The margins will -// automatically adjust to fit the height of the text. A caption -// may have multiple lines by including a '\n' character in the -// string. -//--------------------------------------------------------------------- -$graph->caption->Set("First caption row\n... second row"); -$graph->caption->SetColor("white"); - -//--------------------------------------------------------------------- -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -//--------------------------------------------------------------------- -$odo = new Odometer(ODO_FULL); - -//--------------------------------------------------------------------- -// Set color indication -//--------------------------------------------------------------------- -$odo->AddIndication(0,50,"green"); -$odo->AddIndication(50,80,"yellow"); -$odo->AddIndication(80,100,"red"); - -//--------------------------------------------------------------------- -// Set the center area that will not be affected by the color bands -//--------------------------------------------------------------------- -$odo->SetCenterAreaWidth(0.4); // Fraction of radius - -//--------------------------------------------------------------------- -// Adjust scale ticks to be shown at 10 steps interval and scale -// labels at every second tick -//--------------------------------------------------------------------- -$odo->scale->SetTicks(10,2); - -//--------------------------------------------------------------------- -// Make the tick marks 2 pixel wide -//--------------------------------------------------------------------- -$odo->scale->SetTickWeight(2); - -//--------------------------------------------------------------------- -// Use a bold font for tick labels -//--------------------------------------------------------------------- -$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); - -//--------------------------------------------------------------------- -// Change the start and end angle for the scale -//--------------------------------------------------------------------- -$odo->scale->SetAngle(20,340); - -//--------------------------------------------------------------------- -// Set display value for the odometer -//--------------------------------------------------------------------- -$odo->needle->Set(64); - -//--------------------------------------------------------------------- -// Specify scale caption. Note that depending on the position of the -// indicator needle this label might be partially hidden. -//--------------------------------------------------------------------- -$odo->label->Set("% Passed"); - -//--------------------------------------------------------------------- -// Set a new style for the needle -//--------------------------------------------------------------------- -$odo->needle->SetStyle(NEEDLE_STYLE_MEDIUM_TRIANGLE); -$odo->needle->SetLength(0.7); // Length as 70% of the radius -$odo->needle->SetFillColor("orange"); - -//--------------------------------------------------------------------- -// Setup the second indicator needle -//--------------------------------------------------------------------- -$odo->needle2->Set(15); -$odo->needle2->SetStyle(NEEDLE_STYLE_SMALL_TRIANGLE); -$odo->needle2->SetLength(0.55); // Length as 70% of the radius -$odo->needle2->SetFillColor("lightgray"); -$odo->needle2->Show(); - - -//--------------------------------------------------------------------- -// Add the odometer to the graph -//--------------------------------------------------------------------- -$graph->Add($odo); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex08.php b/#jpgraph/src/Examples/odoex08.php deleted file mode 100644 index 39f12e7a..00000000 --- a/#jpgraph/src/Examples/odoex08.php +++ /dev/null @@ -1,150 +0,0 @@ -SetShadow(); - -//--------------------------------------------------------------------- -// Change the color of the odometer plotcanvas. NOT the odometer -// fill color itself. -//--------------------------------------------------------------------- -$graph->SetColor("lightyellow"); - -//--------------------------------------------------------------------- -// Change the color of the margin in the graph -//--------------------------------------------------------------------- -$graph->SetMarginColor("khaki:0.6"); - -//--------------------------------------------------------------------- -// Specify title and subtitle using default fonts -// * Note each title may be multilines by using a '\n' as a line -// divider. -//--------------------------------------------------------------------- -$graph->title->Set("Odometer title"); -$graph->title->SetColor("white"); -$graph->subtitle->Set("2002-02-13"); -$graph->subtitle->SetColor("white"); - -//--------------------------------------------------------------------- -// Specify caption. -// * (This is the text at the bottom of the graph.) The margins will -// automatically adjust to fit the height of the text. A caption -// may have multiple lines by including a '\n' character in the -// string. -//--------------------------------------------------------------------- -$graph->caption->Set("First caption row\n... second row"); -$graph->caption->SetColor("white"); - -//--------------------------------------------------------------------- -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -//--------------------------------------------------------------------- -$odo = new Odometer(ODO_FULL); - -//--------------------------------------------------------------------- -// Set fill color for odometer -//--------------------------------------------------------------------- -$odo->SetColor("lightblue"); - -//--------------------------------------------------------------------- -// Set color indication -//--------------------------------------------------------------------- -$odo->AddIndication(0,50,"green"); -$odo->AddIndication(50,80,"yellow"); -$odo->AddIndication(80,100,"red"); - -//--------------------------------------------------------------------- -// Set the center area that will not be affected by the color bands -//--------------------------------------------------------------------- -$odo->SetCenterAreaWidth(0.4); // Fraction of radius - -//--------------------------------------------------------------------- -// Adjust scale ticks to be shown at 10 steps interval and scale -// labels at every second tick -//--------------------------------------------------------------------- -$odo->scale->SetTicks(10,2); - -//--------------------------------------------------------------------- -// Make the tick marks 2 pixel wide -//--------------------------------------------------------------------- -$odo->scale->SetTickWeight(2); - -//--------------------------------------------------------------------- -// Use a bold font for tick labels -//--------------------------------------------------------------------- -$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); - -//--------------------------------------------------------------------- -// Change the start and end angle for the scale -//--------------------------------------------------------------------- -$odo->scale->SetAngle(20,340); - -//--------------------------------------------------------------------- -// Set display value for the odometer -//--------------------------------------------------------------------- -$odo->needle->Set(64); - -//--------------------------------------------------------------------- -// Specify scale caption. Note that depending on the position of the -// indicator needle this label might be partially hidden. -//--------------------------------------------------------------------- -$odo->label->Set("% Passed"); - -//--------------------------------------------------------------------- -// Set a new style for the needle -//--------------------------------------------------------------------- -$odo->needle->SetStyle(NEEDLE_STYLE_MEDIUM_TRIANGLE); -$odo->needle->SetLength(0.7); // Length as 70% of the radius -$odo->needle->SetFillColor("orange"); - -//--------------------------------------------------------------------- -// Setup the second indicator needle -//--------------------------------------------------------------------- -$odo->needle2->Set(15); -$odo->needle2->SetStyle(NEEDLE_STYLE_SMALL_TRIANGLE); -$odo->needle2->SetLength(0.55); // Length as 70% of the radius -$odo->needle2->SetFillColor("lightgray"); - -// Only the first needle is shown by default -$odo->needle2->Show(); - -//--------------------------------------------------------------------- -// Add a drop shadow to the indicator needles -//--------------------------------------------------------------------- -$odo->needle->SetShadow(); -$odo->needle2->SetShadow(); - -//--------------------------------------------------------------------- -// Add the odometer to the graph -//--------------------------------------------------------------------- -$graph->Add($odo); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odoex09.php b/#jpgraph/src/Examples/odoex09.php deleted file mode 100644 index 9fc9affe..00000000 --- a/#jpgraph/src/Examples/odoex09.php +++ /dev/null @@ -1,49 +0,0 @@ -needle->Set(17); -$odo2->needle->Set(47); -$odo3->needle->Set(86); - -//--------------------------------------------------------------------- -// Add the odometers to the graph using a vertical layout -//--------------------------------------------------------------------- -$l1 = new LayoutVert( array($odo1,$odo2,$odo3) ) ; -$graph->Add( $l1 ); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex00.php b/#jpgraph/src/Examples/odotutex00.php deleted file mode 100644 index 4344292d..00000000 --- a/#jpgraph/src/Examples/odotutex00.php +++ /dev/null @@ -1,21 +0,0 @@ -needle->Set(30); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the client -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/odotutex01.php b/#jpgraph/src/Examples/odotutex01.php deleted file mode 100644 index ec970cd4..00000000 --- a/#jpgraph/src/Examples/odotutex01.php +++ /dev/null @@ -1,21 +0,0 @@ -needle->Set(30); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the client -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/odotutex02.php b/#jpgraph/src/Examples/odotutex02.php deleted file mode 100644 index a007c1b1..00000000 --- a/#jpgraph/src/Examples/odotutex02.php +++ /dev/null @@ -1,30 +0,0 @@ -title->Set("Result for 2002"); -$graph->title->SetColor("white"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->subtitle->Set("New York Office"); -$graph->subtitle->SetColor("white"); -$graph->caption->Set("Figure 1. Branch results."); -$graph->caption->SetColor("white"); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo = new Odometer(); - -// Set display value for the odometer -$odo->needle->Set(30); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the client -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/odotutex03.php b/#jpgraph/src/Examples/odotutex03.php deleted file mode 100644 index 3c0e907c..00000000 --- a/#jpgraph/src/Examples/odotutex03.php +++ /dev/null @@ -1,30 +0,0 @@ -title->Set("Result for 2002"); -$graph->title->SetColor("white"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->subtitle->Set("New York Office"); -$graph->subtitle->SetColor("white"); -$graph->caption->Set("Figure 1.This is a very, very\nlong text with multiples lines\nthat are added as a caption."); -$graph->caption->SetColor("white"); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo = new Odometer(); - -// Set display value for the odometer -$odo->needle->Set(30); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the client -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/odotutex04.php b/#jpgraph/src/Examples/odotutex04.php deleted file mode 100644 index 60c57fc7..00000000 --- a/#jpgraph/src/Examples/odotutex04.php +++ /dev/null @@ -1,40 +0,0 @@ -title->Set("Result for 2002"); -$graph->title->SetColor("white"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->subtitle->Set("New York Office"); -$graph->subtitle->SetColor("white"); -$graph->caption->Set("Figure 1.This is a very, very\nlong text with multiples lines\nthat are added as a caption."); -$graph->caption->SetColor("white"); - -// Setup colors -// Make the border 40% darker than normal "khaki" -$graph->SetMarginColor("khaki:0.6"); -$graph->SetColor("khaki"); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo = new Odometer(); - -// Setup colors for odometyer plot -$odo->SetColor('white'); -$odo->scale->label->SetColor("darkred"); -$odo->needle->SetFillColor("yellow"); - -// Set display value for the odometer -$odo->needle->Set(30); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the client -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/odotutex06.php b/#jpgraph/src/Examples/odotutex06.php deleted file mode 100644 index 4161e5fa..00000000 --- a/#jpgraph/src/Examples/odotutex06.php +++ /dev/null @@ -1,43 +0,0 @@ -SetColor("lightyellow"); - $odo[$i]->needle->Set(80); - $odo[$i]->needle->SetStyle($nstyle[$i]); - $odo[$i]->caption->Set($captions[$i]); - $odo[$i]->caption->SetFont(FF_FONT1); - $odo[$i]->caption->SetMargin(3); -} - -// Use the automatic layout engine to positon the plots on the graph -$row1 = new LayoutHor( array($odo[0],$odo[1],$odo[2]) ); -$row2 = new LayoutHor( array($odo[3],$odo[4],$odo[5]) ); -$col1 = new LayoutVert( array($row1,$row2) ); - -// Add the odometer to the graph -$graph->Add($col1); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex07.php b/#jpgraph/src/Examples/odotutex07.php deleted file mode 100644 index a1ba22bb..00000000 --- a/#jpgraph/src/Examples/odotutex07.php +++ /dev/null @@ -1,37 +0,0 @@ -SetColor("lightyellow"); - $odo[$i]->needle->Set(75); - $odo[$i]->needle->SetStyle(NEEDLE_STYLE_ENDARROW, $astyles[$i]); - $odo[$i]->caption->SetFont(FF_FONT1,FS_BOLD); - $odo[$i]->caption->Set('Arrow: '.$acaptions[$i]); -} - -$row1 = new LayoutHor( array($odo[0],$odo[1],$odo[2]) ); -$row2 = new LayoutHor( array($odo[3],$odo[4],$odo[5]) ); -$row3 = new LayoutHor( array($odo[6],$odo[7],$odo[8]) ); -$col1 = new LayoutVert( array($row1,$row2,$row3) ); - -// Add the odometer to the graph -$graph->Add($col1); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex08.1.php b/#jpgraph/src/Examples/odotutex08.1.php deleted file mode 100644 index 676ac4c8..00000000 --- a/#jpgraph/src/Examples/odotutex08.1.php +++ /dev/null @@ -1,41 +0,0 @@ -title->Set('An example with thick border'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,11); - -// Add drop shadow for graph -$graph->SetShadow(); - -// Set some nonstandard colors -$color = array(205,220,205); -$graph->SetMarginColor($color); -$graph->SetColor($color); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo = new Odometer(); -$odo->SetColor('white'); -$odo->SetBorder('darkgreen:0.8',5); - -$odo->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); -$odo->scale->label->SetColor('brown:0.6'); - -// Set display value for the odometer -$odo->needle->Set(70); - -// Add drop shadow for needle -$odo->needle->SetShadow(); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex08.php b/#jpgraph/src/Examples/odotutex08.php deleted file mode 100644 index 8132e732..00000000 --- a/#jpgraph/src/Examples/odotutex08.php +++ /dev/null @@ -1,36 +0,0 @@ -title->Set('An example with drop shadows'); - -// Add drop shadow for graph -$graph->SetShadow(); - -// Set some nonstandard colors -$color = array(205,220,205); -$graph->SetMarginColor($color); -$graph->SetColor($color); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo = new Odometer(); -$odo->SetColor('white'); - -// Set display value for the odometer -$odo->needle->Set(70); - -// Add drop shadow for needle -$odo->needle->SetShadow(); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex09.php b/#jpgraph/src/Examples/odotutex09.php deleted file mode 100644 index 82a2c4b3..00000000 --- a/#jpgraph/src/Examples/odotutex09.php +++ /dev/null @@ -1,38 +0,0 @@ -SetColor("lightyellow"); - $odo[$i]->needle->Set(75); - $odo[$i]->needle->SetStyle(NEEDLE_STYLE_ENDARROW, $astyles[$i]); - $odo[$i]->caption->SetFont(FF_FONT1); - $odo[$i]->caption->Set($acaptions[$i]); - $odo[$i]->SetMargin(15); -} - -$row1 = new LayoutHor( array($odo[0],$odo[1],$odo[2]) ); -$row2 = new LayoutHor( array($odo[3],$odo[4],$odo[5]) ); -$row3 = new LayoutHor( array($odo[6],$odo[7],$odo[8]) ); -$col1 = new LayoutVert( array($row1,$row2,$row3) ); - -// Add the odometer to the graph -$graph->Add($col1); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex10.php b/#jpgraph/src/Examples/odotutex10.php deleted file mode 100644 index f44fc5e0..00000000 --- a/#jpgraph/src/Examples/odotutex10.php +++ /dev/null @@ -1,43 +0,0 @@ -title->Set('Example with scale indicators'); - -// Add drop shadow for graph -$graph->SetShadow(); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo = new Odometer(ODO_HALF); - -// Add color indications -$odo->AddIndication(0,20,"green:0.7"); -$odo->AddIndication(20,30,"green:0.9"); -$odo->AddIndication(30,60,"yellow"); -$odo->AddIndication(60,80,"orange"); -$odo->AddIndication(80,100,"red"); - -// Set display value for the odometer -$odo->needle->Set(90); - -//--------------------------------------------------------------------- -// Add drop shadow for needle -//--------------------------------------------------------------------- -$odo->needle->SetShadow(); - -//--------------------------------------------------------------------- -// Add the odometer to the graph -//--------------------------------------------------------------------- -$graph->Add($odo); - -//--------------------------------------------------------------------- -// ... and finally stroke and stream the image back to the browser -//--------------------------------------------------------------------- -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex11.php b/#jpgraph/src/Examples/odotutex11.php deleted file mode 100644 index f1290f7d..00000000 --- a/#jpgraph/src/Examples/odotutex11.php +++ /dev/null @@ -1,40 +0,0 @@ -title->Set('Example with scale indicators'); - -// Add drop shadow for graph -$graph->SetShadow(); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo = new Odometer(ODO_HALF); - -// Add color indications -$odo->AddIndication(0,20,"green:0.7"); -$odo->AddIndication(20,30,"green:0.9"); -$odo->AddIndication(30,60,"yellow"); -$odo->AddIndication(60,80,"orange"); -$odo->AddIndication(80,100,"red"); - -// Set display value for the odometer -$odo->needle->Set(90); - -// Set the size of the non-colored base area to 40% of the radius -$odo->SetCenterAreaWidth(0.45); - -// Add drop shadow for needle -$odo->needle->SetShadow(); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex12.php b/#jpgraph/src/Examples/odotutex12.php deleted file mode 100644 index 5d030a8e..00000000 --- a/#jpgraph/src/Examples/odotutex12.php +++ /dev/null @@ -1,47 +0,0 @@ -title->Set('Example with scale indicators'); - -// Add drop shadow for graph -$graph->SetShadow(); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo = new Odometer(ODO_HALF); - -// Add color indications -$odo->AddIndication(0,20,"green:0.7"); -$odo->AddIndication(20,30,"green:0.9"); -$odo->AddIndication(30,60,"yellow"); -$odo->AddIndication(60,80,"orange"); -$odo->AddIndication(80,100,"red"); - -// Set display value for the odometer -$odo->needle->Set(90); - -// Set the size of the non-colored base area to 40% of the radius -$odo->SetCenterAreaWidth(0.45); - -// Add drop shadow for needle -$odo->needle->SetShadow(); - -// Setup the second needle -$odo->needle2->Set(44); -$odo->needle2->Show(); -$odo->needle2->SetLength(0.4); -$odo->needle2->SetFillColor("navy"); -$odo->needle2->SetShadow(); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); - -// EOF -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex13.php b/#jpgraph/src/Examples/odotutex13.php deleted file mode 100644 index 5c49a117..00000000 --- a/#jpgraph/src/Examples/odotutex13.php +++ /dev/null @@ -1,41 +0,0 @@ -title->Set('Example with scale indicators'); - -// Add drop shadow for graph -$graph->SetShadow(); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo = new Odometer(ODO_HALF); - -// Add color indications -$odo->AddIndication(0,20,"green:0.7"); -$odo->AddIndication(20,30,"green:0.9"); -$odo->AddIndication(30,60,"yellow"); -$odo->AddIndication(60,80,"orange"); -$odo->AddIndication(80,100,"red"); - -$odo->SetCenterAreaWidth(0.45); - -// Set display value for the odometer -$odo->needle->Set(90); - -// Add scale labels -$odo->label->Set("mBar"); -$odo->label->SetFont(FF_FONT2,FS_BOLD); - -// Add drop shadow for needle -$odo->needle->SetShadow(); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex14.php b/#jpgraph/src/Examples/odotutex14.php deleted file mode 100644 index 19e8f71b..00000000 --- a/#jpgraph/src/Examples/odotutex14.php +++ /dev/null @@ -1,35 +0,0 @@ -title->Set('Custom scale'); -$graph->title->SetColor('white'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD); - -// Add drop shadow for graph -$graph->SetShadow(); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo = new Odometer(); -$odo->SetColor('lightyellow'); - -// Setup the scale -$odo->scale->Set(100,600); -$odo->scale->SetTicks(50,2); - -// Set display value for the odometer -$odo->needle->Set(280); - -// Add drop shadow for needle -$odo->needle->SetShadow(); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex15.php b/#jpgraph/src/Examples/odotutex15.php deleted file mode 100644 index fece535e..00000000 --- a/#jpgraph/src/Examples/odotutex15.php +++ /dev/null @@ -1,46 +0,0 @@ -title->Set('Custom formatting'); -$graph->title->SetColor('white'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD); - -// Add drop shadow for graph -$graph->SetShadow(); - -// Now we need to create an odometer to add to the graph. -$odo = new Odometer(); -$odo->SetColor("lightgray:1.9"); - -// Setup the scale -$odo->scale->Set(100,600); -$odo->scale->SetTicks(50,2); -$odo->scale->SetTickColor('brown'); -$odo->scale->SetTickLength(0.05); -$odo->scale->SetTickWeight(2); - -$odo->scale->SetLabelPos(0.75); -$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); -$odo->scale->label->SetColor('brown'); -$odo->scale->label->SetFont(FF_ARIAL,FS_NORMAL,10); - -// Setup a label with a degree mark -$odo->scale->SetLabelFormat('%dC'.SymChar::Get('degree')); - -// Set display value for the odometer -$odo->needle->Set(280); - -// Add drop shadow for needle -$odo->needle->SetShadow(); - -// Add the odometer to the graph -$graph->Add($odo); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex16.1.php b/#jpgraph/src/Examples/odotutex16.1.php deleted file mode 100644 index c370618f..00000000 --- a/#jpgraph/src/Examples/odotutex16.1.php +++ /dev/null @@ -1,42 +0,0 @@ -SetShadow(); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo1 = new Odometer(); -$odo2 = new Odometer(); -$odo1->SetColor("lightgray:1.9"); -$odo2->SetColor("lightgray:1.9"); - -// Adjust start and end angle for the scale -$odo2->scale->SetAngle(110,250); - -$odo1->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); -$odo2->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); -$odo2->AddIndication(-15,0,'lightgray'); -$odo2->AddIndication(100,115,'lightgray'); - -// Set display value for the odometer -$odo1->needle->Set(70); -$odo2->needle->Set(70); - -// Add drop shadow for needle -$odo1->needle->SetShadow(); -$odo2->needle->SetShadow(); - -// Specify the layout for the two odometers -$row = new LayoutHor( array($odo1,$odo2) ); - -// Add the odometer to the graph -$graph->Add($row); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex16.php b/#jpgraph/src/Examples/odotutex16.php deleted file mode 100644 index 16619f3c..00000000 --- a/#jpgraph/src/Examples/odotutex16.php +++ /dev/null @@ -1,40 +0,0 @@ -SetShadow(); - -// Now we need to create an odometer to add to the graph. -// By default the scale will be 0 to 100 -$odo1 = new Odometer(); -$odo2 = new Odometer(); -$odo1->SetColor("lightgray:1.9"); -$odo2->SetColor("lightgray:1.9"); - -// Adjust start and end angle for the scale -$odo2->scale->SetAngle(110,250); - -$odo1->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); -$odo2->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); - -// Set display value for the odometer -$odo1->needle->Set(70); -$odo2->needle->Set(70); - -// Add drop shadow for needle -$odo1->needle->SetShadow(); -$odo2->needle->SetShadow(); - -// Specify the layout for the two odometers -$row = new LayoutHor( array($odo1,$odo2) ); - -// Add the odometer to the graph -$graph->Add($row); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex17.php b/#jpgraph/src/Examples/odotutex17.php deleted file mode 100644 index 6a9abf8d..00000000 --- a/#jpgraph/src/Examples/odotutex17.php +++ /dev/null @@ -1,46 +0,0 @@ -title->Set('Manual positioning'); -$graph->title->SetColor('white'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -// Add drop shadow for graph -$graph->SetShadow(); - -// Now we need to create an odometer to add to the graph. -$odo1 = new Odometer(); -$odo2 = new Odometer(); -$odo1->SetColor('lightgray:1.9'); -$odo2->SetColor('lightgray:1.9'); - -// Set display value for the odometer -$odo1->needle->Set(37); -$odo2->needle->Set(73); - -// Add drop shadow for needle -$odo1->needle->SetShadow(); -$odo2->needle->SetShadow(); - -// Specify the position for the two odometers -$odo1->SetPos(180,110); -$odo1->SetSize(100); -$odo2->SetPos(110,250); -$odo2->SetSize(100); - -// Set captions for the odometers -$odo1->caption->Set("(x,y) = (180,120)\nradius=100"); -$odo2->caption->Set("(x,y) = (110,270)\nradius=100"); - -// Add the odometer to the graph -$graph->Add($odo1); -$graph->Add($odo2); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex18.php b/#jpgraph/src/Examples/odotutex18.php deleted file mode 100644 index 44bd4913..00000000 --- a/#jpgraph/src/Examples/odotutex18.php +++ /dev/null @@ -1,37 +0,0 @@ -SetColor('lightgray:1.9'); - $odo[$i]->needle->Set(10+$i*17); - $odo[$i]->needle->SetShadow(); - if( $i < 2 ) - $fsize = 10; - else - $fsize = 8; - $odo[$i]->scale->label->SetFont(FF_ARIAL,FS_NORMAL,$fsize); - $odo[$i]->AddIndication(92,100,'red'); - $odo[$i]->AddIndication(80,92,'orange'); - $odo[$i]->AddIndication(60,80,'yellow'); -} - -// Create the layout -$row1 = new LayoutHor( array($odo[0],$odo[1]) ); -$row2 = new LayoutHor( array($odo[2],$odo[3],$odo[4]) ); -$col1 = new LayoutVert( array($row1,$row2) ); - -// Add the odometer to the graph -$graph->Add($col1); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/odotutex19.php b/#jpgraph/src/Examples/odotutex19.php deleted file mode 100644 index 02324b06..00000000 --- a/#jpgraph/src/Examples/odotutex19.php +++ /dev/null @@ -1,49 +0,0 @@ -SetColor('lightgray:1.9'); - $odo[$i]->needle->Set(10+$i*17); - $odo[$i]->needle->SetShadow(); - if( $i < 2 ) - $fsize = 10; - else - $fsize = 8; - $odo[$i]->scale->label->SetFont(FF_ARIAL,FS_NORMAL,$fsize); - $odo[$i]->AddIndication(92,100,'red'); - $odo[$i]->AddIndication(80,92,'orange'); - $odo[$i]->AddIndication(60,80,'yellow'); -} - -// Create the layout -$row1 = new LayoutHor( array($odo[0],$odo[1]) ); -$row2 = new LayoutHor( array($odo[2],$odo[3],$odo[4]) ); -$col1 = new LayoutVert( array($row1,$row2) ); - -// Add the odometer to the graph -$graph->Add($col1); - -// Add an icon and text -$icon = new IconPlot('jpglogo.jpg',250,10,0.85,30); -$icon->SetAnchor('center','top'); -$graph->Add($icon); - -$t = new Text('JpGraph',250,70); -$t->SetAlign('center','top'); -#$t->SetFont(FF_VERA,FS_BOLD,11); -$t->SetColor('darkgray'); -$graph->Add($t); - -// ... and finally stroke and stream the image back to the browser -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/orange_example.php b/#jpgraph/src/Examples/orange_example.php deleted file mode 100644 index adab98dc..00000000 --- a/#jpgraph/src/Examples/orange_example.php +++ /dev/null @@ -1,58 +0,0 @@ - array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), - 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), - 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), - 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), - 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), - 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), - 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), - 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), - 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), -); - - -// Create the graph. These two calls are always required -$graph = new Graph(400,300); - -$graph->SetScale("textlin"); -if ($theme) { - $graph->SetTheme(new $theme()); -} -$theme_class = new OrangeTheme; -$graph->SetTheme($theme_class); - -$plot = array(); -// Create the bar plots -for ($i = 0; $i < 4; $i++) { - $plot[$i] = new BarPlot($data[$i]); - $plot[$i]->SetLegend('plot'.($i+1)); -} -//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); -//$acc1->value->Show(); -$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); - -for ($i = 4; $i < 8; $i++) { - $plot[$i] = new LinePlot($data[$i]); - $plot[$i]->SetLegend('plot'.$i); - $plot[$i]->value->Show(); -} - -$graph->Add($gbplot); -$graph->Add($plot[4]); - -$title = "OrangeTheme Example"; -$title = mb_convert_encoding($title,'UTF-8'); -$graph->title->Set($title); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/partiallyfilledlineex1.php b/#jpgraph/src/Examples/partiallyfilledlineex1.php deleted file mode 100644 index 7ad37eca..00000000 --- a/#jpgraph/src/Examples/partiallyfilledlineex1.php +++ /dev/null @@ -1,44 +0,0 @@ -SetScale("textlin"); -$graph->SetShadow(true); -$graph->SetMarginColor("lightblue"); - -// Setup format for legend -$graph->legend->SetFillColor("antiquewhite"); -$graph->legend->SetShadow(true); - -// Setup title -$graph->title->Set("Filled Area Example"); -$graph->title->SetFont(FF_FONT2,FS_BOLD); - -// Setup semi-filled line plot -$lineplot = new LinePlot($ydata); -$lineplot->SetLegend("Semi-filled\nLineplot"); - -// Set line color -$lineplot->SetColor("black"); - -// Setup the two areas to be filled -$lineplot->AddArea(2,5,LP_AREA_FILLED,"red"); -$lineplot->AddArea(6,8,LP_AREA_FILLED,"green"); - -// Display the marks on the lines -$lineplot->mark->SetType(MARK_DIAMOND); -$lineplot->mark->SetSize(8); -$lineplot->mark->Show(); - -// add plot to the graph -$graph->Add($lineplot); - -// display graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/pastel_example.php b/#jpgraph/src/Examples/pastel_example.php deleted file mode 100644 index 82aeeb4c..00000000 --- a/#jpgraph/src/Examples/pastel_example.php +++ /dev/null @@ -1,57 +0,0 @@ - array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), - 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), - 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), - 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), - 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), - 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), - 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), - 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), - 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), -); - - -// Create the graph. These two calls are always required -$graph = new Graph(400,300); - -$graph->SetScale("textlin"); -if ($theme) { - $graph->SetTheme(new $theme()); -} -$theme_class = new PastelTheme; -$graph->SetTheme($theme_class); - -$plot = array(); -// Create the bar plots -for ($i = 0; $i < 4; $i++) { - $plot[$i] = new BarPlot($data[$i]); - $plot[$i]->SetLegend('plot'.($i+1)); -} -//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); -//$acc1->value->Show(); -$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); - -for ($i = 4; $i < 8; $i++) { - $plot[$i] = new LinePlot($data[$i]); - $plot[$i]->SetLegend('plot'.$i); - $plot[$i]->value->Show(); -} - -$graph->Add($gbplot); -$graph->Add($plot[4]); - -$title = "PastelTheme Example"; -$title = mb_convert_encoding($title,'UTF-8'); -$graph->title->Set($title); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/pdf417_ex0.php b/#jpgraph/src/Examples/pdf417_ex0.php deleted file mode 100644 index fb197f5b..00000000 --- a/#jpgraph/src/Examples/pdf417_ex0.php +++ /dev/null @@ -1,8 +0,0 @@ -Stroke($data); -?> diff --git a/#jpgraph/src/Examples/pdf417_ex1.php b/#jpgraph/src/Examples/pdf417_ex1.php deleted file mode 100644 index 84dd2726..00000000 --- a/#jpgraph/src/Examples/pdf417_ex1.php +++ /dev/null @@ -1,13 +0,0 @@ -Stroke($data); -} -catch(JpGraphException $e) { - echo 'PDF417 Error: '.$e->GetMessage(); -} -?> diff --git a/#jpgraph/src/Examples/pdf417_ex1b.php b/#jpgraph/src/Examples/pdf417_ex1b.php deleted file mode 100644 index fad0a9e0..00000000 --- a/#jpgraph/src/Examples/pdf417_ex1b.php +++ /dev/null @@ -1,20 +0,0 @@ -Stroke($data); -} -catch(JpGraphException $e) { - echo 'PDF417 Error: '.$e->GetMessage(); -} -?> diff --git a/#jpgraph/src/Examples/pdf417_ex1c.php b/#jpgraph/src/Examples/pdf417_ex1c.php deleted file mode 100644 index 96a74870..00000000 --- a/#jpgraph/src/Examples/pdf417_ex1c.php +++ /dev/null @@ -1,23 +0,0 @@ -ShowText(true); - $backend->SetModuleWidth($modwidth); - $backend->Stroke($data); -} -catch(JpGraphException $e) { - echo 'PDF417 Error: '.$e->GetMessage(); -} -?> diff --git a/#jpgraph/src/Examples/pdf417_ex2.php b/#jpgraph/src/Examples/pdf417_ex2.php deleted file mode 100644 index 685b0c29..00000000 --- a/#jpgraph/src/Examples/pdf417_ex2.php +++ /dev/null @@ -1,24 +0,0 @@ -SetModuleWidth($modwidth); - $backend->SetHeight($height); - $backend->Stroke($data); -} -catch(JpGraphException $e) { - echo 'PDF417 Error: '.$e->GetMessage(); -} -?> diff --git a/#jpgraph/src/Examples/pdf417_ex3.php b/#jpgraph/src/Examples/pdf417_ex3.php deleted file mode 100644 index ec2c7b6f..00000000 --- a/#jpgraph/src/Examples/pdf417_ex3.php +++ /dev/null @@ -1,26 +0,0 @@ -SetModuleWidth($modwidth); - $backend->SetHeight($height); - $backend->NoText(!$showtext); - $backend->Stroke($data); -} -catch(JpGraphException $e) { - echo 'PDF417 Error: '.$e->GetMessage(); -} -?> diff --git a/#jpgraph/src/Examples/pdf417_ex4.php b/#jpgraph/src/Examples/pdf417_ex4.php deleted file mode 100644 index 5fb8e6e7..00000000 --- a/#jpgraph/src/Examples/pdf417_ex4.php +++ /dev/null @@ -1,28 +0,0 @@ -SetModuleWidth($modwidth); - $backend->SetHeight($height); - $backend->NoText(!$showtext); - $backend->SetColor('black','yellow'); - $backend->Stroke($data); -} -catch(JpGraphException $e) { - echo 'PDF417 Error: '.$e->GetMessage(); -} -?> diff --git a/#jpgraph/src/Examples/pdf417_ex5.php b/#jpgraph/src/Examples/pdf417_ex5.php deleted file mode 100644 index fc525bfe..00000000 --- a/#jpgraph/src/Examples/pdf417_ex5.php +++ /dev/null @@ -1,29 +0,0 @@ -SetModuleWidth($modwidth); - $backend->SetHeight($height); - $backend->NoText(!$showtext); - $backend->SetColor('black','yellow'); - $output = $backend->Stroke($data); - echo nl2br(htmlspecialchars($output)); -} -catch(JpGraphException $e) { - echo 'PDF417 Error: '.$e->GetMessage(); -} -?> diff --git a/#jpgraph/src/Examples/pdf417_ex6.php b/#jpgraph/src/Examples/pdf417_ex6.php deleted file mode 100644 index 9b2e14d6..00000000 --- a/#jpgraph/src/Examples/pdf417_ex6.php +++ /dev/null @@ -1,35 +0,0 @@ -SetModuleWidth($modwidth); - $backend->NoText(!$showtext); - $backend->Stroke($data); -} -catch(JpGraphException $e) { - echo 'PDF417 Error: '.$e->GetMessage(); -} -?> diff --git a/#jpgraph/src/Examples/penguin.png b/#jpgraph/src/Examples/penguin.png deleted file mode 100644 index 2ae426ae..00000000 Binary files a/#jpgraph/src/Examples/penguin.png and /dev/null differ diff --git a/#jpgraph/src/Examples/pie3d_csimex1.php b/#jpgraph/src/Examples/pie3d_csimex1.php deleted file mode 100644 index 564c51f6..00000000 --- a/#jpgraph/src/Examples/pie3d_csimex1.php +++ /dev/null @@ -1,43 +0,0 @@ -SetShadow(); - -// Set A title for the plot -$graph->title->Set("3D Pie Client side image map"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create -$p1 = new PiePlot3D($data); -$p1->SetLegends(array("Jan (%d)","Feb","Mar","Apr","May","Jun","Jul")); -$targ=array("pie3d_csimex1.php?v=1","pie3d_csimex1.php?v=2","pie3d_csimex1.php?v=3", - "pie3d_csimex1.php?v=4","pie3d_csimex1.php?v=5","pie3d_csimex1.php?v=6"); -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); -$p1->SetCSIMTargets($targ,$alts); - -// Use absolute labels -$p1->SetLabelType(1); -$p1->value->SetFormat("%d kr"); - -// Move the pie slightly to the left -$p1->SetCenter(0.4,0.5); - -$graph->Add($p1); - - -// Send back the HTML page which will call this script again -// to retrieve the image. -$graph->StrokeCSIM(); - -?> - - diff --git a/#jpgraph/src/Examples/pie3dex1.php b/#jpgraph/src/Examples/pie3dex1.php deleted file mode 100644 index 10e2100f..00000000 --- a/#jpgraph/src/Examples/pie3dex1.php +++ /dev/null @@ -1,32 +0,0 @@ -SetShadow(); - -// Set A title for the plot -$graph->title->Set("Example 1 3D Pie plot"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); -$graph->title->SetColor("darkblue"); -$graph->legend->Pos(0.1,0.2); - -// Create pie plot -$p1 = new PiePlot3d($data); -$p1->SetTheme("sand"); -$p1->SetCenter(0.4); -$p1->SetAngle(30); -$p1->value->SetFont(FF_ARIAL,FS_NORMAL,12); -$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pie3dex2.php b/#jpgraph/src/Examples/pie3dex2.php deleted file mode 100644 index bd2a099b..00000000 --- a/#jpgraph/src/Examples/pie3dex2.php +++ /dev/null @@ -1,45 +0,0 @@ -SetShadow(); - - -// Set A title for the plot -$graph->title->Set("Example 2 3D Pie plot"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); -$graph->title->SetColor("darkblue"); -$graph->legend->Pos(0.1,0.2); - -// Create 3D pie plot -$p1 = new PiePlot3d($data); -$p1->SetTheme("sand"); -$p1->SetCenter(0.4); -$p1->SetSize(0.4); -$p1->SetHeight(5); - -// Adjust projection angle -$p1->SetAngle(45); - -// You can explode several slices by specifying the explode -// distance for some slices in an array -$p1->Explode(array(0,40,0,30)); - -// As a shortcut you can easily explode one numbered slice with -// $p1->ExplodeSlice(3); - -$p1->value->SetFont(FF_ARIAL,FS_NORMAL,10); -$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pie3dex3.php b/#jpgraph/src/Examples/pie3dex3.php deleted file mode 100644 index b45a2f22..00000000 --- a/#jpgraph/src/Examples/pie3dex3.php +++ /dev/null @@ -1,42 +0,0 @@ -SetShadow(); - -// Set A title for the plot -$graph->title->Set("Example 3 3D Pie plot"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); -$graph->title->SetColor("darkblue"); -$graph->legend->Pos(0.1,0.2); - -// Create 3D pie plot -$p1 = new PiePlot3d($data); -$p1->SetTheme("sand"); -$p1->SetCenter(0.4); -$p1->SetSize(80); - -// Adjust projection angle -$p1->SetAngle(45); - -// As a shortcut you can easily explode one numbered slice with -$p1->ExplodeSlice(3); - -// Setup the slice values -$p1->value->SetFont(FF_ARIAL,FS_BOLD,11); -$p1->value->SetColor("navy"); - -$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pie3dex4.php b/#jpgraph/src/Examples/pie3dex4.php deleted file mode 100644 index 0ce86e4e..00000000 --- a/#jpgraph/src/Examples/pie3dex4.php +++ /dev/null @@ -1,46 +0,0 @@ -SetShadow(); - -// Set A title for the plot -$graph->title->Set("Example 4 3D Pie plot"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); -$graph->title->SetColor("darkblue"); -$graph->legend->Pos(0.1,0.2); - -// Create 3D pie plot -$p1 = new PiePlot3d($data); -$p1->SetTheme("sand"); -$p1->SetCenter(0.4); -$p1->SetSize(80); - -// Adjust projection angle -$p1->SetAngle(45); - -// Adjsut angle for first slice -$p1->SetStartAngle(45); - -// As a shortcut you can easily explode one numbered slice with -$p1->ExplodeSlice(3); - -// Setup slice values -$p1->value->SetFont(FF_ARIAL,FS_BOLD,11); -$p1->value->SetColor("navy"); - - -$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pie3dex5.php b/#jpgraph/src/Examples/pie3dex5.php deleted file mode 100644 index 6efe470f..00000000 --- a/#jpgraph/src/Examples/pie3dex5.php +++ /dev/null @@ -1,46 +0,0 @@ -SetShadow(); - -// Set A title for the plot -$graph->title->Set("Example 5 3D Pie plot"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); -$graph->title->SetColor("darkblue"); -$graph->legend->Pos(0.1,0.2); - -// Create 3D pie plot -$p1 = new PiePlot3d($data); -$p1->SetTheme("sand"); -$p1->SetCenter(0.4); -$p1->SetSize(80); - -// Adjust projection angle -$p1->SetAngle(45); - -// Adjsut angle for first slice -$p1->SetStartAngle(45); - -// Display the slice values -$p1->value->SetFont(FF_ARIAL,FS_BOLD,11); -$p1->value->SetColor("navy"); - -// Add colored edges to the 3D pie -// NOTE: You can't have exploded slices with edges! -$p1->SetEdge("navy"); - -$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pie_csimex1.php b/#jpgraph/src/Examples/pie_csimex1.php deleted file mode 100644 index 50c3f700..00000000 --- a/#jpgraph/src/Examples/pie_csimex1.php +++ /dev/null @@ -1,35 +0,0 @@ -SetShadow(); - -// Set A title for the plot -$graph->title->Set("Client side image map"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create -$p1 = new PiePlot($data); -$p1->SetCenter(0.4,0.5); - -$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul")); -$targ=array("pie_csimex1.php#1","pie_csimex1.php#2","pie_csimex1.php#3", -"pie_csimex1.php#4","pie_csimex1.php#5","pie_csimex1.php#6"); -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); -$p1->SetCSIMTargets($targ,$alts); - -$graph->Add($p1); - - -// Send back the HTML page which will call this script again -// to retrieve the image. -$graph->StrokeCSIM(); - -?> - - diff --git a/#jpgraph/src/Examples/piebkgex1.php b/#jpgraph/src/Examples/piebkgex1.php deleted file mode 100644 index d2371c01..00000000 --- a/#jpgraph/src/Examples/piebkgex1.php +++ /dev/null @@ -1,94 +0,0 @@ -SetMargin(1,1,40,1); -$graph->SetMarginColor('navy'); -$graph->SetShadow(false); - -// Setup background -$graph->SetBackgroundImage('worldmap1.jpg',BGIMG_FILLPLOT); - -// Setup title -$graph->title->Set("Pie plots with background image"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,20); -$graph->title->SetColor('white'); - -$p = array(); -// Create the plots -for( $i=0; $i < $n; ++$i ) { - $d = "data$i"; - $p[] = new PiePlot3D($data[$i]); -} - -// Position the four pies -for( $i=0; $i < $n; ++$i ) { - $p[$i]->SetCenter($piepos[2*$i],$piepos[2*$i+1]); -} - -// Set the titles -for( $i=0; $i < $n; ++$i ) { - $p[$i]->title->Set($titles[$i]); - $p[$i]->title->SetColor('white'); - $p[$i]->title->SetFont(FF_ARIAL,FS_BOLD,12); -} - -// Label font and color setup -for( $i=0; $i < $n; ++$i ) { - $p[$i]->value->SetFont(FF_ARIAL,FS_BOLD); - $p[$i]->value->SetColor('white'); -} - -// Show the percetages for each slice -for( $i=0; $i < $n; ++$i ) { - $p[$i]->value->Show(); -} - -// Label format -for( $i=0; $i < $n; ++$i ) { - $p[$i]->value->SetFormat("%01.1f%%"); -} - -// Size of pie in fraction of the width of the graph -for( $i=0; $i < $n; ++$i ) { - $p[$i]->SetSize(0.15); -} - -// Format the border around each slice - - -for( $i=0; $i < $n; ++$i ) { - $p[$i]->SetEdge(false); - $p[$i]->ExplodeSlice(1); -} - -// Use one legend for the whole graph -$p[0]->SetLegends(array("May","June","July","Aug")); -$graph->legend->Pos(0.05,0.35); -$graph->legend->SetShadow(false); - -for( $i=0; $i < $n; ++$i ) { - $graph->Add($p[$i]); -} - -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/piec_csimex1.php b/#jpgraph/src/Examples/piec_csimex1.php deleted file mode 100644 index bffcb026..00000000 --- a/#jpgraph/src/Examples/piec_csimex1.php +++ /dev/null @@ -1,87 +0,0 @@ -SetFrame(false); - -// Uncomment this line to add a drop shadow to the border -// $graph->SetShadow(); - -// Setup title -$graph->title->Set("CSIM Center Pie plot ex 1"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,18); -$graph->title->SetMargin(8); // Add a little bit more margin from the top - -// Create the pie plot -$p1 = new PiePlotC($data); - -// Set the radius of pie (as fraction of image size) -$p1->SetSize(0.32); - -// Move the center of the pie slightly to the top of the image -$p1->SetCenter(0.5,0.45); - -// Label font and color setup -$p1->value->SetFont(FF_ARIAL,FS_BOLD,12); -$p1->value->SetColor('white'); - -// Setup the title on the center circle -$p1->midtitle->Set("Test mid\nRow 1\nRow 2"); -$p1->midtitle->SetFont(FF_ARIAL,FS_NORMAL,14); - -// Set color for mid circle -$p1->SetMidColor('yellow'); - -// Use percentage values in the legends values (This is also the default) -$p1->SetLabelType(PIE_VALUE_PER); - -// The label array values may have printf() formatting in them. The argument to the -// form,at string will be the value of the slice (either the percetage or absolute -// depending on what was specified in the SetLabelType() above. -$lbl = array("adam\n%.1f%%","bertil\n%.1f%%","johan\n%.1f%%", - "peter\n%.1f%%","daniel\n%.1f%%","erik\n%.1f%%"); -$p1->SetLabels($lbl); - -// Uncomment this line to remove the borders around the slices -// $p1->ShowBorder(false); - -// Add drop shadow to slices -$p1->SetShadow(); - -// Explode all slices 15 pixels -$p1->ExplodeAll(15); - -// Setup the CSIM targets -$targ=array("piec_csimex1.php#1","piec_csimex1.php#2","piec_csimex1.php#3", - "piec_csimex1.php#4","piec_csimex1.php#5","piec_csimex1.php#6"); -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); -$p1->SetCSIMTargets($targ,$alts); -$p1->SetMidCSIM("piec_csimex1.php#7","Center"); - - -// Setup a small help text in the image -$txt = new Text("Note: This is an example of image map. Hold\nyour mouse over the slices to see the values.\nThe URL just points back to this page"); -$txt->SetFont(FF_FONT1,FS_BOLD); -$txt->SetPos(0.5,0.97,'center','bottom'); -$txt->SetBox('yellow','black'); -$txt->SetShadow(); -$graph->AddText($txt); - -// Add plot to pie graph -$graph->Add($p1); - -// .. and send the image on it's marry way to the browser -$graph->StrokeCSIM(); - -?> - - diff --git a/#jpgraph/src/Examples/piecex1.php b/#jpgraph/src/Examples/piecex1.php deleted file mode 100644 index af1f2419..00000000 --- a/#jpgraph/src/Examples/piecex1.php +++ /dev/null @@ -1,46 +0,0 @@ -title->Set("Pie plot with center circle"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->title->SetMargin(8); // Add a little bit more margin from the top - -// Create the pie plot -$p1 = new PiePlotC($data); - -// Set size of pie -$p1->SetSize(0.32); - -// Label font and color setup -$p1->value->SetFont(FF_ARIAL,FS_BOLD,10); -$p1->value->SetColor('black'); - -// Setup the title on the center circle -$p1->midtitle->Set("Test mid\nRow 1\nRow 2"); -$p1->midtitle->SetFont(FF_ARIAL,FS_NORMAL,10); - -// Set color for mid circle -$p1->SetMidColor('yellow'); - -// Use percentage values in the legends values (This is also the default) -$p1->SetLabelType(PIE_VALUE_PER); - -// Add plot to pie graph -$graph->Add($p1); - -// .. and send the image on it's marry way to the browser -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/piecex2.php b/#jpgraph/src/Examples/piecex2.php deleted file mode 100644 index 9dbe5f11..00000000 --- a/#jpgraph/src/Examples/piecex2.php +++ /dev/null @@ -1,70 +0,0 @@ -SetFrame(false); - -// Uncomment this line to add a drop shadow to the border -// $graph->SetShadow(); - -// Setup title -$graph->title->Set("PiePlotC"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,18); -$graph->title->SetMargin(8); // Add a little bit more margin from the top - -// Create the pie plot -$p1 = new PiePlotC($data); - -// Set size of pie -$p1->SetSize(0.35); - -// Label font and color setup -$p1->value->SetFont(FF_ARIAL,FS_BOLD,12); -$p1->value->SetColor('white'); - -$p1->value->Show(); - -// Setup the title on the center circle -$p1->midtitle->Set("Test mid\nRow 1\nRow 2"); -$p1->midtitle->SetFont(FF_ARIAL,FS_NORMAL,14); - -// Set color for mid circle -$p1->SetMidColor('yellow'); - -// Use percentage values in the legends values (This is also the default) -$p1->SetLabelType(PIE_VALUE_PER); - -// The label array values may have printf() formatting in them. The argument to the -// form,at string will be the value of the slice (either the percetage or absolute -// depending on what was specified in the SetLabelType() above. -$lbl = array("adam\n%.1f%%","bertil\n%.1f%%","johan\n%.1f%%", - "peter\n%.1f%%","daniel\n%.1f%%","erik\n%.1f%%"); -$p1->SetLabels($lbl); - -// Uncomment this line to remove the borders around the slices -// $p1->ShowBorder(false); - -// Add drop shadow to slices -$p1->SetShadow(); - -// Explode all slices 15 pixels -$p1->ExplodeAll(15); - -// Add plot to pie graph -$graph->Add($p1); - -// .. and send the image on it's marry way to the browser -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pieex1.php b/#jpgraph/src/Examples/pieex1.php deleted file mode 100644 index 156d6e2e..00000000 --- a/#jpgraph/src/Examples/pieex1.php +++ /dev/null @@ -1,32 +0,0 @@ -SetShadow(); - -// Set A title for the plot -$graph->title->Set("Example 1 Pie plot"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); -$graph->title->SetColor("brown"); - -// Create pie plot -$p1 = new PiePlot($data); -//$p1->SetSliceColors(array("red","blue","yellow","green")); -$p1->SetTheme("earth"); - -$p1->value->SetFont(FF_ARIAL,FS_NORMAL,10); -// Set how many pixels each slice should explode -$p1->Explode(array(0,15,15,25,15)); - - -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pieex2.php b/#jpgraph/src/Examples/pieex2.php deleted file mode 100644 index 195d9755..00000000 --- a/#jpgraph/src/Examples/pieex2.php +++ /dev/null @@ -1,24 +0,0 @@ -SetShadow(); - -// Set A title for the plot -$graph->title->Set("Example 2 Pie plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create -$p1 = new PiePlot($data); -$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul")); -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pieex3.php b/#jpgraph/src/Examples/pieex3.php deleted file mode 100644 index a7795c3a..00000000 --- a/#jpgraph/src/Examples/pieex3.php +++ /dev/null @@ -1,53 +0,0 @@ -SetShadow(); - -// Set A title for the plot -$graph->title->Set("Multiple - Pie plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create plots -$size=0.13; -$p1 = new PiePlot($data); -$p1->SetLegends(array("Jan","Feb","Mar","Apr","May")); -$p1->SetSize($size); -$p1->SetCenter(0.25,0.32); -$p1->value->SetFont(FF_FONT0); -$p1->title->Set("2001"); - -$p2 = new PiePlot($data); -$p2->SetSize($size); -$p2->SetCenter(0.65,0.32); -$p2->value->SetFont(FF_FONT0); -$p2->title->Set("2002"); - -$p3 = new PiePlot($data); -$p3->SetSize($size); -$p3->SetCenter(0.25,0.75); -$p3->value->SetFont(FF_FONT0); -$p3->title->Set("2003"); - -$p4 = new PiePlot($data); -$p4->SetSize($size); -$p4->SetCenter(0.65,0.75); -$p4->value->SetFont(FF_FONT0); -$p4->title->Set("2004"); - -$graph->Add($p1); -$graph->Add($p2); -$graph->Add($p3); -$graph->Add($p4); - -$graph->Stroke(); - -?> - - - diff --git a/#jpgraph/src/Examples/pieex4.php b/#jpgraph/src/Examples/pieex4.php deleted file mode 100644 index 58544267..00000000 --- a/#jpgraph/src/Examples/pieex4.php +++ /dev/null @@ -1,25 +0,0 @@ -SetShadow(); - -$graph->title->Set("Example 4 of pie plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$p1 = new PiePlot($data); -$p1->value->SetFont(FF_FONT1,FS_BOLD); -$p1->value->SetColor("darkred"); -$p1->SetSize(0.3); -$p1->SetCenter(0.4); -$p1->SetLegends(array("Jan","Feb","Mar","Apr","May")); -$graph->Add($p1); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pieex5.php b/#jpgraph/src/Examples/pieex5.php deleted file mode 100644 index 808ab3e9..00000000 --- a/#jpgraph/src/Examples/pieex5.php +++ /dev/null @@ -1,31 +0,0 @@ -SetShadow(); - -// Setup graph title -$graph->title->Set("Example 5 of pie plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Create pie plot -$p1 = new PiePlot($data); -$p1->value->SetFont(FF_VERDANA,FS_BOLD); -$p1->value->SetColor("darkred"); -$p1->SetSize(0.3); -$p1->SetCenter(0.4); -$p1->SetLegends(array("Jan","Feb","Mar","Apr","May")); -//$p1->SetStartAngle(M_PI/8); -$p1->ExplodeSlice(3); - -$graph->Add($p1); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pieex6.php b/#jpgraph/src/Examples/pieex6.php deleted file mode 100644 index 46621e70..00000000 --- a/#jpgraph/src/Examples/pieex6.php +++ /dev/null @@ -1,48 +0,0 @@ -SetShadow(); - -// Setup title -$graph->title->Set("Example of pie plot with absolute labels"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// The pie plot -$p1 = new PiePlot($data); - -// Move center of pie to the left to make better room -// for the legend -$p1->SetCenter(0.35,0.5); - -// No border -$p1->ShowBorder(false); - -// Label font and color setup -$p1->value->SetFont(FF_FONT1,FS_BOLD); -$p1->value->SetColor("darkred"); - -// Use absolute values (type==1) -$p1->SetLabelType(PIE_VALUE_ABS); - -// Label format -$p1->value->SetFormat("$%d"); -$p1->value->Show(); - -// Size of pie in fraction of the width of the graph -$p1->SetSize(0.3); - -// Legends -$p1->SetLegends(array("May ($%d)","June ($%d)","July ($%d)","Aug ($%d)")); -$graph->legend->Pos(0.05,0.15); - -$graph->Add($p1); -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/pieex7.php b/#jpgraph/src/Examples/pieex7.php deleted file mode 100644 index 77f46102..00000000 --- a/#jpgraph/src/Examples/pieex7.php +++ /dev/null @@ -1,52 +0,0 @@ -SetShadow(); - -// Setup title -$graph->title->Set("Pie plot with absolute labels"); -$graph->subtitle->Set('(With hidden 0 labels)'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// The pie plot -$p1 = new PiePlot($data); - - -// Move center of pie to the left to make better room -// for the legend -$p1->SetCenter(0.35,0.5); - -// No border -$p1->ShowBorder(false); - -// Label font and color setup -$p1->value->SetFont(FF_FONT1,FS_BOLD); -$p1->value->SetColor("darkred"); - -// Use absolute values (type==1) -$p1->SetLabelType(PIE_VALUE_ABS); - -// Label format -$p1->value->SetFormat("$%d"); -$p1->value->HideZero(); -$p1->value->Show(); - -// Size of pie in fraction of the width of the graph -$p1->SetSize(0.3); - -// Legends -$p1->SetLegends(array("May ($%d)","June ($%d)","July ($%d)","Aug ($%d)")); -$graph->legend->Pos(0.05,0.2); - -$graph->Add($p1); -$graph->Stroke(); -?> - - diff --git a/#jpgraph/src/Examples/pieex8.php b/#jpgraph/src/Examples/pieex8.php deleted file mode 100644 index 0ca17859..00000000 --- a/#jpgraph/src/Examples/pieex8.php +++ /dev/null @@ -1,33 +0,0 @@ -SetShadow(); - -// Title setup -$graph->title->Set("Adjusting the label pos"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Setup the pie plot -$p1 = new PiePlot($data); - -// Adjust size and position of plot -$p1->SetSize(0.4); -$p1->SetCenter(0.5,0.52); - -// Setup slice labels and move them into the plot -$p1->value->SetFont(FF_FONT1,FS_BOLD); -$p1->value->SetColor("darkred"); -$p1->SetLabelPos(0.6); - -// Finally add the plot -$graph->Add($p1); - -// ... and stroke it -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/pieex9.php b/#jpgraph/src/Examples/pieex9.php deleted file mode 100644 index 2354d06d..00000000 --- a/#jpgraph/src/Examples/pieex9.php +++ /dev/null @@ -1,39 +0,0 @@ -SetShadow(); - -// Title setup -$graph->title->Set("Exploding all slices"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Setup the pie plot -$p1 = new PiePlot($data); - -// Adjust size and position of plot -$p1->SetSize(0.35); -$p1->SetCenter(0.5,0.52); - -// Setup slice labels and move them into the plot -$p1->value->SetFont(FF_FONT1,FS_BOLD); -$p1->value->SetColor("darkred"); -$p1->SetLabelPos(0.65); - -// Explode all slices -$p1->ExplodeAll(10); - -// Add drop shadow -$p1->SetShadow(); - -// Finally add the plot -$graph->Add($p1); - -// ... and stroke it -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/pielabelsex1.php b/#jpgraph/src/Examples/pielabelsex1.php deleted file mode 100644 index d2cf93a0..00000000 --- a/#jpgraph/src/Examples/pielabelsex1.php +++ /dev/null @@ -1,38 +0,0 @@ -title->Set("Label guide lines"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor("darkblue"); -$graph->legend->Pos(0.1,0.2); - - -// Create pie plot -$p1 = new PiePlot($data); -$p1->SetCenter(0.5,0.55); -$p1->SetSize(0.3); - -// Enable and set policy for guide-lines -$p1->SetGuideLines(); -$p1->SetGuideLinesAdjust(1.4); - -// Setup the labels -$p1->SetLabelType(PIE_VALUE_PER); -$p1->value->Show(); -$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9); -$p1->value->SetFormat('%2.1f%%'); - -// Add and stroke -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pielabelsex2.php b/#jpgraph/src/Examples/pielabelsex2.php deleted file mode 100644 index bb3cc2ab..00000000 --- a/#jpgraph/src/Examples/pielabelsex2.php +++ /dev/null @@ -1,38 +0,0 @@ -title->Set("Label guide lines"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor("darkblue"); -$graph->legend->Pos(0.1,0.2); - - -// Create pie plot -$p1 = new PiePlot($data); -$p1->SetCenter(0.5,0.55); -$p1->SetSize(0.3); - -// Enable and set policy for guide-lines. Make labels line up vertically -$p1->SetGuideLines(true,false); -$p1->SetGuideLinesAdjust(1.5); - -// Setup the labels -$p1->SetLabelType(PIE_VALUE_PER); -$p1->value->Show(); -$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9); -$p1->value->SetFormat('%2.1f%%'); - -// Add and stroke -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pielabelsex3.php b/#jpgraph/src/Examples/pielabelsex3.php deleted file mode 100644 index cff6d40f..00000000 --- a/#jpgraph/src/Examples/pielabelsex3.php +++ /dev/null @@ -1,39 +0,0 @@ -title->Set("Label guide lines"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor("darkblue"); -$graph->legend->Pos(0.1,0.2); - - -// Create pie plot -$p1 = new PiePlot($data); -$p1->SetCenter(0.5,0.55); -$p1->SetSize(0.3); - -// Enable and set policy for guide-lines. Make labels line up vertically -// and force guide lines to always beeing used -$p1->SetGuideLines(true,false,true); -$p1->SetGuideLinesAdjust(1.5); - -// Setup the labels -$p1->SetLabelType(PIE_VALUE_PER); -$p1->value->Show(); -$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9); -$p1->value->SetFormat('%2.1f%%'); - -// Add and stroke -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pielabelsex4.php b/#jpgraph/src/Examples/pielabelsex4.php deleted file mode 100644 index 5187b3c5..00000000 --- a/#jpgraph/src/Examples/pielabelsex4.php +++ /dev/null @@ -1,38 +0,0 @@ -title->Set("Label guide lines"); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor("darkblue"); -$graph->legend->Pos(0.1,0.2); - - -// Create pie plot -$p1 = new PiePlot($data); -$p1->SetCenter(0.5,0.55); -$p1->SetSize(0.3); - -// Enable and set policy for guide-lines. Make labels line up vertically -$p1->SetGuideLines(true,false); -$p1->SetGuideLinesAdjust(1.1); - -// Setup the labels -$p1->SetLabelType(PIE_VALUE_PER); -$p1->value->Show(); -$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9); -$p1->value->SetFormat('%2.1f%%'); - -// Add and stroke -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pielabelsex5.php b/#jpgraph/src/Examples/pielabelsex5.php deleted file mode 100644 index 22e697d3..00000000 --- a/#jpgraph/src/Examples/pielabelsex5.php +++ /dev/null @@ -1,48 +0,0 @@ -SetShadow(); - -// Set A title for the plot -$graph->title->Set('String labels with values'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('black'); - -// Create pie plot -$p1 = new PiePlot($data); -$p1->SetCenter(0.5,0.5); -$p1->SetSize(0.3); - -// Setup the labels to be displayed -$p1->SetLabels($labels); - -// This method adjust the position of the labels. This is given as fractions -// of the radius of the Pie. A value < 1 will put the center of the label -// inside the Pie and a value >= 1 will pout the center of the label outside the -// Pie. By default the label is positioned at 0.5, in the middle of each slice. -$p1->SetLabelPos(1); - -// Setup the label formats and what value we want to be shown (The absolute) -// or the percentage. -$p1->SetLabelType(PIE_VALUE_PER); -$p1->value->Show(); -$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9); -$p1->value->SetColor('darkgray'); - -// Add and stroke -$graph->Add($p1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/plotbanddensity_ex0.php b/#jpgraph/src/Examples/plotbanddensity_ex0.php deleted file mode 100644 index 3615a957..00000000 --- a/#jpgraph/src/Examples/plotbanddensity_ex0.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale('textlin'); -$graph->SetMargin(25,10,20,25); -$graph->SetBox(true); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_3DPLANE,15,35,'khaki4'); -$band->SetDensity(10); -$band->ShowFrame(true); -$graph->AddBand($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_3DPLANE, Density=10'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/plotbanddensity_ex1.php b/#jpgraph/src/Examples/plotbanddensity_ex1.php deleted file mode 100644 index ed07487e..00000000 --- a/#jpgraph/src/Examples/plotbanddensity_ex1.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale('textlin'); -$graph->SetMargin(25,10,20,25); -$graph->SetBox(true); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_3DPLANE,15,35,'khaki4'); -$band->SetDensity(40); -$band->ShowFrame(true); -$graph->AddBand($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_3DPLANE, Density=40'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/plotbanddensity_ex2.php b/#jpgraph/src/Examples/plotbanddensity_ex2.php deleted file mode 100644 index 908efdf5..00000000 --- a/#jpgraph/src/Examples/plotbanddensity_ex2.php +++ /dev/null @@ -1,38 +0,0 @@ -SetScale('textlin'); -$graph->SetMargin(25,10,20,25); -$graph->SetBox(true); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); -$graph->ygrid->Show(false); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_3DPLANE,15,35,'khaki4'); -$band->SetDensity(80); -$band->ShowFrame(true); -$graph->AddBand($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_3DPLANE, Density=80'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/plotlineex1.php b/#jpgraph/src/Examples/plotlineex1.php deleted file mode 100644 index 43a8016e..00000000 --- a/#jpgraph/src/Examples/plotlineex1.php +++ /dev/null @@ -1,36 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(40,20,50,70); - -$graph->legend->SetPos(0.5,0.97,'center','bottom'); - -$graph->title->Set('Plot line legend'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -$graph->SetTitleBackground('lightblue:1.3',TITLEBKG_STYLE2,TITLEBKG_FRAME_BEVEL); -$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'lightblue','navy'); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->value->Show(); -$bplot->value->SetFont(FF_VERDANA,FS_BOLD,8); -$bplot->SetValuePos('top'); -$bplot->SetLegend('Bar Legend'); -$graph->Add($bplot); - -$pline = new PlotLine(HORIZONTAL,8,'red',2); -$pline->SetLegend('Line Legend'); -$graph->legend->SetColumns(10); -$graph->Add($pline); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/polar_csimex1.php b/#jpgraph/src/Examples/polar_csimex1.php deleted file mode 100644 index ffaac176..00000000 --- a/#jpgraph/src/Examples/polar_csimex1.php +++ /dev/null @@ -1,69 +0,0 @@ -SetScale('log',100); -$graph->SetType(POLAR_180); - -// Hide frame around graph (by setting width=0) -$graph->SetFrame(true,'white',1); - -// Show both major and minor grid lines -$graph->axis->ShowGrid(true,true); - -// Set color for gradient lines -$graph->axis->SetGridColor('lightblue:0.9','lightblue:0.9','lightblue:0.9'); - -// Set label and axis colors -$graph->axis->SetColor('black','navy','darkred'); - -// Draw the ticks on the bottom side of the radius axis -$graph->axis->SetTickSide(SIDE_DOWN); - -// Increase the margin for the labels since we changed the -// side of the ticks. -$graph->axis->SetLabelMargin(6); - -// Change fonts -$graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8); -$graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8); - -// Setup axis title -$graph->axis->SetTitle('Coverage (in meter)','middle'); -$graph->axis->title->SetFont(FF_FONT1,FS_BOLD); - -// Setup graph title -$graph->title->Set('Polar plot #9'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->SetColor('navy'); - -// Setup tab title -$graph->tabtitle->Set('Microphone #1'); -$graph->tabtitle->SetColor('brown:0.5','lightyellow'); - -// Setup the polar plot with CSIM targets for the marks -$p = new PolarPlot($data); -$p->SetFillColor('lightblue@0.5'); -$p->mark->SetType(MARK_SQUARE); -$p->mark->SetWidth(10); -$p->SetCSIMTargets( $targets ); - -$graph->Add($p); - -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/polarclockex1.php b/#jpgraph/src/Examples/polarclockex1.php deleted file mode 100644 index bdf9008e..00000000 --- a/#jpgraph/src/Examples/polarclockex1.php +++ /dev/null @@ -1,55 +0,0 @@ -SetScale('lin',150); - -$graph->SetMarginColor('#FFE6C0'); -$graph->SetType(POLAR_360); -$graph->SetMargin(40,40,50,40); -$graph->SetClockwise(true); - -//$graph->Set90AndMargin(60,50,70,120); - -$graph->SetBox(true); -$graph->SetFrame(false); -$graph->axis->ShowGrid(true,false,true); -$graph->axis->SetGridColor('gray','gray','gray'); - -$graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8); -$graph->axis->SetTitle('X-Axis','center'); - -$graph->axis->SetColor('black','black','darkred'); -$graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8); - -$graph->title->Set('Clockwise polar plot'); -$graph->title->SetFont(FF_COMIC,FS_NORMAL,16); -$graph->title->SetColor('navy'); - - - -$p = new PolarPlot($data); -$p->SetFillColor('lightblue@0.5'); -$graph->Add($p); - -//$p2 = new PolarPlot($data2); -//$p2->SetFillColor('red@0.5'); -//$graph->Add($p2); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarclockex2.php b/#jpgraph/src/Examples/polarclockex2.php deleted file mode 100644 index 11cdeca6..00000000 --- a/#jpgraph/src/Examples/polarclockex2.php +++ /dev/null @@ -1,53 +0,0 @@ -SetScale('lin',150); - -$graph->SetMarginColor('#FFE6C0'); -$graph->SetType(POLAR_360); -$graph->SetClockwise(true); -$graph->Set90AndMargin(40,40,50,40); - -$graph->SetBox(true); -$graph->SetFrame(false); -$graph->axis->ShowGrid(true,false,true); -$graph->axis->SetGridColor('gray','gray','gray'); - -$graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8); -$graph->axis->SetTitle('X-Axis','center'); - -$graph->axis->SetColor('black','black','darkred'); -$graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8); - -$graph->title->Set('Clockwise polar plot (rotated)'); -$graph->title->SetFont(FF_COMIC,FS_NORMAL,16); -$graph->title->SetColor('navy'); - - - -$p = new PolarPlot($data); -$p->SetFillColor('lightblue@0.5'); -$graph->Add($p); - -//$p2 = new PolarPlot($data2); -//$p2->SetFillColor('red@0.5'); -//$graph->Add($p2); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex0-180.php b/#jpgraph/src/Examples/polarex0-180.php deleted file mode 100644 index 4fa344fa..00000000 --- a/#jpgraph/src/Examples/polarex0-180.php +++ /dev/null @@ -1,27 +0,0 @@ -SetScale('lin'); -$graph->SetMargin(35,35,25,25); -$graph->SetType(POLAR_180); - -$p = new PolarPlot($data); -$p->SetFillColor('lightblue@0.5'); -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex0.php b/#jpgraph/src/Examples/polarex0.php deleted file mode 100644 index b11aa6e1..00000000 --- a/#jpgraph/src/Examples/polarex0.php +++ /dev/null @@ -1,26 +0,0 @@ -SetScale('lin'); -$graph->SetMargin(35,35,25,25); - -$p = new PolarPlot($data); -$p->SetFillColor('lightblue@0.5'); -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex1.php b/#jpgraph/src/Examples/polarex1.php deleted file mode 100644 index b0c7f8af..00000000 --- a/#jpgraph/src/Examples/polarex1.php +++ /dev/null @@ -1,30 +0,0 @@ -SetScale('lin'); -$graph->SetType(POLAR_180); -//$graph->SetAngle(90); -//$graph->SetMargin(30-150,30-150,30+150,30+150); -$graph->Set90AndMargin(40,40,40,40); -//$graph->axis->SetLabelAlign('right','center'); - -$p = new PolarPlot($data); -$p->SetLegend("Test"); -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex10.php b/#jpgraph/src/Examples/polarex10.php deleted file mode 100644 index d864a23d..00000000 --- a/#jpgraph/src/Examples/polarex10.php +++ /dev/null @@ -1,66 +0,0 @@ -SetScale('log',100); -$graph->SetType(POLAR_360); - -// Hide frame around graph (by setting width=0) -$graph->SetFrame(true,'white',1); - -// Show both major and minor grid lines -$graph->axis->ShowGrid(true,true); - -// Set color for gradient lines -$graph->axis->SetGridColor('lightblue:0.9','lightblue:0.9','lightblue:0.9'); - -// Set label and axis colors -$graph->axis->SetColor('black','navy','darkred'); - -// Draw the ticks on the bottom side of the radius axis -$graph->axis->SetTickSide(SIDE_DOWN); - -// Increase the margin for the labels since we changed the -// side of the ticks. -$graph->axis->SetLabelMargin(6); - -// Change fonts -$graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8); -$graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8); - - -// Setup graph title -$graph->title->Set('Polar plot #10'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->SetColor('navy'); - -// Setup tab title -$graph->tabtitle->Set('Microphone #1'); -$graph->tabtitle->SetColor('brown:0.5','lightyellow'); - - -$p = new PolarPlot($data); -$p->SetFillColor('lightblue@0.5'); -$p->mark->SetType(MARK_SQUARE); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex2.php b/#jpgraph/src/Examples/polarex2.php deleted file mode 100644 index d4a9779a..00000000 --- a/#jpgraph/src/Examples/polarex2.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale('lin'); - -$graph->title->Set('Polar plot #2'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->title->SetColor('navy'); - -// Hide last labels on the Radius axis -// They intersect with the box otherwise -$graph->axis->HideLastTickLabel(); - -$p = new PolarPlot($data); -$p->SetFillColor('lightred@0.5'); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex3-lin.php b/#jpgraph/src/Examples/polarex3-lin.php deleted file mode 100644 index 430438c9..00000000 --- a/#jpgraph/src/Examples/polarex3-lin.php +++ /dev/null @@ -1,33 +0,0 @@ -SetScale('lin',200); -$graph->SetType(POLAR_180); - -$graph->title->Set('Polar plot #3'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->title->SetColor('navy'); - -$graph->axis->ShowGrid(true,false); - -$p = new PolarPlot($data); -$p->SetFillColor('lightred@0.5'); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex3.php b/#jpgraph/src/Examples/polarex3.php deleted file mode 100644 index 82bf18a2..00000000 --- a/#jpgraph/src/Examples/polarex3.php +++ /dev/null @@ -1,33 +0,0 @@ -SetScale('log',100); -$graph->SetType(POLAR_180); - -$graph->title->Set('Polar plot #3'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->title->SetColor('navy'); - -$graph->axis->ShowGrid(true,false); - -$p = new PolarPlot($data); -$p->SetFillColor('lightred@0.5'); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex4.php b/#jpgraph/src/Examples/polarex4.php deleted file mode 100644 index a4fb1d08..00000000 --- a/#jpgraph/src/Examples/polarex4.php +++ /dev/null @@ -1,34 +0,0 @@ -SetScale('log'); - -$graph->title->Set('Polar plot #4'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->title->SetColor('navy'); - -// Hide last labels on the Radius axis -// They intersect with the box otherwise -$graph->axis->HideLastTickLabel(); - -$p = new PolarPlot($data); -$p->SetFillColor('lightred@0.5'); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex5.php b/#jpgraph/src/Examples/polarex5.php deleted file mode 100644 index 7da58020..00000000 --- a/#jpgraph/src/Examples/polarex5.php +++ /dev/null @@ -1,37 +0,0 @@ -SetScale('log'); - -// Show both major and minor grid lines -$graph->axis->ShowGrid(true,true); - -$graph->title->Set('Polar plot #5'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->title->SetColor('navy'); - -// Hide last labels on the Radius axis -// They intersect with the box otherwise -$graph->axis->HideLastTickLabel(); - -$p = new PolarPlot($data); -$p->SetFillColor('lightred@0.5'); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex6.php b/#jpgraph/src/Examples/polarex6.php deleted file mode 100644 index 21ae6a27..00000000 --- a/#jpgraph/src/Examples/polarex6.php +++ /dev/null @@ -1,35 +0,0 @@ -SetScale('log'); -$graph->SetType(POLAR_180); - -// Show both major and minor grid lines -$graph->axis->ShowGrid(true,true); - -$graph->title->Set('Polar plot #6'); -$graph->title->SetFont(FF_FONT2,FS_BOLD); -$graph->title->SetColor('navy'); - - -$p = new PolarPlot($data); -$p->SetFillColor('lightred@0.5'); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex7-1.php b/#jpgraph/src/Examples/polarex7-1.php deleted file mode 100644 index 5b593a19..00000000 --- a/#jpgraph/src/Examples/polarex7-1.php +++ /dev/null @@ -1,50 +0,0 @@ -SetScale('log',100); -$graph->SetType(POLAR_180); -$graph->SetPlotSize(220,250); - -// Hide frame around graph (by setting width=0) -$graph->SetFrame(true,'white',1); - -$graph->SetBackgroundGradient('blue:1.3','brown:1.4',GRAD_HOR,BGRAD_PLOT); - -// Set color for gradient lines -$graph->axis->SetGridColor('gray','gray','gray'); - -// Setup axis title -$graph->axis->SetTitle('Coverage (in meter)','middle'); -$graph->axis->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->title->Set('Polar plot #7'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->SetColor('navy'); - -// Adjust legen box position and color -$graph->legend->SetColor('navy','darkgray'); -$graph->legend->SetFillColor('white'); -$graph->legend->SetShadow('darkgray@0.5',5); - -$p = new PolarPlot($data); -$p->SetFillColor('lightblue@0.5'); -$p->mark->SetType(MARK_SQUARE); -$p->SetLegend("Mirophone #1\n(No amps)"); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex7-2.php b/#jpgraph/src/Examples/polarex7-2.php deleted file mode 100644 index 959749d2..00000000 --- a/#jpgraph/src/Examples/polarex7-2.php +++ /dev/null @@ -1,53 +0,0 @@ -SetScale('log',100); -$graph->SetType(POLAR_360); -$graph->SetPlotSize(220,300); - -// Hide frame around graph (by setting width=0) -$graph->SetFrame(true,'white',1); - -$graph->SetBackgroundGradient('blue:1.3','brown:1.4',GRAD_MIDHOR,BGRAD_PLOT); - -// Set color for gradient lines -$graph->axis->SetGridColor('gray','gray','gray'); - -$graph->title->Set('Polar plot #7-2'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->SetColor('navy'); - -// Adjust legen box position and color -$graph->legend->SetColor('navy','darkgray'); -$graph->legend->SetFillColor('white'); -$graph->legend->SetShadow('darkgray@0.5',5); - -$p = new PolarPlot($data); -$p->SetFillColor('yellow@0.6'); -$p->mark->SetType(MARK_SQUARE); -$p->SetLegend("Mirophone #1\n(No amps)"); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex7.php b/#jpgraph/src/Examples/polarex7.php deleted file mode 100644 index d7079a0a..00000000 --- a/#jpgraph/src/Examples/polarex7.php +++ /dev/null @@ -1,53 +0,0 @@ -SetScale('lin',300); -$graph->SetType(POLAR_180); -$graph->SetPlotSize(220,250); - -// Hide frame around graph (by setting width=0) -$graph->SetFrame(true,'white',1); - -$graph->SetBackgroundGradient('blue:1.3','brown:1.4',GRAD_HOR,BGRAD_PLOT); - -// Show both major and minor grid lines -$graph->axis->ShowGrid(true,true); - -// Set color for gradient lines -$graph->axis->SetGridColor('gray','gray','gray'); - -// Setup axis title -$graph->axis->SetTitle('Coverage (in meter)','middle'); -$graph->axis->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->title->Set('Polar plot #7'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->SetColor('navy'); - -// Adjust legen box position and color -$graph->legend->SetColor('navy','darkgray'); -$graph->legend->SetFillColor('white'); -$graph->legend->SetShadow('darkgray@0.5',5); - -$p = new PolarPlot($data); -$p->SetFillColor('lightblue@0.5'); -$p->mark->SetType(MARK_SQUARE); -$p->SetLegend("Mirophone #1\n(No amps)"); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex8.php b/#jpgraph/src/Examples/polarex8.php deleted file mode 100644 index 8322ebcd..00000000 --- a/#jpgraph/src/Examples/polarex8.php +++ /dev/null @@ -1,54 +0,0 @@ -SetScale('log',100); -$graph->SetType(POLAR_180); -//$graph->SetPlotSize(250,250); - -// Hide frame around graph (by setting width=0) -$graph->SetFrame(true,'white',1); - -// Set plotarea color -$graph->SetColor('lightblue'); - -// Show both major and minor grid lines -$graph->axis->ShowGrid(true,true); - -// Set color for gradient lines -$graph->axis->SetGridColor('lightblue:0.8','lightblue:0.8','lightblue:0.8'); - -// Setup axis title -$graph->axis->SetTitle('Coverage (in meter)','middle'); -$graph->axis->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->title->Set('Polar plot #8'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->SetColor('navy'); - -// Adjust legen box position and color -$graph->legend->SetColor('navy','darkgray'); -$graph->legend->SetFillColor('white'); -$graph->legend->SetShadow('darkgray@0.5',5); - -$p = new PolarPlot($data); -$p->SetFillColor('white@0.5'); -$p->mark->SetType(MARK_SQUARE); -$p->SetLegend("Mirophone #1\n(No amps)"); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/polarex9.php b/#jpgraph/src/Examples/polarex9.php deleted file mode 100644 index ee239ec0..00000000 --- a/#jpgraph/src/Examples/polarex9.php +++ /dev/null @@ -1,63 +0,0 @@ -SetScale('log',100); -$graph->SetType(POLAR_180); - -// Hide frame around graph (by setting width=0) -$graph->SetFrame(true,'white',1); - -// Show both major and minor grid lines -$graph->axis->ShowGrid(true,true); - -// Set color for gradient lines -$graph->axis->SetGridColor('lightblue:0.9','lightblue:0.9','lightblue:0.9'); - -// Set label and axis colors -$graph->axis->SetColor('black','navy','darkred'); - -// Draw the ticks on the bottom side of the radius axis -$graph->axis->SetTickSide(SIDE_DOWN); - -// Increase the margin for the labels since we changed the -// side of the ticks. -$graph->axis->SetLabelMargin(6); - -// Change fonts -$graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8); -$graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8); - -// Setup axis title -$graph->axis->SetTitle('Coverage (in meter)','middle'); -$graph->axis->title->SetFont(FF_FONT1,FS_BOLD); - -// Setup graph title -$graph->title->Set('Polar plot #9'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->SetColor('navy'); - -// Setup tab title -$graph->tabtitle->Set('Microphone #1'); -$graph->tabtitle->SetColor('brown:0.5','lightyellow'); - - -$p = new PolarPlot($data); -$p->SetFillColor('lightblue@0.5'); -$p->mark->SetType(MARK_SQUARE); - -$graph->Add($p); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/prepaccdata_example.php b/#jpgraph/src/Examples/prepaccdata_example.php deleted file mode 100644 index 1f1fca31..00000000 --- a/#jpgraph/src/Examples/prepaccdata_example.php +++ /dev/null @@ -1,61 +0,0 @@ -title->Set('Accumulated values with specified X-axis scale'); -$graph->SetScale('textlin'); - -// Setup margin color -$graph->SetMarginColor('green@0.95'); - -// Adjust the margin to make room for the X-labels -$graph->SetMargin(40,30,40,120); - -// Turn the tick marks out from the plot area -$graph->xaxis->SetTickSide(SIDE_BOTTOM); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -$p0 =new LinePlot($ydata[0]); -$p0->SetFillColor('sandybrown'); -$p1 =new LinePlot($ydata[1]); -$p1->SetFillColor('lightblue'); -$p2 =new LinePlot($ydata[2]); -$p2->SetFillColor('red'); -$ap = new AccLinePlot(array($p0,$p1,$p2)); - -$graph->xaxis->SetTickLabels($xdata); -$graph->xaxis->SetTextLabelInterval(4); - -// Add the plot to the graph -$graph->Add($ap); - -// Set the angle for the labels to 90 degrees -$graph->xaxis->SetLabelAngle(90); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/pushpinex1.php b/#jpgraph/src/Examples/pushpinex1.php deleted file mode 100644 index 4b100988..00000000 --- a/#jpgraph/src/Examples/pushpinex1.php +++ /dev/null @@ -1,62 +0,0 @@ -img->SetMargin(1,1,1,1); -$graph->SetScale('linlin',0,100,0,100); - -// We don't want any axis to be shown -$graph->xaxis->Hide(); -$graph->yaxis->Hide(); - -// Use a worldmap as the background and let it fill the plot area -$graph->SetBackgroundImage(WORLDMAP,BGIMG_FILLPLOT); - -// Setup a nice title with a striped bevel background -$graph->title->Set("Pushpin graph"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->SetColor('white'); -$graph->SetTitleBackground('darkgreen',TITLEBKG_STYLE1,TITLEBKG_FRAME_BEVEL); -$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'blue','darkgreen'); - -// Finally create the scatterplot -$sp = new ScatterPlot($datay,$datax); - -// We want the markers to be an image -$sp->mark->SetType(MARK_IMG_PUSHPIN,'blue',0.6); - -// Install the Y-X callback for the markers -$sp->mark->SetCallbackYX('markCallback'); - -// ... and add it to the graph -$graph->Add($sp); - -// .. and output to browser -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/pushpinex2.php b/#jpgraph/src/Examples/pushpinex2.php deleted file mode 100644 index 000d1cc2..00000000 --- a/#jpgraph/src/Examples/pushpinex2.php +++ /dev/null @@ -1,63 +0,0 @@ -img->SetMargin(1,1,1,1); -$graph->SetScale('linlin',0,100,0,100); - -// We don't want any axis to be shown -$graph->xaxis->Hide(); -$graph->yaxis->Hide(); - -// Use a worldmap as the background and let it fill the plot area -$graph->SetBackgroundImage(WORLDMAP,BGIMG_FILLPLOT); - -// Setup a nice title with a striped bevel background -$graph->title->Set("Pushpin graph"); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->SetColor('white'); -$graph->SetTitleBackground('darkgreen',TITLEBKG_STYLE1,TITLEBKG_FRAME_BEVEL); -$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'blue','darkgreen'); - -// Finally create the lineplot -$lp = new LinePlot($datay,$datax); -$lp->SetColor('lightgray'); - -// We want the markers to be an image -$lp->mark->SetType(MARK_IMG_PUSHPIN,'blue',0.6); - -// Install the Y-X callback for the markers -$lp->mark->SetCallbackYX('markCallback'); - -// ... and add it to the graph -$graph->Add($lp); - -// .. and output to browser -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/qr-input.txt b/#jpgraph/src/Examples/qr-input.txt deleted file mode 100644 index 1b3c2bcd..00000000 --- a/#jpgraph/src/Examples/qr-input.txt +++ /dev/null @@ -1 +0,0 @@ -01234567890 \ No newline at end of file diff --git a/#jpgraph/src/Examples/qr_template.php b/#jpgraph/src/Examples/qr_template.php deleted file mode 100644 index e54ea782..00000000 --- a/#jpgraph/src/Examples/qr_template.php +++ /dev/null @@ -1,32 +0,0 @@ -SetModuleWidth($modulewidth); - -// Set Quiet zone (this should rarely need changing from the default) -$backend->SetQuietZone($quiet); - -if( $back == BACKEND_IMAGE ) { - - $backend->Stroke($data); -} -else { - $str = $backend->Stroke($data); - echo '
'.$str.'
'; -} -?> diff --git a/#jpgraph/src/Examples/qrexample0.php b/#jpgraph/src/Examples/qrexample0.php deleted file mode 100644 index 46126fe7..00000000 --- a/#jpgraph/src/Examples/qrexample0.php +++ /dev/null @@ -1,23 +0,0 @@ -Stroke($data); -} catch (Exception $e) { - $errstr = $e->GetMessage(); - echo 'QR Code error: '.$e->GetMessage()."\n"; - exit(1); -} - -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/qrexample00.php b/#jpgraph/src/Examples/qrexample00.php deleted file mode 100644 index f09fcd5d..00000000 --- a/#jpgraph/src/Examples/qrexample00.php +++ /dev/null @@ -1,16 +0,0 @@ -Stroke($data); -?> \ No newline at end of file diff --git a/#jpgraph/src/Examples/qrexample01.php b/#jpgraph/src/Examples/qrexample01.php deleted file mode 100644 index af99deaf..00000000 --- a/#jpgraph/src/Examples/qrexample01.php +++ /dev/null @@ -1,19 +0,0 @@ -SetModuleWidth(5); - -// .. send the barcode back to the browser for the data -$backend->Stroke($data); -?> diff --git a/#jpgraph/src/Examples/qrexample02.php b/#jpgraph/src/Examples/qrexample02.php deleted file mode 100644 index 890d616c..00000000 --- a/#jpgraph/src/Examples/qrexample02.php +++ /dev/null @@ -1,23 +0,0 @@ -SetModuleWidth(5); - - // .. send the barcode back to the browser for the data - $backend->Stroke($data); -?> diff --git a/#jpgraph/src/Examples/qrexample03.php b/#jpgraph/src/Examples/qrexample03.php deleted file mode 100644 index 858eede3..00000000 --- a/#jpgraph/src/Examples/qrexample03.php +++ /dev/null @@ -1,27 +0,0 @@ -SetModuleWidth(5); - - // Store the barcode in the specifed file - $backend->Stroke($data,$fileName); - list($version,$errorcorrection) = $backend->GetQRInfo(); - - echo "QR Barcode, (Version: $version-$errorcorrection), image stored in file $fileName"; -?> diff --git a/#jpgraph/src/Examples/qrexample03.png b/#jpgraph/src/Examples/qrexample03.png deleted file mode 100644 index 091a1cc2..00000000 Binary files a/#jpgraph/src/Examples/qrexample03.png and /dev/null differ diff --git a/#jpgraph/src/Examples/qrexample04.php b/#jpgraph/src/Examples/qrexample04.php deleted file mode 100644 index c86447ae..00000000 --- a/#jpgraph/src/Examples/qrexample04.php +++ /dev/null @@ -1,24 +0,0 @@ -SetModuleWidth(3); - - // Store the barcode in the specifed file - $backend->Stroke($data); -?> diff --git a/#jpgraph/src/Examples/qrexample05.php b/#jpgraph/src/Examples/qrexample05.php deleted file mode 100644 index 96f5f47a..00000000 --- a/#jpgraph/src/Examples/qrexample05.php +++ /dev/null @@ -1,29 +0,0 @@ -SetModuleWidth(4); - - // Store the barcode in the specifed file - $backend->Stroke($data); -?> diff --git a/#jpgraph/src/Examples/qrexample06.php b/#jpgraph/src/Examples/qrexample06.php deleted file mode 100644 index 046627f2..00000000 --- a/#jpgraph/src/Examples/qrexample06.php +++ /dev/null @@ -1,26 +0,0 @@ -SetImgFormat('jpeg',80); - - // Set the module size - $backend->SetModuleWidth(4); - - // Store the barcode in the specifed file - $backend->Stroke($data); -?> diff --git a/#jpgraph/src/Examples/qrexample07.php b/#jpgraph/src/Examples/qrexample07.php deleted file mode 100644 index 68dde156..00000000 --- a/#jpgraph/src/Examples/qrexample07.php +++ /dev/null @@ -1,26 +0,0 @@ -SetModuleWidth(4); - - // Store the barcode in the specifed file - $backend->Stroke($data); -?> diff --git a/#jpgraph/src/Examples/qrexample08.php b/#jpgraph/src/Examples/qrexample08.php deleted file mode 100644 index 08eb947b..00000000 --- a/#jpgraph/src/Examples/qrexample08.php +++ /dev/null @@ -1,22 +0,0 @@ -SetModuleWidth(5); - - // .. send the barcode back to the browser for the data in the file - $backend->StrokeFromFile($readFromFilename); -?> diff --git a/#jpgraph/src/Examples/qrexample09.php b/#jpgraph/src/Examples/qrexample09.php deleted file mode 100644 index faa2a5de..00000000 --- a/#jpgraph/src/Examples/qrexample09.php +++ /dev/null @@ -1,25 +0,0 @@ -SetModuleWidth(5); - - // Use blue and white colors instead - $backend->SetColor('navy','white'); - - // .. send the barcode back to the browser for the data in the file - $backend->StrokeFromFile($readFromFilename); -?> diff --git a/#jpgraph/src/Examples/qrexample10.php b/#jpgraph/src/Examples/qrexample10.php deleted file mode 100644 index 1232754a..00000000 --- a/#jpgraph/src/Examples/qrexample10.php +++ /dev/null @@ -1,26 +0,0 @@ -SetModuleWidth(3); - - // Set color - $backend->SetColor('brown','white'); - - // Store the barcode in the specifed file - $backend->Stroke($data); -?> diff --git a/#jpgraph/src/Examples/qrexample11.php b/#jpgraph/src/Examples/qrexample11.php deleted file mode 100644 index 2f3e503e..00000000 --- a/#jpgraph/src/Examples/qrexample11.php +++ /dev/null @@ -1,26 +0,0 @@ -SetModuleWidth($modulewidth); - -// Store the barcode in the specifed file -$ps_str = $backend->Stroke($data); - -echo '
'.$ps_str.'
'; -?> diff --git a/#jpgraph/src/Examples/qrexample12.php b/#jpgraph/src/Examples/qrexample12.php deleted file mode 100644 index d1e09046..00000000 --- a/#jpgraph/src/Examples/qrexample12.php +++ /dev/null @@ -1,26 +0,0 @@ -SetModuleWidth($modulewidth); - -// Store the barcode in the specifed file -$ps_str = $backend->Stroke($data); - -echo '
'.$ps_str.'
'; -?> diff --git a/#jpgraph/src/Examples/radar_csimex1.php b/#jpgraph/src/Examples/radar_csimex1.php deleted file mode 100644 index 1f0454d8..00000000 --- a/#jpgraph/src/Examples/radar_csimex1.php +++ /dev/null @@ -1,43 +0,0 @@ -title->Set('Radar with marks'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetMargin(10); - -$graph->SetTitles($titles); -$graph->SetCenter(0.5,0.55); -$graph->HideTickMarks(); -$graph->SetColor('lightgreen@0.7'); -$graph->axis->SetColor('darkgray'); -$graph->grid->SetColor('darkgray'); -$graph->grid->Show(); - -$graph->axis->title->SetFont(FF_ARIAL,FS_NORMAL,12); -$graph->axis->title->SetMargin(5); -$graph->SetGridDepth(DEPTH_BACK); -$graph->SetSize(0.6); - -$plot = new RadarPlot($data); -$plot->SetColor('red@0.2'); -$plot->SetLineWeight(2); -$plot->SetFillColor('red@0.7'); -$plot->mark->SetType(MARK_IMG_DIAMOND,'red',0.6); -$plot->mark->SetFillColor('darkred'); -$plot->SetCSIMTargets( $targets , $alts ); - -$graph->Add($plot); -$graph->StrokeCSIM(); -?> diff --git a/#jpgraph/src/Examples/radarex1.php b/#jpgraph/src/Examples/radarex1.php deleted file mode 100644 index a2103757..00000000 --- a/#jpgraph/src/Examples/radarex1.php +++ /dev/null @@ -1,16 +0,0 @@ -Add($plot); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/radarex2.php b/#jpgraph/src/Examples/radarex2.php deleted file mode 100644 index a1400a3f..00000000 --- a/#jpgraph/src/Examples/radarex2.php +++ /dev/null @@ -1,21 +0,0 @@ -title->Set('Weekly goals'); -$graph->subtitle->Set('Year 2003'); - -$plot = new RadarPlot($data); -$plot->SetFillColor('lightred'); -$graph->SetSize(0.6); -$graph->SetPos(0.5,0.6); -// Add the plot and display the graph -$graph->Add($plot); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/radarex3.php b/#jpgraph/src/Examples/radarex3.php deleted file mode 100644 index 18fdd902..00000000 --- a/#jpgraph/src/Examples/radarex3.php +++ /dev/null @@ -1,21 +0,0 @@ -GetShortMonth(); -$graph->SetTitles($titles); - -$plot = new RadarPlot($data); -$plot->SetFillColor('lightblue'); - -// Add the plot and display the graph -$graph->Add($plot); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/radarex4.php b/#jpgraph/src/Examples/radarex4.php deleted file mode 100644 index f64f6148..00000000 --- a/#jpgraph/src/Examples/radarex4.php +++ /dev/null @@ -1,28 +0,0 @@ -SetShadow(); - -// Create the titles for the axis -$titles = $gDateLocale->GetShortMonth(); -$graph->SetTitles($titles); - -// Add grid lines -$graph->grid->Show(); -$graph->grid->SetLineStyle('dashed'); - -$plot = new RadarPlot($data); -$plot->SetFillColor('lightblue'); - -// Add the plot and display the graph -$graph->Add($plot); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/radarex5.php b/#jpgraph/src/Examples/radarex5.php deleted file mode 100644 index 6ee42aef..00000000 --- a/#jpgraph/src/Examples/radarex5.php +++ /dev/null @@ -1,26 +0,0 @@ -GetShortMonth(); -$graph->SetTitles($titles); - -// Add grid lines -$graph->grid->Show(); -$graph->grid->SetColor('darkred'); -$graph->grid->SetLineStyle('dotted'); - -$plot = new RadarPlot($data); -$plot->SetFillColor('lightblue'); - -// Add the plot and display the graph -$graph->Add($plot); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/radarex6.1.php b/#jpgraph/src/Examples/radarex6.1.php deleted file mode 100644 index e6f9a50e..00000000 --- a/#jpgraph/src/Examples/radarex6.1.php +++ /dev/null @@ -1,45 +0,0 @@ -SetShadow(); - -// Create the titles for the axis -$titles = $gDateLocale->GetShortMonth(); -$graph->SetTitles($titles); -$graph->SetColor('lightyellow'); - -// ADjust the position to make more room -// for the legend -$graph->SetCenter(0.4,0.55); -$graph->SetSize(0.6); - -// Add grid lines -$graph->grid->Show(); -$graph->grid->SetColor('darkred'); -$graph->grid->SetLineStyle('dotted'); - -$plot = new RadarPlot($data); -$plot->SetFillColor('lightblue'); -$plot->SetLegend("QA results"); - -$plot2 = new RadarPlot($data2); -$plot2->SetLegend("Target"); -$plot2->SetColor('red'); -$plot2->SetFill(false); -$plot2->SetLineWeight(2); - - -// Add the plot and display the graph -$graph->Add($plot); -$graph->Add($plot2); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/radarex6.php b/#jpgraph/src/Examples/radarex6.php deleted file mode 100644 index d702f294..00000000 --- a/#jpgraph/src/Examples/radarex6.php +++ /dev/null @@ -1,35 +0,0 @@ -SetShadow(); - -// Create the titles for the axis -$titles = $gDateLocale->GetShortMonth(); -$graph->SetTitles($titles); -$graph->SetColor('lightyellow'); - -// ADjust the position to make more room -// for the legend -$graph->SetCenter(0.45,0.5); - -// Add grid lines -$graph->grid->Show(); -$graph->grid->SetColor('darkred'); -$graph->grid->SetLineStyle('dashed'); - -$plot = new RadarPlot($data); -$plot->SetFillColor('lightblue'); -$plot->SetLegend("QA results"); - -// Add the plot and display the graph -$graph->Add($plot); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/radarex7.php b/#jpgraph/src/Examples/radarex7.php deleted file mode 100644 index cb44c208..00000000 --- a/#jpgraph/src/Examples/radarex7.php +++ /dev/null @@ -1,48 +0,0 @@ -SetColor("white"); -$graph->SetShadow(); - -// Position the graph -$graph->SetCenter(0.4,0.55); - -// Setup the axis formatting -$graph->axis->SetFont(FF_FONT1,FS_BOLD); -$graph->axis->SetWeight(2); - -// Setup the grid lines -$graph->grid->SetLineStyle("longdashed"); -$graph->grid->SetColor("navy"); -$graph->grid->Show(); -$graph->HideTickMarks(); - -// Setup graph titles -$graph->title->Set("Quality result"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->SetTitles(array("One","Two","Three","Four","Five","Sex","Seven","Eight","Nine","Ten")); -// Create the first radar plot -$plot = new RadarPlot(array(30,80,60,40,71,81,47)); -$plot->SetLegend("Goal"); -$plot->SetColor("red","lightred"); -$plot->SetFill(false); -$plot->SetLineWeight(2); - -// Create the second radar plot -$plot2 = new RadarPlot(array(70,40,30,80,31,51,14)); -$plot2->SetLegend("Actual"); -$plot2->SetColor("blue","lightred"); - -// Add the plots to the graph -$graph->Add($plot2); -$graph->Add($plot); - -// And output the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/radarex8.1.php b/#jpgraph/src/Examples/radarex8.1.php deleted file mode 100644 index e1f1336b..00000000 --- a/#jpgraph/src/Examples/radarex8.1.php +++ /dev/null @@ -1,52 +0,0 @@ -img->SetAntiAliasing(); - -// Set background color and shadow -$graph->SetColor("white"); -$graph->SetShadow(); - -// Position the graph -$graph->SetCenter(0.4,0.55); - -// Setup the axis formatting -$graph->axis->SetFont(FF_FONT1,FS_BOLD); - -// Setup the grid lines -$graph->grid->SetLineStyle("solid"); -$graph->grid->SetColor("navy"); -$graph->grid->Show(); -$graph->HideTickMarks(); - -// Setup graph titles -$graph->title->Set("Quality result"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->SetTitles($gDateLocale->GetShortMonth()); - -// Create the first radar plot -$plot = new RadarPlot(array(70,80,60,90,71,81,47)); -$plot->SetLegend("Goal"); -$plot->SetColor("red","lightred"); -$plot->SetFill(false); -$plot->SetLineWeight(2); - -// Create the second radar plot -$plot2 = new RadarPlot(array(70,40,30,80,31,51,14)); -$plot2->SetLegend("Actual"); -$plot2->SetLineWeight(2); -$plot2->SetColor("blue"); -$plot2->SetFill(false); - -// Add the plots to the graph -$graph->Add($plot2); -$graph->Add($plot); - -// And output the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/radarex8.php b/#jpgraph/src/Examples/radarex8.php deleted file mode 100644 index 0d6b0f87..00000000 --- a/#jpgraph/src/Examples/radarex8.php +++ /dev/null @@ -1,51 +0,0 @@ -img->SetAntiAliasing(); - -// Set background color and shadow -$graph->SetColor("white"); -$graph->SetShadow(); - -// Position the graph -$graph->SetCenter(0.4,0.55); - -// Setup the axis formatting -$graph->axis->SetFont(FF_FONT1,FS_BOLD); - -// Setup the grid lines -$graph->grid->SetLineStyle("solid"); -$graph->grid->SetColor("navy"); -$graph->grid->Show(); -$graph->HideTickMarks(); - -// Setup graph titles -$graph->title->Set("Quality result"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->SetTitles($gDateLocale->GetShortMonth()); - -// Create the first radar plot -$plot = new RadarPlot(array(70,80,60,90,71,81,47)); -$plot->SetLegend("Goal"); -$plot->SetColor("red","lightred"); -$plot->SetFill(false); -$plot->SetLineWeight(2); - -// Create the second radar plot -$plot2 = new RadarPlot(array(70,40,30,80,31,51,14)); -$plot2->SetLegend("Actual"); -$plot2->SetLineWeight(2); -$plot2->SetColor("blue"); -$plot2->SetFill(false); - -// Add the plots to the graph -$graph->Add($plot2); -$graph->Add($plot); - -// And output the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/radarex9.php b/#jpgraph/src/Examples/radarex9.php deleted file mode 100644 index 465ca262..00000000 --- a/#jpgraph/src/Examples/radarex9.php +++ /dev/null @@ -1,33 +0,0 @@ -title->Set("Accumulated PPM"); -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,12); - -$graph->subtitle->Set("(according to direction)"); -$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); - - -$graph->SetTitles($titles); -$graph->SetCenter(0.5,0.55); -$graph->HideTickMarks(); -$graph->SetColor('lightyellow'); -$graph->axis->SetColor('darkgray@0.3'); -$graph->grid->SetColor('darkgray@0.3'); -$graph->grid->Show(); - -$graph->SetGridDepth(DEPTH_BACK); - -$plot = new RadarPlot($data); -$plot->SetColor('red@0.2'); -$plot->SetLineWeight(1); -$plot->SetFillColor('red@0.7'); -$graph->Add($plot); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/radarlogex1-aa.php b/#jpgraph/src/Examples/radarlogex1-aa.php deleted file mode 100644 index 8417fb76..00000000 --- a/#jpgraph/src/Examples/radarlogex1-aa.php +++ /dev/null @@ -1,60 +0,0 @@ -SetScale('log'); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->Set('Logarithmic scale'); -$graph->title->SetMargin(10); - -// Make the radar graph fill out it's bounding box -$graph->SetPlotSize(0.8); -$graph->SetCenter(0.5,0.55); - -// Note: Enabling this results in a very noticable slow -// down of the image generation! And more load on your -// server. -$graph->img->SetAntiAliasing(); - -// Uncomment the following line if you want to supress -// minor tick marks -//$graph->yscale->ticks->SupressMinorTickMarks(); - -// We want the major tick marks to be black and minor -// slightly less noticable -$graph->yscale->ticks->SetMarkColor('black','darkgray'); - -// Set the axis title font -$graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->axis->title->SetColor('darkred:0.8'); - -// Use blue axis -$graph->axis->SetColor('blue'); - -$plot = new RadarPlot($data); -$plot->SetLineWeight(1); -$plot->SetColor('forestgreen'); -$plot->SetFillColor('forestgreen@0.9'); - -$plot2 = new RadarPlot($data2); -$plot2->SetLineWeight(2); -$plot2->SetColor('red'); -$plot2->SetFillColor('red@0.9'); - -// Add the plot and display the graph -$graph->Add($plot); -$graph->Add($plot2); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/radarlogex1.php b/#jpgraph/src/Examples/radarlogex1.php deleted file mode 100644 index 2d08310e..00000000 --- a/#jpgraph/src/Examples/radarlogex1.php +++ /dev/null @@ -1,55 +0,0 @@ -SetScale('log'); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); -$graph->title->Set('Logarithmic scale'); -$graph->title->SetMargin(10); - -// Make the radar graph fill out it's bounding box -$graph->SetPlotSize(0.8); -$graph->SetCenter(0.5,0.55); - -// Uncomment the following line if you want to supress -// minor tick marks -//$graph->yscale->ticks->SupressMinorTickMarks(); - -// We want the major tick marks to be black and minor -// slightly less noticable -$graph->yscale->ticks->SetMarkColor('black','darkgray'); - -// Set the axis title font -$graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->axis->title->SetColor('darkred:0.8'); - -// Use blue axis -$graph->axis->SetColor('blue'); - -$plot = new RadarPlot($data); -$plot->SetLineWeight(1); -$plot->SetColor('forestgreen'); -$plot->SetFillColor('forestgreen@0.9'); - -$plot2 = new RadarPlot($data2); -$plot2->SetLineWeight(2); -$plot2->SetColor('red'); -$plot2->SetFillColor('red@0.9'); - -// Add the plot and display the graph -$graph->Add($plot); -$graph->Add($plot2); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/radarlogex2.php b/#jpgraph/src/Examples/radarlogex2.php deleted file mode 100644 index f347141c..00000000 --- a/#jpgraph/src/Examples/radarlogex2.php +++ /dev/null @@ -1,47 +0,0 @@ -img->SetAntiAliasing(); - -// Make the spider graph fill out it's bounding box -$graph->SetPlotSize(0.85); - -// Use logarithmic scale (If you don't use any SetScale() -// the spider graph will default to linear scale -$graph->SetScale("log"); - -// Uncomment the following line if you want to supress -// minor tick marks -// $graph->yscale->ticks->SupressMinorTickMarks(); - -// We want the major tick marks to be black and minor -// slightly less noticable -$graph->yscale->ticks->SetMarkColor("black","darkgray"); - -// Set the axis title font -$graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// Use blue axis -$graph->axis->SetColor("blue"); - -$plot = new RadarPlot($data); -$plot->SetLineWeight(2); -$plot->SetColor('forestgreen'); - -// Add the plot and display the graph -$graph->Add($plot); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/radarmarkex1.php b/#jpgraph/src/Examples/radarmarkex1.php deleted file mode 100644 index f5595e8a..00000000 --- a/#jpgraph/src/Examples/radarmarkex1.php +++ /dev/null @@ -1,35 +0,0 @@ -title->Set('Radar with marks'); -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,12); - -$graph->SetTitles($titles); -$graph->SetCenter(0.5,0.55); -$graph->HideTickMarks(); -$graph->SetColor('lightgreen@0.7'); -$graph->axis->SetColor('darkgray'); -$graph->grid->SetColor('darkgray'); -$graph->grid->Show(); - -$graph->axis->title->SetFont(FF_ARIAL,FS_NORMAL,12); -$graph->axis->title->SetMargin(5); -$graph->SetGridDepth(DEPTH_BACK); -$graph->SetSize(0.6); - -$plot = new RadarPlot($data); -$plot->SetColor('red@0.2'); -$plot->SetLineWeight(1); -$plot->SetFillColor('red@0.7'); - -$plot->mark->SetType(MARK_IMG_SBALL,'red'); - -$graph->Add($plot); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/rose.gif b/#jpgraph/src/Examples/rose.gif deleted file mode 100644 index 59fe6319..00000000 Binary files a/#jpgraph/src/Examples/rose.gif and /dev/null differ diff --git a/#jpgraph/src/Examples/rose_example.php b/#jpgraph/src/Examples/rose_example.php deleted file mode 100644 index 7d3d7c57..00000000 --- a/#jpgraph/src/Examples/rose_example.php +++ /dev/null @@ -1,57 +0,0 @@ - array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), - 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), - 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), - 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), - 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), - 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), - 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), - 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), - 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), -); - -// Create the graph. These two calls are always required -$graph = new Graph(400,300); - -$graph->SetScale("textlin"); -if ($theme) { - $graph->SetTheme(new $theme()); -} -$theme_class = new RoseTheme; -$graph->SetTheme($theme_class); - -$plot = array(); -// Create the bar plots -for ($i = 0; $i < 4; $i++) { - $plot[$i] = new BarPlot($data[$i]); - $plot[$i]->SetLegend('plot'.($i+1)); -} -//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); -//$acc1->value->Show(); -$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); - -for ($i = 4; $i < 8; $i++) { - $plot[$i] = new LinePlot($data[$i]); - $plot[$i]->SetLegend('plot'.$i); - $plot[$i]->value->Show(); -} - -$graph->Add($gbplot); -$graph->Add($plot[4]); - -$title = "RoseTheme Example"; -$title = mb_convert_encoding($title,'UTF-8'); -$graph->title->Set($title); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/rotateex1.php b/#jpgraph/src/Examples/rotateex1.php deleted file mode 100644 index a90a6003..00000000 --- a/#jpgraph/src/Examples/rotateex1.php +++ /dev/null @@ -1,46 +0,0 @@ -SetAngle(40); -$graph->img->SetMargin(80,80,80,80); -$graph->SetScale("textlin"); -$graph->SetY2Scale("lin"); -$graph->SetShadow(); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot2=new LinePlot($y2data); - -// Add the plot to the graph -$graph->Add($lineplot); -$graph->AddY2($lineplot2); -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); -$graph->y2axis->SetColor("orange"); - -$graph->title->Set("Example 1 rotated graph (40 degree)"); -$graph->legend->Pos(0.05,0.1,"right","top"); - -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$lineplot->SetColor("blue"); -$lineplot->SetWeight(2); - -$lineplot2->SetColor("orange"); -$lineplot2->SetWeight(2); - -$graph->yaxis->SetColor("blue"); - -$lineplot->SetLegend("Plot 1"); -$lineplot2->SetLegend("Plot 2"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/rotex0.php b/#jpgraph/src/Examples/rotex0.php deleted file mode 100644 index 83d26bb8..00000000 --- a/#jpgraph/src/Examples/rotex0.php +++ /dev/null @@ -1,22 +0,0 @@ -SetMargin(30,90,30,30); -$graph->SetScale("textlin"); - -$line = new LinePlot($ydata); -$line->SetLegend('2002'); -$line->SetColor('darkred'); -$line->SetWeight(2); -$graph->Add($line); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/rotex1.php b/#jpgraph/src/Examples/rotex1.php deleted file mode 100644 index f087b98e..00000000 --- a/#jpgraph/src/Examples/rotex1.php +++ /dev/null @@ -1,24 +0,0 @@ -SetMargin(30,90,30,30); -$graph->SetScale("textlin"); - -$graph->img->SetAngle(45); - -$line = new LinePlot($ydata); -$line->SetLegend('2002'); -$line->SetColor('darkred'); -$line->SetWeight(2); -$graph->Add($line); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/rotex2.php b/#jpgraph/src/Examples/rotex2.php deleted file mode 100644 index bfdea5a7..00000000 --- a/#jpgraph/src/Examples/rotex2.php +++ /dev/null @@ -1,24 +0,0 @@ -SetMargin(30,90,30,30); -$graph->SetScale("textlin"); - -$graph->img->SetAngle(90); - -$line = new LinePlot($ydata); -$line->SetLegend('2002'); -$line->SetColor('darkred'); -$line->SetWeight(2); -$graph->Add($line); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/rotex3.php b/#jpgraph/src/Examples/rotex3.php deleted file mode 100644 index 3a0a03d4..00000000 --- a/#jpgraph/src/Examples/rotex3.php +++ /dev/null @@ -1,25 +0,0 @@ -SetMargin(30,90,30,30); -$graph->SetScale("textlin"); - -$graph->img->SetAngle(45); -$graph->img->SetCenter(floor(270/2),floor(170/2)); - -$line = new LinePlot($ydata); -$line->SetLegend('2002'); -$line->SetColor('darkred'); -$line->SetWeight(2); -$graph->Add($line); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/rotex4.php b/#jpgraph/src/Examples/rotex4.php deleted file mode 100644 index 9c01a7b2..00000000 --- a/#jpgraph/src/Examples/rotex4.php +++ /dev/null @@ -1,25 +0,0 @@ -SetMargin(30,90,30,30); -$graph->SetScale("textlin"); - -$graph->img->SetAngle(90); -$graph->img->SetCenter(floor(270/2),floor(170/2)); - -$line = new LinePlot($ydata); -$line->SetLegend('2002'); -$line->SetColor('darkred'); -$line->SetWeight(2); -$graph->Add($line); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/rotex5.php b/#jpgraph/src/Examples/rotex5.php deleted file mode 100644 index bdf0d93f..00000000 --- a/#jpgraph/src/Examples/rotex5.php +++ /dev/null @@ -1,25 +0,0 @@ -SetMargin(30,90,30,30); -$graph->SetScale("textlin"); - -$graph->img->SetAngle(-30); -$graph->img->SetCenter(30,170-30); - -$line = new LinePlot($ydata); -$line->SetLegend('2002'); -$line->SetColor('darkred'); -$line->SetWeight(2); -$graph->Add($line); - -// Output graph -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/saab_95.jpg b/#jpgraph/src/Examples/saab_95.jpg deleted file mode 100644 index 189b0d48..00000000 Binary files a/#jpgraph/src/Examples/saab_95.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/scatter_csimex1.php b/#jpgraph/src/Examples/scatter_csimex1.php deleted file mode 100644 index 2ab4306d..00000000 --- a/#jpgraph/src/Examples/scatter_csimex1.php +++ /dev/null @@ -1,44 +0,0 @@ -SetShadow(); -$graph->SetScale("linlin"); - -//$graph->img->SetMargin(40,40,40,40); - -$graph->title->Set("Scatter plot with Image Map"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Client side image map targets -$targ=array("pie_csimex1.php#1","pie_csimex1.php#2","pie_csimex1.php#3", -"pie_csimex1.php#4","pie_csimex1.php#5","pie_csimex1.php#6", -"pie_csimex1.php#7","pie_csimex1.php#8","pie_csimex1.php#9" ); - -// Strings to put as "alts" (and "title" value) -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); - -// Create a new scatter plot -$sp1 = new ScatterPlot($datay,$datax); - -// Use diamonds as markerss -$sp1->mark->SetType(MARK_DIAMOND); -$sp1->mark->SetWidth(10); - -// Set the scatter plot image map targets -$sp1->SetCSIMTargets($targ,$alts); - -// Add the plot -$graph->Add($sp1); - -// Send back the HTML page which will call this script again -// to retrieve the image. -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/scatterex1.php b/#jpgraph/src/Examples/scatterex1.php deleted file mode 100644 index 83d830b8..00000000 --- a/#jpgraph/src/Examples/scatterex1.php +++ /dev/null @@ -1,22 +0,0 @@ -SetScale("linlin"); - -$graph->img->SetMargin(40,40,40,40); -$graph->SetShadow(); - -$graph->title->Set("A simple scatter plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$sp1 = new ScatterPlot($datay,$datax); - -$graph->Add($sp1); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/scatterex2.php b/#jpgraph/src/Examples/scatterex2.php deleted file mode 100644 index ff2b847d..00000000 --- a/#jpgraph/src/Examples/scatterex2.php +++ /dev/null @@ -1,25 +0,0 @@ -SetScale("linlin"); - -$graph->img->SetMargin(40,40,40,40); -$graph->SetShadow(); - -$graph->title->Set("A simple scatter plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$sp1 = new ScatterPlot($datay,$datax); -$sp1->mark->SetType(MARK_FILLEDCIRCLE); -$sp1->mark->SetFillColor("red"); -$sp1->mark->SetWidth(8); - -$graph->Add($sp1); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/scatterlinkex1.php b/#jpgraph/src/Examples/scatterlinkex1.php deleted file mode 100644 index 2f2d1bdd..00000000 --- a/#jpgraph/src/Examples/scatterlinkex1.php +++ /dev/null @@ -1,26 +0,0 @@ -img->SetMargin(40,40,40,40); -$graph->img->SetAntiAliasing(); -$graph->SetScale("linlin"); -$graph->SetShadow(); -$graph->title->Set("Linked Scatter plot ex1"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -$sp1 = new ScatterPlot($datay,$datax); -$sp1->SetLinkPoints(true,"red",2); -$sp1->mark->SetType(MARK_FILLEDCIRCLE); -$sp1->mark->SetFillColor("navy"); -$sp1->mark->SetWidth(3); - -$graph->Add($sp1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/scatterlinkex2.php b/#jpgraph/src/Examples/scatterlinkex2.php deleted file mode 100644 index f45f1ec3..00000000 --- a/#jpgraph/src/Examples/scatterlinkex2.php +++ /dev/null @@ -1,43 +0,0 @@ -SetScale("linlin"); - -$graph->img->SetMargin(40,40,40,40); - -$graph->SetShadow(); -$graph->title->Set("Linked scatter plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// 10% top and bottom grace -$graph->yscale->SetGrace(5,5); -$graph->xscale->SetGrace(1,1); - -$sp1 = new ScatterPlot($datay,$datax); -$sp1->mark->SetType(MARK_FILLEDCIRCLE); -$sp1->mark->SetFillColor("red"); -$sp1->SetColor("blue"); - -//$sp1->SetWeight(3); -$sp1->mark->SetWidth(4); -$sp1->SetLinkPoints(); - -$graph->Add($sp1); - -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/scatterlinkex3.php b/#jpgraph/src/Examples/scatterlinkex3.php deleted file mode 100644 index aef51508..00000000 --- a/#jpgraph/src/Examples/scatterlinkex3.php +++ /dev/null @@ -1,45 +0,0 @@ -SetScale('linlin'); -$graph->SetShadow(); -$graph->SetAxisStyle(AXSTYLE_BOXOUT); - -$graph->img->SetMargin(50,50,60,40); - -$graph->title->Set('Linked scatter plot'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->subtitle->Set('(BOXOUT Axis style)'); -$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); - - -// 10% top and bottom grace -$graph->yscale->SetGrace(5,5); -$graph->xscale->SetGrace(1,1); - -$sp1 = new ScatterPlot($datay,$datax); -$sp1->mark->SetType(MARK_FILLEDCIRCLE); -$sp1->mark->SetFillColor('red'); -$sp1->SetColor('blue'); - -$sp1->mark->SetWidth(4); -$sp1->link->Show(); -$sp1->link->SetStyle('dotted'); - -$graph->Add($sp1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/scatterlinkex4.php b/#jpgraph/src/Examples/scatterlinkex4.php deleted file mode 100644 index 63659e0e..00000000 --- a/#jpgraph/src/Examples/scatterlinkex4.php +++ /dev/null @@ -1,45 +0,0 @@ -SetScale('linlin'); -$graph->SetShadow(); -$graph->SetAxisStyle(AXSTYLE_BOXIN); - -$graph->img->SetMargin(50,50,60,40); - -$graph->title->Set('Linked scatter plot'); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->subtitle->Set('(BOXIN Axis style)'); -$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); - -// 10% top and bottom grace -$graph->yscale->SetGrace(5,5); -$graph->xscale->SetGrace(1,1); - -$sp1 = new ScatterPlot($datay,$datax); -$sp1->mark->SetType(MARK_FILLEDCIRCLE); -$sp1->mark->SetFillColor('red'); -$sp1->SetColor('blue'); - -$sp1->mark->SetWidth(4); -$sp1->link->Show(); -$sp1->link->SetWeight(2); -$sp1->link->SetColor('red@0.7'); - - -$graph->Add($sp1); -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/scatterrotex1.php b/#jpgraph/src/Examples/scatterrotex1.php deleted file mode 100644 index 6d67e5b1..00000000 --- a/#jpgraph/src/Examples/scatterrotex1.php +++ /dev/null @@ -1,35 +0,0 @@ -SetScale("linlin"); - -$graph->Set90AndMargin(40,40,40,40); -$graph->SetShadow(); - -$graph->title->Set("A 90 degrees rotated scatter plot"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Adjust the label align for X-axis so they look good rotated -$graph->xaxis->SetLabelAlign('right','center','right'); - -// Adjust the label align for Y-axis so they look good rotated -$graph->yaxis->SetLabelAlign('center','bottom'); - -$graph->xaxis->SetTitle('X-Axis title','low'); -$graph->xaxis->title->SetAngle(90); -$graph->xaxis->title->SetMargin(15); - -$sp1 = new ScatterPlot($datay,$datax); -$sp1->mark->SetType(MARK_FILLEDCIRCLE); -$sp1->mark->SetFillColor("red"); -$sp1->mark->SetWidth(5); - -$graph->Add($sp1); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/show-example.php b/#jpgraph/src/Examples/show-example.php deleted file mode 100644 index b95ac274..00000000 --- a/#jpgraph/src/Examples/show-example.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Test suite for JpGraph - <?php echo $target; ?> - - - - "; - else - echo ""; - ?> - - - diff --git a/#jpgraph/src/Examples/show-image.php b/#jpgraph/src/Examples/show-image.php deleted file mode 100644 index 85a987cd..00000000 --- a/#jpgraph/src/Examples/show-image.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Image <?php echo basename($target); ?> - - -<?php echo basename($target); ?> - - diff --git a/#jpgraph/src/Examples/show-source.php b/#jpgraph/src/Examples/show-source.php deleted file mode 100644 index 248f2dee..00000000 --- a/#jpgraph/src/Examples/show-source.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/#jpgraph/src/Examples/smallstaticbandsex1.php b/#jpgraph/src/Examples/smallstaticbandsex1.php deleted file mode 100644 index c78fc8bc..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex1.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_RDIAG,15,35,'khaki4'); -$band->ShowFrame(false); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_RDIAG'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/smallstaticbandsex10.php b/#jpgraph/src/Examples/smallstaticbandsex10.php deleted file mode 100644 index 88a091ca..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex10.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_DIAGCROSS,15,35,'khaki4'); -$band->ShowFrame(false); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_DIAGCROSS'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/smallstaticbandsex11.php b/#jpgraph/src/Examples/smallstaticbandsex11.php deleted file mode 100644 index 88a091ca..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex11.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_DIAGCROSS,15,35,'khaki4'); -$band->ShowFrame(false); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_DIAGCROSS'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/smallstaticbandsex2.php b/#jpgraph/src/Examples/smallstaticbandsex2.php deleted file mode 100644 index d9add7af..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex2.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_LDIAG,15,35,'khaki4'); -$band->ShowFrame(false); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_LDIAG'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/smallstaticbandsex3.php b/#jpgraph/src/Examples/smallstaticbandsex3.php deleted file mode 100644 index aa2a94d7..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex3.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_SOLID,15,35,'khaki4'); -$band->ShowFrame(false); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_SOLID'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/smallstaticbandsex4.php b/#jpgraph/src/Examples/smallstaticbandsex4.php deleted file mode 100644 index e4bd999c..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex4.php +++ /dev/null @@ -1,42 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_3DPLANE,15,35,'khaki4'); -$band->SetDensity(80); -$band->ShowFrame(true); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_3DPLANE, Density=60'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/smallstaticbandsex5.php b/#jpgraph/src/Examples/smallstaticbandsex5.php deleted file mode 100644 index d7f9ebb2..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex5.php +++ /dev/null @@ -1,42 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_HVCROSS,15,35,'khaki4'); -$band->ShowFrame(true); -$band->SetOrder(DEPTH_FRONT); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_HVCROSS, In front'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/smallstaticbandsex6.php b/#jpgraph/src/Examples/smallstaticbandsex6.php deleted file mode 100644 index 506e1a80..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex6.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_VLINE,15,35,'khaki4'); -$band->ShowFrame(false); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_VLINE'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/smallstaticbandsex7.php b/#jpgraph/src/Examples/smallstaticbandsex7.php deleted file mode 100644 index e07dc6a9..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex7.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_HLINE,15,35,'khaki4'); -$band->ShowFrame(false); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_HLINE'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/smallstaticbandsex8.php b/#jpgraph/src/Examples/smallstaticbandsex8.php deleted file mode 100644 index 6fbe40fb..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex8.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_3DPLANE,15,35,'khaki4'); -$band->ShowFrame(false); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_3DPLANE'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/smallstaticbandsex9.php b/#jpgraph/src/Examples/smallstaticbandsex9.php deleted file mode 100644 index b6126d80..00000000 --- a/#jpgraph/src/Examples/smallstaticbandsex9.php +++ /dev/null @@ -1,41 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,20,20); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("lightblue"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -$graph->ygrid->Show(false); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$band = new PlotBand(HORIZONTAL,BAND_HVCROSS,15,35,'khaki4'); -$band->ShowFrame(false); -$graph->Add($band); - -// Set title -$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->title->SetColor('darkred'); -$graph->title->Set('BAND_HVCROSS'); - - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/softy_example.php b/#jpgraph/src/Examples/softy_example.php deleted file mode 100644 index 4d21fc98..00000000 --- a/#jpgraph/src/Examples/softy_example.php +++ /dev/null @@ -1,58 +0,0 @@ - array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), - 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), - 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), - 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), - 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), - 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), - 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), - 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), - 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), -); - - -// Create the graph. These two calls are always required -$graph = new Graph(400,300); - -$graph->SetScale("textlin"); -if ($theme) { - $graph->SetTheme(new $theme()); -} -$theme_class = new SoftyTheme; -$graph->SetTheme($theme_class); - -$plot = array(); -// Create the bar plots -for ($i = 0; $i < 4; $i++) { - $plot[$i] = new BarPlot($data[$i]); - $plot[$i]->SetLegend('plot'.($i+1)); -} -//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); -//$acc1->value->Show(); -$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); - -for ($i = 4; $i < 8; $i++) { - $plot[$i] = new LinePlot($data[$i]); - $plot[$i]->SetLegend('plot'.$i); - $plot[$i]->value->Show(); -} - -$graph->Add($gbplot); -$graph->Add($plot[4]); - -$title = "SoftyTheme Example"; -$title = mb_convert_encoding($title,'UTF-8'); -$graph->title->Set($title); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/splineex1.php b/#jpgraph/src/Examples/splineex1.php deleted file mode 100644 index 61f60323..00000000 --- a/#jpgraph/src/Examples/splineex1.php +++ /dev/null @@ -1,56 +0,0 @@ -Get(50); - -// Create the graph -$g = new Graph(300,200); -$g->SetMargin(30,20,40,30); -$g->title->Set("Natural cubic splines"); -$g->title->SetFont(FF_ARIAL,FS_NORMAL,12); -$g->subtitle->Set('(Control points shown in red)'); -$g->subtitle->SetColor('darkred'); -$g->SetMarginColor('lightblue'); - -//$g->img->SetAntiAliasing(); - -// We need a linlin scale since we provide both -// x and y coordinates for the data points. -$g->SetScale('linlin'); - -// We want 1 decimal for the X-label -$g->xaxis->SetLabelFormat('%1.1f'); - -// We use a scatterplot to illustrate the original -// contro points. -$splot = new ScatterPlot($ydata,$xdata); - -// -$splot->mark->SetFillColor('red@0.3'); -$splot->mark->SetColor('red@0.5'); - -// And a line plot to stroke the smooth curve we got -// from the original control points -$lplot = new LinePlot($newy,$newx); -$lplot->SetColor('navy'); - -// Add the plots to the graph and stroke -$g->Add($lplot); -$g->Add($splot); -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/staticbandbarex1.php b/#jpgraph/src/Examples/staticbandbarex1.php deleted file mode 100644 index 5d59b26a..00000000 --- a/#jpgraph/src/Examples/staticbandbarex1.php +++ /dev/null @@ -1,52 +0,0 @@ -img->SetMargin(60,30,50,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,15); -$graph->title->Set("Cash flow "); -$graph->subtitle->Set("(Department X)"); - -// Show both X and Y grid -$graph->xgrid->Show(true,false); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10,10); - -// Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); - -// Show the actual value for each bar on top/bottom -$bplot->value->Show(true); -$bplot->value->SetFormat("%02d kr"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$graph->Add(new PlotBand(HORIZONTAL,BAND_HLINE,0,10)); - -//$graph->title->Set("Test of bar gradient fill"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/staticbandbarex2.php b/#jpgraph/src/Examples/staticbandbarex2.php deleted file mode 100644 index 24d3bbcb..00000000 --- a/#jpgraph/src/Examples/staticbandbarex2.php +++ /dev/null @@ -1,52 +0,0 @@ -img->SetMargin(60,30,50,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,15); -$graph->title->Set("Cash flow "); -$graph->subtitle->Set("(Department X)"); - -// Show both X and Y grid -$graph->xgrid->Show(true,false); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10,10); - -// Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); - -// Show the actual value for each bar on top/bottom -$bplot->value->Show(true); -$bplot->value->SetFormat("%02d kr"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add band -$graph->Add(new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","red",2)); - -//$graph->title->Set("Test of bar gradient fill"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/staticbandbarex3.php b/#jpgraph/src/Examples/staticbandbarex3.php deleted file mode 100644 index fa38cca1..00000000 --- a/#jpgraph/src/Examples/staticbandbarex3.php +++ /dev/null @@ -1,58 +0,0 @@ -img->SetMargin(60,30,50,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,15); -$graph->title->Set("Cash flow "); -$graph->subtitle->Set("(Department X)"); - -// Show both X and Y grid -$graph->xgrid->Show(true,false); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10,10); - -// Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); - -// Show the actual value for each bar on top/bottom -$bplot->value->Show(true); -$bplot->value->SetFormat("%02d kr"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add upper and lower band and use no frames -$uband=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green"); -$uband->ShowFrame(false); -$lband=new PlotBand(HORIZONTAL,BAND_LDIAG,"min",0,"red"); -$lband->ShowFrame(false); - -$graph->Add($uband); -$graph->Add($lband); - -//$graph->title->Set("Test of bar gradient fill"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/staticbandbarex4.php b/#jpgraph/src/Examples/staticbandbarex4.php deleted file mode 100644 index 57ca6dbb..00000000 --- a/#jpgraph/src/Examples/staticbandbarex4.php +++ /dev/null @@ -1,60 +0,0 @@ -img->SetMargin(60,30,50,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,15); -$graph->title->Set("Cash flow "); -$graph->subtitle->Set("(Department X)"); - -// Show both X and Y grid -$graph->xgrid->Show(true,false); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10,10); - -// Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); - -// Show the actual value for each bar on top/bottom -$bplot->value->Show(true); -$bplot->value->SetFormat("%02d kr"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add upper and lower band and use no frames -$uband=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green"); -$uband->ShowFrame(false); -$uband->SetDensity(50); // 50% line density -$lband=new PlotBand(HORIZONTAL,BAND_LDIAG,"min",0,"red"); -$lband->ShowFrame(false); -$lband->SetDensity(20); // 20% line density - -$graph->Add($uband); -$graph->Add($lband); - -//$graph->title->Set("Test of bar gradient fill"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/staticbandbarex5.php b/#jpgraph/src/Examples/staticbandbarex5.php deleted file mode 100644 index 8d80855f..00000000 --- a/#jpgraph/src/Examples/staticbandbarex5.php +++ /dev/null @@ -1,63 +0,0 @@ -img->SetMargin(60,30,50,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,15); -$graph->title->Set("Cash flow "); -$graph->subtitle->Set("(Department X)"); - -// Show both X and Y grid -$graph->xgrid->Show(true,false); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10,10); - -// Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); - -// Show the actual value for each bar on top/bottom -$bplot->value->Show(true); -$bplot->value->SetFormat("%02d kr"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add upper and lower band and use no frames -$band[0]=new PlotBand(HORIZONTAL,BAND_RDIAG,10,20,"green"); -$band[0]->ShowFrame(false); -$band[0]->SetDensity(30); -$band[1]=new PlotBand(HORIZONTAL,BAND_LDIAG,-20,-10,"red"); -$band[1]->ShowFrame(false); -$band[1]->SetDensity(40); -$band[2]=new PlotBand(HORIZONTAL,BAND_LDIAG,"min",-20,"red"); -$band[2]->ShowFrame(false); -$band[2]->SetDensity(80); - -// We can also add band in an array -$graph->Add($band); - -//$graph->title->Set("Test of bar gradient fill"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/staticbandbarex6.php b/#jpgraph/src/Examples/staticbandbarex6.php deleted file mode 100644 index df352ea9..00000000 --- a/#jpgraph/src/Examples/staticbandbarex6.php +++ /dev/null @@ -1,74 +0,0 @@ -img->SetMargin(60,30,50,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,15); -$graph->title->Set("Cash flow "); -$graph->subtitle->Set("Shows some possible patterns for bands"); - -// Show both X and Y grid -$graph->xgrid->Show(true,false); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10,10); - -// Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); -$bplot->SetShadow(); - -// Show the actual value for each bar on top/bottom -$bplot->value->Show(true); -$bplot->value->SetFormat("%02d kr"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add upper and lower band and use no frames -$band[0]=new PlotBand(HORIZONTAL,BAND_RDIAG,10,20,"green"); -$band[0]->ShowFrame(false); -$band[1]=new PlotBand(HORIZONTAL,BAND_LDIAG,-20,-10,"red"); -$band[1]->ShowFrame(false); -$band[1]->SetDensity(20); -$band[2]=new PlotBand(HORIZONTAL,BAND_DIAGCROSS,"min",-20,"red"); -$band[2]->ShowFrame(false); -$band[2]->SetDensity(40); -$band[3]=new PlotBand(VERTICAL,BAND_HLINE,0,1,"darkgray"); -$band[3]->ShowFrame(false); -$band[3]->SetOrder(DEPTH_FRONT); -$band[4]=new PlotBand(VERTICAL,BAND_HVCROSS,5,"max","darkgray"); -$band[4]->ShowFrame(false); -$band[4]->SetOrder(DEPTH_FRONT); -$band[5]=new PlotBand(HORIZONTAL,BAND_SOLID,20,"max","lightgreen"); -$band[6]=new PlotBand(HORIZONTAL,BAND_3DPLANE,-10,0,"blue"); -$band[6]->SetDensity(70); -$graph->Add($band); - -$graph->AddLine(new PlotLine(HORIZONTAL,0,"black",2)); - -//$graph->title->Set("Test of bar gradient fill"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); - -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/staticbandbarex7.php b/#jpgraph/src/Examples/staticbandbarex7.php deleted file mode 100644 index 399a172b..00000000 --- a/#jpgraph/src/Examples/staticbandbarex7.php +++ /dev/null @@ -1,62 +0,0 @@ -img->SetMargin(60,30,50,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,15); -$graph->title->Set("Cash flow "); -$graph->subtitle->Set("Use of static line, 3D and solid band"); - -// Turn off Y-grid (it's on by default) -$graph->ygrid->Show(false); - -// Add 10% grace ("space") at top of Y-scale. -$graph->yscale->SetGrace(10); -$graph->yscale->SetAutoMin(-20); - -// Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); -$bplot->SetShadow("darkblue"); - -// Show the actual value for each bar on top/bottom -$bplot->value->Show(true); -$bplot->value->SetFormat("%02d kr"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add upper and lower band and use no frames -$band[0]=new PlotBand(HORIZONTAL,BAND_3DPLANE,"min",0,"blue"); -$band[0]->ShowFrame(false); -$band[0]->SetDensity(20); -$band[1]=new PlotBand(HORIZONTAL,BAND_SOLID,0,"max","steelblue"); -$band[1]->ShowFrame(false); -$graph->Add($band); - -$graph->Add(new PlotLine(HORIZONTAL,0,"black",2)); - -//$graph->title->Set("Test of bar gradient fill"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/staticlinebarex1.php b/#jpgraph/src/Examples/staticlinebarex1.php deleted file mode 100644 index 9c63442b..00000000 --- a/#jpgraph/src/Examples/staticlinebarex1.php +++ /dev/null @@ -1,55 +0,0 @@ -img->SetMargin(60,30,50,40); -$graph->SetScale("textlin"); -$graph->SetShadow(); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,15); -$graph->title->Set("Cash flow "); -$graph->subtitle->Set("(Department X)"); - -// Show both X and Y grid -$graph->xgrid->Show(true,false); - -// Add 10% grace ("space") at top and botton of Y-scale. -$graph->yscale->SetGrace(10,10); - -// Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(SIDE_DOWN); -$graph->yaxis->SetTickSide(SIDE_LEFT); - -// Create a bar pot -$bplot = new BarPlot($datay); -$bplot->SetFillColor("orange"); -$bplot->SetShadow(); - -// Show the actual value for each bar on top/bottom -$bplot->value->Show(); -$bplot->value->SetFormat("%02d kr"); - -// Position the X-axis at the bottom of the plotare -$graph->xaxis->SetPos("min"); - -// .. and add the plot to the graph -$graph->Add($bplot); - -// Add mark graph with static lines -$graph->AddLine(new PlotLine(HORIZONTAL,0,"black",2)); -$graph->AddLine(new PlotLine(VERTICAL,3,"black",2)); - -//$graph->title->Set("Test of bar gradient fill"); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_BOLD,11); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/stockex1.php b/#jpgraph/src/Examples/stockex1.php deleted file mode 100644 index d77145c7..00000000 --- a/#jpgraph/src/Examples/stockex1.php +++ /dev/null @@ -1,33 +0,0 @@ -SetScale("textlin"); -$graph->SetMarginColor('lightblue'); -$graph->title->Set('Stockchart example'); - -// Create a new stock plot -$p1 = new StockPlot($datay); - -// Width of the bars (in pixels) -$p1->SetWidth(9); - -// Uncomment the following line to hide the horizontal end lines -//$p1->HideEndLines(); - -// Add the plot to the graph and send it back to the browser -$graph->Add($p1); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/stockex2.php b/#jpgraph/src/Examples/stockex2.php deleted file mode 100644 index e038cca0..00000000 --- a/#jpgraph/src/Examples/stockex2.php +++ /dev/null @@ -1,39 +0,0 @@ -SetScale("textlin"); -$graph->SetMarginColor('white'); -$graph->SetFrame(false); -$graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5'); -$graph->SetBox(); - -$graph->tabtitle->Set(' Week 34 '); -$graph->tabtitle->SetFont(FF_ARIAL,FS_NORMAL,12); - -// Get week days in curent locale -$days = $gDateLocale->GetShortDay(); -array_shift($days); // Start on monday -$graph->xaxis->SetTickLabels($days); - -// Create stock plot -$p1 = new StockPlot($datay); - -// Indent plot so first and last bar isn't on the edges -$p1->SetCenter(); - -// Add and stroke -$graph->Add($p1); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/stship.jpg b/#jpgraph/src/Examples/stship.jpg deleted file mode 100644 index 7f3bae62..00000000 Binary files a/#jpgraph/src/Examples/stship.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/sunflower.gif b/#jpgraph/src/Examples/sunflower.gif deleted file mode 100644 index b83709f8..00000000 Binary files a/#jpgraph/src/Examples/sunflower.gif and /dev/null differ diff --git a/#jpgraph/src/Examples/sunspotsex1.php b/#jpgraph/src/Examples/sunspotsex1.php deleted file mode 100644 index d5edb83e..00000000 --- a/#jpgraph/src/Examples/sunspotsex1.php +++ /dev/null @@ -1,51 +0,0 @@ - $datarow ) { - $split = preg_split('/[\s]+/',$datarow); - $aYears[] = substr(trim($split[0]),0,4); - $aSunspots[] = trim($split[1]); - } -} - -$year = array(); -$ydata = array(); -readsunspotdata('yearssn.txt',$year,$ydata); - - // Width and height of the graph -$width = 600; $height = 200; - -// Create a graph instance -$graph = new Graph($width,$height); - -// Specify what scale we want to use, -// int = integer scale for the X-axis -// int = integer scale for the Y-axis -$graph->SetScale('intint'); - -// Setup a title for the graph -$graph->title->Set('Sunspot example'); - -// Setup titles and X-axis labels -$graph->xaxis->title->Set('(year from 1701)'); - -// Setup Y-axis title -$graph->yaxis->title->Set('(# sunspots)'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/sunspotsex2.php b/#jpgraph/src/Examples/sunspotsex2.php deleted file mode 100644 index 817db158..00000000 --- a/#jpgraph/src/Examples/sunspotsex2.php +++ /dev/null @@ -1,52 +0,0 @@ - $datarow ) { - $split = preg_split('/[\s]+/',$datarow); - $aYears[] = substr(trim($split[0]),0,4); - $aSunspots[] = trim($split[1]); - } -} - -$year = array(); -$ydata = array(); -readsunspotdata('yearssn.txt',$year,$ydata); - - // Width and height of the graph -$width = 600; $height = 200; - -// Create a graph instance -$graph = new Graph($width,$height); - -// Specify what scale we want to use, -// int = integer scale for the X-axis -// int = integer scale for the Y-axis -$graph->SetScale('intint'); - -// Setup a title for the graph -$graph->title->Set('Sunspot example'); - -// Setup titles and X-axis labels -$graph->xaxis->title->Set('(year from 1701)'); - -// Setup Y-axis title -$graph->yaxis->title->Set('(# sunspots)'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetFillColor('orange@0.5'); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/sunspotsex3.php b/#jpgraph/src/Examples/sunspotsex3.php deleted file mode 100644 index cf54cb44..00000000 --- a/#jpgraph/src/Examples/sunspotsex3.php +++ /dev/null @@ -1,53 +0,0 @@ - $datarow ) { - $split = preg_split('/[\s]+/',$datarow); - $aYears[] = substr(trim($split[0]),0,4); - $aSunspots[] = trim($split[1]); - } -} - -$year = array(); -$ydata = array(); -readsunspotdata('yearssn.txt',$year,$ydata); - - // Width and height of the graph -$width = 600; $height = 200; - -// Create a graph instance -$graph = new Graph($width,$height); - -// Specify what scale we want to use, -// int = integer scale for the X-axis -// int = integer scale for the Y-axis -$graph->SetScale('intint'); - -// Setup a title for the graph -$graph->title->Set('Sunspot example'); - -// Setup titles and X-axis labels -$graph->xaxis->title->Set('(year from 1701)'); -$graph->xaxis->SetTickLabels($year); - -// Setup Y-axis title -$graph->yaxis->title->Set('(# sunspots)'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetFillColor('orange@0.5'); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/sunspotsex4.php b/#jpgraph/src/Examples/sunspotsex4.php deleted file mode 100644 index e0877e03..00000000 --- a/#jpgraph/src/Examples/sunspotsex4.php +++ /dev/null @@ -1,53 +0,0 @@ - $datarow ) { - $split = preg_split('/[\s]+/',$datarow); - $aYears[] = substr(trim($split[0]),0,4); - $aSunspots[] = trim($split[1]); - } -} - -$year = array(); -$ydata = array(); -readsunspotdata('yearssn.txt',$year,$ydata); - - // Width and height of the graph -$width = 600; $height = 200; - -// Create a graph instance -$graph = new Graph($width,$height); - -// Specify what scale we want to use, -// int = integer scale for the X-axis -// int = integer scale for the Y-axis -$graph->SetScale('intint',0,0,0,max($year)-min($year)+1); - -// Setup a title for the graph -$graph->title->Set('Sunspot example'); - -// Setup titles and X-axis labels -$graph->xaxis->title->Set('(year from 1701)'); -$graph->xaxis->SetTickLabels($year); - -// Setup Y-axis title -$graph->yaxis->title->Set('(# sunspots)'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetFillColor('orange@0.5'); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/sunspotsex5.php b/#jpgraph/src/Examples/sunspotsex5.php deleted file mode 100644 index 3d7322a2..00000000 --- a/#jpgraph/src/Examples/sunspotsex5.php +++ /dev/null @@ -1,57 +0,0 @@ - $datarow ) { - $split = preg_split('/[\s]+/',$datarow); - $aYears[] = substr(trim($split[0]),0,4); - $aSunspots[] = trim($split[1]); - } -} - -$year = array(); -$ydata = array(); -readsunspotdata('yearssn.txt',$year,$ydata); - -function year_callback($aLabel) { - return 1700+(int)$aLabel; -} - - // Width and height of the graph -$width = 600; $height = 200; - -// Create a graph instance -$graph = new Graph($width,$height); - -// Specify what scale we want to use, -// int = integer scale for the X-axis -// int = integer scale for the Y-axis -$graph->SetScale('intint'); - -// Setup a title for the graph -$graph->title->Set('Sunspot example'); - -// Setup titles and X-axis labels -$graph->xaxis->title->Set('(year from 1701)'); -$graph->xaxis->SetLabelFormatCallback('year_callback'); - -// Setup Y-axis title -$graph->yaxis->title->Set('(# sunspots)'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetFillColor('orange@0.5'); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/sunspotsex6.php b/#jpgraph/src/Examples/sunspotsex6.php deleted file mode 100644 index 2efe6448..00000000 --- a/#jpgraph/src/Examples/sunspotsex6.php +++ /dev/null @@ -1,52 +0,0 @@ - $datarow ) { - $split = preg_split('/[\s]+/',$datarow); - $aYears[] = substr(trim($split[0]),0,4); - $aSunspots[] = trim($split[1]); - } -} - -$year = array(); -$ydata = array(); -readsunspotdata('yearssn.txt',$year,$ydata); - - // Width and height of the graph -$width = 600; $height = 200; - -// Create a graph instance -$graph = new Graph($width,$height); - -// Specify what scale we want to use, -// int = integer scale for the X-axis -// int = integer scale for the Y-axis -$graph->SetScale('intint'); - -// Setup a title for the graph -$graph->title->Set('Sunspot example'); - -// Setup titles and X-axis labels -$graph->xaxis->title->Set('(year from 1701)'); - -// Setup Y-axis title -$graph->yaxis->title->Set('(# sunspots)'); - -// Create the bar plot -$barplot=new BarPlot($ydata); - -// Add the plot to the graph -$graph->Add($barplot); - -// Display the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/sunspotsex7.php b/#jpgraph/src/Examples/sunspotsex7.php deleted file mode 100644 index b104f9fe..00000000 --- a/#jpgraph/src/Examples/sunspotsex7.php +++ /dev/null @@ -1,56 +0,0 @@ - $datarow ) { - $split = preg_split('/[\s]+/',$datarow); - $aYears[] = substr(trim($split[0]),0,4); - $aSunspots[] = trim($split[1]); - } -} - -$year = array(); -$ydata = array(); -readsunspotdata('yearssn.txt',$year,$ydata); - -// Just keep the last 20 values in the arrays -$year = array_slice($year, -20); -$ydata = array_slice($ydata, -20); - - // Width and height of the graph -$width = 600; $height = 200; - -// Create a graph instance -$graph = new Graph($width,$height); - -// Specify what scale we want to use, -// text = txt scale for the X-axis -// int = integer scale for the Y-axis -$graph->SetScale('textint'); - -// Setup a title for the graph -$graph->title->Set('Sunspot example'); - -// Setup titles and X-axis labels -$graph->xaxis->title->Set('(year)'); -$graph->xaxis->SetTickLabels($year); - -// Setup Y-axis title -$graph->yaxis->title->Set('(# sunspots)'); - -// Create the bar plot -$barplot=new BarPlot($ydata); - -// Add the plot to the graph -$graph->Add($barplot); - -// Display the graph -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/table_flagex1.php b/#jpgraph/src/Examples/table_flagex1.php deleted file mode 100644 index 8729561d..00000000 --- a/#jpgraph/src/Examples/table_flagex1.php +++ /dev/null @@ -1,70 +0,0 @@ -Set($data); -$table->SetFont(FF_TIMES,FS_NORMAL,11); - -// Adjust the font for row 0 and 6 -$table->SetColFont(0,FF_ARIAL,FS_BOLD,11); -$table->SetRowFont(6,FF_TIMES,FS_BOLD,12); - -// Set the minimum heigth/width -$table->SetMinRowHeight(2,10); -$table->SetMinColWidth(70); - -// Add some padding (in pixels) -$table->SetRowPadding(2,0); -$table->SetRowGrid(6,1,'darkgray',TGRID_DOUBLE2); - -// Setup the grid -$table->SetGrid(0); -$table->SetRowGrid(6,1,'black',TGRID_DOUBLE2); - -// Merge all cells in row 0 -$table->MergeRow(0); - -// Set aligns -$table->SetAlign(3,0,6,6,'right'); -$table->SetRowAlign(1,'center'); -$table->SetRowAlign(2,'center'); - -// Set background colors -$table->SetRowFillColor(0,'lightgray@0.5'); -$table->SetColFillColor(0,'lightgray@0.5'); - -// Add the country flags in row 1 -$n = count($countries); -for($i=0; $i < $n; ++$i ) { - $table->SetCellCountryFlag(1,$i+1,$countries[$i],0.5); - $table->SetCellImageConstrain(1,$i+1,TIMG_HEIGHT,20); -} - -// Add the table to the graph -$graph->Add($table); - -// Send back the table graph to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto1.php b/#jpgraph/src/Examples/table_howto1.php deleted file mode 100644 index bb50fa03..00000000 --- a/#jpgraph/src/Examples/table_howto1.php +++ /dev/null @@ -1,21 +0,0 @@ -Set($data); - -// Add the table to the graph -$graph->Add($table); - -// ... and send back the table to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto2.php b/#jpgraph/src/Examples/table_howto2.php deleted file mode 100644 index 69d25e6b..00000000 --- a/#jpgraph/src/Examples/table_howto2.php +++ /dev/null @@ -1,25 +0,0 @@ -Set($data); - -// Merge all cellsn in the rectangle with -// top left corner = (0,2) and bottom right = (1,3) -$table->MergeCells(0,2,1,3); - -// Add the table to the graph -$graph->Add($table); - -// ... and send back the table to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto3.php b/#jpgraph/src/Examples/table_howto3.php deleted file mode 100644 index 26417b4a..00000000 --- a/#jpgraph/src/Examples/table_howto3.php +++ /dev/null @@ -1,24 +0,0 @@ -Set($data); - -// Merge all cells in row 0 -$table->MergeRow(0); - -// Add table to graph -$graph->Add($table); - -// ... and send back the table to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto4.php b/#jpgraph/src/Examples/table_howto4.php deleted file mode 100644 index d093fcb3..00000000 --- a/#jpgraph/src/Examples/table_howto4.php +++ /dev/null @@ -1,28 +0,0 @@ -Set($data); - -// Merge all cells in row 0 -$table->MergeRow(0); - -// Set foreground and background color -$table->SetCellFillColor(0,0,'orange@0.7'); -$table->SetCellColor(0,0,'darkred'); - -// Add the table to the graph -$graph->Add($table); - -// and send it back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto5.php b/#jpgraph/src/Examples/table_howto5.php deleted file mode 100644 index 252318af..00000000 --- a/#jpgraph/src/Examples/table_howto5.php +++ /dev/null @@ -1,30 +0,0 @@ -Set($data); - -// Merge all cells in row 0 -$table->MergeRow(0); - -// Adjust font in cell (0,0) -$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,14); - -// Set left align for all cells in rectangle (0,0) - (0,3) -$table->SetAlign(0,0,0,3,'Left'); - -// Add table to graph -$graph->Add($table); - -// ... send it back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto6.php b/#jpgraph/src/Examples/table_howto6.php deleted file mode 100644 index c776494e..00000000 --- a/#jpgraph/src/Examples/table_howto6.php +++ /dev/null @@ -1,32 +0,0 @@ -Set($data); - -// Merge all cells in row 0 -$table->MergeRow(0); - -// Setup font and color -$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,14); -$table->SetRowFillColor(0,'orange@0.5'); -$table->SetRowColor(0,'darkred'); - -// Setup the minimum width of all columns -$table->SetMinColWidth(35); - -// Add table to the graph -$graph->Add($table); - -// ... send it back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto7.1.php b/#jpgraph/src/Examples/table_howto7.1.php deleted file mode 100644 index 4dbe52d7..00000000 --- a/#jpgraph/src/Examples/table_howto7.1.php +++ /dev/null @@ -1,34 +0,0 @@ -Set($data); - -// Set default font in entire table -$table->SetFont(FF_ARIAL,FS_NORMAL,11); - -// Setup font and color for row = 2 -$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11); -$table->SetRowFillColor(2,'orange@0.5'); - -// Setup minimum color width -$table->SetMinColWidth(35); - -// Setup grid on row 2 -$table->SetRowGrid(2,1,'black',TGRID_DOUBLE); - -// Add table to the graph -$graph->Add($table); - -// and send it back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto7.2.php b/#jpgraph/src/Examples/table_howto7.2.php deleted file mode 100644 index 8a159f8a..00000000 --- a/#jpgraph/src/Examples/table_howto7.2.php +++ /dev/null @@ -1,34 +0,0 @@ -Set($data); - -// Set default font in entire table -$table->SetFont(FF_ARIAL,FS_NORMAL,11); - -// Setup font and color for row = 2 -$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11); -$table->SetRowFillColor(2,'orange@0.5'); - -// Setup minimum color width -$table->SetMinColWidth(35); - -// Setup grid on row 2 -$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2); - -// Add table to the graph -$graph->Add($table); - -// and send it back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto7.php b/#jpgraph/src/Examples/table_howto7.php deleted file mode 100644 index 8a159f8a..00000000 --- a/#jpgraph/src/Examples/table_howto7.php +++ /dev/null @@ -1,34 +0,0 @@ -Set($data); - -// Set default font in entire table -$table->SetFont(FF_ARIAL,FS_NORMAL,11); - -// Setup font and color for row = 2 -$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11); -$table->SetRowFillColor(2,'orange@0.5'); - -// Setup minimum color width -$table->SetMinColWidth(35); - -// Setup grid on row 2 -$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2); - -// Add table to the graph -$graph->Add($table); - -// and send it back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto8.php b/#jpgraph/src/Examples/table_howto8.php deleted file mode 100644 index a89785b3..00000000 --- a/#jpgraph/src/Examples/table_howto8.php +++ /dev/null @@ -1,43 +0,0 @@ -Set($data); - -// Setup overall table font -$table->SetFont(FF_ARIAL,FS_NORMAL,11); - -// Setup font and color for row = 2 -$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11); -$table->SetRowFillColor(2,'orange@0.5'); - -// Setup minimum color width -$table->SetMinColWidth(35); - -// Setup overall cell alignment for the table -$table->SetAlign('right'); - -// Setup overall table border -$table->SetBorder(0,'black'); - -// Setup overall table grid -$table->setGrid(0,'black'); - -// Set specific frid for row = 2 -$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2); - -// Add the table to the graph -$graph->Add($table); - -// and send it back to the browser -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_howto9.php b/#jpgraph/src/Examples/table_howto9.php deleted file mode 100644 index cf6f65f4..00000000 --- a/#jpgraph/src/Examples/table_howto9.php +++ /dev/null @@ -1,46 +0,0 @@ -Set($data); - -// Setup overall table font -$table->SetFont(FF_ARIAL,FS_NORMAL,11); - -// Setup font and color for row = 2 -$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11); -$table->SetRowFillColor(2,'orange@0.5'); - -// Setup minimum color width -$table->SetMinColWidth(40); - -// Setup overall cell alignment for the table -$table->SetAlign('right'); - -// Setup overall table border -$table->SetBorder(0,'black'); - -// Setup overall table grid -$table->setGrid(0,'black'); - -// Set specific frid for row = 2 -$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2); - -// Setup overall number format in all cells -$table->SetNumberFormat("%0.1f"); - -// Add table to the graph -$graph->Add($table); - -// and send it back to the browser -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_mex0.php b/#jpgraph/src/Examples/table_mex0.php deleted file mode 100644 index 9568874e..00000000 --- a/#jpgraph/src/Examples/table_mex0.php +++ /dev/null @@ -1,50 +0,0 @@ -Set($data); - -// Setup fonts -$table->SetFont(FF_TIMES,FS_NORMAL,11); -$table->SetColFont(0,FF_ARIAL,FS_NORMAL,11); -$table->SetRowFont(0,FF_ARIAL,FS_NORMAL,11); -$table->SetRowFont(4,FF_TIMES,FS_BOLD,14); - -// Turn off the grid -$table->SetGrid(0); - -// Setup color -$table->SetRowFillColor(0,'lightgray@0.5'); -$table->SetRowFillColor(4,'lightgray@0.5'); -$table->SetColFillColor(0,'lightgray@0.5'); -$table->SetFillColor(0,0,4,0,'lightgray@0.5'); - -// Set default minimum column width -$table->SetMinColWidth(45); - -// Set default table alignment -$table->SetAlign('right'); - -// Add table to the graph -$graph->Add($table); - -// and send it back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_mex00.php b/#jpgraph/src/Examples/table_mex00.php deleted file mode 100644 index ecd7410d..00000000 --- a/#jpgraph/src/Examples/table_mex00.php +++ /dev/null @@ -1,33 +0,0 @@ -Set($data); -$table->SetFont(FF_TIMES,FS_NORMAL,11); - -// Set default table alignment -$table->SetAlign('right'); - -// Add table to graph -$graph->Add($table); - -// and send it back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_mex1.php b/#jpgraph/src/Examples/table_mex1.php deleted file mode 100644 index ce40d0e7..00000000 --- a/#jpgraph/src/Examples/table_mex1.php +++ /dev/null @@ -1,56 +0,0 @@ -Set($data); -$table->SetFont(FF_ARIAL,FS_NORMAL,11); - -// Setup default column width -$table->SetMinColWidth(40); - -// Setup defalt table alignment -$table->SetAlign('right'); - -// Turn off border -$table->SetBorder(0); - -// Turn off grid -$table->setGrid(0); - -// Setup font for row 4 and 0 -$table->SetRowFont(4,FF_ARIAL,FS_BOLD,11); -$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11); - -// Setup color -$table->SetRowFillColor(4,'orange@0.5'); -$table->SetFillColor(0,1,0,6,'teal@0.8'); - - -// Setup grids -$table->SetRowGrid(4,1,'black',TGRID_DOUBLE2); -$table->SetColGrid(1,1,'black',TGRID_SINGLE); -$table->SetRowGrid(1,1,'black',TGRID_SINGLE); - -// Add table to the graph -$graph->Add($table); - -// Send it back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_mex2.php b/#jpgraph/src/Examples/table_mex2.php deleted file mode 100644 index a4acc9d8..00000000 --- a/#jpgraph/src/Examples/table_mex2.php +++ /dev/null @@ -1,58 +0,0 @@ -Set($data); -$table->SetFont(FF_ARIAL,FS_NORMAL,11); - -// Set default minimum color width -$table->SetMinColWidth(40); - -// Set default table alignment -$table->SetAlign('right'); - -// Set table border -$table->SetBorder(0); - -// Turn off grid -$table->setGrid(0); - -// Setup font -$table->SetRowFont(4,FF_ARIAL,FS_BOLD,11); -$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11); - -// Setup various grid lines -$table->SetRowGrid(4,2,'black',TGRID_SINGLE); -$table->SetColGrid(1,3,'black',TGRID_SINGLE); -$table->SetRowGrid(1,1,'black',TGRID_SINGLE); - -// Setup various colors -$table->SetFillColor(0,1,0,6,'black'); -$table->SetRowColor(0,'white'); -$table->SetRowFillColor(4,'lightyellow'); -$table->SetFillColor(2,0,2,6,'lightgray'); - -// Add table to the graph -$graph->Add($table); - - -// Send back to client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_mex3.php b/#jpgraph/src/Examples/table_mex3.php deleted file mode 100644 index 981181c4..00000000 --- a/#jpgraph/src/Examples/table_mex3.php +++ /dev/null @@ -1,59 +0,0 @@ -Set($data); -$table->SetFont(FF_ARIAL,FS_NORMAL,11); - -// Set default minimum color width -$table->SetMinColWidth(40); - -// Set default table alignment -$table->SetAlign('right'); - -// Turn off grid -$table->setGrid(0); - -// Set table border -$table->SetBorder(2); - -// Setup font -$table->SetRowFont(4,FF_ARIAL,FS_BOLD,11); -$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11); -$table->SetFont(1,2,1,3,FF_ARIAL,FS_BOLD,11); - -// Setup grids -$table->SetRowGrid(4,2,'black',TGRID_SINGLE); -$table->SetColGrid(1,1,'black',TGRID_SINGLE); -$table->SetRowGrid(1,1,'black',TGRID_SINGLE); - -// Setup colors -$table->SetFillColor(0,1,0,6,'black'); -$table->SetRowColor(0,'white'); -$table->SetRowFillColor(4,'lightgray@0.3'); -$table->SetFillColor(2,0,2,6,'lightgray@0.6'); -$table->SetFillColor(1,2,1,3,'lightred'); - -// Add table to graph -$graph->Add($table); - -// Send back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_vtext.php b/#jpgraph/src/Examples/table_vtext.php deleted file mode 100644 index 1b2b349a..00000000 --- a/#jpgraph/src/Examples/table_vtext.php +++ /dev/null @@ -1,42 +0,0 @@ -Set($data); -$table->SetAlign('right'); -$table->SetFont(FF_TIMES,FS_NORMAL,12); -$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,16); - -// Rotate the entire table 90 degrees -$table->SetTextOrientation(90); -//$table->SetCellTextOrientation(0,0,0); - -// Setup background color for header column -$table->SetColFillColor(0,'lightgray'); - -// Set the imnimum row height -$table->SetMinRowHeight(0,150); - -// Add table to graph -$graph->Add($table); - -// and send it back to the client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/table_vtext_ex1.php b/#jpgraph/src/Examples/table_vtext_ex1.php deleted file mode 100644 index 9581884b..00000000 --- a/#jpgraph/src/Examples/table_vtext_ex1.php +++ /dev/null @@ -1,42 +0,0 @@ -Set($data); -$table->SetFont(FF_TIMES,FS_NORMAL,11); - -// Default table alignment -$table->SetAlign('right'); - -// Adjust font in (0,0) -$table->SetCellFont(0,0,FF_TIMES,FS_BOLD,14); - -// Rotate all textxs in row 0 -$table->SetRowTextOrientation(0,90); - -// Adjust alignment in cell (0,0) -$table->SetCellAlign(0,0,'center','center'); - -// Add table to graph -$graph->Add($table); - -// Send back table to client -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/tablebarex1.php b/#jpgraph/src/Examples/tablebarex1.php deleted file mode 100644 index 79567164..00000000 --- a/#jpgraph/src/Examples/tablebarex1.php +++ /dev/null @@ -1,70 +0,0 @@ -img->SetMargin($tablexpos,$rightmargin,30,$height-$tableypos); -$graph->SetScale("textlin"); -$graph->SetMarginColor('white'); - -// Setup titles and fonts -$graph->title->Set('Bar and table'); -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,14); -$graph->yaxis->title->Set("Flow"); -$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,12); -$graph->yaxis->title->SetMargin(10); - -// Create the bars and the accbar plot -$bplot = new BarPlot($datay[3]); -$bplot->SetFillColor("orange"); -$bplot2 = new BarPlot($datay[2]); -$bplot2->SetFillColor("red"); -$bplot3 = new BarPlot($datay[1]); -$bplot3->SetFillColor("darkgreen"); -$accbplot = new AccBarPlot(array($bplot,$bplot2,$bplot3)); -$accbplot->value->Show(); -$graph->Add($accbplot); - -//Setup the table -$table = new GTextTable(); -$table->Set($datay); -$table->SetPos($tablexpos,$tableypos+1); - -// Basic table formatting -$table->SetFont(FF_ARIAL,FS_NORMAL,10); -$table->SetAlign('right'); -$table->SetMinColWidth($cellwidth); -$table->SetNumberFormat('%0.1f'); - -// Format table header row -$table->SetRowFillColor(0,'teal@0.7'); -$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11); -$table->SetRowAlign(0,'center'); - -// .. and add it to the graph -$graph->Add($table); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/tablebarex1_csim.php b/#jpgraph/src/Examples/tablebarex1_csim.php deleted file mode 100644 index 96061493..00000000 --- a/#jpgraph/src/Examples/tablebarex1_csim.php +++ /dev/null @@ -1,72 +0,0 @@ -img->SetMargin($tablexpos,$rightmargin,30,$height-$tableypos); -$graph->SetScale("textlin"); -$graph->SetMarginColor('white'); - -// Setup titles and fonts -$graph->title->Set('Bar and table'); -$graph->title->SetFont(FF_VERDANA,FS_NORMAL,14); -$graph->yaxis->title->Set("Flow"); -$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,12); -$graph->yaxis->title->SetMargin(10); - -// Create the bars and the accbar plot -$bplot = new BarPlot($datay[3]); -$bplot->SetFillColor("orange"); -$bplot2 = new BarPlot($datay[2]); -$bplot2->SetFillColor("red"); -$bplot3 = new BarPlot($datay[1]); -$bplot3->SetFillColor("darkgreen"); -$accbplot = new AccBarPlot(array($bplot,$bplot2,$bplot3)); -$accbplot->value->Show(); -$graph->Add($accbplot); - -//Setup the table -$table = new GTextTable(); -$table->Set($datay); -$table->SetPos($tablexpos,$tableypos+1); - -$table->SetCellCSIMTarget(1,1,'tableex02.php','View details'); - -// Basic table formatting -$table->SetFont(FF_ARIAL,FS_NORMAL,10); -$table->SetAlign('right'); -$table->SetMinColWidth($cellwidth); -$table->SetNumberFormat('%0.1f'); - -// Format table header row -$table->SetRowFillColor(0,'teal@0.7'); -$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11); -$table->SetRowAlign(0,'center'); - -// .. and add it to the graph -$graph->Add($table); - -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/tableex00.php b/#jpgraph/src/Examples/tableex00.php deleted file mode 100644 index 0acabaed..00000000 --- a/#jpgraph/src/Examples/tableex00.php +++ /dev/null @@ -1,25 +0,0 @@ -Set($data); - -//Add table to the graph -$graph->Add($table); - -// Send back table to the client -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/tableex01.php b/#jpgraph/src/Examples/tableex01.php deleted file mode 100644 index 8efe9f9f..00000000 --- a/#jpgraph/src/Examples/tableex01.php +++ /dev/null @@ -1,29 +0,0 @@ -Init(); -$table->Set($data); - -$table->SetRowFont(0,FF_FONT1,FS_BOLD); -$table->SetRowColor(0,'navy'); -$table->SetRowFillColor(0,'lightgray'); - -$table->SetColFont(0,FF_FONT1,FS_BOLD); -$table->SetColColor(0,'navy'); -$table->SetColFillColor(0,'lightgray'); - -$graph->Add($table); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/tableex01_csim.php b/#jpgraph/src/Examples/tableex01_csim.php deleted file mode 100644 index ff11a70b..00000000 --- a/#jpgraph/src/Examples/tableex01_csim.php +++ /dev/null @@ -1,33 +0,0 @@ -Set($data); - -$table->SetCellCSIMTarget(1,1,'tableex02.php','View details'); - -$table->SetRowFont(0,FF_FONT1,FS_BOLD); -$table->SetRowColor(0,'navy'); -$table->SetRowFillColor(0,'lightgray'); - -$table->SetColFont(0,FF_FONT1,FS_BOLD); -$table->SetColColor(0,'navy'); -$table->SetColFillColor(0,'lightgray'); - -$graph->Add($table); - -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/tableex02.php b/#jpgraph/src/Examples/tableex02.php deleted file mode 100644 index 193f49f1..00000000 --- a/#jpgraph/src/Examples/tableex02.php +++ /dev/null @@ -1,33 +0,0 @@ -Init(); -$table->Set($data); - -// Setup row and column headers -$table->SetRowFont(0,FF_TIMES,FS_BOLD,11); -$table->SetRowAlign(0,'left','bottom'); -$table->SetRowColor(0,'navy'); -$table->SetRowFillColor(0,'lightgray'); -$table->SetColFont(0,FF_ARIAL,FS_BOLD,11); -$table->SetColColor(0,'navy'); -$table->SetColFillColor(0,'lightgray'); - -// Highlight cell 2,3 -$table->SetCellFillColor(2,3,'yellow'); - -$graph->Add($table); -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/tableex03.php b/#jpgraph/src/Examples/tableex03.php deleted file mode 100644 index 5ac72151..00000000 --- a/#jpgraph/src/Examples/tableex03.php +++ /dev/null @@ -1,58 +0,0 @@ -Init(); -$table->Set($data); -$table->SetBorder(2,'black'); - -// Setup top row with the year title -$table->MergeCells(0,0,0,6); -$table->SetRowFont(0,FF_ARIAL,FS_BOLD,16); -$table->SetRowColor(0,'navy'); -$table->SetRowAlign(0,'center'); - -// Setup quarter header -$table->MergeCells(1,1,1,3); -$table->MergeCells(1,4,1,6); -$table->SetRowAlign(1,'center'); -$table->SetRowFont(1,FF_ARIAL,FS_BOLD,10); -$table->SetRowColor(1,'navy'); -$table->SetRowFillColor(1,'lightgray'); -$table->SetRowGrid(2,'',0); // Turn off the gridline just under the top row - -// Setup row and column headers -$table->SetRowFont(2,FF_ARIAL,FS_NORMAL,11); -$table->SetRowColor(2,'navy'); -$table->SetRowFillColor(2,'lightgray'); - -$table->SetColFont(0,FF_ARIAL,FS_NORMAL,11); -$table->SetColColor(0,'navy'); -$table->SetColFillColor(0,'lightgray'); - -$table->SetCellFillColor(0,0,'lightgreen'); -$table->SetCellFillColor(1,0,'lightgreen'); -$table->SetCellFillColor(2,0,'lightgreen'); - -// Highlight cell 2,3 -$table->SetCellFillColor(4,3,'yellow'); - -$graph->Add($table); -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/tableex04.php b/#jpgraph/src/Examples/tableex04.php deleted file mode 100644 index 21f540d3..00000000 --- a/#jpgraph/src/Examples/tableex04.php +++ /dev/null @@ -1,50 +0,0 @@ -Init(); -$table->Set($data); -$table->SetBorder(2,'black'); - -// Highlight summation row -$table->SetRowFillColor($r-1,'yellow'); -$table->SetCellAlign($r-1,0,'right'); - -// Setup row and column headers -$table->SetRowFont(0,FF_ARIAL,FS_NORMAL,10); -$table->SetRowColor(0,'navy'); -$table->SetRowFillColor(0,'lightgray'); - -$table->SetColFont(0,FF_ARIAL,FS_NORMAL,10); -$table->SetColColor(0,'navy'); -$table->SetColFillColor(0,'lightgray'); - -$table->SetRowGrid($r-1,1,'black',TGRID_DOUBLE); - -$graph->Add($table); -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/tableex05.php b/#jpgraph/src/Examples/tableex05.php deleted file mode 100644 index aad9e00d..00000000 --- a/#jpgraph/src/Examples/tableex05.php +++ /dev/null @@ -1,53 +0,0 @@ -Init(); -$table->Set($data); -$table->SetBorder(2,'black'); - -// Highlight summation row -$table->SetRowFillColor($r-1,'yellow'); -$table->SetCellAlign($r-1,0,'right'); - -// Setup row and column headers -$table->SetRowFont(0,FF_ARIAL,FS_NORMAL,10); -$table->SetRowColor(0,'navy'); -$table->SetRowFillColor(0,'lightgray'); - -$table->SetColFont(0,FF_ARIAL,FS_NORMAL,10); -$table->SetColColor(0,'navy'); -$table->SetColFillColor(0,'lightgray'); - -$table->SetRowGrid($r-1,1,'black',TGRID_DOUBLE); - -$table->SetFont(1,4,2,6,FF_TIMES,FS_NORMAL,18); -$table->SetFillColor(1,1,2,3,'red'); - -$table->MergeCol(1); -$graph->Add($table); -$graph->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/tabtitleex1.php b/#jpgraph/src/Examples/tabtitleex1.php deleted file mode 100644 index 55d87ea1..00000000 --- a/#jpgraph/src/Examples/tabtitleex1.php +++ /dev/null @@ -1,51 +0,0 @@ -SetMarginColor('white'); -$graph->SetScale("textlin"); -$graph->SetFrame(false); -$graph->SetMargin(30,50,30,30); - -$graph->tabtitle->Set(' Year 2003 ' ); -$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,13); - - -$graph->yaxis->HideZeroLabel(); -$graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5'); -$graph->xgrid->Show(); - -$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); - -// Create the first line -$p1 = new LinePlot($datay1); -$p1->SetColor("navy"); -$p1->SetLegend('Line 1'); -$graph->Add($p1); - -// Create the second line -$p2 = new LinePlot($datay2); -$p2->SetColor("red"); -$p2->SetLegend('Line 2'); -$graph->Add($p2); - -// Create the third line -$p3 = new LinePlot($datay3); -$p3->SetColor("orange"); -$p3->SetLegend('Line 3'); -$graph->Add($p3); - -$graph->legend->SetShadow('gray@0.4',5); -$graph->legend->SetPos(0.1,0.1,'right','top'); -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/testsuit.php b/#jpgraph/src/Examples/testsuit.php deleted file mode 100644 index 4ffb2892..00000000 --- a/#jpgraph/src/Examples/testsuit.php +++ /dev/null @@ -1,107 +0,0 @@ -iType = $aType; - if( $aDir == '' ) { - $aDir = getcwd(); - } - if( !chdir($aDir) ) { - die("PANIC: Can't access directory : $aDir"); - } - $this->iDir = $aDir; - } - - function GetFiles() { - $d = @dir($this->iDir); - $a = array(); - while( $entry=$d->Read() ) { - if( strstr($entry,".php") && strstr($entry,"x") && !strstr($entry,"show") && !strstr($entry,"csim") ) { - $a[] = $entry; - } - } - $d->Close(); - if( count($a) == 0 ) { - die("PANIC: Apache/PHP does not have enough permission to read the scripts in directory: $this->iDir"); - } - sort($a); - return $a; - } - - function GetCSIMFiles() { - $d = @dir($this->iDir); - $a = array(); - while( $entry=$d->Read() ) { - if( strstr($entry,".php") && strstr($entry,"csim") ) { - $a[] = $entry; - } - } - $d->Close(); - if( count($a) == 0 ) { - die("PANIC: Apache/PHP does not have enough permission to read the CSIM scripts in directory: $this->iDir"); - } - sort($a); - return $a; - } - - - function Run() { - switch( $this->iType ) { - case 1: - $files = $this->GetFiles(); - break; - case 2: - $files = $this->GetCSIMFiles(); - break; - default: - die('Panic: Unknown type of test'); - break; - } - $n = count($files); - echo "

Visual test suit for JpGraph

"; - echo "Testtype: " . ($this->iType==1 ? ' Standard images ':' Image map tests '); - echo "
Number of tests: $n

"; - echo "

    "; - - for( $i=0; $i<$n; ++$i ) { - if( $this->iType ==1 ) { - echo '

  1. Filename: '.basename($files[$i])."\n"; - } - else { - echo '
  2. '.$files[$i]."\n"; - } - } - echo "
"; - - echo "

Done.

"; - } -} - -$type=@$_GET['type']; -if( empty($type) ) { - $type=1; -} - -$driver = new TestDriver($type); -$driver->Run(); - -?> diff --git a/#jpgraph/src/Examples/text-example1.php b/#jpgraph/src/Examples/text-example1.php deleted file mode 100644 index 99de8ffe..00000000 --- a/#jpgraph/src/Examples/text-example1.php +++ /dev/null @@ -1,18 +0,0 @@ -SetPos(0.05,0.5); -$t1->SetOrientation("h"); -$t1->SetFont(FF_FONT1,FS_NORMAL); -$t1->SetBox("white","black",'gray'); -$t1->SetColor("black"); -$graph->AddText($t1); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/text-example2.php b/#jpgraph/src/Examples/text-example2.php deleted file mode 100644 index b20cfa8e..00000000 --- a/#jpgraph/src/Examples/text-example2.php +++ /dev/null @@ -1,18 +0,0 @@ -SetPos(0.05,100); -$t1->SetFont(FF_FONT1,FS_NORMAL); -$t1->SetBox("white","black",true); -$t1->ParagraphAlign("right"); -$t1->SetColor("black"); -$graph->AddText($t1); - -$graph->Stroke(); - -?> diff --git a/#jpgraph/src/Examples/textalignex1.php b/#jpgraph/src/Examples/textalignex1.php deleted file mode 100644 index a7b33c57..00000000 --- a/#jpgraph/src/Examples/textalignex1.php +++ /dev/null @@ -1,91 +0,0 @@ -img; - -// Get the bounding box for text -$img->SetFont(FF_ARIAL,FS_NORMAL,16); -$tw=$img->GetBBoxWidth($txt,$angle); -$th=$img->GetBBoxHeight($txt,$angle); - -$img->SetFont(FF_ARIAL,FS_NORMAL,11); -$ch=$img->GetBBoxHeight($caption); - -// Calculate needed height for the image -$h = 3*$th+2*$ym + $ch; -$g = new CanvasGraph($w,$h); -$img = $g->img; - -// Alignment for anchor points to use -$anchors = array('left','top', - 'center','top', - 'right','top', - 'left','center', - 'center','center', - 'right','center', - 'left','bottom', - 'center','bottom', - 'right','bottom'); - -$n = count($anchors)/2; - -for( $i=0,$r=0,$c=0; $i < $n; ++$i ) { - - $x = $c*($tw+$xm)+$xm/2; - $y = $r*($th+$ym)+$ym/2-10; - - $img->SetColor('blue'); - $img->SetTextAlign($anchors[$i*2],$anchors[$i*2+1]); - $img->SetFont(FF_ARIAL,FS_NORMAL,16); - $img->StrokeText($x,$y,$txt,$angle,"left",true); - - $img->SetColor('black'); - $img->SetFont(FF_FONT1,FS_BOLD); - $img->SetTextAlign('center','top'); - $align = sprintf('("%s","%s")',$anchors[$i*2],$anchors[$i*2+1]); - $img->StrokeText($c*($tw/2+$xm)+$xm/2+$tw/2,$r*($th/2+$ym)+$th+$ym/2-4,$align); - - $c++; - if( $c==3 ) { - $c=0;$r++; - } -} - -// Draw the caption text -$img->SetTextAlign('center','bottom'); -$img->SetFont(FF_ARIAL,FS_ITALIC,11); -$img->StrokeText($w/2,$h-10,$caption,0,'left'); - -$img->SetColor('navy'); -$img->Rectangle(0,0,$w-1,$h-1); - -// .. and send back to browser -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/textpalignex1.php b/#jpgraph/src/Examples/textpalignex1.php deleted file mode 100644 index b4dfb36f..00000000 --- a/#jpgraph/src/Examples/textpalignex1.php +++ /dev/null @@ -1,44 +0,0 @@ -img; - -// Alignment for anchor points to use -$palign = array('left','center','right'); - -$n = count($palign); -$t = new Text($txt); - -$y = $ym; -for( $i=0; $i < $n; ++$i ) { - - $x = $xm + $i*$tw; - - $t->SetColor('black'); - $t->SetAlign('left','top'); - $t->SetFont(FF_ARIAL,FS_NORMAL,11); - $t->SetBox(); - $t->SetParagraphAlign($palign[$i]); - $t->Stroke($img, $x,$y); - - $img->SetColor('black'); - $img->SetFont(FF_FONT1,FS_BOLD); - $img->SetTextAlign('center','top'); - $img->StrokeText($x+140,$y+160,'"'.$palign[$i].'"'.' pargraph align'); - -} - -// .. and send back to browser -$g->Stroke(); - -?> - diff --git a/#jpgraph/src/Examples/theme_example.php b/#jpgraph/src/Examples/theme_example.php deleted file mode 100644 index 6d02e472..00000000 --- a/#jpgraph/src/Examples/theme_example.php +++ /dev/null @@ -1,23 +0,0 @@ -SetScale('textlin'); - -$theme_class = new AquaTheme; -$graph->SetTheme($theme_class); - -// after setting theme, you can change details as you want -$graph->SetFrame(true, 'lightgray'); // set frame visible - -$graph->xaxis->SetTickLabels(array('A','B','C','D')); // change xaxis lagels -$graph->title->Set("Theme Example"); // add title - -// add barplot -$bplot = new BarPlot($data1y); -$graph->Add($bplot); -$graph->SetColor('#cc1111'); // you can change color only after calling Add() - -$graph->Stroke(); diff --git a/#jpgraph/src/Examples/tiger1.jpg b/#jpgraph/src/Examples/tiger1.jpg deleted file mode 100644 index 99596101..00000000 Binary files a/#jpgraph/src/Examples/tiger1.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/tiger_bkg.gif b/#jpgraph/src/Examples/tiger_bkg.gif deleted file mode 100644 index 3faaa174..00000000 Binary files a/#jpgraph/src/Examples/tiger_bkg.gif and /dev/null differ diff --git a/#jpgraph/src/Examples/tiger_bkg.jpg b/#jpgraph/src/Examples/tiger_bkg.jpg deleted file mode 100644 index 43d45f30..00000000 Binary files a/#jpgraph/src/Examples/tiger_bkg.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/tiger_bkg.png b/#jpgraph/src/Examples/tiger_bkg.png deleted file mode 100644 index 78d8e25b..00000000 Binary files a/#jpgraph/src/Examples/tiger_bkg.png and /dev/null differ diff --git a/#jpgraph/src/Examples/timestampex01.php b/#jpgraph/src/Examples/timestampex01.php deleted file mode 100644 index b2ee12e9..00000000 --- a/#jpgraph/src/Examples/timestampex01.php +++ /dev/null @@ -1,59 +0,0 @@ -SetMargin(40,20,30,50); - -// Now specify the X-scale explicit but let the Y-scale be auto-scaled -$graph->SetScale("intlin",0,0,$adjstart,$adjend); -$graph->title->Set("Example on TimeStamp Callback"); - -// Setup the callback and adjust the angle of the labels -$graph->xaxis->SetLabelFormatCallback('TimeCallback'); -$graph->xaxis->SetLabelAngle(90); - -// Set the labels every 5min (i.e. 300seconds) and minor ticks every minute -$graph->xaxis->scale->ticks->Set(300,60); - -$line = new LinePlot($data,$xdata); -$line->SetColor('lightblue'); -$graph->Add($line); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/titlecsimex01.php b/#jpgraph/src/Examples/titlecsimex01.php deleted file mode 100644 index a44290e5..00000000 --- a/#jpgraph/src/Examples/titlecsimex01.php +++ /dev/null @@ -1,62 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(50,80,20,40); -$graph->yaxis->SetTitleMargin(30); -$graph->yaxis->scale->SetGrace(30); -$graph->SetShadow(); - - -// Create a bar pot -$bplot = new BarPlot($datay); - -// Create targets for the bars image maps. One for each column -$targ=array("bar_clsmex1.php#1","bar_clsmex1.php#2","bar_clsmex1.php#3","bar_clsmex1.php#4","bar_clsmex1.php#5","bar_clsmex1.php#6"); -$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d"); -$bplot->SetCSIMTargets($targ,$alts); -$bplot->SetFillColor("orange"); -$bplot->SetLegend('Year 2001 %%','#kalle ','%s'); - -// Display the values on top of each bar -$bplot->SetShadow(); -$bplot->value->SetFormat(" $ %2.1f",70); -$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9); -$bplot->value->SetColor("blue"); -$bplot->value->Show(); - -$graph->Add($bplot); - -// Create a big "button" that has an image map action -$txt1 = new Text("A simple text with\ntwo rows"); -$txt1->SetFont(FF_ARIAL); -$txt1->SetBox('lightblue','black','white@1',5); -$txt1->SetParagraphAlign('center'); -$txt1->SetPos(40,50); -$txt1->SetCSIMTarget('#88','Text element'); -$graph->Add($txt1); - -// Add image map to the graph title as well (you can do this to the -// sub- and subsub-title as well) -$graph->title->Set("Image maps barex1"); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->title->SetCSIMTarget('#45','Title for Bar'); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Setup the axis title image map and font style -$graph->yaxis->title->SetFont(FF_FONT2,FS_BOLD); -$graph->yaxis->title->SetCSIMTarget('#55','Y-axis title'); -$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); -$graph->xaxis->title->SetCSIMTarget('#55','X-axis title'); - -// Send back the HTML page which will call this script again -// to retrieve the image. -$graph->StrokeCSIM(); - -?> diff --git a/#jpgraph/src/Examples/titleex1.php b/#jpgraph/src/Examples/titleex1.php deleted file mode 100644 index 77baa00b..00000000 --- a/#jpgraph/src/Examples/titleex1.php +++ /dev/null @@ -1,29 +0,0 @@ -SetScale("textlin"); -$graph->SetMargin(25,10,30,30); - -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); -$graph->title->Set('The Title'); -$graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10); -$graph->subtitle->Set('The Subtitle'); -$graph->subsubtitle->SetFont(FF_ARIAL,FS_ITALIC,9); -$graph->subsubtitle->Set('The Subsubitle'); - -// Create the linear plot -$lineplot=new LinePlot($ydata); -$lineplot->SetColor("blue"); - -// Add the plot to the graph -$graph->Add($lineplot); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/topxaxisex1.php b/#jpgraph/src/Examples/topxaxisex1.php deleted file mode 100644 index 6143875e..00000000 --- a/#jpgraph/src/Examples/topxaxisex1.php +++ /dev/null @@ -1,49 +0,0 @@ -img->SetMargin(40,40,40,20); - -$graph->SetScale("linlin"); -$graph->SetShadow(); -$graph->title->Set("Top X-axis"); - -// Start at 0 -$graph->yscale->SetAutoMin(0); - -// Add some air around the Y-scale -$graph->yscale->SetGrace(100); - -// Use built in font -$graph->title->SetFont(FF_FONT1,FS_BOLD); - -// Adjust the X-axis -$graph->xaxis->SetPos("max"); -$graph->xaxis->SetLabelSide(SIDE_UP); -$graph->xaxis->SetTickSide(SIDE_DOWN); - -// Create the line plot -$p1 = new LinePlot($datay); -$p1->SetColor("blue"); - -// Specify marks for the line plots -$p1->mark->SetType(MARK_FILLEDCIRCLE); -$p1->mark->SetFillColor("red"); -$p1->mark->SetWidth(4); - -// Show values -$p1->value->Show(); - -// Add lineplot to graph -$graph->Add($p1); - -// Output line -$graph->Stroke(); - -?> - - diff --git a/#jpgraph/src/Examples/tornado.jpg b/#jpgraph/src/Examples/tornado.jpg deleted file mode 100644 index 24c1ea1b..00000000 Binary files a/#jpgraph/src/Examples/tornado.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/tr1.jpg b/#jpgraph/src/Examples/tr1.jpg deleted file mode 100644 index f855e31e..00000000 Binary files a/#jpgraph/src/Examples/tr1.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/tr2.jpg b/#jpgraph/src/Examples/tr2.jpg deleted file mode 100644 index 6a75e474..00000000 Binary files a/#jpgraph/src/Examples/tr2.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/tr3.jpg b/#jpgraph/src/Examples/tr3.jpg deleted file mode 100644 index 799e097d..00000000 Binary files a/#jpgraph/src/Examples/tr3.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/tr4.jpg b/#jpgraph/src/Examples/tr4.jpg deleted file mode 100644 index fe411c1c..00000000 Binary files a/#jpgraph/src/Examples/tr4.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/tr5.jpg b/#jpgraph/src/Examples/tr5.jpg deleted file mode 100644 index 33c97488..00000000 Binary files a/#jpgraph/src/Examples/tr5.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/tr6.jpg b/#jpgraph/src/Examples/tr6.jpg deleted file mode 100644 index 81321b7d..00000000 Binary files a/#jpgraph/src/Examples/tr6.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/universal_example.php b/#jpgraph/src/Examples/universal_example.php deleted file mode 100644 index eae0c190..00000000 --- a/#jpgraph/src/Examples/universal_example.php +++ /dev/null @@ -1,58 +0,0 @@ - array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), - 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), - 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), - 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), - 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), - 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), - 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), - 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), - 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), -); - - -// Create the graph. These two calls are always required -$graph = new Graph(400,300); - -$graph->SetScale("textlin"); -if ($theme) { - $graph->SetTheme(new $theme()); -} -$theme_class = new UniversalTheme; -$graph->SetTheme($theme_class); - -$plot = array(); -// Create the bar plots -for ($i = 0; $i < 4; $i++) { - $plot[$i] = new BarPlot($data[$i]); - $plot[$i]->SetLegend('plot'.($i+1)); -} -//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); -//$acc1->value->Show(); -$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); - -for ($i = 4; $i < 8; $i++) { - $plot[$i] = new LinePlot($data[$i]); - $plot[$i]->SetLegend('plot'.$i); - $plot[$i]->value->Show(); -} - -$graph->Add($gbplot); -$graph->Add($plot[4]); - -$title = "UniversalTheme Example"; -$title = mb_convert_encoding($title,'UTF-8'); -$graph->title->Set($title); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/vivid_example.php b/#jpgraph/src/Examples/vivid_example.php deleted file mode 100644 index 1d227481..00000000 --- a/#jpgraph/src/Examples/vivid_example.php +++ /dev/null @@ -1,57 +0,0 @@ - array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), - 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), - 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), - 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), - 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), - 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), - 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), - 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), - 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), -); - -// Create the graph. These two calls are always required -$graph = new Graph(400,300); - -$graph->SetScale("textlin"); -if ($theme) { - $graph->SetTheme(new $theme()); -} -$theme_class = new VividTheme; -$graph->SetTheme($theme_class); - -$plot = array(); -// Create the bar plots -for ($i = 0; $i < 4; $i++) { - $plot[$i] = new BarPlot($data[$i]); - $plot[$i]->SetLegend('plot'.($i+1)); -} -//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); -//$acc1->value->Show(); -$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); - -for ($i = 4; $i < 8; $i++) { - $plot[$i] = new LinePlot($data[$i]); - $plot[$i]->SetLegend('plot'.$i); - $plot[$i]->value->Show(); -} - -$graph->Add($gbplot); -$graph->Add($plot[4]); - -$title = "VividTheme Example"; -$title = mb_convert_encoding($title,'UTF-8'); -$graph->title->Set($title); -$graph->xaxis->title->Set("X-title"); -$graph->yaxis->title->Set("Y-title"); - -// Display the graph -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/windrose_2plots_ex1.php b/#jpgraph/src/Examples/windrose_2plots_ex1.php deleted file mode 100644 index 7aee3154..00000000 --- a/#jpgraph/src/Examples/windrose_2plots_ex1.php +++ /dev/null @@ -1,44 +0,0 @@ - array(10,10,13,7), - 2 => array(2,8,10), - 4 => array(1,12,22), - ); - -$data2 = array( - 4 => array(12,8,2,3), - 2 => array(5,4,4,5,2), - ); - -// Create a new small windrose graph -$graph = new WindroseGraph(660,400); -$graph->SetShadow(); - -$graph->title->Set('Two windrose plots in one graph'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); -$graph->subtitle->Set('(Using Box() for each plot)'); - -$wp = new WindrosePlot($data); -$wp->SetType(WINDROSE_TYPE8); -$wp->SetSize(0.42); -$wp->SetPos(0.25,0.55); -$wp->SetBox(); - -$wp2 = new WindrosePlot($data2); -$wp2->SetType(WINDROSE_TYPE16); -$wp2->SetSize(0.42); -$wp2->SetPos(0.74,0.55); -$wp2->SetBox(); -$wp2->SetRangeColors(array('green','yellow','red','brown')); - -$graph->Add($wp); -$graph->Add($wp2); - -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_bgimg_ex1.php b/#jpgraph/src/Examples/windrose_bgimg_ex1.php deleted file mode 100644 index e51372d8..00000000 --- a/#jpgraph/src/Examples/windrose_bgimg_ex1.php +++ /dev/null @@ -1,50 +0,0 @@ - array(12,8,2,3), - 6 => array(5,4,4,5,4), - ); - -$se_CompassLbl = array('O','ONO','NO','NNO','N','NNV','NV','VNV','V','VSV','SV','SSV','S','SSO','SO','OSO'); - -// Create a new small windrose graph -$graph = new WindroseGraph(400,400); -$graph->SetMargin(25,25,25,25); -$graph->SetFrame(); - -$graph->title->Set('Example with background flag'); -#$graph->title->SetFont(FF_VERA,FS_BOLD,14); - - -//$graph->SetBackgroundImage('bkgimg.jpg',BGIMG_FILLFRAME); -//$graph->SetBackgroundImageMix(90); -$graph->SetBackgroundCFlag(28,BGIMG_FILLFRAME,15); - - -$wp2 = new WindrosePlot($data2); -$wp2->SetType(WINDROSE_TYPE16); -$wp2->SetSize(0.55); -$wp2->SetPos(0.5,0.5); -$wp2->SetAntiAlias(false); - -$wp2->SetFont(FF_ARIAL,FS_BOLD,10); -$wp2->SetFontColor('black'); - -$wp2->SetCompassLabels($se_CompassLbl); -$wp2->legend->SetMargin(20,5); - -$wp2->scale->SetZFont(FF_ARIAL,FS_NORMAL,8); -$wp2->scale->SetFont(FF_ARIAL,FS_NORMAL,9); -$wp2->scale->SetLabelFillColor('white','white'); - -$wp2->SetRangeColors(array('green','yellow','red','brown')); - -$graph->Add($wp2); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex0.php b/#jpgraph/src/Examples/windrose_ex0.php deleted file mode 100644 index 897d4283..00000000 --- a/#jpgraph/src/Examples/windrose_ex0.php +++ /dev/null @@ -1,25 +0,0 @@ - array(5,5,5,8), - 1 => array(3,4,1,4), - 'WSW' => array(1,5,5,3), - 'N' => array(2,3,8,1,1), - 15 => array(2,3,5)); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,400); -$graph->title->Set('A basic Windrose graph'); - -// Create the windrose plot. -$wp = new WindrosePlot($data); - -// Add and send back to browser -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex1.php b/#jpgraph/src/Examples/windrose_ex1.php deleted file mode 100644 index e892a21e..00000000 --- a/#jpgraph/src/Examples/windrose_ex1.php +++ /dev/null @@ -1,28 +0,0 @@ - array(1,1,2.5,4), - 1 => array(3,4,1,4), - 'wsw' => array(1,5,5,3), - 'N' => array(2,7,5,4,2), - 15 => array(2,7,12)); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,400); - -// Setup title -$graph->title->Set('Windrose basic example'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('navy'); - -// Create the windrose plot. -$wp = new WindrosePlot($data); -$wp->SetRadialGridStyle('solid'); -$graph->Add($wp); - -// Send the graph to the browser -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex1b.php b/#jpgraph/src/Examples/windrose_ex1b.php deleted file mode 100644 index c24a98c8..00000000 --- a/#jpgraph/src/Examples/windrose_ex1b.php +++ /dev/null @@ -1,33 +0,0 @@ - array(1,1,2.5,4), - 1 => array(3,4,1,4), - 'wsw' => array(1,5,5,3), - 'N' => array(2,7,5,4,2), - 15 => array(2,7,12)); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,400); -$graph->title->Set('Windrose example 1b'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('navy'); - -// Create the windrose plot. -// The default plot will have 16 compass axis. -$wp = new WindrosePlot($data); -$wp->SetRadialGridStyle('solid'); -$graph->Add($wp); - -// Setup the range so that the values do not touch eachother -$wp->SetRanges(array(0,1,2,3,4,5,6,7,8,10)); -$wp->SetRangeStyle(RANGE_DISCRETE); // Cmp with RANGE_OVERLAPPING as default - -// Send the graph to the browser -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex2.1.php b/#jpgraph/src/Examples/windrose_ex2.1.php deleted file mode 100644 index 48781acc..00000000 --- a/#jpgraph/src/Examples/windrose_ex2.1.php +++ /dev/null @@ -1,49 +0,0 @@ - array(1,1,6,4), - 1 => array(3,8,1,4), - 2 => array(2,7,4,4,3), - 3 => array(2,7,1,2)); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,400); - -// Setup title -$graph->title->Set('Windrose example 2'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('navy'); - -// Create the windrose plot. -$wp = new WindrosePlot($data); - -// Make it have 8 compass direction -$wp->SetType(WINDROSE_TYPE4); - -// Setup the weight of the laegs for the different ranges -$weights = array_fill(0,8,10); -$wp->SetRangeWeights($weights); - -// Adjust the font and font color for scale labels -$wp->scale->SetFont(FF_TIMES,FS_NORMAL,11); -$wp->scale->SetFontColor('navy'); - -// Set the diametr for the plot to 160 pixels -$wp->SetSize(160); - -// Set the size of the innermost center circle to 30% of the plot size -$wp->SetZCircleSize(0.2); - -// Adjust the font and font color for compass directions -$wp->SetFont(FF_ARIAL,FS_NORMAL,12); -$wp->SetFontColor('darkgreen'); - -// Add and send back to browser -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex2.php b/#jpgraph/src/Examples/windrose_ex2.php deleted file mode 100644 index 23822cca..00000000 --- a/#jpgraph/src/Examples/windrose_ex2.php +++ /dev/null @@ -1,49 +0,0 @@ - array(1,1,2.5,4), - 1 => array(3,4,1,4), - 3 => array(2,7,4,4,3), - 5 => array(2,7,1,2)); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,400); - -// Setup title -$graph->title->Set('Windrose example 2'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('navy'); - -// Create the windrose plot. -$wp = new WindrosePlot($data); - -// Make it have 8 compass direction -$wp->SetType(WINDROSE_TYPE8); - -// Setup the weight of the laegs for the different ranges -$weights = array_fill(0,8,10); -$wp->SetRangeWeights($weights); - -// Adjust the font and font color for scale labels -$wp->scale->SetFont(FF_TIMES,FS_NORMAL,11); -$wp->scale->SetFontColor('navy'); - -// Set the diametr for the plot to 160 pixels -$wp->SetSize(200); - -// Set the size of the innermost center circle to 30% of the plot size -$wp->SetZCircleSize(0.2); - -// Adjust the font and font color for compass directions -$wp->SetFont(FF_ARIAL,FS_NORMAL,12); -$wp->SetFontColor('darkgreen'); - -// Add and send back the graph to the client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex3.php b/#jpgraph/src/Examples/windrose_ex3.php deleted file mode 100644 index 39c12cea..00000000 --- a/#jpgraph/src/Examples/windrose_ex3.php +++ /dev/null @@ -1,73 +0,0 @@ - array(1,1,2.5,4), - 1 => array(3,4,1,4), - 3 => array(2,7,4,4,3), - 5 => array(2,7,1,2)); - -$data[1] = array( - "n" => array(1,1,2.5,4), - "ssw" => array(3,4,1,4), - "se" => array(2,7,4,4,3)); - -// Store the position and size data for each plot in an -// array to make it easier to create multiple plots. -// The format choosen for the layout data is -// (type,x-pos,y-pos,size, z-circle size) -$layout = array( - array(WINDROSE_TYPE8,0.25,0.55,0.4,0.25), - array(WINDROSE_TYPE16,0.75,0.55,0.4,0.25)); - -$legendtxt = array('(m/s) Station 7','(m/s) Station 12'); - -// First create a new windrose graph with a dropshadow -$graph = new WindroseGraph(600,350); -$graph->SetShadow('darkgray'); - -// Setup titles -$graph->title->Set('Windrose example 3'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('navy'); -$graph->subtitle->Set('(Multiple plots in the same graph)'); -$graph->subtitle->SetFont(FF_VERDANA,FS_NORMAL,9); -$graph->subtitle->SetColor('navy'); - -// Create the two windrose plots. -for( $i=0; $i < count($data); ++$i ) { - $wp[$i] = new WindrosePlot($data[$i]); - - // Make it have 8 compass direction - $wp[$i]->SetType($layout[$i][0]); - - // Adjust the font and font color for scale labels - $wp[$i]->scale->SetFont(FF_TIMES,FS_NORMAL,10); - $wp[$i]->scale->SetFontColor('navy'); - - // Set the position of the plot - $wp[$i]->SetPos($layout[$i][1],$layout[$i][2]); - - // Set the diameter for the plot to 30% of the width of the graph pixels - $wp[$i]->SetSize($layout[$i][3]); - - // Set the size of the innermost center circle to 30% of the plot size - $wp[$i]->SetZCircleSize($layout[$i][4]); - - // Adjust the font and font color for compass directions - $wp[$i]->SetFont(FF_ARIAL,FS_NORMAL,10); - $wp[$i]->SetFontColor('darkgreen'); - - // Add legend text - $wp[$i]->legend->SetText($legendtxt[$i]); - - $graph->Add($wp[$i]); -} - -// Send the graph to the browser -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex4.php b/#jpgraph/src/Examples/windrose_ex4.php deleted file mode 100644 index 04652041..00000000 --- a/#jpgraph/src/Examples/windrose_ex4.php +++ /dev/null @@ -1,58 +0,0 @@ - array(1,1,2.5,4), - 1 => array(3,4,1,4), - 3 => array(2,7,4,4,3), - 5 => array(2,7,1,2)); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,400); - -// Setup title -$graph->title->Set('Windrose example 4'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('navy'); - -// Create the windrose plot. -$wp = new WindrosePlot($data); - -// Adjust the font and font color for scale labels -$wp->scale->SetFont(FF_TIMES,FS_NORMAL,11); -$wp->scale->SetFontColor('navy'); - -// Set the diameter and position for plot -$wp->SetSize(190); - -// Set the size of the innermost center circle to 40% of the plot size -// Note that we can have the automatic "Zero" sum appear in our custom text -$wp->SetZCircleSize(0.38); -$wp->scale->SetZeroLabel("Station 12\n(Calm %d%%)"); - -// Adjust color and font for center circle text -$wp->scale->SetZFont(FF_ARIAL,FS_NORMAL,9); -$wp->scale->SetZFontColor('darkgreen'); - -// Adjust the font and font color for compass directions -$wp->SetFont(FF_ARIAL,FS_NORMAL,10); -$wp->SetFontColor('darkgreen'); - -// Adjust the margin to the compass directions -$wp->SetLabelMargin(50); - -// Adjust grid colors -$wp->SetGridColor('silver','blue'); - -// Add (m/s) text to legend -$wp->legend->SetText('(m/s)'); -$wp->legend->SetMargin(20,5); - -// Add and send back to client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex5.php b/#jpgraph/src/Examples/windrose_ex5.php deleted file mode 100644 index f013c3bf..00000000 --- a/#jpgraph/src/Examples/windrose_ex5.php +++ /dev/null @@ -1,94 +0,0 @@ - array(1,1,2.5,4), - 1 => array(3,4,1,4), - 3 => array(2,7,4,4,3), - 5 => array(2,7,1,2)); - -// Text to be added. -$txt=array(); -$txt[0] = "It is possible to add arbitrary,multi line, text to a graph. "; -$txt[0] .= "Such a paragraph can have it's text be left, right or center "; -$txt[0] .= "aligned."; -$txt[1] = "This is an example of a right aligned paragraph."; -$txt[2] = "Finally we can show a center aligned paragraph without box."; - -// We store the layout for each of the text boxes in an array -// to keep the code clean -$txtlayout = array( - array(0.97,0.15,25,'left','black','lightblue'), - array(0.97,0.4,20,'right','black','lightblue'), - array(0.97,0.7,20,'center','darkred',false,FF_COMIC,FS_NORMAL,12), -); - -// Range colors to be used -$rangeColors = array('silver','khaki','orange','brown','blue','navy','maroon','red'); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(570,430); -$graph->title->Set('Windrose example 5'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('navy'); - -// Setup graph background color -$graph->SetColor('darkgreen@0.7'); - -// Setup all the defined text boxes -$n = count($txt); -for( $i=0; $i < $n; ++$i ) { - $txtbox[$i] = new Text($txt[$i]); - $txtbox[$i]->SetPos($txtlayout[$i][0],$txtlayout[$i][1],'right'); - $txtbox[$i]->SetWordwrap($txtlayout[$i][2]); - $txtbox[$i]->SetParagraphAlign($txtlayout[$i][3]); - $txtbox[$i]->SetColor($txtlayout[$i][4]); - $txtbox[$i]->SetBox($txtlayout[$i][5]); - if( count($txtlayout[$i]) > 6 ) - $txtbox[$i]->SetFont($txtlayout[$i][6],$txtlayout[$i][7],$txtlayout[$i][8]); -} -$graph->Add($txtbox); - -// Create the windrose plot. -$wp = new WindrosePlot($data); - -// Set background color for plot area -$wp->SetColor('lightyellow'); - -// Add a box around the plot -$wp->SetBox(); - -// Setup the colors for the ranges -$wp->SetRangeColors($rangeColors); - -// Adjust the font and font color for scale labels -$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9); -$wp->scale->SetFontColor('navy'); - -// Set the diameter and position for plot -$wp->SetSize(190); -$wp->SetPos(0.35,0.53); - -$wp->SetZCircleSize(0.2); - -// Adjust the font and font color for compass directions -$wp->SetFont(FF_ARIAL,FS_NORMAL,10); -$wp->SetFontColor('darkgreen'); - -// Adjust the margin to the compass directions -$wp->SetLabelMargin(50); - -// Adjust grid colors -$wp->SetGridColor('silver','blue'); - -// Add (m/s) text to legend -$wp->legend->SetText('(m/s)'); -$wp->legend->SetMargin(20,5); - -// Add plot and send back to client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex6.1.php b/#jpgraph/src/Examples/windrose_ex6.1.php deleted file mode 100644 index 61504c86..00000000 --- a/#jpgraph/src/Examples/windrose_ex6.1.php +++ /dev/null @@ -1,89 +0,0 @@ - array(1,1,2.5,4), - '32.0' => array(3,4,1,4), - '120.5' => array(2,3,4,4,3,2,1), - '223.2' => array(2,4,1,2,2), - '285.7' => array(2,2,1,2,4,2,1,1) -); - -// This file is encode din utf-8. The two Kanji characters roughly means -// 中 = Chinese -// 文 = Sentences -$ctxt = '中文'; - -// Specify text for direction labels -$labels = array( - '120.5' => $ctxt, - '232.2' => "Reference\n#13 Ver:2"); - -// Range colors to be used -$rangeColors = array('khaki','yellow','orange','orange:0.7','brown','darkred','black'); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,450); - -// Setup title -$graph->title->Set('Using chinese charecters'); -#$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('navy'); -$graph->subtitle->Set('(Free type plot)'); -#$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); -$graph->subtitle->SetColor('navy'); - -// Create the windrose plot. -$wp = new WindrosePlot($data); - -// Setup a free plot -$wp->SetType(WINDROSE_TYPEFREE); - -// Setup labels -$wp->SetLabels($labels); -$wp->SetLabelPosition(LBLPOSITION_CENTER); -$wp->SetLabelMargin(30); - -// Setup the colors for the ranges -$wp->SetRangeColors($rangeColors); - -// Adjust the font and font color for scale labels -#$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9); - -// Set the diameter and position for plot -#$wp->SetSize(240); -$wp->SetSize(200); -$wp->SetZCircleSize(30); -$wp->SetPos(0.5,0.5); - -// Adjust the font and font color for compass directions -#$wp->SetFont(FF_CHINESE,FS_NORMAL,12); -$wp->SetFontColor('darkgreen'); - -// Adjust grid colors -$wp->SetGridColor('darkgreen@0.7','blue'); - -// Add (m/s) text to legend -$wp->legend->SetText('(m/s)'); -$wp->legend->SetTFontColor('blue'); - -// Set legend label font color -$wp->legend->SetLFontColor('orange:0.7'); -#$wp->legend->SetLFont(FF_ARIAL,FS_ITALIC,8); - -// Display legend values with no decimals -$wp->legend->SetFormat('%d'); - -// Set the circle font to use chinse character set -// Note: When FF_CHINESE is used the input charectr data are -// assumed to already be in utf-8 encoding -#$wp->legend->SetCFont(FF_CHINESE,FS_NORMAL,14); -$wp->legend->SetCircleText($ctxt); -$wp->legend->SetCFontColor('red'); - -// Add plot to graph and send back to client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex6.php b/#jpgraph/src/Examples/windrose_ex6.php deleted file mode 100644 index 557f005a..00000000 --- a/#jpgraph/src/Examples/windrose_ex6.php +++ /dev/null @@ -1,72 +0,0 @@ - array(1,1,2.5,4), - '32.0' => array(3,4,1,4), - '120.5' => array(2,3,4,4,3,2,1), - '223.2' => array(2,4,1,2,2), - '285.7' => array(2,2,1,2,4,2,1,1) -); - -// Specify text for direction labels -$labels = array( '120.5' => "Plant\n#1275", - '285.7' => "Reference\n#13 Ver:2"); - -// Range colors to be used -$rangeColors = array('khaki','yellow','orange','orange:0.7','brown','darkred','black'); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,450); - -// Setup titles -$graph->title->Set('Windrose example 6'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('navy'); - -$graph->subtitle->Set('(Free type plot)'); -$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); -$graph->subtitle->SetColor('navy'); - -// Create the windrose plot. -$wp = new WindrosePlot($data); - -// Setup a free plot -$wp->SetType(WINDROSE_TYPEFREE); - -// Setup labels -$wp->SetLabels($labels); -$wp->SetLabelPosition(LBLPOSITION_CENTER); -$wp->SetLabelMargin(30); - -// Setup the colors for the ranges -$wp->SetRangeColors($rangeColors); - -// Adjust the font and font color for scale labels -$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9); - -// Set the diameter and position for plot -$wp->SetSize(230); -$wp->SetZCircleSize(30); - -// Adjust the font and font color for compass directions -$wp->SetFont(FF_ARIAL,FS_NORMAL,10); -$wp->SetFontColor('darkgreen'); - -// Adjust grid colors -$wp->SetGridColor('darkgreen@0.7','blue'); - -// Add (m/s) text to legend -$wp->legend->SetText('(m/s)'); - -// Display legend values with no decimals -$wp->legend->SetFormat('%d'); - -// Add plot to graph and send back to the client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex7.1.php b/#jpgraph/src/Examples/windrose_ex7.1.php deleted file mode 100644 index 44987168..00000000 --- a/#jpgraph/src/Examples/windrose_ex7.1.php +++ /dev/null @@ -1,67 +0,0 @@ - array(1,15,7.5,2), - 5 => array(1,1,1.5,2), - 7 => array(1,2,10,3,2), - 8 => array(2,3,1,3,1,2), - ); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(590,580); -$graph->title->Set('Japanese locale'); -#$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); -$graph->title->SetColor('navy'); - -// Create the free windrose plot. -$wp = new WindrosePlot($data); -$wp->SetType(WINDROSE_TYPE8); - -// Add some "arbitrary" text to the center -$wp->scale->SetZeroLabel("SOx\n8%%"); - -// Localize the compass direction labels into Japanese -// Note: The labels for data must now also match the exact -// string for the compass directions. -// -// E   東 -// NE  北東 -// N   北 -// NW  北西 -// W   西 -// SW  南西 -// S   南 -// SE  南東 -$jp_CompassLbl = array('東','','北東','','北','','北西','', - '西','','南西','','南','','南東',''); -$wp->SetCompassLabels($jp_CompassLbl); -#$wp->SetFont(FF_MINCHO,FS_NORMAL,15); - -// Localize the "Calm" text into Swedish and make the circle -// slightly bigger than default -$jp_calmtext = '平穏'; -$wp->legend->SetCircleText($jp_calmtext); -$wp->legend->SetCircleRadius(20); -#$wp->legend->SetCFont(FF_MINCHO,FS_NORMAL,10); -$wp->legend->SetMargin(5,0); -$wp->SetPos(0.5, 0.5); - -// Adjust the displayed ranges -$ranges = array(1,3,5,8,12,19,29); -$wp->SetRanges($ranges); - -// Set the scale to always have max value of 30 -$wp->scale->Set(30,10); -#$wp->scale->SetFont(FF_VERA,FS_NORMAL,12); - -// Finally add it to the graph and send back to client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex7.php b/#jpgraph/src/Examples/windrose_ex7.php deleted file mode 100644 index b7a9b83e..00000000 --- a/#jpgraph/src/Examples/windrose_ex7.php +++ /dev/null @@ -1,51 +0,0 @@ - array(1,15,7.5,2), - 5 => array(1,1,1.5,2), - 7 => array(1,2,10,3,2), - 9 => array(2,3,1,3,1,2), - ); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,450); -$graph->title->Set('Windrose example 7'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); -$graph->title->SetColor('navy'); - -// Create the free windrose plot. -$wp = new WindrosePlot($data); -$wp->SetType(WINDROSE_TYPE16); - -// Add some "arbitrary" text to the center -$wp->scale->SetZeroLabel("SOx\n8%%"); - -// Localize the compass direction labels into Swedish -// Note: The labels for data must now also match the exact -// string for the compass directions. -$se_CompassLbl = array('O','ONO','NO','NNO','N','NNV','NV','VNV', - 'V','VSV','SV','SSV','S','SSO','SO','OSO'); -$wp->SetCompassLabels($se_CompassLbl); - -// Localize the "Calm" text into Swedish and make the circle -// slightly bigger than default -$se_calmtext = 'Lugnt'; -$wp->legend->SetCircleText($se_calmtext); -$wp->legend->SetCircleRadius(20); - -// Adjust the displayed ranges -$ranges = array(1,3,5,8,12,19,29); -$wp->SetRanges($ranges); -//$wp->SetAntiAlias(true); - -// Set the scale to always have max value of 30 with a step -// size of 12. -$wp->scale->Set(30,12); - -// Finally add it to the graph and send back to client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex8.1.php b/#jpgraph/src/Examples/windrose_ex8.1.php deleted file mode 100644 index caaff637..00000000 --- a/#jpgraph/src/Examples/windrose_ex8.1.php +++ /dev/null @@ -1,49 +0,0 @@ - array(3,2,1,2,2), - 355 => array(1,1,1.5,2), - 180 => array(1,1,1.5,2), - 150 => array(1,2,1,3), - 'S' => array(2,3,5,1), - ); - -// Add some labels for afew of the directions -$labels = array(355=>"At\nHome base",180=>"Probe\n123",150=>"Power\nplant"); - -// Define the color,weight and style of some individual radial grid lines. -$axiscolors = array(355=>"red"); -$axisweights = array(355=>8); -$axisstyles = array(355=>'solid',150=>'solid'); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,460); -$graph->title->Set('Adding label backgrounds'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); -$graph->title->SetColor('navy'); - -// Create the free windrose plot. -$wp = new WindrosePlot($data); -$wp->SetType(WINDROSE_TYPEFREE); -$wp->scale->SetLabelFillColor('lightblue','black'); - -// Specify colors weights and style for the radial gridlines -$wp->SetRadialColors($axiscolors); -$wp->SetRadialWeights($axisweights); -$wp->SetRadialStyles($axisstyles); - -// Add a few labels -$wp->SetLabels($labels); - -// Add some "arbitrary" text to the center -$wp->scale->SetZeroLabel("SOx\n8%%"); - -// Finally add it to the graph and send back to client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex8.php b/#jpgraph/src/Examples/windrose_ex8.php deleted file mode 100644 index b81c874d..00000000 --- a/#jpgraph/src/Examples/windrose_ex8.php +++ /dev/null @@ -1,48 +0,0 @@ - array(3,2,1,2,2), - 355 => array(1,1,1.5,2), - 180 => array(1,1,1.5,2), - 150 => array(1,2,1,3), - 'S' => array(2,3,5,1), - ); - -// Add some labels for afew of the directions -$labels = array(355=>"At\nHome base",180=>"Probe\n123",150=>"Power\nplant"); - -// Define the color,weight and style of some individual radial grid lines. -$axiscolors = array(355=>"red"); -$axisweights = array(355=>8); -$axisstyles = array(355=>'solid',150=>'solid'); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,500); -$graph->title->Set('Windrose example 8'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); -$graph->title->SetColor('navy'); - -// Create the free windrose plot. -$wp = new WindrosePlot($data); -$wp->SetType(WINDROSE_TYPEFREE); - -// Specify colors weights and style for the radial gridlines -$wp->SetRadialColors($axiscolors); -$wp->SetRadialWeights($axisweights); -$wp->SetRadialStyles($axisstyles); - -// Add a few labels -$wp->SetLabels($labels); - -// Add some "arbitrary" text to the center -$wp->scale->SetZeroLabel("SOx\n8%%"); - -// Finally add it to the graph and send back to client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex9.1.php b/#jpgraph/src/Examples/windrose_ex9.1.php deleted file mode 100644 index dbdebed4..00000000 --- a/#jpgraph/src/Examples/windrose_ex9.1.php +++ /dev/null @@ -1,62 +0,0 @@ - array(3,2,1,2,2), - 4 => array(1,1,1.5,2), - 6 => array(1,1,1.5,2), - 12 => array(2,3,5,1), -); - -$xpos1 = 0.26; -$xpos2 = 0.74; -$ypos1 = 0.5; -$ypos2 = 0.9; - -// First create a new windrose graph with a title -$graph = new WindroseGraph(650,350); -$graph->title->Set('Interpretation of ordinal keys'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); -$graph->title->SetColor('navy'); - -// Create the first plot -$wp1 = new WindrosePlot($data); -$wp1->SetType(WINDROSE_TYPE16); - -// This is the default encoding -$wp1->SetDataKeyEncoding(KEYENCODING_ANTICLOCKWISE); -$wp1->legend->Hide(); -$wp1->SetPos($xpos1,$ypos1); -$wp1->SetSize(0.5); - -// Create the second plot -$wp2 = new WindrosePlot($data); -$wp2->SetType(WINDROSE_TYPE16); -$wp2->SetDataKeyEncoding(KEYENCODING_CLOCKWISE); -$wp2->legend->Hide(); -$wp2->SetPos($xpos2,$ypos1); -$wp2->SetSize(0.5); - -$txt1 = new Text('KEYENCODING_ANTICLOCKWISE'); -$txt1->SetFont(FF_COURIER,FS_BOLD,12); -$txt1->SetPos($xpos1,$ypos2); -$txt1->SetAlign('center','top'); - -$txt2 = new Text('KEYENCODING_CLOCKWISE'); -$txt2->SetFont(FF_COURIER,FS_BOLD,12); -$txt2->SetPos($xpos2,$ypos2); -$txt2->SetAlign('center','top'); - -// Finally add it to the graph and send back to the client -$graph->Add($wp1); -$graph->Add($txt1); - -$graph->Add($wp2); -$graph->Add($txt2); - -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_ex9.php b/#jpgraph/src/Examples/windrose_ex9.php deleted file mode 100644 index 53f3dda7..00000000 --- a/#jpgraph/src/Examples/windrose_ex9.php +++ /dev/null @@ -1,46 +0,0 @@ - array(3,2,1,2,2), - 'N' => array(1,1,1.5,2), - 'nw' => array(1,1,1.5,2), - 'S' => array(2,3,5,1), - ); - -// Define the color,weight and style of some individual radial -// grid lines. Axis can be specified either by their (localized) -// label or by their index. -// Note; Depending on how many axis you have in the plot the -// index will vary between 0..n where n is the number of -// compass directions. -$axiscolors = array('nw'=>'brown'); -$axisweights = array('nw'=>8); // Could also be specified as 6 => 8 -$axisstyles = array('nw'=>'solid'); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,500); -$graph->title->Set('Windrose example 9'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); -$graph->title->SetColor('navy'); - -// Create the free windrose plot. -$wp = new WindrosePlot($data); -$wp->SetType(WINDROSE_TYPE16); - -// Specify colors weights and style for the radial gridlines -$wp->SetRadialColors($axiscolors); -$wp->SetRadialWeights($axisweights); -$wp->SetRadialStyles($axisstyles); - -// Add some "arbitrary" text to the center -$wp->scale->SetZeroLabel("SOx\n8%%"); - -// Finally add it to the graph and send back to the client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_icon_ex1.php b/#jpgraph/src/Examples/windrose_icon_ex1.php deleted file mode 100644 index 44811747..00000000 --- a/#jpgraph/src/Examples/windrose_icon_ex1.php +++ /dev/null @@ -1,33 +0,0 @@ - array(1,1,2.5,4), - 1 => array(3,4,1,4), - 'wsw' => array(1,5,5,3), - 'N' => array(2,7,5,4,2), - 15 => array(2,7,12)); - -// First create a new windrose graph with a title -$graph = new WindroseGraph(400,400); - -// Creta an icon to be added to the graph -$icon = new IconPlot('tornado.jpg',10,10,1.3,50); -$icon->SetAnchor('left','top'); -$graph->Add($icon); - -// Setup title -$graph->title->Set('Windrose icon example'); -$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); -$graph->title->SetColor('navy'); - -// Create the windrose plot. -$wp = new WindrosePlot($data); - -// Add to graph and send back to client -$graph->Add($wp); -$graph->Stroke(); -?> - diff --git a/#jpgraph/src/Examples/windrose_layout_ex0.php b/#jpgraph/src/Examples/windrose_layout_ex0.php deleted file mode 100644 index cd6f43cb..00000000 --- a/#jpgraph/src/Examples/windrose_layout_ex0.php +++ /dev/null @@ -1,45 +0,0 @@ - array(10,10,13,7), - 2 => array(2,8,10), - 4 => array(1,12,22)), - array( - 4 => array(12,8,2,3), - 2 => array(5,4,4,5,2)), - array( - 1 => array(12,8,2,3), - 3 => array(5,4,4,5,2)), - array( - 2 => array(12,8,2,3), - 3 => array(5,4,4,5,2)), -); - -// Create a windrose graph with titles -$graph = new WindroseGraph(600,650); -$graph->SetShadow(); - -$graph->title->Set('Multiple plots with automatic layout'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -// Setup the individual windrose plots -$wp = array(); -for( $i=0; $i < 4; ++$i ) { - $wp[$i] = new WindrosePlot($data[$i]); - $wp[$i]->SetSize(0.22); - $wp[$i]->SetCenterSize(0.25); -} - -// Position with two rows. Two plots in top row and three plots in -// bottom row. -$hl1 = new LayoutHor( array( $wp[0], $wp[1] ) ); -$hl2 = new LayoutHor( array( $wp[2], $wp[3] ) ); -$vl = new LayoutVert( array( $hl1, $hl2) ); - -$graph->Add($vl); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/windrose_layout_ex1.php b/#jpgraph/src/Examples/windrose_layout_ex1.php deleted file mode 100644 index d44a61c2..00000000 --- a/#jpgraph/src/Examples/windrose_layout_ex1.php +++ /dev/null @@ -1,58 +0,0 @@ - array(10,10,13,7), - 2 => array(2,8,10), - 4 => array(1,12,22)), - array( - 4 => array(12,8,2,3), - 2 => array(5,4,4,5,2)), - array( - 1 => array(12,8,2,3), - 3 => array(5,4,4,5,2)), - array( - 2 => array(12,8,2,3), - 3 => array(5,4,4,5,2)), - array( - 4 => array(12,8,2,3), - 6 => array(5,4,4,5,2)) -); - -// Legend range colors -$rangecolors = array('green','yellow','red','brown'); - -// Create a windrose graph with titles -$graph = new WindroseGraph(750,700); - -$graph->title->Set('Multiple plots with automatic layout'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); - -// Setup the individual windrose plots -$wp = array(); -for( $i=0; $i < 5; ++$i ) { - $wp[$i] = new WindrosePlot($data[$i]); - $wp[$i]->SetType(WINDROSE_TYPE8); - if( $i < 2) { - $wp[$i]->SetSize(0.28); - } - else { - $wp[$i]->legend->Hide(); - $wp[$i]->SetSize(0.16); - $wp[$i]->SetCenterSize(0.25); - } - $wp[$i]->SetRangeColors($rangecolors); -} - -// Position with two rows. Two plots in top row and three plots in -// bottom row. -$hl1 = new LayoutHor( array( $wp[0], $wp[1] ) ); -$hl2 = new LayoutHor( array( $wp[2], $wp[3], $wp[4] ) ); -$vl = new LayoutVert( array( $hl1, $hl2) ); - -$graph->Add($vl); -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/worldmap1.jpg b/#jpgraph/src/Examples/worldmap1.jpg deleted file mode 100644 index caa7c140..00000000 Binary files a/#jpgraph/src/Examples/worldmap1.jpg and /dev/null differ diff --git a/#jpgraph/src/Examples/y2synch.php b/#jpgraph/src/Examples/y2synch.php deleted file mode 100644 index f00ad73e..00000000 --- a/#jpgraph/src/Examples/y2synch.php +++ /dev/null @@ -1,60 +0,0 @@ -SetMargin(50,60,40,45); -$graph->SetMarginColor('white'); - - -// Setup the scales for X,Y and Y2 axis -$graph->SetScale("intlin"); // X and Y axis -$graph->SetY2Scale("lin"); // Y2 axis - -// Overall graph title -$graph->title->Set('Synchronized Y & Y2 scales'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// Title for X-axis -$graph->xaxis->title->Set('Measurement'); -$graph->xaxis->title->SetMargin(5); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11); - -// Create Y data set -$lplot = new LinePlot($datay); -$graph->yaxis->title->Set('Celcius (C)'); -$graph->yaxis->title->SetMargin(5); -$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11); -// ... and add the plot to the Y-axis -$graph->Add($lplot); - -// Create Y2 scale data set -$l2plot = new LinePlot($datay); -$l2plot->SetWeight(0); -$graph->y2axis->title->Set('Fahrenheit (F)'); -$graph->y2axis->title->SetMargin(5); // Some extra margin to clear labels -$graph->y2axis->title->SetFont(FF_ARIAL,FS_NORMAL,11); -$graph->y2axis->SetLabelFormatCallback('toFahrenheit'); -$graph->y2axis->SetColor('navy'); - -// ... and add the plot to the Y2-axis -$graph->AddY2($l2plot); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/y2synch2.php b/#jpgraph/src/Examples/y2synch2.php deleted file mode 100644 index 5d6a88f4..00000000 --- a/#jpgraph/src/Examples/y2synch2.php +++ /dev/null @@ -1,60 +0,0 @@ -SetMargin(50,60,40,45); -$graph->SetMarginColor('white'); - - -// Setup the scales for X,Y and Y2 axis -$graph->SetScale("textlin"); // X and Y axis -$graph->SetY2Scale("lin"); // Y2 axis - -// Overall graph title -$graph->title->Set('Synchronized Y & Y2 scales'); -$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); - -// Title for X-axis -$graph->xaxis->title->Set('Measurement'); -$graph->xaxis->title->SetMargin(5); -$graph->xaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11); - -// Create Y data set -$lplot = new BarPlot($datay); -$graph->yaxis->title->Set('Celcius (C)'); -$graph->yaxis->title->SetMargin(5); -$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11); -// ... and add the plot to the Y-axis -$graph->Add($lplot); - -// Create Y2 scale data set -$l2plot = new LinePlot($datay); -$l2plot->SetWeight(0); -$graph->y2axis->title->Set('Fahrenheit (F)'); -$graph->y2axis->title->SetMargin(5); // Some extra margin to clear labels -$graph->y2axis->title->SetFont(FF_ARIAL,FS_NORMAL,11); -$graph->y2axis->SetLabelFormatCallback('toFahrenheit'); -$graph->y2axis->SetColor('navy'); - -// ... and add the plot to the Y2-axis -$graph->AddY2($l2plot); - -$graph->Stroke(); -?> diff --git a/#jpgraph/src/Examples/yearssn.txt b/#jpgraph/src/Examples/yearssn.txt deleted file mode 100644 index bafcd7b3..00000000 --- a/#jpgraph/src/Examples/yearssn.txt +++ /dev/null @@ -1,309 +0,0 @@ -1700.5 5.0 -1701.5 11.0 -1702.5 16.0 -1703.5 23.0 -1704.5 36.0 -1705.5 58.0 -1706.5 29.0 -1707.5 20.0 -1708.5 10.0 -1709.5 8.0 -1710.5 3.0 -1711.5 0.0 -1712.5 0.0 -1713.5 2.0 -1714.5 11.0 -1715.5 27.0 -1716.5 47.0 -1717.5 63.0 -1718.5 60.0 -1719.5 39.0 -1720.5 28.0 -1721.5 26.0 -1722.5 22.0 -1723.5 11.0 -1724.5 21.0 -1725.5 40.0 -1726.5 78.0 -1727.5 122.0 -1728.5 103.0 -1729.5 73.0 -1730.5 47.0 -1731.5 35.0 -1732.5 11.0 -1733.5 5.0 -1734.5 16.0 -1735.5 34.0 -1736.5 70.0 -1737.5 81.0 -1738.5 111.0 -1739.5 101.0 -1740.5 73.0 -1741.5 40.0 -1742.5 20.0 -1743.5 16.0 -1744.5 5.0 -1745.5 11.0 -1746.5 22.0 -1747.5 40.0 -1748.5 60.0 -1749.5 80.9 -1750.5 83.4 -1751.5 47.7 -1752.5 47.8 -1753.5 30.7 -1754.5 12.2 -1755.5 9.6 -1756.5 10.2 -1757.5 32.4 -1758.5 47.6 -1759.5 54.0 -1760.5 62.9 -1761.5 85.9 -1762.5 61.2 -1763.5 45.1 -1764.5 36.4 -1765.5 20.9 -1766.5 11.4 -1767.5 37.8 -1768.5 69.8 -1769.5 106.1 -1770.5 100.8 -1771.5 81.6 -1772.5 66.5 -1773.5 34.8 -1774.5 30.6 -1775.5 7.0 -1776.5 19.8 -1777.5 92.5 -1778.5 154.4 -1779.5 125.9 -1780.5 84.8 -1781.5 68.1 -1782.5 38.5 -1783.5 22.8 -1784.5 10.2 -1785.5 24.1 -1786.5 82.9 -1787.5 132.0 -1788.5 130.9 -1789.5 118.1 -1790.5 89.9 -1791.5 66.6 -1792.5 60.0 -1793.5 46.9 -1794.5 41.0 -1795.5 21.3 -1796.5 16.0 -1797.5 6.4 -1798.5 4.1 -1799.5 6.8 -1800.5 14.5 -1801.5 34.0 -1802.5 45.0 -1803.5 43.1 -1804.5 47.5 -1805.5 42.2 -1806.5 28.1 -1807.5 10.1 -1808.5 8.1 -1809.5 2.5 -1810.5 0.0 -1811.5 1.4 -1812.5 5.0 -1813.5 12.2 -1814.5 13.9 -1815.5 35.4 -1816.5 45.8 -1817.5 41.0 -1818.5 30.1 -1819.5 23.9 -1820.5 15.6 -1821.5 6.6 -1822.5 4.0 -1823.5 1.8 -1824.5 8.5 -1825.5 16.6 -1826.5 36.3 -1827.5 49.6 -1828.5 64.2 -1829.5 67.0 -1830.5 70.9 -1831.5 47.8 -1832.5 27.5 -1833.5 8.5 -1834.5 13.2 -1835.5 56.9 -1836.5 121.5 -1837.5 138.3 -1838.5 103.2 -1839.5 85.7 -1840.5 64.6 -1841.5 36.7 -1842.5 24.2 -1843.5 10.7 -1844.5 15.0 -1845.5 40.1 -1846.5 61.5 -1847.5 98.5 -1848.5 124.7 -1849.5 96.3 -1850.5 66.6 -1851.5 64.5 -1852.5 54.1 -1853.5 39.0 -1854.5 20.6 -1855.5 6.7 -1856.5 4.3 -1857.5 22.7 -1858.5 54.8 -1859.5 93.8 -1860.5 95.8 -1861.5 77.2 -1862.5 59.1 -1863.5 44.0 -1864.5 47.0 -1865.5 30.5 -1866.5 16.3 -1867.5 7.3 -1868.5 37.6 -1869.5 74.0 -1870.5 139.0 -1871.5 111.2 -1872.5 101.6 -1873.5 66.2 -1874.5 44.7 -1875.5 17.0 -1876.5 11.3 -1877.5 12.4 -1878.5 3.4 -1879.5 6.0 -1880.5 32.3 -1881.5 54.3 -1882.5 59.7 -1883.5 63.7 -1884.5 63.5 -1885.5 52.2 -1886.5 25.4 -1887.5 13.1 -1888.5 6.8 -1889.5 6.3 -1890.5 7.1 -1891.5 35.6 -1892.5 73.0 -1893.5 85.1 -1894.5 78.0 -1895.5 64.0 -1896.5 41.8 -1897.5 26.2 -1898.5 26.7 -1899.5 12.1 -1900.5 9.5 -1901.5 2.7 -1902.5 5.0 -1903.5 24.4 -1904.5 42.0 -1905.5 63.5 -1906.5 53.8 -1907.5 62.0 -1908.5 48.5 -1909.5 43.9 -1910.5 18.6 -1911.5 5.7 -1912.5 3.6 -1913.5 1.4 -1914.5 9.6 -1915.5 47.4 -1916.5 57.1 -1917.5 103.9 -1918.5 80.6 -1919.5 63.6 -1920.5 37.6 -1921.5 26.1 -1922.5 14.2 -1923.5 5.8 -1924.5 16.7 -1925.5 44.3 -1926.5 63.9 -1927.5 69.0 -1928.5 77.8 -1929.5 64.9 -1930.5 35.7 -1931.5 21.2 -1932.5 11.1 -1933.5 5.7 -1934.5 8.7 -1935.5 36.1 -1936.5 79.7 -1937.5 114.4 -1938.5 109.6 -1939.5 88.8 -1940.5 67.8 -1941.5 47.5 -1942.5 30.6 -1943.5 16.3 -1944.5 9.6 -1945.5 33.2 -1946.5 92.6 -1947.5 151.6 -1948.5 136.3 -1949.5 134.7 -1950.5 83.9 -1951.5 69.4 -1952.5 31.5 -1953.5 13.9 -1954.5 4.4 -1955.5 38.0 -1956.5 141.7 -1957.5 190.2 -1958.5 184.8 -1959.5 159.0 -1960.5 112.3 -1961.5 53.9 -1962.5 37.6 -1963.5 27.9 -1964.5 10.2 -1965.5 15.1 -1966.5 47.0 -1967.5 93.7 -1968.5 105.9 -1969.5 105.5 -1970.5 104.5 -1971.5 66.6 -1972.5 68.9 -1973.5 38.0 -1974.5 34.5 -1975.5 15.5 -1976.5 12.6 -1977.5 27.5 -1978.5 92.5 -1979.5 155.4 -1980.5 154.6 -1981.5 140.5 -1982.5 115.9 -1983.5 66.6 -1984.5 45.9 -1985.5 17.9 -1986.5 13.4 -1987.5 29.2 -1988.5 100.2 -1989.5 157.6 -1990.5 142.6 -1991.5 145.7 -1992.5 94.3 -1993.5 54.6 -1994.5 29.9 -1995.5 17.5 -1996.5 8.6 -1997.5 21.5 -1998.5 64.3 -1999.5 93.3 -2000.5 119.6 -2001.5 111.0 -2002.5 104.0 -2003.5 63.7 -2004.5 40.4 -2005.5 29.8 -2006.5 15.2 -2007.5 7.5 -2008.5 2.9 diff --git a/#jpgraph/src/README b/#jpgraph/src/README deleted file mode 100644 index d384ea88..00000000 --- a/#jpgraph/src/README +++ /dev/null @@ -1,63 +0,0 @@ -README FOR JPGRAPH 4.0.2 -========================= - -This package contains the JpGraph PHP library version 4.0.2 - -The library is Copyright (C) 2000-2010 Asial Corporatoin and -released under dual license QPL 1.0 for open source and educational -use and JpGraph Professional License for commercial use. - -Please see full license details at -http://jpgraph.net/pro/ -http://jpgraph.net/download/ - - -Requirements: -------------- -Miminum: -* PHP 5.1.0 or higher -* GD 2.0.28 or higher -Note: Earlier versions might work but is unsupported. - -Recommended: -* >= PHP 5.2.0 -* PHP Builtin GD library - -Installation ------------- -1. Make sure that the PHP version is compatible with the stated - requirements and that the PHP installation has support for - the GD library. Please run phpinfo() to check if GD library - is supported in the installation. - If the GD library doesn't seem to be installed - please consult the PHP manual under section "Image" for - instructions on where to find this library. Please refer to - the manual section "Verifying your PHP installation" - -2. Unzip and copy the files to a directory of your choice where Your - httpd sever can access them. - For a global site installation you should copy the files to - somewhere in the PHP search path. - -3. Check that the default directory paths in jpg-config.inc.php - for cache directory and TTF directory suits your installation. - Note1: The default directories are different depending on if - the library is running on Windows or UNIX. - Note2: Apache/PHP must have write permission to your cache - directory if you enable the cache feature. By default the cache - is disabled. - - -Documentation -------------- -The installation includes HTML documentation and reference guide for the -library. The portal page for all documentation is -/docs/index.html - - -Bug reports and suggestions ---------------------------- -Should be reported using the contact form at - -http://jpgraph.net/contact/ - diff --git a/#jpgraph/src/barcode/demoapp/barcode_image.php b/#jpgraph/src/barcode/demoapp/barcode_image.php deleted file mode 100644 index 2ad88fd6..00000000 --- a/#jpgraph/src/barcode/demoapp/barcode_image.php +++ /dev/null @@ -1,75 +0,0 @@ - 5 ) { - echo "

Module width must be between 1 and 5 pixels

"; -} -elseif( $data==="" ) { - echo "

Please enter data to be encoded, select symbology and press 'Ok'.

"; - echo "Note: Data must be valid for the choosen encoding."; -} -elseif( $code==-1 ) { - echo "

No code symbology selected.

"; -} -elseif( $height < 10 || $height > 500 ) { - echo "

Height must be in range [10, 500]

"; -} -elseif( $scale < 0.1 || $scale > 15 ) { - echo "

Scale must be in range [0.1, 15]

"; -} -else { - if( $code==20 ) { - $encoder = BarcodeFactory::Create(6); - $encoder->UseExtended(); - } - else { - $encoder = BarcodeFactory::Create($code); - } - $b = $backend=='EPS' ? 'PS' : $backend; - $b = substr($backend,0,5) == 'IMAGE' ? 'IMAGE' : $b; - $e = BackendFactory::Create($b,$encoder); - if( substr($backend,0,5) == 'IMAGE' ) { - if( substr($backend,5,1) == 'J' ) - $e->SetImgFormat('JPEG'); - } - if( $e ) { - if( $backend == 'EPS' ) - $e->SetEPS(); - if( $pswidth!='' ) - $modwidth = $pswidth; - $e->SetModuleWidth($modwidth); - $e->AddChecksum($checksum); - $e->NoText($notext); - $e->SetScale($scale); - $e->SetVertical($vertical); - $e->ShowFrame($showframe); - $e->SetHeight($height); - $r = $e->Stroke($data,$file,$info,$info); - if( $r ) - echo nl2br(htmlspecialchars($r)); - if( $file != '' ) - echo "

Wrote file $file."; - } - else - echo "

Can't create choosen backend: $backend.

"; -} - -?> \ No newline at end of file diff --git a/#jpgraph/src/barcode/demoapp/barcode_menu.php b/#jpgraph/src/barcode/demoapp/barcode_menu.php deleted file mode 100644 index ea503066..00000000 --- a/#jpgraph/src/barcode/demoapp/barcode_menu.php +++ /dev/null @@ -1,125 +0,0 @@ -

JpGraph Barcode 1.0

-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Data:
- -
-Encoding:
- -
-Module width:
- -
-Add checksum:
- -
-Hide text:
- -
-Show frame:
- -
-Vertical layout:
- -
-Height:
- -
-Scale:
- -
-Write to file:
- -
-Format:
- -
-PS module width: - -
-
-(If specified will override Module width above)
-
-Debug info:
- -
-
- -
-
- -

-


- - - diff --git a/#jpgraph/src/barcode/demoapp/index.html b/#jpgraph/src/barcode/demoapp/index.html deleted file mode 100644 index e65107cb..00000000 --- a/#jpgraph/src/barcode/demoapp/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -Barcode SYSTEMTEST - - -; - - - diff --git a/#jpgraph/src/barcode/examples/barcode_errhandling_ex0.php b/#jpgraph/src/barcode/examples/barcode_errhandling_ex0.php deleted file mode 100644 index 4f5b5393..00000000 --- a/#jpgraph/src/barcode/examples/barcode_errhandling_ex0.php +++ /dev/null @@ -1,16 +0,0 @@ -Stroke('abc123'); -} catch( JpGraphException $e ) { - //echo 'Error: ' . $e->getMessage()."\n"; - JpGraphError::Raise($e->getMessage()); -} - -?> diff --git a/#jpgraph/src/barcode/examples/barcode_ex0.php b/#jpgraph/src/barcode/examples/barcode_ex0.php deleted file mode 100644 index 021b5c7c..00000000 --- a/#jpgraph/src/barcode/examples/barcode_ex0.php +++ /dev/null @@ -1,11 +0,0 @@ -Stroke('ABC123'); - -?> diff --git a/#jpgraph/src/barcode/examples/barcode_ex1.php b/#jpgraph/src/barcode/examples/barcode_ex1.php deleted file mode 100644 index df7653b5..00000000 --- a/#jpgraph/src/barcode/examples/barcode_ex1.php +++ /dev/null @@ -1,14 +0,0 @@ -SetModuleWidth(2); -$e->SetHeight(20); -echo nl2br($e->Stroke('3125134772')); - - -?> diff --git a/#jpgraph/src/barcode/examples/barcode_ex2.php b/#jpgraph/src/barcode/examples/barcode_ex2.php deleted file mode 100644 index 8fce58e6..00000000 --- a/#jpgraph/src/barcode/examples/barcode_ex2.php +++ /dev/null @@ -1,14 +0,0 @@ -SetModuleWidth(2); -$e->SetHeight(70); -$ps = $e->Stroke('3125134772'); -echo nl2br(htmlspecialchars($ps)); - -?> diff --git a/#jpgraph/src/barcode/examples/barcode_ex3.php b/#jpgraph/src/barcode/examples/barcode_ex3.php deleted file mode 100644 index a63f4ad4..00000000 --- a/#jpgraph/src/barcode/examples/barcode_ex3.php +++ /dev/null @@ -1,17 +0,0 @@ -"; -$encoder = BarcodeFactory::Create(ENCODING_CODEI25); -$e = BackendFactory::Create(BACKEND_PS,$encoder); -$e->SetModuleWidth(2); -$e->SetHeight(70); -$e->SetEPS(); -$ps = $e->Stroke('3125134772'); -echo nl2br(htmlspecialchars($ps)); - - -?> diff --git a/#jpgraph/src/barcode/examples/barcode_ex4.php b/#jpgraph/src/barcode/examples/barcode_ex4.php deleted file mode 100644 index 721b56ba..00000000 --- a/#jpgraph/src/barcode/examples/barcode_ex4.php +++ /dev/null @@ -1,12 +0,0 @@ -SetModuleWidth(2); -$e->Stroke('1234'); - -?> diff --git a/#jpgraph/src/barcode/examples/barcode_usps_example.php b/#jpgraph/src/barcode/examples/barcode_usps_example.php deleted file mode 100644 index 80469bea..00000000 --- a/#jpgraph/src/barcode/examples/barcode_usps_example.php +++ /dev/null @@ -1,74 +0,0 @@ -_USPS_chkd(substr($data,8)); - $data = '420'. $aZIP . '~191' . $aServiceType . $aDUNS . $aSeqNbr; - return $data . $cd; - } - - // Get type 2 of confirmation code (without ZIP) - function GetPIC($aServiceType,$aDUNS,$aSeqNbr) { - // Convert to USPS format with AI=91 - $data = '91' . $aServiceType . $aDUNS . $aSeqNbr; - $cd = $this->_USPS_chkd($data); - return $data . $cd; - } - -} - -$usps = new USPS_Confirmation(); -$zip = '92663'; -$service = '21'; -$DUNS = '805213907'; -$seqnr = '04508735'; -$data = $usps->GetPICwithZIP($zip,$service,$DUNS,$seqnr); -//$data = $usps->GetPIC('01','123456789','00000001'); - -$encoder = BarcodeFactory::Create(ENCODING_EAN128); -$e = BackendFactory::Create(BACKEND_IMAGE,$encoder); -$e->SetModuleWidth(2); -$e->SetFont(FF_ARIAL,FS_NORMAL,14); -$e->Stroke($data); - -?> \ No newline at end of file diff --git a/#jpgraph/src/barcode/mkbarcode.php b/#jpgraph/src/barcode/mkbarcode.php deleted file mode 100644 index 57ef6ec0..00000000 --- a/#jpgraph/src/barcode/mkbarcode.php +++ /dev/null @@ -1,281 +0,0 @@ -argv = ($_SERVER['argv']); - $this->argc = ($_SERVER['argc']); - } - - function PrintUsage() { - $n = $this->argv[0]; - echo "$n -b [-r -h -c -o -m -s -y -f ] datastring \n". - "Create the specified barcode\n". - "-b What symbology to use, one of the following strings (case insensitive)\n". - " UPCA \n". - " UPCE \n". - " EAN128 \n". - " EAN13 \n". - " EAN8 \n". - " CODE11 \n". - " CODE39 \n". - " CODE128 \n". - " CODE25 \n". - " CODEI25 \n". - " CODABAR \n". - " BOOKLAND \n". - "-c Add checkdigit for symbologies where this is optional\n". - "-o Output format. 0=Image, 1=PS, 2=EPS\n". - "-m Module width\n". - "-s Scale factor\n". - "-h Show this help\n". - "-f Filename to write to\n". - "-r Rotate barcode 90 degrees\n". - "-y height Set height in pixels\n". - "-x Hide the human readable text\n". - "--silent Silent. Don't give any error mesages\n"; - exit(1); - } - - function Get() { - $barcode='code39'; - $hide=false; - $checkdigit=false; - $modulewidth=2; - $scale=1; - $output=0; - $filename=''; - $data = ''; - $rotate = false; - $silent=false; - $height = 70; - if( ($n=$this->GetNum()) > 0 ) { - $i=1; - while( $i <= $n ) { - switch( $this->argv[$i] ) { - case '-h': - $this->PrintUsage(); - exit(0); - break; - case '-b': - $barcode = $this->argv[++$i]; - break; - case '-o': - $output = (int)$this->argv[++$i]; - break; - case '-y': - $height = (int)$this->argv[++$i]; - break; - case '-x': - $hide=true; - break; - case '-r': - $rotate=true; - break; - case '-c': - $checkdigit=true; - break; - case '--silent': - $silent=true; - break; - case '-s': - $scale = (float)$this->argv[++$i]; - break; - case '-m': - $modulewidth = (float)$this->argv[++$i]; - break; - case '-f': - $filename = $this->argv[++$i]; - break; - default: - if( $data == '' ) { - $data = $this->argv[$i]; - } - else { - $this->PrintUsage(); - die("Illegal specified parameters"); - } - break; - } - ++$i; - } - - } - - if( $output < 0 || $output > 2 ) { - fwrite(STDERR,"Unkown output format ($output)\n"); - exit(1); - } - - if( $output === 0 ) { - $modulewidth = floor($modulewidth); - } - - // Sanity check - if( $modulewidth > 15 ) { - fwrite(STDERR,"Too large modulewidth\n"); - exit(1); - } - - // Sanity check - if( $height > 1000 ) { - fwrite(STDERR,"Too large height\n"); - exit(1); - } - - // Sanity check - if( $scale > 15 ) { - fwrite(STDERR,"Too large scale factor\n"); - exit(1); - } - - if( strlen($filename) > 256 ) { - fwrite(STDERR,"Too long filename\n"); - exit(1); - } - - if( trim($data) == '' ) { - fwrite(STDERR,"No input data specified\n"); - exit(1); - } - - $barcodes = array( - 'UPCA' => ENCODING_UPCA, - 'UPCE' => ENCODING_UPCE, - 'EAN128' => ENCODING_EAN128, - 'EAN13' => ENCODING_EAN13, - 'EAN8' => ENCODING_EAN8, - 'CODE11' => ENCODING_CODE11, - 'CODE39' => ENCODING_CODE39, - 'CODE128' => ENCODING_CODE128, - 'CODE25' => ENCODING_CODE25, - 'CODEI25' => ENCODING_CODEI25, - 'CODABAR' => ENCODING_CODABAR, - 'BOOKLAND' => ENCODING_BOOKLAND, - ); - $barcode = strtoupper($barcode); - if( key_exists($barcode,$barcodes) ) { - $barcode = $barcodes[$barcode]; - } - else { - fwrite(STDERR,'Specified barcode symbology ('.$barcode.") is not supported\n"); - exit(1); - } - - $ret = array( - 'barcode' => $barcode, - 'hide' => $hide, - 'modulewidth' => $modulewidth, - 'scale' => $scale, - 'output' => $output, - 'data' => $data, - 'silent' => $silent, - 'rotate' => $rotate, - 'height' => $height, - 'checkdigit' => $checkdigit, - 'filename' => $filename - ); - - return $ret; - } - - function _Dump() { - var_dump($this->argv); - } - - function GetNum() { - return $this->argc-1; - } -} - -//---------------------------------------------------------------------- -// CLASS Driver -// Main driver class to create barcodes with the parmeters specified on -// the command line. -//---------------------------------------------------------------------- -class Driver { - - private $iParams; - static public $silent=false; - - static public function ErrHandlerPS(Exception $e) { - if( !Driver::$silent ) - fwrite(STDERR,$e->getMessage()."\n"); - exit(1); - } - - static public function ErrHandlerImg(Exception $e) { - if( !Driver::$silent ) - fwrite(STDERR,$e->getMessage()."\n"); - $errobj = new JpGraphErrObjectImg(); - $errobj->Raise($e->getMessage()); - exit(1); - } - - function Run($aParams) { - - $this->iParams = $aParams; - - Driver::$silent = $aParams['silent']; - - $encoder = BarcodeFactory::Create($aParams['barcode']); - $encoder->AddChecksum($aParams['checkdigit']); - switch( $aParams['output'] ) { - case 0: - $e = BackendFactory::Create(BACKEND_IMAGE,$encoder); - set_exception_handler(array('Driver','ErrHandlerImg')); - break; - case 1: - $e = BackendFactory::Create(BACKEND_PS,$encoder); - set_exception_handler(array('Driver','ErrHandlerPS')); - break; - case 2: - $e = BackendFactory::Create(BACKEND_PS,$encoder); - $e->SetEPS(); - set_exception_handler(array('Driver','ErrHandlerPS')); - break; - } - $e->SetHeight($aParams['height']); - $e->SetVertical($aParams['rotate']); - $e->SetModuleWidth($aParams['modulewidth']); - $e->SetScale($aParams['scale']); - $e->HideText($aParams['hide']); - if( $aParams['output'] === 0 ) { - $err = $e->Stroke($aParams['data'], $aParams['filename']); - } - else { - $s = $e->Stroke($aParams['data'], $aParams['filename']); - if( $aParams['filename'] == '' ) { - // If no filename specified then return the generated postscript - echo $s; - } - } - } -} - -$pa = new ParseArgs(); -$params = $pa->Get(); -$driver = new Driver(); -$driver->Run($params); - -// Successfull termination -exit(0); - -?> diff --git a/#jpgraph/src/flag_mapping b/#jpgraph/src/flag_mapping deleted file mode 100644 index 7f9c3c5f..00000000 --- a/#jpgraph/src/flag_mapping +++ /dev/null @@ -1,237 +0,0 @@ -class JpCountryFlags { - -$iCountryFlags = array( - 'Afghanistan' => 'afgh.gif', - 'Republic of Angola' => 'agla.gif', - 'Republic of Albania' => 'alba.gif', - 'Alderney' => 'alde.gif', - 'Democratic and Popular Republic of Algeria' => 'alge.gif', - 'Territory of American Samoa' => 'amsa.gif', - 'Principality of Andorra' => 'andr.gif', - 'British Overseas Territory of Anguilla' => 'angu.gif', - 'Antarctica' => 'anta.gif', - 'Argentine Republic' => 'arge.gif', - 'League of Arab States' => 'arle.gif', - 'Republic of Armenia' => 'arme.gif', - 'Aruba' => 'arub.gif', - 'Commonwealth of Australia' => 'astl.gif', - 'Republic of Austria' => 'aust.gif', - 'Azerbaijani Republic' => 'azer.gif', - 'British Antarctic Territory' => 'bant.gif', - 'Kingdom of Belgium' => 'belg.gif', - 'British Overseas Territory of Bermuda' => 'berm.gif', - 'Commonwealth of the Bahamas' => 'bhms.gif', - 'Kingdom of Bahrain' => 'bhrn.gif', - 'Republic of Belarus' => 'blru.gif', - 'Republic of Bolivia' => 'blva.gif', - 'Belize' => 'blze.gif', - 'Republic of Benin' => 'bnin.gif', - 'Republic of Botswana' => 'bots.gif', - 'Federative Republic of Brazil' => 'braz.gif', - 'Barbados' => 'brbd.gif', - 'British Indian Ocean Territory' => 'brin.gif', - 'Brunei Darussalam' => 'brun.gif', - 'Republic of Burkina' => 'bufa.gif', - 'Republic of Bulgaria' => 'bulg.gif', - 'Republic of Burundi' => 'buru.gif', - 'Overseas Territory of the British Virgin Islands' => 'bvis.gif', - 'Central African Republic' => 'cafr.gif', - 'Kingdom of Cambodia' => 'camb.gif', - 'Republic of Cameroon' => 'came.gif', - 'Dominion of Canada' => 'cana.gif', - 'Caribbean Community' => 'cari.gif', - 'Republic of Cape Verde' => 'cave.gif', - 'Republic of Chad' => 'chad.gif', - 'Republic of Chile' => 'chil.gif', - 'Territory of Christmas Island' => 'chms.gif', - 'Commonwealth of Independent States' => 'cins.gif', - 'Cook Islands' => 'ckis.gif', - 'Republic of Colombia' => 'clmb.gif', - 'Territory of Cocos Islands' => 'cois.gif', - 'Commonwealth' => 'comn.gif', - 'Union of the Comoros' => 'como.gif', - 'Republic of the Congo' => 'cong.gif', - 'Republic of Costa Rica' => 'corc.gif', - 'Republic of Croatia' => 'croa.gif', - 'Republic of Cuba' => 'cuba.gif', - 'British Overseas Territory of the Cayman Islands' => 'cyis.gif', - 'Republic of Cyprus' => 'cypr.gif', - 'The Czech Republic' => 'czec.gif', - 'Kingdom of Denmark' => 'denm.gif', - 'Republic of Djibouti' => 'djib.gif', - 'Commonwealth of Dominica' => 'domn.gif', - 'Dominican Republic' => 'dore.gif', - 'Republic of Ecuador' => 'ecua.gif', - 'Arab Republic of Egypt' => 'egyp.gif', - 'Republic of El Salvador' => 'elsa.gif', - 'England' => 'engl.gif', - 'Republic of Equatorial Guinea' => 'eqgu.gif', - 'State of Eritrea' => 'erit.gif', - 'Republic of Estonia' => 'estn.gif', - 'Ethiopia' => 'ethp.gif', - 'European Union' => 'euun.gif', - 'British Overseas Territory of the Falkland Islands' => 'fais.gif', - 'International Federation of Vexillological Associations' => 'fiav.gif', - 'Republic of Fiji' => 'fiji.gif', - 'Republic of Finland' => 'finl.gif', - 'Territory of French Polynesia' => 'fpol.gif', - 'French Republic' => 'fran.gif', - 'Overseas Department of French Guiana' => 'frgu.gif', - 'Gabonese Republic' => 'gabn.gif', - 'Republic of the Gambia' => 'gamb.gif', - 'Republic of Georgia' => 'geor.gif', - 'Federal Republic of Germany' => 'germ.gif', - 'Republic of Ghana' => 'ghan.gif', - 'Gibraltar' => 'gibr.gif', - 'Hellenic Republic' => 'grec.gif', - 'State of Grenada' => 'gren.gif', - 'Overseas Department of Guadeloupe' => 'guad.gif', - 'Territory of Guam' => 'guam.gif', - 'Republic of Guatemala' => 'guat.gif', - 'The Bailiwick of Guernsey' => 'guer.gif', - 'Republic of Guinea' => 'guin.gif', - 'Republic of Haiti' => 'hait.gif', - 'Hong Kong Special Administrative Region' => 'hokn.gif', - 'Republic of Honduras' => 'hond.gif', - 'Republic of Hungary' => 'hung.gif', - 'Republic of Iceland' => 'icel.gif', - 'International Committee of the Red Cross' => 'icrc.gif', - 'Republic of India' => 'inda.gif', - 'Republic of Indonesia' => 'indn.gif', - 'Republic of Iraq' => 'iraq.gif', - 'Republic of Ireland' => 'irel.gif', - 'Organization of the Islamic Conference' => 'isco.gif', - 'Isle of Man' => 'isma.gif', - 'State of Israel' => 'isra.gif', - 'Italian Republic' => 'ital.gif', - 'Jamaica' => 'jama.gif', - 'Japan' => 'japa.gif', - 'The Bailiwick of Jersey' => 'jers.gif', - 'Hashemite Kingdom of Jordan' => 'jord.gif', - 'Republic of Kazakhstan' => 'kazk.gif', - 'Republic of Kenya' => 'keny.gif', - 'Republic of Kiribati' => 'kirb.gif', - 'State of Kuwait' => 'kuwa.gif', - 'Kyrgyz Republic' => 'kyrg.gif', - 'Republic of Latvia' => 'latv.gif', - 'Lebanese Republic' => 'leba.gif', - 'Kingdom of Lesotho' => 'lest.gif', - 'Republic of Liberia' => 'libe.gif', - 'Principality of Liechtenstein' => 'liec.gif', - 'Republic of Lithuania' => 'lith.gif', - 'Grand Duchy of Luxembourg' => 'luxe.gif', - 'Macao Special Administrative Region' => 'maca.gif', - 'Republic of Macedonia' => 'mace.gif', - 'Republic of Madagascar' => 'mada.gif', - 'Republic of the Marshall Islands' => 'mais.gif', - 'Republic of Maldives' => 'mald.gif', - 'Republic of Mali' => 'mali.gif', - 'Federation of Malaysia' => 'mals018.gif', - 'Republic of Malta' => 'malt.gif', - 'Republic of Malawi' => 'malw.gif', - 'Overseas Department of Martinique' => 'mart.gif', - 'Islamic Republic of Mauritania' => 'maur.gif', - 'Territorial Collectivity of Mayotte' => 'mayt.gif', - 'United Mexican States' => 'mexc.gif', - 'Federated States of Micronesia' => 'micr.gif', - 'Midway Islands' => 'miis.gif', - 'Republic of Moldova' => 'mold.gif', - 'Principality of Monaco' => 'mona.gif', - 'Republic of Mongolia' => 'mong.gif', - 'British Overseas Territory of Montserrat' => 'mont.gif', - 'Kingdom of Morocco' => 'morc.gif', - 'Republic of Mozambique' => 'moza.gif', - 'Republic of Mauritius' => 'mrts.gif', - 'Union of Myanmar' => 'myan.gif', - 'Republic of Namibia' => 'namb.gif', - 'North Atlantic Treaty Organization' => 'nato.gif', - 'Republic of Nauru' => 'naur.gif', - 'Turkish Republic of Northern Cyprus' => 'ncyp.gif', - 'Netherlands Antilles' => 'nean.gif', - 'Kingdom of Nepal' => 'nepa.gif', - 'Kingdom of the Netherlands' => 'neth.gif', - 'Territory of Norfolk Island' => 'nfis.gif', - 'Federal Republic of Nigeria' => 'ngra.gif', - 'Republic of Nicaragua' => 'nica.gif', - 'Republic of Niger' => 'nigr.gif', - 'Niue' => 'niue.gif', - 'Commonwealth of the Northern Mariana Islands' => 'nmar.gif', - 'Province of Northern Ireland' => 'noir.gif', - 'Nordic Council' => 'nord.gif', - 'Kingdom of Norway' => 'norw.gif', - 'Territory of New Caledonia and Dependencies' => 'nwca.gif', - 'New Zealand' => 'nwze.gif', - 'Organization of American States' => 'oast.gif', - 'Organization of African Unity' => 'oaun.gif', - 'International Olympic Committee' => 'olym.gif', - 'Sultanate of Oman' => 'oman.gif', - 'Organization of Petroleum Exporting Countries' => 'opec.gif', - 'Islamic Republic of Pakistan' => 'paks.gif', - 'Republic of Palau' => 'pala.gif', - 'Independent State of Papua New Guinea' => 'pang.gif', - 'Republic of Paraguay' => 'para.gif', - 'Republic of the Philippines' => 'phil.gif', - 'British Overseas Territory of the Pitcairn Islands' => 'piis.gif', - 'Republic of Poland' => 'pola.gif', - 'Republic of Portugal' => 'port.gif', - 'Commonwealth of Puerto Rico' => 'purc.gif', - 'State of Qatar' => 'qata.gif', - 'Russian Federation' => 'russ.gif', - 'Republic of Rwanda' => 'rwan.gif', - 'Kingdom of Saudi Arabia' => 'saar.gif', - 'Republic of San Marino' => 'sama.gif', - 'Nordic Sami Conference' => 'sami.gif', - 'Sark' => 'sark.gif', - 'Scotland' => 'scot.gif', - 'Principality of Seborga' => 'sebo.gif', - 'Republic of Sierra Leone' => 'sile.gif', - 'Republic of Singapore' => 'sing.gif', - 'Republic of Korea' => 'skor.gif', - 'Republic of Slovenia' => 'slva.gif', - 'Somali Republic' => 'smla.gif', - 'Republic of Somaliland' => 'smld.gif', - 'Republic of South Africa' => 'soaf.gif', - 'Solomon Islands' => 'sois.gif', - 'Kingdom of Spain' => 'span.gif', - 'Secretariat of the Pacific Community' => 'spco.gif', - 'Democratic Socialist Republic of Sri Lanka' => 'srla.gif', - 'Saint Lucia' => 'stlu.gif', - 'Republic of the Sudan' => 'suda.gif', - 'Republic of Suriname' => 'surn.gif', - 'Slovak Republic' => 'svka.gif', - 'Kingdom of Sweden' => 'swdn.gif', - 'Swiss Confederation' => 'swit.gif', - 'Syrian Arab Republic' => 'syra.gif', - 'Kingdom of Swaziland' => 'szld.gif', - 'Republic of China' => 'taiw.gif', - 'Republic of Tajikistan' => 'tajk.gif', - 'United Republic of Tanzania' => 'tanz.gif', - 'Kingdom of Thailand' => 'thal.gif', - 'Autonomous Region of Tibet' => 'tibe.gif', - 'Turkmenistan' => 'tkst.gif', - 'Togolese Republic' => 'togo.gif', - 'Tokelau' => 'toke.gif', - 'Kingdom of Tonga' => 'tong.gif', - 'Tristan da Cunha' => 'trdc.gif', - 'Tromelin' => 'tris.gif', - 'Republic of Tunisia' => 'tuns.gif', - 'Republic of Turkey' => 'turk.gif', - 'Tuvalu' => 'tuva.gif', - 'United Arab Emirates' => 'uaem.gif', - 'Republic of Uganda' => 'ugan.gif', - 'Ukraine' => 'ukrn.gif', - 'United Kingdom of Great Britain' => 'unkg.gif', - 'United Nations' => 'unna.gif', - 'United States of America' => 'unst.gif', - 'Oriental Republic of Uruguay' => 'urgy.gif', - 'Virgin Islands of the United States' => 'usvs.gif', - 'Republic of Uzbekistan' => 'uzbk.gif', - 'State of the Vatican City' => 'vacy.gif', - 'Republic of Vanuatu' => 'vant.gif', - 'Bolivarian Republic of Venezuela' => 'venz.gif', - 'Republic of Yemen' => 'yemn.gif', - 'Democratic Republic of Congo' => 'zare.gif', - 'Republic of Zimbabwe' => 'zbwe.gif' -) ; - - diff --git a/#jpgraph/src/flags.dat b/#jpgraph/src/flags.dat deleted file mode 100644 index 1cd2e723..00000000 Binary files a/#jpgraph/src/flags.dat and /dev/null differ diff --git a/#jpgraph/src/flags_thumb100x100.dat b/#jpgraph/src/flags_thumb100x100.dat deleted file mode 100644 index 545e7ade..00000000 Binary files a/#jpgraph/src/flags_thumb100x100.dat and /dev/null differ diff --git a/#jpgraph/src/flags_thumb35x35.dat b/#jpgraph/src/flags_thumb35x35.dat deleted file mode 100644 index 7335011e..00000000 Binary files a/#jpgraph/src/flags_thumb35x35.dat and /dev/null differ diff --git a/#jpgraph/src/flags_thumb60x60.dat b/#jpgraph/src/flags_thumb60x60.dat deleted file mode 100644 index 6107d084..00000000 Binary files a/#jpgraph/src/flags_thumb60x60.dat and /dev/null differ diff --git a/#jpgraph/src/fonts/ARIALN.TTF b/#jpgraph/src/fonts/ARIALN.TTF deleted file mode 100644 index 49bb6960..00000000 Binary files a/#jpgraph/src/fonts/ARIALN.TTF and /dev/null differ diff --git a/#jpgraph/src/fonts/ARIALNB.TTF b/#jpgraph/src/fonts/ARIALNB.TTF deleted file mode 100644 index 631931e5..00000000 Binary files a/#jpgraph/src/fonts/ARIALNB.TTF and /dev/null differ diff --git a/#jpgraph/src/fonts/ARIALNBI.TTF b/#jpgraph/src/fonts/ARIALNBI.TTF deleted file mode 100644 index 4704de20..00000000 Binary files a/#jpgraph/src/fonts/ARIALNBI.TTF and /dev/null differ diff --git a/#jpgraph/src/fonts/ARIALNI.TTF b/#jpgraph/src/fonts/ARIALNI.TTF deleted file mode 100644 index 1c42b10a..00000000 Binary files a/#jpgraph/src/fonts/ARIALNI.TTF and /dev/null differ diff --git a/#jpgraph/src/fonts/ARIALUNI.TTF b/#jpgraph/src/fonts/ARIALUNI.TTF deleted file mode 100644 index 3c593f07..00000000 Binary files a/#jpgraph/src/fonts/ARIALUNI.TTF and /dev/null differ diff --git a/#jpgraph/src/fonts/DejaVuSans-Bold.ttf b/#jpgraph/src/fonts/DejaVuSans-Bold.ttf deleted file mode 100644 index ac313d26..00000000 Binary files a/#jpgraph/src/fonts/DejaVuSans-Bold.ttf and /dev/null differ diff --git a/#jpgraph/src/fonts/DejaVuSans-BoldOblique.ttf b/#jpgraph/src/fonts/DejaVuSans-BoldOblique.ttf deleted file mode 100644 index c818ae6e..00000000 Binary files a/#jpgraph/src/fonts/DejaVuSans-BoldOblique.ttf and /dev/null differ diff --git a/#jpgraph/src/fonts/DejaVuSans-Oblique.ttf b/#jpgraph/src/fonts/DejaVuSans-Oblique.ttf deleted file mode 100644 index d5ac60d6..00000000 Binary files a/#jpgraph/src/fonts/DejaVuSans-Oblique.ttf and /dev/null differ diff --git a/#jpgraph/src/fonts/DejaVuSans.ttf b/#jpgraph/src/fonts/DejaVuSans.ttf deleted file mode 100644 index a99969e1..00000000 Binary files a/#jpgraph/src/fonts/DejaVuSans.ttf and /dev/null differ diff --git a/#jpgraph/src/fonts/FF_FONT0-Bold.gdf b/#jpgraph/src/fonts/FF_FONT0-Bold.gdf deleted file mode 100644 index 3b371f8a..00000000 Binary files a/#jpgraph/src/fonts/FF_FONT0-Bold.gdf and /dev/null differ diff --git a/#jpgraph/src/fonts/FF_FONT0.gdf b/#jpgraph/src/fonts/FF_FONT0.gdf deleted file mode 100644 index e231b713..00000000 Binary files a/#jpgraph/src/fonts/FF_FONT0.gdf and /dev/null differ diff --git a/#jpgraph/src/fonts/FF_FONT1-Bold.gdf b/#jpgraph/src/fonts/FF_FONT1-Bold.gdf deleted file mode 100644 index d62f0b3b..00000000 Binary files a/#jpgraph/src/fonts/FF_FONT1-Bold.gdf and /dev/null differ diff --git a/#jpgraph/src/fonts/FF_FONT1.gdf b/#jpgraph/src/fonts/FF_FONT1.gdf deleted file mode 100644 index 7b5b0f62..00000000 Binary files a/#jpgraph/src/fonts/FF_FONT1.gdf and /dev/null differ diff --git a/#jpgraph/src/fonts/FF_FONT2-Bold.gdf b/#jpgraph/src/fonts/FF_FONT2-Bold.gdf deleted file mode 100644 index 6e402847..00000000 Binary files a/#jpgraph/src/fonts/FF_FONT2-Bold.gdf and /dev/null differ diff --git a/#jpgraph/src/fonts/FF_FONT2.gdf b/#jpgraph/src/fonts/FF_FONT2.gdf deleted file mode 100644 index 50bca09e..00000000 Binary files a/#jpgraph/src/fonts/FF_FONT2.gdf and /dev/null differ diff --git a/#jpgraph/src/fonts/arial.ttf b/#jpgraph/src/fonts/arial.ttf deleted file mode 100644 index 886789b8..00000000 Binary files a/#jpgraph/src/fonts/arial.ttf and /dev/null differ diff --git a/#jpgraph/src/fonts/arialbd.ttf b/#jpgraph/src/fonts/arialbd.ttf deleted file mode 100644 index b7e58f53..00000000 Binary files a/#jpgraph/src/fonts/arialbd.ttf and /dev/null differ diff --git a/#jpgraph/src/fonts/arialbi.ttf b/#jpgraph/src/fonts/arialbi.ttf deleted file mode 100644 index 813fae3f..00000000 Binary files a/#jpgraph/src/fonts/arialbi.ttf and /dev/null differ diff --git a/#jpgraph/src/fonts/ariali.ttf b/#jpgraph/src/fonts/ariali.ttf deleted file mode 100644 index 50e38506..00000000 Binary files a/#jpgraph/src/fonts/ariali.ttf and /dev/null differ diff --git a/#jpgraph/src/fonts/ariblk.ttf b/#jpgraph/src/fonts/ariblk.ttf deleted file mode 100644 index 251093f0..00000000 Binary files a/#jpgraph/src/fonts/ariblk.ttf and /dev/null differ diff --git a/#jpgraph/src/gd_image.inc.php b/#jpgraph/src/gd_image.inc.php deleted file mode 100644 index a14ca15e..00000000 --- a/#jpgraph/src/gd_image.inc.php +++ /dev/null @@ -1,2313 +0,0 @@ -original_width = $aWidth; - $this->original_height = $aHeight; - $this->CreateImgCanvas($aWidth, $aHeight); - - if( $aSetAutoMargin ) { - $this->SetAutoMargin(); - } - - if( !$this->SetImgFormat($aFormat) ) { - JpGraphError::RaiseL(25081,$aFormat);//("JpGraph: Selected graphic format is either not supported or unknown [$aFormat]"); - } - $this->ttf = new TTF(); - $this->langconv = new LanguageConv(); - - $this->ff_font0 = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT0.gdf"); - $this->ff_font1 = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT1.gdf"); - $this->ff_font2 = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT2.gdf"); - $this->ff_font1_bold = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT1-Bold.gdf"); - $this->ff_font2_bold = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT2-Bold.gdf"); - } - - // Enable interlacing in images - function SetInterlace($aFlg=true) { - $this->iInterlace=$aFlg; - } - - // Should we use anti-aliasing. Note: This really slows down graphics! - function SetAntiAliasing($aFlg=true) { - $this->use_anti_aliasing = $aFlg; - if( function_exists('imageantialias') ) { - imageantialias($this->img,$aFlg); - } - else { - // JpGraphError::RaiseL(25128);//('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.') - } - } - - function GetAntiAliasing() { - return $this->use_anti_aliasing ; - } - - function CreateRawCanvas($aWidth=0,$aHeight=0) { - - $aWidth *= SUPERSAMPLING_SCALE; - $aHeight *= SUPERSAMPLING_SCALE; - - if( $aWidth <= 1 || $aHeight <= 1 ) { - JpGraphError::RaiseL(25082,$aWidth,$aHeight);//("Illegal sizes specified for width or height when creating an image, (width=$aWidth, height=$aHeight)"); - } - - $this->img = @imagecreatetruecolor($aWidth, $aHeight); - if( $this->img < 1 ) { - JpGraphError::RaiseL(25126); - //die("Can't create truecolor image. Check that you really have GD2 library installed."); - } - $this->SetAlphaBlending(); - - if( $this->iInterlace ) { - imageinterlace($this->img,1); - } - if( $this->rgb != null ) { - $this->rgb->img = $this->img ; - } - else { - $this->rgb = new RGB($this->img); - } - } - - function CloneCanvasH() { - $oldimage = $this->img; - $this->CreateRawCanvas($this->width,$this->height); - imagecopy($this->img,$oldimage,0,0,0,0,$this->width,$this->height); - return $oldimage; - } - - function CreateImgCanvas($aWidth=0,$aHeight=0) { - - $old = array($this->img,$this->width,$this->height); - - $aWidth = round($aWidth); - $aHeight = round($aHeight); - - $this->width=$aWidth; - $this->height=$aHeight; - - - if( $aWidth==0 || $aHeight==0 ) { - // We will set the final size later. - // Note: The size must be specified before any other - // img routines that stroke anything are called. - $this->img = null; - $this->rgb = null; - return $old; - } - - $this->CreateRawCanvas($aWidth,$aHeight); - // Set canvas color (will also be the background color for a - // a pallett image - $this->SetColor($this->canvascolor); - $this->FilledRectangle(0,0,$this->width-1,$this->height-1); - - return $old ; - } - - function CopyCanvasH($aToHdl,$aFromHdl,$aToX,$aToY,$aFromX,$aFromY,$aWidth,$aHeight,$aw=-1,$ah=-1) { - if( $aw === -1 ) { - $aw = $aWidth; - $ah = $aHeight; - $f = 'imagecopyresized'; - } - else { - $f = 'imagecopyresampled'; - } - $f($aToHdl,$aFromHdl,$aToX,$aToY,$aFromX,$aFromY, $aWidth,$aHeight,$aw,$ah); - } - - function Copy($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1) { - $this->CopyCanvasH($this->img,$fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight); - } - - function CopyMerge($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1,$aMix=100) { - if( $aMix == 100 ) { - $this->CopyCanvasH($this->img,$fromImg, - $toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight); - } - else { - if( ($fromWidth != -1 && ($fromWidth != $toWidth)) || ($fromHeight != -1 && ($fromHeight != $fromHeight)) ) { - // Create a new canvas that will hold the re-scaled original from image - if( $toWidth <= 1 || $toHeight <= 1 ) { - JpGraphError::RaiseL(25083);//('Illegal image size when copying image. Size for copied to image is 1 pixel or less.'); - } - - $tmpimg = @imagecreatetruecolor($toWidth, $toHeight); - - if( $tmpimg < 1 ) { - JpGraphError::RaiseL(25084);//('Failed to create temporary GD canvas. Out of memory ?'); - } - $this->CopyCanvasH($tmpimg,$fromImg,0,0,0,0, - $toWidth,$toHeight,$fromWidth,$fromHeight); - $fromImg = $tmpimg; - } - imagecopymerge($this->img,$fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$aMix); - } - } - - static function GetWidth($aImg=null) { - if( $aImg === null ) { - $aImg = $this->img; - } - return imagesx($aImg); - } - - static function GetHeight($aImg=null) { - if( $aImg === null ) { - $aImg = $this->img; - } - return imagesy($aImg); - } - - static function CreateFromString($aStr) { - $img = imagecreatefromstring($aStr); - if( $img === false ) { - JpGraphError::RaiseL(25085); - //('An image can not be created from the supplied string. It is either in a format not supported or the string is representing an corrupt image.'); - } - return $img; - } - - function SetCanvasH($aHdl) { - $this->img = $aHdl; - $this->rgb->img = $aHdl; - } - - function SetCanvasColor($aColor) { - $this->canvascolor = $aColor ; - } - - function SetAlphaBlending($aFlg=true) { - ImageAlphaBlending($this->img,$aFlg); - } - - function SetAutoMargin() { - $min_bm=5; - $lm = min(40,$this->width/7); - $rm = min(20,$this->width/10); - $tm = max(5,$this->height/7); - $bm = max($min_bm,$this->height/6); - $this->SetMargin($lm,$rm,$tm,$bm); - } - - //--------------- - // PUBLIC METHODS - - function SetFont($family,$style=FS_NORMAL,$size=10) { - $this->font_family=$family; - $this->font_style=$style; - $this->font_size=$size*SUPERSAMPLING_SCALE; - $this->font_file=''; - if( ($this->font_family==FF_FONT1 || $this->font_family==FF_FONT2) && $this->font_style==FS_BOLD ){ - ++$this->font_family; - } - if( $this->font_family > FF_FONT2+1 ) { // A TTF font so get the font file - - // Check that this PHP has support for TTF fonts - if( !function_exists('imagettfbbox') ) { - // use internal font when php is configured without '--with-ttf' - $this->font_family = FF_FONT1; -// JpGraphError::RaiseL(25087);//('This PHP build has not been configured with TTF support. You need to recompile your PHP installation with FreeType support.'); - } else { - $this->font_file = $this->ttf->File($this->font_family,$this->font_style); - } - } - } - - // Get the specific height for a text string - function GetTextHeight($txt="",$angle=0) { - $tmp = preg_split('/\n/',$txt); - $n = count($tmp); - $m=0; - for($i=0; $i< $n; ++$i) { - $m = max($m,strlen($tmp[$i])); - } - - if( $this->font_family <= FF_FONT2+1 ) { - if( $angle==0 ) { - $h = imagefontheight($this->font_family); - if( $h === false ) { - JpGraphError::RaiseL(25088);//('You have a misconfigured GD font support. The call to imagefontwidth() fails.'); - } - - return $n*$h; - } - else { - $w = @imagefontwidth($this->font_family); - if( $w === false ) { - JpGraphError::RaiseL(25088);//('You have a misconfigured GD font support. The call to imagefontwidth() fails.'); - } - - return $m*$w; - } - } - else { - $bbox = $this->GetTTFBBox($txt,$angle); - return $bbox[1]-$bbox[5]+1; - } - } - - // Estimate font height - function GetFontHeight($angle=0) { - $txt = "XOMg"; - return $this->GetTextHeight($txt,$angle); - } - - // Approximate font width with width of letter "O" - function GetFontWidth($angle=0) { - $txt = 'O'; - return $this->GetTextWidth($txt,$angle); - } - - // Get actual width of text in absolute pixels. Note that the width is the - // texts projected with onto the x-axis. Call with angle=0 to get the true - // etxt width. - function GetTextWidth($txt,$angle=0) { - - $tmp = preg_split('/\n/',$txt); - $n = count($tmp); - if( $this->font_family <= FF_FONT2+1 ) { - - $m=0; - for($i=0; $i < $n; ++$i) { - $l=strlen($tmp[$i]); - if( $l > $m ) { - $m = $l; - } - } - - if( $angle==0 ) { - $w = @imagefontwidth($this->font_family); - if( $w === false ) { - JpGraphError::RaiseL(25088);//('You have a misconfigured GD font support. The call to imagefontwidth() fails.'); - } - return $m*$w; - } - else { - // 90 degrees internal so height becomes width - $h = @imagefontheight($this->font_family); - if( $h === false ) { - JpGraphError::RaiseL(25089);//('You have a misconfigured GD font support. The call to imagefontheight() fails.'); - } - return $n*$h; - } - } - else { - // For TTF fonts we must walk through a lines and find the - // widest one which we use as the width of the multi-line - // paragraph - $m=0; - for( $i=0; $i < $n; ++$i ) { - $bbox = $this->GetTTFBBox($tmp[$i],$angle); - $mm = $bbox[2] - $bbox[0]; - if( $mm > $m ) - $m = $mm; - } - return $m; - } - } - - - // Draw text with a box around it - function StrokeBoxedText($x,$y,$txt,$dir=0,$fcolor="white",$bcolor="black", - $shadowcolor=false,$paragraph_align="left", - $xmarg=6,$ymarg=4,$cornerradius=0,$dropwidth=3) { - - $oldx = $this->lastx; - $oldy = $this->lasty; - - if( !is_numeric($dir) ) { - if( $dir=="h" ) $dir=0; - elseif( $dir=="v" ) $dir=90; - else JpGraphError::RaiseL(25090,$dir);//(" Unknown direction specified in call to StrokeBoxedText() [$dir]"); - } - - if( $this->font_family >= FF_FONT0 && $this->font_family <= FF_FONT2+1) { - $width=$this->GetTextWidth($txt,$dir) ; - $height=$this->GetTextHeight($txt,$dir) ; - } - else { - $width=$this->GetBBoxWidth($txt,$dir) ; - $height=$this->GetBBoxHeight($txt,$dir) ; - } - - $height += 2*$ymarg; - $width += 2*$xmarg; - - if( $this->text_halign=="right" ) $x -= $width; - elseif( $this->text_halign=="center" ) $x -= $width/2; - - if( $this->text_valign=="bottom" ) $y -= $height; - elseif( $this->text_valign=="center" ) $y -= $height/2; - - $olda = $this->SetAngle(0); - - if( $shadowcolor ) { - $this->PushColor($shadowcolor); - $this->FilledRoundedRectangle($x-$xmarg+$dropwidth,$y-$ymarg+$dropwidth, - $x+$width+$dropwidth,$y+$height-$ymarg+$dropwidth, - $cornerradius); - $this->PopColor(); - $this->PushColor($fcolor); - $this->FilledRoundedRectangle($x-$xmarg,$y-$ymarg, - $x+$width,$y+$height-$ymarg, - $cornerradius); - $this->PopColor(); - $this->PushColor($bcolor); - $this->RoundedRectangle($x-$xmarg,$y-$ymarg, - $x+$width,$y+$height-$ymarg,$cornerradius); - $this->PopColor(); - } - else { - if( $fcolor ) { - $oc=$this->current_color; - $this->SetColor($fcolor); - $this->FilledRoundedRectangle($x-$xmarg,$y-$ymarg,$x+$width,$y+$height-$ymarg,$cornerradius); - $this->current_color=$oc; - } - if( $bcolor ) { - $oc=$this->current_color; - $this->SetColor($bcolor); - $this->RoundedRectangle($x-$xmarg,$y-$ymarg,$x+$width,$y+$height-$ymarg,$cornerradius); - $this->current_color=$oc; - } - } - - $h=$this->text_halign; - $v=$this->text_valign; - $this->SetTextAlign("left","top"); - - $debug=false; - $this->StrokeText($x, $y, $txt, $dir, $paragraph_align,$debug); - - $bb = array($x-$xmarg,$y+$height-$ymarg,$x+$width,$y+$height-$ymarg, - $x+$width,$y-$ymarg,$x-$xmarg,$y-$ymarg); - $this->SetTextAlign($h,$v); - - $this->SetAngle($olda); - $this->lastx = $oldx; - $this->lasty = $oldy; - - return $bb; - } - - // Draw text with a box around it. This time the box will be rotated - // with the text. The previous method will just make a larger enough non-rotated - // box to hold the text inside. - function StrokeBoxedText2($x,$y,$txt,$dir=0,$fcolor="white",$bcolor="black", - $shadowcolor=false,$paragraph_align="left", - $xmarg=6,$ymarg=4,$cornerradius=0,$dropwidth=3) { - - // This version of boxed text will stroke a rotated box round the text - // thta will follow the angle of the text. - // This has two implications: - // 1) This methos will only support TTF fonts - // 2) The only two alignment that makes sense are centered or baselined - - if( $this->font_family <= FF_FONT2+1 ) { - JpGraphError::RaiseL(25131);//StrokeBoxedText2() Only support TTF fonts and not built in bitmap fonts - } - - $oldx = $this->lastx; - $oldy = $this->lasty; - $dir = $this->NormAngle($dir); - - if( !is_numeric($dir) ) { - if( $dir=="h" ) $dir=0; - elseif( $dir=="v" ) $dir=90; - else JpGraphError::RaiseL(25090,$dir);//(" Unknown direction specified in call to StrokeBoxedText() [$dir]"); - } - - $width=$this->GetTextWidth($txt,0) + 2*$xmarg; - $height=$this->GetTextHeight($txt,0) + 2*$ymarg ; - $rect_width=$this->GetBBoxWidth($txt,$dir) ; - $rect_height=$this->GetBBoxHeight($txt,$dir) ; - - $baseline_offset = $this->bbox_cache[1]-1; - - if( $this->text_halign=="center" ) { - if( $dir >= 0 && $dir <= 90 ) { - - $x -= $rect_width/2; - $x += sin($dir*M_PI/180)*$height; - $y += $rect_height/2; - - } elseif( $dir >= 270 && $dir <= 360 ) { - - $x -= $rect_width/2; - $y -= $rect_height/2; - $y += cos($dir*M_PI/180)*$height; - - } elseif( $dir >= 90 && $dir <= 180 ) { - - $x += $rect_width/2; - $y += $rect_height/2; - $y += cos($dir*M_PI/180)*$height; - - } - else { - // $dir > 180 && $dir < 270 - $x += $rect_width/2; - $x += sin($dir*M_PI/180)*$height; - $y -= $rect_height/2; - } - } - - // Rotate the box around this point - $this->SetCenter($x,$y); - $olda = $this->SetAngle(-$dir); - - // We need to use adjusted coordinats for the box to be able - // to draw the box below the baseline. This cannot be done before since - // the rotating point must be the original x,y since that is arounbf the - // point where the text will rotate and we cannot change this since - // that is where the GD/GreeType will rotate the text - - - // For smaller <14pt font we need to do some additional - // adjustments to make it look good - if( $this->font_size < 14 ) { - $x -= 2; - $y += 2; - } - else { - // $y += $baseline_offset; - } - - if( $shadowcolor ) { - $this->PushColor($shadowcolor); - $this->FilledRectangle($x-$xmarg+$dropwidth,$y+$ymarg+$dropwidth-$height, - $x+$width+$dropwidth,$y+$ymarg+$dropwidth); - //$cornerradius); - $this->PopColor(); - $this->PushColor($fcolor); - $this->FilledRectangle($x-$xmarg, $y+$ymarg-$height, - $x+$width, $y+$ymarg); - //$cornerradius); - $this->PopColor(); - $this->PushColor($bcolor); - $this->Rectangle($x-$xmarg,$y+$ymarg-$height, - $x+$width,$y+$ymarg); - //$cornerradius); - $this->PopColor(); - } - else { - if( $fcolor ) { - $oc=$this->current_color; - $this->SetColor($fcolor); - $this->FilledRectangle($x-$xmarg,$y+$ymarg-$height,$x+$width,$y+$ymarg);//,$cornerradius); - $this->current_color=$oc; - } - if( $bcolor ) { - $oc=$this->current_color; - $this->SetColor($bcolor); - $this->Rectangle($x-$xmarg,$y+$ymarg-$height,$x+$width,$y+$ymarg);//,$cornerradius); - $this->current_color=$oc; - } - } - - if( $this->font_size < 14 ) { - $x += 2; - $y -= 2; - } - else { - - // Restore the original y before we stroke the text - // $y -= $baseline_offset; - - } - - $this->SetCenter(0,0); - $this->SetAngle($olda); - - $h=$this->text_halign; - $v=$this->text_valign; - if( $this->text_halign == 'center') { - $this->SetTextAlign('center','basepoint'); - } - else { - $this->SetTextAlign('basepoint','basepoint'); - } - - $debug=false; - $this->StrokeText($x, $y, $txt, $dir, $paragraph_align,$debug); - - $bb = array($x-$xmarg, $y+$height-$ymarg, - $x+$width, $y+$height-$ymarg, - $x+$width, $y-$ymarg, - $x-$xmarg, $y-$ymarg); - - $this->SetTextAlign($h,$v); - $this->SetAngle($olda); - - $this->lastx = $oldx; - $this->lasty = $oldy; - - return $bb; - } - - // Set text alignment - function SetTextAlign($halign,$valign="bottom") { - $this->text_halign=$halign; - $this->text_valign=$valign; - } - - function _StrokeBuiltinFont($x,$y,$txt,$dir,$paragraph_align,&$aBoundingBox,$aDebug=false) { - - if( is_numeric($dir) && $dir!=90 && $dir!=0) - JpGraphError::RaiseL(25091);//(" Internal font does not support drawing text at arbitrary angle. Use TTF fonts instead."); - - $h=$this->GetTextHeight($txt); - $fh=$this->GetFontHeight(); - $w=$this->GetTextWidth($txt); - - if( $this->text_halign=="right") { - $x -= $dir==0 ? $w : $h; - } - elseif( $this->text_halign=="center" ) { - // For center we subtract 1 pixel since this makes the middle - // be prefectly in the middle - $x -= $dir==0 ? $w/2-1 : $h/2; - } - if( $this->text_valign=="top" ) { - $y += $dir==0 ? $h : $w; - } - elseif( $this->text_valign=="center" ) { - $y += $dir==0 ? $h/2 : $w/2; - } - - $use_font = $this->font_family; - - if( $dir==90 ) { - imagestringup($this->img,$use_font,$x,$y,$txt,$this->current_color); - $aBoundingBox = array(round($x),round($y),round($x),round($y-$w),round($x+$h),round($y-$w),round($x+$h),round($y)); - if( $aDebug ) { - // Draw bounding box - $this->PushColor('green'); - $this->Polygon($aBoundingBox,true); - $this->PopColor(); - } - } - else { - if( preg_match('/\n/',$txt) ) { - $tmp = preg_split('/\n/',$txt); - for($i=0; $i < count($tmp); ++$i) { - $w1 = $this->GetTextWidth($tmp[$i]); - if( $paragraph_align=="left" ) { - imagestring($this->img,$use_font,$x,$y-$h+1+$i*$fh,$tmp[$i],$this->current_color); - } - elseif( $paragraph_align=="right" ) { - imagestring($this->img,$use_font,$x+($w-$w1),$y-$h+1+$i*$fh,$tmp[$i],$this->current_color); - } - else { - imagestring($this->img,$use_font,$x+$w/2-$w1/2,$y-$h+1+$i*$fh,$tmp[$i],$this->current_color); - } - } - } - else { - //Put the text - imagestring($this->img,$use_font,$x,$y-$h+1,$txt,$this->current_color); - } - if( $aDebug ) { - // Draw the bounding rectangle and the bounding box - $p1 = array(round($x),round($y),round($x),round($y-$h),round($x+$w),round($y-$h),round($x+$w),round($y)); - - // Draw bounding box - $this->PushColor('green'); - $this->Polygon($p1,true); - $this->PopColor(); - - } - $aBoundingBox=array(round($x),round($y),round($x),round($y-$h),round($x+$w),round($y-$h),round($x+$w),round($y)); - } - } - - function AddTxtCR($aTxt) { - // If the user has just specified a '\n' - // instead of '\n\t' we have to add '\r' since - // the width will be too muchy otherwise since when - // we print we stroke the individually lines by hand. - $e = explode("\n",$aTxt); - $n = count($e); - for($i=0; $i<$n; ++$i) { - $e[$i]=str_replace("\r","",$e[$i]); - } - return implode("\n\r",$e); - } - - function NormAngle($a) { - // Normalize angle in degrees - // Normalize angle to be between 0-360 - while( $a > 360 ) - $a -= 360; - while( $a < -360 ) - $a += 360; - if( $a < 0 ) - $a = 360 + $a; - return $a; - } - - function imagettfbbox_fixed($size, $angle, $fontfile, $text) { - - - if( ! USE_LIBRARY_IMAGETTFBBOX ) { - - $bbox = @imagettfbbox($size, $angle, $fontfile, $text); - if( $bbox === false ) { - JpGraphError::RaiseL(25092,$this->font_file); - //("There is either a configuration problem with TrueType or a problem reading font file (".$this->font_file."). Make sure file exists and is in a readable place for the HTTP process. (If 'basedir' restriction is enabled in PHP then the font file must be located in the document root.). It might also be a wrongly installed FreeType library. Try uppgrading to at least FreeType 2.1.13 and recompile GD with the correct setup so it can find the new FT library."); - } - $this->bbox_cache = $bbox; - return $bbox; - } - - // The built in imagettfbbox is buggy for angles != 0 so - // we calculate this manually by getting the bounding box at - // angle = 0 and then rotate the bounding box manually - $bbox = @imagettfbbox($size, 0, $fontfile, $text); - if( $bbox === false ) { - JpGraphError::RaiseL(25092,$this->font_file); - //("There is either a configuration problem with TrueType or a problem reading font file (".$this->font_file."). Make sure file exists and is in a readable place for the HTTP process. (If 'basedir' restriction is enabled in PHP then the font file must be located in the document root.). It might also be a wrongly installed FreeType library. Try uppgrading to at least FreeType 2.1.13 and recompile GD with the correct setup so it can find the new FT library."); - } - - $angle = $this->NormAngle($angle); - - $a = $angle*M_PI/180; - $ca = cos($a); - $sa = sin($a); - $ret = array(); - - // We always add 1 pixel to the left since the left edge of the bounding - // box is sometimes coinciding with the first pixel of the text - //$bbox[0] -= 1; - //$bbox[6] -= 1; - - // For roatated text we need to add extra width for rotated - // text since the kerning and stroking of the TTF is not the same as for - // text at a 0 degree angle - - if( $angle > 0.001 && abs($angle-360) > 0.001 ) { - $h = abs($bbox[7]-$bbox[1]); - $w = abs($bbox[2]-$bbox[0]); - - $bbox[0] -= 2; - $bbox[6] -= 2; - // The width is underestimated so compensate for that - $bbox[2] += round($w*0.06); - $bbox[4] += round($w*0.06); - - // and we also need to compensate with increased height - $bbox[5] -= round($h*0.1); - $bbox[7] -= round($h*0.1); - - if( $angle > 90 ) { - // For angles > 90 we also need to extend the height further down - // by the baseline since that is also one more problem - $bbox[1] += round($h*0.15); - $bbox[3] += round($h*0.15); - - // and also make it slighty less height - $bbox[7] += round($h*0.05); - $bbox[5] += round($h*0.05); - - // And we need to move the box slightly top the rright (from a tetx perspective) - $bbox[0] += round($w*0.02); - $bbox[6] += round($w*0.02); - - if( $angle > 180 ) { - // And we need to move the box slightly to the left (from a text perspective) - $bbox[0] -= round($w*0.02); - $bbox[6] -= round($w*0.02); - $bbox[2] -= round($w*0.02); - $bbox[4] -= round($w*0.02); - - } - - } - for($i = 0; $i < 7; $i += 2) { - $ret[$i] = round($bbox[$i] * $ca + $bbox[$i+1] * $sa); - $ret[$i+1] = round($bbox[$i+1] * $ca - $bbox[$i] * $sa); - } - $this->bbox_cache = $ret; - return $ret; - } - else { - $this->bbox_cache = $bbox; - return $bbox; - } - } - - // Deprecated - function GetTTFBBox($aTxt,$aAngle=0) { - $bbox = $this->imagettfbbox_fixed($this->font_size,$aAngle,$this->font_file,$aTxt); - return $bbox; - } - - function GetBBoxTTF($aTxt,$aAngle=0) { - // Normalize the bounding box to become a minimum - // enscribing rectangle - - $aTxt = $this->AddTxtCR($aTxt); - - if( !is_readable($this->font_file) ) { - JpGraphError::RaiseL(25093,$this->font_file); - //('Can not read font file ('.$this->font_file.') in call to Image::GetBBoxTTF. Please make sure that you have set a font before calling this method and that the font is installed in the TTF directory.'); - } - $bbox = $this->imagettfbbox_fixed($this->font_size,$aAngle,$this->font_file,$aTxt); - - if( $aAngle==0 ) return $bbox; - - if( $aAngle >= 0 ) { - if( $aAngle <= 90 ) { //<=0 - $bbox = array($bbox[6],$bbox[1],$bbox[2],$bbox[1], - $bbox[2],$bbox[5],$bbox[6],$bbox[5]); - } - elseif( $aAngle <= 180 ) { //<= 2 - $bbox = array($bbox[4],$bbox[7],$bbox[0],$bbox[7], - $bbox[0],$bbox[3],$bbox[4],$bbox[3]); - } - elseif( $aAngle <= 270 ) { //<= 3 - $bbox = array($bbox[2],$bbox[5],$bbox[6],$bbox[5], - $bbox[6],$bbox[1],$bbox[2],$bbox[1]); - } - else { - $bbox = array($bbox[0],$bbox[3],$bbox[4],$bbox[3], - $bbox[4],$bbox[7],$bbox[0],$bbox[7]); - } - } - elseif( $aAngle < 0 ) { - if( $aAngle <= -270 ) { // <= -3 - $bbox = array($bbox[6],$bbox[1],$bbox[2],$bbox[1], - $bbox[2],$bbox[5],$bbox[6],$bbox[5]); - } - elseif( $aAngle <= -180 ) { // <= -2 - $bbox = array($bbox[0],$bbox[3],$bbox[4],$bbox[3], - $bbox[4],$bbox[7],$bbox[0],$bbox[7]); - } - elseif( $aAngle <= -90 ) { // <= -1 - $bbox = array($bbox[2],$bbox[5],$bbox[6],$bbox[5], - $bbox[6],$bbox[1],$bbox[2],$bbox[1]); - } - else { - $bbox = array($bbox[0],$bbox[3],$bbox[4],$bbox[3], - $bbox[4],$bbox[7],$bbox[0],$bbox[7]); - } - } - return $bbox; - } - - function GetBBoxHeight($aTxt,$aAngle=0) { - $box = $this->GetBBoxTTF($aTxt,$aAngle); - return abs($box[7]-$box[1]); - } - - function GetBBoxWidth($aTxt,$aAngle=0) { - $box = $this->GetBBoxTTF($aTxt,$aAngle); - return $box[2]-$box[0]+1; - } - - - function _StrokeTTF($x,$y,$txt,$dir,$paragraph_align,&$aBoundingBox,$debug=false) { - - // Setup default inter line margin for paragraphs to be - // 3% of the font height. - $ConstLineSpacing = 0.03 ; - - // Remember the anchor point before adjustment - if( $debug ) { - $ox=$x; - $oy=$y; - } - - if( !preg_match('/\n/',$txt) || ($dir>0 && preg_match('/\n/',$txt)) ) { - // Format a single line - - $txt = $this->AddTxtCR($txt); - $bbox=$this->GetBBoxTTF($txt,$dir); - $width = $this->GetBBoxWidth($txt,$dir); - $height = $this->GetBBoxHeight($txt,$dir); - - // The special alignment "basepoint" is mostly used internally - // in the library. This will put the anchor position at the left - // basepoint of the tetx. This is the default anchor point for - // TTF text. - - if( $this->text_valign != 'basepoint' ) { - // Align x,y ot lower left corner of bbox - - - if( $this->text_halign=='right' ) { - $x -= $width; - $x -= $bbox[0]; - } - elseif( $this->text_halign=='center' ) { - $x -= $width/2; - $x -= $bbox[0]; - } - elseif( $this->text_halign=='baseline' ) { - // This is only support for text at 90 degree !! - // Do nothing the text is drawn at baseline by default - } - - if( $this->text_valign=='top' ) { - $y -= $bbox[1]; // Adjust to bottom of text - $y += $height; - } - elseif( $this->text_valign=='center' ) { - $y -= $bbox[1]; // Adjust to bottom of text - $y += $height/2; - } - elseif( $this->text_valign=='baseline' ) { - // This is only support for text at 0 degree !! - // Do nothing the text is drawn at baseline by default - } - } - ImageTTFText ($this->img, $this->font_size, $dir, $x, $y, - $this->current_color,$this->font_file,$txt); - - // Calculate and return the co-ordinates for the bounding box - $box = $this->imagettfbbox_fixed($this->font_size,$dir,$this->font_file,$txt); - $p1 = array(); - - for($i=0; $i < 4; ++$i) { - $p1[] = round($box[$i*2]+$x); - $p1[] = round($box[$i*2+1]+$y); - } - $aBoundingBox = $p1; - - // Debugging code to highlight the bonding box and bounding rectangle - // For text at 0 degrees the bounding box and bounding rectangle are the - // same - if( $debug ) { - // Draw the bounding rectangle and the bounding box - - $p = array(); - $p1 = array(); - - for($i=0; $i < 4; ++$i) { - $p[] = $bbox[$i*2]+$x ; - $p[] = $bbox[$i*2+1]+$y; - $p1[] = $box[$i*2]+$x ; - $p1[] = $box[$i*2+1]+$y ; - } - - // Draw bounding box - $this->PushColor('green'); - $this->Polygon($p1,true); - $this->PopColor(); - - // Draw bounding rectangle - $this->PushColor('darkgreen'); - $this->Polygon($p,true); - $this->PopColor(); - - // Draw a cross at the anchor point - $this->PushColor('red'); - $this->Line($ox-15,$oy,$ox+15,$oy); - $this->Line($ox,$oy-15,$ox,$oy+15); - $this->PopColor(); - } - } - else { - // Format a text paragraph - $fh=$this->GetFontHeight(); - - // Line margin is 25% of font height - $linemargin=round($fh*$ConstLineSpacing); - $fh += $linemargin; - $w=$this->GetTextWidth($txt); - - $y -= $linemargin/2; - $tmp = preg_split('/\n/',$txt); - $nl = count($tmp); - $h = $nl * $fh; - - if( $this->text_halign=='right') { - $x -= $dir==0 ? $w : $h; - } - elseif( $this->text_halign=='center' ) { - $x -= $dir==0 ? $w/2 : $h/2; - } - - if( $this->text_valign=='top' ) { - $y += $dir==0 ? $h : $w; - } - elseif( $this->text_valign=='center' ) { - $y += $dir==0 ? $h/2 : $w/2; - } - - // Here comes a tricky bit. - // Since we have to give the position for the string at the - // baseline this means thaht text will move slightly up - // and down depending on any of it's character descend below - // the baseline, for example a 'g'. To adjust the Y-position - // we therefore adjust the text with the baseline Y-offset - // as used for the current font and size. This will keep the - // baseline at a fixed positoned disregarding the actual - // characters in the string. - $standardbox = $this->GetTTFBBox('Gg',$dir); - $yadj = $standardbox[1]; - $xadj = $standardbox[0]; - $aBoundingBox = array(); - for($i=0; $i < $nl; ++$i) { - $wl = $this->GetTextWidth($tmp[$i]); - $bbox = $this->GetTTFBBox($tmp[$i],$dir); - if( $paragraph_align=='left' ) { - $xl = $x; - } - elseif( $paragraph_align=='right' ) { - $xl = $x + ($w-$wl); - } - else { - // Center - $xl = $x + $w/2 - $wl/2 ; - } - - // In theory we should adjust with full pre-lead to get the lines - // lined up but this doesn't look good so therfore we only adjust with - // half th pre-lead - $xl -= $bbox[0]/2; - $yl = $y - $yadj; - //$xl = $xl- $xadj; - ImageTTFText($this->img, $this->font_size, $dir, $xl, $yl-($h-$fh)+$fh*$i, - $this->current_color,$this->font_file,$tmp[$i]); - - // echo "xl=$xl,".$tmp[$i]."
"; - if( $debug ) { - // Draw the bounding rectangle around each line - $box=@ImageTTFBBox($this->font_size,$dir,$this->font_file,$tmp[$i]); - $p = array(); - for($j=0; $j < 4; ++$j) { - $p[] = $bbox[$j*2]+$xl; - $p[] = $bbox[$j*2+1]+$yl-($h-$fh)+$fh*$i; - } - - // Draw bounding rectangle - $this->PushColor('darkgreen'); - $this->Polygon($p,true); - $this->PopColor(); - } - } - - // Get the bounding box - $bbox = $this->GetBBoxTTF($txt,$dir); - for($j=0; $j < 4; ++$j) { - $bbox[$j*2]+= round($x); - $bbox[$j*2+1]+= round($y - ($h-$fh) - $yadj); - } - $aBoundingBox = $bbox; - - if( $debug ) { - // Draw a cross at the anchor point - $this->PushColor('red'); - $this->Line($ox-25,$oy,$ox+25,$oy); - $this->Line($ox,$oy-25,$ox,$oy+25); - $this->PopColor(); - } - - } - } - - function StrokeText($x,$y,$txt,$dir=0,$paragraph_align="left",$debug=false) { - - $x = round($x); - $y = round($y); - - // Do special language encoding - $txt = $this->langconv->Convert($txt,$this->font_family); - - if( !is_numeric($dir) ) { - JpGraphError::RaiseL(25094);//(" Direction for text most be given as an angle between 0 and 90."); - } - - if( $this->font_family >= FF_FONT0 && $this->font_family <= FF_FONT2+1) { - $this->_StrokeBuiltinFont($x,$y,$txt,$dir,$paragraph_align,$boundingbox,$debug); - } - elseif( $this->font_family >= _FIRST_FONT && $this->font_family <= _LAST_FONT) { - $this->_StrokeTTF($x,$y,$txt,$dir,$paragraph_align,$boundingbox,$debug); - } - else { - JpGraphError::RaiseL(25095);//(" Unknown font font family specification. "); - } - return $boundingbox; - } - - function SetMargin($lm,$rm,$tm,$bm) { - - $this->left_margin=$lm; - $this->right_margin=$rm; - $this->top_margin=$tm; - $this->bottom_margin=$bm; - - $this->plotwidth = $this->width - $this->left_margin - $this->right_margin; - $this->plotheight = $this->height - $this->top_margin - $this->bottom_margin; - - if( $this->width > 0 && $this->height > 0 ) { - if( $this->plotwidth < 0 || $this->plotheight < 0 ) { - JpGraphError::RaiseL(25130, $this->plotwidth, $this->plotheight); - //JpGraphError::raise("To small plot area. ($lm,$rm,$tm,$bm : $this->plotwidth x $this->plotheight). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins."); - } - } - } - - function SetTransparent($color) { - imagecolortransparent ($this->img,$this->rgb->allocate($color)); - } - - function SetColor($color,$aAlpha=0) { - $this->current_color_name = $color; - $this->current_color=$this->rgb->allocate($color,$aAlpha); - if( $this->current_color == -1 ) { - $tc=imagecolorstotal($this->img); - JpGraphError::RaiseL(25096); - //("Can't allocate any more colors. Image has already allocated maximum of $tc colors. This might happen if you have anti-aliasing turned on together with a background image or perhaps gradient fill since this requires many, many colors. Try to turn off anti-aliasing. If there is still a problem try downgrading the quality of the background image to use a smaller pallete to leave some entries for your graphs. You should try to limit the number of colors in your background image to 64. If there is still problem set the constant DEFINE(\"USE_APPROX_COLORS\",true); in jpgraph.php This will use approximative colors when the palette is full. Unfortunately there is not much JpGraph can do about this since the palette size is a limitation of current graphic format and what the underlying GD library suppports."); - } - return $this->current_color; - } - - function PushColor($color) { - if( $color != "" ) { - $this->colorstack[$this->colorstackidx]=$this->current_color_name; - $this->colorstack[$this->colorstackidx+1]=$this->current_color; - $this->colorstackidx+=2; - $this->SetColor($color); - } - else { - JpGraphError::RaiseL(25097);//("Color specified as empty string in PushColor()."); - } - } - - function PopColor() { - if( $this->colorstackidx < 1 ) { - JpGraphError::RaiseL(25098);//(" Negative Color stack index. Unmatched call to PopColor()"); - } - $this->current_color=$this->colorstack[--$this->colorstackidx]; - $this->current_color_name=$this->colorstack[--$this->colorstackidx]; - } - - - function SetLineWeight($weight) { - $old = $this->line_weight; - imagesetthickness($this->img,$weight); - $this->line_weight = $weight; - return $old; - } - - function SetStartPoint($x,$y) { - $this->lastx=round($x); - $this->lasty=round($y); - } - - function Arc($cx,$cy,$w,$h,$s,$e) { - // GD Arc doesn't like negative angles - while( $s < 0) $s += 360; - while( $e < 0) $e += 360; - imagearc($this->img,round($cx),round($cy),round($w),round($h),$s,$e,$this->current_color); - } - - function FilledArc($xc,$yc,$w,$h,$s,$e,$style='') { - $s = round($s); - $e = round($e); - while( $s < 0 ) $s += 360; - while( $e < 0 ) $e += 360; - if( $style=='' ) - $style=IMG_ARC_PIE; - if( abs($s-$e) > 0 ) { - imagefilledarc($this->img,round($xc),round($yc),round($w),round($h),$s,$e,$this->current_color,$style); -// $this->DrawImageSmoothArc($this->img,round($xc),round($yc),round($w),round($h),$s,$e,$this->current_color,$style); - } - } - - function FilledCakeSlice($cx,$cy,$w,$h,$s,$e) { - $this->CakeSlice($cx,$cy,$w,$h,$s,$e,$this->current_color_name); - } - - function CakeSlice($xc,$yc,$w,$h,$s,$e,$fillcolor="",$arccolor="") { - $s = round($s); $e = round($e); - $w = round($w); $h = round($h); - $xc = round($xc); $yc = round($yc); - if( $s == $e ) { - // A full circle. We draw this a plain circle - $this->PushColor($fillcolor); - imagefilledellipse($this->img,$xc,$yc,2*$w,2*$h,$this->current_color); - - // If antialiasing is used then we often don't have any color no the surrounding - // arc. So, we need to check for this special case so we don't send an empty - // color to the push function. In this case we use the fill color for the arc as well - if( $arccolor != '' ) { - $this->PopColor(); - $this->PushColor($arccolor); - } - imageellipse($this->img,$xc,$yc,2*$w,2*$h,$this->current_color); - $this->Line($xc,$yc,cos($s*M_PI/180)*$w+$xc,$yc+sin($s*M_PI/180)*$h); - $this->PopColor(); - } - else { - $this->PushColor($fillcolor); - $this->FilledArc($xc,$yc,2*$w,2*$h,$s,$e); - $this->PopColor(); - if( $arccolor != "" ) { - $this->PushColor($arccolor); - // We add 2 pixels to make the Arc() better aligned with - // the filled arc. - imagefilledarc($this->img,$xc,$yc,2*$w,2*$h,$s,$e,$this->current_color,IMG_ARC_NOFILL | IMG_ARC_EDGED ) ; - $this->PopColor(); - } - } - } - - function Ellipse($xc,$yc,$w,$h) { - $this->Arc($xc,$yc,$w,$h,0,360); - } - - function Circle($xc,$yc,$r) { - imageellipse($this->img,round($xc),round($yc),$r*2,$r*2,$this->current_color); -// $this->DrawImageSmoothArc($this->img,round($xc),round($yc),$r*2+1,$r*2+1,0,360,$this->current_color); -// $this->imageSmoothCircle($this->img, round($xc),round($yc), $r*2+1, $this->current_color); - } - - function FilledCircle($xc,$yc,$r) { - imagefilledellipse($this->img,round($xc),round($yc),2*$r,2*$r,$this->current_color); -// $this->DrawImageSmoothArc($this->img, round($xc), round($yc), 2*$r, 2*$r, 0, 360, $this->current_color); - } - - // Linear Color InterPolation - function lip($f,$t,$p) { - $p = round($p,1); - $r = $f[0] + ($t[0]-$f[0])*$p; - $g = $f[1] + ($t[1]-$f[1])*$p; - $b = $f[2] + ($t[2]-$f[2])*$p; - return array($r,$g,$b); - } - - // Set line style dashed, dotted etc - function SetLineStyle($s) { - if( is_numeric($s) ) { - if( $s<1 || $s>4 ) { - JpGraphError::RaiseL(25101,$s);//(" Illegal numeric argument to SetLineStyle(): ($s)"); - } - } - elseif( is_string($s) ) { - if( $s == "solid" ) $s=1; - elseif( $s == "dotted" ) $s=2; - elseif( $s == "dashed" ) $s=3; - elseif( $s == "longdashed" ) $s=4; - else { - JpGraphError::RaiseL(25102,$s);//(" Illegal string argument to SetLineStyle(): $s"); - } - } - else { - JpGraphError::RaiseL(25103,$s);//(" Illegal argument to SetLineStyle $s"); - } - $old = $this->line_style; - $this->line_style=$s; - return $old; - } - - // Same as Line but take the line_style into account - function StyleLine($x1,$y1,$x2,$y2,$aStyle='', $from_grid_class = false) { - if( $this->line_weight <= 0 ) return; - - if( $aStyle === '' ) { - $aStyle = $this->line_style; - } - - $dashed_line_method = 'DashedLine'; - if ($from_grid_class) { - $dashed_line_method = 'DashedLineForGrid'; - } - - // Add error check since dashed line will only work if anti-alias is disabled - // this is a limitation in GD - - if( $aStyle == 1 ) { - // Solid style. We can handle anti-aliasing for this - $this->Line($x1,$y1,$x2,$y2); - } - else { - // Since the GD routines doesn't handle AA for styled line - // we have no option than to turn it off to get any lines at - // all if the weight > 1 - $oldaa = $this->GetAntiAliasing(); - if( $oldaa && $this->line_weight > 1 ) { - $this->SetAntiAliasing(false); - } - - switch( $aStyle ) { - case 2: // Dotted - $this->$dashed_line_method($x1,$y1,$x2,$y2,2,6); - break; - case 3: // Dashed - $this->$dashed_line_method($x1,$y1,$x2,$y2,5,9); - break; - case 4: // Longdashes - $this->$dashed_line_method($x1,$y1,$x2,$y2,9,13); - break; - default: - JpGraphError::RaiseL(25104,$this->line_style);//(" Unknown line style: $this->line_style "); - break; - } - if( $oldaa ) { - $this->SetAntiAliasing(true); - } - } - } - - function DashedLine($x1,$y1,$x2,$y2,$dash_length=1,$dash_space=4) { - - if( $this->line_weight <= 0 ) return; - - // Add error check to make sure anti-alias is not enabled. - // Dashed line does not work with anti-alias enabled. This - // is a limitation in GD. - if( $this->use_anti_aliasing ) { -// JpGraphError::RaiseL(25129); // Anti-alias can not be used with dashed lines. Please disable anti-alias or use solid lines. - } - - $x1 = round($x1); - $x2 = round($x2); - $y1 = round($y1); - $y2 = round($y2); - - $dash_length *= SUPERSAMPLING_SCALE; - $dash_space *= SUPERSAMPLING_SCALE; - - $style = array_fill(0,$dash_length,$this->current_color); - $style = array_pad($style,$dash_space,IMG_COLOR_TRANSPARENT); - imagesetstyle($this->img, $style); - imageline($this->img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED); - - $this->lastx = $x2; - $this->lasty = $y2; - } - - function DashedLineForGrid($x1,$y1,$x2,$y2,$dash_length=1,$dash_space=4) { - - if( $this->line_weight <= 0 ) return; - - // Add error check to make sure anti-alias is not enabled. - // Dashed line does not work with anti-alias enabled. This - // is a limitation in GD. - if( $this->use_anti_aliasing ) { -// JpGraphError::RaiseL(25129); // Anti-alias can not be used with dashed lines. Please disable anti-alias or use solid lines. - } - - $x1 = round($x1); - $x2 = round($x2); - $y1 = round($y1); - $y2 = round($y2); - - /* - $dash_length *= $this->scale; - $dash_space *= $this->scale; - */ - - $dash_length = 2; - $dash_length = 4; - imagesetthickness($this->img, 1); - $style = array_fill(0,$dash_length, $this->current_color); //hexdec('CCCCCC')); - $style = array_pad($style,$dash_space,IMG_COLOR_TRANSPARENT); - imagesetstyle($this->img, $style); - imageline($this->img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED); - - $this->lastx = $x2; - $this->lasty = $y2; - } - - function Line($x1,$y1,$x2,$y2) { - - if( $this->line_weight <= 0 ) return; - - $x1 = round($x1); - $x2 = round($x2); - $y1 = round($y1); - $y2 = round($y2); - - imageline($this->img,$x1,$y1,$x2,$y2,$this->current_color); -// $this->DrawLine($this->img, $x1, $y1, $x2, $y2, $this->line_weight, $this->current_color); - $this->lastx=$x2; - $this->lasty=$y2; - } - - function Polygon($p,$closed=FALSE,$fast=FALSE) { - - if( $this->line_weight <= 0 ) return; - - $n=count($p); - $oldx = $p[0]; - $oldy = $p[1]; - if( $fast ) { - for( $i=2; $i < $n; $i+=2 ) { - imageline($this->img,$oldx,$oldy,$p[$i],$p[$i+1],$this->current_color); - $oldx = $p[$i]; - $oldy = $p[$i+1]; - } - if( $closed ) { - imageline($this->img,$p[$n*2-2],$p[$n*2-1],$p[0],$p[1],$this->current_color); - } - } - else { - for( $i=2; $i < $n; $i+=2 ) { - $this->StyleLine($oldx,$oldy,$p[$i],$p[$i+1]); - $oldx = $p[$i]; - $oldy = $p[$i+1]; - } - if( $closed ) { - $this->StyleLine($oldx,$oldy,$p[0],$p[1]); - } - } - } - - function FilledPolygon($pts) { - $n=count($pts); - if( $n == 0 ) { - JpGraphError::RaiseL(25105);//('NULL data specified for a filled polygon. Check that your data is not NULL.'); - } - for($i=0; $i < $n; ++$i) { - $pts[$i] = round($pts[$i]); - } - $old = $this->line_weight; - imagesetthickness($this->img,1); - imagefilledpolygon($this->img,$pts,count($pts)/2,$this->current_color); - $this->line_weight = $old; - imagesetthickness($this->img,$old); - } - - function Rectangle($xl,$yu,$xr,$yl) { - $this->Polygon(array($xl,$yu,$xr,$yu,$xr,$yl,$xl,$yl,$xl,$yu)); - } - - function FilledRectangle($xl,$yu,$xr,$yl) { - $this->FilledPolygon(array($xl,$yu,$xr,$yu,$xr,$yl,$xl,$yl)); - } - - function FilledRectangle2($xl,$yu,$xr,$yl,$color1,$color2,$style=1) { - // Fill a rectangle with lines of two colors - if( $style===1 ) { - // Horizontal stripe - if( $yl < $yu ) { - $t = $yl; $yl=$yu; $yu=$t; - } - for( $y=$yu; $y <= $yl; ++$y) { - $this->SetColor($color1); - $this->Line($xl,$y,$xr,$y); - ++$y; - $this->SetColor($color2); - $this->Line($xl,$y,$xr,$y); - } - } - else { - if( $xl < $xl ) { - $t = $xl; $xl=$xr; $xr=$t; - } - for( $x=$xl; $x <= $xr; ++$x) { - $this->SetColor($color1); - $this->Line($x,$yu,$x,$yl); - ++$x; - $this->SetColor($color2); - $this->Line($x,$yu,$x,$yl); - } - } - } - - function ShadowRectangle($xl,$yu,$xr,$yl,$fcolor=false,$shadow_width=4,$shadow_color='darkgray',$useAlpha=true) { - // This is complicated by the fact that we must also handle the case where - // the reactangle has no fill color - $xl = floor($xl); - $yu = floor($yu); - $xr = floor($xr); - $yl = floor($yl); - $this->PushColor($shadow_color); - $shadowAlpha=0; - $this->SetLineWeight(1); - $this->SetLineStyle('solid'); - $basecolor = $this->rgb->Color($shadow_color); - $shadow_color = array($basecolor[0],$basecolor[1],$basecolor[2],); - for( $i=0; $i < $shadow_width; ++$i ) { - $this->SetColor($shadow_color,$shadowAlpha); - $this->Line($xr-$shadow_width+$i, $yu+$shadow_width, - $xr-$shadow_width+$i, $yl-$shadow_width-1+$i); - $this->Line($xl+$shadow_width, $yl-$shadow_width+$i, - $xr-$shadow_width+$i, $yl-$shadow_width+$i); - if( $useAlpha ) $shadowAlpha += 1.0/$shadow_width; - } - - $this->PopColor(); - if( $fcolor==false ) { - $this->Rectangle($xl,$yu,$xr-$shadow_width-1,$yl-$shadow_width-1); - } - else { - $this->PushColor($fcolor); - $this->FilledRectangle($xl,$yu,$xr-$shadow_width-1,$yl-$shadow_width-1); - $this->PopColor(); - $this->Rectangle($xl,$yu,$xr-$shadow_width-1,$yl-$shadow_width-1); - } - } - - function FilledRoundedRectangle($xt,$yt,$xr,$yl,$r=5) { - if( $r==0 ) { - $this->FilledRectangle($xt,$yt,$xr,$yl); - return; - } - - // To avoid overlapping fillings (which will look strange - // when alphablending is enabled) we have no choice but - // to fill the five distinct areas one by one. - - // Center square - $this->FilledRectangle($xt+$r,$yt+$r,$xr-$r,$yl-$r); - // Top band - $this->FilledRectangle($xt+$r,$yt,$xr-$r,$yt+$r); - // Bottom band - $this->FilledRectangle($xt+$r,$yl-$r,$xr-$r,$yl); - // Left band - $this->FilledRectangle($xt,$yt+$r,$xt+$r,$yl-$r); - // Right band - $this->FilledRectangle($xr-$r,$yt+$r,$xr,$yl-$r); - - // Topleft & Topright arc - $this->FilledArc($xt+$r,$yt+$r,$r*2,$r*2,180,270); - $this->FilledArc($xr-$r,$yt+$r,$r*2,$r*2,270,360); - - // Bottomleft & Bottom right arc - $this->FilledArc($xt+$r,$yl-$r,$r*2,$r*2,90,180); - $this->FilledArc($xr-$r,$yl-$r,$r*2,$r*2,0,90); - - } - - function RoundedRectangle($xt,$yt,$xr,$yl,$r=5) { - - if( $r==0 ) { - $this->Rectangle($xt,$yt,$xr,$yl); - return; - } - - // Top & Bottom line - $this->Line($xt+$r,$yt,$xr-$r,$yt); - $this->Line($xt+$r,$yl,$xr-$r,$yl); - - // Left & Right line - $this->Line($xt,$yt+$r,$xt,$yl-$r); - $this->Line($xr,$yt+$r,$xr,$yl-$r); - - // Topleft & Topright arc - $this->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); - $this->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); - - // Bottomleft & Bottomright arc - $this->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); - $this->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); - } - - function FilledBevel($x1,$y1,$x2,$y2,$depth=2,$color1='white@0.4',$color2='darkgray@0.4') { - $this->FilledRectangle($x1,$y1,$x2,$y2); - $this->Bevel($x1,$y1,$x2,$y2,$depth,$color1,$color2); - } - - function Bevel($x1,$y1,$x2,$y2,$depth=2,$color1='white@0.4',$color2='black@0.5') { - $this->PushColor($color1); - for( $i=0; $i < $depth; ++$i ) { - $this->Line($x1+$i,$y1+$i,$x1+$i,$y2-$i); - $this->Line($x1+$i,$y1+$i,$x2-$i,$y1+$i); - } - $this->PopColor(); - - $this->PushColor($color2); - for( $i=0; $i < $depth; ++$i ) { - $this->Line($x1+$i,$y2-$i,$x2-$i,$y2-$i); - $this->Line($x2-$i,$y1+$i,$x2-$i,$y2-$i-1); - } - $this->PopColor(); - } - - function StyleLineTo($x,$y) { - $this->StyleLine($this->lastx,$this->lasty,$x,$y); - $this->lastx=$x; - $this->lasty=$y; - } - - function LineTo($x,$y) { - $this->Line($this->lastx,$this->lasty,$x,$y); - $this->lastx=$x; - $this->lasty=$y; - } - - function Point($x,$y) { - imagesetpixel($this->img,round($x),round($y),$this->current_color); - } - - function Fill($x,$y) { - imagefill($this->img,round($x),round($y),$this->current_color); - } - - function FillToBorder($x,$y,$aBordColor) { - $bc = $this->rgb->allocate($aBordColor); - if( $bc == -1 ) { - JpGraphError::RaiseL(25106);//('Image::FillToBorder : Can not allocate more colors'); - } - imagefilltoborder($this->img,round($x),round($y),$bc,$this->current_color); - } - - function SetExpired($aFlg=true) { - $this->expired = $aFlg; - } - - // Generate image header - function Headers() { - - // In case we are running from the command line with the client version of - // PHP we can't send any headers. - $sapi = php_sapi_name(); - if( $sapi == 'cli' ) return; - - // These parameters are set by headers_sent() but they might cause - // an undefined variable error unless they are initilized - $file=''; - $lineno=''; - if( headers_sent($file,$lineno) ) { - $file=basename($file); - $t = new ErrMsgText(); - $msg = $t->Get(10,$file,$lineno); - die($msg); - } - - if ($this->expired) { - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); - header("Cache-Control: no-cache, must-revalidate"); - header("Pragma: no-cache"); - } - header("Content-type: image/$this->img_format"); - } - - // Adjust image quality for formats that allow this - function SetQuality($q) { - $this->quality = $q; - } - - // Stream image to browser or to file - function Stream($aFile=NULL) { - $this->DoSupersampling(); - - $func="image".$this->img_format; - if( $this->img_format=="jpeg" && $this->quality != null ) { - $res = @$func($this->img,$aFile,$this->quality); - - if(!$res){ - if($aFile != NULL){ - JpGraphError::RaiseL(25107,$aFile);//("Can't write to file '$aFile'. Check that the process running PHP has enough permission."); - }else{ - JpGraphError::RaiseL(25108);//("Can't stream image. This is most likely due to a faulty PHP/GD setup. Try to recompile PHP and use the built-in GD library that comes with PHP."); - } - - } - } - else { - if( $aFile != NULL ) { - $res = @$func($this->img,$aFile); - if( !$res ) { - JpGraphError::RaiseL(25107,$aFile);//("Can't write to file '$aFile'. Check that the process running PHP has enough permission."); - } - } - else { - $res = @$func($this->img); - if( !$res ) { - JpGraphError::RaiseL(25108);//("Can't stream image. This is most likely due to a faulty PHP/GD setup. Try to recompile PHP and use the built-in GD library that comes with PHP."); - } - - } - } - } - - // Do SuperSampling using $scale - function DoSupersampling() { - if (SUPERSAMPLING_SCALE <= 1) { - return $this->img; - } - - $dst_img = @imagecreatetruecolor($this->original_width, $this->original_height); - imagecopyresampled($dst_img, $this->img, 0, 0, 0, 0, $this->original_width, $this->original_height, $this->width, $this->height); - $this->Destroy(); - return $this->img = $dst_img; - } - - // Clear resources used by image (this is normally not used since all resources are/should be - // returned when the script terminates - function Destroy() { - imagedestroy($this->img); - } - - // Specify image format. Note depending on your installation - // of PHP not all formats may be supported. - function SetImgFormat($aFormat,$aQuality=75) { - $this->quality = $aQuality; - $aFormat = strtolower($aFormat); - $tst = true; - $supported = imagetypes(); - if( $aFormat=="auto" ) { - if( $supported & IMG_PNG ) $this->img_format="png"; - elseif( $supported & IMG_JPG ) $this->img_format="jpeg"; - elseif( $supported & IMG_GIF ) $this->img_format="gif"; - elseif( $supported & IMG_WBMP ) $this->img_format="wbmp"; - elseif( $supported & IMG_XPM ) $this->img_format="xpm"; - else { - JpGraphError::RaiseL(25109);//("Your PHP (and GD-lib) installation does not appear to support any known graphic formats. You need to first make sure GD is compiled as a module to PHP. If you also want to use JPEG images you must get the JPEG library. Please see the PHP docs for details."); - } - return true; - } - else { - if( $aFormat=="jpeg" || $aFormat=="png" || $aFormat=="gif" ) { - if( $aFormat=="jpeg" && !($supported & IMG_JPG) ) $tst=false; - elseif( $aFormat=="png" && !($supported & IMG_PNG) ) $tst=false; - elseif( $aFormat=="gif" && !($supported & IMG_GIF) ) $tst=false; - elseif( $aFormat=="wbmp" && !($supported & IMG_WBMP) ) $tst=false; - elseif( $aFormat=="xpm" && !($supported & IMG_XPM) ) $tst=false; - else { - $this->img_format=$aFormat; - return true; - } - } - else { - $tst=false; - } - if( !$tst ) { - JpGraphError::RaiseL(25110,$aFormat);//(" Your PHP installation does not support the chosen graphic format: $aFormat"); - } - } - } - - /** - * Draw Line - */ - function DrawLine($im, $x1, $y1, $x2, $y2, $weight, $color) { - if ($weight == 1) { - return imageline($im,$x1,$y1,$x2,$y2,$color); - } - - $angle=(atan2(($y1 - $y2), ($x2 - $x1))); - - $dist_x = $weight * (sin($angle)) / 2; - $dist_y = $weight * (cos($angle)) / 2; - - $p1x=ceil(($x1 + $dist_x)); - $p1y=ceil(($y1 + $dist_y)); - $p2x=ceil(($x2 + $dist_x)); - $p2y=ceil(($y2 + $dist_y)); - $p3x=ceil(($x2 - $dist_x)); - $p3y=ceil(($y2 - $dist_y)); - $p4x=ceil(($x1 - $dist_x)); - $p4y=ceil(($y1 - $dist_y)); - - $array=array($p1x,$p1y,$p2x,$p2y,$p3x,$p3y,$p4x,$p4y); - imagefilledpolygon ( $im, $array, (count($array)/2), $color ); - - // for antialias - imageline($im, $p1x, $p1y, $p2x, $p2y, $color); - imageline($im, $p3x, $p3y, $p4x, $p4y, $color); - return; - - - - return imageline($this->img,$x1,$y1,$x2,$y2,$this->current_color); - $weight = 8; - if ($weight <= 1) { - return imageline($this->img,$x1,$y1,$x2,$y2,$this->current_color); - } - - $pts = array(); - - $weight /= 2; - - if ($y2 - $y1 == 0) { - // x line - $pts = array(); - $pts[] = $x1; $pts[] = $y1 - $weight; - $pts[] = $x1; $pts[] = $y1 + $weight; - $pts[] = $x2; $pts[] = $y2 + $weight; - $pts[] = $x2; $pts[] = $y2 - $weight; - - } elseif ($x2 - $x1 == 0) { - // y line - $pts = array(); - $pts[] = $x1 - $weight; $pts[] = $y1; - $pts[] = $x1 + $weight; $pts[] = $y1; - $pts[] = $x2 + $weight; $pts[] = $y2; - $pts[] = $x2 - $weight; $pts[] = $y2; - - } else { - - var_dump($x1, $x2, $y1, $y2); - $length = sqrt(pow($x2 - $x1, 2) + pow($y2 - $y1, 2)); - var_dump($length);exit; - exit; - -/* - $lean = ($y2 - $y1) / ($x2 - $x1); - $lean2 = -1 / $lean; - $sin = $lean / ($y2 - $y1); - $cos = $lean / ($x2 - $x1); - - $pts[] = $x1 + (-$weight * $sin); $pts[] = $y1 + (-$weight * $cos); - $pts[] = $x1 + (+$weight * $sin); $pts[] = $y1 + (+$weight * $cos); - $pts[] = $x2 + (+$weight * $sin); $pts[] = $y2 + (+$weight * $cos); - $pts[] = $x2 + (-$weight * $sin); $pts[] = $y2 + (-$weight * $cos); -*/ - } - -//print_r($pts);exit; - if (count($pts)/2 < 3) { - return; - } - - imagesetthickness($im, 1); - imagefilledpolygon($im, $pts,count($pts)/2, $color); - - - $weight *= 2; - -// $this->DrawImageSmoothArc($im, $x1, $y1, $weight, $weight, 0, 360, $color); -// $this->DrawImageSmoothArc($im, $x2, $y2, $weight, $weight, 0, 360, $color); - } - - - function DrawImageSmoothArc($im, $xc, $yc, $w, $h, $s, $e, $color, $style = null) { - $tmp = $s; - $s = (360 - $e) / 180 * M_PI; - $e = (360 - $tmp) / 180 * M_PI; - return imageSmoothArc($im, round($xc), round($yc), round($w), round($h), $this->CreateColorForImageSmoothArc($color), $s, $e); - } - - function CreateColorForImageSmoothArc($color) { - $alpha = $color >> 24 & 0xFF; - $red = $color >> 16 & 0xFF; - $green = $color >> 8 & 0xFF; - $blue = $color & 0xFF; - -//var_dump($alpha, $red, $green, $blue);exit; - - return array($red, $green, $blue, $alpha); - } - - function imageSmoothCircle( &$img, $cx, $cy, $cr, $color ) { - $ir = $cr; - $ix = 0; - $iy = $ir; - $ig = 2 * $ir - 3; - $idgr = -6; - $idgd = 4 * $ir - 10; - $fill = imageColorExactAlpha( $img, $color[ 'R' ], $color[ 'G' ], $color[ 'B' ], 0 ); - imageLine( $img, $cx + $cr - 1, $cy, $cx, $cy, $fill ); - imageLine( $img, $cx - $cr + 1, $cy, $cx - 1, $cy, $fill ); - imageLine( $img, $cx, $cy + $cr - 1, $cx, $cy + 1, $fill ); - imageLine( $img, $cx, $cy - $cr + 1, $cx, $cy - 1, $fill ); - $draw = imageColorExactAlpha( $img, $color[ 'R' ], $color[ 'G' ], $color[ 'B' ], 42 ); - imageSetPixel( $img, $cx + $cr, $cy, $draw ); - imageSetPixel( $img, $cx - $cr, $cy, $draw ); - imageSetPixel( $img, $cx, $cy + $cr, $draw ); - imageSetPixel( $img, $cx, $cy - $cr, $draw ); - while ( $ix <= $iy - 2 ) { - if ( $ig < 0 ) { - $ig += $idgd; - $idgd -= 8; - $iy--; - } else { - $ig += $idgr; - $idgd -= 4; - } - $idgr -= 4; - $ix++; - imageLine( $img, $cx + $ix, $cy + $iy - 1, $cx + $ix, $cy + $ix, $fill ); - imageLine( $img, $cx + $ix, $cy - $iy + 1, $cx + $ix, $cy - $ix, $fill ); - imageLine( $img, $cx - $ix, $cy + $iy - 1, $cx - $ix, $cy + $ix, $fill ); - imageLine( $img, $cx - $ix, $cy - $iy + 1, $cx - $ix, $cy - $ix, $fill ); - imageLine( $img, $cx + $iy - 1, $cy + $ix, $cx + $ix, $cy + $ix, $fill ); - imageLine( $img, $cx + $iy - 1, $cy - $ix, $cx + $ix, $cy - $ix, $fill ); - imageLine( $img, $cx - $iy + 1, $cy + $ix, $cx - $ix, $cy + $ix, $fill ); - imageLine( $img, $cx - $iy + 1, $cy - $ix, $cx - $ix, $cy - $ix, $fill ); - $filled = 0; - for ( $xx = $ix - 0.45; $xx < $ix + 0.5; $xx += 0.2 ) { - for ( $yy = $iy - 0.45; $yy < $iy + 0.5; $yy += 0.2 ) { - if ( sqrt( pow( $xx, 2 ) + pow( $yy, 2 ) ) < $cr ) $filled += 4; - } - } - $draw = imageColorExactAlpha( $img, $color[ 'R' ], $color[ 'G' ], $color[ 'B' ], ( 100 - $filled ) ); - imageSetPixel( $img, $cx + $ix, $cy + $iy, $draw ); - imageSetPixel( $img, $cx + $ix, $cy - $iy, $draw ); - imageSetPixel( $img, $cx - $ix, $cy + $iy, $draw ); - imageSetPixel( $img, $cx - $ix, $cy - $iy, $draw ); - imageSetPixel( $img, $cx + $iy, $cy + $ix, $draw ); - imageSetPixel( $img, $cx + $iy, $cy - $ix, $draw ); - imageSetPixel( $img, $cx - $iy, $cy + $ix, $draw ); - imageSetPixel( $img, $cx - $iy, $cy - $ix, $draw ); - } - } - - function __get($name) { - - if (strpos($name, 'raw_') !== false) { - // if $name == 'raw_left_margin' , return $this->_left_margin; - $variable_name = '_' . str_replace('raw_', '', $name); - return $this->$variable_name; - } - - $variable_name = '_' . $name; - - if (isset($this->$variable_name)) { - return $this->$variable_name * SUPERSAMPLING_SCALE; - } else { - JpGraphError::RaiseL('25132', $name); - } - } - - function __set($name, $value) { - $this->{'_'.$name} = $value; - } - -} // CLASS - -//=================================================== -// CLASS RotImage -// Description: Exactly as Image but draws the image at -// a specified angle around a specified rotation point. -//=================================================== -class RotImage extends Image { - public $a=0; - public $dx=0,$dy=0,$transx=0,$transy=0; - private $m=array(); - - function __construct($aWidth,$aHeight,$a=0,$aFormat=DEFAULT_GFORMAT,$aSetAutoMargin=true) { - parent::__construct($aWidth,$aHeight,$aFormat,$aSetAutoMargin); - $this->dx=$this->left_margin+$this->plotwidth/2; - $this->dy=$this->top_margin+$this->plotheight/2; - $this->SetAngle($a); - } - - function SetCenter($dx,$dy) { - $old_dx = $this->dx; - $old_dy = $this->dy; - $this->dx=$dx; - $this->dy=$dy; - $this->SetAngle($this->a); - return array($old_dx,$old_dy); - } - - function SetTranslation($dx,$dy) { - $old = array($this->transx,$this->transy); - $this->transx = $dx; - $this->transy = $dy; - return $old; - } - - function UpdateRotMatrice() { - $a = $this->a; - $a *= M_PI/180; - $sa=sin($a); $ca=cos($a); - // Create the rotation matrix - $this->m[0][0] = $ca; - $this->m[0][1] = -$sa; - $this->m[0][2] = $this->dx*(1-$ca) + $sa*$this->dy ; - $this->m[1][0] = $sa; - $this->m[1][1] = $ca; - $this->m[1][2] = $this->dy*(1-$ca) - $sa*$this->dx ; - } - - function SetAngle($a) { - $tmp = $this->a; - $this->a = $a; - $this->UpdateRotMatrice(); - return $tmp; - } - - function Circle($xc,$yc,$r) { - list($xc,$yc) = $this->Rotate($xc,$yc); - parent::Circle($xc,$yc,$r); - } - - function FilledCircle($xc,$yc,$r) { - list($xc,$yc) = $this->Rotate($xc,$yc); - parent::FilledCircle($xc,$yc,$r); - } - - - function Arc($xc,$yc,$w,$h,$s,$e) { - list($xc,$yc) = $this->Rotate($xc,$yc); - $s += $this->a; - $e += $this->a; - parent::Arc($xc,$yc,$w,$h,$s,$e); - } - - function FilledArc($xc,$yc,$w,$h,$s,$e,$style='') { - list($xc,$yc) = $this->Rotate($xc,$yc); - $s += $this->a; - $e += $this->a; - parent::FilledArc($xc,$yc,$w,$h,$s,$e); - } - - function SetMargin($lm,$rm,$tm,$bm) { - parent::SetMargin($lm,$rm,$tm,$bm); - $this->dx=$this->left_margin+$this->plotwidth/2; - $this->dy=$this->top_margin+$this->plotheight/2; - $this->UpdateRotMatrice(); - } - - function Rotate($x,$y) { - // Optimization. Ignore rotation if Angle==0 || Angle==360 - if( $this->a == 0 || $this->a == 360 ) { - return array($x + $this->transx, $y + $this->transy ); - } - else { - $x1=round($this->m[0][0]*$x + $this->m[0][1]*$y,1) + $this->m[0][2] + $this->transx; - $y1=round($this->m[1][0]*$x + $this->m[1][1]*$y,1) + $this->m[1][2] + $this->transy; - return array($x1,$y1); - } - } - - function CopyMerge($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1,$aMix=100) { - list($toX,$toY) = $this->Rotate($toX,$toY); - parent::CopyMerge($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight,$aMix); - - } - - function ArrRotate($pnts) { - $n = count($pnts)-1; - for($i=0; $i < $n; $i+=2) { - list ($x,$y) = $this->Rotate($pnts[$i],$pnts[$i+1]); - $pnts[$i] = $x; $pnts[$i+1] = $y; - } - return $pnts; - } - - function DashedLine($x1,$y1,$x2,$y2,$dash_length=1,$dash_space=4) { - list($x1,$y1) = $this->Rotate($x1,$y1); - list($x2,$y2) = $this->Rotate($x2,$y2); - parent::DashedLine($x1,$y1,$x2,$y2,$dash_length,$dash_space); - } - - function Line($x1,$y1,$x2,$y2) { - list($x1,$y1) = $this->Rotate($x1,$y1); - list($x2,$y2) = $this->Rotate($x2,$y2); - parent::Line($x1,$y1,$x2,$y2); - } - - function Rectangle($x1,$y1,$x2,$y2) { - // Rectangle uses Line() so it will be rotated through that call - parent::Rectangle($x1,$y1,$x2,$y2); - } - - function FilledRectangle($x1,$y1,$x2,$y2) { - if( $y1==$y2 || $x1==$x2 ) - $this->Line($x1,$y1,$x2,$y2); - else - $this->FilledPolygon(array($x1,$y1,$x2,$y1,$x2,$y2,$x1,$y2)); - } - - function Polygon($pnts,$closed=FALSE,$fast=FALSE) { - // Polygon uses Line() so it will be rotated through that call unless - // fast drawing routines are used in which case a rotate is needed - if( $fast ) { - parent::Polygon($this->ArrRotate($pnts)); - } - else { - parent::Polygon($pnts,$closed,$fast); - } - } - - function FilledPolygon($pnts) { - parent::FilledPolygon($this->ArrRotate($pnts)); - } - - function Point($x,$y) { - list($xp,$yp) = $this->Rotate($x,$y); - parent::Point($xp,$yp); - } - - function StrokeText($x,$y,$txt,$dir=0,$paragraph_align="left",$debug=false) { - list($xp,$yp) = $this->Rotate($x,$y); - return parent::StrokeText($xp,$yp,$txt,$dir,$paragraph_align,$debug); - } -} - -//======================================================================= -// CLASS ImgStreamCache -// Description: Handle caching of graphs to files. All image output goes -// through this class -//======================================================================= -class ImgStreamCache { - private $cache_dir, $timeout=0; // Infinite timeout - //--------------- - // CONSTRUCTOR - function __construct($aCacheDir=CACHE_DIR) { - $this->cache_dir = $aCacheDir; - } - - //--------------- - // PUBLIC METHODS - - // Specify a timeout (in minutes) for the file. If the file is older then the - // timeout value it will be overwritten with a newer version. - // If timeout is set to 0 this is the same as infinite large timeout and if - // timeout is set to -1 this is the same as infinite small timeout - function SetTimeout($aTimeout) { - $this->timeout=$aTimeout; - } - - // Output image to browser and also write it to the cache - function PutAndStream($aImage,$aCacheFileName,$aInline,$aStrokeFileName) { - - // Check if we should always stroke the image to a file - if( _FORCE_IMGTOFILE ) { - $aStrokeFileName = _FORCE_IMGDIR.GenImgName(); - } - - if( $aStrokeFileName != '' ) { - - if( $aStrokeFileName == 'auto' ) { - $aStrokeFileName = GenImgName(); - } - - if( file_exists($aStrokeFileName) ) { - - // Wait for lock (to make sure no readers are trying to access the image) - $fd = fopen($aStrokeFileName,'w'); - $lock = flock($fd, LOCK_EX); - - // Since the image write routines only accepts a filename which must not - // exist we need to delete the old file first - if( !@unlink($aStrokeFileName) ) { - $lock = flock($fd, LOCK_UN); - JpGraphError::RaiseL(25111,$aStrokeFileName); - //(" Can't delete cached image $aStrokeFileName. Permission problem?"); - } - $aImage->Stream($aStrokeFileName); - $lock = flock($fd, LOCK_UN); - fclose($fd); - - } - else { - $aImage->Stream($aStrokeFileName); - } - - return; - } - - if( $aCacheFileName != '' && USE_CACHE) { - - $aCacheFileName = $this->cache_dir . $aCacheFileName; - if( file_exists($aCacheFileName) ) { - if( !$aInline ) { - // If we are generating image off-line (just writing to the cache) - // and the file exists and is still valid (no timeout) - // then do nothing, just return. - $diff=time()-filemtime($aCacheFileName); - if( $diff < 0 ) { - JpGraphError::RaiseL(25112,$aCacheFileName); - //(" Cached imagefile ($aCacheFileName) has file date in the future!!"); - } - if( $this->timeout>0 && ($diff <= $this->timeout*60) ) return; - } - - // Wait for lock (to make sure no readers are trying to access the image) - $fd = fopen($aCacheFileName,'w'); - $lock = flock($fd, LOCK_EX); - - if( !@unlink($aCacheFileName) ) { - $lock = flock($fd, LOCK_UN); - JpGraphError::RaiseL(25113,$aStrokeFileName); - //(" Can't delete cached image $aStrokeFileName. Permission problem?"); - } - $aImage->Stream($aCacheFileName); - $lock = flock($fd, LOCK_UN); - fclose($fd); - - } - else { - $this->MakeDirs(dirname($aCacheFileName)); - if( !is_writeable(dirname($aCacheFileName)) ) { - JpGraphError::RaiseL(25114,$aCacheFileName); - //('PHP has not enough permissions to write to the cache file '.$aCacheFileName.'. Please make sure that the user running PHP has write permission for this file if you wan to use the cache system with JpGraph.'); - } - $aImage->Stream($aCacheFileName); - } - - $res=true; - // Set group to specified - if( CACHE_FILE_GROUP != '' ) { - $res = @chgrp($aCacheFileName,CACHE_FILE_GROUP); - } - if( CACHE_FILE_MOD != '' ) { - $res = @chmod($aCacheFileName,CACHE_FILE_MOD); - } - if( !$res ) { - JpGraphError::RaiseL(25115,$aStrokeFileName); - //(" Can't set permission for cached image $aStrokeFileName. Permission problem?"); - } - - $aImage->Destroy(); - if( $aInline ) { - if ($fh = @fopen($aCacheFileName, "rb") ) { - $aImage->Headers(); - fpassthru($fh); - return; - } - else { - JpGraphError::RaiseL(25116,$aFile);//(" Cant open file from cache [$aFile]"); - } - } - } - elseif( $aInline ) { - $aImage->Headers(); - $aImage->Stream(); - return; - } - } - - function IsValid($aCacheFileName) { - $aCacheFileName = $this->cache_dir.$aCacheFileName; - if ( USE_CACHE && file_exists($aCacheFileName) ) { - $diff=time()-filemtime($aCacheFileName); - if( $this->timeout>0 && ($diff > $this->timeout*60) ) { - return false; - } - else { - return true; - } - } - else { - return false; - } - } - - function StreamImgFile($aImage,$aCacheFileName) { - $aCacheFileName = $this->cache_dir.$aCacheFileName; - if ( $fh = @fopen($aCacheFileName, 'rb') ) { - $lock = flock($fh, LOCK_SH); - $aImage->Headers(); - fpassthru($fh); - $lock = flock($fh, LOCK_UN); - fclose($fh); - return true; - } - else { - JpGraphError::RaiseL(25117,$aCacheFileName);//(" Can't open cached image \"$aCacheFileName\" for reading."); - } - } - - // Check if a given image is in cache and in that case - // pass it directly on to web browser. Return false if the - // image file doesn't exist or exists but is to old - function GetAndStream($aImage,$aCacheFileName) { - if( $this->Isvalid($aCacheFileName) ) { - $this->StreamImgFile($aImage,$aCacheFileName); - } - else { - return false; - } - } - - //--------------- - // PRIVATE METHODS - // Create all necessary directories in a path - function MakeDirs($aFile) { - $dirs = array(); - // In order to better work when open_basedir is enabled - // we do not create directories in the root path - while ( $aFile != '/' && !(file_exists($aFile)) ) { - $dirs[] = $aFile.'/'; - $aFile = dirname($aFile); - } - for ($i = sizeof($dirs)-1; $i>=0; $i--) { - if(! @mkdir($dirs[$i],0777) ) { - JpGraphError::RaiseL(25118,$aFile);//(" Can't create directory $aFile. Make sure PHP has write permission to this directory."); - } - // We also specify mode here after we have changed group. - // This is necessary if Apache user doesn't belong the - // default group and hence can't specify group permission - // in the previous mkdir() call - if( CACHE_FILE_GROUP != "" ) { - $res=true; - $res =@chgrp($dirs[$i],CACHE_FILE_GROUP); - $res = @chmod($dirs[$i],0777); - if( !$res ) { - JpGraphError::RaiseL(25119,$aFile);//(" Can't set permissions for $aFile. Permission problems?"); - } - } - } - return true; - } -} // CLASS Cache - -?> diff --git a/#jpgraph/src/imageSmoothArc.php b/#jpgraph/src/imageSmoothArc.php deleted file mode 100644 index a1d581ff..00000000 --- a/#jpgraph/src/imageSmoothArc.php +++ /dev/null @@ -1,344 +0,0 @@ -= abs($yStart)) { - $aaStartX = true; - } else { - $aaStartX = false; - } - if ($xStop >= $yStop) { - $aaStopX = true; - } else { - $aaStopX = false; - } - //$xp = +1; $yp = -1; $xa = +1; $ya = 0; - for ( $x = 0; $x < $a; $x += 1 ) { - /*$y = $b * sqrt( 1 - ($x*$x)/($a*$a) ); - - $error = $y - (int)($y); - $y = (int)($y); - - $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error );*/ - - $_y1 = $dyStop*$x; - $_y2 = $dyStart*$x; - if ($xStart > $xStop) - { - $error1 = $_y1 - (int)($_y1); - $error2 = 1 - $_y2 + (int)$_y2; - $_y1 = $_y1-$error1; - $_y2 = $_y2+$error2; - } - else - { - $error1 = 1 - $_y1 + (int)$_y1; - $error2 = $_y2 - (int)($_y2); - $_y1 = $_y1+$error1; - $_y2 = $_y2-$error2; - } - /* - if ($aaStopX) - $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); - if ($aaStartX) - $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); - */ - - if ($seg == 0 || $seg == 2) - { - $i = $seg; - if (!($start > $i*M_PI/2 && $x > $xStart)) { - if ($i == 0) { - $xp = +1; $yp = -1; $xa = +1; $ya = 0; - } else { - $xp = -1; $yp = +1; $xa = 0; $ya = +1; - } - if ( $stop < ($i+1)*(M_PI/2) && $x <= $xStop ) { - $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); - $y1 = $_y1; if ($aaStopX) imageSetPixel($img, $cx+$xp*($x)+$xa, $cy+$yp*($y1+1)+$ya, $diffColor1); - - } else { - $y = $b * sqrt( 1 - ($x*$x)/($a*$a) ); - $error = $y - (int)($y); - $y = (int)($y); - $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error ); - $y1 = $y; if ($x < $aaAngleX ) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y1+1)+$ya, $diffColor); - } - if ($start > $i*M_PI/2 && $x <= $xStart) { - $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); - $y2 = $_y2; if ($aaStartX) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y2-1)+$ya, $diffColor2); - } else { - $y2 = 0; - } - if ($y2 <= $y1) imageLine($img, $cx+$xp*$x+$xa, $cy+$yp*$y1+$ya , $cx+$xp*$x+$xa, $cy+$yp*$y2+$ya, $fillColor); - } - } - - if ($seg == 1 || $seg == 3) - { - $i = $seg; - if (!($stop < ($i+1)*M_PI/2 && $x > $xStop)) { - if ($i == 1) { - $xp = -1; $yp = -1; $xa = 0; $ya = 0; - } else { - $xp = +1; $yp = +1; $xa = 1; $ya = 1; - } - if ( $start > $i*M_PI/2 && $x < $xStart ) { - $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); - $y1 = $_y2; if ($aaStartX) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y1+1)+$ya, $diffColor2); - - } else { - $y = $b * sqrt( 1 - ($x*$x)/($a*$a) ); - $error = $y - (int)($y); - $y = (int) $y; - $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error ); - $y1 = $y; if ($x < $aaAngleX ) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y1+1)+$ya, $diffColor); - } - if ($stop < ($i+1)*M_PI/2 && $x <= $xStop) { - $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); - $y2 = $_y1; if ($aaStopX) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y2-1)+$ya, $diffColor1); - } else { - $y2 = 0; - } - if ($y2 <= $y1) imageLine($img, $cx+$xp*$x+$xa, $cy+$yp*$y1+$ya, $cx+$xp*$x+$xa, $cy+$yp*$y2+$ya, $fillColor); - } - } - } - - ///YYYYY - - for ( $y = 0; $y < $b; $y += 1 ) { - /*$x = $a * sqrt( 1 - ($y*$y)/($b*$b) ); - - $error = $x - (int)($x); - $x = (int)($x); - - $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error ); - */ - $_x1 = $dxStop*$y; - $_x2 = $dxStart*$y; - if ($yStart > $yStop) - { - $error1 = $_x1 - (int)($_x1); - $error2 = 1 - $_x2 + (int)$_x2; - $_x1 = $_x1-$error1; - $_x2 = $_x2+$error2; - } - else - { - $error1 = 1 - $_x1 + (int)$_x1; - $error2 = $_x2 - (int)($_x2); - $_x1 = $_x1+$error1; - $_x2 = $_x2-$error2; - } -/* - if (!$aaStopX) - $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); - if (!$aaStartX) - $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); -*/ - - if ($seg == 0 || $seg == 2) - { - $i = $seg; - if (!($start > $i*M_PI/2 && $y > $yStop)) { - if ($i == 0) { - $xp = +1; $yp = -1; $xa = 1; $ya = 0; - } else { - $xp = -1; $yp = +1; $xa = 0; $ya = 1; - } - if ( $stop < ($i+1)*(M_PI/2) && $y <= $yStop ) { - $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); - $x1 = $_x1; if (!$aaStopX) imageSetPixel($img, $cx+$xp*($x1-1)+$xa, $cy+$yp*($y)+$ya, $diffColor1); - } - if ($start > $i*M_PI/2 && $y < $yStart) { - $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); - $x2 = $_x2; if (!$aaStartX) imageSetPixel($img, $cx+$xp*($x2+1)+$xa, $cy+$yp*($y)+$ya, $diffColor2); - } else { - $x = $a * sqrt( 1 - ($y*$y)/($b*$b) ); - $error = $x - (int)($x); - $x = (int)($x); - $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error ); - $x1 = $x; if ($y < $aaAngleY && $y <= $yStop ) imageSetPixel($img, $cx+$xp*($x1+1)+$xa, $cy+$yp*$y+$ya, $diffColor); - } - } - } - - if ($seg == 1 || $seg == 3) - { - $i = $seg; - if (!($stop < ($i+1)*M_PI/2 && $y > $yStart)) { - if ($i == 1) { - $xp = -1; $yp = -1; $xa = 0; $ya = 0; - } else { - $xp = +1; $yp = +1; $xa = 1; $ya = 1; - } - if ( $start > $i*M_PI/2 && $y < $yStart ) { - $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); - $x1 = $_x2; if (!$aaStartX) imageSetPixel($img, $cx+$xp*($x1-1)+$xa, $cy+$yp*$y+$ya, $diffColor2); - } - if ($stop < ($i+1)*M_PI/2 && $y <= $yStop) { - $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); - $x2 = $_x1; if (!$aaStopX) imageSetPixel($img, $cx+$xp*($x2+1)+$xa, $cy+$yp*$y+$ya, $diffColor1); - } else { - $x = $a * sqrt( 1 - ($y*$y)/($b*$b) ); - $error = $x - (int)($x); - $x = (int)($x); - $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error ); - $x1 = $x; if ($y < $aaAngleY && $y < $yStart) imageSetPixel($img,$cx+$xp*($x1+1)+$xa, $cy+$yp*$y+$ya, $diffColor); - } - } - } - } -} - - -function imageSmoothArc ( &$img, $cx, $cy, $w, $h, $color, $start, $stop) -{ - // Originally written from scratch by Ulrich Mierendorff, 06/2006 - // Rewritten and improved, 04/2007, 07/2007 - // compared to old version: - // + Support for transparency added - // + Improved quality of edges & antialiasing - - // note: This function does not represent the fastest way to draw elliptical - // arcs. It was written without reading any papers on that subject. Better - // algorithms may be twice as fast or even more. - - // what it cannot do: It does not support outlined arcs, only filled - - // Parameters: - // $cx - Center of ellipse, X-coord - // $cy - Center of ellipse, Y-coord - // $w - Width of ellipse ($w >= 2) - // $h - Height of ellipse ($h >= 2 ) - // $color - Color of ellipse as a four component array with RGBA - // $start - Starting angle of the arc, no limited range! - // $stop - Stop angle of the arc, no limited range! - // $start _can_ be greater than $stop! - // If any value is not in the given range, results are undefined! - - // This script does not use any special algorithms, everything is completely - // written from scratch; see http://de.wikipedia.org/wiki/Ellipse for formulas. - - while ($start < 0) - $start += 2*M_PI; - while ($stop < 0) - $stop += 2*M_PI; - - while ($start > 2*M_PI) - $start -= 2*M_PI; - - while ($stop > 2*M_PI) - $stop -= 2*M_PI; - - - if ($start > $stop) - { - imageSmoothArc ( $img, $cx, $cy, $w, $h, $color, $start, 2*M_PI); - imageSmoothArc ( $img, $cx, $cy, $w, $h, $color, 0, $stop); - return; - } - - $a = 1.0*round ($w/2); - $b = 1.0*round ($h/2); - $cx = 1.0*round ($cx); - $cy = 1.0*round ($cy); - - $aaAngle = atan(($b*$b)/($a*$a)*tan(0.25*M_PI)); - $aaAngleX = $a*cos($aaAngle); - $aaAngleY = $b*sin($aaAngle); - - $a -= 0.5; // looks better... - $b -= 0.5; - - for ($i=0; $i<4;$i++) - { - if ($start < ($i+1)*M_PI/2) - { - if ($start > $i*M_PI/2) - { - if ($stop > ($i+1)*M_PI/2) - { - imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY , $color, $start, ($i+1)*M_PI/2, $i); - } - else - { - imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $start, $stop, $i); - break; - } - } - else - { - if ($stop > ($i+1)*M_PI/2) - { - imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $i*M_PI/2, ($i+1)*M_PI/2, $i); - } - else - { - imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $i*M_PI/2, $stop, $i); - break; - } - } - } - } -} -?> diff --git a/#jpgraph/src/imgdata_balls.inc.php b/#jpgraph/src/imgdata_balls.inc.php deleted file mode 100644 index ee5db492..00000000 --- a/#jpgraph/src/imgdata_balls.inc.php +++ /dev/null @@ -1,1061 +0,0 @@ - 'imgdata_large', - MARK_IMG_MBALL => 'imgdata_small', - MARK_IMG_SBALL => 'imgdata_xsmall', - MARK_IMG_BALL => 'imgdata_xsmall'); - protected $colors,$index,$maxidx; - private $colors_1 = array('blue','lightblue','brown','darkgreen', - 'green','purple','red','gray','yellow','silver','gray'); - private $index_1 = array('blue'=>9,'lightblue'=>1,'brown'=>6,'darkgreen'=>7, - 'green'=>8,'purple'=>4,'red'=>0,'gray'=>5,'silver'=>3,'yellow'=>2); - private $maxidx_1 = 9 ; - - private $colors_2 = array('blue','bluegreen','brown','cyan', - 'darkgray','greengray','gray','green', - 'greenblue','lightblue','lightred', - 'purple','red','white','yellow'); - - - private $index_2 = array('blue'=>9,'bluegreen'=>13,'brown'=>8,'cyan'=>12, - 'darkgray'=>5,'greengray'=>6,'gray'=>2,'green'=>10, - 'greenblue'=>3,'lightblue'=>1,'lightred'=>14, - 'purple'=>7,'red'=>0,'white'=>11,'yellow'=>4); - - private $maxidx_2 = 14 ; - - - private $colors_3 = array('bluegreen','cyan','darkgray','greengray', - 'gray','graypurple','green','greenblue','lightblue', - 'lightred','navy','orange','purple','red','yellow'); - - private $index_3 = array('bluegreen'=>1,'cyan'=>11,'darkgray'=>14,'greengray'=>10, - 'gray'=>3,'graypurple'=>4,'green'=>9,'greenblue'=>7, - 'lightblue'=>13,'lightred'=>0,'navy'=>2,'orange'=>12, - 'purple'=>8,'red'=>5,'yellow'=>6); - private $maxidx_3 = 14 ; - - protected $imgdata_large, $imgdata_small, $imgdata_xsmall ; - - - function GetImg($aMark,$aIdx) { - switch( $aMark ) { - case MARK_IMG_SBALL: - case MARK_IMG_BALL: - $this->colors = $this->colors_3; - $this->index = $this->index_3 ; - $this->maxidx = $this->maxidx_3 ; - break; - case MARK_IMG_MBALL: - $this->colors = $this->colors_2; - $this->index = $this->index_2 ; - $this->maxidx = $this->maxidx_2 ; - break; - default: - $this->colors = $this->colors_1; - $this->index = $this->index_1 ; - $this->maxidx = $this->maxidx_1 ; - break; - } - return parent::GetImg($aMark,$aIdx); - } - - function __construct() { - - //========================================================== - // File: bl_red.png - //========================================================== - $this->imgdata_large[0][0]= 1072 ; - $this->imgdata_large[0][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAByF'. - 'BMVEX/////////xsb/vb3/lIz/hIT/e3v/c3P/c2v/a2v/Y2P/'. - 'UlL/Skr/SkL/Qjn/MTH/MSn/KSn/ISH/IRj/GBj/GBD/EBD/EA'. - 'j/CAj/CAD/AAD3QkL3MTH3KSn3KSH3GBj3EBD3CAj3AAD1zMzv'. - 'QkLvISHvIRjvGBjvEBDvEAjvAADnUlLnSkrnMTnnKSnnIRjnGB'. - 'DnEBDnCAjnAADec3PeSkreISHeGBjeGBDeEAjWhITWa2vWUlLW'. - 'SkrWISnWGBjWEBDWEAjWCAjWAADOnp7Oa2vOGCHOGBjOGBDOEB'. - 'DOCAjOAADJrq7Gt7fGGBjGEBDGCAjGAADEpKS/v7+9QkK9GBC9'. - 'EBC9CAi9AAC1e3u1a2u1Skq1KSm1EBC1CAi1AACtEBCtCBCtCA'. - 'itAACngYGlCAilAACghIScOTmcCAicAACYgYGUGAiUCAiUAAiU'. - 'AACMKSmMEACMAACEa2uEGAiEAAB7GBh7CAB7AABzOTlzGBBzCA'. - 'BzAABrSkprOTlrGBhrAABjOTljAABaQkJaOTlaCABaAABSKSlS'. - 'GBhSAABKKSlKGBhKAABCGBhCCABCAAA5CAA5AAAxCAAxAAApCA'. - 'ApAAAhAAAYAACc9eRyAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. - 'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkRFD'. - 'UHLytKAAAB4UlEQVR4nGNgIAK4mGjrmNq6BmFIWMmISUpKSmk5'. - 'B8ZEokj4qoiLiQCBgqald3xaBpKMj6y4sLCQkJCIvIaFV0RaUR'. - 'lCSk5cWEiAn19ASN7QwisuraihHiajKyEixM/NwckjoKrvEACU'. - 'qumpg7pAUlREiJdNmZmLT9/cMzwps7Smc3I2WEpGUkxYkJuFiY'. - 'lTxszePzY1v7Shc2oX2D+K4iLCgjzsrOw8embuYUmZeTVtPVOn'. - 'gqSslYAOF+Ln4ZHWtXMPTcjMrWno7J82rRgoZWOsqaCgrqaqqm'. - 'fn5peQmlsK1DR52vRaoFSIs5GRoYG5ub27n19CYm5pdVPnxKnT'. - 'pjWDpLydnZwcHTz8QxMSEnJLgDL9U6dNnQ6Sio4PDAgICA+PTU'. - 'zNzSkph8hADIxKS46Pj0tKTc3MLSksqWrtmQySAjuDIT8rKy0r'. - 'Kz+vtLSmur6jb9JUIJgGdjxDQUVRUVFpaUVNQ1NrZ9+kKVOmTZ'. - 'k6vR0sldJUAwQNTU2dnX0TgOJTQLrSIYFY2dPW1NbW2TNxwtQp'. - 'U6ZMmjJt2rRGWNB3TO7vnzh5MsgSoB6gy7sREdY7bRrQEDAGOb'. - 'wXOQW0TJsOEpwClmxBTTbZ7UDVIPkp7dkYaYqhuLa5trYYUxwL'. - 'AADzm6uekAAcXAAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bl_bluegreen.png - //========================================================== - $this->imgdata_large[1][0]= 1368 ; - $this->imgdata_large[1][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. - 'B3RJTUUH0wMMFi8hE9b2uAAABOVJREFUeNq9lk2sJFUVx3+3qv'. - 'tW95t57zFvhiFxmCFRUJRoNCQiJARMhiFx/Igxii5goTG6ZDAu'. - '/EhcSCIrTAgLEiKsJ8ywABNZEMJXEDYCukAmjgjzBkK/j35V1d'. - '333FtV97io97pfzwxfG86qcu/N+Z3zP+fcW/Apmfk4hx57+R/6'. - 'Rqmc9ykhsWjlsUngAA1fXIQ7b73pI/186IGHnn9dH/8frC8v4I'. - 'PiG53uaerR4GmKkv31mB8cyfjd946ZTwR66qVX9OTWIi8UKUv9'. - 'BOrZXpYZvFeiBvzI0fgSUSFKwbVG+Pl1V3HH0VvNR4KeeukV/f'. - 'PmMmdHhst76aXD64AbeVQ9bjNHaiGOC2o3wLrAb2/4LL/84ffn'. - 'fCdzkOdayKpLppBemrBsU5Y1Zdmm9LJdGU6E/t4M24Q26jRDRL'. - 'j3mdc49cSTekFsMzs5XuTsyLDUNSDQ25NwKOly9YIl22MYhJr/'. - 'uoDtBBoT0CxBRGYOAhibIaOCe//2MpfM6KHnX9cXipSlbkKWmS'. - 'nk9iv38J0jixw7vJfrTMYBOvhSoQHJBS09ANELloAGDxW8tfoW'. - 'J+5/UC8CPS0LU7r3SpYarr7M8rmFjMPLXT6/33L4si7Z2GCrQC'. - '+0ctlOaNs9DReV8vSLr85ndPLpZ/WNvHW+01kAVFBOGvJx0wYg'. - 'Sp47RIQ4Emwa8FGJXlDxSCFo5YlVgAo2hwPue/hRndboTV3EW2'. - 'Wp3k6wBp8q56QiWzecW6vwQfnPRkAWhFgILnq08jQ+R2nlUzzN'. - 'uES9Q7Vd+9fba7NmWJW61db2247qACmcjxXr45psYphsFGSLBu'. - 'kIajxqtjNwHkvAjQt0sg3crhPA2+fPz0CuyNFOghsGsr19mnFg'. - 'DGwrRm8UoAtNmQPQtRXDgdC4HImCFEKcCE0oieUWUYq2LtbiGp'. - 'mBQmppfIkjw45DK0QNNkvQ0jMBtPL0UnDRM1rN+cxKwzvOo2NP'. - 'tykR9a1kfpZNDLMG6QDYJqCTBvUe1+uxs+YKyPoGrTwY2HhvC4'. - 'CDWQd5d4xNApNQEEMgjgLdUCLBQ5cprL/trwNwKG2IUmDqDFd5'. - 'sr5BWrlxuSdLDFEFlqAzXGc4zFjupqh6uqYihpxJcEgp026l2w'. - '7wFUv7Z6AvrfRo/n0OYzPwIKE3HUKAJg2otMBiElnsF7wngis9'. - '3ZDjNnLi7huCWUZfueZKTu/M0V3HvmkOFDVxVKDG04ScejSgW5'. - 'V0q5JYFEghuDLHlTmToqDeGOCKIVtrW9hsdmXufEcNLPSXuPHa'. - 'a+bvuh9df5AH/v5PDFmbWQC3Mx+TVvfGVTRB2CodNgT2JBX003'. - 'aANZAYS/BxCv32TV/l2C03G7jgmfjGiT/qmeEmibEYm7XzAO2k'. - 'A+pbgHhBgydqu54YO5eRiLCy7yDvPP6Xqf+5Z+Lu277OYuOpiw'. - 'H15oBmlNOMcmK5RbP+PrEscGU+DSAxdg4CICIkxnLP8aNz63Og'. - 'H3/rdvOb795GVhuaYo0oBc3GGrEsUPVTwO6a7LYd+X51x3Hu/t'. - 'lP5tS65FN+6okn9U+n/sqb596dTvhOF+02myXTmkQNrOw7yD3H'. - 'j14E+UDQjp24/0E9/eKrbA4HH3aMK1b2ccvXvswjv//1J/s5ud'. - 'Due/hRPfP+OmfOrk7vrn7a48ihA3zh8CH+8Iuffiw/n4r9H1ZZ'. - '0zz7G56hAAAAAElFTkSuQmCC' ; - - //========================================================== - // File: bl_yellow.png - //========================================================== - $this->imgdata_large[2][0]= 1101 ; - $this->imgdata_large[2][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAB2l'. - 'BMVEX//////////+///+f//9b//8b//73//7X//63//6X//5T/'. - '/4z//4T//3P//2v//1r//0r//0L//zH//yn//yH//xj//xD//w'. - 'j//wD/90L/9zn/9zH/9xj/9xD/9wj/9wD39yn37zn37zH37yH3'. - '7xD37wj37wDv70Lv50rv50Lv5znv5yHv5xjv5wjv5wDn51Ln5x'. - 'Dn3jHn3iHn3hjn3hDn3gje3oze3nPe3lLe1oze1nPe1lLe1ine'. - '1iHe1hje1hDe1gje1gDW1qXW1mvWzqXWzkLWzhjWzhDWzgjWzg'. - 'DOzrXOzq3OzpzOzgDOxkrOxinOxhjOxhDOxgjOxgDGxqXGxnvG'. - 'xmvGvRjGvRDGvQjGvQDFxbnAvr6/v7+9vaW9vZS9vQi9vQC9tR'. - 'C9tQi9tQC7u7W1tZS1tXu1tTG1tQi1rRC1rQi1rQCtrYytrSGt'. - 'rQitrQCtpYStpSGtpQitpQClpYSlpXulpQClnBClnAilnACcnG'. - 'ucnAicnACclAiclACUlFqUlCmUlAiUlACUjFKUjAiUjACMjFKM'. - 'jEqMjACMhACEhACEewB7ezF7exB7ewB7cwBzcylzcwBzaxBzaw'. - 'BraxhrawhrawBrYxBrYwBjYwBjWgBaWgBaUgCXBwRMAAAAAXRS'. - 'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'. - 'LdfvwAAAAHdElNRQfTAwkRFBKiJZ4hAAAB7ElEQVR4nI3S+1vS'. - 'UBgHcB67WJmIMWAVdDHEDLBC6Go0slj3Ft0m9RRBWQEmFZFDEM'. - 'Qgt0EMFBY7p/+198hj1kM/9N1+++x73rOd6XT/kStnTx4fPzd9'. - 'uwfOjFhomj7smAhwj/6Cm2O0xUwy6g7cCL99uCW3jtBmE7lsdr'. - 'fvejgpzP7uEDFRRoqy2k8xQPnypo2BUMP6waF9Vpf3ciiSzErL'. - 'XTkPc0zDe3bsHDAcc00yoVgqL3UWN2iENpspff+2vn6D0+NnZ9'. - '6lC5K6RuSqBTZn1O/a3rd7v/MSez+WyIpVFX8GuuCA9SjD4N6B'. - 'oRNTfo5PCAVR0fBXoIuOQzab1XjwwNHx00GOj8/nKtV1DdeArk'. - '24R+0ul9PjmbrHPYl+EipyU0OoQSjg8/m83kl/MMhx0fjCkqio'. - 'SMOE7t4JMAzDsizH81AqSdW2hroLPg4/CEF4PhKNx98vlevrbY'. - 'QQXgV6kXwVfjkTiSXmhYVcSa7DIE1DOENe7GM6lUym0l+EXKks'. - 'K20VAeH2M0JvVgrZfL5Qqkiy0lRVaMBd7H7EZUmsiJJcrTdVja'. - 'wGpdbTLj3/3qwrUOjAfGgg4LnNA5tdQx14Hm00QFBm65hfNzAm'. - '+yIFhFtzuj+z2MI/MQn6Uez5pz4Ua41G7VumB/6RX4zMr1TKBr'. - 'SXAAAAAElFTkSuQmCC' ; - - //========================================================== - // File: bl_silver.png - //========================================================== - $this->imgdata_large[3][0]= 1481 ; - $this->imgdata_large[3][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAADAF'. - 'BMVEUAAADOzs7Gxsa9vb21tbXOxsbOzsbGzsb3///O1ta1vb2c'. - 'paVSWlpKWlpSY2ve5+97hIze7/9aY2vO5/9zhJRaa3tSY3PGzt'. - 'aMlJxrc3tja3NKUlpCSlK1vcZze4RSWmPW5/+Upb3G3v9zhJxS'. - 'Y3t7jKVaa4TO3veltc6ElK1re5Rjc4ycpbV7hJRaY3M5QlLn7/'. - '/Gzt6lrb2EjJzO3v9ja3vG1ve9zu+1xueltdacrc6UpcaMnL1C'. - 'SlqElLV7jK1zhKVre5zW3u/O1ue1vc6ttcaMlKVze4xrc4RSWm'. - 'tKUmPG1v+9zve1xu+tveeltd6crdbe5/+9xt6cpb17hJxaY3s5'. - 'QlrW3vfO1u/Gzue1vdattc6lrcaUnLWMlK2EjKVze5Rrc4xja4'. - 'RSWnNKUmtCSmO9xuecpcZ7hKVaY4TW3v/O1vfGzu+1vd6ttdal'. - 'rc69xu+UnL2MlLWEjK1ze5xrc5R7hK1ja4zO1v+1veettd6lrd'. - 'aMlL3Gzv/39//W1t7Gxs61tb29vcatrbWlpa2cnKWUlJyEhIx7'. - 'e4TW1ufGxta1tcZSUlqcnK3W1u+UlKW9vda1tc57e4ytrcalpb'. - '1ra3vOzu9jY3OUlK29vd6MjKWEhJxaWmtSUmNzc4xKSlpjY3tK'. - 'SmNCQlqUjJzOxs7///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. - 'AAAAAAAAAAAAAAAAAAAAAAAAD///9fnkWVAAAAAnRSTlP/AOW3'. - 'MEoAAAABYktHRP+lB/LFAAAACXBIWXMAAABFAAAARQBP+QatAA'. - 'AB/klEQVR42mNgxAsYqCdd3+lcb4hLmj8wMMvEu8DCMqYbU9op'. - 'UEFB2MTb26eyysomFl06XEEhUCHLpAKo2z/fujikEUVaXUFBMB'. - 'BouLePuV+VVWGRciIXknSEsImCQd3//xwmPr65llaFcSFJHkjS'. - '3iYmWUDZ//8NfCr989NjNUMSUyTg0jneSiaCINn/gmlVQM12qg'. - 'lJnp5waTMTE5NAkCyHWZW/lXWNfUlikmdYK0zax7siS4EDKJtd'. - 'mQeU1XRwLBdLkRGASucWmGVnZ4dnhZvn5lmm29iVOWpnJqcuko'. - 'JKR1Wm5eTkRKYF5eblp9sU2ZeUJiV7zbfVg0pH56UFBQXNjIqK'. - 'jgkujItX1koKTVmYajsdKu2qETVhwgSXiUDZ2Bn9xqUeoZ5e0t'. - 'LzYYZ3B092ndjtOnmKTmycW1s7SHa+l5dtB8zlccE6RlN0dGbM'. - 'mDVbd5KupNBcL6+F82XgHouLj5vRP2PWLGNdd4+ppnxe8tJec6'. - 'XnNsKkm0uVQ5RDRHQTPTym68nPlZbvkfYCexsa5rpJ2qXa5Umm'. - 'ocmec3m8vHjmSs+fgxyhC5JDQ8WSPT2lvbzm8vDIe0nbtiBLN8'. - '8BigNdu1B6Lsje+fPbUFMLi5TMfGmvHi/puUAv23q2YCTFNqH5'. - 'MvPnSwPh3HasCbm3XUpv+nS5VtrkEkwAANSTpGHdye9PAAAASn'. - 'RFWHRzaWduYXR1cmUANGJkODkyYmE4MWZhNTk4MTIyNDJjNjUx'. - 'NzZhY2UxMDAzOGFhZjdhZWIyNzliNTM2ZGFmZDlkM2RiNDU3Zm'. - 'NlNT9CliMAAAAASUVORK5CYII=' ; - - //========================================================== - // File: bl_purple.png - //========================================================== - $this->imgdata_large[4][0]= 1149 ; - $this->imgdata_large[4][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAACAV'. - 'BMVEX/////////7///5///1v//xv//rf//pf//lP//jP//hP//'. - 'c///a///Wv//Wvf/Uv//Sv//Qv//Qvf/Off/Mf//Kf//If//If'. - 'f/GP//GPf/EP//EPf/CP//CPf/CO//AP//APf3Oe/3Kff3Ke/3'. - 'Ie/3GO/3EO/3AO/vSu/vSufvOefvMefvIefvGOfvEOfvCOfvAO'. - 'fnUufnSufnMd7nId7nGN7nGNbnEN7nCN7nAN7ejN7ejNbec97e'. - 'c9beUtbeQtbeIdbeGNbeENbeCNbeANbWpdbWa9bWQs7WGM7WEM'. - '7WCM7WAM7Otc7Orc7OnM7OSsbOIb3OGMbOEMbOCMbOAM7OAMbG'. - 'pcbGnMbGe8bGa8bGKbXGEL3GCL3GAL3FucXBu73AvsC/v7+9pb'. - '29Ka29GLW9ELW9CLW9AL29ALW5rrm1lLW1e7W1MbW1GKW1EK21'. - 'CLW1CK21AK2tjK2thKWtMaWtIaWtGJytCK2tCKWtAK2tAKWlhK'. - 'Wle6WlEJylCJylAKWlAJyca5ycGJScEJScCJScAJycAJSUWpSU'. - 'UoyUKZSUEIyUCIyUAJSUAIyMUoyMSoyMIYSMEISMCISMAIyMAI'. - 'SECHuEAISEAHt7MXt7EHt7CHt7AHt7AHNzKXNzEGtzAHNzAGtr'. - 'GGtrEGNrCGtrAGtrAGNjCFpjAGNjAFpaAFpaAFIpZn4bAAAAAX'. - 'RSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsS'. - 'AdLdfvwAAAAHdElNRQfTAwkRFB0ymoOwAAAB9UlEQVR4nGNgIA'. - 'K42hhqGtm5+WFIWClKycvLK6gbuARGoEj4aMjLSElISUir6Tt7'. - 'x+aEIWR8leQlwEBSTc/CK7awLguuR0lGQkJMVFRUTFJVzwko1d'. - 'oFk9OQl5IQE+Dh5hVR0TV3CkkvbJgyASJjDZIR5GBl5eRX0TH1'. - 'DEqrbJ2ypBEspSgvJSXKw8bMxMavbOLoGZNf1TZlybw4oIyfLN'. - 'BxotxsLEzsQiaOHkFpBQ2905esrAZK2SpIAaUEuDm5+LTNPAKj'. - 'C+pbps1evrIDKGWnLictKSkuLKyoZQyUya9o7Z2+YMXKGUApew'. - 'M9PTVdXR0TEwf3wOjUirruafOXL18xFyjl72Kpb25qaurg4REU'. - 'EFVe2zJ5zpLlK1aCpbydnZ2dnDwDA6NTopLLeiZNXbB8BcTAyP'. - 'TQ0JDg4KCY1NS83JKmiVOBepYvX9UPlAovzEiPSU/LLyior2vq'. - 'mjZr3vLlIF01IC+XVhUWFlZW1Lc290ycOGfxohVATSsXx4Oksn'. - 'vaWlsb2tq6J0+bM2/RohVA81asbIcEYueU3t7JU6ZNnwNyGkhm'. - '+cp5CRCppJnzZ8+ZM3/JUogECBbBIixr8Yqly8FCy8F6ltUgoj'. - 'lz7sqVK2ByK+cVMSCDxoUrwWDVysXt8WhJKqG4Y8bcuTP6qrGk'. - 'QwwAABiMu7T4HMi4AAAAAElFTkSuQmCC' ; - - //========================================================== - // File: bl_gray.png - //========================================================== - $this->imgdata_large[5][0]= 905 ; - $this->imgdata_large[5][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAABO1'. - 'BMVEX////////3///39/fv7+/e5+fW3t7Wzs7WxsbG1tbGzsbG'. - 'xsbDxMS/v7++wMC+v7+9zsa9xsa9vb29tbW9ra29pa24uLi1xs'. - 'a1vb21tbWxtrattbWmpqalra2cra2cpaWcnJycjIyUpaWUnJyU'. - 'lJSUjIyMnJyMnJSMlJSMlIyMjJSMjIyElJSElIyEjIyEhIR7jI'. - 'x7hIR7hHt7e3t7e3N7e2tzhIRze3tze3Nzc3Nre3trc3Nrc2tr'. - 'a2tjc3Njc2tja3Nja2tjY2NjWlpaa2taY2taY2NaY1paWlpaUl'. - 'JSY2NSY1pSWlpSWlJSUlJSUkpKWlpKWlJKUlpKUlJKUkpKSkpK'. - 'SkJCUlJCUkJCSkpCSkJCQkI5Sko5QkI5Qjk5OUI5OTkxQkIxOT'. - 'kxMTkxMTEpMTEhMTEhKSkYISEpy7AFAAAAAXRSTlMAQObYZgAA'. - 'AAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdE'. - 'lNRQfTAwkRFQfW40uLAAABx0lEQVR4nI3SbXfSMBQA4NV3nce5'. - 'TecAHUywRMHSgFuBCFsQUqwBS1OsWQh0GTj//y8wZUzdwQ/efM'. - 'tzcm/uuXdj4z9ic/PR9k4qk1qDnf0X2/uZzKt8GaRvSubg4LVp'. - 'mkWzCGAT/i3Zsm2XNQHLsm2n2937LaaNnGoJFAEo27B50qN0ay'. - 'Wg26lXsw8fP8nmzcJb2CbsnF5JmmCE8ncN404KvLfsYwd7/MdV'. - 'Pdgl/VbKMIzbuwVgVZw2JlSKJTVJ3609vWUY957lgAUd1KNcqr'. - 'yWnOcOPn8q7d5/8PywAqsOOiVDrn42NFk+HQ7dVuXNYeFdBTpN'. - 'nY5JdZl8xI5Y+HXYaTVqEDp1hAnRohZM03EUjMdhn5wghOoNnD'. - 'wSK7KiiDPqEtz+iD4ctdyAifNYzUnScBSxwPd6GLfRURW7Ay5i'. - 'pS5bmrY8348C5vvUI+TLiIVSJrVA0heK/GDkJxYMRoyfCSmk4s'. - 'uWc3yic/oBo4yF374LGQs5Xw0GyQljI8bYmEsxVUoKxa6HMpAT'. - 'vgyhU2mR8uU1pXmsa8ezqb6U4mwWF/5MeY8uLtQ0nmmQ8UWYvb'. - 'EcJaYWar7QhztrO5Wr4Q4hDbAG/4hfTAF2iCiWrCEAAAAASUVO'. - 'RK5CYII=' ; - - //========================================================== - // File: bl_brown.png - //========================================================== - $this->imgdata_large[6][0]= 1053 ; - $this->imgdata_large[6][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAABoV'. - 'BMVEX////Gzs7GvbXGrZTGpXu9nHO1nHO1nIy9taXGxs7GtaXO'. - 'nHPGlFrGjEq9hEq1hEqte0Klczmcazmce1KtnIzGxsbGvb3OlF'. - 'LOlFq9hFKte0qcc0KUYzGEWimMc1K9ta3OnGvOnGPWnGO9jFq9'. - 'jFKlc0KUazmMYzl7UilzUjGtpZzGxr3GnGPWpWvepXO1hFJ7Wj'. - 'FrSiFjUjG1ra3GnHPvxpT/5733zpythFKUa0KEYzlzUilaOSF7'. - 'Wjm9jErvvYz/99b///f/78bnrYS1hFqle0p7UjFrSiljQiFCMR'. - 'iMhHO9lGvGjFLWnGv/3q3////erXuthEqlc0paQiFKMRhSQin/'. - '1qX/997//++cc0pjSilaQilKORhCKRiclIy9pYzGlGPntYT33q'. - '3vvZSEWjlSOSE5KRB7c2O1lHutczmthFqte1JrWkqtjGtCKRBa'. - 'SjmljGuca0KMYzGMaznOztaclISUYzmEWjFKOSF7a1qEYzFaSi'. - 'GUjISEa0pKOSm9vb2llIxaQhg5IQiEc2tzY0paORilnJy1raVS'. - 'OSljUkJjWkKTpvQWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHU'. - 'gAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkREiei'. - 'zP2EAAAB9UlEQVR4nGWS/VfSUBjHL5QluhhBxtwyWcCus5Blpm'. - 'wDC4ONaWXCyBi7RMZmpQ2Bypm9W/byV3cHHo/W88s95/s5z/d5'. - 'uwCcCh/4L3zAf+bs0NC588On9QAYGSUuBINk6GI4cmnsBLk8Go'. - '1SFEGMkzRzZeLq5JE8FvDHouw1lqXiCZJOcnCKnx4AcP0GBqmZ'. - 'mRgRT9MMB4Wbs7cGSXNRik3dnp9fiMUzNCNKgpzN9bsaWaQo9s'. - '7dfH7pXiFTZCBU1JK27LmtBO8TDx7mV1eXHqXXyiIUFLWiVzHx'. - 'BxcJIvV4/cn6wkqmWOOwmVE3UQOAp6HxRKL5bGPj+VwhUhalFq'. - '8alm5vAt+LlySZTsebzcKrraIIW4JqZC3N3ga+1+EQTZKZta1M'. - 'pCZCSeDViqVrThsEdsLJZLJYLpZrHVGScrKBvTQNtQHY6XIM02'. - 'E6Ik7odRW1Dzy3N28n3kGuB3tQagm7UMBFXI/sATAs7L5vdbEs'. - '8Lycm923NB0j5wMe6KOsKIIyxcuqauxbrmlqyEWfPmPy5assY1'. - 'U1SvWKZWom9nK/HfQ3+v2HYZSMStayTNN0PYKqg11P1nWsWq7u'. - '4gJeY8g9PLrddNXRdW8Iryv86I3ja/9s26gvukhDdvUQnIjlKr'. - 'IdZCNH+3Xw779qbG63f//ZOzb6C4+ofdbzERrSAAAAAElFTkSu'. - 'QmCC' ; - - //========================================================== - // File: bl_darkgreen.png - //========================================================== - $this->imgdata_large[7][0]= 1113 ; - $this->imgdata_large[7][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAB2l'. - 'BMVEX////////3///v///n/+/e99bW/+/W99bO786/v7++vr69'. - '/96999a7wb24vbu1/9a1zqW1u7itxrWosq6l772l1qWlxrWlxq'. - '2lva2cxpSU562U3q2UxqWUvaWUpZyM77WM57WMvYyMtZyMrZyM'. - 'pZSMnJSEvZyEtYyErZSElIx7zpR7xpx7xpR7vZR7jIRz1pRzxp'. - 'RzjIRrzpRrzoxrxoxrtYRrrYxrrXtrpYRrhHNjzoxjxoxjxoRj'. - 'vYRjtYRjrXtjpXtjlGNje2tazoxazoRaxoxaxoRavYRatYRatX'. - 'tarXtapXNanHNajFpae2tSzoRSxoRSvXtStXtSrXtSrXNSpXNS'. - 'nHNSnGtSlGtSlGNSjGtSjGNKvXtKtXNKrXNKpWtKnGtKlGNKjG'. - 'NKhGNKhFJKc1pKa1JCrWtCpWtCnGtClGNCjGNCjFpChFpCe1JC'. - 'a1JCY1I5pWs5nGM5lGM5jFo5hFo5e1o5c0o5WkoxjFoxhFoxhF'. - 'Ixe1Ixc1Ixc0oxa0ophFIpe0opc0opa0opa0IpY0IpWkIpWjkp'. - 'UkIpUjkhc0oha0IhY0IhWjkhWjEhUjkhUjEhSjEhSikhQjEhQi'. - 'kYWjkYSjEYSikYQjEYQikQSikQQikQQiEQOSExf8saAAAAAXRS'. - 'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'. - 'LdfvwAAAAHdElNRQfTAwkRFCaDkWqUAAAB+ElEQVR4nI3S+1vS'. - 'UBgHcGZlPV0ks/vFrmQWFimJjiwiYUJWjFBWFhClyZCy5hLrwA'. - 'x2EIwJC1w7zf2vnU0re+iHvs9++7x7zznvORbLf+TA6ct9fYMX'. - 'jrfAUYefpp+/iM1ykxf/lmuhUZ/PTwXC8dml5Wcd23o5H5Mk6b'. - '5NUU8icXbhS67rNzn9JDnguOEYGQtEEtwC+Crs3RJ76P5A/znr'. - 'vsNX7wQnEiwHCtK7TTkW8rvdZ9uJtvZTLkxpHhSrP66bNEj7/P'. - '3WNoLYeeSWQQCIpe9lQw7RNEU5rDsIYtcJ14Nocg7kRUlBNkxn'. - 'YmGKcp7cv3vPwR7XOJPmc0VYU3Sv0e9NOBAYG7Hbz/cMjTMveZ'. - 'CHkqxuTBv0PhYJB4N3XR6PJ5rMAPMnpGUxDX1IxSeMTEaZp1OZ'. - 'nGAIQiYtsalUIhFlmGTy3sO3AizJCKn6DKYryxzHsWyaneMzr6'. - 'cWxRVZVlFTe4SpE3zm+U/4+whyiwJcWVMQNr3XONirVWAklxcE'. - 'EdbqchPhjhVzGpeqhUKhWBQhLElr9fo3pDaQPrw5xOl1CGG1JE'. - 'k1uYEBIVkrb02+o6RItfq6rBhbw/tuINT96766KhuqYpY3UFPF'. - 'BbY/19yZ1XF1U0UNBa9T7rZsz80K0jWk6bpWGW55UzbvTHZ+3t'. - 'vbAv/IT+K1uCmhIrKJAAAAAElFTkSuQmCC' ; - - //========================================================== - // File: bl_green.png - //========================================================== - $this->imgdata_large[8][0]= 1484 ; - $this->imgdata_large[8][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. - 'B3RJTUUH0wMMFjM4kcoDJQAABVlJREFUeNq9ll2MJFUVx3/11V'. - 'Vd/TE9vU0v4zLDwJIF16jBqLAPhsRXEiDqg0QTJiQSjcSNvCzw'. - 'sBEDDxizhvAAxBgf1oR9QF9NiE9ESFZkQyZB5WtddmdnZ3qqqr'. - 'uqbt367Cofqu3ZZpWVaDzJfbkf53//55z/PVdZXV3l/2H6f7Lp'. - '5VdOV/4Nb+GmHpUeA7AdBNxc3kafNb73jRPK9Xwon8ToxVefqU'. - 'b91wibH5EkCQBCizFihTSviHUHR0hWws9xe3wvJ7/7nPKpgX5y'. - '9oFqt3eOgWniRBoAbUBGGqZUibSYaeoT2B5bnkdaSA6793Cv/S'. - 'QPPbihXBfo5VdOV+8dfgnvwAU62YH5fCZ12sDujFkwyegCqTrB'. - 'iUOKTOJKj8jr88jS8zy6cXwBTP048nuHX0I0nDlIp7RpTG7kM0'. - 'sdyAYsTVukUuWGhlWHMq0ITL92lnUp9R1Obz/GmTNnqn9bDD8/'. - '+0D1oX0O0zQZZDYCsK2j3Gl9jQqDfHiei8GfiKVLlsZkJaBAN1'. - '0i6PgwUbB0GxG5/PrtE/xLRr959Znqw9452oVNI+jiJhnr1pe4'. - 'k29zB1/nFr5Kj7tpt1YYhJ0FJ7nUYbcJQBgahN2MzeCP/OipR6'. - 'prgN6Qr6ELFQFUWoRpNVjlKwxZB8DCpE+PtfEKqV1cUzxpVudu'. - 'GTBHA5Y1g99e+dUio9O/P1Vpq+/WE5GGjDSMoAtAQjrf3C52IP'. - 'QxpY4WK2hpReka9Gfrhqgz0bACRoCWjDh56kQ1z9FeuUUQxVhK'. - 'B92sD1VahM+bAJgcoJhGjP/6Ln8rAgDiRCVRKiIzxMkkodBJ85'. - 'im1IlEHbE4k1xyNveL4YP8HarmGJIOpqyjeQmfNHmTvnqZTWBt'. - 'vIJXpPwlukJSuSTKGK3pEwtJmiX00ZlInTyNscImO6XBITvH1c'. - '8vVt2OucdKvIyeKRTNCivsEMgcpg6taYs30nfq0Gqg6hOSSFJ4'. - 'BSnJPht0IqEjWmOGocEI6F0J94F0qaL6BntTF0MtUfweKQKAPU'. - 'Wwp4OcVnQAmVb0p9DLOzjEhEKnGRmoRc7EzRGlwA6NujAKG4yP'. - '6Sjwc4aVznZ7DK0xXdkDoJf0kGmFBniFBOBGcZSCCSKd0IwN0k'. - 'IS+QZWCGVZex4BnUxya3+Zt9iugQbcRFpIAtuHvAZulPUdLhUJ'. - 'RqegI3WcqaSXddlT3idsWMSRRGkEtNwmyTifAwyBo7LP+11J0e'. - '7tM7pZOYblHkBLcqZ5LcYtw6Wbd4CM3SpE9foYZsIHoqDKCrbz'. - 'mLSQtPwmuhXgtBLs0GBdbXOhFGB7WBKO2F8GXt9/VO97Ya3atF'. - '7nUHnwGjGGQqcPxFEdFqURkEidiZszAERoYIsGju1hq21kWee3'. - 'bw15+8WpsvAy3K1+i3JkkhZyPpxxjjPOsfOYiZ+TFhLPzQnHOU'. - 'tpzGB2dgA4tscIkKIx19Cxg/fPL7vQJu47eXt1VvsDK8pwPueZ'. - 'PuZoQMOqhRoJHSs0kKLBWjvjYinmeQGw1TaX1RFdfZ3LMzYLjA'. - 'C++dkn6AaH2Nobk6cxEzdnuG0TdC8zvdJkN0hqkFkO/jwL0fxa'. - 'so8sBcuFzQ+/+MRC+BeAHnpwQzn++ee5KT9Eshuy46dcKAXm32'. - '0uzPQhS4GttkH2GQID2Wc0Y4LtAbDxhZ/x5A+e/uTG9+jGceXH'. - '9/ySnnIXnUzOxXe1038mW3ZynNmam4yYWkO+f9cv+Oljz16/lV'. - '9tDz/9nerc1hm8ZEScSRK7VvtYl1i1dklsOKyvc+zg/bzw1O8+'. - '/efkajt56kR1ydlEJBc5H46xzbrJ3dY9wrB7hGcff+6/+279L+'. - '0fHxyiE8XMLl4AAAAASUVORK5CYII=' ; - - //========================================================== - // File: bl_blue.png - //========================================================== - $this->imgdata_large[9][0]= 1169 ; - $this->imgdata_large[9][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAACEF'. - 'BMVEX/////////7//35//v1v/exv/Wvf/Wrf/Wpf/Orf+/v7+9'. - 'tc69jP+9hP+5ucW1tc6tlP+rq7Wlpdalpcalpb2cnM6cnMacc/'. - '+cWv+UlLWUjN6UjK2Uc/+Ma/+MUv+EhKWEa/+EQvd7e8Z7e7V7'. - 'e6V7c957Wv9za9Zza8ZzSv9ra5xrSv9rOf9rMe9jUudjQv9jOe'. - '9aWpRaUt5aUpRaSu9aSudSUoxSSs5SSoxSMf9KQtZKOfdKMedK'. - 'Kf9KKe9CKf9CKb1CKa1CIfdCIedCId45MXs5Kfc5If85Iec5Id'. - 'Y5GP8xMbUxMXsxKc4xKZQxIf8xGP8xGO8xGN4xGNYxGL0xGK0p'. - 'KXMpIYwpGP8pGO8pGOcpGNYpGM4pEP8pEPcpEOcpEN4pENYpEM'. - 'YpEL0hGKUhEP8hEPchEO8hEOchEN4hENYhEM4hEMYhELUhCP8h'. - 'CO8hCN4YGJwYGGsYEL0YEK0YEHMYCN4YCM4YCMYYCL0YCKUYAP'. - '8QEJQQEIwQEHsQEGsQCM4QCLUQCK0QCKUQCJwQCJQQCIwQCHMQ'. - 'CGsQAP8QAPcQAO8QAOcQAN4QANYQAM4QAMYQAL0QALUQAKUQAJ'. - 'QQAIQICGsICGMIAO8IANYIAL0IALUIAK0IAKUIAJwIAJQIAIwI'. - 'AIQIAHsIAHMIAGsIAGMAAN4AAMYAAK0AAJQAAIwAAIQAAHMAAG'. - 'sAAGMAAFrR1dDlAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. - 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkRFRPMOZ'. - '/2AAAB+klEQVR4nGNgIAIIqeqZmBqpi2JISNml5lVXV3d198Yo'. - 'oUjwm1SnxsbGRsSm5ZfNXO4tjCTjVh0ABhFx6QV9E1Y0S8JkuN'. - '3yAgLc7W3t/QPi4jPKJ8ye1yoIlTKpjvVy15eVUbN0i4zKLJ8w'. - 'ae6qcKgLqmMj3PUFWFl5NJ0CExLLJzbNW7BWCyxlXR0ba6/Axs'. - 'zELmfnkRBT0QiSKgXJCOflxUbYy3KyMHEoOrtEZ1c2TZ6/cMl6'. - 'eaCUamdsbIC7tjgPr4SBS3BMMVDTwkXr1hsDpYy6UmMj/O0tdX'. - 'QNbDxjknJLWqYsXLx0vStQynxGflpkZGCgs7Onp29SbtNkoMy6'. - 'pevCgFJWy3oyMuKjgoKCPWNCvEuqWhcsWrJ06XqQlPnMvrKyrM'. - 'TomJjkZAfHlNa2qdOWrlu63gcopbG8v7+hvLwip7g4JdSxsLZu'. - '8dKlS9ettwBKic2eNXHChIkTG5tKqgpr2uo6loLAehWQx0LnzJ'. - '49p6mpeXLLlNq6RUvqly6dvnR9Bx9ISnnlvLmT582bMr9t4aL2'. - '+vrp60GaDCGB6Ld6wfwFCxYCJZYsXQ+SmL6+FBryInVrFi1atH'. - 'jJkqVQsH6pNCzCJNvXrQW6CmQJREYFEc2CYevXrwMLAyXXl0oz'. - 'IAOt0vVQUGSIkabkDV3DwlzNVDAksAAAfUbNQRCwr88AAAAASU'. - 'VORK5CYII=' ; - - //========================================================== - // File: bs_red.png - //========================================================== - $this->imgdata_small[0][0]= 437 ; - $this->imgdata_small[0][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAk1'. - 'BMVEX////////GxsbGra3/xsbOhITWhIT/hIT/e3v/c3P/a2vG'. - 'UlK1SkrOUlL/Y2PWUlLGSkrnUlLeSkrnSkr/SkqEGBj/KSmlGB'. - 'jeGBjvGBj3GBj/EBD/CAj/AAD3AADvAADnAADeAADWAADOAADG'. - 'AAC9AAC1AACtAAClAACcAACUAACMAACEAAB7AABzAABrAABjAA'. - 'BuukXBAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. - 'cwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGDNEMgOYAAAAm0'. - 'lEQVR4nI3Q3RKCIBAFYGZMy9RKzX7MVUAUlQTe/+kS0K49d3wD'. - '7JlFaG+CvIR3FvzPXgpLatxevVVS+Jzv0BDGk/UJwOkQ1ph2g/'. - 'Ct5ACX4wNT1o/zzUoJUFUGBiGfVnDTYGJgmrWy8iKEtp0Bpd2d'. - 'jLGu56MB7f4JOOfDJAwoNwslk/jOUi+Jts6RVNrC1hkhPy50Ef'. - 'u79/ADQMQSGQ8bBywAAAAASUVORK5CYII=' ; - - - //========================================================== - // File: bs_lightblue.png - //========================================================== - $this->imgdata_small[1][0]= 657 ; - $this->imgdata_small[1][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABVl'. - 'BMVEX////////d///AwMC7wcS08P+y+P+xxdCwxM+uws2twMur'. - 'vsinzNynytylzuKhyN6e5v6d5P+d1fOcwNWcu8ub4f+at8iZ3v'. - '+ZvdGY2/yW2f+VscGU1vuT1fqTr72Sx+SSxeKR0fWRz/GPz/OP'. - 'rr+OyeqMy+6Myu2LyeyKxueJudSGw+SGorGDvt+Cvd6CvN2Aud'. - 'p+uNd+t9Z9tdV8tdR8tNN6sc94r813rct2q8h0qcZ0qMVzp8Rx'. - 'o8Bwor5tn7ptnrptnrlsnbhqmbRpmbNpi51ol7Flkqtkkqtkka'. - 'pjj6hijaRhjaZgi6NfiqJfiaFdh55bhJtag5pZgphYgJZYf5VX'. - 'cn9Ve5FSeI1RdopRdYlQdYlPc4dPcoZPcoVNcINLboBLbH9GZn'. - 'hGZXdFZHZEY3RDYnJCXW4/W2s/WWg+Wmo7VmU7VGM7U2E6VGM6'. - 'VGI5UV82T1wGxheQAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHU'. - 'gAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGTok'. - '9Yp9AAAAtElEQVR4nGNgIBaw8wkpKghzwvksPAKiUsraprYiLF'. - 'ARXkE2JiZ1PXMHXzGIAIekOFBE08TGLTCOCyzCLyvDxsZqZOnk'. - 'E56kAhaRV9NQUjW2tPcMjs9wBYsY6Oobmlk7egRGpxZmgkW0zC'. - '2s7Jy9giKT8gohaiQcnVzc/UNjkrMLCyHmcHr7BYREJKTlFxbm'. - 'QOxiEIuKTUzJKgQCaZibpdOzQfwCOZibGRi4dcJyw3S4iQ4HAL'. - 'qvIlIAMH7YAAAAAElFTkSuQmCC' ; - - //========================================================== - // File: bs_gray.png - //========================================================== - $this->imgdata_small[2][0]= 550 ; - $this->imgdata_small[2][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAAQCAMAAADH72RtAAABI1'. - 'BMVEX///8AAAD8EAD8IAD8NAD8RAD8VAAYGBi/v7+goKCCgoJk'. - 'ZGRGRkb8yAD83AD87AD8/AD4+ADo+ADY+ADI+AC0+ACk+ACU+A'. - 'CE+AB0/ABk/ABU/ABE/AAw/AAg/AAQ/AAA/AAA+AAA6BAA2CAA'. - 'yDQAtEQApFQAlGQAhHQAdIgAZJgAVKgARLgAMMgAINwAEOwAAP'. - 'wAAPgIAPAQAOgYAOAkANgsANA0AMg8AMBEALhMALBUAKhcAKBo'. - 'AJhwAJB4AIiAAID////4+Pjy8vLs7Ozm5ubg4ODa2trT09PNzc'. - '3Hx8fBwcG7u7u1tbWurq6oqKiioqKcnJyWlpaQkJCJiYmDg4N9'. - 'fX13d3dxcXFra2tkZGReXl5YWFhSUlJMTExGRkZAQEA1BLn4AA'. - 'AAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIA'. - 'AAsSAdLdfvwAAAAHdElNRQfTAwkUGiIctEHoAAAAfElEQVR4nI'. - '2N2xKDIAwF+bZ2kAa8cNFosBD//yvKWGh9dN+yk9kjxH28R7ze'. - 'wzBOYSX6CaNB927Z9qZ66KTSNmBM7UU9Hx2c5qjmJaWCaV5j4t'. - 'o1ANr40sn5a+x4biElrqHgrXMeac/c1nEpFHG0LSFoo/jO/BeF'. - 'lJnFbT58ayUf0BpA8wAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bs_greenblue.png - //========================================================== - $this->imgdata_small[3][0]= 503 ; - $this->imgdata_small[3][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAxl'. - 'BMVEX///////+/v79znJQhSkJ7raU5hHtjraVKnJRCjIRClIyU'. - '9++E595avbVaxr2/v7+ctbWcvb17nJxrjIx7paUxQkK9//+Mvb'. - '17ra2Evb17tbVCY2MQGBiU5+ec9/eM5+d71tZanJxjra1rvb1j'. - 'tbVSnJxara1rzs5jxsZKlJRChIQpUlIhQkJatbVSpaU5c3MxY2'. - 'MYMTEQISFavb1Sra1KnJxCjIw5e3sxa2spWlpClJQhSkoYOTkp'. - 'Y2MhUlIQKSkIGBgQMTH+e30mAAAAAXRSTlMAQObYZgAAAAFiS0'. - 'dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfT'. - 'AwkUGTIqLgJPAAAAqklEQVR4nI2QVxOCMBCEM6Mi2OiCvSslJB'. - 'CUoqjn//9TYgCfubf9Zu9uZxFqO+rscO7b6l/LljMZX29J2pNr'. - 'YjmX4ZaIEs2NeiWO19NNacl8rHAyD4LR6jjw6PMRdTjZE0JOiU'. - 'dDv2ALTlzRvSdCCfAHGCc7yRPSrAQRQOWxKc3C/IUjBlDdUcM8'. - '97vFGwBY9QsZGBc/A4DWZNbeXIPWZEZI0c2lqSute/gCO9MXGY'. - '4/IOkAAAAASUVORK5CYII=' ; - - //========================================================== - // File: bs_yellow.png - //========================================================== - $this->imgdata_small[4][0]= 507 ; - $this->imgdata_small[4][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAzF'. - 'BMVEX///////+/v79zYwCMewDOxoTWzoTezkr/5wj/5wDnzgDe'. - 'xgC1pQCtnACllACcjACUhABjWgDGvVK1rUrOxlLGvUqEexilnB'. - 'jv3hj35xj/7wj/7wD35wDv3gDn1gDezgDWxgDOvQDGtQC9rQCE'. - 'ewB7cwBzawBrYwDWzlLn3lLe1krn3kre1hi9tQC1rQCtpQClnA'. - 'CclACUjACMhAD/9wC/v7///8bOzoT//4T//3v//3P//2v//2Pn'. - '50r//0r//yn39xj//xD//wBjYwDO8noaAAAAAXRSTlMAQObYZg'. - 'AAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAH'. - 'dElNRQfTAwkUGSDZl3MHAAAAqElEQVR4nI3QWRNDMBAA4My09E'. - 'IF1SME0VT1okXvM/3//6kEfbZv+81eswA0DfHxRpOV+M+zkDGG'. - 'rL63zCoJ2ef2RLZDIqNqYexyvFrY9ePkxGWdpvfzC7tEGtIRly'. - 'nqzboFKMlizAXbNnZyiFUKAy4bZ+B6W0lRaQDLmg4h/k7eFwDL'. - 'OWIky8qhXUBQ7gKGmsxpC+ah1TdriwByqG8GQNDNr6kLjf/wAx'. - 'KgEq+FpPbfAAAAAElFTkSuQmCC' ; - - //========================================================== - // File: bs_darkgray.png - //========================================================== - $this->imgdata_small[5][0]= 611 ; - $this->imgdata_small[5][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAABJl'. - 'BMVEX////////o8v/f6O7W4OnR3PXL1OTL0evEyLvCzePAwMC/'. - 'v7a8wsq7t7C1xum1vtS1q6GzopmyxeKsrsOqvNWoq7anvN+nsb'. - 'qhrcGgqbGfpq6cp7+bqMuVmJKRm7yPlKKMnL6FkKWFipOEkLSE'. - 'j6qEhoqAiaB+jqd8haF7hZR4iJt4g5l3hZl2gIt2cod1hJVzeY'. - 'VzboJvhp9sfJJsb41peY1pd5xpdoVod4xndI5lcHxka4BjcYVg'. - 'Z3BfboFbb4lbZnZbYntaZ4laZYVZV3JYYWpXX3JWWm5VX4RVW2'. - 'NUYX9SXHxPWn5OVFxNWWtNVXVMVWFKV3xHUGZGU3dGTldFSlxE'. - 'Sk9ESXBCRlNBS3k/SGs/RU4+R1k9R2U6RFU2PUg0PEQxNU0ECL'. - 'QWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAA'. - 'CxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGQmbJetrAAAAtklEQV'. - 'R4nGNgwAK4JZTNNOWlYDxhMT4ZDTOzQE1uMF9CiJWVU0LbxDlS'. - 'G8QVF+FnZ2KRNHAIiPUHaZGSlmZj5lH19A1KjLUA8lXU5MWllF'. - 'yjo30TYr2BfG19G11b37CEeN84H38gX1HbwTUkOjo+zjfG3hLI'. - 'l1exCvCNCwnxjfMz0gTyRdXNHXx9fUNCQu2MwU6SN3ZwD42LCH'. - 'W30IK4T8vUJSAkNMhDiwPqYiktXWN9JZj7UQAAjWEfhlG+kScA'. - 'AAAASUVORK5CYII=' ; - - - //========================================================== - // File: bs_darkgreen.png - //========================================================== - $this->imgdata_small[6][0]= 666 ; - $this->imgdata_small[6][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABX1'. - 'BMVEX////////l/+nAwMC86r+8wb28wby8wLy78sCzw7SywrSx'. - 'wLKwvrGuvK+syK+ryq2rx62n36ym3aumxKmk2qij0Keh16ahva'. - 'Og1aSguKKe06KeuaCetZ+d0KGdtZ+bz6Cay56ZyZ2Zwp2Zr5qZ'. - 'rpqYwJuXyZuXrJmVw5mUxZiTxJeTw5eTq5WRwJWPtJKOvZKKuI'. - '6Kt42Kn4yJt42ItIuGsomFsYmEsIiEr4eDr4eBrIR/qoN+qIJ8'. - 'poB7pH56o356on14nnt2nXl0mndzmnZzmXZymHVwlXNvlHJukn'. - 'FtiHBqjm1qjW1oi2toiWpniWplh2hlhmdkhWdig2VggGNgf2Je'. - 'fmFdfGBde19bbl1aeFxXdFpWclhVclhVcVdUcFZTb1VSbVRQal'. - 'JPaVFKY0xKYkxJYUtIYEpHX0lEWkZCWERCV0NCVkM/U0A+U0A+'. - 'UUA+UEA9Uj89UT48Tj45TDvewfrHAAAAAXRSTlMAQObYZgAAAA'. - 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. - 'RQfTAwkUGRjxlcuZAAAAtElEQVR4nGNgIBZw8osqqIpzw/msfI'. - 'IiUmr6lo6SbFARASEOJiYtQ2uXADmIAJeEGFBE18LBMySBBywi'. - 'LC/LwcFiZuvmH5WiAxZR0tRW1DC3dfYJS8zyAouYGBibWtm7+o'. - 'TEpZfkgEX0rG3snNx9Q2NSCksgaqRd3Ty8gyLiU/NKSiDmcPsF'. - 'BodHJ2UUlZTkQ+xikIlNSE7LLgECZagL2VQyc0H8YnV2uD94jS'. - 'ILIo14iQ4HALarJBNwbJVNAAAAAElFTkSuQmCC' ; - - //========================================================== - // File: bs_purple.png - //========================================================== - $this->imgdata_small[7][0]= 447 ; - $this->imgdata_small[7][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAnF'. - 'BMVEX///////+/v7/Gvca9rb3Grcb/xv+1hLWte629hL21e7XG'. - 'hMbWhNbOe87We9b/hP//e/97OXv/c///a///Y/+cOZz/Sv/WOd'. - 'bnOefvOe//Kf9jCGNrCGv/EP//CP/nCOf/AP/3APfvAO/nAOfe'. - 'AN7WANbOAM7GAMa9AL21ALWtAK2lAKWcAJyUAJSMAIyEAIR7AH'. - 'tzAHNrAGtjAGPP1sZnAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. - 'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGS'. - 'o5QpoZAAAAnElEQVR4nI3Q2xJDMBAG4MyQokWrZz3oSkJISJH3'. - 'f7dK0Gv/Xb7J7vyzCK0NjtPsHuH/2wlhTE7LnTNLCO/TFQjjIp'. - 'hHAA6bY06LSqppMAY47x+04HXTba2kAFlmQKr+YuVDCGUG2k6/'. - 'rNwYK8rKwKCnPxHnVS0aA3rag4UQslUGhrlk0Kpv1+sx3tLZ6w'. - 'dtYemMkOsnz8R3V9/hB87DEu2Wos5+AAAAAElFTkSuQmCC' ; - - - //========================================================== - // File: bs_brown.png - //========================================================== - $this->imgdata_small[8][0]= 677 ; - $this->imgdata_small[8][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABaF'. - 'BMVEX//////////8X/3oD/3nj/1HX/0Gr/xGP/rkv/gBf+iS/2'. - 'bAL1agDxaQDuZwDrZwLpZQDmZQLlZADjcx7gZATeYQDdZgraXw'. - 'DZXwHYXgDXiEvXZAvUjlfUXwXTjVfTbR7ShUvRbR7RWwDMWQDL'. - 'WADKooLKWADJoYLJgkvHWATGoILFn4LFgEvFVgDEZx7EVQDDt6'. - '/DVQDCt6/CnoLChlfCVADAwMC+hFe+UgC8UgC6UQC4gVe4UAC3'. - 'gVe3UAC1gFe1eUu1TwC1TgCzTgCwTQKuTACrSgCqSgCpSgCpSQ'. - 'CodEulSACkRwCiRgCdRACcRACaQwCYQgCWQgKVQQCVQACUQACS'. - 'UR6RPwCOPgCNPQCLPACKPACJOwCEOQCBOAB+NwB9NgB8NgB7NQ'. - 'B6NwJ4NAB3RR52MwB0MgBuLwBtLwBsLwBqLgBpLQBkLQJiKgBh'. - 'KgBgKwRcKABbKQJbJwBaKQRaJwBYKAJVJQDZvdIYAAAAAXRSTl'. - 'MAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLd'. - 'fvwAAAAHdElNRQfTAwkUGho0tvl2AAAAtklEQVR4nGNgIBaoSg'. - 'mLKGpowfkGMty8AqJKpi4mRlAROR5ONg4JFUv3YHOIgDo/HwsT'. - 'q6yps29EsjZYREFIkJ2ZS9/OMzA20wEsIi8uKSZtaOPmH5WSFw'. - 'YW0VRW07Vw8vCLSMguLwCL6FlaObp6B0TGZxSXQ9TouHv6+IXG'. - 'JGYWlpdDzNEKCgmPjkvLKS0vL4LYxWAen5SelV8OBNZQFxrZ5h'. - 'aC+GX2MDczMBh7pZakehkTHQ4AA0Am/jsB5gkAAAAASUVORK5C'. - 'YII=' ; - - //========================================================== - // File: bs_blue.png - //========================================================== - $this->imgdata_small[9][0]= 436 ; - $this->imgdata_small[9][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAk1'. - 'BMVEX///////+/v7+trcbGxv+EhM6EhNaEhP97e/9zc/9ra/9S'. - 'UsZKSrVSUs5jY/9SUtZKSsZSUudKSt5KSudKSv8YGIQpKf8YGK'. - 'UYGN4YGO8YGPcQEP8ICP8AAP8AAPcAAO8AAOcAAN4AANYAAM4A'. - 'AMYAAL0AALUAAK0AAKUAAJwAAJQAAIwAAIQAAHsAAHMAAGsAAG'. - 'ONFkFbAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. - 'cwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGhNNakHSAAAAmk'. - 'lEQVR4nI3P2xKCIBAGYGfM6SBWo1nauIqogaDA+z9dK9Lhrv47'. - 'vtl/2A2CfxNlJRRp9IETYGraJeEb7ocLNKznia8A7Db7umWDUG'. - 'sxAzhurxRHxok4KQGqCuEhlL45oU1D2w5BztY4KRhj/bCAsetM'. - '2uObjwvY8/oX50JItYDxSyZSTrO2mNhvGMbaWAevnbFIcpuTr7'. - 't+5AkyfBIKSJHdSQAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bs_green.png - //========================================================== - $this->imgdata_small[10][0]= 452 ; - $this->imgdata_small[10][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAn1'. - 'BMVEX///////+/v7+/v7/G/8aUxpSMvYyUzpSMzoyM1oxarVqE'. - '/4R7/3tavVpKnEpaxlpz/3Nr/2tKtUpj/2Na51pKzkpK1kpK50'. - 'pK/0oYcxgp/ykYlBgY3hgY7xgY9xgQ/xAI/wgA/wAA9wAA7wAA'. - '5wAA3gAA1gAAzgAAxgAAvQAAtQAArQAApQAAnAAAlAAAjAAAhA'. - 'AAewAAcwAAawAAYwA0tyxUAAAAAXRSTlMAQObYZgAAAAFiS0dE'. - 'AIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAw'. - 'kUGgW5vvSDAAAAnklEQVR4nI3QSxKCMAwA0M4gqCgoiiJ+kEAL'. - 'LQUq0PufzX7ENdnlJZNkgtDS2CYZvK6bf+7EoKLA9cH5SQzv6A'. - 'YloTywsAbYr44FrlgrXCMJwHl3xxVtuuFkJAPIcw2tGB9GcFli'. - 'oqEf5GTkSUhVMw2TtD0XSlnDOw3SznE5520vNEi7CwW9+Ayjyq'. - 'U/3+yPuq5gvhkhL0xlGnqL//AFf14UIh4mkEkAAAAASUVORK5C'. - 'YII=' ; - - - //========================================================== - // File: bs_white.png - //========================================================== - $this->imgdata_small[11][0]= 480 ; - $this->imgdata_small[11][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAAQCAYAAADwMZRfAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. - 'B3RJTUUH0wMLFTsY/ewvBQAAAW1JREFUeJytkz2u4jAUhT/jic'. - 'gfBUKiZhE0bIKeVbCWrIKenp6eDiGlCEEEBArIxvzGU4xeZjLk'. - 'jWb05lRXuvbx+exr4bouX1Xjyw7Atz81F4uFBYjjGIDhcCjq1o'. - 'k6nN1uZwFerxfP55Msy1itVmRZBsB4PK6YveHkeW5d18XzPIIg'. - 'wPd9Wq0WnU6HMAxJkoQoiuynOIfDwUopkVIihKAoCgAcx6Hdbm'. - 'OMIU1T5vN55eBKEikljUYDIX6kFUKU9e8aDAZlmjcca+1b7TgO'. - '1+uVy+VS9nzfr8e53++VzdZaiqIgz3OMMWitOZ/PaK0JgqDeRC'. - 'mF53lIKYGfr3O73TDGoJQiTVO01nS73XqT4/FIs9kkCAIej0eZ'. - 'brPZEMcxSZKgtQZgMpmIWpN+vy+m06n1PK9yTx8Gy+WS/X5Pr9'. - 'er9GuHLYoiG4YhSilOpxPr9Zrtdlti/JriU5MPjUYjq7UuEWaz'. - '2d+P/b/qv/zi75oetJcv7QQXAAAAAElFTkSuQmCC' ; - - - //========================================================== - // File: bs_cyan.png - //========================================================== - $this->imgdata_small[12][0]= 633 ; - $this->imgdata_small[12][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABPl'. - 'BMVEX////////F///AwMCvxsaC1NSC0dGCz8+CzMyA//94//91'. - '//9q//9j//9X4uJX09NXz89Xx8dXxMRL//9L5uZL3d1L2NhLxs'. - 'ZLt7cv//8e9fUe8fEe7u4e398epqYehoYX//8L+PgK//8F9fUE'. - '/v4E5+cEb28EZ2cC//8C/v4C/f0CzMwCrq4Cjo4CdXUCaWkCZW'. - 'UB/PwA//8A/f0A+/sA8/MA7e0A7OwA6+sA5eUA5OQA4uIA4eEA'. - '3NwA2toA2NgA1dUA09MA0tIA0NAAysoAxsYAxcUAxMQAv78Avr'. - '4AvLwAtrYAtbUAs7MAsLAAra0Aq6sAqKgApaUApKQAoqIAoKAA'. - 'n58AmpoAlZUAk5MAkpIAkJAAj48AjIwAiYkAh4cAf38AfX0Ae3'. - 'sAenoAcnIAcHAAa2sAaWkAaGgAYmIUPEuTAAAAAXRSTlMAQObY'. - 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. - 'AHdElNRQfTAwkUGQDi+VPPAAAAtElEQVR4nGNgIBawikipyIiy'. - 'wfksfJpGRkamNtr8LFARPiMFHmFDcztXfwGoFi0jLiZuZRtnry'. - 'BddrCIiJEGL6eklYO7X3iCOFhE2thESdHawdUnJDZFDiyiamZh'. - 'aevk5h0UlZSpBhaRtbN3dPHwDY5MSM+EqBFzc/f0DgiLTkjLzI'. - 'SYw6bjHxgaEZeckZmpD7GLQSAqJj4xNRMIBGFuFtRLA/ENhGBu'. - 'ZmDgkJBXl5fgIDocAAKcINaFePT4AAAAAElFTkSuQmCC' ; - - //========================================================== - // File: bs_bluegreen.png - //========================================================== - $this->imgdata_small[13][0]= 493 ; - $this->imgdata_small[13][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAvV'. - 'BMVEX///////+/v79j//855/8x3v851v9Spb1C1v8AOUqEtcZK'. - 'lK1StdYxzv8hxv8AY4QASmNSlK1KpcZKtd4YQlIYnM4YrecIvf'. - '8AtfcAre8AjL0AhLUAc5wAa5QAWnsAQloAKTkAGCFKhJxKrdYY'. - 'jL0Ypd4Atf8ArfcApecAnN4AlM4AjMYAe60Ac6UAY4wAUnNSnL'. - '0AlNYAWoQASmsAOVIAITGEtc4YWnsAUnsAMUqtvcaErcYAKUIA'. - 'GCkAECHUyVh/AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAA'. - 'AJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGxNUcXCT'. - 'AAAAqUlEQVR4nI2Q1xKCMBREM2NHLCCogAGCjd6SqLT8/2cZKT'. - '6zb3tm987OBWCsXoejp8rC35fi4+l6gXFZlD0Rz6fZ1tdDmKR9'. - 'RdOmkzmP7DDpilfX3SzvRgQ/Vr1uiZplfsCBiVf03RJd140wgj'. - 'kmNqMtuYXcxyYmNWJdRoYwzpM9qRvGujuCmSR7q7ARY00/MiWk'. - 'sCnjkobNEm1+HknDZgAqR0GKU43+wxdu2hYzbsHU6AAAAABJRU'. - '5ErkJggg==' ; - - //========================================================== - // File: bs_lightred.png - //========================================================== - $this->imgdata_small[14][0]= 532 ; - $this->imgdata_small[14][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAA3l'. - 'BMVEX///////+/v7/Gvb0hGBj/5///3v//zu//1u//xucpGCG9'. - 'nK21lKVSQkp7Wms5KTExISlaOUpjQlIhEBj/tdbOhKXnrcbGjK'. - 'Wla4TetcbGnK2EWmv/rc73pcZ7UmOcY3vOpbW1jJzenLW9e5Rz'. - 'Slq1c4xrQlJSOULGhJz/pcb3nL2chIzOnK33rcbelK3WjKWMWm'. - 'vGe5SEUmM5ISnOtb3GrbXerb3vpb2ca3v/rcaUY3POhJxCKTF7'. - 'SlrWnK21e4ytc4TvnLXnlK2la3taOUK1lJxrSlLGhJRjQkpSMT'. - 'lw+q2nAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. - 'cwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGjoP2Nm+AAAAr0'. - 'lEQVR4nGNgIBaYiOk62imYwPnMkiIyso76yhJSzFARMxkRNk49'. - 'a3t5OW6oFk1LVkYOfWUHKxUXiEYzLS12DnN3VXkjIRtFsIiSk5'. - '6evqGqhYGKugAfWMRa1FpD2UHeQEXQRlgALCJur+rgbCUNFOAS'. - 'hqjRkZe3MpBTcwEKCEPMMTGSs3Xz8OQHCnBBHckt6OJpIyAMBD'. - 'wwN/MYc4H4LK4wNzMwmGrzcvFqmxIdDgDiHRT6VVQkrAAAAABJ'. - 'RU5ErkJggg==' ; - - //========================================================== - // File: bxs_lightred.png - //========================================================== - $this->imgdata_xsmall[0][0]= 432 ; - $this->imgdata_xsmall[0][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAA3l'. - 'BMVEX///////+/v7/Gvb0hGBj/5///3v//zu//1u//xucpGCG9'. - 'nK21lKVSQkp7Wms5KTExISlaOUpjQlIhEBj/tdbOhKXnrcbGjK'. - 'Wla4TetcbGnK2EWmv/rc73pcZ7UmOcY3vOpbW1jJzenLW9e5Rz'. - 'Slq1c4xrQlJSOULGhJz/pcb3nL2chIzOnK33rcbelK3WjKWMWm'. - 'vGe5SEUmM5ISnOtb3GrbXerb3vpb2ca3v/rcaUY3POhJxCKTF7'. - 'SlrWnK21e4ytc4TvnLXnlK2la3taOUK1lJxrSlLGhJRjQkpSMT'. - 'lw+q2nAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. - 'cwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUKBOgGhWjAAAAS0'. - 'lEQVR4nGNgQAEmunYmEJaMCKe1vBxYzJKVQ9lKBSSupKdnaKGi'. - 'zgdkiqs6WKnYcIGYJnK2HvzCwmCNgi42wsLCECNMeXlNUY0HAL'. - 'DaB7Du8MiEAAAAAElFTkSuQmCC' ; - - //========================================================== - // File: bxs_bluegreen.png - //========================================================== - $this->imgdata_xsmall[1][0]= 397 ; - $this->imgdata_xsmall[1][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAvV'. - 'BMVEX///////+/v79j//855/8x3v851v9Spb1C1v8AOUqEtcZK'. - 'lK1StdYxzv8hxv8AY4QASmNSlK1KpcZKtd4YQlIYnM4YrecIvf'. - '8AtfcAre8AjL0AhLUAc5wAa5QAWnsAQloAKTkAGCFKhJxKrdYY'. - 'jL0Ypd4Atf8ArfcApecAnN4AlM4AjMYAe60Ac6UAY4wAUnNSnL'. - '0AlNYAWoQASmsAOVIAITGEtc4YWnsAUnsAMUqtvcaErcYAKUIA'. - 'GCkAECHUyVh/AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAA'. - 'AJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUKDVyF5Be'. - 'AAAASUlEQVR4nGNgQAFmYqJcEJaEOJ+UrD5YTJKFTZrfGCQuaq'. - 'glLWvMaQ5kqujo6hnbKIKYXPr68gp2dmCNJiZAlh3ECGsREWtU'. - '4wF1kwdpAHfnSwAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bxs_navy.png - //========================================================== - $this->imgdata_xsmall[2][0]= 353 ; - $this->imgdata_xsmall[2][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAk1'. - 'BMVEX///////+/v7+trcbGxv+EhM6EhNaEhP97e/9zc/9ra/9S'. - 'UsZKSrVSUs5jY/9SUtZKSsZSUudKSt5KSudKSv8YGIQpKf8YGK'. - 'UYGN4YGO8YGPcQEP8ICP8AAP8AAPcAAO8AAOcAAN4AANYAAM4A'. - 'AMYAAL0AALUAAK0AAKUAAJwAAJQAAIwAAIQAAHsAAHMAAGsAAG'. - 'ONFkFbAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. - 'cwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUJxXO4axZAAAAR0'. - 'lEQVR4nGNgQAGskhKsEJaslIi8ijpYTJaDU1FVAyQuKSujoKKh'. - 'LQ5kSigpqWro6oOYrOoaWroGBmCNWiCWAdQwUVFWVOMBOp4GCJ'. - 's5S60AAAAASUVORK5CYII=' ; - - //========================================================== - // File: bxs_gray.png - //========================================================== - $this->imgdata_xsmall[3][0]= 492 ; - $this->imgdata_xsmall[3][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABI1'. - 'BMVEX///8AAAD8EAD8IAD8NAD8RAD8VAAYGBi/v7+goKCCgoJk'. - 'ZGRGRkb8yAD83AD87AD8/AD4+ADo+ADY+ADI+AC0+ACk+ACU+A'. - 'CE+AB0/ABk/ABU/ABE/AAw/AAg/AAQ/AAA/AAA+AAA6BAA2CAA'. - 'yDQAtEQApFQAlGQAhHQAdIgAZJgAVKgARLgAMMgAINwAEOwAAP'. - 'wAAPgIAPAQAOgYAOAkANgsANA0AMg8AMBEALhMALBUAKhcAKBo'. - 'AJhwAJB4AIiAAID////4+Pjy8vLs7Ozm5ubg4ODa2trT09PNzc'. - '3Hx8fBwcG7u7u1tbWurq6oqKiioqKcnJyWlpaQkJCJiYmDg4N9'. - 'fX13d3dxcXFra2tkZGReXl5YWFhSUlJMTExGRkZAQEA1BLn4AA'. - 'AAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEA'. - 'AAsRAX9kX5EAAAAHdElNRQfTAwkUKC74clmyAAAAQklEQVR4nG'. - 'NgQAVBYVCGt5dXYEQ0mOnp5h4QFgVmeri6+4dHxYMVeHoFRUTH'. - 'gTUFBIZBWAwMkZEx8bFQM2Lj0UwHANc/DV6yq/BiAAAAAElFTk'. - 'SuQmCC' ; - - //========================================================== - // File: bxs_graypurple.png - //========================================================== - $this->imgdata_xsmall[4][0]= 542 ; - $this->imgdata_xsmall[4][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABSl'. - 'BMVEX////////11P/MqdvKrNfAwMC+u7+9u7+4rr24lsi3rby3'. - 'lMe1rLq1o720q7i0oL20ksSzoryyqbaykMGxlb2wkL+vnbiujb'. - '2sjLuri7qpl7GoirWoibenmK2mla6mjLKmhrSllauki7CjhrCj'. - 'hLGihLChg6+ggq2fkqadkKOcfqqai6Gag6WYe6WXeqSWeaOTd6'. - 'CTd5+Rdp6RdZ6RdZ2Qg5eOc5qMcpiLcZeJb5WIbpOHbZKGbJGE'. - 'a4+CaY2AZ4t/Z4p/Zop/Zol+Zol7ZIZ6Y4V5YoR1ZH11X391Xn'. - '9zXX1yXXtxXHtvWnluWXhsV3VqVnNpVXJoVHFnU3BmUm9jUGth'. - 'VGdgTmheTGZcS2RcSmRaSWJYR19XRl5SQllRQlhQQVdPQFZOP1'. - 'VLPlFJO09IPE5IOk5FOEtEN0lDOEpDOElDNklCNkc/M0XhbrfD'. - 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'. - 'EAAAsRAX9kX5EAAAAHdElNRQfTAwkUKCgREfyHAAAATUlEQVR4'. - 'nGNgQAEcIko8EBY3M5Ougy+IxSXMwmTsFsAHZMqrSRvZB0W7A5'. - 'k6FlYugXEZICaPr394Um4uSAFDRFRCbm4uxAihsDAhVOMBHT0L'. - 'hkeRpo8AAAAASUVORK5CYII=' ; - - //========================================================== - // File: bxs_red.png - //========================================================== - $this->imgdata_xsmall[5][0]= 357 ; - $this->imgdata_xsmall[5][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAk1'. - 'BMVEX////////GxsbGra3/xsbOhITWhIT/hIT/e3v/c3P/a2vG'. - 'UlK1SkrOUlL/Y2PWUlLGSkrnUlLeSkrnSkr/SkqEGBj/KSmlGB'. - 'jeGBjvGBj3GBj/EBD/CAj/AAD3AADvAADnAADeAADWAADOAADG'. - 'AAC9AAC1AACtAAClAACcAACUAACMAACEAAB7AABzAABrAABjAA'. - 'BuukXBAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. - 'cwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUIyjy5SVMAAAAS0'. - 'lEQVR4nGNgQAFsUpJsEJastIi8ijpYTJaDU0FVgxXIlJKVUVDR'. - '0BYHMiUUlVQ1dPVBTDZ1dS1dAwOQAgYtbSDLAGIEq6goK6rxAD'. - 'yXBg73lwGUAAAAAElFTkSuQmCC' ; - - //========================================================== - // File: bxs_yellow.png - //========================================================== - $this->imgdata_xsmall[6][0]= 414 ; - $this->imgdata_xsmall[6][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAzF'. - 'BMVEX///////+/v79zYwCMewDOxoTWzoTezkr/5wj/5wDnzgDe'. - 'xgC1pQCtnACllACcjACUhABjWgDGvVK1rUrOxlLGvUqEexilnB'. - 'jv3hj35xj/7wj/7wD35wDv3gDn1gDezgDWxgDOvQDGtQC9rQCE'. - 'ewB7cwBzawBrYwDWzlLn3lLe1krn3kre1hi9tQC1rQCtpQClnA'. - 'CclACUjACMhAD/9wC/v7///8bOzoT//4T//3v//3P//2v//2Pn'. - '50r//0r//yn39xj//xD//wBjYwDO8noaAAAAAXRSTlMAQObYZg'. - 'AAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAH'. - 'dElNRQfTAwkUIzoBXFQEAAAAS0lEQVR4nGNgQAFsDhJsEJaTo5'. - '2skj5YzMnSSk7ZwBzIlOSUklPiMxYHMnW4FXT5VNVBTDZeXiNV'. - 'QUGQAgYBYyBLEGIEq5gYK6rxAH4kBmHBaMQQAAAAAElFTkSuQm'. - 'CC' ; - - //========================================================== - // File: bxs_greenblue.png - //========================================================== - $this->imgdata_xsmall[7][0]= 410 ; - $this->imgdata_xsmall[7][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAxl'. - 'BMVEX///////+/v79znJQhSkJ7raU5hHtjraVKnJRCjIRClIyU'. - '9++E595avbVaxr2/v7+ctbWcvb17nJxrjIx7paUxQkK9//+Mvb'. - '17ra2Evb17tbVCY2MQGBiU5+ec9/eM5+d71tZanJxjra1rvb1j'. - 'tbVSnJxara1rzs5jxsZKlJRChIQpUlIhQkJatbVSpaU5c3MxY2'. - 'MYMTEQISFavb1Sra1KnJxCjIw5e3sxa2spWlpClJQhSkoYOTkp'. - 'Y2MhUlIQKSkIGBgQMTH+e30mAAAAAXRSTlMAQObYZgAAAAFiS0'. - 'dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfT'. - 'AwkUJy5/6kV9AAAATUlEQVR4nGNgQAGCyuyCEJaGugKHviVYzF'. - 'hO3sxCWwDIVNLTM9PXtpEGMhW12Cy0DR1ATEFLSxZ7BweQAgYd'. - 'HUMHBweIEQKiogKoxgMAo/4H5AfSehsAAAAASUVORK5CYII=' ; - - //========================================================== - // File: bxs_purple.png - //========================================================== - $this->imgdata_xsmall[8][0]= 364 ; - $this->imgdata_xsmall[8][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAnF'. - 'BMVEX///////+/v7/Gvca9rb3Grcb/xv+1hLWte629hL21e7XG'. - 'hMbWhNbOe87We9b/hP//e/97OXv/c///a///Y/+cOZz/Sv/WOd'. - 'bnOefvOe//Kf9jCGNrCGv/EP//CP/nCOf/AP/3APfvAO/nAOfe'. - 'AN7WANbOAM7GAMa9AL21ALWtAK2lAKWcAJyUAJSMAIyEAIR7AH'. - 'tzAHNrAGtjAGPP1sZnAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. - 'HUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUIj'. - 'mBTjT/AAAASUlEQVR4nGNgQAGskhKsEJaCrJiSuhZYTEFASFlD'. - 'GyQuqSCnrK6tJwpkiquoamgbGIGYrFpaugbGxmCNunpAljHECB'. - 'ZBQRZU4wFSMAZsXeM71AAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bxs_green.png - //========================================================== - $this->imgdata_xsmall[9][0]= 370 ; - $this->imgdata_xsmall[9][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAn1'. - 'BMVEX///////+/v7+/v7/G/8aUxpSMvYyUzpSMzoyM1oxarVqE'. - '/4R7/3tavVpKnEpaxlpz/3Nr/2tKtUpj/2Na51pKzkpK1kpK50'. - 'pK/0oYcxgp/ykYlBgY3hgY7xgY9xgQ/xAI/wgA/wAA9wAA7wAA'. - '5wAA3gAA1gAAzgAAxgAAvQAAtQAArQAApQAAnAAAlAAAjAAAhA'. - 'AAewAAcwAAawAAYwA0tyxUAAAAAXRSTlMAQObYZgAAAAFiS0dE'. - 'AIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAw'. - 'kUKBrZxq0HAAAATElEQVR4nGNgQAGccrIcEJaivISyhjaIxa7I'. - 'I6CiqcMKZMopKqho6OhLA5kyqmqaOobGICartraeoYkJSAGDnj'. - '6QZQIxgk1Skg3VeABlVgbItqEBUwAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bxs_darkgreen.png - //========================================================== - $this->imgdata_xsmall[10][0]= 563 ; - $this->imgdata_xsmall[10][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABX1'. - 'BMVEX////////l/+nAwMC86r+8wb28wby8wLy78sCzw7SywrSx'. - 'wLKwvrGuvK+syK+ryq2rx62n36ym3aumxKmk2qij0Keh16ahva'. - 'Og1aSguKKe06KeuaCetZ+d0KGdtZ+bz6Cay56ZyZ2Zwp2Zr5qZ'. - 'rpqYwJuXyZuXrJmVw5mUxZiTxJeTw5eTq5WRwJWPtJKOvZKKuI'. - '6Kt42Kn4yJt42ItIuGsomFsYmEsIiEr4eDr4eBrIR/qoN+qIJ8'. - 'poB7pH56o356on14nnt2nXl0mndzmnZzmXZymHVwlXNvlHJukn'. - 'FtiHBqjm1qjW1oi2toiWpniWplh2hlhmdkhWdig2VggGNgf2Je'. - 'fmFdfGBde19bbl1aeFxXdFpWclhVclhVcVdUcFZTb1VSbVRQal'. - 'JPaVFKY0xKYkxJYUtIYEpHX0lEWkZCWERCV0NCVkM/U0A+U0A+'. - 'UUA+UEA9Uj89UT48Tj45TDvewfrHAAAAAXRSTlMAQObYZgAAAA'. - 'FiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElN'. - 'RQfTAwkUKCFozUQjAAAATUlEQVR4nGNgQAGcoqrcEJYQB5OhSw'. - 'CIxSXGwWThGcIDZCppK5o7hyV6AZl6NnbuoSmFICZ3YHB0RkkJ'. - 'SAFDbEJaSUkJxAjeyEheVOMBQj4MOEkWew4AAAAASUVORK5CYI'. - 'I=' ; - - //========================================================== - // File: bxs_cyan.png - //========================================================== - $this->imgdata_xsmall[11][0]= 530 ; - $this->imgdata_xsmall[11][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABPl'. - 'BMVEX////////F///AwMCvxsaC1NSC0dGCz8+CzMyA//94//91'. - '//9q//9j//9X4uJX09NXz89Xx8dXxMRL//9L5uZL3d1L2NhLxs'. - 'ZLt7cv//8e9fUe8fEe7u4e398epqYehoYX//8L+PgK//8F9fUE'. - '/v4E5+cEb28EZ2cC//8C/v4C/f0CzMwCrq4Cjo4CdXUCaWkCZW'. - 'UB/PwA//8A/f0A+/sA8/MA7e0A7OwA6+sA5eUA5OQA4uIA4eEA'. - '3NwA2toA2NgA1dUA09MA0tIA0NAAysoAxsYAxcUAxMQAv78Avr'. - '4AvLwAtrYAtbUAs7MAsLAAra0Aq6sAqKgApaUApKQAoqIAoKAA'. - 'n58AmpoAlZUAk5MAkpIAkJAAj48AjIwAiYkAh4cAf38AfX0Ae3'. - 'sAenoAcnIAcHAAa2sAaWkAaGgAYmIUPEuTAAAAAXRSTlMAQObY'. - 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAA'. - 'AHdElNRQfTAwkUKQFKuFWqAAAATUlEQVR4nGNgQAGsUjJsEJaR'. - 'grC5qz9YzIiL28YriB3IlDZRsnYNiZUDMmXtHT2CE9JBTDb/wI'. - 'jkzEyQAoaomMTMzEyIERzy8hyoxgMAN2MLVPW0f4gAAAAASUVO'. - 'RK5CYII=' ; - - //========================================================== - // File: bxs_orange.png - //========================================================== - $this->imgdata_xsmall[12][0]= 572 ; - $this->imgdata_xsmall[12][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABaF'. - 'BMVEX//////////8X/3oD/3nj/1HX/0Gr/xGP/rkv/gBf+iS/2'. - 'bAL1agDxaQDuZwDrZwLpZQDmZQLlZADjcx7gZATeYQDdZgraXw'. - 'DZXwHYXgDXiEvXZAvUjlfUXwXTjVfTbR7ShUvRbR7RWwDMWQDL'. - 'WADKooLKWADJoYLJgkvHWATGoILFn4LFgEvFVgDEZx7EVQDDt6'. - '/DVQDCt6/CnoLChlfCVADAwMC+hFe+UgC8UgC6UQC4gVe4UAC3'. - 'gVe3UAC1gFe1eUu1TwC1TgCzTgCwTQKuTACrSgCqSgCpSgCpSQ'. - 'CodEulSACkRwCiRgCdRACcRACaQwCYQgCWQgKVQQCVQACUQACS'. - 'UR6RPwCOPgCNPQCLPACKPACJOwCEOQCBOAB+NwB9NgB8NgB7NQ'. - 'B6NwJ4NAB3RR52MwB0MgBuLwBtLwBsLwBqLgBpLQBkLQJiKgBh'. - 'KgBgKwRcKABbKQJbJwBaKQRaJwBYKAJVJQDZvdIYAAAAAXRSTl'. - 'MAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9k'. - 'X5EAAAAHdElNRQfTAwkUJBSSy88MAAAATUlEQVR4nGNgQAGqwo'. - 'paEBYPJ4eKezCIpc7HwmrqG6ENZMpLihm6RaWEAZl6Vo7ekRnF'. - 'IKZWSHhcTnk5SAFDfFJWeXk5xAjj1FRjVOMBeFwNcWYSLjsAAA'. - 'AASUVORK5CYII=' ; - - //========================================================== - // File: bxs_lightblue.png - //========================================================== - $this->imgdata_xsmall[13][0]= 554 ; - $this->imgdata_xsmall[13][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABVl'. - 'BMVEX////////d///AwMC7wcS08P+y+P+xxdCwxM+uws2twMur'. - 'vsinzNynytylzuKhyN6e5v6d5P+d1fOcwNWcu8ub4f+at8iZ3v'. - '+ZvdGY2/yW2f+VscGU1vuT1fqTr72Sx+SSxeKR0fWRz/GPz/OP'. - 'rr+OyeqMy+6Myu2LyeyKxueJudSGw+SGorGDvt+Cvd6CvN2Aud'. - 'p+uNd+t9Z9tdV8tdR8tNN6sc94r813rct2q8h0qcZ0qMVzp8Rx'. - 'o8Bwor5tn7ptnrptnrlsnbhqmbRpmbNpi51ol7Flkqtkkqtkka'. - 'pjj6hijaRhjaZgi6NfiqJfiaFdh55bhJtag5pZgphYgJZYf5VX'. - 'cn9Ve5FSeI1RdopRdYlQdYlPc4dPcoZPcoVNcINLboBLbH9GZn'. - 'hGZXdFZHZEY3RDYnJCXW4/W2s/WWg+Wmo7VmU7VGM7U2E6VGM6'. - 'VGI5UV82T1wGxheQAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHU'. - 'gAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUJziL'. - 'PvAsAAAATUlEQVR4nGNgQAHsQgqcEJYgG5Oegy+IxSHOxmTiFs'. - 'gFZMprKBnbB8e7AplaFlbOQUl5ICanX0BEWmEhSAFDVGxKYWEh'. - 'xAjusDBuVOMBJO8LrFHRAykAAAAASUVORK5CYII=' ; - - //========================================================== - // File: bxs_darkgray.png - //========================================================== - $this->imgdata_xsmall[14][0]= 574 ; - $this->imgdata_xsmall[14][1]= - 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABm'. - 'JLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsRAAALEQF/ZF+RAAAB'. - 'iElEQVR42k3QPU8TYRwA8P//ebkXrgdIColXRAOEkJqbaExMut'. - 'DBhE1GNjYHPg+DG6ODiU6QOLjVxITBcFKBYCstlAC2Bz17fe76'. - 'vLD6+wg/1FpTRFR5lpaub/u1eGBGaAT4HneD4OlXx7avtDYUjT'. - 'HQabd2Ti8e3vVSKzxrtHS32wIpFVldno22Nqvvg2Bhl0gp/aNm'. - 'vJ3qqXAtLIva+ks1H0wqlSXi4+d6+OFTfRsAfHJx2d1od24rZP'. - 'xP2HzopINr1mkesX7ccojqif0v9crxWXODZTno3+dNGA7uWLsd'. - 'mUYU4fHJCViMG9umLBmM4L6fagZGg9QKfjZ+Qfy3C3G/B3mugF'. - 'IHHNcDf64E3KJALApk2p8CSolUUqLjFkyxOGMsTtFyJ+Wz57NQ'. - '8DghS4sLB0svioeZZo7nPhFoUKZDIVFbglkTTnl5/rC8snjAkJ'. - 'Bk/XV5LxHC/v7tR8jzTFPbg8LENK9WX0Vv31T2AEmCSmlKCCoh'. - 'ROnP1U1tPFYjJBRcbtzSf+GPsFTAQBq1n4AAAABKdEVYdHNpZ2'. - '5hdHVyZQBiYzYyMDIyNjgwYThjODMyMmUxNjk0NWUzZjljOGFh'. - 'N2VmZWFhMjA4OTE2ZjkwOTdhZWE1MzYyMjk0MWRkM2I5EqaPDA'. - 'AAAABJRU5ErkJggg==' ; - } -} - -?> diff --git a/#jpgraph/src/imgdata_bevels.inc.php b/#jpgraph/src/imgdata_bevels.inc.php deleted file mode 100644 index c98fa571..00000000 --- a/#jpgraph/src/imgdata_bevels.inc.php +++ /dev/null @@ -1,104 +0,0 @@ - 'imgdata'); - - protected $colors = array('green','purple','orange','red','yellow'); - protected $index = array('green'=>1,'purple'=>4,'orange'=>2,'red'=>0,'yellow'=>3); - protected $maxidx = 4 ; - - protected $imgdata ; - - function __construct() { - //========================================================== - // File: bullets_balls_red_013.png - //========================================================== - $this->imgdata[0][0]= 337 ; - $this->imgdata[0][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'. - 'BMVEX////////27t/f3+LFwcmNxMuxm62DmqKth1VpZmIWg6fv'. - 'HCa7K0BwMEytCjFnIyUlEBg9vhQvAAAAAXRSTlMAQObYZgAAAA'. - 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. - 'RQfTAxcBNhk+pYJVAAAAl0lEQVR4nE2Q2xLDIAgFHUWBKJf//9'. - 'oekmbafVDZARRbK/pYTKP9WNcNv64zzUdd9BjmrgnsVXRNSzO3'. - 'CJ5ahdhy0XKQkxld1kxb45j7dp0x2lBNOyVgQpMaoadX7Hs7zr'. - 'P1yKj47DKBnKaBKiSAkNss7O6PkMx6kIgYXISQJpcZCqdY6KR+'. - 'J1PkS5Xob/h7MNz8x6D3fz5DKQjpkZOBYAAAAABJRU5ErkJggg'. - '==' ; - - //========================================================== - // File: bullets_balls_green_013.png - //========================================================== - $this->imgdata[1][0]= 344 ; - $this->imgdata[1][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'. - 'BMVEX////////27t/e3+K3vriUub/Dm18j4xc3ob10k0ItqQlU'. - 'e5JBmwpxY1ENaKBgUh0iHgwsSre9AAAAAXRSTlMAQObYZgAAAA'. - 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. - 'RQfTAxcBNTfJXtxZAAAAnklEQVR4nE2QWY4EMQhDUVhSIRC4/2'. - 'kbaqLp9p+f2AxAayAzDfiK9znPORuvH0x8Ss9z6I9sHp6tcxE9'. - 'nLmWmebmt5F5p2AR0+C9AWpLBjXRaZsCAT3SqklVp0YkAWaGtd'. - 'c5Z41/STYpPzW7BjyiRrwkVmQto/Cw9tNEMvsgcekyCyFPboIu'. - 'IsuXiKffYB4NK4r/h6d4g9HPPwCR7i8+GscIiiaonUAAAAAASU'. - 'VORK5CYII=' ; - - //========================================================== - // File: bullets_balls_oy_035.png - //========================================================== - $this->imgdata[2][0]= 341 ; - $this->imgdata[2][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'. - 'BMVEX////////27t/f3+K5tbqNwcjnkjXjbxR2i5anfEoNkbis'. - 'PBxpU0sZbZejKgdqIRIlERIwYtkYAAAAAXRSTlMAQObYZgAAAA'. - 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. - 'RQfTAxcBNgK0wEu5AAAAm0lEQVR4nE3QVxIEIQgEUErAgTHA/U'. - '+7zbipf9RXgoGo0liMmX6RdSPLPtZM9F4LuuSIaZtZWffiU6Iz'. - 'Y8SOMF0NogBj30ioGRGLZgiPvce1TbIRz6oBQEbOFGK0rIoxrn'. - '5hDomMA1cfGRCaRVhjS3gkzheM+4HtnlkXcvdZhWG4qZawewe6'. - '9Jnz/TKLB/ML6HUepn//QczazuwFO/0Ivpolhi4AAAAASUVORK'. - '5CYII=' ; - - //========================================================== - // File: bullets_balls_oy_036.png - //========================================================== - $this->imgdata[3][0]= 340 ; - $this->imgdata[3][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'. - 'BMVEX////////27t/e3+LO3hfYzz65ubiNwci6uQ12ipadgVGa'. - 'fwsNkbhnVkcaZ5dwSA8lFg7CEepmAAAAAXRSTlMAQObYZgAAAA'. - 'FiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElN'. - 'RQfTAxcCBySi1nevAAAAjElEQVR4nFXPWw7EIAgFUNMoCMhj/6'. - 'staKczc/2RkwjS2glQ+w3YytgXCXCZpRo8gJdGxZadJws13CUP'. - '4SZI4MYiUxypeiGGw1XShVBTNN9kLXP2GRrZPFvKgd7z/sqGGV'. - '7C7r7r3l09alYN3iA8Yn+ImdVrNoEeSRqJPAaHfhZzLYwXstdZ'. - 'rP3n2bvdAI4INwtihiwAAAAASUVORK5CYII=' ; - - //========================================================== - // File: bullets_balls_pp_019.png - //========================================================== - $this->imgdata[4][0]= 334 ; - $this->imgdata[4][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'. - 'BMVEX////+/v7i4eO/w8eHxcvKroNVormtfkjrMN2BeXQrepPc'. - 'Esy4IL+OFaR7F25LHF8mFRh5XXtUAAAAAXRSTlMAQObYZgAAAA'. - 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. - 'RQfTAxcBNgkjEpIxAAAAlElEQVR4nE2QAQ7FIAhDDTAVndL7n3'. - 'ZV/7JfEwMvFIWUlkTMVNInbVv5ZeJqG7Smh2QTBwJBpsdizAZP'. - '5NyW0awhK8kYodnZxS6ECvPRp2sI+y7PBv1mN02KH7h77QCJ8D'. - '4VvY5NUgEmCwj6ZMzHtJRgRSXwC1gfcqJJH0GBnSnK1kUQ72DY'. - 'CPBv+MCS/e0jib77eQAJxwiEWm7hFwAAAABJRU5ErkJggg==' ; - - } -} - - -?> diff --git a/#jpgraph/src/imgdata_diamonds.inc.php b/#jpgraph/src/imgdata_diamonds.inc.php deleted file mode 100644 index a0d6a421..00000000 --- a/#jpgraph/src/imgdata_diamonds.inc.php +++ /dev/null @@ -1,177 +0,0 @@ -'imgdata'); - protected $colors = array('lightblue','darkblue','gray', - 'blue','pink','purple','red','yellow'); - protected $index = array('lightblue' =>7,'darkblue'=>2,'gray'=>6, - 'blue'=>4,'pink'=>1,'purple'=>5,'red'=>0,'yellow'=>3); - - protected $maxidx = 7 ; - protected $imgdata ; - - function __construct() { - //========================================================== - // File: diam_red.png - //========================================================== - $this->imgdata[0][0]= 668 ; - $this->imgdata[0][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'. - 'BMVEX///////+cAAD/AADOAABjAABrAADWGBjOCAj/CAj/GBj/'. - 'EBCcCAiMOTl7KSl7ISFzGBilGBjOEBBrCAjv5+eMQkK1QkKtMT'. - 'GtKSnWKSn/KSlzEBCcEBDexsb/tbXOe3ucWlqcUlKUSkr/e3vn'. - 'a2u9UlL/a2uEMTHeUlLeSkqtOTn/UlL/SkrWOTn/QkL/OTmlIS'. - 'H/MTH/ISH39/f/9/f35+fezs7/5+fvzs7WtbXOra3nvb3/zs7G'. - 'nJzvtbXGlJTepaW9jIy1hITWlJS1e3uta2ulY2P/lJTnhITne3'. - 'vGY2O9Wlr/c3PeY2O1Skr/Y2P/WlreQkLWISGlEBCglEUaAAAA'. - 'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'. - 'sSAdLdfvwAAAAHdElNRQfTAwsWEw5WI4qnAAABGUlEQVR4nHXQ'. - '1XLDMBAFUKUCM1NiO8zcpIxpp8z0//9SWY7b2LHv6EU6s1qtAN'. - 'iMBAojLPkigpJvogKC4pxDuQipjanlICXof1RQDkYEF21mKIfg'. - '/GGKtjAmOKt9oSyuCU7OhyiDCQnjowGfRnooCJIkiWJvv8NxnG'. - 'nyNAwFcekvZpPP3mu7Vrp8fOq8DYbTyjdnAvBj7Jbd7nP95urs'. - '+MC2D6unF+Cu0VJULQBAlsOQuueN3Hrp2nGUvqppemBZ0aU7Se'. - 'SXvYZFMKaLJn7MH3btJmZEMEmGSOreqy0SI/4ffo3uiUOYEACy'. - 'OFopmNWlP5uZd9uPWmUoxvK9ilO9NtBo6mS7KkZD0fOJYqgGBU'. - 'S/T7OKCAA9tfsFOicXcbxt29cAAAAASUVORK5CYII=' ; - - //========================================================== - // File: diam_pink.png - //========================================================== - $this->imgdata[1][0]= 262 ; - $this->imgdata[1][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'. - 'BMVEX///+AgID/M5n/Zpn/zMz/mZn1xELhAAAAAXRSTlMAQObY'. - 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. - 'AHdElNRQfTAwsWEi3tX8qUAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'. - 'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'. - '6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'. - 'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'. - '==' ; - - //========================================================== - // File: diam_blue.png - //========================================================== - $this->imgdata[2][0]= 662 ; - $this->imgdata[2][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA+V'. - 'BMVEX///+AgIAAAJwAAP8AAM4AAGMAAGsQEP8YGHMQEHMYGP8Q'. - 'EKUICJwICM5KSpQxMYQpKXsYGNYQEM4ICGsICP97e85aWpw5OY'. - 'xSUv85ObVCQt4xMa0pKa0hIaUpKf+9vd6EhLVra+dzc/9SUr1r'. - 'a/9aWt5SUt5CQrVaWv9KSv8hIXs5Of8xMf8pKdYhIdYYGKUhIf'. - '/Ozs739//v7/fn5+/v7//n5/fW1ufOzufOzu/W1v+trc69veel'. - 'pc6trd6UlMa9vf+MjL21tfe1tf+UlNZzc61ra6Wlpf+EhOeMjP'. - '9ra8ZSUpyEhP9CQoxKSrVCQv85Od4xMdYQENZnJhlWAAAAAXRS'. - 'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'. - 'LdfvwAAAAHdElNRQfTAwsWEx3Snct5AAABFklEQVR4nHXR5XbD'. - 'IBgGYM6AuHsaqbvOfeuknev9X8xISbplSd5/8JyXwwcA/I0AKm'. - 'PFchVBdvKNKggKQx2VIoRwMZihMiQE49YUlWBCcPL0hYq4ITh+'. - 'qKECUoLDZWqoQNA766F/mJHlHXblPJJNiyURhM5eU9cNw5BlmS'. - 'IrLOLxhzfotF7vwO2j3ez2ap/TmW4AIM7DoN9+tu+vLk6Pdg9O'. - '6ufXjfXLm6pxPACSJIpRFAa+/26DhuK6qjbiON40k0N3skjOvm'. - 'NijBmchF5mi+1jhQqDmWyIzPp1hUlrv8On5l+6mMm1tigFNyrt'. - '5R97g+FKKyGKkTNKesXPJTZXOFIrUoKiypcTQVHjK4g8H2dWEQ'. - 'B8bvUDLSQXSr41rmEAAAAASUVORK5CYII=' ; - - //========================================================== - // File: diam_yellow.png - //========================================================== - $this->imgdata[3][0]= 262 ; - $this->imgdata[3][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'. - 'BMVEX///+AgIBmMwCZZgD/zADMmQD/QLMZAAAAAXRSTlMAQObY'. - 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. - 'AHdElNRQfTAwsWEwcv/zIDAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'. - 'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'. - '6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'. - 'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'. - '==' ; - - //========================================================== - // File: diam_lightblue.png - //========================================================== - $this->imgdata[4][0]= 671 ; - $this->imgdata[4][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/1'. - 'BMVEX///+AgIAAnP8A//8Azv8AY/8Aa/8I//8Y1v8Izv8Y//8Q'. - '//8InP8Qzv8Ypf85jP8he/8Yc/8Ia/8pe/8p//8p1v9Ctf8xrf'. - '8prf8QnP8Qc/9CjP+1//97//9r//9S//9K//9C//85//8x//8h'. - '//9r5/9K3v9S3v851v97zv9Svf85rf8hpf/G3v9SnP9anP9KlP'. - '8xhP/n7//v7+f3///n///O//+U//9z//9j//9a//975/9C3v8h'. - '1v+E5/+17/9j3v/O7//n9/+95/+l3v9jxv+U1v8Qpf9avf9Ktf'. - '+Uxv+11v97tf9rrf+cxv+Mvf9jpf+tzv+Etf/O3v/39/8Akkxr'. - 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'. - 'IAAAsSAdLdfvwAAAAHdElNRQfTAwsWEiHk6Ya/AAABGUlEQVR4'. - 'nHXQ13KDMBAF0J2o0E01GHDvJa7p3em95/+/JQJMYjDc0Yt0Zr'. - 'VaAaxHgtxwbSGPkGQpOIeQ2ORxJiJmNWYZyAhZR0WcgQGhViU0'. - 'nEGoedDHGxgRapRPcRpXhOr7XZzCmLjaXk9IIjvkOEmSRLG62+'. - 'F5XlEElhA5sW21GvXj6mGlDBfnJ51lr9svnvEKwH1hu2QPbwd3'. - 'N9eXVzuL7/Hn29frdKaamgcgy67L3HFG9gDefV+dm5qme4YRXL'. - 'oVR374mRqUELZYosf84XAxISFRQuMh4rrH8YxGSP6HX6H97NNQ'. - 'KEAaR08qCeuSnx2a8zIPWqUowtKHSRK91rAw0elmVYQFVc8mhq'. - '7p5RD7Ps3IIwA9sfsFxFUX6eZ4Zh4AAAAASUVORK5CYII=' ; - - //========================================================== - // File: diam_purple.png - //========================================================== - $this->imgdata[5][0]= 657 ; - $this->imgdata[5][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'. - 'BMVEX///////8xAP/OAP+cAP9jAP9rAP+cCP85CP/OEP9SKf/O'. - 'CP9CEP9zGP9rCP+lGP/WOf/WIf9KIf9jOf+MQv+EMf97If9zEP'. - '+1Sv+lIf/ne//eUv/na//n5//Oxv/Wzv+chP9zUv97Wv9rQv9a'. - 'Mf9KGP/v5/+te/97Kf+9Y/+tOf+tKf+lEP/vtf/WMf/WKf/v7+'. - 'f39/+tnP+9rf9rSv9jQv9CGP+ljP+EY//Gtf+tlP+Ma/9zSv/e'. - 'zv+UUv+9lP+cWv+lY/+cUv+MOf+EKf+UQv/Opf/OhP/Ga/+1Qv'. - '/Oe/+9Uv/ntf/eWv/eSv/WGP/3zv/vlP/WEP//9/+pL4oHAAAA'. - 'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'. - 'sSAdLdfvwAAAAHdElNRQfTAwsWEjX+M1LCAAABDklEQVR4nHXQ'. - '1bLDIBAGYFqIEW+ksbr7cXd3ff93OUCamdOE/Mxw882yywLwPz'. - '+gNKotlRFUVnNUQlCxTMRFCKEdE+MgpJaEiIOU4DKaoSIygtb3'. - 'FBUQrm3xjPK4JvXjK0A5hFniYSBtIilQVYUm+X0KTVNiYah+2q'. - 'ulFb8nUbSovD2+TCavwXQWmnMA6ro+di+uR5cPzfPhVqPV3N1p'. - 'n3b3+rimAWAYhP3xnXd7P6oc9vadPsa1wYEs00dFQRAFehlX21'. - '25Sg9NOgwF5jeNTjVL9om0TjDc1lmeCKZ17nFPzhPtSRt6J06R'. - 'WKUoeG3MoXRa/wjLHGLodwZcotPqjsYngnWslRBZH91hWTbpD2'. - 'EdF1ECWW1SAAAAAElFTkSuQmCC' ; - - //========================================================== - // File: diam_gray.png - //========================================================== - $this->imgdata[6][0]= 262 ; - $this->imgdata[6][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'. - 'BMVEX//////wAzMzNmZmbMzMyZmZlq4Qo5AAAAAXRSTlMAQObY'. - 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. - 'AHdElNRQfTAwsWExZFTxLxAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'. - 'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'. - '6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'. - 'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'. - '==' ; - - //========================================================== - // File: diam_blgr.png - //========================================================== - $this->imgdata[7][0]= 262 ; - $this->imgdata[7][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'. - 'BMVEX///+AgIBmzP9m///M//+Z//8hMmBVAAAAAXRSTlMAQObY'. - 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. - 'AHdElNRQfTAwsWEwCxm6egAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'. - 'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'. - '6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'. - 'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'. - '==' ; - } -} - -?> diff --git a/#jpgraph/src/imgdata_pushpins.inc.php b/#jpgraph/src/imgdata_pushpins.inc.php deleted file mode 100644 index e59b7427..00000000 --- a/#jpgraph/src/imgdata_pushpins.inc.php +++ /dev/null @@ -1,517 +0,0 @@ - 'imgdata_small', - MARK_IMG_SPUSHPIN => 'imgdata_small', - MARK_IMG_LPUSHPIN => 'imgdata_large'); - - protected $colors = array('blue','green','orange','pink','red'); - protected $index = array('red' => 0, 'orange' => 1, 'pink' => 2, 'blue' => 3, 'green' => 4 ) ; - protected $maxidx = 4 ; - protected $imgdata_large, $imgdata_small ; - - function __construct() { - - // The anchor should be where the needle "hits" the paper - // (bottom left corner) - $this->anchor_x = 0; - $this->anchor_y = 1; - - //========================================================== - // File: ppl_red.png - //========================================================== - $this->imgdata_large[0][0]= 2490 ; - $this->imgdata_large[0][1]= - 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. - 'B3RJTUUH0wMKBh4Ryh89CgAACUdJREFUeJy9mNtTFFcexz+/7p'. - '4Lw1wZJKDGCAwmDAqUySamcCq1ed6k9mn3UfMP7F+1T3nYqn2J'. - 'lZdoDEjpbq0KG8EBFBFBEJye6Zmenkv32Ydu5GYiUMmeqq6uqT'. - '6Xz3zP73aOcIKmAQkIFyD3N/jrBPwlKjLQEglVlJKyUjR3u7cc'. - 'WLoP3/4dvv03LNrQ8I6x1rFbDML9kOmHvh7IRHU9JKmUSG8vpF'. - 'IoXX/TV0AiEM5A5jT0noFMFMJHXUt/d5f9TUAbhtQ3cPFruDog'. - '8klHMnmO0dGYe/myOJGINEwTz3F2higFXgy8PpAkOC+h8hoaCt'. - '4ppHFcQAWSgOQlyI/p+lUjmRxWAwNJd3xca/f34yoFi4tgmjtD'. - 'NIFkJ4xcgBCgVqEBFJ9DqcZea/gNAAVEg7AOGYnHe9XoaJd3+X'. - 'LISSSwnz6lsbKCZ9sHh4UVdBkwdA6cPwNnIfJPmC3Ctgft3wwQ'. - 'QPkvTZJJnbExzfvsM2nMzVG7e5fG48d4lnXwTwEYCjJxuHQBog'. - 'BHUfKkgAIIhiGk06hTp/Dm5qS1uYlXLvtWd4gPgIiCrAEcVckT'. - 'Ab5p7TaYJrK1hQaEenrwSiVfQdc91P0kSp7Ii89D5ksY/kAkLy'. - 'IZXFdXkQjS1YUSEbdcRu168V6+HTUNIKJDRwdE+sBIQmP9Ld59'. - 'bEBA3of4F/D+uXb7rGaaCSmXI3pPj64PDaHCYfEqFVSjgWo2D2'. - '73XlJNQTgCyQykIuBWoNKEeh1aLXBPBCggGdBOgxZVSjoajVhH'. - 'o5HWlIpq4bCQSgm9vXhK4ZZKh5SUYygp4J1EQVUD9xlU18BJQD'. - 'bUbJ5T5XJStyxN9fSI099P3baxV1dRloW2h2ivx/yakg2ot6F1'. - 'EkCa4G1D+zVEq5ArKTWM42Q6HUczQV7U66w9e0ZpdRXlOIQ5vF'. - 'VHUXILKify4jiEzkOqC3peQMoBQymFlMt4Dx6wUSxSsm2UZXEK'. - 'P30QvOUt8/2Sd78CdWwFDTA+gsw3cOlPcPUD+CQB52oQ21RKXM'. - 'eRhGXhOg7VoKrx8KuS4ygZhVg3ZI8FGIfwR9BVgAtfwxdXdP3L'. - '86nUR91dXelNXTeWWy10paQHX602YAP1ADASAL7LJvFtMpOCc0'. - 'cG3FHuGlz6Gr4YEpnoTCbzsdHRbOzy5RCRiLRMk5rjyOtAimwA'. - 'U4U3SurBN/0wnAASBCVDIKpB4kiAB5Ub0/UvO9LpPAMDGfn005'. - 'AxPCzxep3Q6iqPLUseBoufCZRsAE6g5g5kKIDfKUj3wnpAG8QB'. - '/Z1OIqANQuI65AtwNScyYXR2XlAXL2YZHzcklRKWl5GVFXFtGx'. - 'MoAiV/EQaAGH6BUQNWgQpwFngv+Ca8KUAQEBcwgTJHyMV7679R'. - 'XS8YqdSI6u/PMD5ukMtJY3GR2uQkr5aXeWVZOEALmA8WsIAxfL'. - 'd0goVLAdCOd+/YpgqeVtBv4yiA++q/RKKXixe7GB8PSyoljcVF'. - 'yg8fyubyMpulEk2lyAIfAAvAC+B+oOQFoAt/+0rAejB/EzjNri'. - 'vvqNnCd64jxcE39V8spnP+vMbAgDSePKE2NcXm06dslMuUlcID'. - 'TuFvqwXMBU8N39bGgRR+ki0Dz4L5DSAe9NGD7zq+6kcN1L6H2b'. - 'ao5WWaQHllRTafPmWrVMJUimoAQrBYJFjQwre7B6A8YAi8LCgD'. - '5DVo6/hbb/iHK1KggvFeD3hHziQKEMuiNTNDbXGRTdtmw7Iwla'. - 'KGH0oqwbscLOoG46rAY6AOzRhY74PT6QuUKEN4PegXxd/yEDTT'. - 'YMWOk+oEaLkuFdNk0zTZwjfkavDUArXWgGXgFb4dEShXhfYqlI'. - 'ow3w9rg3B6ED60IOOA5oEYQBrcpG+mj9bg0VG8GMJhVDZLyzAo'. - 'VSq8rFYxXXefcjVgG9+uisDrXUCApoKSBcUHMBmHhfcgNwhtD3'. - 'q9IG6Lr15b4OUTmPwBJt8JqGuapp05o0mhoHnptLQfPsR+8IBK'. - 'uYyNH3yr+B77LHheA3tK1Ta+IrMeTL2C6Xl48TOsNWDDgAz7s5'. - '/r+krP/eddCsbj8fDQ4GBm9MqVvvRXX2VULBayRGRzaYn1SoWa'. - 'UjgB4PIB5QK4ZgBXBKaAHxQsrED1H7CRgCUPwgHZDqACmhWwXv'. - '2aDRqGYeRyufS169cvThQKV88PDuYbW1vJ5VRK+5euqxWlPMdX'. - 'SRqgreHbZGN3ijfKBXBTAeh2Fdwi2MofshP/dvKwCmKhp4m83Y'. - 'vj8Xg4l8tlCoXC0MTExMTFkZE/1m37wvLGRvKRacoD1209E7Fc'. - 'pZwYREOQqEJ4z3HskHLsz4AoXykPIBSN0t3dTTQafROoHdumXC'. - '4fjoMiog0ODiauX7+eLxQKV3O53ETdti88nJnJ3rl505ifmWm3'. - 'arWSodR8GNbycDoNHy5C5jFold1k8d+DyvELNwg93d18/vnn9P'. - 'X1oes6nufx/Plz7t+/fxhQKSWJRCI5NjaWHxkZKdj1+sjSwkJm'. - '+uZN/dZ337VqCwullGUVdZjsgIUC5LqhrUPvCugWuApeApPAzY'. - 'PKHWyaphGNRunt7WVwcBARwfM8Ojo6sCzrMKBhGLphGFEF2Wq1'. - '2jc7M5OZ/vHH0MPbt93awkJJmeZsC6ZaMK3DCwvWdNioQUb5B6'. - 'AdBR+9SzkAz/NwHIeXL18iIui6TjgcJplMMjY2th8wHo+Hh4aG'. - 'MsPDw6fddru7+Phxx51bt/RbN260qwsLpZhlFZsw9QJ+2Pbrga'. - 'oJG2FY2oKwuTtVEz9uV34NbqdtbW0xPT1NNBoF4MyZM1y5coWu'. - 'rq5dQBHRcrlc4tq1a/l8Pj9RMs38ndu3Ez//9JNXLRZNyuXZJk'. - 'xVYKoExQpsK/+IaAuYb7no8zjC/R+A4zisrq7u+53NZjl16tQ+'. - 'QIlEIslsNpuPRCJXZ2dnh2/duNFRW1oy07a96MKd575yxRqU1B'. - '5vPMpF5HHa1tYW9+7do7Ozc/eQpZTSQ6FQt1Lq8pMnT/5w7969'. - 'nuLcXE1rNufO9fRMhlKpOyvt9qPtVmvb25fFfvvWbrepVCqHwo'. - 'xaX19vff/996ZhGC8qlkW9Wt1Onz073fXxxz+6MB+9e9dUjuO+'. - '7ebq9wLdB9hoNCrr6+s/4wf3FCJW3fPmTZhXsNWCprjuW66Dfr'. - '928KAfBhJAEgiJSLuzs7OSTqctoFkqlZRt26j/I+L/AGjPTN4d'. - 'Nqn4AAAAAElFTkSuQmCC' ; - - //========================================================== - // File: ppl_orange.png - //========================================================== - $this->imgdata_large[1][0]= 2753 ; - $this->imgdata_large[1][1]= - 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. - 'B3RJTUUH0wMLFQ0VCkHCzQAACk5JREFUeJytmGtzG0d2hp8zNw'. - 'AEcRdJ6EJK9FL0CqZUm9jWbkwq3vhDstl8dmLvz8rP2H8Q75ZT'. - 'pkRfpLgqsS6WIFEKGYkiSBCDO+banQ8DUpRWEkklXQUUqlCDfv'. - 'rp857pgfAOQ4AMOJdg4R/hX96Hf06bvDc5iT07i8yeg8ksiIAI'. - '4TBi/ds9/vivD/njapNHvRBfHXMu410AM+BUoVSF05NQsi1sO4'. - '8402AXwLQTuP31OAZO2aG0MEn14iSlnI1z3LnMk8IZYJyBwjIs'. - '/TWsVIWPJkvMFS4zMfMhUp5BsoCpAAEBLYKaMFGn00jBxnvu02'. - '35+JHmSJEnBpQEcPo38MmCxd/nS9Ry71Ga/g1W9a8gn0GsHkgA'. - '6DGjxkqb5CoO+YxF3A3p+jGjQUzoK+L/V0ADzFMwtSR8eLbAr8'. - 'uXOTf9NzhTc0geSLUQcYHgYEH786RMg0zWJHV2Aitv4x/HpHVS'. - 'QA2YBqTTGIUq5qkPMWaWkVwPnPtAA/BevmZcjxaaUtHh8pJJGu'. - 'DpCB9FvT7A7YT7S3p5vFMNzmWo/O0MSx/Ms3TqI8r59zFTfUQe'. - 'I7SBODE3tnfoIxYnNHligwik0zAzDdVpyKbA8sff5YAeMEwgkV'. - 'cufQeTJzZoCsaFLKXPTnNpoUTNsSgJmNoGsuNQjIDwYD2HlnZy'. - 'k++yxTKXZfKTU8zOpjhneeQYkorSmGERtIlICBKRbLX+y98YN3'. - 'ADcNIm+bJD4U3pPnmbEaRgYVRTGBkDSSsmxKfY7ZLuDJA4hdjl'. - 'JEgyBB2SJOvQ9RzTpNKoEwNq0CNFvOXR3/HxMgYVPObaz8kPmh'. - 'hkEWMatAfRONGGvLizyOE9P8KkpwhPDAgQKJQbELUD0oOIhbbH'. - 'JeVTmowxjAgZutB5AoOngA+2DdYrcTyOyYZP9+QpBvI29vwEhb'. - 'It042BVQgDy9KTMfkwQG1A9ACCLlgBBGUwxxoc52WDh2ATyEPp'. - '1hoaPvrEBh0Dq5an9OUsl/9hylk5b5c+mowLc4E2Jtw4Eoljyf'. - 'ogA/AGEAagNRjGyUxOmEycyVA5EWDBxrmUp3ytLIv/NJP69Goh'. - '+9mFydIvS5PZYkvH1oY/RFtKymlwBFQAgQd+kAA6qSQ8pvn2mp'. - 'SkJkuVFHPHBnQMrEt5Sl+e4/Lvp51PF1PF5Xy6WMvOWZXMom8z'. - 'OZTQ8+j5sbQiMEwopsCIwRtBGIJSCdzbTGo9NimkDcgdC7Bg49'. - 'TG5n4/nfr0Si77WdYp1YzyZEkWPdteaEnB7pPqBTxuIf/VgciE'. - 'SgasCPwh+GNIkaNNag1RiPge5pEhMQVjfoLcF+eoXSvbKxedwn'. - 'LKzC3KWbOi5/sW5a44/SHFUSgVA7SCzRG0AvA9mPOgFIETgu4n'. - 'Ww0wNQWFAqRSL6D2ZQYBdDrQ7R7jXiwgRcvIL02makuTmWtpM/'. - '+BlLMl5vuWzLVEuwH6oYnR1KS8kJINGXMM2YdfRlALoQoQQKeb'. - 'bDVwoMdxQMaLCwLo96HZTF5HbrEhmOftianfZisfzueKv7ZmrX'. - 'MsjhxKXZGBjzyeEHmSE3oWiggtyVGmE8DTIXTC5NxgAxOAGUM8'. - 'fun9mnSSLQ/CxNzOTgJ3LIMgoGwkKBiiMyaVviHVkdCO4FEKNv'. - 'LQzWBYHfITPa4UBVM0LR/WB7ARJsdDDTjA6deYFIFUOimJ3d0E'. - 'sNdLavYYgBpthqKcjiiJRO8K6CK0CsJTjfQAGaJtD9vQFAxNNQ'. - '1FB0yBAfA8gdMAIagLoCVAen0M00zMOTYShNDtoHs9CAIUoI4E'. - '1IBihCdNhsMhsj6NuV7BCC2IBpBqQaaFOENCCeiEsO1BO4RQgy'. - 'I5Hm4k4oIU9MrgZSAdBeTabZz+ODxKQRRBFBJo6IUc51anYRQo'. - 'dto+24FNxYCiaWKkQsj00KkO4gxRRkAngJ868M0u3OkkM+hxQA'. - 'cQ7YD7GO5XYSsPZybh/TCkFIYY+kWniTW4Q7jXgHvHMhiRpmuW'. - 'ca08GZkkZ/nY6TZMNhCnf2CuPoDVJvxpB+q9BHA8Ag1uH+oP4c'. - 'YEPCzDwmzSLquShHW/E0YRbG/BjZtw40hAy7aNzJlzRn75E6N0'. - 'qiwTzafI7kOU3gWrhzZC2iHcbsPqLlxvJnCt4KC1RYAL3I5hzY'. - 'Xv/huePYCtITQMKEnyB4KQvMURuJvw889HGSwUCs7CwkLpo6tX'. - 'Ty/+7nel6VLGDn/8N9m+eZuo1UP8iNhLau6b3RfmOsHBGTUYw9'. - 'WBNeDrGB4+h/4qNLKwTnLbHj9CJw/6GoIh9Jpvq0HHcayFhYXi'. - 'l3/4w9LK8vLKexfma3G/mb/3n1njTivS7tNQaaU1grQDjJ868D'. - 'Axx6vmxnBrY9C9IcSbSXbavNjb/S3eN6/0m1JcKBScixcvllZW'. - 'Vi6uLC8v12q1v/M8b/HxVjP//YYr32yE4dYWvShO0ogi14xwxq'. - 'F4rbnxZ3cMjtpvEEeMvwA0TdOYn5/PffHFF7Vr166tvPeLXyx7'. - 'nrd4+/btyg/frFo//Xgncnd67qCn78earQqcmYD3fSi1wPCTSV'. - '3gzqvm9uFOMl5nUAqFQn5paal26dKla57vf7D+6FHph9VV88af'. - 'vgq79bo70e3VT2l9A3hYg4UiRALVHTCHSZvYBm4A//6quf8zoG'. - '3bpuM4acMwKr1+//SDe/dK31+/bv90/Xrcq9fduNW6rbVeC+E7'. - 'gWdD2DKg4UEpBmPcm10RuScida31ntb62HAigoigDw6Gh0axWH'. - 'QWFhZKi4uLZ+I4PrVer2e+u37dXPvqq6hbr7tOp1NXWq89h6/b'. - '8FBB34WGBesdcPrj38lkMkGlUuml0+mu53nR3t4eo9HoSLhMJk'. - 'OlUiGdTuN5Hq7rvgA0TdO4cOFC7vPPP6/VarXldqdTu7m2lrv7'. - '7beq++BBO263b/tKrfWSXlbvwJ6CuAtDgTYiaBFMw6BSqfDxxx'. - '+rarWqGo0GN2/eZGtrC6XenAkRoVKpcPXqVWZmZmg0Gty6desF'. - 'oIhIOp3Ol8vlmmVZK3fv3Lm09uc/Zwbr653ccPgoNIzvnmn99Z'. - '7W9QG46lAaM5mM2l95GIYUi0VOnz7N7OwsWmsymQzyuse5Q8Mw'. - 'DNLpNDMzM5w/f/7A6AGgUkoajYa9urpayOXzUz/fvZutr68Pim'. - 'F4/2y1+n2o9Q/ru7uPesPhXnyo4A+vfHp6mmazybNnz9jZ2UFr'. - 'TbPZJAhe+8/aS0Mphed5NBoNABqNBqPR6MWBVWstvu/nnj9/Pv'. - 'vo0aPq5uZmPBgM/qcwPf39xV/9ajU1M3Nvq9PZaw8GoT50PjdN'. - 'k6mpKa5cucL58+eJ45j19XWePHnCzs4OnudhmiaWZRGGIVH05r'. - 'yEYYjrumxubrKxsfFyDQJ6NBp1Pc+7C4jWumBaVm+kVL2l1H2l'. - '1G6otS+H6V6z8u3tbVzXpdFooJRicXGRqakptre3uXXr1ltrcT'. - 'Qa8ezZszemWAE9rfUdYBOwtVLRbrPZ+48ff+wDvuu6Sr3MB4Dr'. - 'uty6desgfa1WC3iRyrNnz4pSSmezWUzTfGtYtNYcdvC/9sMlgP'. - 'n5N4cAAAAASUVORK5CYII=' ; - - //========================================================== - // File: ppl_pink.png - //========================================================== - $this->imgdata_large[2][0]= 2779 ; - $this->imgdata_large[2][1]= - 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. - 'B3RJTUUH0wMLFQolY9lkpgAACmhJREFUeJy9mOtzFNl5h5+3b9'. - 'Mz0kzPBWmEVtIiWYhIiC0HCDhB8lb8ISk7nzdZ5+/zJ/8BTmpT'. - '660CZLwG1pVFgBkgGIHECEaa+/T9nHzQCCQuRpCNz6mp6g893U'. - '8/c37ve3qEjxiC4OA4n/Lp/EUu/tsMM/+aEWduVBx7WhdkShcY'. - 'xUH2zo0Dwod/5N6vf8V//PoGdx8M8EOFPtK9jI8BdHCcMuVSmf'. - 'LxHLmSZdm2U8xIbmKETDGDZZnIy4dBbCynyGhphurEDBOlHFnn'. - 'qPcyPxTOwDCOccw7w5nlBRZWylI+ny/mZ6rL1dzUZ5/IWGZU3D'. - 'ZIOMQDDaJcHDVGWUbJBi9odVr0QoVSPzigIEaZ8vgSS/8wZU3/'. - 'k1fylipz5dLM2WlrZqHKaGCKbEbontq3KAKWQyZfZKTgYqc9Bp'. - '2I2PcJ4ogk/UEBQcwipbFZmT13vDBx8fhnE1Ofnp9yJopFyT3X'. - 'yANfks0QHSQMDaL37pOxMLIu2UyVkjVKLjyKSeuD8dAYCFkso1'. - 'gYMaeWJ40T56cl8yAi/O4FSa2P6kYczIDsgVpAqcDImZPMuAB1'. - 'dkLQtcc8a/bwox8IUHAxZVxGZMouSLVYwKuMkD5IxN+JSdsRJB'. - 'pexuTVgYYM6EoGmxkmg3/hEhNUMr/hd7dqbOzExMn/GRDAxWZc'. - 'j3I8HiXfMjF2FQowKw7pjoN6E/Llw/GBJj8qxVOMlX4ipxc/lY'. - 'kl2zBLkmrTcEzMkoNoRLVidLi/9g+Z3I+1xRHX5EcAihxnbPRv'. - 'OTU9kZSmpKPy9FTGrLimPZ1H+UiyGaF67w6n7E1DwMngFDxGvc'. - 'w70v0xZUby5IxjlIyMssUJrJwVWkXBdbXvSvwEibcSdKCAFI16'. - '4/sc0SRo9cGAGq1DwvQFzV6DVuBiV4zYnlEts6A2TSPcSiXoxo'. - 'QqJCEEFMbQ2b69o5qMiOOPqIMQkagu/aSL7waE8101WFShLjk9'. - 'yxgEvjRUiyYd+gwAjY2J9VpXfZ/JEXLhDp3OR6U4T97+hEnPwx'. - 'tv4HsRjy2tTQSFzQgDUnwSLBQRI+x1ZgcH87Vcv4SF19Kt0ezS'. - '1h9s0Ma25pgr/YJfnLnEysok0+ezjM6EBLldGqKIJYuDRhOQEJ'. - 'Oih8X9Q0xmcXNjlCofBJgn78wxVz7L2YWf8tPPz1hnfjbjzfxN'. - 'qVwutq2etZXUQSXikcXGIgUiUkJSDIQMJgYGJsaB3c7b1qQ4GZ'. - 'xSkdGZIwMeNLfK6uezMnvJK3pLxeVixfvMsyVjSNSO6IV9adPG'. - 'AArkEEz8oUkFmBjYGO80qfd6pCWIayD59wIKcsjcKqufn7JO/S'. - 'xfyi+5c24pey5rZ09mJRNkiDdT/tzbkBr3SYkpMYpgEaIJSYhI'. - 'kSOY1GhilAQk5ntDIojxCZ/kf87Pl85xbuWEnLiUy+cW3NNuJX'. - 'MmY5meKf6mT7wZS+THdOjxlG06tIlIOMZxchSxcFFEGAwAGGME'. - 'jwyZYSnWL3cXWiIUbUI6hO/vxXuFOV84ycmlBWthNeflTjuzTi'. - 'lzJmM5s46Ej0J63/ZoPmoy6PYxtYVNhmfs0mbAND1mmKVMBY1L'. - 'mxA1LN7WgXQbCApNhKJHRIM+DQbv7yQGhjnJ5NgFuXBuxpu5mD'. - 'udm3LPuY7pmZLUE6L1SIJaIPFuDAqyw9lnwDYv6NFHkWJh4ZDB'. - 'wCBFD3uMxsTAwcBAiElpE/KcPg36dIiOvpsRxDCyhmlP2YY9ZU'. - 'v8NMb/1id+FGO0DTztkSXLOONUqeITsMkW2zwnJEIDFhYGx+A1'. - 'kwK4mASkvKDPc3p0iYhRRwYUhZLUTyV6Eu0t4s1Y4kcx6W6KaM'. - 'EZThcXH59RRhGEgIAddnBwNEBKqqpUtWBIF22YDIhJsbEkJqFN'. - 'qLtERHs7GnUkwISEQAf0uj30bY39PzbiC6qrDu2cExJ69Nhhhz'. - '59UlIUipCQOnVi4sjG7ubJBy6um0C+he/0iDHQKIQERYyKFLqr'. - 'SI/W6kJCnvOcrWSLSquC1/Jw9Ks3R0FQKHr0uMc9bnCDGjX69A'. - 'H0XlcJkibN5jOe/alCZStHbjJL9lSMLkXExvCXRiDV6GZEeGeX'. - '3TvvBVQoEjfBL/v0rT75Th7VU5C8gktI6NLlMY+5yU3WWGODDf'. - 'r098tHpNFNH7/2lKdXXdz7efLzVaqJIBOCmK8AJUlI6g0aV+9y'. - '9+p7AR3bMQpTBWPy7yeN6fy0jNwewfpvC9Xe+3kFoUuXe9zj5n'. - 'BusEGHjh6GIAGawC2FWuvSvbbF1maFylZAsC1ISZADBiVNSJrP'. - 'eX73MY//skHP85z5+fnSxQsXj//4n39cmnPn7LbZlsajBmEnBL'. - '1nuEGDG9x4aa5Ldz+h0RCuBqwBv1Wo+7vs9r7n++0MmYeAM+zB'. - '+61EK1QUEnbbtN+9Bh3Hsebn54u//PdfLq9eWl2ZnZ1dSnaSwu'. - 'Pin40b9g3doKE0WoNIl65xj3v75njd3BBubQi6ExKmDWkMRKSl'. - 'tSbVKQcMao1Go5Ugb0+x53nOyZMnSysrKydXLq1cWlxa/McgCB'. - 'Yev3hU+GPrD3I5/q94k3pXYQY58q6B5Bs0HB//neaGx00gyWaz'. - 'VCoV7bquCoKAnZ0dfN/f03egLGj0m3XQNE1jdnY2/+WXXy6trq'. - '6uzP3oR5eCIFi4detW5feXL1vr679Let37zVB3/mQytjXJwmSB'. - 'wikHp9ShY0RESqObwPrr5oBERKhUKly4cIFqtUq9XufmzZtsbW'. - '2hXvuDwTTNtxZq8TyvsLy8vLS4uLgahOHphw8elL69fNlc++qr'. - 'uFOrNXPddm1cczVL5f5P+Lv5MuOJgTGxwYbZpZsCdeAq8M1Bcw'. - 'CGYeC6LtVqlRMnTjAyMkKn0yGXyx0N0LZt03Ec1zCMSrfXO37v'. - 'zp3S769csb+/ciXt1mrNdHf3ltZ6Lca8ZpJsduhtCdb2gEFJoQ'. - 'xADYHuHDS3f32lFEEQUK/XGRkZoVAocP78eZaXl9FaI/Jq25Uk'. - 'yWHAYrHozM/PlxYWFibTND32sFbLXrtyxVz76qukXas1M61WTW'. - 'm99gx+20TdN9jqtfjP7QzOwwYNp037Zd0DukDnIByA1pqdnR2+'. - '++472u02Z8+eZWJiAsMwDsEBRNGBzYJpmsaJEyfyX3zxxdLS0t'. - 'KlVqu1dP3q1cLta9ekU6u1dat1J9b6Sk9kraV1rYXegW7apDYw'. - 'kFY6fPc4MNTw88bwfZ/NzU2UUnieRxAEiAiGcXiXfcigiIjruo'. - 'VyubxkWdbK7fX1xWvffFMInjzBM82uMT5+p++6V1UUrSe7u03t'. - '+8lezlKt3gHyl0aSJDQaDa5fv876+vo+w6FzDq1BpZRsb2/bly'. - '9f9vL5/Njdu3fzG0+eMJHNxsfn532vXN5NPG/7abPZal6/Hvfe'. - 'kroPHfsm98f7AHW9Xo+//vrrlmVZm71+37QNw3JnZ9PK4uJGpV'. - 'pt4Dh+vLGhsrmcfv1iHzu01m89HjIdCon2fb8TBMHtvYeRUn50'. - '1Oj4vqp3Ok1f5LYSadfr9dQfDN642P/XeF2DA+SBAuA4jkOhUK'. - 'BQKESO43S11p3BYBDt7u4y+CtB/i/q7jp1GMiw2AAAAABJRU5E'. - 'rkJggg==' ; - - //========================================================== - // File: ppl_blue.png - //========================================================== - $this->imgdata_large[3][0]= 2284 ; - $this->imgdata_large[3][1]= - 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. - 'B3RJTUUH0wMLFRAiTZAL3gAACHlJREFUeJy9mGtv29YZgJ9zKF'. - 'F3y/Q9jh05tuQkarKgbYasde0UBdZgwNou/Vqga/sD9mP2B4a1'. - 'BbZ9atFPxb5sqOtmXbI19bqsluPYiR3HN90vFEWRZx/IJI5zqa'. - 'x0OwBBSgR5Hj7v+55zSEFXTUgIJyA9C6/9RsjMjAyFIxxJCDc7'. - 'iBqKgyZACGg3G2x9+xXf/fG33P3mC9qNKsp1O+1JdkEnQTdgIO'. - 'ttCSMUi8gj072MnugllAyB9G8rBGi6RsToJTF6iuRoFi1kHKZf'. - '7fB8Iggj0/Dy23D2dakNTR3JDsXPvzstxmZGRMER1EwHhQAEgE'. - 'CLhIkPD6InY9S3djGLJVBtQP1Qb4HDAyoJYQOOZkPx49nhTH9i'. - '7MUBGT7egxkJgd70wZS/CUkoZtA/fRoE1DZ2ACiv52ibReCp4e'. - '7CIEHomxDiuVdGTqUnf/ZeOjR8fpiVXZul5ZrY3bWwbdcLr/dA'. - 'AAIpAwQjUWIjQ+g9HZvswiCgBVF9/SI6OSLGzo0i+oLi6+Utbq'. - '+bKEftgwOE/0Ohocf66M+cBjo22U2RQLIHMhmYnvaOpR9S8bSU'. - 'UqCURGpRkuMZMm9cIvPGJZLj0yBjT2LprkiSkykx9cuXIhOnUs'. - 'm+QNC2XdG02ggBTcvFabsPWwTPpBAChSCgh4kYBpoeplWp47Qs'. - '7EYDt21xINzd5GCAxLExRl89Z+nHjpbKMmjbmkgfDzI0JEW53K'. - 'Jaa6NcAOEX8v52uJzsBlAS6u0hcnTIccPRqhWPCUcLD+s1EaUp'. - 'HCEhEMCyHNpt9SjgIU12A6iw6xb123vYhaaKjB9tlgMD5X+uBp'. - 'zdkpg6azA8EaNQtKlVba+Xez4eCntnJrsDdFsW5nYFpxlFN846'. - 'DXe8utkM4mhi+EgQmjYbS2WqexZKk6BpjwJ2YlK5VjeA3pNDiH'. - 'YjRWPzPE7tmBo8EWwGhkXx+z3uXL7D3rU97LIF8RBEAl6lK/Uo'. - '6JNM1rZ2aTcr3eUgIQOGTgbdwXMGyRejenLYTvQGbAdRuetSud'. - 'OivVuFZgtCEgICghICnZoMhmlVTPR49LCAEkQUhk/B7KXe0MWf'. - 'nxj8xVR/cDheK14WZmtVMJSBnlGoN6FmQq0FLfdwJgORKPHRo/'. - 'Snzx4G0F/FjJ4KiOdmjPCrrx8bffnMybMv9MQGNG3rzlVqtR1B'. - 'sh/CYXCD4Aag1oCW7ZnUOjSp6WFi/QNEB8Y7BfTNjZyCmUvJ0I'. - 'XXT47MTp98Ybon9VZCk8cVazfqlNargsY34G7ByAlIjkHd9CCr'. - 'LbBdiHViUgiECuDKYCdz8b2cywREdiYZOj8zNnLuzOTzx6ODp+'. - 'OaGaqwVzBFqz0Idhz2loE7YEwBLaAJLQcKbW8qjAcBF5Jh0AMP'. - 'IOHe6kxgtb3UMO2OxkF//ffK28nQqxfvm3szrtnDVa799Qb/+v'. - 'NtsbNSpm3tAv8B+w7Ub0FhAyoBcMPec9oK6raXk48ziQBXQcmC'. - 'pT3YqHa0mpEBkTR6wz/Jjo2cy04+fzwxdDquNfQKO7sFUbpu0c'. - 'wp3JoAYsA42Bbkl4GCryUNDEM7Avm6Z/CgSYBWG8pNuFuDu1Wo'. - 'tjoxKIJGeHIiM/jmK9NnX5ycuJQMtUcqXPvLDTa+qIie4hAJ1U'. - 'vdrmO2HaDfB931twJgAn1A4lGT96obPHPLBbhVgUoTHHWo9aAA'. - 'JVAKpyKEmQNzWRENAsL18ycKjAFN/9gCNvzLB/390MMmE7pnDi'. - 'Bvwt0K5Jv3O+0oB22nJ1Vvjb/UMhOpcKknqN1OiMB2DNHU2G5s'. - 'sVndpGJVcZXjX1IAlvw9PmhRQcOFPhsSDkiBrQR1G7brgs0a7D'. - 'ag3FK4rguqBXarI4Nt1SJv5gls7TEWtJDRBO2GwnIs8maevFnA'. - 'Gx6awLZvzeTBu4kFbLigijC47pscpx0xyDfkvtUEnlarCDtrUC'. - 't2HGIhvPHVdVwqjTIrxRU2a5uUrYoP0QZ2gMvACl7+3V/LuKDq'. - 'sJuDy597516+CEezIHXv7vcgXQu2l+Bvn8He9Y4AE4kgk5P9DE'. - 'R6aFdq5Et5Nit3yTf3m9sBcsAN3+D98c0Fit5JawE25r1zg1Fo'. - '5B8GFD7g+nVYnu8EUEop9XTa0N/9dUbqcphP/rDJzbUClVbpgR'. - 'y2fXM3fND95qj75J8AC6BWPINfVSBieK+x+6cS5UCzCLu3oFV9'. - 'GqCMx2NGOp2Znpv7aXZudsool3T5J/179sxVlHJ4kGPrP2COBX'. - '/7DmiApWCjxIMXpYNznYuXM+6TAKWUMppOZzLvv//ery5cuDCT'. - 'SqVS336bCwr1JfAPB9r+2KAFwJS+OcETzZHz/7v3etl6ipz77X'. - 'GAMh6PG+l0OjM3NzczOzs3k0pNnFlbW43+e/GKtMqrblSsF03V'. - 'WHcJA0PjIAzvg9JTze2H67g9DjAwOTmZ+uCDD96anZ2dnZiYmF'. - '5dW41++Lvfa1fnr7qllVK9103mXNTnJgPA+YugsvB3HTaEl+Qs'. - 'AZ/yeHPPDCiTyaRx5syZbGoilV1dW00szC9oV+avusuLy0Xd0X'. - 'MgFkDM+zkYBZEHV8f7wwKu84zmngQoNU0LaZoWUa4K31y5qX/8'. - '4cfyyvwVN5/L10NOKNeg8UmDxoKF5Vfj1xXAgD0JrgAcvBDfel'. - 'a4g4AykUgY6XR6emJiIru2ttZXq9S0K19eUcuLy8WQE8o5OAsN'. - 'Ggsmpl+NpoL1g9X4UBU+C9xDgEKIwNTUVOqdd955M9mbnJ3/cj'. - '6Vu5aTheXCQXNdVeMzAwJSCGEA2XKpnF1cXIzlFnOVhJPIKdR+'. - 'c88ctq4AlVKsrKzw0UcfKcC5uXqzXnNqSzb2pwLxOHP/l7Z/BN'. - 'eB01LKt4HTrusKvGr8jB+hGn8MQAkYQMrfw4Nq/MFPtf+rdvDb'. - 'k8QL+/5Z4Uepxm7bfwHuTAVUWpWaqAAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: ppl_green.png - //========================================================== - $this->imgdata_large[4][0]= 2854 ; - $this->imgdata_large[4][1]= - 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. - 'B3RJTUUH0wMLFQ4hANhluwAACrNJREFUeJytmF1zE1eagJ+3u9'. - 'XdkvUty2AbmLEtEzDBgZ0UpDBOalNTUzU3czl7tct/2n+wt3M/'. - 'NVM12SSTQQSyW2TA+QAJQogtYYFtyfrqL3WfvWj5g8AEjzfvhS'. - 'SXjk8//Zz3Pf3qCMcJAWxMKlT4kH+jwu/FknnJSUItKFHzCrKA'. - 'BggBQx5ziz/wn/yBz3hED4/oaJfSjgVoYjJJgTLTZCjohp7IGT'. - 'k5aZ4kb+bRTR30Q7djj8f/kpPMUSCFedRL6W8e8qMQNE6S4xpv'. - 'c5HrTPFubiJ3ZnlyOXV59rJYU5Z00h1c3d0brxAiUkScRijisk'. - '6XLTyiN3s8HuAJpniXa/q8/pt8Or+0kF8oXJm5YiydWcIpOrJu'. - 'rjOQwd54AQwsMpTJYhPSoYuLQ58An/DnBQSdImXO8avsTPbqpc'. - 'lLp67OXDVzMznZLGxSs2qyIRu4at8gKHQEC50kE1icxqCAdxST'. - 'xjEA44tqaJlERl8uLWvvnX5PHuQfcCdxh5qq0aX76vj4WgWyXO'. - 'QiNgBP8IAaddr08X8+wHFmJSQhBbPAZGoSZSt5wQs6qoNC7UEd'. - '4AEoLIQSCaCCy78Dv8Tiv1hjjW1CRj8XIAgEKqDtt9keboMJZa'. - 'vMjuzQVd3Xr9prTJo+GF/jKZea95R25Lxs8jg5qFGiwDnOS0mW'. - 'NE0rjNRIt3WbklUCA9mV3Zdz8OBT/JfCQLB0SKYVVjGFYSfx/E'. - '26ow4e6uDujlPFQpE0FU6P8qNTHdXJdEdda0qf0itWBVM3pa/3'. - 'ccUlIECJet0cAJoeYk5EZCeS5IwEoerSxccJBwRqFFf38QCTaO'. - 'TRVFKJm3NTbtLNSyh2IkhIXsvLCesEGNCWdmwyruSD/z9kUlRc'. - '3bqNlSxhJNJ43p5JITrOEis8Qtr0cXEpU/JT/pmO18n2vb42pU'. - '3JnDnHMBqyPlpnoAaxhr2llv1ZUBqEGlqYwDQMsskMOcMgVL3Y'. - 'ZOQTHAcQQiIGjHCwCaiovjrv4hbcpKuJJjIcDHm685RGr4GLCx'. - 'YHkAcrLoAoDSLBiAQrMkjqybHJCbxgh+7xAC1MpsgzwRwD3qHL'. - 'WyTIBdlAa6u2rHfXaew06PV78ZZjAwleNnkolECoH5i090wOcY'. - '+TgwYzFHiPi1zkOkXexeAMASnVU+LiyiA1wFUuaqggACLizeWw'. - 'ycMzyssmVYKkbpGyC5T+OUALk2mKLHKWf+ED/az+YW42d66YL+'. - 'aNrmEEzQCFEnKw368EgEvcN1m80eTIQIt0TFOjMJHkzNEBBYPp'. - 'sblf8QHzrORO5JaWZ5ZLl6cuJyyxpNPv4PZdoT+GyIxBfI5uUg'. - 'eJMCwP2/bIHO1JEudcgUUWOceKNq99mCvnzs5PzRcuTV4y5mRO'. - 'SMIjo47z5S7a94oQCNKgJsZwO7D/IDNg3/LLhRNXt4JohBb4aG'. - '82GLdXcf93mQ+Y43r2RHZp+cRy6cqJK4l8MS+tdItaqiYtc0Mm'. - 'QpfJARh98HYh9IiXVcaAo58wGb+LBAjbSPgCOcoSa0wzxXtc08'. - '/pv8mfyL+9MLVQvDJ1JVHJV6SZbFI1qtTsB+KlehRtRTGE8Afo'. - 'P4DRcAxiEudhAHjjzz+ubgX4oHowakHQOlqzICQwyVPITGVOXi'. - 'xfLF6aumzmczl5lHzMff2+fCdPaGttEkXoLQAO9B7C6EugPYby'. - 'gVPjGXc5eIbNAJPjGwiAbaAJUQv8wVG7GROkJFpyOqn/ovgLba'. - '44L0+sDaraXb6jzq7aBQWjBOyUoHcaopOgmaA3IRyNDZnA1HjO'. - 'HSBkr7eEFDAEngHrQCf+/s2A8cSiSkqcKUeeTjwFy2Jd78t3+L'. - 'TR4itIiBLwLQhzkJyB5Cx4HXDaENVQCBAQcRqFIHTRaBIvuYXg'. - 'AdsouuNxEL0ZUBHnSQp66R73zYfUtQ6OytKT8RckQAJQoLtgO5'. - 'BJgj0D/WfgdyHaAHx8THoUcbGx8ciwhUl3bDEiToURPooeI7pH'. - 'MziK9Yd9nU5a6GgKjOH41vsgI4hAcyC5AZkapF+AoYNrjjsuhx'. - 'FbtPmeB5ykyQQzTPAWAQWC8S9oAI0QRRuPb9jkmyMZNAOTklvC'. - 'GGYZaFkGmkVAh8h4DtKFMIBunG+pB5B5AIkGBDsQ+qBiL20caj'. - 'zhJknq5KlgMkLjJHJos4kYEbFJi5vc5eYbATVN02bNWe19+32t'. - 'aJWlFm3wbf8Rz5NbDFJdlOFBF/g7cBf0JkrbBb+F6j1DOduEkU'. - '8bWCOiSofPWadBnSZDWmgUkEMGhZCINut8S/0NBtPptFlZrBSu'. - 'vnt1+ndnflfIp9OJ/279Ubbbd+lP7KBKPoEBsgnqLph/BRzwdS'. - 'LnBUFvHcfdpRsGPAGqwMco6jynz+e0SPKYCHMfLX5VKHwcenR+'. - 'Igd1XTcqlUr+xn/cePv91fevzy8sLO2OtrOpWkqL7gXKSAVRdh'. - 'ZFEmEXoYkwBNqovoc/3GHH3aUR+jwC1oD/AWrANi4hGwyBzqEG'. - 'Vvb77Dgi0eT1VZzJZMxKpVJYXV1dXF1dXVm6sPSvruue3Xzcyj'. - '6/syvDzwj0lNazK6Fj5LFCRZouZpBABj6jXouu3+Np6HNvDHaf'. - 'g91t74msbMuOJicnSSaTKKUQEUQEpRSO69But1/dB0VEm5uby9'. - 'y4cWNpdXX1+sLCworrume//PuXpeqnVeOban0U1PW2kcx+O9L7'. - 'Te9sUB4lWFR9SqNtNGcHx+/RDD2+Am4D94CnQA8OjjlEhMnyJC'. - 'srK8zOzu7BiYioMAzZ2Njg9u3brwIqpSSXy2WXl5eXLly4sOo4'. - 'zoV6vV6oflrVP/7Tx8Hmw1Zb6ydqmpWp7ha8h4O3gjOhzVANmF'. - 'XPMNQWvdDnCXCXuHR+APqH4fbCtm2mp6eZn59H13WJuYXRaKSU'. - 'UiSTyVcBdV3XDcOwRaTU7/en19bWCn/79G+JL/76RbhZ22y7u+'. - '6ahl71nPDz/nO17m7wAxlabFOihy4+DvAcqAMbPzZ3OFzX5dmz'. - 'Z2iahoiosUUVhiGNRgPHcV4GzGQy5uLiYuH8+fMzo9FoslarJW'. - '9+elP75E+fBJu1zY7qqpqBUW3T/niohnVvy+1zm5aVtp+WE2XT'. - 'nrHFzbjh1tYLz3XdPjD4R3BKKba2tqhWq4dzUO3noBPn4H5PKy'. - 'LaO++8U7hx48byhQsXVne7u6tf3/v64t3P7mbq9+odt+OuaWi3'. - 'PLxbW2ytubjbQCgiMnt6VlaurWgz0zM0m02q1WrUaDSUUuqI56'. - 'ivDxE5MCgiYllWtlwuL5mmufLV/a/O/uXPf9Ff1F+80Lv6Yx29'. - '2qHzyZBh3cdvc7gaTZuZkzPh/Py8ACqVSv1/uPZDKXUAGEWRtF'. - 'qtxEcffZTL5XLF+2v39fqjeivshA/TpP83JLwzYFBzcA4370Cc'. - 'S81nTRBUs9lkOByi1GuOPI4Rh3+26JZlnSkWi781DOPXvV4v3+'. - '/2G0R8kSBxB/jew+tERK+c49m2TblcxrZtXNfl+fPneJ6HZVmU'. - 'y2VJJpNyaJ9TSinlOA5bW1u4rntkQA0oAG8D54gb9W3ianxM3A'. - 'e/cn73U3Hq1Cm5du2aPjs7a+ztcSIShmE4ajQa6tatWzQajZ+0'. - 'fbiKI+It4SvijVUj7kL2qvGfgkskEqTTaZmcnDROnTplJhIJTU'. - 'QiwPd9P/Q8T6XTaQzDIAiCfzjP/wFVfszuFqdHXgAAAABJRU5E'. - 'rkJggg==' ; - - - //========================================================== - // File: pp_red.png - //========================================================== - $this->imgdata_small[0][0]= 384 ; - $this->imgdata_small[0][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. - 'B3RJTUUH0wMJFhouFobZrQAAAQ1JREFUeJyV1dFtwyAQBuD/og'. - 'xQdYxa8gRY6hJ0jK6QdohMkTEuE5wUj5ERen05IoLvID7Jkn2G'. - 'j8MgTMyMXqRlUQBYq9ydmaL2h1cwqD7l30t+L1iwlbYFRegY7I'. - 'SHjkEifGg4ww3aBa/l4+9AhxWWr/dLhEunXUGHq6yGniw3QkOw'. - '3jJ7UBd82n/VVAlAtvsfp98lAj2sAJOhU4AeQ7DC1ubVBODWDJ'. - 'TtCsEWa6u5M1NeFs1NzgdtuhHGtj+9Q2IDppQUAL6Cyrlz0gDN'. - 'ohSMiJCt861672EiAhEhESG3woJ9V9OKTkwRKbdqz4cHmFLSFg'. - 's69+LvAZKdeZ/n89uLnd2g0S+gjd5g8zzjH5Y/eLLi+NPEAAAA'. - 'AElFTkSuQmCC' ; - - //========================================================== - // File: pp_orange.png - //========================================================== - $this->imgdata_small[1][0]= 403 ; - $this->imgdata_small[1][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. - 'B3RJTUUH0wMJFhwAnApz5AAAASBJREFUeJyN1dFthDAMBuDf7S'. - '3BCm2VCRKpS4QxbhikW6IewzcBqm6Fm6JyH7iEEByCn5AJH38g'. - 'BBIRHNUzBAWAGNfe/SrUGv92CtNt309BrfFdMGPjvt9CD8Fyml'. - 'ZZaDchRgA/59FDMD18pvNoNyHxMnUmgLmPHoJ+CqqfMaNAH22C'. - 'fgqKRwR+GRpxGjXBEiuXDBWQhTK3plxijyWWvtKVS5KNG1xM8I'. - 'OBr7geV1WupDqpmTAPKjCqLhxk/z0PImQmjKrAuI6vMXlhFroD'. - 'vfdqITXWqg2YMSJEAFcReoag6UXU2DzPG8w5t09YYsAyLWvHrL'. - 'HUy6D3XmvMAAhAay8kAJpBosX4vt0G4+4Jam6s6Rz1fgFG0ncA'. - 'f3XfOQcA+Acv5IUSdQw9hgAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: pp_pink.png - //========================================================== - $this->imgdata_small[2][0]= 419 ; - $this->imgdata_small[2][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. - 'B3RJTUUH0wMJFhsQzvz1RwAAATBJREFUeJyd1MFthDAQheF/oi'. - 'gF+JYWQKICkCJRA1vGtrDbxFbhGvY0HVjCLeS2BeTiHFgTB2wg'. - 'eRISstCnmcG2qCpbuXf3ADBQzWsPfZfS9y9HsEu4/Fo33Wf4Fx'. - 'gxL3a1XkI3wbTNXHLoboVeLFUYDqObYBy+Fw/Uh9DdCmtOwIjF'. - 'YvG76CZoOhNGRmpO8zz30CJoOhMAqlDxFzQLppgXj2XaNlP7FF'. - 'GLL7ccMYCBgZERgCvXLBrfi2DEclmiKZwFY4tp6sW26bVfnede'. - 'e5Hc5dC2bUgrXGKqWrwcXnNYDjmCrcCIiQgDcFYV05kQ8SXmnB'. - 'NgPiVN06wrTDGAhz5EWY/FOccTk+cTnHM/YNu2YYllgFxCWuUM'. - 'ikzGx+2Gc+4N+CoJW8n+5a2UKm2aBoBvGA6L7wfl8aoAAAAASU'. - 'VORK5CYII=' ; - - - //========================================================== - // File: pp_blue.png - //========================================================== - $this->imgdata_small[3][0]= 883 ; - $this->imgdata_small[3][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAACi1'. - 'BMVEX///8AAAAAADMAAGYAAJkAAMwAAP8zAAAzADMzAGYzAJkz'. - 'AMwzAP9mAABmADNmAGZmAJlmAMxmAP+ZAACZADOZAGaZAJmZAM'. - 'yZAP/MAADMADPMAGbMAJnMAMzMAP//AAD/ADP/AGb/AJn/AMz/'. - 'AP8AMwAAMzMAM2YAM5kAM8wAM/8zMwAzMzMzM2YzM5kzM8wzM/'. - '9mMwBmMzNmM2ZmM5lmM8xmM/+ZMwCZMzOZM2aZM5mZM8yZM//M'. - 'MwDMMzPMM2bMM5nMM8zMM///MwD/MzP/M2b/M5n/M8z/M/8AZg'. - 'AAZjMAZmYAZpkAZswAZv8zZgAzZjMzZmYzZpkzZswzZv9mZgBm'. - 'ZjNmZmZmZplmZsxmZv+ZZgCZZjOZZmaZZpmZZsyZZv/MZgDMZj'. - 'PMZmbMZpnMZszMZv//ZgD/ZjP/Zmb/Zpn/Zsz/Zv8AmQAAmTMA'. - 'mWYAmZkAmcwAmf8zmQAzmTMzmWYzmZkzmcwzmf9mmQBmmTNmmW'. - 'ZmmZlmmcxmmf+ZmQCZmTOZmWaZmZmZmcyZmf/MmQDMmTPMmWbM'. - 'mZnMmczMmf//mQD/mTP/mWb/mZn/mcz/mf8AzAAAzDMAzGYAzJ'. - 'kAzMwAzP8zzAAzzDMzzGYzzJkzzMwzzP9mzABmzDNmzGZmzJlm'. - 'zMxmzP+ZzACZzDOZzGaZzJmZzMyZzP/MzADMzDPMzGbMzJnMzM'. - 'zMzP//zAD/zDP/zGb/zJn/zMz/zP8A/wAA/zMA/2YA/5kA/8wA'. - '//8z/wAz/zMz/2Yz/5kz/8wz//9m/wBm/zNm/2Zm/5lm/8xm//'. - '+Z/wCZ/zOZ/2aZ/5mZ/8yZ///M/wDM/zPM/2bM/5nM/8zM////'. - '/wD//zP//2b//5n//8z///9jJVUgAAAAAXRSTlMAQObYZgAAAA'. - 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. - 'RQfTAwkWGTNerea3AAAAYUlEQVR4nHXNwQ3AIAxDUUfyoROxRZ'. - 'icARin0EBTIP3Hp1gBRqSqYo0seqjZpnngojlWBir5+b8o06lM'. - 'ha5uFKEpDZulV8l52axhVzqaCdxQp32qVSSwC1wN3fYiw7b76w'. - 'bN4SMue4/KbwAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: pp_green.png - //========================================================== - $this->imgdata_small[4][0]= 447 ; - $this->imgdata_small[4][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. - 'B3RJTUUH0wMJFhkLdq9eKQAAAUxJREFUeJyN1LFVwzAQxvH/8f'. - 'IeDS0FLKABlN6eIwPYAzCHB0gWYI2jj+i1ABUTQN4TRSQ7iiWZ'. - 'qxLn9Mt9ydmiqrSq930AYFiu6YdKrf/hP1gYQn6960PxwBaYMG'. - 'E9UA3dBFtVQjdBOQmBakLennK0CapRwbZRZ3N0O/IeEsqp3HKL'. - 'Smtt5pUZgTPg4gdDud+6xoS97wM2rsxxmRSoTgoVcMZsXJkBho'. - 'SmKqCuOuEtls6nmGMFPTUmxBKx/MeyNfQGLoOOiC2ddsxb1Kzv'. - 'ZzUqu5IXbGDvBJf+hDisi77qFSuhq7Xpuu66TyJLRGbsXVUPxV'. - 'SxsgkzDMt0mKT3/RcjL8C5hHnvJToXY0xYRZ4xnVKsV/S+a8YA'. - 'AvCb3s9g13UhYj+TTo93B3fApRV1FVlEAD6H42DjN9/WvzDYuJ'. - 'dL5b1/ji+/IX8EGWP4AwRii8PdFHTqAAAAAElFTkSuQmCC' ; - } -} - -?> diff --git a/#jpgraph/src/imgdata_squares.inc.php b/#jpgraph/src/imgdata_squares.inc.php deleted file mode 100644 index 895dc936..00000000 --- a/#jpgraph/src/imgdata_squares.inc.php +++ /dev/null @@ -1,150 +0,0 @@ -'imgdata'); - - protected $colors = array('bluegreen','blue','green', - 'lightblue','orange','purple','red','yellow'); - protected $index = array('bluegreen' =>2,'blue'=>5,'green'=>6, - 'lightblue'=>0,'orange'=>7,'purple'=>4,'red'=>3,'yellow'=>1); - protected $maxidx = 7 ; - protected $imgdata ; - - function ImgData_Squares () { - //========================================================== - //sq_lblue.png - //========================================================== - $this->imgdata[0][0]= 362 ; - $this->imgdata[0][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAABm'. - 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. - 'B3RJTUUH0wMLFgojiPx/ygAAAPdJREFUeNpj/P377+kzHx89/c'. - 'VAHNBQ5VBX52HavPWWjg6nnDQbkXoUFTnnL7zD9PPXrz17HxCj'. - 'E6Jn6fL7H7/+ZWJgYCBGJ7IeBgYGJogofp1oehDa8OjE1IOiDa'. - 'tOrHoYGBhY0NwD0enirMDAwMDFxYRVD7ptyDrNTAU0NXix6sGu'. - 'jYGBgZOT9e/f/0xMjFyczFgVsGAKCfBza2kKzpl3hIuT1c9Xb/'. - 'PW58/foKchJqx6tmy98vbjj8cvPm/afMnXW1JShA2fNmQ9EBFc'. - 'Opnw6MGjkwm/Hlw6mQjqwaqTiRg9mDoZv//4M2/+UYJ64EBWgj'. - 'cm2hwA8l24oNDl+DMAAAAASUVORK5CYII=' ; - - //========================================================== - //sq_yellow.png - //========================================================== - $this->imgdata[1][0]= 338 ; - $this->imgdata[1][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAWl'. - 'BMVEX////+/+H+/9/9/9v8/8P8/8H8/7v8/7n6/4P5/335/3n5'. - '/3X4/1f4/1P3/031/w30/wn0/wPt+ADp9ADm8ADk7gDc5gDa5A'. - 'DL1ADFzgCwuACqsgClrABzeAC9M0MzAAAAAWJLR0QAiAUdSAAA'. - 'AAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEDlOgDj'. - 'EAAAB+SURBVHjaVcpbCsQgDEDRGERGKopjDa2a/W9zfLWj9/Nw'. - 'Ac21ZRBOtZlRN9ApzSYFaDUj79KIorRDbJNO9bN/GUSh2ZRJFJ'. - 'S18iorURBiyksO8buT0zkfYaUqzI91ckfhWhoGXTLzsDjI68Sz'. - 'pGMjrzPzauA/iXk1AtykmvgBC8UcWUdc9HkAAAAASUVORK5CYI'. - 'I=' ; - - //========================================================== - //sq_blgr.png - //========================================================== - $this->imgdata[2][0]= 347 ; - $this->imgdata[2][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAZl'. - 'BMVEX////0+vv0+vrz+fry+frv+Png7e/d7e/a6+zY6+250tSz'. - '0tSyztCtztGM0NWIz9SDzdNfsLVcrrRZrbJOp61MpqtIr7dHn6'. - 'RErrZArLQ6q7M2g4kygYcsp68npa4ctr8QZ20JnqepKsl4AAAA'. - 'AWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU'. - '1FB9MDCxYEByp8tpUAAAB7SURBVHjaVcjRFoIgDADQWZpWJpjY'. - 'MsnG//9kzIFn3McLzfArDA3MndFjrhvgfDHFBEB9pt0CVzwrY3'. - 'n2yicjhY4vTSp0nbXtN+hCV53SHDWe61dZY+/9463r2XuifHAM'. - '0SoH+6xEcovUlCfefeFSIwfTTQ3fB+pi4lV/bTIgvmaA7a0AAA'. - 'AASUVORK5CYII=' ; - - //========================================================== - //sq_red.png - //========================================================== - $this->imgdata[3][0]= 324 ; - $this->imgdata[3][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXV'. - 'BMVEX////++Pn99/j99ff99fb98/X98/T98PL55uj43+P24+bw'. - 'kKPvjaHviJ3teJHpxMnoL2Pjs73WW3rWNljVWXnUVnbUK1DTJk'. - '3SUHPOBz/KQmmxPVmuOFasNFOeIkWVka/fAAAAAWJLR0QAiAUd'. - 'SAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEHd'. - 'ceT+8AAABtSURBVHjaVchbAkMwEAXQq6i3VrQiQfa/zDYTw8z5'. - 'PCjGt9JVWFt1XWPh1fWNdfDy+tq6WPfRUPENNKnSnXNWPB4uv2'. - 'b54nSZ8jHrMtOxvWZZZtpD4KP6xLkO9/AhzhaCOMhJh68cOjzV'. - '/K/4Ac2cG+nBcaRuAAAAAElFTkSuQmCC' ; - - //========================================================== - //sq_pink.png - //========================================================== - $this->imgdata[4][0]= 445 ; - $this->imgdata[4][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAApV'. - 'BMVEX////6+Pz69/v49Pr38/r17/jr4+/l3Onj2efh1ua/L+i+'. - 'q8m+Lue9Lua8qsS8LuW8LeS7pca5LOG4LN+2Y9O2YNW1ZdO1Kt'. - 'y0atC0aNGzb82zbc6zKtuzKdqycsuwa8qtJtOISZ2GRpuFN6GE'. - 'NqCDQpmCMZ+BPpd/LJ1/K519S5B9Jpx9Jpt9JZt6RY11BJZ1BJ'. - 'V0BJV0BJRzBJNvNoRtIoJUEmdZ/XbrAAAAAWJLR0QAiAUdSAAA'. - 'AAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYDF3iKMD'. - 'YAAACeSURBVHjaVczbEoIgGARgCiMtrexoWpaa2FHUgvd/tH4Y'. - 'BnEvv9ldhNPradPnnGBUTtPDzMRPSIF46SaBoR25dYjz3I20Lb'. - 'ek6BgQz73Il7KKpSgCO0pTHU0886J1sCe0ZYbALjGhjFnEM2es'. - 'VhZVI4d+B1QtfnV47ywCEaKeP/p7JdLejSYt0j6NIiOq1wJZIs'. - 'QTDA0ELHwhPBCwyR/Cni9cOmzJtwAAAABJRU5ErkJggg==' ; - - //========================================================== - //sq_blue.png - //========================================================== - $this->imgdata[5][0]= 283 ; - $this->imgdata[5][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAQl'. - 'BMVEX////4+fz39/z19vvy8vru7/ni4+7g4fHW1ue8vteXmt6B'. - 'hdhiZ7FQVaZETcxCSJo1Oq4zNoMjKakhJHcKFaMEC2jRVYdWAA'. - 'AAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0'. - 'SU1FB9MDCxYDN0PkEP4AAABfSURBVHjaVchHAoAgDATAVcCCIF'. - 'j4/1elJEjmOFDHKVgDv4iz640gLs+LMF6ZUv/VqcXXplU7Gqpy'. - 'PFzBT5qml9NzlOX259riWHlS4kOffviHD8PQYZx2EFMPRkw+9Q'. - 'FSnRPeWEDzKAAAAABJRU5ErkJggg==' ; - - //========================================================== - //sq_green.png - //========================================================== - $this->imgdata[6][0]= 325 ; - $this->imgdata[6][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXV'. - 'BMVEX////2+vX1+vX1+fT0+fPz+PPx9/Dv9u7u9e3h7uHe697a'. - '6dnO2s3I1sa10LOvza2ay5aEwYBWlE9TqE5Tkk1RkEpMrUJMg0'. - 'hKiUNGpEFBojw8oTcsbScaYBMWlwmMT0NtAAAAAWJLR0QAiAUd'. - 'SAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEFd'. - 'nFx90AAABuSURBVHjaVc9HAoAgDADB2HuJWLDx/2cKBITscW4L'. - '5byzMIWtZobNDZIZtrcCGZsRQ8GwvRSRNxIiMuysODKG3alikl'. - 'ueOPlpKTLBaRmOZxQxaXlfb5ZWI9om4WntrXiDSJzp7SBkwMQa'. - 'FEy0VR/NAB2kNuj7rgAAAABJRU5ErkJggg==' ; - - //========================================================== - //sq_orange.png - //========================================================== - $this->imgdata[7][0]= 321 ; - $this->imgdata[7][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAUV'. - 'BMVEX/////8+n/8uf/8OP/59H/5Mv/zqH/zJ3/ypv/yJf/vYH/'. - 'u33/uXn/n0n/nUX/m0H/lzn/ljf/lDP/kS3/kCv/iR//hxv/fg'. - 'n/fAX/eQDYZgDW6ia5AAAAAWJLR0QAiAUdSAAAAAlwSFlzAAAL'. - 'EgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEJIgbx+cAAAB2SURBVH'. - 'jaVczRCoQwDETRbLAWLZSGUA35/w/dVI0283i4DODew3YESmWW'. - 'kg5gWkoQAe6TleUQI/66Sy7i56+kLk7cht2N0+hcnJgQu0SqiC'. - '1SzSIbzWSi6gavqJ63wSduRi2f+kwyD5rEukwCdZ1kGAMGMfv9'. - 'AbWuGMOr5COSAAAAAElFTkSuQmCC' ; - } -} - -?> diff --git a/#jpgraph/src/imgdata_stars.inc.php b/#jpgraph/src/imgdata_stars.inc.php deleted file mode 100644 index bc696902..00000000 --- a/#jpgraph/src/imgdata_stars.inc.php +++ /dev/null @@ -1,144 +0,0 @@ - 'imgdata'); - - protected $colors = array('bluegreen','lightblue','purple','blue','green','pink','red','yellow'); - protected $index = array('bluegreen'=>3,'lightblue'=>4,'purple'=>1, - 'blue'=>5,'green'=>0,'pink'=>7,'red'=>2,'yellow'=>6); - protected $maxidx = 7 ; - protected $imgdata ; - - function __construct() { - //========================================================== - // File: bstar_green_001.png - //========================================================== - $this->imgdata[0][0]= 329 ; - $this->imgdata[0][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAAUV'. - 'BMVEX///////+/v7+83rqcyY2Q/4R7/15y/1tp/05p/0lg/zdX'. - '/zdX/zVV/zdO/zFJ9TFJvDFD4yg+8Bw+3iU68hwurhYotxYosx'. - 'YokBoTfwANgQFUp7DWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. - 'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJj'. - 'CRyxgTAAAAcUlEQVR4nH3MSw6AIAwEUBL/IKBWwXL/g0pLojUS'. - 'ZzGLl8ko9Zumhr5iy66/GH0dp49llNPB5sTotDY5PVuLG6tnM9'. - 'CVKSIe1joSgPsAKSuANNaENFQvTAGzmheSkUpMBWeJZwqBT8wo'. - 'hmysD4bnnPsC/x8ItUdGPfAAAAAASUVORK5CYII=' ; - //========================================================== - // File: bstar_blred.png - //========================================================== - $this->imgdata[1][0]= 325 ; - $this->imgdata[1][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. - 'BMVEX///+/v79uRJ6jWPOSUtKrb+ejWO+gWPaGTruJTr6rZvF2'. - 'RqC2ocqdVuCeV+egV/GsnLuIXL66rMSpcOyATbipY/OdWOp+VK'. - 'aTU9WhV+yJKBoLAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. - 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJwynv1'. - 'XVAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. - 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. - 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. - 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bstar_red_001.png - //========================================================== - $this->imgdata[2][0]= 325 ; - $this->imgdata[2][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. - 'BMVEX///+/v7+eRFHzWG3SUmHnb37vWGr2WHG7Tlm+TljxZneg'. - 'Rk3KoaXgVmXnV2nxV227nJ++XGzErK3scIS4TVzzY3fqWG2mVF'. - 'zVU2PsV2rJFw9VAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. - 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJzCI0C'. - 'lSAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. - 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. - 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. - 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bstar_blgr_001.png - //========================================================== - $this->imgdata[3][0]= 325 ; - $this->imgdata[3][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. - 'BMVEX///+/v79Ehp5Yx/NSq9Jvw+dYwu9YzfZOmbtOmb5myPFG'. - 'gqChvcpWteBXvedXxvGcsbtcpb6su8RwzOxNmrhjyvNYwupUjK'. - 'ZTr9VXwOyJhmWNAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. - 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJTC65k'. - 'vQAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. - 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. - 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. - 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bstar_blgr_002.png - //========================================================== - $this->imgdata[4][0]= 325 ; - $this->imgdata[4][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. - 'BMVEX///+/v79EnpxY8/FS0dJv5+dY7+9Y9vBOubtOur5m8fFG'. - 'nKChycpW3uBX5+ZX8e2curtcvrqswsRw7OdNuLZj8/BY6udUpK'. - 'ZT1dRX7OtNkrW5AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. - 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJgXHeN'. - 'wwAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. - 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. - 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. - 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bstar_blue_001.png - //========================================================== - $this->imgdata[5][0]= 325 ; - $this->imgdata[5][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. - 'BMVEX///+/v79EY55Yi/NSetJvledYiO9YkPZOb7tObr5mkvFG'. - 'X6ChrcpWgOBXhedXi/Gcpbtcf76sssRwnOxNcbhjk/NYiepUbK'. - 'ZTfdVXh+ynNEzzAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. - 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJhStyP'. - 'zCAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. - 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. - 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. - 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bstar_oy_007.png - //========================================================== - $this->imgdata[6][0]= 325 ; - $this->imgdata[6][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. - 'BMVEX///+/v7+ejUTz11jSvVLn02/v1lj21li7q06+r07x2mag'. - 'lUbKxKHgy1bnz1fx1Ve7t5y+qlzEwqzs03C4pE3z2WPqz1imml'. - 'TVv1Ps01dGRjeyAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. - 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJjsGGc'. - 'GbAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. - 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. - 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. - 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; - - //========================================================== - // File: bstar_lred.png - //========================================================== - $this->imgdata[7][0]= 325 ; - $this->imgdata[7][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. - 'BMVEX///+/v7+eRJPzWN3SUr7nb9TvWNj2WOS7Tqi+TqnxZtyg'. - 'Ro/KocPgVsjnV9LxV927nLa+XLTErL7scN24TarzY9/qWNemVJ'. - 'jVU8LsV9VCwcc9AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. - 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJxi9ZY'. - 'GoAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. - 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. - 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. - 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; - } -} - -?> diff --git a/#jpgraph/src/jpg-config.inc.php b/#jpgraph/src/jpg-config.inc.php deleted file mode 100644 index ea16c1e2..00000000 --- a/#jpgraph/src/jpg-config.inc.php +++ /dev/null @@ -1,138 +0,0 @@ - diff --git a/#jpgraph/src/jpg-config.inc.php.orig b/#jpgraph/src/jpg-config.inc.php.orig deleted file mode 100644 index 8b29eec4..00000000 --- a/#jpgraph/src/jpg-config.inc.php.orig +++ /dev/null @@ -1,138 +0,0 @@ - diff --git a/#jpgraph/src/jpgraph.php b/#jpgraph/src/jpgraph.php deleted file mode 100644 index 5db0bbc3..00000000 --- a/#jpgraph/src/jpgraph.php +++ /dev/null @@ -1,5629 +0,0 @@ -Get(11,$file,$lineno); - die($msg); - } - else { - define('CACHE_DIR', $_SERVER['TEMP'] . '/'); - } - } else { - define('CACHE_DIR','/tmp/jpgraph_cache/'); - } - } -} -elseif( !defined('CACHE_DIR') ) { - define('CACHE_DIR', ''); -} - -// -// Setup path for western/latin TTF fonts -// -if (!defined('TTF_DIR')) { - if (strstr( PHP_OS, 'WIN') ) { - $sroot = getenv('SystemRoot'); - if( empty($sroot) ) { - $t = new ErrMsgText(); - $msg = $t->Get(12,$file,$lineno); - die($msg); - } - else { - define('TTF_DIR', $sroot.'/fonts/'); - } - } else { - define('TTF_DIR','/usr/share/fonts/truetype/'); - } -} - -// -// Setup path for MultiByte TTF fonts (japanese, chinese etc.) -// -if (!defined('MBTTF_DIR')) { - if (strstr( PHP_OS, 'WIN') ) { - $sroot = getenv('SystemRoot'); - if( empty($sroot) ) { - $t = new ErrMsgText(); - $msg = $t->Get(12,$file,$lineno); - die($msg); - } - else { - define('MBTTF_DIR', $sroot.'/fonts/'); - } - } else { - define('MBTTF_DIR','/usr/share/fonts/truetype/'); - } -} - -// -// Check minimum PHP version -// -function CheckPHPVersion($aMinVersion) { - list($majorC, $minorC, $editC) = preg_split('/[\/.-]/', PHP_VERSION); - list($majorR, $minorR, $editR) = preg_split('/[\/.-]/', $aMinVersion); - - if ($majorC < $majorR) return false; - - if ($majorC == $majorR) { - if($minorC < $minorR) return false; - - if($minorC == $minorR){ - if($editC < $editR) return false; - } - } - - return true; -} - -// -// Make sure PHP version is high enough -// -if( !CheckPHPVersion(MIN_PHPVERSION) ) { - JpGraphError::RaiseL(13,PHP_VERSION,MIN_PHPVERSION); - die(); -} - -// -// Make GD sanity check -// -if( !function_exists("imagetypes") || !function_exists('imagecreatefromstring') ) { - JpGraphError::RaiseL(25001); - //("This PHP installation is not configured with the GD library. Please recompile PHP with GD support to run JpGraph. (Neither function imagetypes() nor imagecreatefromstring() does exist)"); -} - -// -// Setup PHP error handler -// -function _phpErrorHandler($errno,$errmsg,$filename, $linenum, $vars) { - // Respect current error level - if( $errno & error_reporting() ) { - JpGraphError::RaiseL(25003,basename($filename),$linenum,$errmsg); - } -} - -if( INSTALL_PHP_ERR_HANDLER ) { - set_error_handler("_phpErrorHandler"); -} - -// -// Check if there were any warnings, perhaps some wrong includes by the user. In this -// case we raise it immediately since otherwise the image will not show and makes -// debugging difficult. This is controlled by the user setting CATCH_PHPERRMSG -// -if( isset($GLOBALS['php_errormsg']) && CATCH_PHPERRMSG && !preg_match('/|Deprecated|/i', $GLOBALS['php_errormsg']) ) { - JpGraphError::RaiseL(25004,$GLOBALS['php_errormsg']); -} - -// Useful mathematical function -function sign($a) {return $a >= 0 ? 1 : -1;} - -// -// Utility function to generate an image name based on the filename we -// are running from and assuming we use auto detection of graphic format -// (top level), i.e it is safe to call this function -// from a script that uses JpGraph -// -function GenImgName() { - // Determine what format we should use when we save the images - $supported = imagetypes(); - if( $supported & IMG_PNG ) $img_format="png"; - elseif( $supported & IMG_GIF ) $img_format="gif"; - elseif( $supported & IMG_JPG ) $img_format="jpeg"; - elseif( $supported & IMG_WBMP ) $img_format="wbmp"; - elseif( $supported & IMG_XPM ) $img_format="xpm"; - - - if( !isset($_SERVER['PHP_SELF']) ) { - JpGraphError::RaiseL(25005); - //(" Can't access PHP_SELF, PHP global variable. You can't run PHP from command line if you want to use the 'auto' naming of cache or image files."); - } - $fname = basename($_SERVER['PHP_SELF']); - if( !empty($_SERVER['QUERY_STRING']) ) { - $q = @$_SERVER['QUERY_STRING']; - $fname .= '_'.preg_replace("/\W/", "_", $q).'.'.$img_format; - } - else { - $fname = substr($fname,0,strlen($fname)-4).'.'.$img_format; - } - return $fname; -} - -//=================================================== -// CLASS JpgTimer -// Description: General timing utility class to handle -// time measurement of generating graphs. Multiple -// timers can be started. -//=================================================== -class JpgTimer { - private $start, $idx; - - function __construct() { - $this->idx=0; - } - - // Push a new timer start on stack - function Push() { - list($ms,$s)=explode(" ",microtime()); - $this->start[$this->idx++]=floor($ms*1000) + 1000*$s; - } - - // Pop the latest timer start and return the diff with the - // current time - function Pop() { - assert($this->idx>0); - list($ms,$s)=explode(" ",microtime()); - $etime=floor($ms*1000) + (1000*$s); - $this->idx--; - return $etime-$this->start[$this->idx]; - } -} // Class - -//=================================================== -// CLASS DateLocale -// Description: Hold localized text used in dates -//=================================================== -class DateLocale { - - public $iLocale = 'C'; // environmental locale be used by default - private $iDayAbb = null, $iShortDay = null, $iShortMonth = null, $iMonthName = null; - - function __construct() { - settype($this->iDayAbb, 'array'); - settype($this->iShortDay, 'array'); - settype($this->iShortMonth, 'array'); - settype($this->iMonthName, 'array'); - $this->Set('C'); - } - - function Set($aLocale) { - if ( in_array($aLocale, array_keys($this->iDayAbb)) ){ - $this->iLocale = $aLocale; - return TRUE; // already cached nothing else to do! - } - - $pLocale = setlocale(LC_TIME, 0); // get current locale for LC_TIME - - if (is_array($aLocale)) { - foreach ($aLocale as $loc) { - $res = @setlocale(LC_TIME, $loc); - if ( $res ) { - $aLocale = $loc; - break; - } - } - } - else { - $res = @setlocale(LC_TIME, $aLocale); - } - - if ( ! $res ) { - JpGraphError::RaiseL(25007,$aLocale); - //("You are trying to use the locale ($aLocale) which your PHP installation does not support. Hint: Use '' to indicate the default locale for this geographic region."); - return FALSE; - } - - $this->iLocale = $aLocale; - for( $i = 0, $ofs = 0 - strftime('%w'); $i < 7; $i++, $ofs++ ) { - $day = strftime('%a', strtotime("$ofs day")); - $day[0] = strtoupper($day[0]); - $this->iDayAbb[$aLocale][]= $day[0]; - $this->iShortDay[$aLocale][]= $day; - } - - for($i=1; $i<=12; ++$i) { - list($short ,$full) = explode('|', strftime("%b|%B",strtotime("2001-$i-01"))); - $this->iShortMonth[$aLocale][] = ucfirst($short); - $this->iMonthName [$aLocale][] = ucfirst($full); - } - - setlocale(LC_TIME, $pLocale); - - return TRUE; - } - - - function GetDayAbb() { - return $this->iDayAbb[$this->iLocale]; - } - - function GetShortDay() { - return $this->iShortDay[$this->iLocale]; - } - - function GetShortMonth() { - return $this->iShortMonth[$this->iLocale]; - } - - function GetShortMonthName($aNbr) { - return $this->iShortMonth[$this->iLocale][$aNbr]; - } - - function GetLongMonthName($aNbr) { - return $this->iMonthName[$this->iLocale][$aNbr]; - } - - function GetMonth() { - return $this->iMonthName[$this->iLocale]; - } -} - -// Global object handlers -$gDateLocale = new DateLocale(); -$gJpgDateLocale = new DateLocale(); - -//======================================================= -// CLASS Footer -// Description: Encapsulates the footer line in the Graph -//======================================================= -class Footer { - public $iLeftMargin = 3, $iRightMargin = 3, $iBottomMargin = 3 ; - public $left,$center,$right; - private $iTimer=null, $itimerpoststring=''; - - function __construct() { - $this->left = new Text(); - $this->left->ParagraphAlign('left'); - $this->center = new Text(); - $this->center->ParagraphAlign('center'); - $this->right = new Text(); - $this->right->ParagraphAlign('right'); - } - - function SetTimer($aTimer,$aTimerPostString='') { - $this->iTimer = $aTimer; - $this->itimerpoststring = $aTimerPostString; - } - - function SetMargin($aLeft=3,$aRight=3,$aBottom=3) { - $this->iLeftMargin = $aLeft; - $this->iRightMargin = $aRight; - $this->iBottomMargin = $aBottom; - } - - function Stroke($aImg) { - $y = $aImg->height - $this->iBottomMargin; - $x = $this->iLeftMargin; - $this->left->Align('left','bottom'); - $this->left->Stroke($aImg,$x,$y); - - $x = ($aImg->width - $this->iLeftMargin - $this->iRightMargin)/2; - $this->center->Align('center','bottom'); - $this->center->Stroke($aImg,$x,$y); - - $x = $aImg->width - $this->iRightMargin; - $this->right->Align('right','bottom'); - if( $this->iTimer != null ) { - $this->right->Set( $this->right->t . sprintf('%.3f',$this->iTimer->Pop()/1000.0) . $this->itimerpoststring ); - } - $this->right->Stroke($aImg,$x,$y); - } -} - - -//=================================================== -// CLASS Graph -// Description: Main class to handle graphs -//=================================================== -class Graph { - public $cache=null; // Cache object (singleton) - public $img=null; // Img object (singleton) - public $plots=array(); // Array of all plot object in the graph (for Y 1 axis) - public $y2plots=array(); // Array of all plot object in the graph (for Y 2 axis) - public $ynplots=array(); - public $xscale=null; // X Scale object (could be instance of LinearScale or LogScale - public $yscale=null,$y2scale=null, $ynscale=array(); - public $iIcons = array(); // Array of Icons to add to - public $cache_name; // File name to be used for the current graph in the cache directory - public $xgrid=null; // X Grid object (linear or logarithmic) - public $ygrid=null,$y2grid=null; //dito for Y - public $doframe,$frame_color, $frame_weight; // Frame around graph - public $boxed=false, $box_color='black', $box_weight=1; // Box around plot area - public $doshadow=false,$shadow_width=4,$shadow_color='gray@0.5'; // Shadow for graph - public $xaxis=null; // X-axis (instane of Axis class) - public $yaxis=null, $y2axis=null, $ynaxis=array(); // Y axis (instance of Axis class) - public $margin_color; // Margin color of graph - public $plotarea_color=array(255,255,255); // Plot area color - public $title,$subtitle,$subsubtitle; // Title and subtitle(s) text object - public $axtype="linlin"; // Type of axis - public $xtick_factor,$ytick_factor; // Factor to determine the maximum number of ticks depending on the plot width - public $texts=null, $y2texts=null; // Text object to ge shown in the graph - public $lines=null, $y2lines=null; - public $bands=null, $y2bands=null; - public $text_scale_off=0, $text_scale_abscenteroff=-1; // Text scale in fractions and for centering bars - public $background_image='',$background_image_type=-1,$background_image_format="png"; - public $background_image_bright=0,$background_image_contr=0,$background_image_sat=0; - public $background_image_xpos=0,$background_image_ypos=0; - public $image_bright=0, $image_contr=0, $image_sat=0; - public $inline; - public $showcsim=0,$csimcolor="red";//debug stuff, draw the csim boundaris on the image if <>0 - public $grid_depth=DEPTH_BACK; // Draw grid under all plots as default - public $iAxisStyle = AXSTYLE_SIMPLE; - public $iCSIMdisplay=false,$iHasStroked = false; - public $footer; - public $csimcachename = '', $csimcachetimeout = 0, $iCSIMImgAlt=''; - public $iDoClipping = false; - public $y2orderback=true; - public $tabtitle; - public $bkg_gradtype=-1,$bkg_gradstyle=BGRAD_MARGIN; - public $bkg_gradfrom='navy', $bkg_gradto='silver'; - public $plot_gradtype=-1,$plot_gradstyle=BGRAD_MARGIN; - public $plot_gradfrom='silver', $plot_gradto='navy'; - - public $titlebackground = false; - public $titlebackground_color = 'lightblue', - $titlebackground_style = 1, - $titlebackground_framecolor, - $titlebackground_framestyle, - $titlebackground_frameweight, - $titlebackground_bevelheight; - public $titlebkg_fillstyle=TITLEBKG_FILLSTYLE_SOLID; - public $titlebkg_scolor1='black',$titlebkg_scolor2='white'; - public $framebevel, $framebeveldepth; - public $framebevelborder, $framebevelbordercolor; - public $framebevelcolor1, $framebevelcolor2; - public $background_image_mix=100; - public $background_cflag = ''; - public $background_cflag_type = BGIMG_FILLPLOT; - public $background_cflag_mix = 100; - public $iImgTrans=false, - $iImgTransHorizon = 100,$iImgTransSkewDist=150, - $iImgTransDirection = 1, $iImgTransMinSize = true, - $iImgTransFillColor='white',$iImgTransHighQ=false, - $iImgTransBorder=false,$iImgTransHorizonPos=0.5; - public $legend; - public $graph_theme; - protected $iYAxisDeltaPos=50; - protected $iIconDepth=DEPTH_BACK; - protected $iAxisLblBgType = 0, - $iXAxisLblBgFillColor = 'lightgray', $iXAxisLblBgColor = 'black', - $iYAxisLblBgFillColor = 'lightgray', $iYAxisLblBgColor = 'black'; - protected $iTables=NULL; - - protected $isRunningClear = false; - protected $inputValues; - protected $isAfterSetScale = false; - - // aWIdth Width in pixels of image - // aHeight Height in pixels of image - // aCachedName Name for image file in cache directory - // aTimeOut Timeout in minutes for image in cache - // aInline If true the image is streamed back in the call to Stroke() - // If false the image is just created in the cache - function __construct($aWidth=300,$aHeight=200,$aCachedName='',$aTimeout=0,$aInline=true) { - - if( !is_numeric($aWidth) || !is_numeric($aHeight) ) { - JpGraphError::RaiseL(25008);//('Image width/height argument in Graph::Graph() must be numeric'); - } - - // Initialize frame and margin - $this->InitializeFrameAndMargin(); - - // Automatically generate the image file name based on the name of the script that - // generates the graph - if( $aCachedName == 'auto' ) { - $aCachedName=GenImgName(); - } - - // Should the image be streamed back to the browser or only to the cache? - $this->inline=$aInline; - - $this->img = new RotImage($aWidth,$aHeight); - $this->cache = new ImgStreamCache(); - - // Window doesn't like '?' in the file name so replace it with an '_' - $aCachedName = str_replace("?","_",$aCachedName); - $this->SetupCache($aCachedName, $aTimeout); - - $this->title = new Text(); - $this->title->ParagraphAlign('center'); - $this->title->SetFont(FF_DEFAULT,FS_NORMAL); //FF_FONT2, FS_BOLD - $this->title->SetMargin(5); - $this->title->SetAlign('center'); - - $this->subtitle = new Text(); - $this->subtitle->ParagraphAlign('center'); - $this->subtitle->SetMargin(3); - $this->subtitle->SetAlign('center'); - - $this->subsubtitle = new Text(); - $this->subsubtitle->ParagraphAlign('center'); - $this->subsubtitle->SetMargin(3); - $this->subsubtitle->SetAlign('center'); - - $this->legend = new Legend(); - $this->footer = new Footer(); - - // If the cached version exist just read it directly from the - // cache, stream it back to browser and exit - if( $aCachedName!='' && READ_CACHE && $aInline ) { - if( $this->cache->GetAndStream($this->img,$aCachedName) ) { - exit(); - } - } - - $this->SetTickDensity(); // Normal density - - $this->tabtitle = new GraphTabTitle(); - - if (!$this->isRunningClear) { - $this->inputValues = array(); - $this->inputValues['aWidth'] = $aWidth; - $this->inputValues['aHeight'] = $aHeight; - $this->inputValues['aCachedName'] = $aCachedName; - $this->inputValues['aTimeout'] = $aTimeout; - $this->inputValues['aInline'] = $aInline; - - $theme_class = DEFAULT_THEME_CLASS; - if (class_exists($theme_class)) { - $this->graph_theme = new $theme_class(); - } - } - } - - function InitializeFrameAndMargin() { - $this->doframe=true; - $this->frame_color='black'; - $this->frame_weight=1; - - $this->titlebackground_framecolor = 'blue'; - $this->titlebackground_framestyle = 2; - $this->titlebackground_frameweight = 1; - $this->titlebackground_bevelheight = 3; - $this->titlebkg_fillstyle=TITLEBKG_FILLSTYLE_SOLID; - $this->titlebkg_scolor1='black'; - $this->titlebkg_scolor2='white'; - $this->framebevel = false; - $this->framebeveldepth = 2; - $this->framebevelborder = false; - $this->framebevelbordercolor='black'; - $this->framebevelcolor1='white@0.4'; - $this->framebevelcolor2='black@0.4'; - - $this->margin_color = array(250,250,250); - } - - function SetupCache($aFilename,$aTimeout=60) { - $this->cache_name = $aFilename; - $this->cache->SetTimeOut($aTimeout); - } - - // Enable final image perspective transformation - function Set3DPerspective($aDir=1,$aHorizon=100,$aSkewDist=120,$aQuality=false,$aFillColor='#FFFFFF',$aBorder=false,$aMinSize=true,$aHorizonPos=0.5) { - $this->iImgTrans = true; - $this->iImgTransHorizon = $aHorizon; - $this->iImgTransSkewDist= $aSkewDist; - $this->iImgTransDirection = $aDir; - $this->iImgTransMinSize = $aMinSize; - $this->iImgTransFillColor=$aFillColor; - $this->iImgTransHighQ=$aQuality; - $this->iImgTransBorder=$aBorder; - $this->iImgTransHorizonPos=$aHorizonPos; - } - - function SetUserFont($aNormal,$aBold='',$aItalic='',$aBoldIt='') { - $this->img->ttf->SetUserFont($aNormal,$aBold,$aItalic,$aBoldIt); - } - - function SetUserFont1($aNormal,$aBold='',$aItalic='',$aBoldIt='') { - $this->img->ttf->SetUserFont1($aNormal,$aBold,$aItalic,$aBoldIt); - } - - function SetUserFont2($aNormal,$aBold='',$aItalic='',$aBoldIt='') { - $this->img->ttf->SetUserFont2($aNormal,$aBold,$aItalic,$aBoldIt); - } - - function SetUserFont3($aNormal,$aBold='',$aItalic='',$aBoldIt='') { - $this->img->ttf->SetUserFont3($aNormal,$aBold,$aItalic,$aBoldIt); - } - - // Set Image format and optional quality - function SetImgFormat($aFormat,$aQuality=75) { - $this->img->SetImgFormat($aFormat,$aQuality); - } - - // Should the grid be in front or back of the plot? - function SetGridDepth($aDepth) { - $this->grid_depth=$aDepth; - } - - function SetIconDepth($aDepth) { - $this->iIconDepth=$aDepth; - } - - // Specify graph angle 0-360 degrees. - function SetAngle($aAngle) { - $this->img->SetAngle($aAngle); - } - - function SetAlphaBlending($aFlg=true) { - $this->img->SetAlphaBlending($aFlg); - } - - // Shortcut to image margin - function SetMargin($lm,$rm,$tm,$bm) { - $this->img->SetMargin($lm,$rm,$tm,$bm); - } - - function SetY2OrderBack($aBack=true) { - $this->y2orderback = $aBack; - } - - // Rotate the graph 90 degrees and set the margin - // when we have done a 90 degree rotation - function Set90AndMargin($lm=0,$rm=0,$tm=0,$bm=0) { - $lm = $lm ==0 ? floor(0.2 * $this->img->width) : $lm ; - $rm = $rm ==0 ? floor(0.1 * $this->img->width) : $rm ; - $tm = $tm ==0 ? floor(0.2 * $this->img->height) : $tm ; - $bm = $bm ==0 ? floor(0.1 * $this->img->height) : $bm ; - - $adj = ($this->img->height - $this->img->width)/2; - $this->img->SetMargin($tm-$adj,$bm-$adj,$rm+$adj,$lm+$adj); - $this->img->SetCenter(floor($this->img->width/2),floor($this->img->height/2)); - $this->SetAngle(90); - if( empty($this->yaxis) || empty($this->xaxis) ) { - JpgraphError::RaiseL(25009);//('You must specify what scale to use with a call to Graph::SetScale()'); - } - $this->xaxis->SetLabelAlign('right','center'); - $this->yaxis->SetLabelAlign('center','bottom'); - } - - function SetClipping($aFlg=true) { - $this->iDoClipping = $aFlg ; - } - - // Add a plot object to the graph - function Add($aPlot) { - if( $aPlot == null ) { - JpGraphError::RaiseL(25010);//("Graph::Add() You tried to add a null plot to the graph."); - } - if( is_array($aPlot) && count($aPlot) > 0 ) { - $cl = $aPlot[0]; - } - else { - $cl = $aPlot; - } - - if( $cl instanceof Text ) $this->AddText($aPlot); - elseif( class_exists('PlotLine',false) && ($cl instanceof PlotLine) ) $this->AddLine($aPlot); - elseif( class_exists('PlotBand',false) && ($cl instanceof PlotBand) ) $this->AddBand($aPlot); - elseif( class_exists('IconPlot',false) && ($cl instanceof IconPlot) ) $this->AddIcon($aPlot); - elseif( class_exists('GTextTable',false) && ($cl instanceof GTextTable) ) $this->AddTable($aPlot); - else { - if( is_array($aPlot) ) { - $this->plots = array_merge($this->plots,$aPlot); - } - else { - $this->plots[] = $aPlot; - } - } - - if ($this->graph_theme) { - $this->graph_theme->SetupPlot($aPlot); - } - } - - function AddTable($aTable) { - if( is_array($aTable) ) { - for($i=0; $i < count($aTable); ++$i ) { - $this->iTables[]=$aTable[$i]; - } - } - else { - $this->iTables[] = $aTable ; - } - } - - function AddIcon($aIcon) { - if( is_array($aIcon) ) { - for($i=0; $i < count($aIcon); ++$i ) { - $this->iIcons[]=$aIcon[$i]; - } - } - else { - $this->iIcons[] = $aIcon ; - } - } - - // Add plot to second Y-scale - function AddY2($aPlot) { - if( $aPlot == null ) { - JpGraphError::RaiseL(25011);//("Graph::AddY2() You tried to add a null plot to the graph."); - } - - if( is_array($aPlot) && count($aPlot) > 0 ) { - $cl = $aPlot[0]; - } - else { - $cl = $aPlot; - } - - if( $cl instanceof Text ) { - $this->AddText($aPlot,true); - } - elseif( class_exists('PlotLine',false) && ($cl instanceof PlotLine) ) { - $this->AddLine($aPlot,true); - } - elseif( class_exists('PlotBand',false) && ($cl instanceof PlotBand) ) { - $this->AddBand($aPlot,true); - } - else { - $this->y2plots[] = $aPlot; - } - - if ($this->graph_theme) { - $this->graph_theme->SetupPlot($aPlot); - } - } - - // Add plot to the extra Y-axises - function AddY($aN,$aPlot) { - - if( $aPlot == null ) { - JpGraphError::RaiseL(25012);//("Graph::AddYN() You tried to add a null plot to the graph."); - } - - if( is_array($aPlot) && count($aPlot) > 0 ) { - $cl = $aPlot[0]; - } - else { - $cl = $aPlot; - } - - if( ($cl instanceof Text) || - (class_exists('PlotLine',false) && ($cl instanceof PlotLine)) || - (class_exists('PlotBand',false) && ($cl instanceof PlotBand)) ) { - JpGraph::RaiseL(25013);//('You can only add standard plots to multiple Y-axis'); - } - else { - $this->ynplots[$aN][] = $aPlot; - } - - if ($this->graph_theme) { - $this->graph_theme->SetupPlot($aPlot); - } - } - - // Add text object to the graph - function AddText($aTxt,$aToY2=false) { - if( $aTxt == null ) { - JpGraphError::RaiseL(25014);//("Graph::AddText() You tried to add a null text to the graph."); - } - if( $aToY2 ) { - if( is_array($aTxt) ) { - for($i=0; $i < count($aTxt); ++$i ) { - $this->y2texts[]=$aTxt[$i]; - } - } - else { - $this->y2texts[] = $aTxt; - } - } - else { - if( is_array($aTxt) ) { - for($i=0; $i < count($aTxt); ++$i ) { - $this->texts[]=$aTxt[$i]; - } - } - else { - $this->texts[] = $aTxt; - } - } - } - - // Add a line object (class PlotLine) to the graph - function AddLine($aLine,$aToY2=false) { - if( $aLine == null ) { - JpGraphError::RaiseL(25015);//("Graph::AddLine() You tried to add a null line to the graph."); - } - - if( $aToY2 ) { - if( is_array($aLine) ) { - for($i=0; $i < count($aLine); ++$i ) { - //$this->y2lines[]=$aLine[$i]; - $this->y2plots[]=$aLine[$i]; - } - } - else { - //$this->y2lines[] = $aLine; - $this->y2plots[]=$aLine; - } - } - else { - if( is_array($aLine) ) { - for($i=0; $ilines[]=$aLine[$i]; - $this->plots[]=$aLine[$i]; - } - } - else { - //$this->lines[] = $aLine; - $this->plots[] = $aLine; - } - } - } - - // Add vertical or horizontal band - function AddBand($aBand,$aToY2=false) { - if( $aBand == null ) { - JpGraphError::RaiseL(25016);//(" Graph::AddBand() You tried to add a null band to the graph."); - } - - if( $aToY2 ) { - if( is_array($aBand) ) { - for($i=0; $i < count($aBand); ++$i ) { - $this->y2bands[] = $aBand[$i]; - } - } - else { - $this->y2bands[] = $aBand; - } - } - else { - if( is_array($aBand) ) { - for($i=0; $i < count($aBand); ++$i ) { - $this->bands[] = $aBand[$i]; - } - } - else { - $this->bands[] = $aBand; - } - } - } - - function SetPlotGradient($aFrom='navy',$aTo='silver',$aGradType=2) { - $this->plot_gradtype=$aGradType; - $this->plot_gradfrom = $aFrom; - $this->plot_gradto = $aTo; - } - - function SetBackgroundGradient($aFrom='navy',$aTo='silver',$aGradType=2,$aStyle=BGRAD_FRAME) { - $this->bkg_gradtype=$aGradType; - $this->bkg_gradstyle=$aStyle; - $this->bkg_gradfrom = $aFrom; - $this->bkg_gradto = $aTo; - } - - // Set a country flag in the background - function SetBackgroundCFlag($aName,$aBgType=BGIMG_FILLPLOT,$aMix=100) { - $this->background_cflag = $aName; - $this->background_cflag_type = $aBgType; - $this->background_cflag_mix = $aMix; - } - - // Alias for the above method - function SetBackgroundCountryFlag($aName,$aBgType=BGIMG_FILLPLOT,$aMix=100) { - $this->background_cflag = $aName; - $this->background_cflag_type = $aBgType; - $this->background_cflag_mix = $aMix; - } - - - // Specify a background image - function SetBackgroundImage($aFileName,$aBgType=BGIMG_FILLPLOT,$aImgFormat='auto') { - - // Get extension to determine image type - if( $aImgFormat == 'auto' ) { - $e = explode('.',$aFileName); - if( !$e ) { - JpGraphError::RaiseL(25018,$aFileName);//('Incorrect file name for Graph::SetBackgroundImage() : '.$aFileName.' Must have a valid image extension (jpg,gif,png) when using autodetection of image type'); - } - - $valid_formats = array('png', 'jpg', 'gif'); - $aImgFormat = strtolower($e[count($e)-1]); - if ($aImgFormat == 'jpeg') { - $aImgFormat = 'jpg'; - } - elseif (!in_array($aImgFormat, $valid_formats) ) { - JpGraphError::RaiseL(25019,$aImgFormat);//('Unknown file extension ($aImgFormat) in Graph::SetBackgroundImage() for filename: '.$aFileName); - } - } - - $this->background_image = $aFileName; - $this->background_image_type=$aBgType; - $this->background_image_format=$aImgFormat; - } - - function SetBackgroundImageMix($aMix) { - $this->background_image_mix = $aMix ; - } - - // Adjust background image position - function SetBackgroundImagePos($aXpos,$aYpos) { - $this->background_image_xpos = $aXpos ; - $this->background_image_ypos = $aYpos ; - } - - // Specify axis style (boxed or single) - function SetAxisStyle($aStyle) { - $this->iAxisStyle = $aStyle ; - } - - // Set a frame around the plot area - function SetBox($aDrawPlotFrame=true,$aPlotFrameColor=array(0,0,0),$aPlotFrameWeight=1) { - $this->boxed = $aDrawPlotFrame; - $this->box_weight = $aPlotFrameWeight; - $this->box_color = $aPlotFrameColor; - } - - // Specify color for the plotarea (not the margins) - function SetColor($aColor) { - $this->plotarea_color=$aColor; - } - - // Specify color for the margins (all areas outside the plotarea) - function SetMarginColor($aColor) { - $this->margin_color=$aColor; - } - - // Set a frame around the entire image - function SetFrame($aDrawImgFrame=true,$aImgFrameColor=array(0,0,0),$aImgFrameWeight=1) { - $this->doframe = $aDrawImgFrame; - $this->frame_color = $aImgFrameColor; - $this->frame_weight = $aImgFrameWeight; - } - - function SetFrameBevel($aDepth=3,$aBorder=false,$aBorderColor='black',$aColor1='white@0.4',$aColor2='darkgray@0.4',$aFlg=true) { - $this->framebevel = $aFlg ; - $this->framebeveldepth = $aDepth ; - $this->framebevelborder = $aBorder ; - $this->framebevelbordercolor = $aBorderColor ; - $this->framebevelcolor1 = $aColor1 ; - $this->framebevelcolor2 = $aColor2 ; - - $this->doshadow = false ; - } - - // Set the shadow around the whole image - function SetShadow($aShowShadow=true,$aShadowWidth=5,$aShadowColor='darkgray') { - $this->doshadow = $aShowShadow; - $this->shadow_color = $aShadowColor; - $this->shadow_width = $aShadowWidth; - $this->footer->iBottomMargin += $aShadowWidth; - $this->footer->iRightMargin += $aShadowWidth; - } - - // Specify x,y scale. Note that if you manually specify the scale - // you must also specify the tick distance with a call to Ticks::Set() - function SetScale($aAxisType,$aYMin=1,$aYMax=1,$aXMin=1,$aXMax=1) { - $this->axtype = $aAxisType; - - if( $aYMax < $aYMin || $aXMax < $aXMin ) { - JpGraphError::RaiseL(25020);//('Graph::SetScale(): Specified Max value must be larger than the specified Min value.'); - } - - $yt=substr($aAxisType,-3,3); - if( $yt == 'lin' ) { - $this->yscale = new LinearScale($aYMin,$aYMax); - } - elseif( $yt == 'int' ) { - $this->yscale = new LinearScale($aYMin,$aYMax); - $this->yscale->SetIntScale(); - } - elseif( $yt == 'log' ) { - $this->yscale = new LogScale($aYMin,$aYMax); - } - else { - JpGraphError::RaiseL(25021,$aAxisType);//("Unknown scale specification for Y-scale. ($aAxisType)"); - } - - $xt=substr($aAxisType,0,3); - if( $xt == 'lin' || $xt == 'tex' ) { - $this->xscale = new LinearScale($aXMin,$aXMax,'x'); - $this->xscale->textscale = ($xt == 'tex'); - } - elseif( $xt == 'int' ) { - $this->xscale = new LinearScale($aXMin,$aXMax,'x'); - $this->xscale->SetIntScale(); - } - elseif( $xt == 'dat' ) { - $this->xscale = new DateScale($aXMin,$aXMax,'x'); - } - elseif( $xt == 'log' ) { - $this->xscale = new LogScale($aXMin,$aXMax,'x'); - } - else { - JpGraphError::RaiseL(25022,$aAxisType);//(" Unknown scale specification for X-scale. ($aAxisType)"); - } - - $this->xaxis = new Axis($this->img,$this->xscale); - $this->yaxis = new Axis($this->img,$this->yscale); - $this->xgrid = new Grid($this->xaxis); - $this->ygrid = new Grid($this->yaxis); - $this->ygrid->Show(); - - - if (!$this->isRunningClear) { - $this->inputValues['aAxisType'] = $aAxisType; - $this->inputValues['aYMin'] = $aYMin; - $this->inputValues['aYMax'] = $aYMax; - $this->inputValues['aXMin'] = $aXMin; - $this->inputValues['aXMax'] = $aXMax; - - if ($this->graph_theme) { - $this->graph_theme->ApplyGraph($this); - } - } - - $this->isAfterSetScale = true; - } - - // Specify secondary Y scale - function SetY2Scale($aAxisType='lin',$aY2Min=1,$aY2Max=1) { - if( $aAxisType == 'lin' ) { - $this->y2scale = new LinearScale($aY2Min,$aY2Max); - } - elseif( $aAxisType == 'int' ) { - $this->y2scale = new LinearScale($aY2Min,$aY2Max); - $this->y2scale->SetIntScale(); - } - elseif( $aAxisType == 'log' ) { - $this->y2scale = new LogScale($aY2Min,$aY2Max); - } - else { - JpGraphError::RaiseL(25023,$aAxisType);//("JpGraph: Unsupported Y2 axis type: $aAxisType\nMust be one of (lin,log,int)"); - } - - $this->y2axis = new Axis($this->img,$this->y2scale); - $this->y2axis->scale->ticks->SetDirection(SIDE_LEFT); - $this->y2axis->SetLabelSide(SIDE_RIGHT); - $this->y2axis->SetPos('max'); - $this->y2axis->SetTitleSide(SIDE_RIGHT); - - // Deafult position is the max x-value - $this->y2grid = new Grid($this->y2axis); - - if ($this->graph_theme) { - $this->graph_theme->ApplyGraph($this); - } - } - - // Set the delta position (in pixels) between the multiple Y-axis - function SetYDeltaDist($aDist) { - $this->iYAxisDeltaPos = $aDist; - } - - // Specify secondary Y scale - function SetYScale($aN,$aAxisType="lin",$aYMin=1,$aYMax=1) { - - if( $aAxisType == 'lin' ) { - $this->ynscale[$aN] = new LinearScale($aYMin,$aYMax); - } - elseif( $aAxisType == 'int' ) { - $this->ynscale[$aN] = new LinearScale($aYMin,$aYMax); - $this->ynscale[$aN]->SetIntScale(); - } - elseif( $aAxisType == 'log' ) { - $this->ynscale[$aN] = new LogScale($aYMin,$aYMax); - } - else { - JpGraphError::RaiseL(25024,$aAxisType);//("JpGraph: Unsupported Y axis type: $aAxisType\nMust be one of (lin,log,int)"); - } - - $this->ynaxis[$aN] = new Axis($this->img,$this->ynscale[$aN]); - $this->ynaxis[$aN]->scale->ticks->SetDirection(SIDE_LEFT); - $this->ynaxis[$aN]->SetLabelSide(SIDE_RIGHT); - - if ($this->graph_theme) { - $this->graph_theme->ApplyGraph($this); - } - } - - // Specify density of ticks when autoscaling 'normal', 'dense', 'sparse', 'verysparse' - // The dividing factor have been determined heuristically according to my aesthetic - // sense (or lack off) y.m.m.v ! - function SetTickDensity($aYDensity=TICKD_NORMAL,$aXDensity=TICKD_NORMAL) { - $this->xtick_factor=30; - $this->ytick_factor=25; - switch( $aYDensity ) { - case TICKD_DENSE: - $this->ytick_factor=12; - break; - case TICKD_NORMAL: - $this->ytick_factor=25; - break; - case TICKD_SPARSE: - $this->ytick_factor=40; - break; - case TICKD_VERYSPARSE: - $this->ytick_factor=100; - break; - default: - JpGraphError::RaiseL(25025,$densy);//("JpGraph: Unsupported Tick density: $densy"); - } - switch( $aXDensity ) { - case TICKD_DENSE: - $this->xtick_factor=15; - break; - case TICKD_NORMAL: - $this->xtick_factor=30; - break; - case TICKD_SPARSE: - $this->xtick_factor=45; - break; - case TICKD_VERYSPARSE: - $this->xtick_factor=60; - break; - default: - JpGraphError::RaiseL(25025,$densx);//("JpGraph: Unsupported Tick density: $densx"); - } - } - - - // Get a string of all image map areas - function GetCSIMareas() { - if( !$this->iHasStroked ) { - $this->Stroke(_CSIM_SPECIALFILE); - } - - $csim = $this->title->GetCSIMAreas(); - $csim .= $this->subtitle->GetCSIMAreas(); - $csim .= $this->subsubtitle->GetCSIMAreas(); - $csim .= $this->legend->GetCSIMAreas(); - - if( $this->y2axis != NULL ) { - $csim .= $this->y2axis->title->GetCSIMAreas(); - } - - if( $this->texts != null ) { - $n = count($this->texts); - for($i=0; $i < $n; ++$i ) { - $csim .= $this->texts[$i]->GetCSIMAreas(); - } - } - - if( $this->y2texts != null && $this->y2scale != null ) { - $n = count($this->y2texts); - for($i=0; $i < $n; ++$i ) { - $csim .= $this->y2texts[$i]->GetCSIMAreas(); - } - } - - if( $this->yaxis != null && $this->xaxis != null ) { - $csim .= $this->yaxis->title->GetCSIMAreas(); - $csim .= $this->xaxis->title->GetCSIMAreas(); - } - - $n = count($this->plots); - for( $i=0; $i < $n; ++$i ) { - $csim .= $this->plots[$i]->GetCSIMareas(); - } - - $n = count($this->y2plots); - for( $i=0; $i < $n; ++$i ) { - $csim .= $this->y2plots[$i]->GetCSIMareas(); - } - - $n = count($this->ynaxis); - for( $i=0; $i < $n; ++$i ) { - $m = count($this->ynplots[$i]); - for($j=0; $j < $m; ++$j ) { - $csim .= $this->ynplots[$i][$j]->GetCSIMareas(); - } - } - - $n = count($this->iTables); - for( $i=0; $i < $n; ++$i ) { - $csim .= $this->iTables[$i]->GetCSIMareas(); - } - - return $csim; - } - - // Get a complete .. tag for the final image map - function GetHTMLImageMap($aMapName) { - $im = "\n"; - $im .= $this->GetCSIMareas(); - $im .= ""; - return $im; - } - - function CheckCSIMCache($aCacheName,$aTimeOut=60) { - global $_SERVER; - - if( $aCacheName=='auto' ) { - $aCacheName=basename($_SERVER['PHP_SELF']); - } - - $urlarg = $this->GetURLArguments(); - $this->csimcachename = CSIMCACHE_DIR.$aCacheName.$urlarg; - $this->csimcachetimeout = $aTimeOut; - - // First determine if we need to check for a cached version - // This differs from the standard cache in the sense that the - // image and CSIM map HTML file is written relative to the directory - // the script executes in and not the specified cache directory. - // The reason for this is that the cache directory is not necessarily - // accessible from the HTTP server. - if( $this->csimcachename != '' ) { - $dir = dirname($this->csimcachename); - $base = basename($this->csimcachename); - $base = strtok($base,'.'); - $suffix = strtok('.'); - $basecsim = $dir.'/'.$base.'?'.$urlarg.'_csim_.html'; - $baseimg = $dir.'/'.$base.'?'.$urlarg.'.'.$this->img->img_format; - - $timedout=false; - // Does it exist at all ? - - if( file_exists($basecsim) && file_exists($baseimg) ) { - // Check that it hasn't timed out - $diff=time()-filemtime($basecsim); - if( $this->csimcachetimeout>0 && ($diff > $this->csimcachetimeout*60) ) { - $timedout=true; - @unlink($basecsim); - @unlink($baseimg); - } - else { - if ($fh = @fopen($basecsim, "r")) { - fpassthru($fh); - return true; - } - else { - JpGraphError::RaiseL(25027,$basecsim);//(" Can't open cached CSIM \"$basecsim\" for reading."); - } - } - } - } - return false; - } - - // Build the argument string to be used with the csim images - static function GetURLArguments($aAddRecursiveBlocker=false) { - - if( $aAddRecursiveBlocker ) { - // This is a JPGRAPH internal defined that prevents - // us from recursively coming here again - $urlarg = _CSIM_DISPLAY.'=1'; - } - - // Now reconstruct any user URL argument - reset($_GET); - while( list($key,$value) = each($_GET) ) { - if( is_array($value) ) { - foreach ( $value as $k => $v ) { - $urlarg .= '&'.$key.'%5B'.$k.'%5D='.urlencode($v); - } - } - else { - $urlarg .= '&'.$key.'='.urlencode($value); - } - } - - // It's not ideal to convert POST argument to GET arguments - // but there is little else we can do. One idea for the - // future might be recreate the POST header in case. - reset($_POST); - while( list($key,$value) = each($_POST) ) { - if( is_array($value) ) { - foreach ( $value as $k => $v ) { - $urlarg .= '&'.$key.'%5B'.$k.'%5D='.urlencode($v); - } - } - else { - $urlarg .= '&'.$key.'='.urlencode($value); - } - } - - return $urlarg; - } - - function SetCSIMImgAlt($aAlt) { - $this->iCSIMImgAlt = $aAlt; - } - - function StrokeCSIM($aScriptName='auto',$aCSIMName='',$aBorder=0) { - if( $aCSIMName=='' ) { - // create a random map name - srand ((double) microtime() * 1000000); - $r = rand(0,100000); - $aCSIMName='__mapname'.$r.'__'; - } - - if( $aScriptName=='auto' ) { - $aScriptName=basename($_SERVER['PHP_SELF']); - } - - $urlarg = $this->GetURLArguments(true); - - if( empty($_GET[_CSIM_DISPLAY]) ) { - // First determine if we need to check for a cached version - // This differs from the standard cache in the sense that the - // image and CSIM map HTML file is written relative to the directory - // the script executes in and not the specified cache directory. - // The reason for this is that the cache directory is not necessarily - // accessible from the HTTP server. - if( $this->csimcachename != '' ) { - $dir = dirname($this->csimcachename); - $base = basename($this->csimcachename); - $base = strtok($base,'.'); - $suffix = strtok('.'); - $basecsim = $dir.'/'.$base.'?'.$urlarg.'_csim_.html'; - $baseimg = $base.'?'.$urlarg.'.'.$this->img->img_format; - - // Check that apache can write to directory specified - - if( file_exists($dir) && !is_writeable($dir) ) { - JpgraphError::RaiseL(25028,$dir);//('Apache/PHP does not have permission to write to the CSIM cache directory ('.$dir.'). Check permissions.'); - } - - // Make sure directory exists - $this->cache->MakeDirs($dir); - - // Write the image file - $this->Stroke(CSIMCACHE_DIR.$baseimg); - - // Construct wrapper HTML and write to file and send it back to browser - - // In the src URL we must replace the '?' with its encoding to prevent the arguments - // to be converted to real arguments. - $tmp = str_replace('?','%3f',$baseimg); - $htmlwrap = $this->GetHTMLImageMap($aCSIMName)."\n". - 'img->width.'" height="'.$this->img->height."\" alt=\"".$this->iCSIMImgAlt."\" />\n"; - - if($fh = @fopen($basecsim,'w') ) { - fwrite($fh,$htmlwrap); - fclose($fh); - echo $htmlwrap; - } - else { - JpGraphError::RaiseL(25029,$basecsim);//(" Can't write CSIM \"$basecsim\" for writing. Check free space and permissions."); - } - } - else { - - if( $aScriptName=='' ) { - JpGraphError::RaiseL(25030);//('Missing script name in call to StrokeCSIM(). You must specify the name of the actual image script as the first parameter to StrokeCSIM().'); - } - echo $this->GetHTMLImageMap($aCSIMName) . $this->GetCSIMImgHTML($aCSIMName, $aScriptName, $aBorder); - } - } - else { - $this->Stroke(); - } - } - - function StrokeCSIMImage() { - if( @$_GET[_CSIM_DISPLAY] == 1 ) { - $this->Stroke(); - } - } - - function GetCSIMImgHTML($aCSIMName, $aScriptName='auto', $aBorder=0 ) { - if( $aScriptName=='auto' ) { - $aScriptName=basename($_SERVER['PHP_SELF']); - } - $urlarg = $this->GetURLArguments(true); - return "\"".$this-iCSIMImgAlt."\" />\n"; - } - - function GetTextsYMinMax($aY2=false) { - if( $aY2 ) { - $txts = $this->y2texts; - } - else { - $txts = $this->texts; - } - $n = count($txts); - $min=null; - $max=null; - for( $i=0; $i < $n; ++$i ) { - if( $txts[$i]->iScalePosY !== null && $txts[$i]->iScalePosX !== null ) { - if( $min === null ) { - $min = $max = $txts[$i]->iScalePosY ; - } - else { - $min = min($min,$txts[$i]->iScalePosY); - $max = max($max,$txts[$i]->iScalePosY); - } - } - } - if( $min !== null ) { - return array($min,$max); - } - else { - return null; - } - } - - function GetTextsXMinMax($aY2=false) { - if( $aY2 ) { - $txts = $this->y2texts; - } - else { - $txts = $this->texts; - } - $n = count($txts); - $min=null; - $max=null; - for( $i=0; $i < $n; ++$i ) { - if( $txts[$i]->iScalePosY !== null && $txts[$i]->iScalePosX !== null ) { - if( $min === null ) { - $min = $max = $txts[$i]->iScalePosX ; - } - else { - $min = min($min,$txts[$i]->iScalePosX); - $max = max($max,$txts[$i]->iScalePosX); - } - } - } - if( $min !== null ) { - return array($min,$max); - } - else { - return null; - } - } - - function GetXMinMax() { - - list($min,$ymin) = $this->plots[0]->Min(); - list($max,$ymax) = $this->plots[0]->Max(); - - $i=0; - // Some plots, e.g. PlotLine should not affect the scale - // and will return (null,null). We should ignore those - // values. - while( ($min===null || $max === null) && ($i < count($this->plots)-1) ) { - ++$i; - list($min,$ymin) = $this->plots[$i]->Min(); - list($max,$ymax) = $this->plots[$i]->Max(); - } - - foreach( $this->plots as $p ) { - list($xmin,$ymin) = $p->Min(); - list($xmax,$ymax) = $p->Max(); - - if( $xmin !== null && $xmax !== null ) { - $min = Min($xmin,$min); - $max = Max($xmax,$max); - } - } - - if( $this->y2axis != null ) { - foreach( $this->y2plots as $p ) { - list($xmin,$ymin) = $p->Min(); - list($xmax,$ymax) = $p->Max(); - $min = Min($xmin,$min); - $max = Max($xmax,$max); - } - } - - $n = count($this->ynaxis); - for( $i=0; $i < $n; ++$i ) { - if( $this->ynaxis[$i] != null) { - foreach( $this->ynplots[$i] as $p ) { - list($xmin,$ymin) = $p->Min(); - list($xmax,$ymax) = $p->Max(); - $min = Min($xmin,$min); - $max = Max($xmax,$max); - } - } - } - return array($min,$max); - } - - function AdjustMarginsForTitles() { - $totrequired = - ($this->title->t != '' - ? $this->title->GetTextHeight($this->img) + $this->title->margin + 5 * SUPERSAMPLING_SCALE - : 0 ) + - ($this->subtitle->t != '' - ? $this->subtitle->GetTextHeight($this->img) + $this->subtitle->margin + 5 * SUPERSAMPLING_SCALE - : 0 ) + - ($this->subsubtitle->t != '' - ? $this->subsubtitle->GetTextHeight($this->img) + $this->subsubtitle->margin + 5 * SUPERSAMPLING_SCALE - : 0 ) ; - - $btotrequired = 0; - if($this->xaxis != null && !$this->xaxis->hide && !$this->xaxis->hide_labels ) { - // Minimum bottom margin - if( $this->xaxis->title->t != '' ) { - if( $this->img->a == 90 ) { - $btotrequired = $this->yaxis->title->GetTextHeight($this->img) + 7 ; - } - else { - $btotrequired = $this->xaxis->title->GetTextHeight($this->img) + 7 ; - } - } - else { - $btotrequired = 0; - } - - if( $this->img->a == 90 ) { - $this->img->SetFont($this->yaxis->font_family,$this->yaxis->font_style, - $this->yaxis->font_size); - $lh = $this->img->GetTextHeight('Mg',$this->yaxis->label_angle); - } - else { - $this->img->SetFont($this->xaxis->font_family,$this->xaxis->font_style, - $this->xaxis->font_size); - $lh = $this->img->GetTextHeight('Mg',$this->xaxis->label_angle); - } - - $btotrequired += $lh + 6; - } - - if( $this->img->a == 90 ) { - // DO Nothing. It gets too messy to do this properly for 90 deg... - } - else{ - // need more top margin - if( $this->img->top_margin < $totrequired ) { - $this->SetMargin( - $this->img->raw_left_margin, - $this->img->raw_right_margin, - $totrequired / SUPERSAMPLING_SCALE, - $this->img->raw_bottom_margin - ); - } - - // need more bottom margin - if( $this->img->bottom_margin < $btotrequired ) { - $this->SetMargin( - $this->img->raw_left_margin, - $this->img->raw_right_margin, - $this->img->raw_top_margin, - $btotrequired / SUPERSAMPLING_SCALE - ); - } - } - } - - function StrokeStore($aStrokeFileName) { - // Get the handler to prevent the library from sending the - // image to the browser - $ih = $this->Stroke(_IMG_HANDLER); - - // Stroke it to a file - $this->img->Stream($aStrokeFileName); - - // Send it back to browser - $this->img->Headers(); - $this->img->Stream(); - } - - function doAutoscaleXAxis() { - //Check if we should autoscale x-axis - if( !$this->xscale->IsSpecified() ) { - if( substr($this->axtype,0,4) == "text" ) { - $max=0; - $n = count($this->plots); - for($i=0; $i < $n; ++$i ) { - $p = $this->plots[$i]; - // We need some unfortunate sub class knowledge here in order - // to increase number of data points in case it is a line plot - // which has the barcenter set. If not it could mean that the - // last point of the data is outside the scale since the barcenter - // settings means that we will shift the entire plot half a tick step - // to the right in oder to align with the center of the bars. - if( class_exists('BarPlot',false) ) { - $cl = strtolower(get_class($p)); - if( (class_exists('BarPlot',false) && ($p instanceof BarPlot)) || empty($p->barcenter) ) { - $max=max($max,$p->numpoints-1); - } - else { - $max=max($max,$p->numpoints); - } - } - else { - if( empty($p->barcenter) ) { - $max=max($max,$p->numpoints-1); - } - else { - $max=max($max,$p->numpoints); - } - } - } - $min=0; - if( $this->y2axis != null ) { - foreach( $this->y2plots as $p ) { - $max=max($max,$p->numpoints-1); - } - } - $n = count($this->ynaxis); - for( $i=0; $i < $n; ++$i ) { - if( $this->ynaxis[$i] != null) { - foreach( $this->ynplots[$i] as $p ) { - $max=max($max,$p->numpoints-1); - } - } - } - - $this->xscale->Update($this->img,$min,$max); - $this->xscale->ticks->Set($this->xaxis->tick_step,1); - $this->xscale->ticks->SupressMinorTickMarks(); - } - else { - list($min,$max) = $this->GetXMinMax(); - - $lres = $this->GetLinesXMinMax($this->lines); - if( $lres ) { - list($linmin,$linmax) = $lres ; - $min = min($min,$linmin); - $max = max($max,$linmax); - } - - $lres = $this->GetLinesXMinMax($this->y2lines); - if( $lres ) { - list($linmin,$linmax) = $lres ; - $min = min($min,$linmin); - $max = max($max,$linmax); - } - - $tres = $this->GetTextsXMinMax(); - if( $tres ) { - list($tmin,$tmax) = $tres ; - $min = min($min,$tmin); - $max = max($max,$tmax); - } - - $tres = $this->GetTextsXMinMax(true); - if( $tres ) { - list($tmin,$tmax) = $tres ; - $min = min($min,$tmin); - $max = max($max,$tmax); - } - - $this->xscale->AutoScale($this->img,$min,$max,round($this->img->plotwidth/$this->xtick_factor)); - } - - //Adjust position of y-axis and y2-axis to minimum/maximum of x-scale - if( !is_numeric($this->yaxis->pos) && !is_string($this->yaxis->pos) ) { - $this->yaxis->SetPos($this->xscale->GetMinVal()); - } - } - elseif( $this->xscale->IsSpecified() && - ( $this->xscale->auto_ticks || !$this->xscale->ticks->IsSpecified()) ) { - // The tick calculation will use the user suplied min/max values to determine - // the ticks. If auto_ticks is false the exact user specifed min and max - // values will be used for the scale. - // If auto_ticks is true then the scale might be slightly adjusted - // so that the min and max values falls on an even major step. - $min = $this->xscale->scale[0]; - $max = $this->xscale->scale[1]; - $this->xscale->AutoScale($this->img,$min,$max,round($this->img->plotwidth/$this->xtick_factor),false); - - // Now make sure we show enough precision to accurate display the - // labels. If this is not done then the user might end up with - // a scale that might actually start with, say 13.5, butdue to rounding - // the scale label will ony show 14. - if( abs(floor($min)-$min) > 0 ) { - - // If the user has set a format then we bail out - if( $this->xscale->ticks->label_formatstr == '' && $this->xscale->ticks->label_dateformatstr == '' ) { - $this->xscale->ticks->precision = abs( floor(log10( abs(floor($min)-$min))) )+1; - } - } - } - - // Position the optional Y2 and Yn axis to the rightmost position of the x-axis - if( $this->y2axis != null ) { - if( !is_numeric($this->y2axis->pos) && !is_string($this->y2axis->pos) ) { - $this->y2axis->SetPos($this->xscale->GetMaxVal()); - } - $this->y2axis->SetTitleSide(SIDE_RIGHT); - } - - $n = count($this->ynaxis); - $nY2adj = $this->y2axis != null ? $this->iYAxisDeltaPos : 0; - for( $i=0; $i < $n; ++$i ) { - if( $this->ynaxis[$i] != null ) { - if( !is_numeric($this->ynaxis[$i]->pos) && !is_string($this->ynaxis[$i]->pos) ) { - $this->ynaxis[$i]->SetPos($this->xscale->GetMaxVal()); - $this->ynaxis[$i]->SetPosAbsDelta($i*$this->iYAxisDeltaPos + $nY2adj); - } - $this->ynaxis[$i]->SetTitleSide(SIDE_RIGHT); - } - } - } - - - function doAutoScaleYnAxis() { - - if( $this->y2scale != null) { - if( !$this->y2scale->IsSpecified() && count($this->y2plots)>0 ) { - list($min,$max) = $this->GetPlotsYMinMax($this->y2plots); - - $lres = $this->GetLinesYMinMax($this->y2lines); - if( is_array($lres) ) { - list($linmin,$linmax) = $lres ; - $min = min($min,$linmin); - $max = max($max,$linmax); - } - $tres = $this->GetTextsYMinMax(true); - if( is_array($tres) ) { - list($tmin,$tmax) = $tres ; - $min = min($min,$tmin); - $max = max($max,$tmax); - } - $this->y2scale->AutoScale($this->img,$min,$max,$this->img->plotheight/$this->ytick_factor); - } - elseif( $this->y2scale->IsSpecified() && ( $this->y2scale->auto_ticks || !$this->y2scale->ticks->IsSpecified()) ) { - // The tick calculation will use the user suplied min/max values to determine - // the ticks. If auto_ticks is false the exact user specifed min and max - // values will be used for the scale. - // If auto_ticks is true then the scale might be slightly adjusted - // so that the min and max values falls on an even major step. - $min = $this->y2scale->scale[0]; - $max = $this->y2scale->scale[1]; - $this->y2scale->AutoScale($this->img,$min,$max, - $this->img->plotheight/$this->ytick_factor, - $this->y2scale->auto_ticks); - - // Now make sure we show enough precision to accurate display the - // labels. If this is not done then the user might end up with - // a scale that might actually start with, say 13.5, butdue to rounding - // the scale label will ony show 14. - if( abs(floor($min)-$min) > 0 ) { - // If the user has set a format then we bail out - if( $this->y2scale->ticks->label_formatstr == '' && $this->y2scale->ticks->label_dateformatstr == '' ) { - $this->y2scale->ticks->precision = abs( floor(log10( abs(floor($min)-$min))) )+1; - } - } - - } - } - - - // - // Autoscale the extra Y-axises - // - $n = count($this->ynaxis); - for( $i=0; $i < $n; ++$i ) { - if( $this->ynscale[$i] != null) { - if( !$this->ynscale[$i]->IsSpecified() && count($this->ynplots[$i])>0 ) { - list($min,$max) = $this->GetPlotsYMinMax($this->ynplots[$i]); - $this->ynscale[$i]->AutoScale($this->img,$min,$max,$this->img->plotheight/$this->ytick_factor); - } - elseif( $this->ynscale[$i]->IsSpecified() && ( $this->ynscale[$i]->auto_ticks || !$this->ynscale[$i]->ticks->IsSpecified()) ) { - // The tick calculation will use the user suplied min/max values to determine - // the ticks. If auto_ticks is false the exact user specifed min and max - // values will be used for the scale. - // If auto_ticks is true then the scale might be slightly adjusted - // so that the min and max values falls on an even major step. - $min = $this->ynscale[$i]->scale[0]; - $max = $this->ynscale[$i]->scale[1]; - $this->ynscale[$i]->AutoScale($this->img,$min,$max, - $this->img->plotheight/$this->ytick_factor, - $this->ynscale[$i]->auto_ticks); - - // Now make sure we show enough precision to accurate display the - // labels. If this is not done then the user might end up with - // a scale that might actually start with, say 13.5, butdue to rounding - // the scale label will ony show 14. - if( abs(floor($min)-$min) > 0 ) { - // If the user has set a format then we bail out - if( $this->ynscale[$i]->ticks->label_formatstr == '' && $this->ynscale[$i]->ticks->label_dateformatstr == '' ) { - $this->ynscale[$i]->ticks->precision = abs( floor(log10( abs(floor($min)-$min))) )+1; - } - } - } - } - } - } - - function doAutoScaleYAxis() { - - //Check if we should autoscale y-axis - if( !$this->yscale->IsSpecified() && count($this->plots)>0 ) { - list($min,$max) = $this->GetPlotsYMinMax($this->plots); - $lres = $this->GetLinesYMinMax($this->lines); - if( is_array($lres) ) { - list($linmin,$linmax) = $lres ; - $min = min($min,$linmin); - $max = max($max,$linmax); - } - $tres = $this->GetTextsYMinMax(); - if( is_array($tres) ) { - list($tmin,$tmax) = $tres ; - $min = min($min,$tmin); - $max = max($max,$tmax); - } - $this->yscale->AutoScale($this->img,$min,$max, - $this->img->plotheight/$this->ytick_factor); - } - elseif( $this->yscale->IsSpecified() && ( $this->yscale->auto_ticks || !$this->yscale->ticks->IsSpecified()) ) { - // The tick calculation will use the user suplied min/max values to determine - // the ticks. If auto_ticks is false the exact user specifed min and max - // values will be used for the scale. - // If auto_ticks is true then the scale might be slightly adjusted - // so that the min and max values falls on an even major step. - $min = $this->yscale->scale[0]; - $max = $this->yscale->scale[1]; - $this->yscale->AutoScale($this->img,$min,$max, - $this->img->plotheight/$this->ytick_factor, - $this->yscale->auto_ticks); - - // Now make sure we show enough precision to accurate display the - // labels. If this is not done then the user might end up with - // a scale that might actually start with, say 13.5, butdue to rounding - // the scale label will ony show 14. - if( abs(floor($min)-$min) > 0 ) { - - // If the user has set a format then we bail out - if( $this->yscale->ticks->label_formatstr == '' && $this->yscale->ticks->label_dateformatstr == '' ) { - $this->yscale->ticks->precision = abs( floor(log10( abs(floor($min)-$min))) )+1; - } - } - } - - } - - function InitScaleConstants() { - // Setup scale constants - if( $this->yscale ) $this->yscale->InitConstants($this->img); - if( $this->xscale ) $this->xscale->InitConstants($this->img); - if( $this->y2scale ) $this->y2scale->InitConstants($this->img); - - $n=count($this->ynscale); - for($i=0; $i < $n; ++$i) { - if( $this->ynscale[$i] ) { - $this->ynscale[$i]->InitConstants($this->img); - } - } - } - - function doPrestrokeAdjustments() { - - // Do any pre-stroke adjustment that is needed by the different plot types - // (i.e bar plots want's to add an offset to the x-labels etc) - for($i=0; $i < count($this->plots) ; ++$i ) { - $this->plots[$i]->PreStrokeAdjust($this); - $this->plots[$i]->DoLegend($this); - } - - // Any plots on the second Y scale? - if( $this->y2scale != null ) { - for($i=0; $iy2plots) ; ++$i ) { - $this->y2plots[$i]->PreStrokeAdjust($this); - $this->y2plots[$i]->DoLegend($this); - } - } - - // Any plots on the extra Y axises? - $n = count($this->ynaxis); - for($i=0; $i<$n ; ++$i ) { - if( $this->ynplots == null || $this->ynplots[$i] == null) { - JpGraphError::RaiseL(25032,$i);//("No plots for Y-axis nbr:$i"); - } - $m = count($this->ynplots[$i]); - for($j=0; $j < $m; ++$j ) { - $this->ynplots[$i][$j]->PreStrokeAdjust($this); - $this->ynplots[$i][$j]->DoLegend($this); - } - } - } - - function StrokeBands($aDepth,$aCSIM) { - // Stroke bands - if( $this->bands != null && !$aCSIM) { - for($i=0; $i < count($this->bands); ++$i) { - // Stroke all bands that asks to be in the background - if( $this->bands[$i]->depth == $aDepth ) { - $this->bands[$i]->Stroke($this->img,$this->xscale,$this->yscale); - } - } - } - - if( $this->y2bands != null && $this->y2scale != null && !$aCSIM ) { - for($i=0; $i < count($this->y2bands); ++$i) { - // Stroke all bands that asks to be in the foreground - if( $this->y2bands[$i]->depth == $aDepth ) { - $this->y2bands[$i]->Stroke($this->img,$this->xscale,$this->y2scale); - } - } - } - } - - - // Stroke the graph - // $aStrokeFileName If != "" the image will be written to this file and NOT - // streamed back to the browser - function Stroke($aStrokeFileName='') { - // Fist make a sanity check that user has specified a scale - if( empty($this->yscale) ) { - JpGraphError::RaiseL(25031);//('You must specify what scale to use with a call to Graph::SetScale().'); - } - - // Start by adjusting the margin so that potential titles will fit. - $this->AdjustMarginsForTitles(); - - // Give the plot a chance to do any scale adjuments the individual plots - // wants to do. Right now this is only used by the contour plot to set scale - // limits - for($i=0; $i < count($this->plots) ; ++$i ) { - $this->plots[$i]->PreScaleSetup($this); - } - - // Init scale constants that are used to calculate the transformation from - // world to pixel coordinates - $this->InitScaleConstants(); - - // If the filename is the predefined value = '_csim_special_' - // we assume that the call to stroke only needs to do enough - // to correctly generate the CSIM maps. - // We use this variable to skip things we don't strictly need - // to do to generate the image map to improve performance - // a best we can. Therefor you will see a lot of tests !$_csim in the - // code below. - $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); - - // If we are called the second time (perhaps the user has called GetHTMLImageMap() - // himself then the legends have alsready been populated once in order to get the - // CSIM coordinats. Since we do not want the legends to be populated a second time - // we clear the legends - $this->legend->Clear(); - - // We need to know if we have stroked the plot in the - // GetCSIMareas. Otherwise the CSIM hasn't been generated - // and in the case of GetCSIM called before stroke to generate - // CSIM without storing an image to disk GetCSIM must call Stroke. - $this->iHasStroked = true; - - // Setup pre-stroked adjustments and Legends - $this->doPrestrokeAdjustments(); - - if ($this->graph_theme) { - $this->graph_theme->PreStrokeApply($this); - } - - // Bail out if any of the Y-axis not been specified and - // has no plots. (This means it is impossible to do autoscaling and - // no other scale was given so we can't possible draw anything). If you use manual - // scaling you also have to supply the tick steps as well. - if( (!$this->yscale->IsSpecified() && count($this->plots)==0) || - ($this->y2scale!=null && !$this->y2scale->IsSpecified() && count($this->y2plots)==0) ) { - //$e = "n=".count($this->y2plots)."\n"; - // $e = "Can't draw unspecified Y-scale.
\nYou have either:
\n"; - // $e .= "1. Specified an Y axis for autoscaling but have not supplied any plots
\n"; - // $e .= "2. Specified a scale manually but have forgot to specify the tick steps"; - JpGraphError::RaiseL(25026); - } - - // Bail out if no plots and no specified X-scale - if( (!$this->xscale->IsSpecified() && count($this->plots)==0 && count($this->y2plots)==0) ) { - JpGraphError::RaiseL(25034);//("JpGraph: Can't draw unspecified X-scale.
No plots.
"); - } - - // Autoscale the normal Y-axis - $this->doAutoScaleYAxis(); - - // Autoscale all additiopnal y-axis - $this->doAutoScaleYnAxis(); - - // Autoscale the regular x-axis and position the y-axis properly - $this->doAutoScaleXAxis(); - - // If we have a negative values and x-axis position is at 0 - // we need to supress the first and possible the last tick since - // they will be drawn on top of the y-axis (and possible y2 axis) - // The test below might seem strange the reasone being that if - // the user hasn't specified a value for position this will not - // be set until we do the stroke for the axis so as of now it - // is undefined. - // For X-text scale we ignore all this since the tick are usually - // much further in and not close to the Y-axis. Hence the test - // for 'text' - if( ($this->yaxis->pos==$this->xscale->GetMinVal() || (is_string($this->yaxis->pos) && $this->yaxis->pos=='min')) && - !is_numeric($this->xaxis->pos) && $this->yscale->GetMinVal() < 0 && - substr($this->axtype,0,4) != 'text' && $this->xaxis->pos != 'min' ) { - - //$this->yscale->ticks->SupressZeroLabel(false); - $this->xscale->ticks->SupressFirst(); - if( $this->y2axis != null ) { - $this->xscale->ticks->SupressLast(); - } - } - elseif( !is_numeric($this->yaxis->pos) && $this->yaxis->pos=='max' ) { - $this->xscale->ticks->SupressLast(); - } - - if( !$_csim ) { - $this->StrokePlotArea(); - if( $this->iIconDepth == DEPTH_BACK ) { - $this->StrokeIcons(); - } - } - $this->StrokeAxis(false); - - // Stroke colored bands - $this->StrokeBands(DEPTH_BACK,$_csim); - - if( $this->grid_depth == DEPTH_BACK && !$_csim) { - $this->ygrid->Stroke(); - $this->xgrid->Stroke(); - } - - // Stroke Y2-axis - if( $this->y2axis != null && !$_csim) { - $this->y2axis->Stroke($this->xscale); - $this->y2grid->Stroke(); - } - - // Stroke yn-axis - $n = count($this->ynaxis); - for( $i=0; $i < $n; ++$i ) { - $this->ynaxis[$i]->Stroke($this->xscale); - } - - $oldoff=$this->xscale->off; - if( substr($this->axtype,0,4) == 'text' ) { - if( $this->text_scale_abscenteroff > -1 ) { - // For a text scale the scale factor is the number of pixel per step. - // Hence we can use the scale factor as a substitute for number of pixels - // per major scale step and use that in order to adjust the offset so that - // an object of width "abscenteroff" becomes centered. - $this->xscale->off += round($this->xscale->scale_factor/2)-round($this->text_scale_abscenteroff/2); - } - else { - $this->xscale->off += ceil($this->xscale->scale_factor*$this->text_scale_off*$this->xscale->ticks->minor_step); - } - } - - if( $this->iDoClipping ) { - $oldimage = $this->img->CloneCanvasH(); - } - - if( ! $this->y2orderback ) { - // Stroke all plots for Y1 axis - for($i=0; $i < count($this->plots); ++$i) { - $this->plots[$i]->Stroke($this->img,$this->xscale,$this->yscale); - $this->plots[$i]->StrokeMargin($this->img); - } - } - - // Stroke all plots for Y2 axis - if( $this->y2scale != null ) { - for($i=0; $i< count($this->y2plots); ++$i ) { - $this->y2plots[$i]->Stroke($this->img,$this->xscale,$this->y2scale); - } - } - - if( $this->y2orderback ) { - // Stroke all plots for Y1 axis - for($i=0; $i < count($this->plots); ++$i) { - $this->plots[$i]->Stroke($this->img,$this->xscale,$this->yscale); - $this->plots[$i]->StrokeMargin($this->img); - } - } - - $n = count($this->ynaxis); - for( $i=0; $i < $n; ++$i ) { - $m = count($this->ynplots[$i]); - for( $j=0; $j < $m; ++$j ) { - $this->ynplots[$i][$j]->Stroke($this->img,$this->xscale,$this->ynscale[$i]); - $this->ynplots[$i][$j]->StrokeMargin($this->img); - } - } - - if( $this->iIconDepth == DEPTH_FRONT) { - $this->StrokeIcons(); - } - - if( $this->iDoClipping ) { - // Clipping only supports graphs at 0 and 90 degrees - if( $this->img->a == 0 ) { - $this->img->CopyCanvasH($oldimage,$this->img->img, - $this->img->left_margin,$this->img->top_margin, - $this->img->left_margin,$this->img->top_margin, - $this->img->plotwidth+1,$this->img->plotheight); - } - elseif( $this->img->a == 90 ) { - $adj = ($this->img->height - $this->img->width)/2; - $this->img->CopyCanvasH($oldimage,$this->img->img, - $this->img->bottom_margin-$adj,$this->img->left_margin+$adj, - $this->img->bottom_margin-$adj,$this->img->left_margin+$adj, - $this->img->plotheight+1,$this->img->plotwidth); - } - else { - JpGraphError::RaiseL(25035,$this->img->a);//('You have enabled clipping. Cliping is only supported for graphs at 0 or 90 degrees rotation. Please adjust you current angle (='.$this->img->a.' degrees) or disable clipping.'); - } - $this->img->Destroy(); - $this->img->SetCanvasH($oldimage); - } - - $this->xscale->off=$oldoff; - - if( $this->grid_depth == DEPTH_FRONT && !$_csim ) { - $this->ygrid->Stroke(); - $this->xgrid->Stroke(); - } - - // Stroke colored bands - $this->StrokeBands(DEPTH_FRONT,$_csim); - - // Finally draw the axis again since some plots may have nagged - // the axis in the edges. - if( !$_csim ) { - $this->StrokeAxis(); - } - - if( $this->y2scale != null && !$_csim ) { - $this->y2axis->Stroke($this->xscale,false); - } - - if( !$_csim ) { - $this->StrokePlotBox(); - } - - // The titles and legends never gets rotated so make sure - // that the angle is 0 before stroking them - $aa = $this->img->SetAngle(0); - $this->StrokeTitles(); - $this->footer->Stroke($this->img); - $this->legend->Stroke($this->img); - $this->img->SetAngle($aa); - $this->StrokeTexts(); - $this->StrokeTables(); - - if( !$_csim ) { - - $this->img->SetAngle($aa); - - // Draw an outline around the image map - if(_JPG_DEBUG) { - $this->DisplayClientSideaImageMapAreas(); - } - - // Should we do any final image transformation - if( $this->iImgTrans ) { - if( !class_exists('ImgTrans',false) ) { - require_once('jpgraph_imgtrans.php'); - //JpGraphError::Raise('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.'); - } - - $tform = new ImgTrans($this->img->img); - $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, - $this->iImgTransDirection,$this->iImgTransHighQ, - $this->iImgTransMinSize,$this->iImgTransFillColor, - $this->iImgTransBorder); - } - - // If the filename is given as the special "__handle" - // then the image handler is returned and the image is NOT - // streamed back - if( $aStrokeFileName == _IMG_HANDLER ) { - return $this->img->img; - } - else { - // Finally stream the generated picture - $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); - } - } - } - - function SetAxisLabelBackground($aType,$aXFColor='lightgray',$aXColor='black',$aYFColor='lightgray',$aYColor='black') { - $this->iAxisLblBgType = $aType; - $this->iXAxisLblBgFillColor = $aXFColor; - $this->iXAxisLblBgColor = $aXColor; - $this->iYAxisLblBgFillColor = $aYFColor; - $this->iYAxisLblBgColor = $aYColor; - } - - function StrokeAxisLabelBackground() { - // Types - // 0 = No background - // 1 = Only X-labels, length of axis - // 2 = Only Y-labels, length of axis - // 3 = As 1 but extends to width of graph - // 4 = As 2 but extends to height of graph - // 5 = Combination of 3 & 4 - // 6 = Combination of 1 & 2 - - $t = $this->iAxisLblBgType ; - if( $t < 1 ) return; - - // Stroke optional X-axis label background color - if( $t == 1 || $t == 3 || $t == 5 || $t == 6 ) { - $this->img->PushColor($this->iXAxisLblBgFillColor); - if( $t == 1 || $t == 6 ) { - $xl = $this->img->left_margin; - $yu = $this->img->height - $this->img->bottom_margin + 1; - $xr = $this->img->width - $this->img->right_margin ; - $yl = $this->img->height-1-$this->frame_weight; - } - else { // t==3 || t==5 - $xl = $this->frame_weight; - $yu = $this->img->height - $this->img->bottom_margin + 1; - $xr = $this->img->width - 1 - $this->frame_weight; - $yl = $this->img->height-1-$this->frame_weight; - } - - $this->img->FilledRectangle($xl,$yu,$xr,$yl); - $this->img->PopColor(); - - // Check if we should add the vertical lines at left and right edge - if( $this->iXAxisLblBgColor !== '' ) { - // Hardcode to one pixel wide - $this->img->SetLineWeight(1); - $this->img->PushColor($this->iXAxisLblBgColor); - if( $t == 1 || $t == 6 ) { - $this->img->Line($xl,$yu,$xl,$yl); - $this->img->Line($xr,$yu,$xr,$yl); - } - else { - $xl = $this->img->width - $this->img->right_margin ; - $this->img->Line($xl,$yu-1,$xr,$yu-1); - } - $this->img->PopColor(); - } - } - - if( $t == 2 || $t == 4 || $t == 5 || $t == 6 ) { - $this->img->PushColor($this->iYAxisLblBgFillColor); - if( $t == 2 || $t == 6 ) { - $xl = $this->frame_weight; - $yu = $this->frame_weight+$this->img->top_margin; - $xr = $this->img->left_margin - 1; - $yl = $this->img->height - $this->img->bottom_margin + 1; - } - else { - $xl = $this->frame_weight; - $yu = $this->frame_weight; - $xr = $this->img->left_margin - 1; - $yl = $this->img->height-1-$this->frame_weight; - } - - $this->img->FilledRectangle($xl,$yu,$xr,$yl); - $this->img->PopColor(); - - // Check if we should add the vertical lines at left and right edge - if( $this->iXAxisLblBgColor !== '' ) { - $this->img->PushColor($this->iXAxisLblBgColor); - if( $t == 2 || $t == 6 ) { - $this->img->Line($xl,$yu-1,$xr,$yu-1); - $this->img->Line($xl,$yl-1,$xr,$yl-1); - } - else { - $this->img->Line($xr+1,$yu,$xr+1,$this->img->top_margin); - } - $this->img->PopColor(); - } - - } - } - - function StrokeAxis($aStrokeLabels=true) { - - if( $aStrokeLabels ) { - $this->StrokeAxisLabelBackground(); - } - - // Stroke axis - if( $this->iAxisStyle != AXSTYLE_SIMPLE ) { - switch( $this->iAxisStyle ) { - case AXSTYLE_BOXIN : - $toppos = SIDE_DOWN; - $bottompos = SIDE_UP; - $leftpos = SIDE_RIGHT; - $rightpos = SIDE_LEFT; - break; - case AXSTYLE_BOXOUT : - $toppos = SIDE_UP; - $bottompos = SIDE_DOWN; - $leftpos = SIDE_LEFT; - $rightpos = SIDE_RIGHT; - break; - case AXSTYLE_YBOXIN: - $toppos = FALSE; - $bottompos = SIDE_UP; - $leftpos = SIDE_RIGHT; - $rightpos = SIDE_LEFT; - break; - case AXSTYLE_YBOXOUT: - $toppos = FALSE; - $bottompos = SIDE_DOWN; - $leftpos = SIDE_LEFT; - $rightpos = SIDE_RIGHT; - break; - default: - JpGRaphError::RaiseL(25036,$this->iAxisStyle); //('Unknown AxisStyle() : '.$this->iAxisStyle); - break; - } - - // By default we hide the first label so it doesn't cross the - // Y-axis in case the positon hasn't been set by the user. - // However, if we use a box we always want the first value - // displayed so we make sure it will be displayed. - $this->xscale->ticks->SupressFirst(false); - - // Now draw the bottom X-axis - $this->xaxis->SetPos('min'); - $this->xaxis->SetLabelSide(SIDE_DOWN); - $this->xaxis->scale->ticks->SetSide($bottompos); - $this->xaxis->Stroke($this->yscale,$aStrokeLabels); - - if( $toppos !== FALSE ) { - // We also want a top X-axis - $this->xaxis = $this->xaxis; - $this->xaxis->SetPos('max'); - $this->xaxis->SetLabelSide(SIDE_UP); - // No title for the top X-axis - if( $aStrokeLabels ) { - $this->xaxis->title->Set(''); - } - $this->xaxis->scale->ticks->SetSide($toppos); - $this->xaxis->Stroke($this->yscale,$aStrokeLabels); - } - - // Stroke the left Y-axis - $this->yaxis->SetPos('min'); - $this->yaxis->SetLabelSide(SIDE_LEFT); - $this->yaxis->scale->ticks->SetSide($leftpos); - $this->yaxis->Stroke($this->xscale,$aStrokeLabels); - - // Stroke the right Y-axis - $this->yaxis->SetPos('max'); - // No title for the right side - if( $aStrokeLabels ) { - $this->yaxis->title->Set(''); - } - $this->yaxis->SetLabelSide(SIDE_RIGHT); - $this->yaxis->scale->ticks->SetSide($rightpos); - $this->yaxis->Stroke($this->xscale,$aStrokeLabels); - } - else { - $this->xaxis->Stroke($this->yscale,$aStrokeLabels); - $this->yaxis->Stroke($this->xscale,$aStrokeLabels); - } - } - - - // Private helper function for backgound image - static function LoadBkgImage($aImgFormat='',$aFile='',$aImgStr='') { - if( $aImgStr != '' ) { - return Image::CreateFromString($aImgStr); - } - - // Remove case sensitivity and setup appropriate function to create image - // Get file extension. This should be the LAST '.' separated part of the filename - $e = explode('.',$aFile); - $ext = strtolower($e[count($e)-1]); - if ($ext == "jpeg") { - $ext = "jpg"; - } - - if( trim($ext) == '' ) { - $ext = 'png'; // Assume PNG if no extension specified - } - - if( $aImgFormat == '' ) { - $imgtag = $ext; - } - else { - $imgtag = $aImgFormat; - } - - $supported = imagetypes(); - if( ( $ext == 'jpg' && !($supported & IMG_JPG) ) || - ( $ext == 'gif' && !($supported & IMG_GIF) ) || - ( $ext == 'png' && !($supported & IMG_PNG) ) || - ( $ext == 'bmp' && !($supported & IMG_WBMP) ) || - ( $ext == 'xpm' && !($supported & IMG_XPM) ) ) { - - JpGraphError::RaiseL(25037,$aFile);//('The image format of your background image ('.$aFile.') is not supported in your system configuration. '); - } - - - if( $imgtag == "jpg" || $imgtag == "jpeg") { - $f = "imagecreatefromjpeg"; - $imgtag = "jpg"; - } - else { - $f = "imagecreatefrom".$imgtag; - } - - // Compare specified image type and file extension - if( $imgtag != $ext ) { - //$t = "Background image seems to be of different type (has different file extension) than specified imagetype. Specified: '".$aImgFormat."'File: '".$aFile."'"; - JpGraphError::RaiseL(25038, $aImgFormat, $aFile); - } - - $img = @$f($aFile); - if( !$img ) { - JpGraphError::RaiseL(25039,$aFile);//(" Can't read background image: '".$aFile."'"); - } - return $img; - } - - function StrokePlotGrad() { - if( $this->plot_gradtype < 0 ) - return; - - $grad = new Gradient($this->img); - $xl = $this->img->left_margin; - $yt = $this->img->top_margin; - $xr = $xl + $this->img->plotwidth+1 ; - $yb = $yt + $this->img->plotheight ; - $grad->FilledRectangle($xl,$yt,$xr,$yb,$this->plot_gradfrom,$this->plot_gradto,$this->plot_gradtype); - - } - - function StrokeBackgroundGrad() { - if( $this->bkg_gradtype < 0 ) - return; - - $grad = new Gradient($this->img); - if( $this->bkg_gradstyle == BGRAD_PLOT ) { - $xl = $this->img->left_margin; - $yt = $this->img->top_margin; - $xr = $xl + $this->img->plotwidth+1 ; - $yb = $yt + $this->img->plotheight ; - $grad->FilledRectangle($xl,$yt,$xr,$yb,$this->bkg_gradfrom,$this->bkg_gradto,$this->bkg_gradtype); - } - else { - $xl = 0; - $yt = 0; - $xr = $xl + $this->img->width - 1; - $yb = $yt + $this->img->height - 1 ; - if( $this->doshadow ) { - $xr -= $this->shadow_width; - $yb -= $this->shadow_width; - } - if( $this->doframe ) { - $yt += $this->frame_weight; - $yb -= $this->frame_weight; - $xl += $this->frame_weight; - $xr -= $this->frame_weight; - } - $aa = $this->img->SetAngle(0); - $grad->FilledRectangle($xl,$yt,$xr,$yb,$this->bkg_gradfrom,$this->bkg_gradto,$this->bkg_gradtype); - $aa = $this->img->SetAngle($aa); - } - } - - function StrokeFrameBackground() { - if( $this->background_image != '' && $this->background_cflag != '' ) { - JpGraphError::RaiseL(25040);//('It is not possible to specify both a background image and a background country flag.'); - } - if( $this->background_image != '' ) { - $bkgimg = $this->LoadBkgImage($this->background_image_format,$this->background_image); - } - elseif( $this->background_cflag != '' ) { - if( ! class_exists('FlagImages',false) ) { - JpGraphError::RaiseL(25041);//('In order to use Country flags as backgrounds you must include the "jpgraph_flags.php" file.'); - } - $fobj = new FlagImages(FLAGSIZE4); - $dummy=''; - $bkgimg = $fobj->GetImgByName($this->background_cflag,$dummy); - $this->background_image_mix = $this->background_cflag_mix; - $this->background_image_type = $this->background_cflag_type; - } - else { - return ; - } - - $bw = ImageSX($bkgimg); - $bh = ImageSY($bkgimg); - - // No matter what the angle is we always stroke the image and frame - // assuming it is 0 degree - $aa = $this->img->SetAngle(0); - - switch( $this->background_image_type ) { - case BGIMG_FILLPLOT: // Resize to just fill the plotarea - $this->FillMarginArea(); - $this->StrokeFrame(); - // Special case to hande 90 degree rotated graph corectly - if( $aa == 90 ) { - $this->img->SetAngle(90); - $this->FillPlotArea(); - $aa = $this->img->SetAngle(0); - $adj = ($this->img->height - $this->img->width)/2; - $this->img->CopyMerge($bkgimg, - $this->img->bottom_margin-$adj,$this->img->left_margin+$adj, - 0,0, - $this->img->plotheight+1,$this->img->plotwidth, - $bw,$bh,$this->background_image_mix); - } - else { - $this->FillPlotArea(); - $this->img->CopyMerge($bkgimg, - $this->img->left_margin,$this->img->top_margin+1, - 0,0,$this->img->plotwidth+1,$this->img->plotheight, - $bw,$bh,$this->background_image_mix); - } - break; - case BGIMG_FILLFRAME: // Fill the whole area from upper left corner, resize to just fit - $hadj=0; $vadj=0; - if( $this->doshadow ) { - $hadj = $this->shadow_width; - $vadj = $this->shadow_width; - } - $this->FillMarginArea(); - $this->FillPlotArea(); - $this->img->CopyMerge($bkgimg,0,0,0,0,$this->img->width-$hadj,$this->img->height-$vadj, - $bw,$bh,$this->background_image_mix); - $this->StrokeFrame(); - break; - case BGIMG_COPY: // Just copy the image from left corner, no resizing - $this->FillMarginArea(); - $this->FillPlotArea(); - $this->img->CopyMerge($bkgimg,0,0,0,0,$bw,$bh, - $bw,$bh,$this->background_image_mix); - $this->StrokeFrame(); - break; - case BGIMG_CENTER: // Center original image in the plot area - $this->FillMarginArea(); - $this->FillPlotArea(); - $centerx = round($this->img->plotwidth/2+$this->img->left_margin-$bw/2); - $centery = round($this->img->plotheight/2+$this->img->top_margin-$bh/2); - $this->img->CopyMerge($bkgimg,$centerx,$centery,0,0,$bw,$bh, - $bw,$bh,$this->background_image_mix); - $this->StrokeFrame(); - break; - case BGIMG_FREE: // Just copy the image to the specified location - $this->img->CopyMerge($bkgimg, - $this->background_image_xpos,$this->background_image_ypos, - 0,0,$bw,$bh,$bw,$bh,$this->background_image_mix); - $this->StrokeFrame(); // New - break; - default: - JpGraphError::RaiseL(25042);//(" Unknown background image layout"); - } - $this->img->SetAngle($aa); - } - - // Private - // Draw a frame around the image - function StrokeFrame() { - if( !$this->doframe ) return; - - if( $this->background_image_type <= 1 && ($this->bkg_gradtype < 0 || ($this->bkg_gradtype > 0 && $this->bkg_gradstyle==BGRAD_PLOT)) ) { - $c = $this->margin_color; - } - else { - $c = false; - } - - if( $this->doshadow ) { - $this->img->SetColor($this->frame_color); - $this->img->ShadowRectangle(0,0,$this->img->width,$this->img->height, - $c,$this->shadow_width,$this->shadow_color); - } - elseif( $this->framebevel ) { - if( $c ) { - $this->img->SetColor($this->margin_color); - $this->img->FilledRectangle(0,0,$this->img->width-1,$this->img->height-1); - } - $this->img->Bevel(1,1,$this->img->width-2,$this->img->height-2, - $this->framebeveldepth, - $this->framebevelcolor1,$this->framebevelcolor2); - if( $this->framebevelborder ) { - $this->img->SetColor($this->framebevelbordercolor); - $this->img->Rectangle(0,0,$this->img->width-1,$this->img->height-1); - } - } - else { - $this->img->SetLineWeight($this->frame_weight); - if( $c ) { - $this->img->SetColor($this->margin_color); - $this->img->FilledRectangle(0,0,$this->img->width-1,$this->img->height-1); - } - $this->img->SetColor($this->frame_color); - $this->img->Rectangle(0,0,$this->img->width-1,$this->img->height-1); - } - } - - function FillMarginArea() { - $hadj=0; $vadj=0; - if( $this->doshadow ) { - $hadj = $this->shadow_width; - $vadj = $this->shadow_width; - } - - $this->img->SetColor($this->margin_color); - $this->img->FilledRectangle(0,0,$this->img->width-1-$hadj,$this->img->height-1-$vadj); - - $this->img->FilledRectangle(0,0,$this->img->width-1-$hadj,$this->img->top_margin); - $this->img->FilledRectangle(0,$this->img->top_margin,$this->img->left_margin,$this->img->height-1-$hadj); - $this->img->FilledRectangle($this->img->left_margin+1, - $this->img->height-$this->img->bottom_margin, - $this->img->width-1-$hadj, - $this->img->height-1-$hadj); - $this->img->FilledRectangle($this->img->width-$this->img->right_margin, - $this->img->top_margin+1, - $this->img->width-1-$hadj, - $this->img->height-$this->img->bottom_margin-1); - } - - function FillPlotArea() { - $this->img->PushColor($this->plotarea_color); - $this->img->FilledRectangle($this->img->left_margin, - $this->img->top_margin, - $this->img->width-$this->img->right_margin, - $this->img->height-$this->img->bottom_margin); - $this->img->PopColor(); - } - - // Stroke the plot area with either a solid color or a background image - function StrokePlotArea() { - // Note: To be consistent we really should take a possible shadow - // into account. However, that causes some problem for the LinearScale class - // since in the current design it does not have any links to class Graph which - // means it has no way of compensating for the adjusted plotarea in case of a - // shadow. So, until I redesign LinearScale we can't compensate for this. - // So just set the two adjustment parameters to zero for now. - $boxadj = 0; //$this->doframe ? $this->frame_weight : 0 ; - $adj = 0; //$this->doshadow ? $this->shadow_width : 0 ; - - if( $this->background_image != '' || $this->background_cflag != '' ) { - $this->StrokeFrameBackground(); - } - else { - $aa = $this->img->SetAngle(0); - $this->StrokeFrame(); - $aa = $this->img->SetAngle($aa); - $this->StrokeBackgroundGrad(); - if( $this->bkg_gradtype < 0 || ($this->bkg_gradtype > 0 && $this->bkg_gradstyle==BGRAD_MARGIN) ) { - $this->FillPlotArea(); - } - $this->StrokePlotGrad(); - } - } - - function StrokeIcons() { - $n = count($this->iIcons); - for( $i=0; $i < $n; ++$i ) { - $this->iIcons[$i]->StrokeWithScale($this->img,$this->xscale,$this->yscale); - } - } - - function StrokePlotBox() { - // Should we draw a box around the plot area? - if( $this->boxed ) { - $this->img->SetLineWeight(1); - $this->img->SetLineStyle('solid'); - $this->img->SetColor($this->box_color); - for($i=0; $i < $this->box_weight; ++$i ) { - $this->img->Rectangle( - $this->img->left_margin-$i,$this->img->top_margin-$i, - $this->img->width-$this->img->right_margin+$i, - $this->img->height-$this->img->bottom_margin+$i); - } - } - } - - function SetTitleBackgroundFillStyle($aStyle,$aColor1='black',$aColor2='white') { - $this->titlebkg_fillstyle = $aStyle; - $this->titlebkg_scolor1 = $aColor1; - $this->titlebkg_scolor2 = $aColor2; - } - - function SetTitleBackground($aBackColor='gray', $aStyle=TITLEBKG_STYLE1, $aFrameStyle=TITLEBKG_FRAME_NONE, $aFrameColor='black', $aFrameWeight=1, $aBevelHeight=3, $aEnable=true) { - $this->titlebackground = $aEnable; - $this->titlebackground_color = $aBackColor; - $this->titlebackground_style = $aStyle; - $this->titlebackground_framecolor = $aFrameColor; - $this->titlebackground_framestyle = $aFrameStyle; - $this->titlebackground_frameweight = $aFrameWeight; - $this->titlebackground_bevelheight = $aBevelHeight ; - } - - - function StrokeTitles() { - - $margin=3; - - if( $this->titlebackground ) { - // Find out height - $this->title->margin += 2 ; - $h = $this->title->GetTextHeight($this->img)+$this->title->margin+$margin; - if( $this->subtitle->t != '' && !$this->subtitle->hide ) { - $h += $this->subtitle->GetTextHeight($this->img)+$margin+ - $this->subtitle->margin; - $h += 2; - } - if( $this->subsubtitle->t != '' && !$this->subsubtitle->hide ) { - $h += $this->subsubtitle->GetTextHeight($this->img)+$margin+ - $this->subsubtitle->margin; - $h += 2; - } - $this->img->PushColor($this->titlebackground_color); - if( $this->titlebackground_style === TITLEBKG_STYLE1 ) { - // Inside the frame - if( $this->framebevel ) { - $x1 = $y1 = $this->framebeveldepth + 1 ; - $x2 = $this->img->width - $this->framebeveldepth - 2 ; - $this->title->margin += $this->framebeveldepth + 1 ; - $h += $y1 ; - $h += 2; - } - else { - $x1 = $y1 = $this->frame_weight; - $x2 = $this->img->width - $this->frame_weight-1; - } - } - elseif( $this->titlebackground_style === TITLEBKG_STYLE2 ) { - // Cover the frame as well - $x1 = $y1 = 0; - $x2 = $this->img->width - 1 ; - } - elseif( $this->titlebackground_style === TITLEBKG_STYLE3 ) { - // Cover the frame as well (the difference is that - // for style==3 a bevel frame border is on top - // of the title background) - $x1 = $y1 = 0; - $x2 = $this->img->width - 1 ; - $h += $this->framebeveldepth ; - $this->title->margin += $this->framebeveldepth ; - } - else { - JpGraphError::RaiseL(25043);//('Unknown title background style.'); - } - - if( $this->titlebackground_framestyle === 3 ) { - $h += $this->titlebackground_bevelheight*2 + 1 ; - $this->title->margin += $this->titlebackground_bevelheight ; - } - - if( $this->doshadow ) { - $x2 -= $this->shadow_width ; - } - - $indent=0; - if( $this->titlebackground_framestyle == TITLEBKG_FRAME_BEVEL ) { - $indent = $this->titlebackground_bevelheight; - } - - if( $this->titlebkg_fillstyle==TITLEBKG_FILLSTYLE_HSTRIPED ) { - $this->img->FilledRectangle2($x1+$indent,$y1+$indent,$x2-$indent,$h-$indent, - $this->titlebkg_scolor1, - $this->titlebkg_scolor2); - } - elseif( $this->titlebkg_fillstyle==TITLEBKG_FILLSTYLE_VSTRIPED ) { - $this->img->FilledRectangle2($x1+$indent,$y1+$indent,$x2-$indent,$h-$indent, - $this->titlebkg_scolor1, - $this->titlebkg_scolor2,2); - } - else { - // Solid fill - $this->img->FilledRectangle($x1,$y1,$x2,$h); - } - $this->img->PopColor(); - - $this->img->PushColor($this->titlebackground_framecolor); - $this->img->SetLineWeight($this->titlebackground_frameweight); - if( $this->titlebackground_framestyle == TITLEBKG_FRAME_FULL ) { - // Frame background - $this->img->Rectangle($x1,$y1,$x2,$h); - } - elseif( $this->titlebackground_framestyle == TITLEBKG_FRAME_BOTTOM ) { - // Bottom line only - $this->img->Line($x1,$h,$x2,$h); - } - elseif( $this->titlebackground_framestyle == TITLEBKG_FRAME_BEVEL ) { - $this->img->Bevel($x1,$y1,$x2,$h,$this->titlebackground_bevelheight); - } - $this->img->PopColor(); - - // This is clumsy. But we neeed to stroke the whole graph frame if it is - // set to bevel to get the bevel shading on top of the text background - if( $this->framebevel && $this->doframe && $this->titlebackground_style === 3 ) { - $this->img->Bevel(1,1,$this->img->width-2,$this->img->height-2, - $this->framebeveldepth, - $this->framebevelcolor1,$this->framebevelcolor2); - if( $this->framebevelborder ) { - $this->img->SetColor($this->framebevelbordercolor); - $this->img->Rectangle(0,0,$this->img->width-1,$this->img->height-1); - } - } - } - - // Stroke title - $y = $this->title->margin; - if( $this->title->halign == 'center' ) { - $this->title->Center(0,$this->img->width,$y); - } - elseif( $this->title->halign == 'left' ) { - $this->title->SetPos($this->title->margin+2,$y); - } - elseif( $this->title->halign == 'right' ) { - $indent = 0; - if( $this->doshadow ) { - $indent = $this->shadow_width+2; - } - $this->title->SetPos($this->img->width-$this->title->margin-$indent,$y,'right'); - } - $this->title->Stroke($this->img); - - // ... and subtitle - $y += $this->title->GetTextHeight($this->img) + $margin + $this->subtitle->margin; - if( $this->subtitle->halign == 'center' ) { - $this->subtitle->Center(0,$this->img->width,$y); - } - elseif( $this->subtitle->halign == 'left' ) { - $this->subtitle->SetPos($this->subtitle->margin+2,$y); - } - elseif( $this->subtitle->halign == 'right' ) { - $indent = 0; - if( $this->doshadow ) - $indent = $this->shadow_width+2; - $this->subtitle->SetPos($this->img->width-$this->subtitle->margin-$indent,$y,'right'); - } - $this->subtitle->Stroke($this->img); - - // ... and subsubtitle - $y += $this->subtitle->GetTextHeight($this->img) + $margin + $this->subsubtitle->margin; - if( $this->subsubtitle->halign == 'center' ) { - $this->subsubtitle->Center(0,$this->img->width,$y); - } - elseif( $this->subsubtitle->halign == 'left' ) { - $this->subsubtitle->SetPos($this->subsubtitle->margin+2,$y); - } - elseif( $this->subsubtitle->halign == 'right' ) { - $indent = 0; - if( $this->doshadow ) - $indent = $this->shadow_width+2; - $this->subsubtitle->SetPos($this->img->width-$this->subsubtitle->margin-$indent,$y,'right'); - } - $this->subsubtitle->Stroke($this->img); - - // ... and fancy title - $this->tabtitle->Stroke($this->img); - - } - - function StrokeTexts() { - // Stroke any user added text objects - if( $this->texts != null ) { - for($i=0; $i < count($this->texts); ++$i) { - $this->texts[$i]->StrokeWithScale($this->img,$this->xscale,$this->yscale); - } - } - - if( $this->y2texts != null && $this->y2scale != null ) { - for($i=0; $i < count($this->y2texts); ++$i) { - $this->y2texts[$i]->StrokeWithScale($this->img,$this->xscale,$this->y2scale); - } - } - - } - - function StrokeTables() { - if( $this->iTables != null ) { - $n = count($this->iTables); - for( $i=0; $i < $n; ++$i ) { - $this->iTables[$i]->StrokeWithScale($this->img,$this->xscale,$this->yscale); - } - } - } - - function DisplayClientSideaImageMapAreas() { - // Debug stuff - display the outline of the image map areas - $csim=''; - foreach ($this->plots as $p) { - $csim.= $p->GetCSIMareas(); - } - $csim .= $this->legend->GetCSIMareas(); - if (preg_match_all("/area shape=\"(\w+)\" coords=\"([0-9\, ]+)\"/", $csim, $coords)) { - $this->img->SetColor($this->csimcolor); - $n = count($coords[0]); - for ($i=0; $i < $n; $i++) { - if ( $coords[1][$i] == 'poly' ) { - preg_match_all('/\s*([0-9]+)\s*,\s*([0-9]+)\s*,*/',$coords[2][$i],$pts); - $this->img->SetStartPoint($pts[1][count($pts[0])-1],$pts[2][count($pts[0])-1]); - $m = count($pts[0]); - for ($j=0; $j < $m; $j++) { - $this->img->LineTo($pts[1][$j],$pts[2][$j]); - } - } elseif ( $coords[1][$i] == 'rect' ) { - $pts = preg_split('/,/', $coords[2][$i]); - $this->img->SetStartPoint($pts[0],$pts[1]); - $this->img->LineTo($pts[2],$pts[1]); - $this->img->LineTo($pts[2],$pts[3]); - $this->img->LineTo($pts[0],$pts[3]); - $this->img->LineTo($pts[0],$pts[1]); - } - } - } - } - - // Text scale offset in world coordinates - function SetTextScaleOff($aOff) { - $this->text_scale_off = $aOff; - $this->xscale->text_scale_off = $aOff; - } - - // Text width of bar to be centered in absolute pixels - function SetTextScaleAbsCenterOff($aOff) { - $this->text_scale_abscenteroff = $aOff; - } - - // Get Y min and max values for added lines - function GetLinesYMinMax( $aLines ) { - $n = count($aLines); - if( $n == 0 ) return false; - $min = $aLines[0]->scaleposition ; - $max = $min ; - $flg = false; - for( $i=0; $i < $n; ++$i ) { - if( $aLines[$i]->direction == HORIZONTAL ) { - $flg = true ; - $v = $aLines[$i]->scaleposition ; - if( $min > $v ) $min = $v ; - if( $max < $v ) $max = $v ; - } - } - return $flg ? array($min,$max) : false ; - } - - // Get X min and max values for added lines - function GetLinesXMinMax( $aLines ) { - $n = count($aLines); - if( $n == 0 ) return false ; - $min = $aLines[0]->scaleposition ; - $max = $min ; - $flg = false; - for( $i=0; $i < $n; ++$i ) { - if( $aLines[$i]->direction == VERTICAL ) { - $flg = true ; - $v = $aLines[$i]->scaleposition ; - if( $min > $v ) $min = $v ; - if( $max < $v ) $max = $v ; - } - } - return $flg ? array($min,$max) : false ; - } - - // Get min and max values for all included plots - function GetPlotsYMinMax($aPlots) { - $n = count($aPlots); - $i=0; - do { - list($xmax,$max) = $aPlots[$i]->Max(); - } while( ++$i < $n && !is_numeric($max) ); - - $i=0; - do { - list($xmin,$min) = $aPlots[$i]->Min(); - } while( ++$i < $n && !is_numeric($min) ); - - if( !is_numeric($min) || !is_numeric($max) ) { - JpGraphError::RaiseL(25044);//('Cannot use autoscaling since it is impossible to determine a valid min/max value of the Y-axis (only null values).'); - } - - for($i=0; $i < $n; ++$i ) { - list($xmax,$ymax)=$aPlots[$i]->Max(); - list($xmin,$ymin)=$aPlots[$i]->Min(); - if (is_numeric($ymax)) $max=max($max,$ymax); - if (is_numeric($ymin)) $min=min($min,$ymin); - } - if( $min == '' ) $min = 0; - if( $max == '' ) $max = 0; - if( $min == 0 && $max == 0 ) { - // Special case if all values are 0 - $min=0;$max=1; - } - return array($min,$max); - } - - function hasLinePlotAndBarPlot() { - $has_line = false; - $has_bar = false; - - foreach ($this->plots as $plot) { - if ($plot instanceof LinePlot) { - $has_line = true; - } - if ($plot instanceof BarPlot) { - $has_bar = true; - } - } - - if ($has_line && $has_bar) { - return true; - } - - return false; - } - - function SetTheme($graph_theme) { - - if (!($this instanceof PieGraph)) { - if (!$this->isAfterSetScale) { - JpGraphError::RaiseL(25133);//('Use Graph::SetTheme() after Graph::SetScale().'); - } - } - - if ($this->graph_theme) { - $this->ClearTheme(); - } - $this->graph_theme = $graph_theme; - $this->graph_theme->ApplyGraph($this); - } - - function ClearTheme() { - $this->graph_theme = null; - - $this->isRunningClear = true; - - $this->__construct( - $this->inputValues['aWidth'], - $this->inputValues['aHeight'], - $this->inputValues['aCachedName'], - $this->inputValues['aTimeout'], - $this->inputValues['aInline'] - ); - - if (!($this instanceof PieGraph)) { - if ($this->isAfterSetScale) { - $this->SetScale( - $this->inputValues['aAxisType'], - $this->inputValues['aYMin'], - $this->inputValues['aYMax'], - $this->inputValues['aXMin'], - $this->inputValues['aXMax'] - ); - } - } - - $this->isRunningClear = false; - } - - function SetSupersampling($do = false, $scale = 2) { - if ($do) { - define('SUPERSAMPLING_SCALE', $scale); - // $this->img->scale = $scale; - } else { - define('SUPERSAMPLING_SCALE', 1); - //$this->img->scale = 0; - } - } - -} // Class - -//=================================================== -// CLASS LineProperty -// Description: Holds properties for a line -//=================================================== -class LineProperty { - public $iWeight=1, $iColor='black', $iStyle='solid', $iShow=false; - - function __construct($aWeight=1,$aColor='black',$aStyle='solid') { - $this->iWeight = $aWeight; - $this->iColor = $aColor; - $this->iStyle = $aStyle; - } - - function SetColor($aColor) { - $this->iColor = $aColor; - } - - function SetWeight($aWeight) { - $this->iWeight = $aWeight; - } - - function SetStyle($aStyle) { - $this->iStyle = $aStyle; - } - - function Show($aShow=true) { - $this->iShow=$aShow; - } - - function Stroke($aImg,$aX1,$aY1,$aX2,$aY2) { - if( $this->iShow ) { - $aImg->PushColor($this->iColor); - $oldls = $aImg->line_style; - $oldlw = $aImg->line_weight; - $aImg->SetLineWeight($this->iWeight); - $aImg->SetLineStyle($this->iStyle); - $aImg->StyleLine($aX1,$aY1,$aX2,$aY2); - $aImg->PopColor($this->iColor); - $aImg->line_style = $oldls; - $aImg->line_weight = $oldlw; - - } - } -} - -//=================================================== -// CLASS GraphTabTitle -// Description: Draw "tab" titles on top of graphs -//=================================================== -class GraphTabTitle extends Text{ - private $corner = 6 , $posx = 7, $posy = 4; - private $fillcolor='lightyellow',$bordercolor='black'; - private $align = 'left', $width=TABTITLE_WIDTHFIT; - function __construct() { - $this->t = ''; - $this->font_style = FS_BOLD; - $this->hide = true; - $this->color = 'darkred'; - } - - function SetColor($aTxtColor,$aFillColor='lightyellow',$aBorderColor='black') { - $this->color = $aTxtColor; - $this->fillcolor = $aFillColor; - $this->bordercolor = $aBorderColor; - } - - function SetFillColor($aFillColor) { - $this->fillcolor = $aFillColor; - } - - function SetTabAlign($aAlign) { - $this->align = $aAlign; - } - - function SetWidth($aWidth) { - $this->width = $aWidth ; - } - - function Set($t) { - $this->t = $t; - $this->hide = false; - } - - function SetCorner($aD) { - $this->corner = $aD ; - } - - function Stroke($aImg,$aDummy1=null,$aDummy2=null) { - if( $this->hide ) - return; - $this->boxed = false; - $w = $this->GetWidth($aImg) + 2*$this->posx; - $h = $this->GetTextHeight($aImg) + 2*$this->posy; - - $x = $aImg->left_margin; - $y = $aImg->top_margin; - - if( $this->width === TABTITLE_WIDTHFIT ) { - if( $this->align == 'left' ) { - $p = array($x, $y, - $x, $y-$h+$this->corner, - $x + $this->corner,$y-$h, - $x + $w - $this->corner, $y-$h, - $x + $w, $y-$h+$this->corner, - $x + $w, $y); - } - elseif( $this->align == 'center' ) { - $x += round($aImg->plotwidth/2) - round($w/2); - $p = array($x, $y, - $x, $y-$h+$this->corner, - $x + $this->corner, $y-$h, - $x + $w - $this->corner, $y-$h, - $x + $w, $y-$h+$this->corner, - $x + $w, $y); - } - else { - $x += $aImg->plotwidth -$w; - $p = array($x, $y, - $x, $y-$h+$this->corner, - $x + $this->corner,$y-$h, - $x + $w - $this->corner, $y-$h, - $x + $w, $y-$h+$this->corner, - $x + $w, $y); - } - } - else { - if( $this->width === TABTITLE_WIDTHFULL ) { - $w = $aImg->plotwidth ; - } - else { - $w = $this->width ; - } - - // Make the tab fit the width of the plot area - $p = array($x, $y, - $x, $y-$h+$this->corner, - $x + $this->corner,$y-$h, - $x + $w - $this->corner, $y-$h, - $x + $w, $y-$h+$this->corner, - $x + $w, $y); - - } - if( $this->halign == 'left' ) { - $aImg->SetTextAlign('left','bottom'); - $x += $this->posx; - $y -= $this->posy; - } - elseif( $this->halign == 'center' ) { - $aImg->SetTextAlign('center','bottom'); - $x += $w/2; - $y -= $this->posy; - } - else { - $aImg->SetTextAlign('right','bottom'); - $x += $w - $this->posx; - $y -= $this->posy; - } - - $aImg->SetColor($this->fillcolor); - $aImg->FilledPolygon($p); - - $aImg->SetColor($this->bordercolor); - $aImg->Polygon($p,true); - - $aImg->SetColor($this->color); - $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); - $aImg->StrokeText($x,$y,$this->t,0,'center'); - } - -} - -//=================================================== -// CLASS SuperScriptText -// Description: Format a superscript text -//=================================================== -class SuperScriptText extends Text { - private $iSuper=''; - private $sfont_family='',$sfont_style='',$sfont_size=8; - private $iSuperMargin=2,$iVertOverlap=4,$iSuperScale=0.65; - private $iSDir=0; - private $iSimple=false; - - function __construct($aTxt='',$aSuper='',$aXAbsPos=0,$aYAbsPos=0) { - parent::__construct($aTxt,$aXAbsPos,$aYAbsPos); - $this->iSuper = $aSuper; - } - - function FromReal($aVal,$aPrecision=2) { - // Convert a floating point number to scientific notation - $neg=1.0; - if( $aVal < 0 ) { - $neg = -1.0; - $aVal = -$aVal; - } - - $l = floor(log10($aVal)); - $a = sprintf("%0.".$aPrecision."f",round($aVal / pow(10,$l),$aPrecision)); - $a *= $neg; - if( $this->iSimple && ($a == 1 || $a==-1) ) $a = ''; - - if( $a != '' ) { - $this->t = $a.' * 10'; - } - else { - if( $neg == 1 ) { - $this->t = '10'; - } - else { - $this->t = '-10'; - } - } - $this->iSuper = $l; - } - - function Set($aTxt,$aSuper='') { - $this->t = $aTxt; - $this->iSuper = $aSuper; - } - - function SetSuperFont($aFontFam,$aFontStyle=FS_NORMAL,$aFontSize=8) { - $this->sfont_family = $aFontFam; - $this->sfont_style = $aFontStyle; - $this->sfont_size = $aFontSize; - } - - // Total width of text - function GetWidth($aImg) { - $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); - $w = $aImg->GetTextWidth($this->t); - $aImg->SetFont($this->sfont_family,$this->sfont_style,$this->sfont_size); - $w += $aImg->GetTextWidth($this->iSuper); - $w += $this->iSuperMargin; - return $w; - } - - // Hight of font (approximate the height of the text) - function GetFontHeight($aImg) { - $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); - $h = $aImg->GetFontHeight(); - $aImg->SetFont($this->sfont_family,$this->sfont_style,$this->sfont_size); - $h += $aImg->GetFontHeight(); - return $h; - } - - // Hight of text - function GetTextHeight($aImg) { - $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); - $h = $aImg->GetTextHeight($this->t); - $aImg->SetFont($this->sfont_family,$this->sfont_style,$this->sfont_size); - $h += $aImg->GetTextHeight($this->iSuper); - return $h; - } - - function Stroke($aImg,$ax=-1,$ay=-1) { - - // To position the super script correctly we need different - // cases to handle the alignmewnt specified since that will - // determine how we can interpret the x,y coordinates - - $w = parent::GetWidth($aImg); - $h = parent::GetTextHeight($aImg); - switch( $this->valign ) { - case 'top': - $sy = $this->y; - break; - case 'center': - $sy = $this->y - $h/2; - break; - case 'bottom': - $sy = $this->y - $h; - break; - default: - JpGraphError::RaiseL(25052);//('PANIC: Internal error in SuperScript::Stroke(). Unknown vertical alignment for text'); - break; - } - - switch( $this->halign ) { - case 'left': - $sx = $this->x + $w; - break; - case 'center': - $sx = $this->x + $w/2; - break; - case 'right': - $sx = $this->x; - break; - default: - JpGraphError::RaiseL(25053);//('PANIC: Internal error in SuperScript::Stroke(). Unknown horizontal alignment for text'); - break; - } - - $sx += $this->iSuperMargin; - $sy += $this->iVertOverlap; - - // Should we automatically determine the font or - // has the user specified it explicetly? - if( $this->sfont_family == '' ) { - if( $this->font_family <= FF_FONT2 ) { - if( $this->font_family == FF_FONT0 ) { - $sff = FF_FONT0; - } - elseif( $this->font_family == FF_FONT1 ) { - if( $this->font_style == FS_NORMAL ) { - $sff = FF_FONT0; - } - else { - $sff = FF_FONT1; - } - } - else { - $sff = FF_FONT1; - } - $sfs = $this->font_style; - $sfz = $this->font_size; - } - else { - // TTF fonts - $sff = $this->font_family; - $sfs = $this->font_style; - $sfz = floor($this->font_size*$this->iSuperScale); - if( $sfz < 8 ) $sfz = 8; - } - $this->sfont_family = $sff; - $this->sfont_style = $sfs; - $this->sfont_size = $sfz; - } - else { - $sff = $this->sfont_family; - $sfs = $this->sfont_style; - $sfz = $this->sfont_size; - } - - parent::Stroke($aImg,$ax,$ay); - - // For the builtin fonts we need to reduce the margins - // since the bounding bx reported for the builtin fonts - // are much larger than for the TTF fonts. - if( $sff <= FF_FONT2 ) { - $sx -= 2; - $sy += 3; - } - - $aImg->SetTextAlign('left','bottom'); - $aImg->SetFont($sff,$sfs,$sfz); - $aImg->PushColor($this->color); - $aImg->StrokeText($sx,$sy,$this->iSuper,$this->iSDir,'left'); - $aImg->PopColor(); - } -} - - -//=================================================== -// CLASS Grid -// Description: responsible for drawing grid lines in graph -//=================================================== -class Grid { - protected $img; - protected $scale; - protected $majorcolor='#CCCCCC',$minorcolor='#DDDDDD'; - protected $majortype='solid',$minortype='solid'; - protected $show=false, $showMinor=false,$majorweight=1,$minorweight=1; - protected $fill=false,$fillcolor=array('#EFEFEF','#BBCCFF'); - - function __construct($aAxis) { - $this->scale = $aAxis->scale; - $this->img = $aAxis->img; - } - - function SetColor($aMajColor,$aMinColor=false) { - $this->majorcolor=$aMajColor; - if( $aMinColor === false ) { - $aMinColor = $aMajColor ; - } - $this->minorcolor = $aMinColor; - } - - function SetWeight($aMajorWeight,$aMinorWeight=1) { - $this->majorweight=$aMajorWeight; - $this->minorweight=$aMinorWeight; - } - - // Specify if grid should be dashed, dotted or solid - function SetLineStyle($aMajorType,$aMinorType='solid') { - $this->majortype = $aMajorType; - $this->minortype = $aMinorType; - } - - function SetStyle($aMajorType,$aMinorType='solid') { - $this->SetLineStyle($aMajorType,$aMinorType); - } - - // Decide if both major and minor grid should be displayed - function Show($aShowMajor=true,$aShowMinor=false) { - $this->show=$aShowMajor; - $this->showMinor=$aShowMinor; - } - - function SetFill($aFlg=true,$aColor1='lightgray',$aColor2='lightblue') { - $this->fill = $aFlg; - $this->fillcolor = array( $aColor1, $aColor2 ); - } - - // Display the grid - function Stroke() { - if( $this->showMinor && !$this->scale->textscale ) { - $this->DoStroke($this->scale->ticks->ticks_pos,$this->minortype,$this->minorcolor,$this->minorweight); - $this->DoStroke($this->scale->ticks->maj_ticks_pos,$this->majortype,$this->majorcolor,$this->majorweight); - } - else { - $this->DoStroke($this->scale->ticks->maj_ticks_pos,$this->majortype,$this->majorcolor,$this->majorweight); - } - } - - //-------------- - // Private methods - // Draw the grid - function DoStroke($aTicksPos,$aType,$aColor,$aWeight) { - if( !$this->show ) return; - $nbrgrids = count($aTicksPos); - - if( $this->scale->type == 'y' ) { - $xl=$this->img->left_margin; - $xr=$this->img->width-$this->img->right_margin; - - if( $this->fill ) { - // Draw filled areas - $y2 = $aTicksPos[0]; - $i=1; - while( $i < $nbrgrids ) { - $y1 = $y2; - $y2 = $aTicksPos[$i++]; - $this->img->SetColor($this->fillcolor[$i & 1]); - $this->img->FilledRectangle($xl,$y1,$xr,$y2); - } - } - - $this->img->SetColor($aColor); - $this->img->SetLineWeight($aWeight); - - // Draw grid lines - switch( $aType ) { - case 'solid': $style = LINESTYLE_SOLID; break; - case 'dotted': $style = LINESTYLE_DOTTED; break; - case 'dashed': $style = LINESTYLE_DASHED; break; - case 'longdashed': $style = LINESTYLE_LONGDASH; break; - default: - $style = LINESTYLE_SOLID; break; - } - - for($i=0; $i < $nbrgrids; ++$i) { - $y=$aTicksPos[$i]; - $this->img->StyleLine($xl,$y,$xr,$y,$style,true); - } - } - elseif( $this->scale->type == 'x' ) { - $yu=$this->img->top_margin; - $yl=$this->img->height-$this->img->bottom_margin; - $limit=$this->img->width-$this->img->right_margin; - - if( $this->fill ) { - // Draw filled areas - $x2 = $aTicksPos[0]; - $i=1; - while( $i < $nbrgrids ) { - $x1 = $x2; - $x2 = min($aTicksPos[$i++],$limit) ; - $this->img->SetColor($this->fillcolor[$i & 1]); - $this->img->FilledRectangle($x1,$yu,$x2,$yl); - } - } - - $this->img->SetColor($aColor); - $this->img->SetLineWeight($aWeight); - - // We must also test for limit since we might have - // an offset and the number of ticks is calculated with - // assumption offset==0 so we might end up drawing one - // to many gridlines - $i=0; - $x=$aTicksPos[$i]; - while( $iimg->Line($x,$yl,$x,$yu); - elseif( $aType == 'dotted' ) $this->img->DashedLineForGrid($x,$yl,$x,$yu,1,6); - elseif( $aType == 'dashed' ) $this->img->DashedLineForGrid($x,$yl,$x,$yu,2,4); - elseif( $aType == 'longdashed' ) $this->img->DashedLineForGrid($x,$yl,$x,$yu,8,6); - ++$i; - } - } - else { - JpGraphError::RaiseL(25054,$this->scale->type);//('Internal error: Unknown grid axis ['.$this->scale->type.']'); - } - return true; - } -} // Class - -//=================================================== -// CLASS Axis -// Description: Defines X and Y axis. Notes that at the -// moment the code is not really good since the axis on -// several occasion must know wheter it's an X or Y axis. -// This was a design decision to make the code easier to -// follow. -//=================================================== -class AxisPrototype { - public $scale=null; - public $img=null; - public $hide=false,$hide_labels=false; - public $title=null; - public $font_family=FF_DEFAULT,$font_style=FS_NORMAL,$font_size=8,$label_angle=0; - public $tick_step=1; - public $pos = false; - public $ticks_label = array(); - - protected $weight=1; - protected $color=array(0,0,0),$label_color=array(0,0,0); - protected $ticks_label_colors=null; - protected $show_first_label=true,$show_last_label=true; - protected $label_step=1; // Used by a text axis to specify what multiple of major steps - // should be labeled. - protected $labelPos=0; // Which side of the axis should the labels be? - protected $title_adjust,$title_margin,$title_side=SIDE_LEFT; - protected $tick_label_margin=5; - protected $label_halign = '',$label_valign = '', $label_para_align='left'; - protected $hide_line=false; - protected $iDeltaAbsPos=0; - - function __construct($img,$aScale,$color = array(0,0,0)) { - $this->img = $img; - $this->scale = $aScale; - $this->color = $color; - $this->title=new Text(''); - - if( $aScale->type == 'y' ) { - $this->title_margin = 25; - $this->title_adjust = 'middle'; - $this->title->SetOrientation(90); - $this->tick_label_margin=7; - $this->labelPos=SIDE_LEFT; - } - else { - $this->title_margin = 5; - $this->title_adjust = 'high'; - $this->title->SetOrientation(0); - $this->tick_label_margin=5; - $this->labelPos=SIDE_DOWN; - $this->title_side=SIDE_DOWN; - } - } - - function SetLabelFormat($aFormStr) { - $this->scale->ticks->SetLabelFormat($aFormStr); - } - - function SetLabelFormatString($aFormStr,$aDate=false) { - $this->scale->ticks->SetLabelFormat($aFormStr,$aDate); - } - - function SetLabelFormatCallback($aFuncName) { - $this->scale->ticks->SetFormatCallback($aFuncName); - } - - function SetLabelAlign($aHAlign,$aVAlign='top',$aParagraphAlign='left') { - $this->label_halign = $aHAlign; - $this->label_valign = $aVAlign; - $this->label_para_align = $aParagraphAlign; - } - - // Don't display the first label - function HideFirstTickLabel($aShow=false) { - $this->show_first_label=$aShow; - } - - function HideLastTickLabel($aShow=false) { - $this->show_last_label=$aShow; - } - - // Manually specify the major and (optional) minor tick position and labels - function SetTickPositions($aMajPos,$aMinPos=NULL,$aLabels=NULL) { - $this->scale->ticks->SetTickPositions($aMajPos,$aMinPos,$aLabels); - } - - // Manually specify major tick positions and optional labels - function SetMajTickPositions($aMajPos,$aLabels=NULL) { - $this->scale->ticks->SetTickPositions($aMajPos,NULL,$aLabels); - } - - // Hide minor or major tick marks - function HideTicks($aHideMinor=true,$aHideMajor=true) { - $this->scale->ticks->SupressMinorTickMarks($aHideMinor); - $this->scale->ticks->SupressTickMarks($aHideMajor); - } - - // Hide zero label - function HideZeroLabel($aFlag=true) { - $this->scale->ticks->SupressZeroLabel(); - } - - function HideFirstLastLabel() { - // The two first calls to ticks method will supress - // automatically generated scale values. However, that - // will not affect manually specified value, e.g text-scales. - // therefor we also make a kludge here to supress manually - // specified scale labels. - $this->scale->ticks->SupressLast(); - $this->scale->ticks->SupressFirst(); - $this->show_first_label = false; - $this->show_last_label = false; - } - - // Hide the axis - function Hide($aHide=true) { - $this->hide=$aHide; - } - - // Hide the actual axis-line, but still print the labels - function HideLine($aHide=true) { - $this->hide_line = $aHide; - } - - function HideLabels($aHide=true) { - $this->hide_labels = $aHide; - } - - // Weight of axis - function SetWeight($aWeight) { - $this->weight = $aWeight; - } - - // Axis color - function SetColor($aColor,$aLabelColor=false) { - $this->color = $aColor; - if( !$aLabelColor ) $this->label_color = $aColor; - else $this->label_color = $aLabelColor; - } - - // Title on axis - function SetTitle($aTitle,$aAdjustAlign='high') { - $this->title->Set($aTitle); - $this->title_adjust=$aAdjustAlign; - } - - // Specify distance from the axis - function SetTitleMargin($aMargin) { - $this->title_margin=$aMargin; - } - - // Which side of the axis should the axis title be? - function SetTitleSide($aSideOfAxis) { - $this->title_side = $aSideOfAxis; - } - - function SetTickSide($aDir) { - $this->scale->ticks->SetSide($aDir); - } - - function SetTickSize($aMajSize,$aMinSize=3) { - $this->scale->ticks->SetSize($aMajSize,$aMinSize=3); - } - - // Specify text labels for the ticks. One label for each data point - function SetTickLabels($aLabelArray,$aLabelColorArray=null) { - $this->ticks_label = $aLabelArray; - $this->ticks_label_colors = $aLabelColorArray; - } - - function SetLabelMargin($aMargin) { - $this->tick_label_margin=$aMargin; - } - - // Specify that every $step of the ticks should be displayed starting - // at $start - function SetTextTickInterval($aStep,$aStart=0) { - $this->scale->ticks->SetTextLabelStart($aStart); - $this->tick_step=$aStep; - } - - // Specify that every $step tick mark should have a label - // should be displayed starting - function SetTextLabelInterval($aStep) { - if( $aStep < 1 ) { - JpGraphError::RaiseL(25058);//(" Text label interval must be specified >= 1."); - } - $this->label_step=$aStep; - } - - function SetLabelSide($aSidePos) { - $this->labelPos=$aSidePos; - } - - // Set the font - function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) { - $this->font_family = $aFamily; - $this->font_style = $aStyle; - $this->font_size = $aSize; - } - - // Position for axis line on the "other" scale - function SetPos($aPosOnOtherScale) { - $this->pos=$aPosOnOtherScale; - } - - // Set the position of the axis to be X-pixels delta to the right - // of the max X-position (used to position the multiple Y-axis) - function SetPosAbsDelta($aDelta) { - $this->iDeltaAbsPos=$aDelta; - } - - // Specify the angle for the tick labels - function SetLabelAngle($aAngle) { - $this->label_angle = $aAngle; - } - -} // Class - - -//=================================================== -// CLASS Axis -// Description: Defines X and Y axis. Notes that at the -// moment the code is not really good since the axis on -// several occasion must know wheter it's an X or Y axis. -// This was a design decision to make the code easier to -// follow. -//=================================================== -class Axis extends AxisPrototype { - - function __construct($img,$aScale,$color='black') { - parent::__construct($img,$aScale,$color); - } - - // Stroke the axis. - function Stroke($aOtherAxisScale,$aStrokeLabels=true) { - if( $this->hide ) - return; - if( is_numeric($this->pos) ) { - $pos=$aOtherAxisScale->Translate($this->pos); - } - else { // Default to minimum of other scale if pos not set - if( ($aOtherAxisScale->GetMinVal() >= 0 && $this->pos==false) || $this->pos == 'min' ) { - $pos = $aOtherAxisScale->scale_abs[0]; - } - elseif($this->pos == "max") { - $pos = $aOtherAxisScale->scale_abs[1]; - } - else { // If negative set x-axis at 0 - $this->pos=0; - $pos=$aOtherAxisScale->Translate(0); - } - } - - $pos += $this->iDeltaAbsPos; - $this->img->SetLineWeight($this->weight); - $this->img->SetColor($this->color); - $this->img->SetFont($this->font_family,$this->font_style,$this->font_size); - - if( $this->scale->type == "x" ) { - if( !$this->hide_line ) { - // Stroke X-axis - $this->img->FilledRectangle( - $this->img->left_margin, - $pos, - $this->img->width - $this->img->right_margin, - $pos + $this->weight-1 - ); - } - if( $this->title_side == SIDE_DOWN ) { - $y = $pos + $this->img->GetFontHeight() + $this->title_margin + $this->title->margin; - $yalign = 'top'; - } - else { - $y = $pos - $this->img->GetFontHeight() - $this->title_margin - $this->title->margin; - $yalign = 'bottom'; - } - - if( $this->title_adjust=='high' ) { - $this->title->SetPos($this->img->width-$this->img->right_margin,$y,'right',$yalign); - } - elseif( $this->title_adjust=='middle' || $this->title_adjust=='center' ) { - $this->title->SetPos(($this->img->width-$this->img->left_margin-$this->img->right_margin)/2+$this->img->left_margin,$y,'center',$yalign); - } - elseif($this->title_adjust=='low') { - $this->title->SetPos($this->img->left_margin,$y,'left',$yalign); - } - else { - JpGraphError::RaiseL(25060,$this->title_adjust);//('Unknown alignment specified for X-axis title. ('.$this->title_adjust.')'); - } - } - elseif( $this->scale->type == "y" ) { - // Add line weight to the height of the axis since - // the x-axis could have a width>1 and we want the axis to fit nicely together. - if( !$this->hide_line ) { - // Stroke Y-axis - $this->img->FilledRectangle( - $pos - $this->weight + 1, - $this->img->top_margin, - $pos, - $this->img->height - $this->img->bottom_margin + $this->weight - 1 - ); - } - - $x=$pos ; - if( $this->title_side == SIDE_LEFT ) { - $x -= $this->title_margin; - $x -= $this->title->margin; - $halign = 'right'; - } - else { - $x += $this->title_margin; - $x += $this->title->margin; - $halign = 'left'; - } - // If the user has manually specified an hor. align - // then we override the automatic settings with this - // specifed setting. Since default is 'left' we compare - // with that. (This means a manually set 'left' align - // will have no effect.) - if( $this->title->halign != 'left' ) { - $halign = $this->title->halign; - } - if( $this->title_adjust == 'high' ) { - $this->title->SetPos($x,$this->img->top_margin,$halign,'top'); - } - elseif($this->title_adjust=='middle' || $this->title_adjust=='center') { - $this->title->SetPos($x,($this->img->height-$this->img->top_margin-$this->img->bottom_margin)/2+$this->img->top_margin,$halign,"center"); - } - elseif($this->title_adjust=='low') { - $this->title->SetPos($x,$this->img->height-$this->img->bottom_margin,$halign,'bottom'); - } - else { - JpGraphError::RaiseL(25061,$this->title_adjust);//('Unknown alignment specified for Y-axis title. ('.$this->title_adjust.')'); - } - } - $this->scale->ticks->Stroke($this->img,$this->scale,$pos); - if( $aStrokeLabels ) { - if( !$this->hide_labels ) { - $this->StrokeLabels($pos); - } - $this->title->Stroke($this->img); - } - } - - //--------------- - // PRIVATE METHODS - // Draw all the tick labels on major tick marks - function StrokeLabels($aPos,$aMinor=false,$aAbsLabel=false) { - - if( is_array($this->label_color) && count($this->label_color) > 3 ) { - $this->ticks_label_colors = $this->label_color; - $this->img->SetColor($this->label_color[0]); - } - else { - $this->img->SetColor($this->label_color); - } - $this->img->SetFont($this->font_family,$this->font_style,$this->font_size); - $yoff=$this->img->GetFontHeight()/2; - - // Only draw labels at major tick marks - $nbr = count($this->scale->ticks->maj_ticks_label); - - // We have the option to not-display the very first mark - // (Usefull when the first label might interfere with another - // axis.) - $i = $this->show_first_label ? 0 : 1 ; - if( !$this->show_last_label ) { - --$nbr; - } - // Now run through all labels making sure we don't overshoot the end - // of the scale. - $ncolor=0; - if( isset($this->ticks_label_colors) ) { - $ncolor=count($this->ticks_label_colors); - } - while( $i < $nbr ) { - // $tpos holds the absolute text position for the label - $tpos=$this->scale->ticks->maj_ticklabels_pos[$i]; - - // Note. the $limit is only used for the x axis since we - // might otherwise overshoot if the scale has been centered - // This is due to us "loosing" the last tick mark if we center. - if( $this->scale->type == 'x' && $tpos > $this->img->width-$this->img->right_margin+1 ) { - return; - } - // we only draw every $label_step label - if( ($i % $this->label_step)==0 ) { - - // Set specific label color if specified - if( $ncolor > 0 ) { - $this->img->SetColor($this->ticks_label_colors[$i % $ncolor]); - } - - // If the label has been specified use that and in other case - // just label the mark with the actual scale value - $m=$this->scale->ticks->GetMajor(); - - // ticks_label has an entry for each data point and is the array - // that holds the labels set by the user. If the user hasn't - // specified any values we use whats in the automatically asigned - // labels in the maj_ticks_label - if( isset($this->ticks_label[$i*$m]) ) { - $label=$this->ticks_label[$i*$m]; - } - else { - if( $aAbsLabel ) { - $label=abs($this->scale->ticks->maj_ticks_label[$i]); - } - else { - $label=$this->scale->ticks->maj_ticks_label[$i]; - } - - // We number the scale from 1 and not from 0 so increase by one - if( $this->scale->textscale && - $this->scale->ticks->label_formfunc == '' && - ! $this->scale->ticks->HaveManualLabels() ) { - - ++$label; - - } - } - - if( $this->scale->type == "x" ) { - if( $this->labelPos == SIDE_DOWN ) { - if( $this->label_angle==0 || $this->label_angle==90 ) { - if( $this->label_halign=='' && $this->label_valign=='') { - $this->img->SetTextAlign('center','top'); - } - else { - $this->img->SetTextAlign($this->label_halign,$this->label_valign); - } - - } - else { - if( $this->label_halign=='' && $this->label_valign=='') { - $this->img->SetTextAlign("right","top"); - } - else { - $this->img->SetTextAlign($this->label_halign,$this->label_valign); - } - } - $this->img->StrokeText($tpos,$aPos+$this->tick_label_margin,$label, - $this->label_angle,$this->label_para_align); - } - else { - if( $this->label_angle==0 || $this->label_angle==90 ) { - if( $this->label_halign=='' && $this->label_valign=='') { - $this->img->SetTextAlign("center","bottom"); - } - else { - $this->img->SetTextAlign($this->label_halign,$this->label_valign); - } - } - else { - if( $this->label_halign=='' && $this->label_valign=='') { - $this->img->SetTextAlign("right","bottom"); - } - else { - $this->img->SetTextAlign($this->label_halign,$this->label_valign); - } - } - $this->img->StrokeText($tpos,$aPos-$this->tick_label_margin-1,$label, - $this->label_angle,$this->label_para_align); - } - } - else { - // scale->type == "y" - //if( $this->label_angle!=0 ) - //JpGraphError::Raise(" Labels at an angle are not supported on Y-axis"); - if( $this->labelPos == SIDE_LEFT ) { // To the left of y-axis - if( $this->label_halign=='' && $this->label_valign=='') { - $this->img->SetTextAlign("right","center"); - } - else { - $this->img->SetTextAlign($this->label_halign,$this->label_valign); - } - $this->img->StrokeText($aPos-$this->tick_label_margin,$tpos,$label,$this->label_angle,$this->label_para_align); - } - else { // To the right of the y-axis - if( $this->label_halign=='' && $this->label_valign=='') { - $this->img->SetTextAlign("left","center"); - } - else { - $this->img->SetTextAlign($this->label_halign,$this->label_valign); - } - $this->img->StrokeText($aPos+$this->tick_label_margin,$tpos,$label,$this->label_angle,$this->label_para_align); - } - } - } - ++$i; - } - } - -} - - -//=================================================== -// CLASS Ticks -// Description: Abstract base class for drawing linear and logarithmic -// tick marks on axis -//=================================================== -class Ticks { - public $label_formatstr=''; // C-style format string to use for labels - public $label_formfunc=''; - public $label_dateformatstr=''; - public $direction=1; // Should ticks be in(=1) the plot area or outside (=-1) - public $supress_last=false,$supress_tickmarks=false,$supress_minor_tickmarks=false; - public $maj_ticks_pos = array(), $maj_ticklabels_pos = array(), - $ticks_pos = array(), $maj_ticks_label = array(); - public $precision; - - protected $minor_abs_size=3, $major_abs_size=5; - protected $scale; - protected $is_set=false; - protected $supress_zerolabel=false,$supress_first=false; - protected $mincolor='',$majcolor=''; - protected $weight=1; - protected $label_usedateformat=FALSE; - - function __construct($aScale) { - $this->scale=$aScale; - $this->precision = -1; - } - - // Set format string for automatic labels - function SetLabelFormat($aFormatString,$aDate=FALSE) { - $this->label_formatstr=$aFormatString; - $this->label_usedateformat=$aDate; - } - - function SetLabelDateFormat($aFormatString) { - $this->label_dateformatstr=$aFormatString; - } - - function SetFormatCallback($aCallbackFuncName) { - $this->label_formfunc = $aCallbackFuncName; - } - - // Don't display the first zero label - function SupressZeroLabel($aFlag=true) { - $this->supress_zerolabel=$aFlag; - } - - // Don't display minor tick marks - function SupressMinorTickMarks($aHide=true) { - $this->supress_minor_tickmarks=$aHide; - } - - // Don't display major tick marks - function SupressTickMarks($aHide=true) { - $this->supress_tickmarks=$aHide; - } - - // Hide the first tick mark - function SupressFirst($aHide=true) { - $this->supress_first=$aHide; - } - - // Hide the last tick mark - function SupressLast($aHide=true) { - $this->supress_last=$aHide; - } - - // Size (in pixels) of minor tick marks - function GetMinTickAbsSize() { - return $this->minor_abs_size; - } - - // Size (in pixels) of major tick marks - function GetMajTickAbsSize() { - return $this->major_abs_size; - } - - function SetSize($aMajSize,$aMinSize=3) { - $this->major_abs_size = $aMajSize; - $this->minor_abs_size = $aMinSize; - } - - // Have the ticks been specified - function IsSpecified() { - return $this->is_set; - } - - function SetSide($aSide) { - $this->direction=$aSide; - } - - // Which side of the axis should the ticks be on - function SetDirection($aSide=SIDE_RIGHT) { - $this->direction=$aSide; - } - - // Set colors for major and minor tick marks - function SetMarkColor($aMajorColor,$aMinorColor='') { - $this->SetColor($aMajorColor,$aMinorColor); - } - - function SetColor($aMajorColor,$aMinorColor='') { - $this->majcolor=$aMajorColor; - - // If not specified use same as major - if( $aMinorColor == '' ) { - $this->mincolor=$aMajorColor; - } - else { - $this->mincolor=$aMinorColor; - } - } - - function SetWeight($aWeight) { - $this->weight=$aWeight; - } - -} // Class - -//=================================================== -// CLASS LinearTicks -// Description: Draw linear ticks on axis -//=================================================== -class LinearTicks extends Ticks { - public $minor_step=1, $major_step=2; - public $xlabel_offset=0,$xtick_offset=0; - private $label_offset=0; // What offset should the displayed label have - // i.e should we display 0,1,2 or 1,2,3,4 or 2,3,4 etc - private $text_label_start=0; - private $iManualTickPos = NULL, $iManualMinTickPos = NULL, $iManualTickLabels = NULL; - private $iAdjustForDST = false; // If a date falls within the DST period add one hour to the diaplyed time - - function __construct() { - $this->precision = -1; - } - - // Return major step size in world coordinates - function GetMajor() { - return $this->major_step; - } - - // Return minor step size in world coordinates - function GetMinor() { - return $this->minor_step; - } - - // Set Minor and Major ticks (in world coordinates) - function Set($aMajStep,$aMinStep=false) { - if( $aMinStep==false ) { - $aMinStep=$aMajStep; - } - - if( $aMajStep <= 0 || $aMinStep <= 0 ) { - JpGraphError::RaiseL(25064); - //(" Minor or major step size is 0. Check that you haven't got an accidental SetTextTicks(0) in your code. If this is not the case you might have stumbled upon a bug in JpGraph. Please report this and if possible include the data that caused the problem."); - } - - $this->major_step=$aMajStep; - $this->minor_step=$aMinStep; - $this->is_set = true; - } - - function SetMajTickPositions($aMajPos,$aLabels=NULL) { - $this->SetTickPositions($aMajPos,NULL,$aLabels); - } - - function SetTickPositions($aMajPos,$aMinPos=NULL,$aLabels=NULL) { - if( !is_array($aMajPos) || ($aMinPos!==NULL && !is_array($aMinPos)) ) { - JpGraphError::RaiseL(25065);//('Tick positions must be specifued as an array()'); - return; - } - $n=count($aMajPos); - if( is_array($aLabels) && (count($aLabels) != $n) ) { - JpGraphError::RaiseL(25066);//('When manually specifying tick positions and labels the number of labels must be the same as the number of specified ticks.'); - } - $this->iManualTickPos = $aMajPos; - $this->iManualMinTickPos = $aMinPos; - $this->iManualTickLabels = $aLabels; - } - - function HaveManualLabels() { - return count($this->iManualTickLabels) > 0; - } - - // Specify all the tick positions manually and possible also the exact labels - function _doManualTickPos($aScale) { - $n=count($this->iManualTickPos); - $m=count($this->iManualMinTickPos); - $doLbl=count($this->iManualTickLabels) > 0; - - $this->maj_ticks_pos = array(); - $this->maj_ticklabels_pos = array(); - $this->ticks_pos = array(); - - // Now loop through the supplied positions and translate them to screen coordinates - // and store them in the maj_label_positions - $minScale = $aScale->scale[0]; - $maxScale = $aScale->scale[1]; - $j=0; - for($i=0; $i < $n ; ++$i ) { - // First make sure that the first tick is not lower than the lower scale value - if( !isset($this->iManualTickPos[$i]) || $this->iManualTickPos[$i] < $minScale || $this->iManualTickPos[$i] > $maxScale) { - continue; - } - - $this->maj_ticks_pos[$j] = $aScale->Translate($this->iManualTickPos[$i]); - $this->maj_ticklabels_pos[$j] = $this->maj_ticks_pos[$j]; - - // Set the minor tick marks the same as major if not specified - if( $m <= 0 ) { - $this->ticks_pos[$j] = $this->maj_ticks_pos[$j]; - } - if( $doLbl ) { - $this->maj_ticks_label[$j] = $this->iManualTickLabels[$i]; - } - else { - $this->maj_ticks_label[$j]=$this->_doLabelFormat($this->iManualTickPos[$i],$i,$n); - } - ++$j; - } - - // Some sanity check - if( count($this->maj_ticks_pos) < 2 ) { - JpGraphError::RaiseL(25067);//('Your manually specified scale and ticks is not correct. The scale seems to be too small to hold any of the specified tickl marks.'); - } - - // Setup the minor tick marks - $j=0; - for($i=0; $i < $m; ++$i ) { - if( empty($this->iManualMinTickPos[$i]) || $this->iManualMinTickPos[$i] < $minScale || $this->iManualMinTickPos[$i] > $maxScale) { - continue; - } - $this->ticks_pos[$j] = $aScale->Translate($this->iManualMinTickPos[$i]); - ++$j; - } - } - - function _doAutoTickPos($aScale) { - $maj_step_abs = $aScale->scale_factor*$this->major_step; - $min_step_abs = $aScale->scale_factor*$this->minor_step; - - if( $min_step_abs==0 || $maj_step_abs==0 ) { - JpGraphError::RaiseL(25068);//("A plot has an illegal scale. This could for example be that you are trying to use text autoscaling to draw a line plot with only one point or that the plot area is too small. It could also be that no input data value is numeric (perhaps only '-' or 'x')"); - } - // We need to make this an int since comparing it below - // with the result from round() can give wrong result, such that - // (40 < 40) == TRUE !!! - $limit = (int)$aScale->scale_abs[1]; - - if( $aScale->textscale ) { - // This can only be true for a X-scale (horizontal) - // Define ticks for a text scale. This is slightly different from a - // normal linear type of scale since the position might be adjusted - // and the labels start at on - $label = (float)$aScale->GetMinVal()+$this->text_label_start+$this->label_offset; - $start_abs=$aScale->scale_factor*$this->text_label_start; - $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1; - - $x = $aScale->scale_abs[0]+$start_abs+$this->xlabel_offset*$min_step_abs; - for( $i=0; $label <= $aScale->GetMaxVal()+$this->label_offset; ++$i ) { - // Apply format to label - $this->maj_ticks_label[$i]=$this->_doLabelFormat($label,$i,$nbrmajticks); - $label+=$this->major_step; - - // The x-position of the tick marks can be different from the labels. - // Note that we record the tick position (not the label) so that the grid - // happen upon tick marks and not labels. - $xtick=$aScale->scale_abs[0]+$start_abs+$this->xtick_offset*$min_step_abs+$i*$maj_step_abs; - $this->maj_ticks_pos[$i]=$xtick; - $this->maj_ticklabels_pos[$i] = round($x); - $x += $maj_step_abs; - } - } - else { - $label = $aScale->GetMinVal(); - $abs_pos = $aScale->scale_abs[0]; - $j=0; $i=0; - $step = round($maj_step_abs/$min_step_abs); - if( $aScale->type == "x" ) { - // For a normal linear type of scale the major ticks will always be multiples - // of the minor ticks. In order to avoid any rounding issues the major ticks are - // defined as every "step" minor ticks and not calculated separately - $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1; - while( round($abs_pos) <= $limit ) { - $this->ticks_pos[] = round($abs_pos); - $this->ticks_label[] = $label; - if( $step== 0 || $i % $step == 0 && $j < $nbrmajticks ) { - $this->maj_ticks_pos[$j] = round($abs_pos); - $this->maj_ticklabels_pos[$j] = round($abs_pos); - $this->maj_ticks_label[$j]=$this->_doLabelFormat($label,$j,$nbrmajticks); - ++$j; - } - ++$i; - $abs_pos += $min_step_abs; - $label+=$this->minor_step; - } - } - elseif( $aScale->type == "y" ) { - //@todo s=2:20,12 s=1:50,6 $this->major_step:$nbr - // abs_point,limit s=1:270,80 s=2:540,160 - // $this->major_step = 50; - $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal())/$this->major_step)+1; -// $step = 5; - while( round($abs_pos) >= $limit ) { - $this->ticks_pos[$i] = round($abs_pos); - $this->ticks_label[$i]=$label; - if( $step== 0 || $i % $step == 0 && $j < $nbrmajticks) { - $this->maj_ticks_pos[$j] = round($abs_pos); - $this->maj_ticklabels_pos[$j] = round($abs_pos); - $this->maj_ticks_label[$j]=$this->_doLabelFormat($label,$j,$nbrmajticks); - ++$j; - } - ++$i; - $abs_pos += $min_step_abs; - $label += $this->minor_step; - } - } - } - } - - function AdjustForDST($aFlg=true) { - $this->iAdjustForDST = $aFlg; - } - - - function _doLabelFormat($aVal,$aIdx,$aNbrTicks) { - - // If precision hasn't been specified set it to a sensible value - if( $this->precision==-1 ) { - $t = log10($this->minor_step); - if( $t > 0 || $t === 0.0) { - $precision = 0; - } - else { - $precision = -floor($t); - } - } - else { - $precision = $this->precision; - } - - if( $this->label_formfunc != '' ) { - $f=$this->label_formfunc; - if( $this->label_formatstr == '' ) { - $l = call_user_func($f,$aVal); - } - else { - $l = sprintf($this->label_formatstr, call_user_func($f,$aVal)); - } - } - elseif( $this->label_formatstr != '' || $this->label_dateformatstr != '' ) { - if( $this->label_usedateformat ) { - // Adjust the value to take daylight savings into account - if (date("I",$aVal)==1 && $this->iAdjustForDST ) { - // DST - $aVal+=3600; - } - - $l = date($this->label_formatstr,$aVal); - if( $this->label_formatstr == 'W' ) { - // If we use week formatting then add a single 'w' in front of the - // week number to differentiate it from dates - $l = 'w'.$l; - } - } - else { - if( $this->label_dateformatstr !== '' ) { - // Adjust the value to take daylight savings into account - if (date("I",$aVal)==1 && $this->iAdjustForDST ) { - // DST - $aVal+=3600; - } - - $l = date($this->label_dateformatstr,$aVal); - if( $this->label_formatstr == 'W' ) { - // If we use week formatting then add a single 'w' in front of the - // week number to differentiate it from dates - $l = 'w'.$l; - } - } - else { - $l = sprintf($this->label_formatstr,$aVal); - } - } - } - else { - $l = sprintf('%01.'.$precision.'f',round($aVal,$precision)); - } - - if( ($this->supress_zerolabel && $l==0) || ($this->supress_first && $aIdx==0) || ($this->supress_last && $aIdx==$aNbrTicks-1) ) { - $l=''; - } - return $l; - } - - // Stroke ticks on either X or Y axis - function _StrokeTicks($aImg,$aScale,$aPos) { - $hor = $aScale->type == 'x'; - $aImg->SetLineWeight($this->weight); - - // We need to make this an int since comparing it below - // with the result from round() can give wrong result, such that - // (40 < 40) == TRUE !!! - $limit = (int)$aScale->scale_abs[1]; - - // A text scale doesn't have any minor ticks - if( !$aScale->textscale ) { - // Stroke minor ticks - $yu = $aPos - $this->direction*$this->GetMinTickAbsSize(); - $xr = $aPos + $this->direction*$this->GetMinTickAbsSize(); - $n = count($this->ticks_pos); - for($i=0; $i < $n; ++$i ) { - if( !$this->supress_tickmarks && !$this->supress_minor_tickmarks) { - if( $this->mincolor != '') { - $aImg->PushColor($this->mincolor); - } - if( $hor ) { - //if( $this->ticks_pos[$i] <= $limit ) - $aImg->Line($this->ticks_pos[$i],$aPos,$this->ticks_pos[$i],$yu); - } - else { - //if( $this->ticks_pos[$i] >= $limit ) - $aImg->Line($aPos,$this->ticks_pos[$i],$xr,$this->ticks_pos[$i]); - } - if( $this->mincolor != '' ) { - $aImg->PopColor(); - } - } - } - } - - // Stroke major ticks - $yu = $aPos - $this->direction*$this->GetMajTickAbsSize(); - $xr = $aPos + $this->direction*$this->GetMajTickAbsSize(); - $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1; - $n = count($this->maj_ticks_pos); - for($i=0; $i < $n ; ++$i ) { - if(!($this->xtick_offset > 0 && $i==$nbrmajticks-1) && !$this->supress_tickmarks) { - if( $this->majcolor != '') { - $aImg->PushColor($this->majcolor); - } - if( $hor ) { - //if( $this->maj_ticks_pos[$i] <= $limit ) - $aImg->Line($this->maj_ticks_pos[$i],$aPos,$this->maj_ticks_pos[$i],$yu); - } - else { - //if( $this->maj_ticks_pos[$i] >= $limit ) - $aImg->Line($aPos,$this->maj_ticks_pos[$i],$xr,$this->maj_ticks_pos[$i]); - } - if( $this->majcolor != '') { - $aImg->PopColor(); - } - } - } - - } - - // Draw linear ticks - function Stroke($aImg,$aScale,$aPos) { - if( $this->iManualTickPos != NULL ) { - $this->_doManualTickPos($aScale); - } - else { - $this->_doAutoTickPos($aScale); - } - $this->_StrokeTicks($aImg,$aScale,$aPos, $aScale->type == 'x' ); - } - - //--------------- - // PRIVATE METHODS - // Spoecify the offset of the displayed tick mark with the tick "space" - // Legal values for $o is [0,1] used to adjust where the tick marks and label - // should be positioned within the major tick-size - // $lo specifies the label offset and $to specifies the tick offset - // this comes in handy for example in bar graphs where we wont no offset for the - // tick but have the labels displayed halfway under the bars. - function SetXLabelOffset($aLabelOff,$aTickOff=-1) { - $this->xlabel_offset=$aLabelOff; - if( $aTickOff==-1 ) { - // Same as label offset - $this->xtick_offset=$aLabelOff; - } - else { - $this->xtick_offset=$aTickOff; - } - if( $aLabelOff>0 ) { - $this->SupressLast(); // The last tick wont fit - } - } - - // Which tick label should we start with? - function SetTextLabelStart($aTextLabelOff) { - $this->text_label_start=$aTextLabelOff; - } - -} // Class - -//=================================================== -// CLASS LinearScale -// Description: Handle linear scaling between screen and world -//=================================================== -class LinearScale { - public $textscale=false; // Just a flag to let the Plot class find out if - // we are a textscale or not. This is a cludge since - // this information is available in Graph::axtype but - // we don't have access to the graph object in the Plots - // stroke method. So we let graph store the status here - // when the linear scale is created. A real cludge... - public $type; // is this x or y scale ? - public $ticks=null; // Store ticks - public $text_scale_off = 0; - public $scale_abs=array(0,0); - public $scale_factor; // Scale factor between world and screen - public $off; // Offset between image edge and plot area - public $scale=array(0,0); - public $name = 'lin'; - public $auto_ticks=false; // When using manual scale should the ticks be automatically set? - public $world_abs_size; // Plot area size in pixels (Needed public in jpgraph_radar.php) - public $intscale=false; // Restrict autoscale to integers - protected $autoscale_min=false; // Forced minimum value, auto determine max - protected $autoscale_max=false; // Forced maximum value, auto determine min - private $gracetop=0,$gracebottom=0; - - private $_world_size; // Plot area size in world coordinates - - function __construct($aMin=0,$aMax=0,$aType='y') { - assert($aType=='x' || $aType=='y' ); - assert($aMin<=$aMax); - - $this->type=$aType; - $this->scale=array($aMin,$aMax); - $this->world_size=$aMax-$aMin; - $this->ticks = new LinearTicks(); - } - - // Check if scale is set or if we should autoscale - // We should do this is either scale or ticks has not been set - function IsSpecified() { - if( $this->GetMinVal()==$this->GetMaxVal() ) { // Scale not set - return false; - } - return true; - } - - // Set the minimum data value when the autoscaling is used. - // Usefull if you want a fix minimum (like 0) but have an - // automatic maximum - function SetAutoMin($aMin) { - $this->autoscale_min=$aMin; - } - - // Set the minimum data value when the autoscaling is used. - // Usefull if you want a fix minimum (like 0) but have an - // automatic maximum - function SetAutoMax($aMax) { - $this->autoscale_max=$aMax; - } - - // If the user manually specifies a scale should the ticks - // still be set automatically? - function SetAutoTicks($aFlag=true) { - $this->auto_ticks = $aFlag; - } - - // Specify scale "grace" value (top and bottom) - function SetGrace($aGraceTop,$aGraceBottom=0) { - if( $aGraceTop<0 || $aGraceBottom < 0 ) { - JpGraphError::RaiseL(25069);//(" Grace must be larger then 0"); - } - $this->gracetop=$aGraceTop; - $this->gracebottom=$aGraceBottom; - } - - // Get the minimum value in the scale - function GetMinVal() { - return $this->scale[0]; - } - - // get maximum value for scale - function GetMaxVal() { - return $this->scale[1]; - } - - // Specify a new min/max value for sclae - function Update($aImg,$aMin,$aMax) { - $this->scale=array($aMin,$aMax); - $this->world_size=$aMax-$aMin; - $this->InitConstants($aImg); - } - - // Translate between world and screen - function Translate($aCoord) { - if( !is_numeric($aCoord) ) { - if( $aCoord != '' && $aCoord != '-' && $aCoord != 'x' ) { - JpGraphError::RaiseL(25070);//('Your data contains non-numeric values.'); - } - return 0; - } - else { - return round($this->off+($aCoord - $this->scale[0]) * $this->scale_factor); - } - } - - // Relative translate (don't include offset) usefull when we just want - // to know the relative position (in pixels) on the axis - function RelTranslate($aCoord) { - if( !is_numeric($aCoord) ) { - if( $aCoord != '' && $aCoord != '-' && $aCoord != 'x' ) { - JpGraphError::RaiseL(25070);//('Your data contains non-numeric values.'); - } - return 0; - } - else { - return ($aCoord - $this->scale[0]) * $this->scale_factor; - } - } - - // Restrict autoscaling to only use integers - function SetIntScale($aIntScale=true) { - $this->intscale=$aIntScale; - } - - // Calculate an integer autoscale - function IntAutoScale($img,$min,$max,$maxsteps,$majend=true) { - // Make sure limits are integers - $min=floor($min); - $max=ceil($max); - if( abs($min-$max)==0 ) { - --$min; ++$max; - } - $maxsteps = floor($maxsteps); - - $gracetop=round(($this->gracetop/100.0)*abs($max-$min)); - $gracebottom=round(($this->gracebottom/100.0)*abs($max-$min)); - if( is_numeric($this->autoscale_min) ) { - $min = ceil($this->autoscale_min); - if( $min >= $max ) { - JpGraphError::RaiseL(25071);//('You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.'); - } - } - - if( is_numeric($this->autoscale_max) ) { - $max = ceil($this->autoscale_max); - if( $min >= $max ) { - JpGraphError::RaiseL(25072);//('You have specified a max value with SetAutoMax() which is smaller than the miminum value used for the scale. This is not possible.'); - } - } - - if( abs($min-$max ) == 0 ) { - ++$max; - --$min; - } - - $min -= $gracebottom; - $max += $gracetop; - - // First get tickmarks as multiples of 1, 10, ... - if( $majend ) { - list($num1steps,$adj1min,$adj1max,$maj1step) = $this->IntCalcTicks($maxsteps,$min,$max,1); - } - else { - $adj1min = $min; - $adj1max = $max; - list($num1steps,$maj1step) = $this->IntCalcTicksFreeze($maxsteps,$min,$max,1); - } - - if( abs($min-$max) > 2 ) { - // Then get tick marks as 2:s 2, 20, ... - if( $majend ) { - list($num2steps,$adj2min,$adj2max,$maj2step) = $this->IntCalcTicks($maxsteps,$min,$max,5); - } - else { - $adj2min = $min; - $adj2max = $max; - list($num2steps,$maj2step) = $this->IntCalcTicksFreeze($maxsteps,$min,$max,5); - } - } - else { - $num2steps = 10000; // Dummy high value so we don't choose this - } - - if( abs($min-$max) > 5 ) { - // Then get tickmarks as 5:s 5, 50, 500, ... - if( $majend ) { - list($num5steps,$adj5min,$adj5max,$maj5step) = $this->IntCalcTicks($maxsteps,$min,$max,2); - } - else { - $adj5min = $min; - $adj5max = $max; - list($num5steps,$maj5step) = $this->IntCalcTicksFreeze($maxsteps,$min,$max,2); - } - } - else { - $num5steps = 10000; // Dummy high value so we don't choose this - } - - // Check to see whichof 1:s, 2:s or 5:s fit better with - // the requested number of major ticks - $match1=abs($num1steps-$maxsteps); - $match2=abs($num2steps-$maxsteps); - if( !empty($maj5step) && $maj5step > 1 ) { - $match5=abs($num5steps-$maxsteps); - } - else { - $match5=10000; // Dummy high value - } - - // Compare these three values and see which is the closest match - // We use a 0.6 weight to gravitate towards multiple of 5:s - if( $match1 < $match2 ) { - if( $match1 < $match5 ) $r=1; - else $r=3; - } - else { - if( $match2 < $match5 ) $r=2; - else $r=3; - } - // Minsteps are always the same as maxsteps for integer scale - switch( $r ) { - case 1: - $this->ticks->Set($maj1step,$maj1step); - $this->Update($img,$adj1min,$adj1max); - break; - case 2: - $this->ticks->Set($maj2step,$maj2step); - $this->Update($img,$adj2min,$adj2max); - break; - case 3: - $this->ticks->Set($maj5step,$maj5step); - $this->Update($img,$adj5min,$adj5max); - break; - default: - JpGraphError::RaiseL(25073,$r);//('Internal error. Integer scale algorithm comparison out of bound (r=$r)'); - } - } - - - // Calculate autoscale. Used if user hasn't given a scale and ticks - // $maxsteps is the maximum number of major tickmarks allowed. - function AutoScale($img,$min,$max,$maxsteps,$majend=true) { - - if( !is_numeric($min) || !is_numeric($max) ) { - JpGraphError::Raise(25044); - } - - if( $this->intscale ) { - $this->IntAutoScale($img,$min,$max,$maxsteps,$majend); - return; - } - if( abs($min-$max) < 0.00001 ) { - // We need some difference to be able to autoscale - // make it 5% above and 5% below value - if( $min==0 && $max==0 ) { // Special case - $min=-1; $max=1; - } - else { - $delta = (abs($max)+abs($min))*0.005; - $min -= $delta; - $max += $delta; - } - } - - $gracetop=($this->gracetop/100.0)*abs($max-$min); - $gracebottom=($this->gracebottom/100.0)*abs($max-$min); - if( is_numeric($this->autoscale_min) ) { - $min = $this->autoscale_min; - if( $min >= $max ) { - JpGraphError::RaiseL(25071);//('You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.'); - } - if( abs($min-$max ) < 0.001 ) { - $max *= 1.2; - } - } - - if( is_numeric($this->autoscale_max) ) { - $max = $this->autoscale_max; - if( $min >= $max ) { - JpGraphError::RaiseL(25072);//('You have specified a max value with SetAutoMax() which is smaller than the miminum value used for the scale. This is not possible.'); - } - if( abs($min-$max ) < 0.001 ) { - $min *= 0.8; - } - } - - $min -= $gracebottom; - $max += $gracetop; - - // First get tickmarks as multiples of 0.1, 1, 10, ... - if( $majend ) { - list($num1steps,$adj1min,$adj1max,$min1step,$maj1step) = $this->CalcTicks($maxsteps,$min,$max,1,2); - } - else { - $adj1min=$min; - $adj1max=$max; - list($num1steps,$min1step,$maj1step) = $this->CalcTicksFreeze($maxsteps,$min,$max,1,2,false); - } - - // Then get tick marks as 2:s 0.2, 2, 20, ... - if( $majend ) { - list($num2steps,$adj2min,$adj2max,$min2step,$maj2step) = $this->CalcTicks($maxsteps,$min,$max,5,2); - } - else { - $adj2min=$min; - $adj2max=$max; - list($num2steps,$min2step,$maj2step) = $this->CalcTicksFreeze($maxsteps,$min,$max,5,2,false); - } - - // Then get tickmarks as 5:s 0.05, 0.5, 5, 50, ... - if( $majend ) { - list($num5steps,$adj5min,$adj5max,$min5step,$maj5step) = $this->CalcTicks($maxsteps,$min,$max,2,5); - } - else { - $adj5min=$min; - $adj5max=$max; - list($num5steps,$min5step,$maj5step) = $this->CalcTicksFreeze($maxsteps,$min,$max,2,5,false); - } - - // Check to see whichof 1:s, 2:s or 5:s fit better with - // the requested number of major ticks - $match1=abs($num1steps-$maxsteps); - $match2=abs($num2steps-$maxsteps); - $match5=abs($num5steps-$maxsteps); - - // Compare these three values and see which is the closest match - // We use a 0.8 weight to gravitate towards multiple of 5:s - $r=$this->MatchMin3($match1,$match2,$match5,0.8); - switch( $r ) { - case 1: - $this->Update($img,$adj1min,$adj1max); - $this->ticks->Set($maj1step,$min1step); - break; - case 2: - $this->Update($img,$adj2min,$adj2max); - $this->ticks->Set($maj2step,$min2step); - break; - case 3: - $this->Update($img,$adj5min,$adj5max); - $this->ticks->Set($maj5step,$min5step); - break; - } - } - - //--------------- - // PRIVATE METHODS - - // This method recalculates all constants that are depending on the - // margins in the image. If the margins in the image are changed - // this method should be called for every scale that is registred with - // that image. Should really be installed as an observer of that image. - function InitConstants($img) { - if( $this->type=='x' ) { - $this->world_abs_size=$img->width - $img->left_margin - $img->right_margin; - $this->off=$img->left_margin; - $this->scale_factor = 0; - if( $this->world_size > 0 ) { - $this->scale_factor=$this->world_abs_size/($this->world_size*1.0); - } - } - else { // y scale - $this->world_abs_size=$img->height - $img->top_margin - $img->bottom_margin; - $this->off=$img->top_margin+$this->world_abs_size; - $this->scale_factor = 0; - if( $this->world_size > 0 ) { - $this->scale_factor=-$this->world_abs_size/($this->world_size*1.0); - } - } - $size = $this->world_size * $this->scale_factor; - $this->scale_abs=array($this->off,$this->off + $size); - } - - // Initialize the conversion constants for this scale - // This tries to pre-calculate as much as possible to speed up the - // actual conversion (with Translate()) later on - // $start =scale start in absolute pixels (for x-scale this is an y-position - // and for an y-scale this is an x-position - // $len =absolute length in pixels of scale - function SetConstants($aStart,$aLen) { - $this->world_abs_size=$aLen; - $this->off=$aStart; - - if( $this->world_size<=0 ) { - // This should never ever happen !! - JpGraphError::RaiseL(25074); - //("You have unfortunately stumbled upon a bug in JpGraph. It seems like the scale range is ".$this->world_size." [for ".$this->type." scale]
Please report Bug #01 to info@jpgraph.net and include the script that gave this error. This problem could potentially be caused by trying to use \"illegal\" values in the input data arrays (like trying to send in strings or only NULL values) which causes the autoscaling to fail."); - } - - // scale_factor = number of pixels per world unit - $this->scale_factor=$this->world_abs_size/($this->world_size*1.0); - - // scale_abs = start and end points of scale in absolute pixels - $this->scale_abs=array($this->off,$this->off+$this->world_size*$this->scale_factor); - } - - - // Calculate number of ticks steps with a specific division - // $a is the divisor of 10**x to generate the first maj tick intervall - // $a=1, $b=2 give major ticks with multiple of 10, ...,0.1,1,10,... - // $a=5, $b=2 give major ticks with multiple of 2:s ...,0.2,2,20,... - // $a=2, $b=5 give major ticks with multiple of 5:s ...,0.5,5,50,... - // We return a vector of - // [$numsteps,$adjmin,$adjmax,$minstep,$majstep] - // If $majend==true then the first and last marks on the axis will be major - // labeled tick marks otherwise it will be adjusted to the closest min tick mark - function CalcTicks($maxsteps,$min,$max,$a,$b,$majend=true) { - $diff=$max-$min; - if( $diff==0 ) { - $ld=0; - } - else { - $ld=floor(log10($diff)); - } - - // Gravitate min towards zero if we are close - if( $min>0 && $min < pow(10,$ld) ) $min=0; - - //$majstep=pow(10,$ld-1)/$a; - $majstep=pow(10,$ld)/$a; - $minstep=$majstep/$b; - - $adjmax=ceil($max/$minstep)*$minstep; - $adjmin=floor($min/$minstep)*$minstep; - $adjdiff = $adjmax-$adjmin; - $numsteps=$adjdiff/$majstep; - - while( $numsteps>$maxsteps ) { - $majstep=pow(10,$ld)/$a; - $numsteps=$adjdiff/$majstep; - ++$ld; - } - - $minstep=$majstep/$b; - $adjmin=floor($min/$minstep)*$minstep; - $adjdiff = $adjmax-$adjmin; - if( $majend ) { - $adjmin = floor($min/$majstep)*$majstep; - $adjdiff = $adjmax-$adjmin; - $adjmax = ceil($adjdiff/$majstep)*$majstep+$adjmin; - } - else { - $adjmax=ceil($max/$minstep)*$minstep; - } - - return array($numsteps,$adjmin,$adjmax,$minstep,$majstep); - } - - function CalcTicksFreeze($maxsteps,$min,$max,$a,$b) { - // Same as CalcTicks but don't adjust min/max values - $diff=$max-$min; - if( $diff==0 ) { - $ld=0; - } - else { - $ld=floor(log10($diff)); - } - - //$majstep=pow(10,$ld-1)/$a; - $majstep=pow(10,$ld)/$a; - $minstep=$majstep/$b; - $numsteps=floor($diff/$majstep); - - while( $numsteps > $maxsteps ) { - $majstep=pow(10,$ld)/$a; - $numsteps=floor($diff/$majstep); - ++$ld; - } - $minstep=$majstep/$b; - return array($numsteps,$minstep,$majstep); - } - - - function IntCalcTicks($maxsteps,$min,$max,$a,$majend=true) { - $diff=$max-$min; - if( $diff==0 ) { - JpGraphError::RaiseL(25075);//('Can\'t automatically determine ticks since min==max.'); - } - else { - $ld=floor(log10($diff)); - } - - // Gravitate min towards zero if we are close - if( $min>0 && $min < pow(10,$ld) ) { - $min=0; - } - if( $ld == 0 ) { - $ld=1; - } - if( $a == 1 ) { - $majstep = 1; - } - else { - $majstep=pow(10,$ld)/$a; - } - $adjmax=ceil($max/$majstep)*$majstep; - - $adjmin=floor($min/$majstep)*$majstep; - $adjdiff = $adjmax-$adjmin; - $numsteps=$adjdiff/$majstep; - while( $numsteps>$maxsteps ) { - $majstep=pow(10,$ld)/$a; - $numsteps=$adjdiff/$majstep; - ++$ld; - } - - $adjmin=floor($min/$majstep)*$majstep; - $adjdiff = $adjmax-$adjmin; - if( $majend ) { - $adjmin = floor($min/$majstep)*$majstep; - $adjdiff = $adjmax-$adjmin; - $adjmax = ceil($adjdiff/$majstep)*$majstep+$adjmin; - } - else { - $adjmax=ceil($max/$majstep)*$majstep; - } - - return array($numsteps,$adjmin,$adjmax,$majstep); - } - - - function IntCalcTicksFreeze($maxsteps,$min,$max,$a) { - // Same as IntCalcTick but don't change min/max values - $diff=$max-$min; - if( $diff==0 ) { - JpGraphError::RaiseL(25075);//('Can\'t automatically determine ticks since min==max.'); - } - else { - $ld=floor(log10($diff)); - } - if( $ld == 0 ) { - $ld=1; - } - if( $a == 1 ) { - $majstep = 1; - } - else { - $majstep=pow(10,$ld)/$a; - } - - $numsteps=floor($diff/$majstep); - while( $numsteps > $maxsteps ) { - $majstep=pow(10,$ld)/$a; - $numsteps=floor($diff/$majstep); - ++$ld; - } - - return array($numsteps,$majstep); - } - - // Determine the minimum of three values witha weight for last value - function MatchMin3($a,$b,$c,$weight) { - if( $a < $b ) { - if( $a < ($c*$weight) ) { - return 1; // $a smallest - } - else { - return 3; // $c smallest - } - } - elseif( $b < ($c*$weight) ) { - return 2; // $b smallest - } - return 3; // $c smallest - } - - function __get($name) { - $variable_name = '_' . $name; - - if (isset($this->$variable_name)) { - return $this->$variable_name * SUPERSAMPLING_SCALE; - } else { - JpGraphError::RaiseL('25132', $name); - } - } - - function __set($name, $value) { - $this->{'_'.$name} = $value; - } -} // Class - - -//=================================================== -// CLASS DisplayValue -// Description: Used to print data values at data points -//=================================================== -class DisplayValue { - public $margin=5; - public $show=false; - public $valign='',$halign='center'; - public $format='%.1f',$negformat=''; - private $ff=FF_DEFAULT,$fs=FS_NORMAL,$fsize=8; - private $iFormCallback=''; - private $angle=0; - private $color='navy',$negcolor=''; - private $iHideZero=false; - public $txt=null; - - function __construct() { - $this->txt = new Text(); - } - - function Show($aFlag=true) { - $this->show=$aFlag; - } - - function SetColor($aColor,$aNegcolor='') { - $this->color = $aColor; - $this->negcolor = $aNegcolor; - } - - function SetFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=8) { - $this->ff=$aFontFamily; - $this->fs=$aFontStyle; - $this->fsize=$aFontSize; - } - - function ApplyFont($aImg) { - $aImg->SetFont($this->ff,$this->fs,$this->fsize); - } - - function SetMargin($aMargin) { - $this->margin = $aMargin; - } - - function SetAngle($aAngle) { - $this->angle = $aAngle; - } - - function SetAlign($aHAlign,$aVAlign='') { - $this->halign = $aHAlign; - $this->valign = $aVAlign; - } - - function SetFormat($aFormat,$aNegFormat='') { - $this->format= $aFormat; - $this->negformat= $aNegFormat; - } - - function SetFormatCallback($aFunc) { - $this->iFormCallback = $aFunc; - } - - function HideZero($aFlag=true) { - $this->iHideZero=$aFlag; - } - - function Stroke($img,$aVal,$x,$y) { - - if( $this->show ) - { - if( $this->negformat=='' ) { - $this->negformat=$this->format; - } - if( $this->negcolor=='' ) { - $this->negcolor=$this->color; - } - - if( $aVal===NULL || (is_string($aVal) && ($aVal=='' || $aVal=='-' || $aVal=='x' ) ) ) { - return; - } - - if( is_numeric($aVal) && $aVal==0 && $this->iHideZero ) { - return; - } - - // Since the value is used in different cirumstances we need to check what - // kind of formatting we shall use. For example, to display values in a line - // graph we simply display the formatted value, but in the case where the user - // has already specified a text string we don't fo anything. - if( $this->iFormCallback != '' ) { - $f = $this->iFormCallback; - $sval = call_user_func($f,$aVal); - } - elseif( is_numeric($aVal) ) { - if( $aVal >= 0 ) { - $sval=sprintf($this->format,$aVal); - } - else { - $sval=sprintf($this->negformat,$aVal); - } - } - else { - $sval=$aVal; - } - - $y = $y-sign($aVal)*$this->margin; - - $this->txt->Set($sval); - $this->txt->SetPos($x,$y); - $this->txt->SetFont($this->ff,$this->fs,$this->fsize); - if( $this->valign == '' ) { - if( $aVal >= 0 ) { - $valign = "bottom"; - } - else { - $valign = "top"; - } - } - else { - $valign = $this->valign; - } - $this->txt->Align($this->halign,$valign); - - $this->txt->SetOrientation($this->angle); - if( $aVal > 0 ) { - $this->txt->SetColor($this->color); - } - else { - $this->txt->SetColor($this->negcolor); - } - $this->txt->Stroke($img); - } - } -} - -//=================================================== -// CLASS Plot -// Description: Abstract base class for all concrete plot classes -//=================================================== -class Plot { - public $numpoints=0; - public $value; - public $legend=''; - public $coords=array(); - public $color='black'; - public $hidelegend=false; - public $line_weight=1; - public $csimtargets=array(),$csimwintargets=array(); // Array of targets for CSIM - public $csimareas=''; // Resultant CSIM area tags - public $csimalts=null; // ALT:s for corresponding target - public $legendcsimtarget='',$legendcsimwintarget=''; - public $legendcsimalt=''; - protected $weight=1; - protected $center=false; - - protected $inputValues; - protected $isRunningClear = false; - - function __construct($aDatay,$aDatax=false) { - $this->numpoints = count($aDatay); - if( $this->numpoints==0 ) { - JpGraphError::RaiseL(25121);//("Empty input data array specified for plot. Must have at least one data point."); - } - - if (!$this->isRunningClear) { - $this->inputValues = array(); - $this->inputValues['aDatay'] = $aDatay; - $this->inputValues['aDatax'] = $aDatax; - } - - $this->coords[0]=$aDatay; - if( is_array($aDatax) ) { - $this->coords[1]=$aDatax; - $n = count($aDatax); - for( $i=0; $i < $n; ++$i ) { - if( !is_numeric($aDatax[$i]) ) { - JpGraphError::RaiseL(25070); - } - } - } - $this->value = new DisplayValue(); - } - - // Stroke the plot - // "virtual" function which must be implemented by - // the subclasses - function Stroke($aImg,$aXScale,$aYScale) { - JpGraphError::RaiseL(25122);//("JpGraph: Stroke() must be implemented by concrete subclass to class Plot"); - } - - function HideLegend($f=true) { - $this->hidelegend = $f; - } - - function DoLegend($graph) { - if( !$this->hidelegend ) - $this->Legend($graph); - } - - function StrokeDataValue($img,$aVal,$x,$y) { - $this->value->Stroke($img,$aVal,$x,$y); - } - - // Set href targets for CSIM - function SetCSIMTargets($aTargets,$aAlts='',$aWinTargets='') { - $this->csimtargets=$aTargets; - $this->csimwintargets=$aWinTargets; - $this->csimalts=$aAlts; - } - - // Get all created areas - function GetCSIMareas() { - return $this->csimareas; - } - - // "Virtual" function which gets called before any scale - // or axis are stroked used to do any plot specific adjustment - function PreStrokeAdjust($aGraph) { - if( substr($aGraph->axtype,0,4) == "text" && (isset($this->coords[1])) ) { - JpGraphError::RaiseL(25123);//("JpGraph: You can't use a text X-scale with specified X-coords. Use a \"int\" or \"lin\" scale instead."); - } - return true; - } - - // Virtual function to the the concrete plot class to make any changes to the graph - // and scale before the stroke process begins - function PreScaleSetup($aGraph) { - // Empty - } - - // Get minimum values in plot - function Min() { - if( isset($this->coords[1]) ) { - $x=$this->coords[1]; - } - else { - $x=''; - } - if( $x != '' && count($x) > 0 ) { - $xm=min($x); - } - else { - $xm=0; - } - $y=$this->coords[0]; - $cnt = count($y); - if( $cnt > 0 ) { - $i=0; - while( $i<$cnt && !is_numeric($ym=$y[$i]) ) { - $i++; - } - while( $i < $cnt) { - if( is_numeric($y[$i]) ) { - $ym=min($ym,$y[$i]); - } - ++$i; - } - } - else { - $ym=''; - } - return array($xm,$ym); - } - - // Get maximum value in plot - function Max() { - if( isset($this->coords[1]) ) { - $x=$this->coords[1]; - } - else { - $x=''; - } - - if( $x!='' && count($x) > 0 ) { - $xm=max($x); - } - else { - $xm = $this->numpoints-1; - } - $y=$this->coords[0]; - if( count($y) > 0 ) { - $cnt = count($y); - $i=0; - while( $i<$cnt && !is_numeric($ym=$y[$i]) ) { - $i++; - } - while( $i < $cnt ) { - if( is_numeric($y[$i]) ) { - $ym=max($ym,$y[$i]); - } - ++$i; - } - } - else { - $ym=''; - } - return array($xm,$ym); - } - - function SetColor($aColor) { - $this->color=$aColor; - } - - function SetLegend($aLegend,$aCSIM='',$aCSIMAlt='',$aCSIMWinTarget='') { - $this->legend = $aLegend; - $this->legendcsimtarget = $aCSIM; - $this->legendcsimwintarget = $aCSIMWinTarget; - $this->legendcsimalt = $aCSIMAlt; - } - - function SetWeight($aWeight) { - $this->weight=$aWeight; - } - - function SetLineWeight($aWeight=1) { - $this->line_weight=$aWeight; - } - - function SetCenter($aCenter=true) { - $this->center = $aCenter; - } - - // This method gets called by Graph class to plot anything that should go - // into the margin after the margin color has been set. - function StrokeMargin($aImg) { - return true; - } - - // Framework function the chance for each plot class to set a legend - function Legend($aGraph) { - if( $this->legend != '' ) { - $aGraph->legend->Add($this->legend,$this->color,'',0,$this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } - } - - function Clear() { - $this->isRunningClear = true; - $this->__construct($this->inputValues['aDatay'], $this->inputValues['aDatax']); - $this->isRunningClear = false; - } - -} // Class - - -// Provide a deterministic list of new colors whenever the getColor() method -// is called. Used to automatically set colors of plots. -class ColorFactory { - - static private $iIdx = 0; - static private $iColorList = array( - 'black', - 'blue', - 'orange', - 'darkgreen', - 'red', - 'AntiqueWhite3', - 'aquamarine3', - 'azure4', - 'brown', - 'cadetblue3', - 'chartreuse4', - 'chocolate', - 'darkblue', - 'darkgoldenrod3', - 'darkorchid3', - 'darksalmon', - 'darkseagreen4', - 'deepskyblue2', - 'dodgerblue4', - 'gold3', - 'hotpink', - 'lawngreen', - 'lightcoral', - 'lightpink3', - 'lightseagreen', - 'lightslateblue', - 'mediumpurple', - 'olivedrab', - 'orangered1', - 'peru', - 'slategray', - 'yellow4', - 'springgreen2'); - static private $iNum = 33; - - static function getColor() { - if( ColorFactory::$iIdx >= ColorFactory::$iNum ) - ColorFactory::$iIdx = 0; - return ColorFactory::$iColorList[ColorFactory::$iIdx++]; - } - -} - -// -?> diff --git a/#jpgraph/src/jpgraph_antispam-digits.php b/#jpgraph/src/jpgraph_antispam-digits.php deleted file mode 100644 index d9d350ca..00000000 --- a/#jpgraph/src/jpgraph_antispam-digits.php +++ /dev/null @@ -1,205 +0,0 @@ -digits['6'][0]= 645 ; - $this->digits['6'][1]= - '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. - 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. - 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAEBAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwMC'. - 'BAQEBwAAAAAAAAABAgMEAAURBiESIjFRBxMUQRUWMmFTYnGRkrHC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFhEBAQEAAAAA'. - 'AAAAAAAAAAAAAAER/9oADAMBAAIRAxEAPwDslwiR3oDku8ONttsAvDiVyMcO/ET7ke5/aoOz6k1Vr5htNjW7a7M1yO3NTQU9JUDu'. - 'GgrlSn8xyf6p4gXaHJvNps9/mKZtSkGdMjRwpfqAFBLLACRlZUrJONsI2717No1lbZ10kx7XGnRpKWQ/6GVGMfzEJ5VFIVtsOH6e'. - 'wyKVhYsia0y22pLThSkJK1uniVgdThOM0ol+StIUhpopIyCFq3H8aUVCwnG3PGe4Rp6fLXJtMdyM0ojcIWvIz3HFnAPfrWTXb6GN'. - 'WaLXDwZjVz8pKEfhuIUFg/bAz9sVJ61nt61mxJFslLtq7e5yPqiBT4UDklKw4MDpt+u+9bFiu9riXNu83R+fcr6tohuQ5HQhmK37'. - 'paaC8DruScmg6X8KkjZEhbaB9KEyFYSOw26Uqd+e7Qerl5z74DY/1SomP//Z' ; - - //========================================================== - // d2-small.jpg - //========================================================== - $this->digits['2'][0]= 606 ; - $this->digits['2'][1]= - '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. - 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. - 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEQMBIgACEQEDEQH/xAAYAAEBAQEBAAAAAAAAAAAAAAAFAAQHAv/EACsQAAEDBAEC'. - 'BAYDAAAAAAAAAAIBAwQABQYRIRIxQVFhcQcTFSJSU5GU0f/EABcBAAMBAAAAAAAAAAAAAAAAAAECAwT/xAAZEQACAwEAAAAAAAAA'. - 'AAAAAAAAARESUUH/2gAMAwEAAhEDEQA/AOqXm/Q8dxmOL4PPSnCSNFixx6nXnkXgRT3Te17JWbGsveueSyLZdbPItNxOKLzTLjou'. - 'gYCSoSoY8ISKSbFeUrzkdlnTL1YshskiErkQnFEZaF8kkdBBVdjyi6RNL5+9F486eS/ECVkcBtDt1vZcho5viS8ZCp9C9tAIAm/F'. - 'VoPRU+HRtJ5JVRP1kP0PfwP+1VKrHBMliXG4Nw8VgE4xGkuqk2S1wTUNEVdIvgpL9iL6KtNxY7WOwo9tt0RCitj0sR2uCbFPPzH1'. - '7+6rRuSRcljMBMsUy2tky045KOawZk5xtEFBJEROO3hx61kh2rPCIX3MhsyC4QmfTbC6lH8dq5212qwkiG5H6Y/9R2qm+ofxqqsL'. - 'DLZ6f//Z' ; - - //========================================================== - // d9-small.jpg - //========================================================== - $this->digits['9'][0]= 680 ; - $this->digits['9'][1]= - '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. - 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. - 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwP/xAArEAABAwMD'. - 'AgYBBQAAAAAAAAABAgMEBQYRABIhE1EUIjEzQUIHMlJhcdH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAQD/xAAYEQEAAwEAAAAAAAAA'. - 'AAAAAAAAAREhQf/aAAwDAQACEQMRAD8AkK7brF6X7XpMeGoKhFMLEeT4ZUheEhanF4OcZ2pTgDykk92bZpdCsi7aezLjxkIPUZiV'. - 'RSCy8hah7EkZ27yM7V+iscal5bE22Lon1qNDmSKROd8Sl+Ix1lMOlIS4HGgQpbStoUCnlJz8HmsXtW3Lst2rmBAelLMRRekOwnYz'. - 'Edls9QKKnOVLyk7UgcbzzrdBthqEJJwZbAI4x1U/7o1TaFa9lG36aXaZTy54VrcXUgrzsGdx+T30aNydweqVw1GS87T6Lb86Q4ha'. - 'my/IAYjZBx+snKk99oOQMf1AViE65SY348hzFy6hPKnqtKz7DC1lbqyPrvJKUJ7H+M6Wrt3InP7o1brFNp4bCDGhxGAsqz69VSiQ'. - 'ORwBxrrQ7itm1ac7Hp0WoGTIc3PSn0pccdcP2WorycfA1RaRHjxosZqOyhtDTSAhCf2gDAGjVHTd9sKSCumynFEZK1tIJUe58/ro'. - '1V1//9k=' ; - - //========================================================== - // d5-small.jpg - //========================================================== - $this->digits['5'][0]= 632 ; - $this->digits['5'][1]= - '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. - 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. - 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgIFBwT/xAAoEAABAwME'. - 'AQQCAwAAAAAAAAABAgMEBQYRABIhIkEUMVFhBxNCgaH/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAv/EABcRAQEBAQAAAAAAAAAAAAAA'. - 'AAABEUH/2gAMAwEAAhEDEQA/ANGvW4YVOeiRX5b4mv5Sin05IdlupPKdo/j2SO3+6TbPNQvOsTVz33KRT4csR3YUF7Dsh5OSFvug'. - 'kqG4FPBxnjxpvvi4KZb1pTpU+QwxUi2Y7ZIAefUk5ATxnB9/gbtL/wCH1UpuhPUlZlMVaQ0mS8zJjqZOPfc2TwpIUonI9tw40R1r'. - 'WNGq/wBdJR1XT3lqHBUnGCfkfWjRWs1ve249erQqQYjOtN1FqPUpCXQ4WIzQSsJwT0UpRwQPG0nzqyuNHobjsl9kBuWqoOoXtT1/'. - 'WppZcA8lKRj64HxqU+3KpAr6plElRVKef3S4E0K9O8pLXVzKcqSsJAB9wSAca6bSoNXeuA1+5pEV+SGFNU1iKVFqI0Vdx2AJUeoz'. - '8DGlTDwG3CAf3q/pI0ah6MDhLz6U+EpXwPoaNMU//9k=' ; - - //========================================================== - // d1-small.jpg - //========================================================== - $this->digits['1'][0]= 646 ; - $this->digits['1'][1]= - '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. - 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. - 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEwMBIgACEQEDEQH/xAAZAAADAAMAAAAAAAAAAAAAAAAABQYCBAf/xAApEAACAQMD'. - 'AwQBBQAAAAAAAAABAgMEBREABiESMUEHEyJRkSNCYXGB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAQEBAAAAAAAAAAAA'. - 'AAAAAAEREv/aAAwDAQACEQMRAD8A6jdd4WLbstILnc4Uq0VoWpkJknb6IjXLHJUePOlez923fcW4r1SxWlqC2UbdKirQif3Xw3yA'. - 'OFAGT09/kO3OmV3a20MFRf6lIYPcpy7yRRAzgxjIy2M8YwcdiBzpX6d22VNvUlTXsFkuwkrKqNSfnK7F8OTzwrAY+l5zoxKskudN'. - 'EgQPUT9PBkWF3DH+1GPxo1mLnRoAqF2VRgGOFmX/AAgY/GjRUP6hVMFv2FuFqUvUGrpDFJMBnpdyF5bsAQew7Hxzp6LZNT0yQ1DI'. - 'wp0QCFBhD0jCsfLZHxbx5xxpTuvb1+v9PV7Ztk9roLPLCjmSSN3mX5ZwqjCgZX7PfWxDQb2in96pv9qq46aTE0bW4x9ceAWAYPwS'. - 'PsYzoixgmheBGjIVcYCnjp/jHjHbRpe1JLn9OnopE/a0ykvjwDx47aNMXqP/2Q==' ; - - //========================================================== - // d8-small.jpg - //========================================================== - $this->digits['8'][0]= 694 ; - $this->digits['8'][1]= - '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. - 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. - 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AFQMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABgcEBf/EACsQAAEDAwMD'. - 'AwMFAAAAAAAAAAECAwQFBhEAEiEUMVEHE0EVYYEiIzJCsf/EABYBAQEBAAAAAAAAAAAAAAAAAAIAAf/EABcRAQEBAQAAAAAAAAAA'. - 'AAAAAAABERL/2gAMAwEAAhEDEQA/AKL6gVVUa0i1T5QjvTprUJMlxW4R9zgQXe/AH+kaWrntqlWjaq7gpcmotXAw82ht9yY4tch8'. - 'uAFC0k7VBXPGMY51ruiaue+bThIj+7NbWqS+7HDxajFf6AlB/k44o8ZOABk4xkL0X0tZiojKrlRuGRJjugqldSlKGf6t7BuUQe3J'. - '44xxxrA1a4KVJipLidri8uLHgqOcfjOPxo0o2hdDvS1CmV2Yl6fS5ioipIQR1CAlKkLKR2UUqAI8g6NRSwuuyHab6s1ufLI/Zai7'. - 'UBJOxhTS0+6B32pWSFH4CidOdWU0ukLiN1BLr0zG5Sdm3GRvcPhIT858DvjXNrVsSLnm/VIdTXS6tTnFsxZTSN3jchaTwps+O/z9'. - 'tcBVq3hIX0tYqlIiQHdy5CqRHKHXEjAOMgBKjnvyRk4xrQa7OiGt1K5biYZL8SoVEpjOqkFsONtJCNwASeCQrn7aNUKnQYtLp7EC'. - 'EylmLHQltptPZKQOBo1FzH//2Q==' ; - - //========================================================== - // d4-small.jpg - //========================================================== - $this->digits['4'][0]= 643 ; - $this->digits['4'][1]= - '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. - 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. - 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABAYHAv/EAC0QAAIBAwQA'. - 'BAMJAAAAAAAAAAECAwQFEQAGEiETFDFBUmGBByIjUVNxobHR/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAIB/8QAGBEBAAMBAAAAAAAA'. - 'AAAAAAAAAAERIVH/2gAMAwEAAhEDEQA/ANjM00Nxmt1xiWW31CZp5uJwoAAaOQ/n7qfcZHqO5my3q5XX7R6ijiqnNut9u4NyJ4yv'. - 'JJyjYr8Xhrn5g599J7x3ulBNU7Zo7dXXXcLQ8kURYi4epYtkALjOePv1nUvbLvV7P3BZm3DR3eh88Kp7pVzBZI6iUhGWRRGWwE44'. - 'HX3V+uiL1uHgt+vL/H+aNJQ3CSeCOaFqSaJ1DJKs/TqRkMOvQjvRorHE4pRDLNWLGlRHGUeYIORXs9e5B7OP31E0fmdyb/t0DJ4Q'. - '27bfx3YZzPUIoAAz7IpOD6cuxq0uNumqLfVNDOqXBoZEjnZcqhIPXH4c46+WkdoWOltu3IDDLLLVVR83UVcuPEmmcZZ2/rHoAANG'. - 'GI7KIY1ijoLeEQBVCwIoAHpgY6Hy0aZe7mJ2jeHLKcEhusj6aNKgzr//2Q==' ; - - //========================================================== - // d7-small.jpg - //========================================================== - $this->digits['7'][0]= 658 ; - $this->digits['7'][1]= - '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. - 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. - 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgEFBwT/xAAuEAABAwIE'. - 'BAQGAwAAAAAAAAABAgMEBREABiExEhMiQSMyUXEHFBclVJFhk9L/xAAXAQADAQAAAAAAAAAAAAAAAAAAAQID/8QAGREBAQEAAwAA'. - 'AAAAAAAAAAAAAAEREiFR/9oADAMBAAIRAxEAPwDXq9mCjZeQ05VZ5ZST4bfEpa3VdglCbqUe+g9MZ5Uq7V8415WXoMSdQ6etgSps'. - '19wpkCMDZKUpv0FZvbi1NzpYasMDLDUbMVXrtQdbeeU23xLWkj5RlLYK0J7anW9gbAjCzkOtsVSUJUdtc6dVZK51UeaFm4LKbhpC'. - 'l7EhIFkDW974GbRI2XorUVls1OTdKAOqUpR0Hc3198GITQ6k+hLwrEpoODiDenRfW23bBicg78JXxPpD0mgVOW5PAivNNpahsPW5'. - '8xxQaSVkboQnhsnYm5OHqDGp1IpsalMKjMsMIC3+XZKbJFth62/QOEfMOZqZXp9JcKZTcGmTky3meSi7xQklI81vMR+sXIz/AEgp'. - 'Q0qPNu6ea8Q2jqtbp8+2w9h/OKORc/cpHjt1dDSHOtLZ4ekHW23bBjj+o9H/AB539aP94MG0+L//2Q==' ; - - //========================================================== - // d3-small.jpg - //========================================================== - $this->digits['3'][0]= 662 ; - $this->digits['3'][1]= - '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. - 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. - 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwL/xAArEAABBAED'. - 'AwMDBQEAAAAAAAABAgMEBREABhIhMUEiMmETFZEHFkJDUdH/xAAWAQEBAQAAAAAAAAAAAAAAAAABAAL/xAAYEQEBAQEBAAAAAAAA'. - 'AAAAAAAAEQExQf/aAAwDAQACEQMRAD8A0vclruBdk3VVLLUNssGRJsZSCtqOjlgJAHvcOD6c4HnOdIbcttw1W5P29cFEhuawqTXS'. - 'VsJjnCMBxKkJJx7goAde+ceJfdNxU0UNlyymyXHi6kxWUNl1S3EnkAEIHX2nv86qtTuZr9Q9+1VhRsOoYpYcgSVyAE/TdewkJxnK'. - 'sBCjkdPGpnOtFMd3PqsXgfOAgD8Y0aX+11H9rDDjn8lr9yj5J+dGqsqxaw6Cc9cQZU4Sp7zTJsIrKlcUEKwhSin1JABI45GUjqOu'. - 'lbOvjbc3Ts9ynjGCy445UuFLYRzbWgrT6fhSCQSMDke+pew2zYVly/d7YchNqkMJZnQpgV9J8IzwWFJyUrAJHYgjvpLbu37G5nR7'. - 'vck5C3YRKYEOEVJZj8kjKypXqWvirjk9h+dB9i4faa89TDZUfKlIyT8k+To10a6KTkpcJ/0vL/7o0TS//9k=' ; - } -} - -class AntiSpam { - - private $iNumber=''; - - function __construct($aNumber='') { - $this->iNumber = $aNumber; - } - - function Rand($aLen) { - $d=''; - for($i=0; $i < $aLen; ++$i) { - $d .= rand(1,9); - } - $this->iNumber = $d; - return $d; - } - - function Stroke() { - - $n=strlen($this->iNumber); - for($i=0; $i < $n; ++$i ) { - if( !is_numeric($this->iNumber[$i]) || $this->iNumber[$i]==0 ) { - return false; - } - } - - $dd = new HandDigits(); - $n = strlen($this->iNumber); - $img = @imagecreatetruecolor($n*$dd->iWidth, $dd->iHeight); - if( $img < 1 ) { - return false; - } - $start=0; - for($i=0; $i < $n; ++$i ) { - $size = $dd->digits[$this->iNumber[$i]][0]; - $dimg = imagecreatefromstring(base64_decode($dd->digits[$this->iNumber[$i]][1])); - imagecopy($img,$dimg,$start,0,0,0,imagesx($dimg), $dd->iHeight); - $start += imagesx($dimg); - } - $resimg = @imagecreatetruecolor($start+4, $dd->iHeight+4); - if( $resimg < 1 ) { - return false; - } - imagecopy($resimg,$img,2,2,0,0,$start, $dd->iHeight); - header("Content-type: image/jpeg"); - imagejpeg($resimg); - return true; - } -} - -?> diff --git a/#jpgraph/src/jpgraph_antispam.php b/#jpgraph/src/jpgraph_antispam.php deleted file mode 100644 index 7998df28..00000000 --- a/#jpgraph/src/jpgraph_antispam.php +++ /dev/null @@ -1,615 +0,0 @@ -chars['j'][0]= 658 ; - $this->chars['j'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAUGBAf/xAAsEAACAQMDAwMBCQAAAAAAAAAB'. -'AgMEBREAEjEGIUEUUXGBBxMVIiNSYWKC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAwEC/8QAGhEAAwADAQAAAAAAAAAAAAAAAAECERIh'. -'Mv/aAAwDAQACEQMRAD8A6veK2st8zRWSyV1dUBfvHaGVI4hknsS7AFv4AyM57ayWbqeS+11xtT2etttwo4YqhEqnQs5bcAfyk4AZ'. -'SOeD441TKRTyingUBG4/ah8j684+dSFzh/BvtaslejMUu9DPQTDnLx4lQ/ONw1TGBm0jdRWqguEMghEisWilgDmNs4Ze+MEEEH40'. -'aUVFTa7JeLjRXu4GjhmnNbSfqFQVlA3rkckOjH/Q99Glmkl0C/Q06pvsvT9vttXHDF6T1KrWbs5gRgQJM+FDlQxPhjpF1XcVq+qe'. -'jEoKiOecXBqh2TDDYIXLKuP6549xk8auI6aJqV45oknWdNswkAIkGMYIxjGO2NR1F0LZY5qkWqkS1xrM0M8lMSJpY+TGrnJiQ577'. -'cEgeNHhi7D3qC3UN69M8tIakRhgrh9o748+eNGtcCiKjjpkQKlMTEg3ZwoxtHHtgfTRpYXArvp//2Q==' ; - - //========================================================== - // lf-small.jpg - //========================================================== - $this->chars['f'][0]= 633 ; - $this->chars['f'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQFBgcC/8QAKxAAAgEDAwMCBQUAAAAAAAAA'. -'AQIDBBEhAAUGEjFBEyIHFFFhoRUzYnGS/8QAFQEBAQAAAAAAAAAAAAAAAAAAAQP/xAAaEQACAwEBAAAAAAAAAAAAAAAAAQIRMRIh'. -'/9oADAMBAAIRAxEAPwDcnmLoIkiSYsouC3tA++O2lU9WkqVjJ+YdhZLsQI/4/YfQm50kZP0vbmaCSU0SRNIH6sghb9INs3t38dvp'. -'akUuz8x5DwdN5peS1jV1dSipSiVUigIcdQjQ26lIB/c6r3F86SZpE/zCFJaqsihQNhRgdj3Jyfxo0jDSbXHt9Oph9RAoV3qJGltY'. -'HDOxyb/nRpV0D3RXle21m48XraOk3IUSemUaV4g4Zc9ShcDtgff+tQfwvjq34Dtku7buamFqeJKemCCMxKFsEJU+/FrX8d76sEHG'. -'aNItzr4usVNdG3S0rmRYAVwEUmyjyQLZ11x7aF4zs9DQOyzml29I2cLa/pixIHi99DFCtU9dFuLIaijo9qiYPmR2mZmB9thgAHOD'. -'4+mjUrURyrUNMZFEkkIOFuFAbsP9d/OjVIQ6Vh4tP//Z' ; - - //========================================================== - // lb-small.jpg - //========================================================== - $this->chars['b'][0]= 645 ; - $this->chars['b'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYCAwUH/8QAKxAAAQMDAwMDAwUAAAAAAAAA'. -'AQIDBAAFEQYSIRMxUSJBYQcVI2JxgqHw/8QAFQEBAQAAAAAAAAAAAAAAAAAAAQL/xAAYEQEBAQEBAAAAAAAAAAAAAAAAATERYf/a'. -'AAwDAQACEQMRAD8A6H95mxNYwLXcX+pCuilSLXJ6YSplaUELjqxwe4IJ5PIPamJ2V0bPcS7+NxCX1cHggAnIP+xSd9RyzHh2m7FQ'. -'Q1CvMNQWTjCt+HFD+PB/Y1fI1PL1HFFt0zaGblFdJQ9cJjpZiqPJUlBAKnPcEpGB5NNRKdrOl1NlgiQol4R2w4Sc5VtGf7opZteo'. -'LhdorjUSM5FnQnlR50NeHQysYxtVxlJHIPgjtRRD3xkaghs6juumdHz4+Y7RVPnt59K2mk7W+fcKWsZ7djTXMkW+xMP3GRJjwIEN'. -'HTG/CWx5wPY8AADx2NYk3SL9wukvUjGobnBkORksIbjdMANozgEqSo8qJPGO/wAVO36IsjUmBIfZfuM7epZk3F9UhSSk5O0K9Kcq'. -'8AcU3UzFuhUSBFud6nRXoz96mqmJZWg7m2dqUNhWBwdqQSP1UU5c/FFCn//Z' ; - - //========================================================== - // d6-small.jpg - //========================================================== - $this->chars['6'][0]= 645 ; - $this->chars['6'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. -'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAEBAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwMC'. -'BAQEBwAAAAAAAAABAgMEAAURBiESIjFRBxMUQRUWMmFTYnGRkrHC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFhEBAQEAAAAA'. -'AAAAAAAAAAAAAAER/9oADAMBAAIRAxEAPwDslwiR3oDku8ONttsAvDiVyMcO/ET7ke5/aoOz6k1Vr5htNjW7a7M1yO3NTQU9JUDu'. -'GgrlSn8xyf6p4gXaHJvNps9/mKZtSkGdMjRwpfqAFBLLACRlZUrJONsI2717No1lbZ10kx7XGnRpKWQ/6GVGMfzEJ5VFIVtsOH6e'. -'wyKVhYsia0y22pLThSkJK1uniVgdThOM0ol+StIUhpopIyCFq3H8aUVCwnG3PGe4Rp6fLXJtMdyM0ojcIWvIz3HFnAPfrWTXb6GN'. -'WaLXDwZjVz8pKEfhuIUFg/bAz9sVJ61nt61mxJFslLtq7e5yPqiBT4UDklKw4MDpt+u+9bFiu9riXNu83R+fcr6tohuQ5HQhmK37'. -'paaC8DruScmg6X8KkjZEhbaB9KEyFYSOw26Uqd+e7Qerl5z74DY/1SomP//Z' ; - - //========================================================== - // lx-small.jpg - //========================================================== - $this->chars['x'][0]= 650 ; - $this->chars['x'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABMDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAUHBgj/xAApEAABAwMDAwQCAwAAAAAAAAAB'. -'AgMEBQYRACFBBxIxFCJRgRNxkcHw/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAWEQEBAQAAAAAAAAAAAAAAAAAAEQH/2gAMAwEA'. -'AhEDEQA/AH9t3pKvO14UykVARa/HfAlxlDKXR24V2p3z7RlPwdtMep91uWdRGHWELjuTFFtLvcC4SNznnH+21O7ttiodOq1BvC0E'. -'p9I0lSX2kgqCSklK+5PKCMAng6zV2XRO6u3lSIURtbDRShltlZHa0tW7q/0MeTwnjxq1Jiw2xc9xTLbhSVU5iaXUFfqFFILgJOCd'. -'9Gt3SXabR6REpkL8yo0RpLCFNx1qBCRjOQMHxo0pEr6o3um2LVYpMEpTVqg25lHn08dfcB9kEgfZ1LIFDuawqZRb7aQlLTzqglsg'. -'9wQdveOEqBIB425xqhQuk8qo9UKlPrlRblw2ZBeCSVKW6CcoSrI2AGOT41SKzT4dYtmdS5bIXDZhNoWgbZJ94x8AYT/GkM03oNUc'. -'uKgwqtTZDTMOU0FttqRkoHggnPkEEHRrkJ6t1SlSHYUOc6zHaWrsbQrATk5/vRqK/9k=' ; - - //========================================================== - // d2-small.jpg - //========================================================== - $this->chars['2'][0]= 606 ; - $this->chars['2'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. -'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEQMBIgACEQEDEQH/xAAYAAEBAQEBAAAAAAAAAAAAAAAFAAQHAv/EACsQAAEDBAEC'. -'BAYDAAAAAAAAAAIBAwQABQYRIRIxQVFhcQcTFSJSU5GU0f/EABcBAAMBAAAAAAAAAAAAAAAAAAECAwT/xAAZEQACAwEAAAAAAAAA'. -'AAAAAAAAARESUUH/2gAMAwEAAhEDEQA/AOqXm/Q8dxmOL4PPSnCSNFixx6nXnkXgRT3Te17JWbGsveueSyLZdbPItNxOKLzTLjou'. -'gYCSoSoY8ISKSbFeUrzkdlnTL1YshskiErkQnFEZaF8kkdBBVdjyi6RNL5+9F486eS/ECVkcBtDt1vZcho5viS8ZCp9C9tAIAm/F'. -'VoPRU+HRtJ5JVRP1kP0PfwP+1VKrHBMliXG4Nw8VgE4xGkuqk2S1wTUNEVdIvgpL9iL6KtNxY7WOwo9tt0RCitj0sR2uCbFPPzH1'. -'7+6rRuSRcljMBMsUy2tky045KOawZk5xtEFBJEROO3hx61kh2rPCIX3MhsyC4QmfTbC6lH8dq5212qwkiG5H6Y/9R2qm+ofxqqsL'. -'DLZ6f//Z' ; - - //========================================================== - // lm-small.jpg - //========================================================== - $this->chars['m'][0]= 649 ; - $this->chars['m'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAAcDBAUCBv/EAC0QAAICAQMCBAMJAAAAAAAA'. -'AAECAwQRAAUSBiETMVFhB2KhFSIyQVJxgZHB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgED/8QAGREBAQEAAwAAAAAAAAAAAAAAAQAR'. -'EiEx/9oADAMBAAIRAxEAPwB0MI2lIdgI0Cly3kFXLEn2zx1FDdp7rbpbjUtRWKio3hyxOGQllJzkegX66rQ2qW87Zuk9S5FNVmru'. -'iywyBhjDKTkeXfSr+GRfYtq2KAO32b1BGxAZu0dyJ2DKPTxY1wPddVszycUq2Golq8jRWbcnJWwCVGMjz+VQP50atxMtm2ZUOY4l'. -'4qfUnBP0x/Z0amy4jJm10Tt2yddWasFmfaRfdrlG3UcgArnxKzJ+Fu4DqCMkcgNem2DoWav8PLfTm+FPEkuSNTnqueS5bnHIv6CG'. -'LNjJwM99bm67NB1Ht89KSxNXnr2hNDbiUc47K4KyD2GQMfmMjUnS+7vuIktTqPCaaWCqAMMojPFyw8hyYMQBnAwNJHYGXPTsW9VN'. -'jg2zf50W9zk524GAEihuz+xbIOD82jW5TkjtRPZkTkJ+4VgDhQfuj/f3OjUxl1f/2Q==' ; - - //========================================================== - // lt-small.jpg - //========================================================== - $this->chars['t'][0]= 648 ; - $this->chars['t'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQDBQYH/8QAJxAAAQMDAgYDAQEAAAAAAAAA'. -'AQIDBAUGEQASEyExQVFhIjJxFSP/xAAWAQEBAQAAAAAAAAAAAAAAAAABAAP/xAAZEQADAQEBAAAAAAAAAAAAAAAAAREhMUH/2gAM'. -'AwEAAhEDEQA/AO4BLEiEy7uG4IGxxs5IOOx76wd2XYidSp1HoD70240gcNNPbDyI6wQQpaz8E9MczkdhqtbsKYLieDk6WLKmZmmL'. -'Hk7AHVkbkLI+RQc7uRxgkfr1tx2rGu6VbToLVKkhU+kbugGf9WfaknCk5ycaX0zmaa+3JkqvW/CmzojsB9xoF6OoFK0r6HOcEDI0'. -'aefTuKX5ScMdC14HYq8n12zo1DEUcKTGg1Z+hyBwoPBVIiA/VQyOIgedhUCB4WMfXSV3UufVLcTUIqVf26K6mXDbPVRRzKT54iMg'. -'+zjtq6mtsyJjclxpKlUhSXEbkgkqWnBx4+J5e/zU0pZemPvJJQzEPDfQOrwwFY9AZ5eeYPLV6FwhoFYZuigxpkJeIjqAeIoAk9wA'. -'D46EnuD+6Nc1smDNrTlRkxqtMo1vzKhIdYgU9YDqVpISrLhHxSSd21I0aYyqP//Z' ; - - //========================================================== - // li-small.jpg - //========================================================== - $this->chars['i'][0]= 639 ; - $this->chars['i'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABwAGBP/EACcQAAEEAQMEAgIDAAAAAAAAAAEC'. -'AwQRBQAGEiExQVEHExSBFWFx/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgMB/8QAGBEBAQEBAQAAAAAAAAAAAAAAAAECMRH/2gAMAwEA'. -'AhEDEQA/AE7c+5M9BeRG29t1WUfKFFYW+GvrI7WD3B9g140YD5T36rcErDjbUR6dCBdejsKUpxITXI2FUrooCh70yvxzHyIlMvuK'. -'eVSH7IKEpJoKqu/ahddLryR/aMiO187bsmrWShhp1AZS2XHHrWhNJrzdf7f7GiVcHk3sptmHkJcJ2DIftS2FrKlJPXudWuLGYeQp'. -'t2fmEIckqIZaaKuSGG0lQ4gduRoFRHQ9AOgs2lOJbk9aSUlpjGvAWeSVH2VKq/2dFPw3IjyJe8s281ct3I9UoHJXGiQkD2STrSZ7'. -'Yf8AOl7JTdw5eOCz0jw3+LbYCfA9nz71msb8KMxoTGTw+5srjsipAdDqFBQBIuiOl6KrdYyJMyTCshlw2G3Fr/HiNqNNAqJJUoGl'. -'KND+h47km1bZwsvCbYYjycxIyK1qDv2yEi0hQviK8atKDcy9j//Z' ; - - - //========================================================== - // lp-small.jpg - //========================================================== - $this->chars['p'][0]= 700 ; - $this->chars['p'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGgAAAQUBAAAAAAAAAAAAAAAAAAECBAUGB//EAC8QAAEDAwMCBAMJAAAAAAAA'. -'AAECAwQFESEABhIiMRMVUWEHFEEWIzIzcYGRocH/xAAWAQEBAQAAAAAAAAAAAAAAAAADAgH/xAAcEQACAgIDAAAAAAAAAAAAAAAA'. -'AQIxAxESIUH/2gAMAwEAAhEDEQA/AOh703xG21DMeOyqoVNDjSzERiwU6Ep5qtZNycA97HTF13d33KWtmlt9xwkLl1NkXVxIuQgK'. -'wLj+hqBvel0qmbR8GnR22nJNZiLeeKr8nDIT1OLJucX+uPbWom7iocRpafOac5MX1ALltp/Cbi+cJH++utdh+WVNL3PNdNYpdWgx'. -'Y0qmLZSrwJJcQoOJ5XKlJFu4HbJOjVbt+V5nu7eopNRivqcdhK+bFnWwA1Y2AOcgjvj9dGlxy0g5y0xd+hNXoG24C4obizq3HZUh'. -'YHqtRHD06bG/8a0MbbG1mqekxaBSGmgkrcdcitlLfrckZIz7DUatbeFak0tyRLUwzT5vmiGm0cufEkFBJItfkD+59tKmiO12atFa'. -'eQukO3ejUxgENqTcfnE5WbkHiOnJ76N2IqI1DibabptS+zkZhtp90F2Y0S026EkAFK/qL46cXv65NVZDfxHmVCK4DE2/RX/lRFbA'. -'C5LwAyq2EtpHZI7mxPYDRqoctdESimz/2Q==' ; - - //========================================================== - // le-small.jpg - //========================================================== - $this->chars['e'][0]= 700 ; - $this->chars['e'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABgDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYEBQcB/8QAKhAAAQMCBAUEAwEAAAAAAAAA'. -'AgEDBAURAAYSIQciMTJBE0JRYRQVFoH/xAAXAQEBAQEAAAAAAAAAAAAAAAAAAgED/8QAGREAAwEBAQAAAAAAAAAAAAAAAAERAjFB'. -'/9oADAMBAAIRAxEAPwDTszvhEYCoS80BTm2bCjQRwdAzVe2yopkpJtpRUVfjEIc4V2oMerByg5Ji30oMyS3GeMunK0upfnu09MdJ'. -'p2scTmWnnGfx6HThktgLfKj7xEOqyr7QBbL41LhBzpxbcOru0LKDLdSnOHoaltNqSC4qWL0x9xbJYum69caczSaHmGmTmpDUYn4l'. -'UiqjkynzAVtwV23Ud+X4Ibpa2DCPkjhfUaRO/p8yzpb+YHhUmhbev6ZEll1lvqK3jt2XrbBgp6HVwsK3THpfEubGSoOUyFMpbJmL'. -'Deh6SgOGKti57EuY6l62JMWdJy7k3hg1LkOozEbVm7suQSkTiKtkEfP1pH664Za/QItccgI4bseTHdNxiXHLQ8yVl7V32XyioqL5'. -'TGc1ng6eYs0idczXUZscBBABWgEhEtfKNuUezwPnBhEuj8X2M21z9BR6NUX211Kk/UKKAjuhkPhL7XVf8vtgw7UPJlEyrDWFSYLb'. -'LBNF6qrzG6t0spEu6+fpL7YMXhUndp//2Q==' ; - - //========================================================== - // la-small.jpg - //========================================================== - $this->chars['a'][0]= 730 ; - $this->chars['a'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABoDASIAAhEBAxEB/8QAGAABAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwIFAQcCBwAAAAAAAAAB'. -'AgMEBREAEiExQQYHFBUiUXGBE2EyQkNSgpHh/8QAFwEBAQEBAAAAAAAAAAAAAAAAAAMBAv/EABkRAAMBAQEAAAAAAAAAAAAAAAAB'. -'IQIRMf/aAAwDAQACEQMRAD8AfdQ1pxjqZMSn0mRUZRYDaklJCE3OawO2ttTxY4hl07qFMVs1Ku02kpPnRGhsAqz8W9T9wDjozq6o'. -'Q1lDrcZLGVcmUoZg0obpufxK3Ftt9ccqB1GgBcmLSqtVEqOZcr6ARm/kbXHt7DEtc7WTJKTJqEWvRKfLqL9QplSjuPtGVYOJKBrm'. -'t+U+n94WGStZzNypmRWqckUKTbixy6jAfxPxHtCgKqFNlU5huK6pLMndSlegG4J45N8aKmTMKQRBsCNMzwB+RbHWHGEAZlPZX2hx'. -'qZIC34ygZoYUbB50JSkFXFhZR9BrpheR4fIbQ6gvurJ7q02bIQTuAOAN8x40HAxRr3TrNRpBmSHVt1KMlTyJTCsqkKAPlSf28W+c'. -'UGaD1c9HSR1HFUh9tJU45EBcAtcC9+P9wqbg8IAto9o81yputrVGpiUkgHKkqUTZI32+cKm1z1tIUgPBBAKQ4UBQH3uL3xmXSXep'. -'HVDtXStE5K5jlPU7PF3Q41+okJFkjgC+3OuNSYiSzHaLtRcW4UDMpLYSCbakDW3thhum5p//2Q==' ; - - //========================================================== - // d9-small.jpg - //========================================================== - $this->chars['9'][0]= 680 ; - $this->chars['9'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. -'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwP/xAArEAABAwMD'. -'AgYBBQAAAAAAAAABAgMEBQYRABIhE1EUIjEzQUIHMlJhcdH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAQD/xAAYEQEAAwEAAAAAAAAA'. -'AAAAAAAAAREhQf/aAAwDAQACEQMRAD8AkK7brF6X7XpMeGoKhFMLEeT4ZUheEhanF4OcZ2pTgDykk92bZpdCsi7aezLjxkIPUZiV'. -'RSCy8hah7EkZ27yM7V+iscal5bE22Lon1qNDmSKROd8Sl+Ix1lMOlIS4HGgQpbStoUCnlJz8HmsXtW3Lst2rmBAelLMRRekOwnYz'. -'Edls9QKKnOVLyk7UgcbzzrdBthqEJJwZbAI4x1U/7o1TaFa9lG36aXaZTy54VrcXUgrzsGdx+T30aNydweqVw1GS87T6Lb86Q4ha'. -'my/IAYjZBx+snKk99oOQMf1AViE65SY348hzFy6hPKnqtKz7DC1lbqyPrvJKUJ7H+M6Wrt3InP7o1brFNp4bCDGhxGAsqz69VSiQ'. -'ORwBxrrQ7itm1ac7Hp0WoGTIc3PSn0pccdcP2WorycfA1RaRHjxosZqOyhtDTSAhCf2gDAGjVHTd9sKSCumynFEZK1tIJUe58/ro'. -'1V1//9k=' ; - - //========================================================== - // d5-small.jpg - //========================================================== - $this->chars['5'][0]= 632 ; - $this->chars['5'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. -'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgIFBwT/xAAoEAABAwME'. -'AQQCAwAAAAAAAAABAgMEBQYRABIhIkEUMVFhBxNCgaH/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAv/EABcRAQEBAQAAAAAAAAAAAAAA'. -'AAABEUH/2gAMAwEAAhEDEQA/ANGvW4YVOeiRX5b4mv5Sin05IdlupPKdo/j2SO3+6TbPNQvOsTVz33KRT4csR3YUF7Dsh5OSFvug'. -'kqG4FPBxnjxpvvi4KZb1pTpU+QwxUi2Y7ZIAefUk5ATxnB9/gbtL/wCH1UpuhPUlZlMVaQ0mS8zJjqZOPfc2TwpIUonI9tw40R1r'. -'WNGq/wBdJR1XT3lqHBUnGCfkfWjRWs1ve249erQqQYjOtN1FqPUpCXQ4WIzQSsJwT0UpRwQPG0nzqyuNHobjsl9kBuWqoOoXtT1/'. -'WppZcA8lKRj64HxqU+3KpAr6plElRVKef3S4E0K9O8pLXVzKcqSsJAB9wSAca6bSoNXeuA1+5pEV+SGFNU1iKVFqI0Vdx2AJUeoz'. -'8DGlTDwG3CAf3q/pI0ah6MDhLz6U+EpXwPoaNMU//9k=' ; - - //========================================================== - // d1-small.jpg - //========================================================== - $this->chars['1'][0]= 646 ; - $this->chars['1'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. -'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEwMBIgACEQEDEQH/xAAZAAADAAMAAAAAAAAAAAAAAAAABQYCBAf/xAApEAACAQMD'. -'AwQBBQAAAAAAAAABAgMEBREABiESMUEHEyJRkSNCYXGB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAQEBAAAAAAAAAAAA'. -'AAAAAAEREv/aAAwDAQACEQMRAD8A6jdd4WLbstILnc4Uq0VoWpkJknb6IjXLHJUePOlez923fcW4r1SxWlqC2UbdKirQif3Xw3yA'. -'OFAGT09/kO3OmV3a20MFRf6lIYPcpy7yRRAzgxjIy2M8YwcdiBzpX6d22VNvUlTXsFkuwkrKqNSfnK7F8OTzwrAY+l5zoxKskudN'. -'EgQPUT9PBkWF3DH+1GPxo1mLnRoAqF2VRgGOFmX/AAgY/GjRUP6hVMFv2FuFqUvUGrpDFJMBnpdyF5bsAQew7Hxzp6LZNT0yQ1DI'. -'wp0QCFBhD0jCsfLZHxbx5xxpTuvb1+v9PV7Ztk9roLPLCjmSSN3mX5ZwqjCgZX7PfWxDQb2in96pv9qq46aTE0bW4x9ceAWAYPwS'. -'PsYzoixgmheBGjIVcYCnjp/jHjHbRpe1JLn9OnopE/a0ykvjwDx47aNMXqP/2Q==' ; - - //========================================================== - // ll-small.jpg - //========================================================== - $this->chars['l'][0]= 626 ; - $this->chars['l'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYEBQf/xAArEAACAQIFAwIGAwAAAAAAAAAB'. -'AgMEEQAFBhIhFEFREzEHFSIyYcFxgZH/xAAXAQEAAwAAAAAAAAAAAAAAAAACAAED/8QAGhEAAwEAAwAAAAAAAAAAAAAAAAECMREh'. -'Qf/aAAwDAQACEQMRAD8A15Zfm1VURj1Fp5AqLKv3OARcL4W5Nzx+MLWjdRz5hqXU6TSb6OCr6WghiQbrJ91gOTy1yT5xZ55myZFk'. -'Gb5ozX6Ondm28XYqpQDwu7jEH4c5S2UaDy4xxrLmlUDWzk8XaQ3O49hbj+RiB85HNg8Ee3aqwIqhDuux7G/HHbvzgxEqaWOvy09R'. -'O0o3hjdQoUji20g+fY3wYSM6pJ4Ylr7V+Zz5PSaezHTlTRNWzxySSxt6q1MSkH6AOT2Fu3Aw7RfF/T9DEkLUeawuF2mKSgdWQj2/'. -'q3+fnDZDlqRZzQGaOGcpTOaeR1u8R+ncN3gj94so2jNWHeMNNKzorEX2qp9v3imNPoRE1zpjUtZ09HJmYq5lury0benZeTww23t3'. -'Ivgw+T0yRRyyxIqNfkLcA8jt7YMKcBWn/9k=' ; - - - //========================================================== - // ls-small.jpg - //========================================================== - $this->chars['s'][0]= 701 ; - $this->chars['s'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAAMCBAUGB//EACwQAAEEAQIFAgUFAAAAAAAA'. -'AAECAwQFEQAGEhMUITEiYQcjQVFxFRZCUoH/xAAWAQEBAQAAAAAAAAAAAAAAAAADAgH/xAAZEQADAQEBAAAAAAAAAAAAAAAAAQIR'. -'EiH/2gAMAwEAAhEDEQA/APWZMhmFXSJU+SGmWFiQtAWMJQAnJUr8Z+w/OuQk71uZnMsqnbjy9s8st9UMCQ6kZJdZaIHEkZ/JHceN'. -'N3HtizuY1JLrG48yLBSC9UTFKQiY4nACir+wAOOMEe2rm2bTbzlqtE1MyBuZAPybpw85KSfDRJ4Cg+Pl/wC61hJeGjV31VuuKqwr'. -'LGU+whZZK+Rw+oYJAyj3GjS4dZFpZVkqPLktdfMXNcaU2kBC1BIITkdx6c599GlnvPAa3TL2vNvU76n0063acr3YSLCEjpUpUQtW'. -'Dhf14SMEnOc57aZ8Tegm7dbrEQGZt1PeTDgc1PEW3FeXAvyAkZVkeMDOm2G3f3O7Cl/qEuqkQg4lp6CRxraWfUlRUD24kZA741Ko'. -'2k1HvlT3ri2sLOCgtsyJz6XEtBwZPAgJAGQMHUNPWKqWItsqh0UCFVyLeKhyLHQ2TMdHNVj+RKlAnJyfto1FW2ahgjrq6LYTFjjf'. -'lymUOLdWfJyoHA+gA7AAAaNPE3ysJdLT/9k=' ; - - //========================================================== - // lh-small.jpg - //========================================================== - $this->chars['h'][0]= 677 ; - $this->chars['h'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGgAAAQUBAAAAAAAAAAAAAAAAAAIDBAUGB//EACwQAAIBAwMCBQIHAAAAAAAA'. -'AAECAwQFEQAGEiExExQiQVEVggcyU2GRocH/xAAXAQADAQAAAAAAAAAAAAAAAAAAAwQB/8QAGhEBAQEAAwEAAAAAAAAAAAAAAQAC'. -'AyEyMf/aAAwDAQACEQMRAD8A6DZb95q9bmpK6ieOCzNHJTxmE+NMhQ5fr1fLq3Ejvkak2e7ipiFsqb3R0m4qkPPJRiRXenU9VjKE'. -'5JVcA9R7nWc3/BUbfoKTdO3VRXhpjbZ2D8Rwk6RyZH6chB+46m7i2hDYtgA2ePlV2VkuKysoLzzRnlIScZJZeeevvjtrX7LK2rp7'. -'tTwwJ9WjhILDrTKnIdMEDl2+P80aVdJZb1QW+vgqENLPH4sBCDLIwUgnOf4GjVvDnLgUk79T81voqjb8NnuUx8pVRCiEaYUSuynl'. -'jHU9mOfnOoOx6hqz8PrbNdfEkMUXg1LSM3rKOUywJ7YAJ1ZTWmSpvdvlaVTDSUzJAhH5ZJBgv0x2RSAPlz21WXqoet3ba9nuW8n4'. -'Jr6qTPqnUNxSM/f6mPvxA9zqJnExTbR+h0nkhVu1uE8j0UBRQ9PGxBKFjnkAScdsDp10a0lc7z0tI7Y5YYN+5GAf7GjVXF4Icj3f'. -'/9k=' ; - - - //========================================================== - // ld-small.jpg - //========================================================== - $this->chars['d'][0]= 681 ; - $this->chars['d'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQFBgH/xAAsEAABAwMEAAQFBQAAAAAAAAAB'. -'AgMEBQYRABIhMQcTI0EUMlFhkRgicaGx/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgEA/8QAGBEBAQEBAQAAAAAAAAAAAAAAAAECETH/'. -'2gAMAwEAAhEDEQA/ALUhp6h3W/X63UlypbhCY0WMjLqGzwDtPCfv/WtealNpVInuVBBqCogcdbU36YUkAkJWVHG8YPXBxxzxqPcN'. -'YtWyWnIlUeW05VEOAvrCnnSkftK1H5lKJPHsMDoDUWq+KdrSbIqsalVsImiEtLUZ2MU71bcYJWkhZ/36ayLHhi/IXZVOmzKqp5uU'. -'688hTyjuGVEFJKvoQesD86NL2jGZp1EoLDSmk+ZAQ8d7oPzp3YGesFWMfxo1YGvSzLsT9QExVX8phTlMaFOExAJIBGQjJwCcL+/e'. -'rd+W7GuO0Kw05CQ6+ww69Gfdb2kFIKk7DgEkjgnr86rXRa9HuyP8LV4SH0sIBbWFFDiFEgDaocgdkjo8ccay0qw7ut5nyrcviQqC'. -'slsRKo0HwlODkBRzxj2AGoXTtpzIdQ8MbffUChz4NCPRaClAo9Mn6c7T3o13wytmo0K05VIqkiPJbizFiMWs4CTgnIIHOST796NL'. -'Ia1JX//Z' ; - - //========================================================== - // d8-small.jpg - //========================================================== - $this->chars['8'][0]= 694 ; - $this->chars['8'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. -'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AFQMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABgcEBf/EACsQAAEDAwMD'. -'AwMFAAAAAAAAAAECAwQFBhEAEiEUMVEHE0EVYYEiIzJCsf/EABYBAQEBAAAAAAAAAAAAAAAAAAIAAf/EABcRAQEBAQAAAAAAAAAA'. -'AAAAAAABERL/2gAMAwEAAhEDEQA/AKL6gVVUa0i1T5QjvTprUJMlxW4R9zgQXe/AH+kaWrntqlWjaq7gpcmotXAw82ht9yY4tch8'. -'uAFC0k7VBXPGMY51ruiaue+bThIj+7NbWqS+7HDxajFf6AlB/k44o8ZOABk4xkL0X0tZiojKrlRuGRJjugqldSlKGf6t7BuUQe3J'. -'44xxxrA1a4KVJipLidri8uLHgqOcfjOPxo0o2hdDvS1CmV2Yl6fS5ioipIQR1CAlKkLKR2UUqAI8g6NRSwuuyHab6s1ufLI/Zai7'. -'UBJOxhTS0+6B32pWSFH4CidOdWU0ukLiN1BLr0zG5Sdm3GRvcPhIT858DvjXNrVsSLnm/VIdTXS6tTnFsxZTSN3jchaTwps+O/z9'. -'tcBVq3hIX0tYqlIiQHdy5CqRHKHXEjAOMgBKjnvyRk4xrQa7OiGt1K5biYZL8SoVEpjOqkFsONtJCNwASeCQrn7aNUKnQYtLp7EC'. -'EylmLHQltptPZKQOBo1FzH//2Q==' ; - - //========================================================== - // lz-small.jpg - //========================================================== - $this->chars['z'][0]= 690 ; - $this->chars['z'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABgAHA//EACsQAAEDAwQBAwIHAAAAAAAAAAEC'. -'AwQFESEABhIxBxMiQVFxCCM0UmGRof/EABYBAQEBAAAAAAAAAAAAAAAAAAECAP/EABgRAAMBAQAAAAAAAAAAAAAAAAABEVEC/9oA'. -'DAMBAAIRAxEAPwBTWfLu1KXXZDbM4uewNvLajlwhaCbBAwDe5uehYd3xm6t6bi3jvulwqc7KgxXZZeYQLNLeF73WRg4HEdgfzrSa'. -'P45pNEkznITDc9ypLShtyWhJDJyXC2qxJHZvjoZOjyVv1v8AESt6FFS4ijxvTLbawEApSccrYHJf0+OtJMQ2rNXk7GZMufJgJjTH'. -'Un9M4qzxT7hyCiThIyRnPXWrRvyLElVBUF6vlhl0lwRYCFKcQhAtyWpVhyWTx+w++rUvp4EWjOvbniUOnVatcS43BYDbJSPZyIBw'. -'ejclIx+3Wa+J63T6DQanuGszI0eZVJJV60p0Jum5GEi6le7l0PjvSjyRsaTvJqI1BqhhR46ksuMrQVJcUSEoUbHNr/7o7C8L7eiz'. -'4lLlyJk2cEqW+6V+m0AE9ISLnsj5+O9UhsFK92bZZqb9SRu9p2c4A0OCEqDbYAJSlJwAVZv3fBvbFrg/462btlhuS1RG5nL8pYkq'. -'KrnsKH06I/rVrQKkf//Z' ; - - //========================================================== - // d4-small.jpg - //========================================================== - $this->chars['4'][0]= 643 ; - $this->chars['4'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. -'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABAYHAv/EAC0QAAIBAwQA'. -'BAMJAAAAAAAAAAECAwQFEQAGEiETFDFBUmGBByIjUVNxobHR/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAIB/8QAGBEBAAMBAAAAAAAA'. -'AAAAAAAAAAERIVH/2gAMAwEAAhEDEQA/ANjM00Nxmt1xiWW31CZp5uJwoAAaOQ/n7qfcZHqO5my3q5XX7R6ijiqnNut9u4NyJ4yv'. -'JJyjYr8Xhrn5g599J7x3ulBNU7Zo7dXXXcLQ8kURYi4epYtkALjOePv1nUvbLvV7P3BZm3DR3eh88Kp7pVzBZI6iUhGWRRGWwE44'. -'HX3V+uiL1uHgt+vL/H+aNJQ3CSeCOaFqSaJ1DJKs/TqRkMOvQjvRorHE4pRDLNWLGlRHGUeYIORXs9e5B7OP31E0fmdyb/t0DJ4Q'. -'27bfx3YZzPUIoAAz7IpOD6cuxq0uNumqLfVNDOqXBoZEjnZcqhIPXH4c46+WkdoWOltu3IDDLLLVVR83UVcuPEmmcZZ2/rHoAANG'. -'GI7KIY1ijoLeEQBVCwIoAHpgY6Hy0aZe7mJ2jeHLKcEhusj6aNKgzr//2Q==' ; - - //========================================================== - // lv-small.jpg - //========================================================== - $this->chars['v'][0]= 648 ; - $this->chars['v'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQDBQYH/8QAKBAAAQQBAwMEAgMAAAAAAAAA'. -'AQIDBBEFAAYhEzFBEhQiYQdRFTKB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAQEBAAAAAAAAAAAAAAAAAAERIf/aAAwD'. -'AQACEQMRAD8A6Ngt1SZ4yrYgrecgTFsFJA9aGwAUrUaF2D2Avjzq6CIjiBPkB9bwQVIkIYIDae/wq+P9N+dY4SGMf+Txlev7KBmY'. -'PoadKRy4zxSgRxaTwO/x09u7KPYnasmHjlsyFZZXt4K23ezjvBpNGgLUrvXfVZyLLbWambiwEbKvvxYAkeotNlIJW2FEJWb7WBda'. -'NSQI0fHYyJjkrjKRDZQwnpQ1vgBIr+w8+a+9GocZr8iKkuY1eXhsKH8U8iZE9BHz6ZHUc48UfSPqzqH3kfeO9kTTDQYGGietpTaO'. -'shyW6AocpHNIrv8AvWzk9BUSdPdYS4BcRlomkhIV6KP0VE39V+tU2wdlRMHtZUB8NuTQ+51X27+Kr46ZPIAFV540D8zeLsJ5LMHa'. -'ubmMBCVJdjx0pRyLoWR4I8aNIQ8BvZMNtMTeUcsptKfc4tC1gAkCyFC+K0aJtf/Z' ; - - //========================================================== - // lk-small.jpg - //========================================================== - $this->chars['k'][0]= 680 ; - $this->chars['k'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAAUGBAMH/8QALhAAAQMDAwIEBAcAAAAAAAAA'. -'AQIDBAUREgAGITFBEyIyYQcVUYEUIzNicZHx/8QAFgEBAQEAAAAAAAAAAAAAAAAAAwEE/8QAGxEAAwACAwAAAAAAAAAAAAAAAAEC'. -'AxESMeH/2gAMAwEAAhEDEQA/APVK/V36dU6NSJDTT8esPLiqfK8S2cCoeTkKvZQ6jm2ldSqKqbu+OgMOvSX3m4UBrLnDlbqiefKl'. -'Nzz2x1m+IwNP27CkJQ7JkR6rCkMJbP5jp8S2CPfkgD6H+dJ6Ca0nerr+64rTNSqMYrg+C9mmOwhVpDfsuxSbi97DmybaoZeQ5jTl'. -'PEp18JTIfeW3kq3ly4H26aNZqvTWZsjFcZTsVtSg0G8Rio+vr2vb7g6NLPRnuXy8F+8kl+obUh4KXJdqSJJQnohlkZqJPYBXh3P+'. -'a4b5Hyp6k1bO7sOotPyXkj9NlwFl0ewstJA9ifrqkVSmET4csoS7UTHXFQ+6SQlskKUMb/tH9ddLVUmS7DqdBqD7U6OsqfS46jzl'. -'hQ5bXb1K9Scuybdxo2OTu92dwSZkWn0Sb8viQWyn8Qq5D6ifSLd0BIv7q0arTBRSKPToMZbi2GWylsvLK148Wue/XRrRjxOpT2R2'. -'k9aP/9k=' ; - - //========================================================== - // lr-small.jpg - //========================================================== - $this->chars['r'][0]= 681 ; - $this->chars['r'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAGgAAAgIDAAAAAAAAAAAAAAAAAAYCBQMEB//EAC4QAAICAQIFAgMJAQAAAAAA'. -'AAECAwQRBQYAEiExQQdRFGFxEyIyM0JSYoGC8P/EABYBAQEBAAAAAAAAAAAAAAAAAAEAAv/EABcRAQEBAQAAAAAAAAAAAAAAAAAB'. -'EUH/2gAMAwEAAhEDEQA/AOs0ZdETU54Gt1INSmlPJEsyo7J+jlXPUYBPY9c+eE/dO9tY0a7ren6BVrW7VJTZtW5kZkjXkBSIKveQ'. -'gHp0AAJ4w+q2hVdT2Md0h46+saS4mr3EUK0gWTAB+vQj2PboeL/ZVOqmhaZVjkFmxdC6tctt3tM2G5/7bAx4C4+qxiWwd3prWzKe'. -'r3IBAth5OYxozKsgc8y4GTgnJB9uncdTi6tXq2140rRVM13JMEMAVAg7sMdBjJB/18uDgRO9R2Oo6FX2vShkFzURFUq1whIj+8DI'. -'7EdAFjXv7MeNb0kuStsFEmIaajZaos2fy2Q4VGH7SGxn+Rzw9yMLOm/FzRhZazmOTkP4grYyD3B8j2PTyeFfZ+z7G3BeSS8lmprl'. -'2K2qcnK0Z5S8gPjrgAY8cNEWmq7u23pEos6/Zji+Kd0rLLGWwseA3joeZj/w4OET1g0vlmrWV+ydFnkUxSgsvM4V+YYIwfHz6cHB'. -'ZeKZ1//Z' ; - - //========================================================== - // lg-small.jpg - //========================================================== - $this->chars['g'][0]= 655 ; - $this->chars['g'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQCBQYH/8QAJxAAAQQBAwQCAgMAAAAAAAAA'. -'AQIDBBEFAAYhBxIxQRNhcYEiQlH/xAAYAQACAwAAAAAAAAAAAAAAAAACAwABBP/EABkRAAMBAQEAAAAAAAAAAAAAAAABAhEhIv/a'. -'AAwDAQACEQMRAD8AayO4t6bq3hmMHtxyLi4OKeKH5jyASiiQCCQeTRNAeB61FrBb+jTGpLO+BMW24EFMhkhpQru8m7B/H70x09Yi'. -'q3nv/vLfwpnJ7UNkqSRbngf2ofWkpXV7brymC2malLfagurjW0aHk89xPJ9cX9aprURHWbYEaMHHEBfwpv8AnXPk+/8AdGqGJOxO'. -'4YbOSxK4y4boIStUWysgkEmxY54r60aOI8oTV9MHtjJwunPUbO46WWo0HLlD8KY4goboFVoquOVEVwLT963WdnxYfT6ZJyz0JvHm'. -'KvtaSkW4tYNVSqKiTwB+fw5n9sY/cuOXCzDDcluyW3Ckd7V+0n0eNZTH9DdouFalHIOJBUhtDki0pNV3UALo81ehG6IdKjPZ6d47'. -'4ywltanVJvuJI+RQs/sHRqy2r003JhsImEc/CUyhxRZBjKV2oJ8eRXNmufPnRo1WIz3DdNn/2Q==' ; - - //========================================================== - // lc-small.jpg - //========================================================== - $this->chars['c'][0]= 629 ; - $this->chars['c'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAAUGBwID/8QALRAAAgICAQIEBAYDAAAAAAAA'. -'AQIDBAURACExBhIiQRMVUWEHMkJScYFykaH/xAAWAQEBAQAAAAAAAAAAAAAAAAABAgP/xAAXEQEBAQEAAAAAAAAAAAAAAAAAATER'. -'/9oADAMBAAIRAxEAPwDcoGkmiT4Q8kWvzuPU38D2/v8A1zwrCFayq1qTaFk2H7aJHt05MeMvENzC4upDWkjW9kJXiricAJCigvJN'. -'IB1IVQT5frrv24twPgunk6a288crbklUSJNNdnSTZ2STHHqOP/Eb17njdZtAoqwEvrEiGVyG117/AG6HhyV8H1sljMldoxXTksGC'. -'zV7M0oaWGQOVeGQ92I6EMR22D11w4LmEPjaOL51iL8ssc9Z69zHtZkYCGGeQK0ez2UEoU39wCeX1S/LLiEt+mPSbMLxsGVv2kEjR'. -'305xkaEV/GTULMUT1LD/AAGh8gIZS2jv+vpybb8NMIb0dVLWYWgiiU0vmMphOj6V0TvQI3rfsON1E6dYjGtisa0F1mAWR2NhG0WZ'. -'3Ls3TqNs5Hc9h23w49NWL9K+Q/VD5T/zhwPH/9k=' ; - - //========================================================== - // d7-small.jpg - //========================================================== - $this->chars['7'][0]= 658 ; - $this->chars['7'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. -'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgEFBwT/xAAuEAABAwIE'. -'BAQGAwAAAAAAAAABAgMEBREABiExEhMiQSMyUXEHFBclVJFhk9L/xAAXAQADAQAAAAAAAAAAAAAAAAAAAQID/8QAGREBAQEAAwAA'. -'AAAAAAAAAAAAAAEREiFR/9oADAMBAAIRAxEAPwDXq9mCjZeQ05VZ5ZST4bfEpa3VdglCbqUe+g9MZ5Uq7V8415WXoMSdQ6etgSps'. -'19wpkCMDZKUpv0FZvbi1NzpYasMDLDUbMVXrtQdbeeU23xLWkj5RlLYK0J7anW9gbAjCzkOtsVSUJUdtc6dVZK51UeaFm4LKbhpC'. -'l7EhIFkDW974GbRI2XorUVls1OTdKAOqUpR0Hc3198GITQ6k+hLwrEpoODiDenRfW23bBicg78JXxPpD0mgVOW5PAivNNpahsPW5'. -'8xxQaSVkboQnhsnYm5OHqDGp1IpsalMKjMsMIC3+XZKbJFth62/QOEfMOZqZXp9JcKZTcGmTky3meSi7xQklI81vMR+sXIz/AEgp'. -'Q0qPNu6ea8Q2jqtbp8+2w9h/OKORc/cpHjt1dDSHOtLZ4ekHW23bBjj+o9H/AB539aP94MG0+L//2Q==' ; - - //========================================================== - // ly-small.jpg - //========================================================== - $this->chars['y'][0]= 672 ; - $this->chars['y'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQGBQf/xAArEAABAwMEAQIFBQAAAAAAAAAB'. -'AgMEBREhAAYSEzEHIhQkQVGxQmFxgaH/xAAWAQEBAQAAAAAAAAAAAAAAAAADAQL/xAAeEQEAAgEEAwAAAAAAAAAAAAABABECAxIh'. -'MUGR8P/aAAwDAQACEQMRAD8Ar3tys07dVHohemz5dWQ7fk91MsA3IIRY8rkKFySceTqw3JVV0KhyKw+0C1CQp9aUOFSiAk4AIAvn'. -'76xtz0ioVvbcJ6msx2JtOfZmw1PKI5LQcJNh7UqBKcn6+NRfqPu6s1fYc6GxSJsRfWDUVSGA22ygEckJWSexRNgOP0udXzDKOJ0I'. -'yo62mHm25Sy80l1Z4lSgpQvZRGLgWwPGjTjbchyLH+Ejx22EtJSgO8kki3kADA/nOjWjGzv73CyQZjUWNVp7bNSrj7qJDqflqUlQ'. -'DMds24l3HvcNr3Pi9gME6T9WWVsemdYWswwC2lPta4m5WMA3OdUExCmozUJD6g84ntMjrHIFBTdQz5yLDx/WDNytpwW6nAkViqVe'. -'uvmXdlme6n4dCwlRBKEgA2tj99QG7Ilncp5QqpU31PMsJ6x7A32f6SPxo0hPVCD45oVyKf0MtgeT97/nRrO7UOCFla3tn//Z' ; - - //========================================================== - // d3-small.jpg - //========================================================== - $this->chars['3'][0]= 662 ; - $this->chars['3'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. -'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwL/xAArEAABBAED'. -'AwMDBQEAAAAAAAABAgMEBREABhIhMUEiMmETFZEHFkJDUdH/xAAWAQEBAQAAAAAAAAAAAAAAAAABAAL/xAAYEQEBAQEBAAAAAAAA'. -'AAAAAAAAEQExQf/aAAwDAQACEQMRAD8A0vclruBdk3VVLLUNssGRJsZSCtqOjlgJAHvcOD6c4HnOdIbcttw1W5P29cFEhuawqTXS'. -'VsJjnCMBxKkJJx7goAde+ceJfdNxU0UNlyymyXHi6kxWUNl1S3EnkAEIHX2nv86qtTuZr9Q9+1VhRsOoYpYcgSVyAE/TdewkJxnK'. -'sBCjkdPGpnOtFMd3PqsXgfOAgD8Y0aX+11H9rDDjn8lr9yj5J+dGqsqxaw6Cc9cQZU4Sp7zTJsIrKlcUEKwhSin1JABI45GUjqOu'. -'lbOvjbc3Ts9ynjGCy445UuFLYRzbWgrT6fhSCQSMDke+pew2zYVly/d7YchNqkMJZnQpgV9J8IzwWFJyUrAJHYgjvpLbu37G5nR7'. -'vck5C3YRKYEOEVJZj8kjKypXqWvirjk9h+dB9i4faa89TDZUfKlIyT8k+To10a6KTkpcJ/0vL/7o0TS//9k=' ; - - //========================================================== - // ln-small.jpg - //========================================================== - $this->chars['n'][0]= 643 ; - $this->chars['n'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGwAAAgEFAAAAAAAAAAAAAAAAAAYCAQMEBQf/xAAtEAACAQMCBAUCBwAAAAAA'. -'AAABAgMEBREAIQYSE0EHIjFRcWGRIzIzQoGCwf/EABYBAQEBAAAAAAAAAAAAAAAAAAMEAP/EABkRAQEBAQEBAAAAAAAAAAAAAAEA'. -'AhEhUf/aAAwDAQACEQMRAD8A6FR3p7v4oV9rlkMQsjL00RyOss0KkFxnDcrc2PbI1NOJKyTjW+W5OmKeA0UEJx5meRZS2/8AUfbS'. -'LVGS1+K16vCzfiR3GmoqqXGyxz06hWPsFlVMfOmq1iNvE69KjBYo3oJMZ3GKeYYPxg/fW+xzZX1FLQyxwSTcpWNceu4G3+aNSmpY'. -'qmQzzwh2k8yhv2r2H23/AJ0aoy+EWh7I1ntacR3PxDtEzhjWy0wkkIwYmanU5GO6sNh7rrU8AVdTceNbhDXxNHUQvS0tZ3DzwxVA'. -'fB7hj59/XJ08cPWaKj4gvlwSQiG7dCboqvLy9NOmQT9SM7ayJrBa6K5V91hjlWorp4JGUOAglRSiMMDb82/vgaBGTpVvtNUVtyJg'. -'5+WNAh5ZCu/r2+dGrgq0pi0DhmlRsSSAfqMd+b6ZyNu3po1Rk1yNBe3/2Q==' ; - - //========================================================== - // lu-small.jpg - //========================================================== - $this->chars['u'][0]= 671 ; - $this->chars['u'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYDBAUH/8QAJRAAAQQBAwQDAQEAAAAAAAAA'. -'AQIDBBEFAAYhBxMxYRJBURSB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAQAD/8QAGhEBAQEAAwEAAAAAAAAAAAAAAQARITFBAv/aAAwD'. -'AQACEQMRAD8A6dLkQmJzu3WVtHIqjf0duKFNuBr5UTQ45F1R8/XI1PMmsYoJyjhS9iI7BKHeKjkXZVXqhyLHP+rrHeR1pZlx1W1M'. -'wTiW0ukkrS28nn5fV2SPPFfurHUKQhzYG7pLYKEfyBhaSOS7dG/YCki/uvWn3LPDOJrwa4kyEzOYeakqkpC3Hk0bNePQHgDRpchY'. -'leIZwzUWauKtuPctTSUlCAUmrBHIKuAPV/ujQsmHdm7hya43UbbD3ZVElOQJsdTS6IQaQUqBHCk8E2Pocgam6oYwObHy0Zm0oi45'. -'T1KBPdpV2f0pom/1Ws7cmPazu98Ltvcq3VzRHfehz8a4pirFEKRZo8eQT+eCdWYfS/b+WYnxpbuVcDRMdHcyTqg2fiAfiLoi+Rf+'. -'jT7Xc74HtOYnHyUOh8yWUvKeHhy0CiPVUAPoDRrm+OeznTva6lzsyMjCYbbaiNJjJSWElagD5tRpNUSALFeNGoOCH7Bv/9k=' ; - - //========================================================== - // lw-small.jpg - //========================================================== - $this->chars['w'][0]= 673 ; - $this->chars['w'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYDBAX/xAAtEAACAQMDAgMHBQAAAAAAAAAB'. -'AgMEBREABhIhMRMUQRUiIzJRYZEWNIGx0f/EABYBAQEBAAAAAAAAAAAAAAAAAAABA//EABoRAAICAwAAAAAAAAAAAAAAAAABERIh'. -'MVH/2gAMAwEAAhEDEQA/AHXbV13ZLu6t2/uaa1JijWopVp4XUTKSAXRyc+6ehBGeoPbTSlwpql0K3GneqpZViqUhI5JzGMEZJGeh'. -'GlXfaFILDf7FQzXC426rDLTojs8sLqVkXBGcfKf40twWbdWzZY75R0s90ul3jPtKjVMJDNn4DDp8iEhW+wJ1WZG2KWt3Lv26U1tv'. -'92o7PaYkgYUbqVepYlmUBlIwqnB++O2jTDt/bBtth9jcpvEWNGqalZQryTlmeR8jPct6+mNGmRC4a1U13htzVFItB5nA/cyOUVfp'. -'7oz/ALqitJulYJKuqvFsppHALLFb3cp9FBaXr+O51bq0q6i38KK5PDVAAxSzU6SIpz3Kjjn8jUFoS7uFmut1gq17xLFQ+DxOccj8'. -'Rsn+tVpiyJnqv09YfOXu5AycgZZQEhBZjgDBOOgwO/po0sttWHdNzqLruioa4UwmdaC3kYp4IwSvJlBHKQ4OSe3po0qxM6P/2Q==' ; - - //========================================================== - // lq-small.jpg - //========================================================== - $this->chars['q'][0]= 671 ; - $this->chars['q'][1]= -'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. -'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. -'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAcDBAUG/8QAKRAAAQQBBAICAQQDAAAAAAAA'. -'AQIDBBEFAAYSIQcxIlETCBQVgSNBYf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAER/9oADAMB'. -'AAIRAxEAPwDT3H5Qz+O3LN2vtrF/y86NYLzzVlAABJITQPv2a/17vXMboz3lDEYWPuafNx7CFrS03+2jpK2bs0CUkUa7pRvrUu63'. -'sr438yv7pLEo4XIK5Kcji0uJUkckm+uQUOVH6GsnyJv7A5vaJwuFdkONLmolgONFH4vioKRXYqyCADXvRMh0yspmZ4jyIEtDTK47'. -'aiA0lQUopBJBI/7X9aNT7amRo228e3a31iO3yUzCcdSPiKAIFdCho0TIswZ7GQlO/hlRxBooih1YXzAoKUkX0LPEBX110dJ7zbuv'. -'AORpO04cIpmxH23FSEIRwKuNnsdk0o31702XhFMKbuRUZJWP8LTQ6HBCuIB+iVWSR2BXuqK93/hDlvGzEphmG3Ml5JpDi1I7TzNA'. -'BYFlPafY+/7LBiv1CYDH4iFDOGySlMR22lFP4wCUpANfL11o1r4bxXlWMNEaE/bqlIbCFl/ANPK5Do/M0VDr2Rf3o0TX/9k=' ; - - - - } -} - -class AntiSpam { - - private $iData=''; - private $iDD=null; - - function __construct($aData='') { - $this->iData = $aData; - $this->iDD = new HandDigits(); - } - - function Set($aData) { - $this->iData = $aData; - } - - function Rand($aLen) { - $d=''; - for($i=0; $i < $aLen; ++$i) { - if( rand(0,9) < 6 ) { - // Digits - $d .= chr( ord('1') + rand(0,8) ); - } - else { - // Letters - do { - $offset = rand(0,25); - } while ( $offset==14 ); - $d .= chr( ord('a') + $offset ); - } - } - $this->iData = $d; - return $d; - } - - function Stroke() { - - $n=strlen($this->iData); - if( $n==0 ) { - return false; - } - - for($i=0; $i < $n; ++$i ) { - if( $this->iData[$i]==='0' || strtolower($this->iData[$i])==='o') { - return false; - } - } - - $img = @imagecreatetruecolor($n*$this->iDD->iWidth, $this->iDD->iHeight); - if( $img < 1 ) { - return false; - } - - $start=0; - for($i=0; $i < $n; ++$i ) { - $dimg = imagecreatefromstring(base64_decode($this->iDD->chars[strtolower($this->iData[$i])][1])); - imagecopy($img,$dimg,$start,0,0,0,imagesx($dimg), $this->iDD->iHeight); - $start += imagesx($dimg); - } - $resimg = @imagecreatetruecolor($start+4, $this->iDD->iHeight+4); - if( $resimg < 1 ) { - return false; - } - - imagecopy($resimg,$img,2,2,0,0,$start, $this->iDD->iHeight); - header("Content-type: image/jpeg"); - imagejpeg($resimg); - return true; - } -} - -?> diff --git a/#jpgraph/src/jpgraph_bar.php b/#jpgraph/src/jpgraph_bar.php deleted file mode 100644 index cedc1836..00000000 --- a/#jpgraph/src/jpgraph_bar.php +++ /dev/null @@ -1,1190 +0,0 @@ -numpoints; - } - - //--------------- - // PUBLIC METHODS - - // Set a drop shadow for the bar (or rather an "up-right" shadow) - function SetShadow($aColor="black",$aHSize=3,$aVSize=3,$aShow=true) { - $this->bar_shadow=$aShow; - $this->bar_shadow_color=$aColor; - $this->bar_shadow_vsize=$aVSize; - $this->bar_shadow_hsize=$aHSize; - - // Adjust the value margin to compensate for shadow - $this->value->margin += $aVSize; - } - - function Set3D($aHSize=3,$aVSize=3,$aShow=true) { - $this->bar_3d=$aShow; - $this->bar_3d_vsize=$aVSize; - $this->bar_3d_hsize=$aHSize; - - $this->value->margin += $aVSize; - } - - // DEPRECATED use SetYBase instead - function SetYMin($aYStartValue) { - //die("JpGraph Error: Deprecated function SetYMin. Use SetYBase() instead."); - $this->ybase=$aYStartValue; - } - - // Specify the base value for the bars - function SetYBase($aYStartValue) { - $this->ybase=$aYStartValue; - } - - // The method will take the specified pattern anre - // return a pattern index that corresponds to the original - // patterm being rotated 90 degreees. This is needed when plottin - // Horizontal bars - function RotatePattern($aPat,$aRotate=true) { - $rotate = array(1 => 2, 2 => 1, 3 => 3, 4 => 5, 5 => 4, 6 => 6, 7 => 7, 8 => 8); - if( $aRotate ) { - return $rotate[$aPat]; - } - else { - return $aPat; - } - } - - function Legend($graph) { - if( $this->grad && $this->legend!="" && !$this->fill ) { - $color=array($this->grad_fromcolor,$this->grad_tocolor); - // In order to differentiate between gradients and cooors specified as an RGB triple - $graph->legend->Add($this->legend,$color,"",-$this->grad_style, - $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } - elseif( $this->legend!="" && ($this->iPattern > -1 || is_array($this->iPattern)) ) { - if( is_array($this->iPattern) ) { - $p1 = $this->RotatePattern( $this->iPattern[0], $graph->img->a == 90 ); - $p2 = $this->iPatternColor[0]; - $p3 = $this->iPatternDensity[0]; - } - else { - $p1 = $this->RotatePattern( $this->iPattern, $graph->img->a == 90 ); - $p2 = $this->iPatternColor; - $p3 = $this->iPatternDensity; - } - if( $p3 < 90 ) $p3 += 5; - $color = array($p1,$p2,$p3,$this->fill_color); - // A kludge: Too mark that we add a pattern we use a type value of < 100 - $graph->legend->Add($this->legend,$color,"",-101, - $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } - elseif( $this->fill_color && $this->legend!="" ) { - if( is_array($this->fill_color) ) { - $graph->legend->Add($this->legend,$this->fill_color[0],"",0, - $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } - else { - $graph->legend->Add($this->legend,$this->fill_color,"",0, - $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } - } - } - - // Gets called before any axis are stroked - function PreStrokeAdjust($graph) { - parent::PreStrokeAdjust($graph); - - // If we are using a log Y-scale we want the base to be at the - // minimum Y-value unless the user have specifically set some other - // value than the default. - if( substr($graph->axtype,-3,3)=="log" && $this->ybase==0 ) - $this->ybase = $graph->yaxis->scale->GetMinVal(); - - // For a "text" X-axis scale we will adjust the - // display of the bars a little bit. - if( substr($graph->axtype,0,3)=="tex" ) { - // Position the ticks between the bars - $graph->xaxis->scale->ticks->SetXLabelOffset(0.5,0); - - // Center the bars - if( $this->abswidth > -1 ) { - $graph->SetTextScaleAbsCenterOff($this->abswidth); - } - else { - if( $this->align == "center" ) - $graph->SetTextScaleOff(0.5-$this->width/2); - elseif( $this->align == "right" ) - $graph->SetTextScaleOff(1-$this->width); - } - } - elseif( ($this instanceof AccBarPlot) || ($this instanceof GroupBarPlot) ) { - // We only set an absolute width for linear and int scale - // for text scale the width will be set to a fraction of - // the majstep width. - if( $this->abswidth == -1 ) { - // Not set - // set width to a visuable sensible default - $this->abswidth = $graph->img->plotwidth/(2*$this->numpoints); - } - } - } - - function Min() { - $m = parent::Min(); - if( $m[1] >= $this->ybase ) $m[1] = $this->ybase; - return $m; - } - - function Max() { - $m = parent::Max(); - if( $m[1] <= $this->ybase ) $m[1] = $this->ybase; - return $m; - } - - // Specify width as fractions of the major stepo size - function SetWidth($aWidth) { - if( $aWidth > 1 ) { - // Interpret this as absolute width - $this->abswidth=$aWidth; - } - else { - $this->width=$aWidth; - } - } - - // Specify width in absolute pixels. If specified this - // overrides SetWidth() - function SetAbsWidth($aWidth) { - $this->abswidth=$aWidth; - } - - function SetAlign($aAlign) { - $this->align=$aAlign; - } - - function SetNoFill() { - $this->grad = false; - $this->fill_color=false; - $this->fill=false; - } - - function SetFillColor($aColor) { - // Do an extra error check if the color is specified as an RGB array triple - // In that case convert it to a hex string since it will otherwise be - // interpretated as an array of colors for each individual bar. - - $aColor = RGB::tryHexConversion($aColor); - $this->fill = true ; - $this->fill_color=$aColor; - - } - - function SetFillGradient($aFromColor,$aToColor=null,$aStyle=null) { - $this->grad = true; - $this->grad_fromcolor = $aFromColor; - $this->grad_tocolor = $aToColor; - $this->grad_style = $aStyle; - } - - function SetValuePos($aPos) { - $this->valuepos = $aPos; - } - - function SetPattern($aPattern, $aColor='black'){ - if( is_array($aPattern) ) { - $n = count($aPattern); - $this->iPattern = array(); - $this->iPatternDensity = array(); - if( is_array($aColor) ) { - $this->iPatternColor = array(); - if( count($aColor) != $n ) { - JpGraphError::RaiseL(2001);//('NUmber of colors is not the same as the number of patterns in BarPlot::SetPattern()'); - } - } - else { - $this->iPatternColor = $aColor; - } - for( $i=0; $i < $n; ++$i ) { - $this->_SetPatternHelper($aPattern[$i], $this->iPattern[$i], $this->iPatternDensity[$i]); - if( is_array($aColor) ) { - $this->iPatternColor[$i] = $aColor[$i]; - } - } - } - else { - $this->_SetPatternHelper($aPattern, $this->iPattern, $this->iPatternDensity); - $this->iPatternColor = $aColor; - } - } - - function _SetPatternHelper($aPattern, &$aPatternValue, &$aDensity){ - switch( $aPattern ) { - case PATTERN_DIAG1: - $aPatternValue= 1; - $aDensity = 92; - break; - case PATTERN_DIAG2: - $aPatternValue= 1; - $aDensity = 78; - break; - case PATTERN_DIAG3: - $aPatternValue= 2; - $aDensity = 92; - break; - case PATTERN_DIAG4: - $aPatternValue= 2; - $aDensity = 78; - break; - case PATTERN_CROSS1: - $aPatternValue= 8; - $aDensity = 90; - break; - case PATTERN_CROSS2: - $aPatternValue= 8; - $aDensity = 78; - break; - case PATTERN_CROSS3: - $aPatternValue= 8; - $aDensity = 65; - break; - case PATTERN_CROSS4: - $aPatternValue= 7; - $aDensity = 90; - break; - case PATTERN_STRIPE1: - $aPatternValue= 5; - $aDensity = 94; - break; - case PATTERN_STRIPE2: - $aPatternValue= 5; - $aDensity = 85; - break; - default: - JpGraphError::RaiseL(2002); - //('Unknown pattern specified in call to BarPlot::SetPattern()'); - } - } - - function Stroke($img,$xscale,$yscale) { - - $numpoints = count($this->coords[0]); - if( isset($this->coords[1]) ) { - if( count($this->coords[1])!=$numpoints ) { - JpGraphError::RaiseL(2003,count($this->coords[1]),$numpoints); - //"Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])."Number of Y-points:$numpoints"); - } - else { - $exist_x = true; - } - } - else { - $exist_x = false; - } - - - $numbars=count($this->coords[0]); - - // Use GetMinVal() instead of scale[0] directly since in the case - // of log scale we get a correct value. Log scales will have negative - // values for values < 1 while still not representing negative numbers. - if( $yscale->GetMinVal() >= 0 ) - $zp=$yscale->scale_abs[0]; - else { - $zp=$yscale->Translate(0); - } - - if( $this->abswidth > -1 ) { - $abswidth=$this->abswidth; - } - else { - $abswidth=round($this->width*$xscale->scale_factor,0); - } - - // Count pontetial pattern array to avoid doing the count for each iteration - if( is_array($this->iPattern) ) { - $np = count($this->iPattern); - } - - $grad = null; - for($i=0; $i < $numbars; ++$i) { - - // If value is NULL, or 0 then don't draw a bar at all - if ($this->coords[0][$i] === null || $this->coords[0][$i] === '' ) - continue; - - if( $exist_x ) { - $x=$this->coords[1][$i]; - } - else { - $x=$i; - } - - $x=$xscale->Translate($x); - - // Comment Note: This confuses the positioning when using acc together with - // grouped bars. Workaround for fixing #191 - /* - if( !$xscale->textscale ) { - if($this->align=="center") - $x -= $abswidth/2; - elseif($this->align=="right") - $x -= $abswidth; - } - */ - // Stroke fill color and fill gradient - $pts=array( - $x,$zp, - $x,$yscale->Translate($this->coords[0][$i]), - $x+$abswidth,$yscale->Translate($this->coords[0][$i]), - $x+$abswidth,$zp); - if( $this->grad ) { - if( $grad === null ) { - $grad = new Gradient($img); - } - if( is_array($this->grad_fromcolor) ) { - // The first argument (grad_fromcolor) can be either an array or a single color. If it is an array - // then we have two choices. It can either a) be a single color specified as an RGB triple or it can be - // an array to specify both (from, to style) for each individual bar. The way to know the difference is - // to investgate the first element. If this element is an integer [0,255] then we assume it is an RGB - // triple. - $ng = count($this->grad_fromcolor); - if( $ng === 3 ) { - if( is_numeric($this->grad_fromcolor[0]) && $this->grad_fromcolor[0] > 0 && $this->grad_fromcolor[0] < 256 ) { - // RGB Triple - $fromcolor = $this->grad_fromcolor; - $tocolor = $this->grad_tocolor; - $style = $this->grad_style; - } - else { - $fromcolor = $this->grad_fromcolor[$i % $ng][0]; - $tocolor = $this->grad_fromcolor[$i % $ng][1]; - $style = $this->grad_fromcolor[$i % $ng][2]; - } - } - else { - $fromcolor = $this->grad_fromcolor[$i % $ng][0]; - $tocolor = $this->grad_fromcolor[$i % $ng][1]; - $style = $this->grad_fromcolor[$i % $ng][2]; - } - $grad->FilledRectangle($pts[2],$pts[3], - $pts[6],$pts[7], - $fromcolor,$tocolor,$style); - } - else { - $grad->FilledRectangle($pts[2],$pts[3], - $pts[6],$pts[7], - $this->grad_fromcolor,$this->grad_tocolor,$this->grad_style); - } - } - elseif( !empty($this->fill_color) ) { - if(is_array($this->fill_color)) { - $img->PushColor($this->fill_color[$i % count($this->fill_color)]); - } else { - $img->PushColor($this->fill_color); - } - $img->FilledPolygon($pts); - $img->PopColor(); - } - -/////////////////////////kokorahen rectangle polygon////////////////////// - - // Remember value of this bar - $val=$this->coords[0][$i]; - - if( !empty($val) && !is_numeric($val) ) { - JpGraphError::RaiseL(2004,$i,$val); - //'All values for a barplot must be numeric. You have specified value['.$i.'] == \''.$val.'\''); - } - - // Determine the shadow - if( $this->bar_shadow && $val != 0) { - - $ssh = $this->bar_shadow_hsize; - $ssv = $this->bar_shadow_vsize; - // Create points to create a "upper-right" shadow - if( $val > 0 ) { - $sp[0]=$pts[6]; $sp[1]=$pts[7]; - $sp[2]=$pts[4]; $sp[3]=$pts[5]; - $sp[4]=$pts[2]; $sp[5]=$pts[3]; - $sp[6]=$pts[2]+$ssh; $sp[7]=$pts[3]-$ssv; - $sp[8]=$pts[4]+$ssh; $sp[9]=$pts[5]-$ssv; - $sp[10]=$pts[6]+$ssh; $sp[11]=$pts[7]-$ssv; - } - elseif( $val < 0 ) { - $sp[0]=$pts[4]; $sp[1]=$pts[5]; - $sp[2]=$pts[6]; $sp[3]=$pts[7]; - $sp[4]=$pts[0]; $sp[5]=$pts[1]; - $sp[6]=$pts[0]+$ssh; $sp[7]=$pts[1]-$ssv; - $sp[8]=$pts[6]+$ssh; $sp[9]=$pts[7]-$ssv; - $sp[10]=$pts[4]+$ssh; $sp[11]=$pts[5]-$ssv; - } - if( is_array($this->bar_shadow_color) ) { - $numcolors = count($this->bar_shadow_color); - if( $numcolors == 0 ) { - JpGraphError::RaiseL(2005);//('You have specified an empty array for shadow colors in the bar plot.'); - } - $img->PushColor($this->bar_shadow_color[$i % $numcolors]); - } - else { - $img->PushColor($this->bar_shadow_color); - } - $img->FilledPolygon($sp); - $img->PopColor(); - - } elseif( $this->bar_3d && $val != 0) { - // Determine the 3D - - $ssh = $this->bar_3d_hsize; - $ssv = $this->bar_3d_vsize; - - // Create points to create a "upper-right" shadow - if( $val > 0 ) { - $sp1[0]=$pts[6]; $sp1[1]=$pts[7]; - $sp1[2]=$pts[4]; $sp1[3]=$pts[5]; - $sp1[4]=$pts[4]+$ssh; $sp1[5]=$pts[5]-$ssv; - $sp1[6]=$pts[6]+$ssh; $sp1[7]=$pts[7]-$ssv; - - $sp2[0]=$pts[4]; $sp2[1]=$pts[5]; - $sp2[2]=$pts[2]; $sp2[3]=$pts[3]; - $sp2[4]=$pts[2]+$ssh; $sp2[5]=$pts[3]-$ssv; - $sp2[6]=$pts[4]+$ssh; $sp2[7]=$pts[5]-$ssv; - - } - elseif( $val < 0 ) { - $sp1[0]=$pts[4]; $sp1[1]=$pts[5]; - $sp1[2]=$pts[6]; $sp1[3]=$pts[7]; - $sp1[4]=$pts[6]+$ssh; $sp1[5]=$pts[7]-$ssv; - $sp1[6]=$pts[4]+$ssh; $sp1[7]=$pts[5]-$ssv; - - $sp2[0]=$pts[6]; $sp2[1]=$pts[7]; - $sp2[2]=$pts[0]; $sp2[3]=$pts[1]; - $sp2[4]=$pts[0]+$ssh; $sp2[5]=$pts[1]-$ssv; - $sp2[6]=$pts[6]+$ssh; $sp2[7]=$pts[7]-$ssv; - } - - $base_color = $this->fill_color; - - $img->PushColor($base_color . ':0.7'); - $img->FilledPolygon($sp1); - $img->PopColor(); - - $img->PushColor($base_color . ':1.1'); - $img->FilledPolygon($sp2); - $img->PopColor(); - } - - // Stroke the pattern - if( is_array($this->iPattern) ) { - $f = new RectPatternFactory(); - if( is_array($this->iPatternColor) ) { - $pcolor = $this->iPatternColor[$i % $np]; - } - else { - $pcolor = $this->iPatternColor; - } - $prect = $f->Create($this->iPattern[$i % $np],$pcolor,1); - $prect->SetDensity($this->iPatternDensity[$i % $np]); - - if( $val < 0 ) { - $rx = $pts[0]; - $ry = $pts[1]; - } - else { - $rx = $pts[2]; - $ry = $pts[3]; - } - $width = abs($pts[4]-$pts[0])+1; - $height = abs($pts[1]-$pts[3])+1; - $prect->SetPos(new Rectangle($rx,$ry,$width,$height)); - $prect->Stroke($img); - } - else { - if( $this->iPattern > -1 ) { - $f = new RectPatternFactory(); - $prect = $f->Create($this->iPattern,$this->iPatternColor,1); - $prect->SetDensity($this->iPatternDensity); - if( $val < 0 ) { - $rx = $pts[0]; - $ry = $pts[1]; - } - else { - $rx = $pts[2]; - $ry = $pts[3]; - } - $width = abs($pts[4]-$pts[0])+1; - $height = abs($pts[1]-$pts[3])+1; - $prect->SetPos(new Rectangle($rx,$ry,$width,$height)); - $prect->Stroke($img); - } - } - - // Stroke the outline of the bar - if( is_array($this->color) ) { - $img->SetColor($this->color[$i % count($this->color)]); - } - else { - $img->SetColor($this->color); - } - - $pts[] = $pts[0]; - $pts[] = $pts[1]; - - if( $this->weight > 0 ) { - $img->SetLineWeight($this->weight); - $img->Polygon($pts); - } - - // Determine how to best position the values of the individual bars - $x=$pts[2]+($pts[4]-$pts[2])/2; - $this->value->SetMargin(5); - - if( $this->valuepos=='top' ) { - $y=$pts[3]; - if( $img->a === 90 ) { - if( $val < 0 ) { - $this->value->SetAlign('right','center'); - } - else { - $this->value->SetAlign('left','center'); - } - - } - else { - if( $val < 0 ) { - $this->value->SetMargin(-5); - $y=$pts[1]; - $this->value->SetAlign('center','bottom'); - } - else { - $this->value->SetAlign('center','bottom'); - } - - } - $this->value->Stroke($img,$val,$x,$y); - } - elseif( $this->valuepos=='max' ) { - $y=$pts[3]; - if( $img->a === 90 ) { - if( $val < 0 ) - $this->value->SetAlign('left','center'); - else - $this->value->SetAlign('right','center'); - } - else { - if( $val < 0 ) { - $this->value->SetAlign('center','bottom'); - } - else { - $this->value->SetAlign('center','top'); - } - } - $this->value->SetMargin(-5); - $this->value->Stroke($img,$val,$x,$y); - } - elseif( $this->valuepos=='center' ) { - $y = ($pts[3] + $pts[1])/2; - $this->value->SetAlign('center','center'); - $this->value->SetMargin(0); - $this->value->Stroke($img,$val,$x,$y); - } - elseif( $this->valuepos=='bottom' || $this->valuepos=='min' ) { - $y=$pts[1]; - if( $img->a === 90 ) { - if( $val < 0 ) - $this->value->SetAlign('right','center'); - else - $this->value->SetAlign('left','center'); - } - $this->value->SetMargin(3); - $this->value->Stroke($img,$val,$x,$y); - } - else { - JpGraphError::RaiseL(2006,$this->valuepos); - //'Unknown position for values on bars :'.$this->valuepos); - } - // Create the client side image map - $rpts = $img->ArrRotate($pts); - $csimcoord=round($rpts[0]).", ".round($rpts[1]); - for( $j=1; $j < 4; ++$j){ - $csimcoord .= ", ".round($rpts[2*$j]).", ".round($rpts[2*$j+1]); - } - if( !empty($this->csimtargets[$i]) ) { - $this->csimareas .= 'csimareas .= " href=\"".htmlentities($this->csimtargets[$i])."\""; - - if( !empty($this->csimwintargets[$i]) ) { - $this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; - } - - $sval=''; - if( !empty($this->csimalts[$i]) ) { - $sval=sprintf($this->csimalts[$i],$this->coords[0][$i]); - $this->csimareas .= " title=\"$sval\" alt=\"$sval\" "; - } - $this->csimareas .= " />\n"; - } - } - return true; - } -} // Class - -//=================================================== -// CLASS GroupBarPlot -// Description: Produce grouped bar plots -//=================================================== -class GroupBarPlot extends BarPlot { - public $plots; - private $nbrplots=0; - //--------------- - // CONSTRUCTOR - function GroupBarPlot($plots) { - $this->width=0.7; - $this->plots = $plots; - $this->nbrplots = count($plots); - if( $this->nbrplots < 1 ) { - JpGraphError::RaiseL(2007);//('Cannot create GroupBarPlot from empty plot array.'); - } - for($i=0; $i < $this->nbrplots; ++$i ) { - if( empty($this->plots[$i]) || !isset($this->plots[$i]) ) { - JpGraphError::RaiseL(2008,$i);//("Group bar plot element nbr $i is undefined or empty."); - } - } - $this->numpoints = $plots[0]->numpoints; - $this->width=0.7; - } - - //--------------- - // PUBLIC METHODS - function Legend($graph) { - $n = count($this->plots); - for($i=0; $i < $n; ++$i) { - $c = get_class($this->plots[$i]); - if( !($this->plots[$i] instanceof BarPlot) ) { - JpGraphError::RaiseL(2009,$c); - //('One of the objects submitted to GroupBar is not a BarPlot. Make sure that you create the Group Bar plot from an array of BarPlot or AccBarPlot objects. (Class = '.$c.')'); - } - $this->plots[$i]->DoLegend($graph); - } - } - - function Min() { - list($xmin,$ymin) = $this->plots[0]->Min(); - $n = count($this->plots); - for($i=0; $i < $n; ++$i) { - list($xm,$ym) = $this->plots[$i]->Min(); - $xmin = max($xmin,$xm); - $ymin = min($ymin,$ym); - } - return array($xmin,$ymin); - } - - function Max() { - list($xmax,$ymax) = $this->plots[0]->Max(); - $n = count($this->plots); - for($i=0; $i < $n; ++$i) { - list($xm,$ym) = $this->plots[$i]->Max(); - $xmax = max($xmax,$xm); - $ymax = max($ymax,$ym); - } - return array($xmax,$ymax); - } - - function GetCSIMareas() { - $n = count($this->plots); - $csimareas=''; - for($i=0; $i < $n; ++$i) { - $csimareas .= $this->plots[$i]->csimareas; - } - return $csimareas; - } - - // Stroke all the bars next to each other - function Stroke($img,$xscale,$yscale) { - $tmp=$xscale->off; - $n = count($this->plots); - $subwidth = $this->width/$this->nbrplots ; - - for( $i=0; $i < $n; ++$i ) { - $this->plots[$i]->ymin=$this->ybase; - $this->plots[$i]->SetWidth($subwidth); - - // If the client have used SetTextTickInterval() then - // major_step will be > 1 and the positioning will fail. - // If we assume it is always one the positioning will work - // fine with a text scale but this will not work with - // arbitrary linear scale - $xscale->off = $tmp+$i*round($xscale->scale_factor* $subwidth); - $this->plots[$i]->Stroke($img,$xscale,$yscale); - } - $xscale->off=$tmp; - } -} // Class - -//=================================================== -// CLASS AccBarPlot -// Description: Produce accumulated bar plots -//=================================================== -class AccBarPlot extends BarPlot { - public $plots=null; - private $nbrplots=0; - //--------------- - // CONSTRUCTOR - function __construct($plots) { - $this->plots = $plots; - $this->nbrplots = count($plots); - if( $this->nbrplots < 1 ) { - JpGraphError::RaiseL(2010);//('Cannot create AccBarPlot from empty plot array.'); - } - for($i=0; $i < $this->nbrplots; ++$i ) { - if( empty($this->plots[$i]) || !isset($this->plots[$i]) ) { - JpGraphError::RaiseL(2011,$i);//("Acc bar plot element nbr $i is undefined or empty."); - } - } - - // We can only allow individual plost which do not have specified X-positions - for($i=0; $i < $this->nbrplots; ++$i ) { - if( !empty($this->plots[$i]->coords[1]) ) { - JpGraphError::RaiseL(2015); - //'Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-positions.'); - } - } - - // Use 0 weight by default which means that the individual bar - // weights will be used per part n the accumulated bar - $this->SetWeight(0); - - $this->numpoints = $plots[0]->numpoints; - $this->value = new DisplayValue(); - } - - //--------------- - // PUBLIC METHODS - function Legend($graph) { - $n = count($this->plots); - for( $i=$n-1; $i >= 0; --$i ) { - $c = get_class($this->plots[$i]); - if( !($this->plots[$i] instanceof BarPlot) ) { - JpGraphError::RaiseL(2012,$c); - //('One of the objects submitted to AccBar is not a BarPlot. Make sure that you create the AccBar plot from an array of BarPlot objects.(Class='.$c.')'); - } - $this->plots[$i]->DoLegend($graph); - } - } - - function Max() { - list($xmax) = $this->plots[0]->Max(); - $nmax=0; - for($i=0; $i < count($this->plots); ++$i) { - $n = count($this->plots[$i]->coords[0]); - $nmax = max($nmax,$n); - list($x) = $this->plots[$i]->Max(); - $xmax = max($xmax,$x); - } - for( $i = 0; $i < $nmax; $i++ ) { - // Get y-value for bar $i by adding the - // individual bars from all the plots added. - // It would be wrong to just add the - // individual plots max y-value since that - // would in most cases give to large y-value. - $y=0; - if( !isset($this->plots[0]->coords[0][$i]) ) { - JpGraphError::RaiseL(2014); - } - if( $this->plots[0]->coords[0][$i] > 0 ) - $y=$this->plots[0]->coords[0][$i]; - for( $j = 1; $j < $this->nbrplots; $j++ ) { - if( !isset($this->plots[$j]->coords[0][$i]) ) { - JpGraphError::RaiseL(2014); - } - if( $this->plots[$j]->coords[0][$i] > 0 ) - $y += $this->plots[$j]->coords[0][$i]; - } - $ymax[$i] = $y; - } - $ymax = max($ymax); - - // Bar always start at baseline - if( $ymax <= $this->ybase ) - $ymax = $this->ybase; - return array($xmax,$ymax); - } - - function Min() { - $nmax=0; - list($xmin,$ysetmin) = $this->plots[0]->Min(); - for($i=0; $i < count($this->plots); ++$i) { - $n = count($this->plots[$i]->coords[0]); - $nmax = max($nmax,$n); - list($x,$y) = $this->plots[$i]->Min(); - $xmin = Min($xmin,$x); - $ysetmin = Min($y,$ysetmin); - } - for( $i = 0; $i < $nmax; $i++ ) { - // Get y-value for bar $i by adding the - // individual bars from all the plots added. - // It would be wrong to just add the - // individual plots max y-value since that - // would in most cases give to large y-value. - $y=0; - if( $this->plots[0]->coords[0][$i] < 0 ) - $y=$this->plots[0]->coords[0][$i]; - for( $j = 1; $j < $this->nbrplots; $j++ ) { - if( $this->plots[$j]->coords[0][$i] < 0 ) - $y += $this->plots[ $j ]->coords[0][$i]; - } - $ymin[$i] = $y; - } - $ymin = Min($ysetmin,Min($ymin)); - // Bar always start at baseline - if( $ymin >= $this->ybase ) - $ymin = $this->ybase; - return array($xmin,$ymin); - } - - // Stroke acc bar plot - function Stroke($img,$xscale,$yscale) { - $pattern=NULL; - $img->SetLineWeight($this->weight); - $grad=null; - for($i=0; $i < $this->numpoints-1; $i++) { - $accy = 0; - $accy_neg = 0; - for($j=0; $j < $this->nbrplots; ++$j ) { - $img->SetColor($this->plots[$j]->color); - - if ( $this->plots[$j]->coords[0][$i] >= 0) { - $yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy); - $accyt=$yscale->Translate($accy); - $accy+=$this->plots[$j]->coords[0][$i]; - } - else { - //if ( $this->plots[$j]->coords[0][$i] < 0 || $accy_neg < 0 ) { - $yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy_neg); - $accyt=$yscale->Translate($accy_neg); - $accy_neg+=$this->plots[$j]->coords[0][$i]; - } - - $xt=$xscale->Translate($i); - - if( $this->abswidth > -1 ) { - $abswidth=$this->abswidth; - } - else { - $abswidth=round($this->width*$xscale->scale_factor,0); - } - - $pts=array($xt,$accyt,$xt,$yt,$xt+$abswidth,$yt,$xt+$abswidth,$accyt); - - if( $this->bar_shadow ) { - $ssh = $this->bar_shadow_hsize; - $ssv = $this->bar_shadow_vsize; - - // We must also differ if we are a positive or negative bar. - if( $j === 0 ) { - // This gets extra complicated since we have to - // see all plots to see if we are negative. It could - // for example be that all plots are 0 until the very - // last one. We therefore need to save the initial setup - // for both the negative and positive case - - // In case the final bar is positive - $sp[0]=$pts[6]+1; $sp[1]=$pts[7]; - $sp[2]=$pts[6]+$ssh; $sp[3]=$pts[7]-$ssv; - - // In case the final bar is negative - $nsp[0]=$pts[0]; $nsp[1]=$pts[1]; - $nsp[2]=$pts[0]+$ssh; $nsp[3]=$pts[1]-$ssv; - $nsp[4]=$pts[6]+$ssh; $nsp[5]=$pts[7]-$ssv; - $nsp[10]=$pts[6]+1; $nsp[11]=$pts[7]; - } - - if( $j === $this->nbrplots-1 ) { - // If this is the last plot of the bar and - // the total value is larger than 0 then we - // add the shadow. - if( is_array($this->bar_shadow_color) ) { - $numcolors = count($this->bar_shadow_color); - if( $numcolors == 0 ) { - JpGraphError::RaiseL(2013);//('You have specified an empty array for shadow colors in the bar plot.'); - } - $img->PushColor($this->bar_shadow_color[$i % $numcolors]); - } - else { - $img->PushColor($this->bar_shadow_color); - } - - if( $accy > 0 ) { - $sp[4]=$pts[4]+$ssh; $sp[5]=$pts[5]-$ssv; - $sp[6]=$pts[2]+$ssh; $sp[7]=$pts[3]-$ssv; - $sp[8]=$pts[2]; $sp[9]=$pts[3]-1; - $sp[10]=$pts[4]+1; $sp[11]=$pts[5]; - $img->FilledPolygon($sp,4); - } - elseif( $accy_neg < 0 ) { - $nsp[6]=$pts[4]+$ssh; $nsp[7]=$pts[5]-$ssv; - $nsp[8]=$pts[4]+1; $nsp[9]=$pts[5]; - $img->FilledPolygon($nsp,4); - } - $img->PopColor(); - } - } - - - // If value is NULL or 0, then don't draw a bar at all - if ($this->plots[$j]->coords[0][$i] == 0 ) continue; - - if( $this->plots[$j]->grad ) { - if( $grad === null ) { - $grad = new Gradient($img); - } - if( is_array($this->plots[$j]->grad_fromcolor) ) { - // The first argument (grad_fromcolor) can be either an array or a single color. If it is an array - // then we have two choices. It can either a) be a single color specified as an RGB triple or it can be - // an array to specify both (from, to style) for each individual bar. The way to know the difference is - // to investgate the first element. If this element is an integer [0,255] then we assume it is an RGB - // triple. - $ng = count($this->plots[$j]->grad_fromcolor); - if( $ng === 3 ) { - if( is_numeric($this->plots[$j]->grad_fromcolor[0]) && $this->plots[$j]->grad_fromcolor[0] > 0 && - $this->plots[$j]->grad_fromcolor[0] < 256 ) { - // RGB Triple - $fromcolor = $this->plots[$j]->grad_fromcolor; - $tocolor = $this->plots[$j]->grad_tocolor; - $style = $this->plots[$j]->grad_style; - } - else { - $fromcolor = $this->plots[$j]->grad_fromcolor[$i % $ng][0]; - $tocolor = $this->plots[$j]->grad_fromcolor[$i % $ng][1]; - $style = $this->plots[$j]->grad_fromcolor[$i % $ng][2]; - } - } - else { - $fromcolor = $this->plots[$j]->grad_fromcolor[$i % $ng][0]; - $tocolor = $this->plots[$j]->grad_fromcolor[$i % $ng][1]; - $style = $this->plots[$j]->grad_fromcolor[$i % $ng][2]; - } - $grad->FilledRectangle($pts[2],$pts[3], - $pts[6],$pts[7], - $fromcolor,$tocolor,$style); - } - else { - $grad->FilledRectangle($pts[2],$pts[3], - $pts[6],$pts[7], - $this->plots[$j]->grad_fromcolor, - $this->plots[$j]->grad_tocolor, - $this->plots[$j]->grad_style); - } - } else { - if (is_array($this->plots[$j]->fill_color) ) { - $numcolors = count($this->plots[$j]->fill_color); - $fillcolor = $this->plots[$j]->fill_color[$i % $numcolors]; - // If the bar is specified to be non filled then the fill color is false - if( $fillcolor !== false ) { - $img->SetColor($this->plots[$j]->fill_color[$i % $numcolors]); - } - } - else { - $fillcolor = $this->plots[$j]->fill_color; - if( $fillcolor !== false ) { - $img->SetColor($this->plots[$j]->fill_color); - } - } - if( $fillcolor !== false ) { - $img->FilledPolygon($pts); - } - } - - $img->SetColor($this->plots[$j]->color); - - // Stroke the pattern - if( $this->plots[$j]->iPattern > -1 ) { - if( $pattern===NULL ) { - $pattern = new RectPatternFactory(); - } - - $prect = $pattern->Create($this->plots[$j]->iPattern,$this->plots[$j]->iPatternColor,1); - $prect->SetDensity($this->plots[$j]->iPatternDensity); - if( $this->plots[$j]->coords[0][$i] < 0 ) { - $rx = $pts[0]; - $ry = $pts[1]; - } - else { - $rx = $pts[2]; - $ry = $pts[3]; - } - $width = abs($pts[4]-$pts[0])+1; - $height = abs($pts[1]-$pts[3])+1; - $prect->SetPos(new Rectangle($rx,$ry,$width,$height)); - $prect->Stroke($img); - } - - - // CSIM array - - if( $i < count($this->plots[$j]->csimtargets) ) { - // Create the client side image map - $rpts = $img->ArrRotate($pts); - $csimcoord=round($rpts[0]).", ".round($rpts[1]); - for( $k=1; $k < 4; ++$k){ - $csimcoord .= ", ".round($rpts[2*$k]).", ".round($rpts[2*$k+1]); - } - if( ! empty($this->plots[$j]->csimtargets[$i]) ) { - $this->csimareas.= 'csimareas.= " href=\"".$this->plots[$j]->csimtargets[$i]."\" "; - - if( ! empty($this->plots[$j]->csimwintargets[$i]) ) { - $this->csimareas.= " target=\"".$this->plots[$j]->csimwintargets[$i]."\" "; - } - - $sval=''; - if( !empty($this->plots[$j]->csimalts[$i]) ) { - $sval=sprintf($this->plots[$j]->csimalts[$i],$this->plots[$j]->coords[0][$i]); - $this->csimareas .= " title=\"$sval\" "; - } - $this->csimareas .= " alt=\"$sval\" />\n"; - } - } - - $pts[] = $pts[0]; - $pts[] = $pts[1]; - $img->SetLineWeight($this->plots[$j]->weight); - $img->Polygon($pts); - $img->SetLineWeight(1); - } - - // Daw potential bar around the entire accbar bar - if( $this->weight > 0 ) { - $y=$yscale->Translate(0); - $img->SetColor($this->color); - $img->SetLineWeight($this->weight); - $img->Rectangle($pts[0],$y,$pts[6],$pts[5]); - } - - // Draw labels for each acc.bar - - $x=$pts[2]+($pts[4]-$pts[2])/2; - if($this->bar_shadow) $x += $ssh; - - // First stroke the accumulated value for the entire bar - // This value is always placed at the top/bottom of the bars - if( $accy_neg < 0 ) { - $y=$yscale->Translate($accy_neg); - $this->value->Stroke($img,$accy_neg,$x,$y); - } - else { - $y=$yscale->Translate($accy); - $this->value->Stroke($img,$accy,$x,$y); - } - - $accy = 0; - $accy_neg = 0; - for($j=0; $j < $this->nbrplots; ++$j ) { - - // We don't print 0 values in an accumulated bar plot - if( $this->plots[$j]->coords[0][$i] == 0 ) continue; - - if ($this->plots[$j]->coords[0][$i] > 0) { - $yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy); - $accyt=$yscale->Translate($accy); - if( $this->plots[$j]->valuepos=='center' ) { - $y = $accyt-($accyt-$yt)/2; - } - elseif( $this->plots[$j]->valuepos=='bottom' ) { - $y = $accyt; - } - else { // top or max - $y = $accyt-($accyt-$yt); - } - $accy+=$this->plots[$j]->coords[0][$i]; - if( $this->plots[$j]->valuepos=='center' ) { - $this->plots[$j]->value->SetAlign("center","center"); - $this->plots[$j]->value->SetMargin(0); - } - elseif( $this->plots[$j]->valuepos=='bottom' ) { - $this->plots[$j]->value->SetAlign('center','bottom'); - $this->plots[$j]->value->SetMargin(2); - } - else { - $this->plots[$j]->value->SetAlign('center','top'); - $this->plots[$j]->value->SetMargin(1); - } - } else { - $yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy_neg); - $accyt=$yscale->Translate($accy_neg); - $accy_neg+=$this->plots[$j]->coords[0][$i]; - if( $this->plots[$j]->valuepos=='center' ) { - $y = $accyt-($accyt-$yt)/2; - } - elseif( $this->plots[$j]->valuepos=='bottom' ) { - $y = $accyt; - } - else { - $y = $accyt-($accyt-$yt); - } - if( $this->plots[$j]->valuepos=='center' ) { - $this->plots[$j]->value->SetAlign("center","center"); - $this->plots[$j]->value->SetMargin(0); - } - elseif( $this->plots[$j]->valuepos=='bottom' ) { - $this->plots[$j]->value->SetAlign('center',$j==0 ? 'bottom':'top'); - $this->plots[$j]->value->SetMargin(-2); - } - else { - $this->plots[$j]->value->SetAlign('center','bottom'); - $this->plots[$j]->value->SetMargin(-1); - } - } - $this->plots[$j]->value->Stroke($img,$this->plots[$j]->coords[0][$i],round($x),round($y)); - } - - } - return true; - } -} // Class - -/* EOF */ -?> diff --git a/#jpgraph/src/jpgraph_canvas.php b/#jpgraph/src/jpgraph_canvas.php deleted file mode 100644 index f9429513..00000000 --- a/#jpgraph/src/jpgraph_canvas.php +++ /dev/null @@ -1,95 +0,0 @@ -StrokePlotArea(); - } - - // Method description - function Stroke($aStrokeFileName="") { - if( $this->texts != null ) { - for($i=0; $i < count($this->texts); ++$i) { - $this->texts[$i]->Stroke($this->img); - } - } - if( $this->iTables !== null ) { - for($i=0; $i < count($this->iTables); ++$i) { - $this->iTables[$i]->Stroke($this->img); - } - } - $this->StrokeTitles(); - - // If the filename is the predefined value = '_csim_special_' - // we assume that the call to stroke only needs to do enough - // to correctly generate the CSIM maps. - // We use this variable to skip things we don't strictly need - // to do to generate the image map to improve performance - // a best we can. Therefor you will see a lot of tests !$_csim in the - // code below. - $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); - - // We need to know if we have stroked the plot in the - // GetCSIMareas. Otherwise the CSIM hasn't been generated - // and in the case of GetCSIM called before stroke to generate - // CSIM without storing an image to disk GetCSIM must call Stroke. - $this->iHasStroked = true; - - if( !$_csim ) { - - // Should we do any final image transformation - if( $this->iImgTrans ) { - if( !class_exists('ImgTrans',false) ) { - require_once('jpgraph_imgtrans.php'); - } - - $tform = new ImgTrans($this->img->img); - $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, - $this->iImgTransDirection,$this->iImgTransHighQ, - $this->iImgTransMinSize,$this->iImgTransFillColor, - $this->iImgTransBorder); - } - - - // If the filename is given as the special _IMG_HANDLER - // then the image handler is returned and the image is NOT - // streamed back - if( $aStrokeFileName == _IMG_HANDLER ) { - return $this->img->img; - } - else { - // Finally stream the generated picture - $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); - return true; - } - } - } -} // Class - -/* EOF */ -?> diff --git a/#jpgraph/src/jpgraph_canvtools.php b/#jpgraph/src/jpgraph_canvtools.php deleted file mode 100644 index 2290a5bc..00000000 --- a/#jpgraph/src/jpgraph_canvtools.php +++ /dev/null @@ -1,523 +0,0 @@ -g = $graph; - $this->w = $graph->img->width; - $this->h = $graph->img->height; - $this->ixmin = $xmin; - $this->ixmax = $xmax; - $this->iymin = $ymin; - $this->iymax = $ymax; - } - - function Set($xmin=0,$xmax=10,$ymin=0,$ymax=10) { - $this->ixmin = $xmin; - $this->ixmax = $xmax; - $this->iymin = $ymin; - $this->iymax = $ymax; - } - - function Get() { - return array($this->ixmin,$this->ixmax,$this->iymin,$this->iymax); - } - - function Translate($x,$y) { - $xp = round(($x-$this->ixmin)/($this->ixmax - $this->ixmin) * $this->w); - $yp = round(($y-$this->iymin)/($this->iymax - $this->iymin) * $this->h); - return array($xp,$yp); - } - - function TranslateX($x) { - $xp = round(($x-$this->ixmin)/($this->ixmax - $this->ixmin) * $this->w); - return $xp; - } - - function TranslateY($y) { - $yp = round(($y-$this->iymin)/($this->iymax - $this->iymin) * $this->h); - return $yp; - } - -} - - -//=================================================== -// CLASS Shape -// Description: Methods to draw shapes on canvas -//=================================================== -class Shape { - private $img,$scale; - - function __construct($aGraph,$scale) { - $this->img = $aGraph->img; - $this->img->SetColor('black'); - $this->scale = $scale; - } - - function SetColor($aColor) { - $this->img->SetColor($aColor); - } - - function Line($x1,$y1,$x2,$y2) { - list($x1,$y1) = $this->scale->Translate($x1,$y1); - list($x2,$y2) = $this->scale->Translate($x2,$y2); - $this->img->Line($x1,$y1,$x2,$y2); - } - - function SetLineWeight($aWeight) { - $this->img->SetLineWeight($aWeight); - } - - function Polygon($p,$aClosed=false) { - $n=count($p); - for($i=0; $i < $n; $i+=2 ) { - $p[$i] = $this->scale->TranslateX($p[$i]); - $p[$i+1] = $this->scale->TranslateY($p[$i+1]); - } - $this->img->Polygon($p,$aClosed); - } - - function FilledPolygon($p) { - $n=count($p); - for($i=0; $i < $n; $i+=2 ) { - $p[$i] = $this->scale->TranslateX($p[$i]); - $p[$i+1] = $this->scale->TranslateY($p[$i+1]); - } - $this->img->FilledPolygon($p); - } - - - // Draw a bezier curve with defining points in the $aPnts array - // using $aSteps steps. - // 0=x0, 1=y0 - // 2=x1, 3=y1 - // 4=x2, 5=y2 - // 6=x3, 7=y3 - function Bezier($p,$aSteps=40) { - $x0 = $p[0]; - $y0 = $p[1]; - // Calculate coefficients - $cx = 3*($p[2]-$p[0]); - $bx = 3*($p[4]-$p[2])-$cx; - $ax = $p[6]-$p[0]-$cx-$bx; - $cy = 3*($p[3]-$p[1]); - $by = 3*($p[5]-$p[3])-$cy; - $ay = $p[7]-$p[1]-$cy-$by; - - // Step size - $delta = 1.0/$aSteps; - - $x_old = $x0; - $y_old = $y0; - for($t=$delta; $t<=1.0; $t+=$delta) { - $tt = $t*$t; $ttt=$tt*$t; - $x = $ax*$ttt + $bx*$tt + $cx*$t + $x0; - $y = $ay*$ttt + $by*$tt + $cy*$t + $y0; - $this->Line($x_old,$y_old,$x,$y); - $x_old = $x; - $y_old = $y; - } - $this->Line($x_old,$y_old,$p[6],$p[7]); - } - - function Rectangle($x1,$y1,$x2,$y2) { - list($x1,$y1) = $this->scale->Translate($x1,$y1); - list($x2,$y2) = $this->scale->Translate($x2,$y2); - $this->img->Rectangle($x1,$y1,$x2,$y2); - } - - function FilledRectangle($x1,$y1,$x2,$y2) { - list($x1,$y1) = $this->scale->Translate($x1,$y1); - list($x2,$y2) = $this->scale->Translate($x2,$y2); - $this->img->FilledRectangle($x1,$y1,$x2,$y2); - } - - function Circle($x1,$y1,$r) { - list($x1,$y1) = $this->scale->Translate($x1,$y1); - if( $r >= 0 ) - $r = $this->scale->TranslateX($r); - else - $r = -$r; - $this->img->Circle($x1,$y1,$r); - } - - function FilledCircle($x1,$y1,$r) { - list($x1,$y1) = $this->scale->Translate($x1,$y1); - if( $r >= 0 ) - $r = $this->scale->TranslateX($r); - else - $r = -$r; - $this->img->FilledCircle($x1,$y1,$r); - } - - function RoundedRectangle($x1,$y1,$x2,$y2,$r=null) { - list($x1,$y1) = $this->scale->Translate($x1,$y1); - list($x2,$y2) = $this->scale->Translate($x2,$y2); - - if( $r == null ) - $r = 5; - elseif( $r >= 0 ) - $r = $this->scale->TranslateX($r); - else - $r = -$r; - $this->img->RoundedRectangle($x1,$y1,$x2,$y2,$r); - } - - function FilledRoundedRectangle($x1,$y1,$x2,$y2,$r=null) { - list($x1,$y1) = $this->scale->Translate($x1,$y1); - list($x2,$y2) = $this->scale->Translate($x2,$y2); - - if( $r == null ) - $r = 5; - elseif( $r > 0 ) - $r = $this->scale->TranslateX($r); - else - $r = -$r; - $this->img->FilledRoundedRectangle($x1,$y1,$x2,$y2,$r); - } - - function ShadowRectangle($x1,$y1,$x2,$y2,$fcolor=false,$shadow_width=null,$shadow_color=array(102,102,102)) { - list($x1,$y1) = $this->scale->Translate($x1,$y1); - list($x2,$y2) = $this->scale->Translate($x2,$y2); - if( $shadow_width == null ) - $shadow_width=4; - else - $shadow_width=$this->scale->TranslateX($shadow_width); - $this->img->ShadowRectangle($x1,$y1,$x2,$y2,$fcolor,$shadow_width,$shadow_color); - } - - function SetTextAlign($halign,$valign="bottom") { - $this->img->SetTextAlign($halign,$valign="bottom"); - } - - function StrokeText($x1,$y1,$txt,$dir=0,$paragraph_align="left") { - list($x1,$y1) = $this->scale->Translate($x1,$y1); - $this->img->StrokeText($x1,$y1,$txt,$dir,$paragraph_align); - } - - // A rounded rectangle where one of the corner has been moved "into" the - // rectangle 'iw' width and 'ih' height. Corners: - // 0=Top left, 1=top right, 2=bottom right, 3=bottom left - function IndentedRectangle($xt,$yt,$w,$h,$iw=0,$ih=0,$aCorner=3,$aFillColor="",$r=4) { - - list($xt,$yt) = $this->scale->Translate($xt,$yt); - list($w,$h) = $this->scale->Translate($w,$h); - list($iw,$ih) = $this->scale->Translate($iw,$ih); - - $xr = $xt + $w - 0; - $yl = $yt + $h - 0; - - switch( $aCorner ) { - case 0: // Upper left - - // Bottom line, left & right arc - $this->img->Line($xt+$r,$yl,$xr-$r,$yl); - $this->img->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); - $this->img->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); - - // Right line, Top right arc - $this->img->Line($xr,$yt+$r,$xr,$yl-$r); - $this->img->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); - - // Top line, Top left arc - $this->img->Line($xt+$iw+$r,$yt,$xr-$r,$yt); - $this->img->Arc($xt+$iw+$r,$yt+$r,$r*2,$r*2,180,270); - - // Left line - $this->img->Line($xt,$yt+$ih+$r,$xt,$yl-$r); - - // Indent horizontal, Lower left arc - $this->img->Line($xt+$r,$yt+$ih,$xt+$iw-$r,$yt+$ih); - $this->img->Arc($xt+$r,$yt+$ih+$r,$r*2,$r*2,180,270); - - // Indent vertical, Indent arc - $this->img->Line($xt+$iw,$yt+$r,$xt+$iw,$yt+$ih-$r); - $this->img->Arc($xt+$iw-$r,$yt+$ih-$r,$r*2,$r*2,0,90); - - if( $aFillColor != '' ) { - $bc = $this->img->current_color_name; - $this->img->PushColor($aFillColor); - $this->img->FillToBorder($xr-$r,$yl-$r,$bc); - $this->img->PopColor(); - } - - break; - - case 1: // Upper right - - // Bottom line, left & right arc - $this->img->Line($xt+$r,$yl,$xr-$r,$yl); - $this->img->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); - $this->img->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); - - // Left line, Top left arc - $this->img->Line($xt,$yt+$r,$xt,$yl-$r); - $this->img->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); - - // Top line, Top right arc - $this->img->Line($xt+$r,$yt,$xr-$iw-$r,$yt); - $this->img->Arc($xr-$iw-$r,$yt+$r,$r*2,$r*2,270,360); - - // Right line - $this->img->Line($xr,$yt+$ih+$r,$xr,$yl-$r); - - // Indent horizontal, Lower right arc - $this->img->Line($xr-$iw+$r,$yt+$ih,$xr-$r,$yt+$ih); - $this->img->Arc($xr-$r,$yt+$ih+$r,$r*2,$r*2,270,360); - - // Indent vertical, Indent arc - $this->img->Line($xr-$iw,$yt+$r,$xr-$iw,$yt+$ih-$r); - $this->img->Arc($xr-$iw+$r,$yt+$ih-$r,$r*2,$r*2,90,180); - - if( $aFillColor != '' ) { - $bc = $this->img->current_color_name; - $this->img->PushColor($aFillColor); - $this->img->FillToBorder($xt+$r,$yl-$r,$bc); - $this->img->PopColor(); - } - - break; - - case 2: // Lower right - // Top line, Top left & Top right arc - $this->img->Line($xt+$r,$yt,$xr-$r,$yt); - $this->img->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); - $this->img->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); - - // Left line, Bottom left arc - $this->img->Line($xt,$yt+$r,$xt,$yl-$r); - $this->img->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); - - // Bottom line, Bottom right arc - $this->img->Line($xt+$r,$yl,$xr-$iw-$r,$yl); - $this->img->Arc($xr-$iw-$r,$yl-$r,$r*2,$r*2,0,90); - - // Right line - $this->img->Line($xr,$yt+$r,$xr,$yl-$ih-$r); - - // Indent horizontal, Lower right arc - $this->img->Line($xr-$r,$yl-$ih,$xr-$iw+$r,$yl-$ih); - $this->img->Arc($xr-$r,$yl-$ih-$r,$r*2,$r*2,0,90); - - // Indent vertical, Indent arc - $this->img->Line($xr-$iw,$yl-$r,$xr-$iw,$yl-$ih+$r); - $this->img->Arc($xr-$iw+$r,$yl-$ih+$r,$r*2,$r*2,180,270); - - if( $aFillColor != '' ) { - $bc = $this->img->current_color_name; - $this->img->PushColor($aFillColor); - $this->img->FillToBorder($xt+$r,$yt+$r,$bc); - $this->img->PopColor(); - } - - break; - - case 3: // Lower left - // Top line, Top left & Top right arc - $this->img->Line($xt+$r,$yt,$xr-$r,$yt); - $this->img->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); - $this->img->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); - - // Right line, Bottom right arc - $this->img->Line($xr,$yt+$r,$xr,$yl-$r); - $this->img->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); - - // Bottom line, Bottom left arc - $this->img->Line($xt+$iw+$r,$yl,$xr-$r,$yl); - $this->img->Arc($xt+$iw+$r,$yl-$r,$r*2,$r*2,90,180); - - // Left line - $this->img->Line($xt,$yt+$r,$xt,$yl-$ih-$r); - - // Indent horizontal, Lower left arc - $this->img->Line($xt+$r,$yl-$ih,$xt+$iw-$r,$yl-$ih); - $this->img->Arc($xt+$r,$yl-$ih-$r,$r*2,$r*2,90,180); - - // Indent vertical, Indent arc - $this->img->Line($xt+$iw,$yl-$ih+$r,$xt+$iw,$yl-$r); - $this->img->Arc($xt+$iw-$r,$yl-$ih+$r,$r*2,$r*2,270,360); - - if( $aFillColor != '' ) { - $bc = $this->img->current_color_name; - $this->img->PushColor($aFillColor); - $this->img->FillToBorder($xr-$r,$yt+$r,$bc); - $this->img->PopColor(); - } - - break; - } - } -} - - -//=================================================== -// CLASS RectangleText -// Description: Draws a text paragraph inside a -// rounded, possible filled, rectangle. -//=================================================== -class CanvasRectangleText { - private $ix,$iy,$iw,$ih,$ir=4; - private $iTxt,$iColor='black',$iFillColor='',$iFontColor='black'; - private $iParaAlign='center'; - private $iAutoBoxMargin=5; - private $iShadowWidth=3,$iShadowColor=''; - - function __construct($aTxt='',$xl=0,$yt=0,$w=0,$h=0) { - $this->iTxt = new Text($aTxt); - $this->ix = $xl; - $this->iy = $yt; - $this->iw = $w; - $this->ih = $h; - } - - function SetShadow($aColor='gray',$aWidth=3) { - $this->iShadowColor = $aColor; - $this->iShadowWidth = $aWidth; - } - - function SetFont($FontFam,$aFontStyle,$aFontSize=12) { - $this->iTxt->SetFont($FontFam,$aFontStyle,$aFontSize); - } - - function SetTxt($aTxt) { - $this->iTxt->Set($aTxt); - } - - function ParagraphAlign($aParaAlign) { - $this->iParaAlign = $aParaAlign; - } - - function SetFillColor($aFillColor) { - $this->iFillColor = $aFillColor; - } - - function SetAutoMargin($aMargin) { - $this->iAutoBoxMargin=$aMargin; - } - - function SetColor($aColor) { - $this->iColor = $aColor; - } - - function SetFontColor($aColor) { - $this->iFontColor = $aColor; - } - - function SetPos($xl=0,$yt=0,$w=0,$h=0) { - $this->ix = $xl; - $this->iy = $yt; - $this->iw = $w; - $this->ih = $h; - } - - function Pos($xl=0,$yt=0,$w=0,$h=0) { - $this->ix = $xl; - $this->iy = $yt; - $this->iw = $w; - $this->ih = $h; - } - - function Set($aTxt,$xl,$yt,$w=0,$h=0) { - $this->iTxt->Set($aTxt); - $this->ix = $xl; - $this->iy = $yt; - $this->iw = $w; - $this->ih = $h; - } - - function SetCornerRadius($aRad=5) { - $this->ir = $aRad; - } - - function Stroke($aImg,$scale) { - - // If coordinates are specifed as negative this means we should - // treat them as abolsute (pixels) coordinates - if( $this->ix > 0 ) { - $this->ix = $scale->TranslateX($this->ix) ; - } - else { - $this->ix = -$this->ix; - } - - if( $this->iy > 0 ) { - $this->iy = $scale->TranslateY($this->iy) ; - } - else { - $this->iy = -$this->iy; - } - - list($this->iw,$this->ih) = $scale->Translate($this->iw,$this->ih) ; - - if( $this->iw == 0 ) - $this->iw = round($this->iTxt->GetWidth($aImg) + $this->iAutoBoxMargin); - if( $this->ih == 0 ) { - $this->ih = round($this->iTxt->GetTextHeight($aImg) + $this->iAutoBoxMargin); - } - - if( $this->iShadowColor != '' ) { - $aImg->PushColor($this->iShadowColor); - $aImg->FilledRoundedRectangle($this->ix+$this->iShadowWidth, - $this->iy+$this->iShadowWidth, - $this->ix+$this->iw-1+$this->iShadowWidth, - $this->iy+$this->ih-1+$this->iShadowWidth, - $this->ir); - $aImg->PopColor(); - } - - if( $this->iFillColor != '' ) { - $aImg->PushColor($this->iFillColor); - $aImg->FilledRoundedRectangle($this->ix,$this->iy, - $this->ix+$this->iw-1, - $this->iy+$this->ih-1, - $this->ir); - $aImg->PopColor(); - } - - if( $this->iColor != '' ) { - $aImg->PushColor($this->iColor); - $aImg->RoundedRectangle($this->ix,$this->iy, - $this->ix+$this->iw-1, - $this->iy+$this->ih-1, - $this->ir); - $aImg->PopColor(); - } - - $this->iTxt->Align('center','center'); - $this->iTxt->ParagraphAlign($this->iParaAlign); - $this->iTxt->SetColor($this->iFontColor); - $this->iTxt->Stroke($aImg, $this->ix+$this->iw/2, $this->iy+$this->ih/2); - - return array($this->iw, $this->ih); - - } - -} - - -?> diff --git a/#jpgraph/src/jpgraph_contour.php b/#jpgraph/src/jpgraph_contour.php deleted file mode 100644 index 760989e5..00000000 --- a/#jpgraph/src/jpgraph_contour.php +++ /dev/null @@ -1,587 +0,0 @@ -nbrRows = count($aMatrix); - $this->nbrCols = count($aMatrix[0]); - $this->dataPoints = $aMatrix; - - if( is_array($aIsobars) ) { - // use the isobar values supplied - $this->nbrIsobars = count($aIsobars); - $this->isobarValues = $aIsobars; - } - else { - // Determine the isobar values automatically - $this->nbrIsobars = $aIsobars; - list($min,$max) = $this->getMinMaxVal(); - $stepSize = ($max-$min) / $aIsobars ; - $isobar = $min+$stepSize/2; - for ($i = 0; $i < $aIsobars; $i++) { - $this->isobarValues[$i] = $isobar; - $isobar += $stepSize; - } - } - - if( $aColors !== null && count($aColors) > 0 ) { - - if( !is_array($aColors) ) { - JpGraphError::RaiseL(28001); - //'Third argument to Contour must be an array of colors.' - } - - if( count($aColors) != count($this->isobarValues) ) { - JpGraphError::RaiseL(28002); - //'Number of colors must equal the number of isobar lines specified'; - } - - $this->isobarColors = $aColors; - } - } - - /** - * Flip the plot around the Y-coordinate. This has the same affect as flipping the input - * data matrice - * - * @param $aFlg If true the the vertice in input data matrice position (0,0) corresponds to the top left - * corner of teh plot otherwise it will correspond to the bottom left corner (a horizontal flip) - */ - function SetInvert($aFlg=true) { - $this->invert = $aFlg; - } - - /** - * Find the min and max values in the data matrice - * - * @return array(min_value,max_value) - */ - function getMinMaxVal() { - $min = $this->dataPoints[0][0]; - $max = $this->dataPoints[0][0]; - for ($i = 0; $i < $this->nbrRows; $i++) { - if( ($mi=min($this->dataPoints[$i])) < $min ) $min = $mi; - if( ($ma=max($this->dataPoints[$i])) > $max ) $max = $ma; - } - return array($min,$max); - } - - /** - * Reset the two matrices that keeps track on where the isobars crosses the - * horizontal and vertical edges - */ - function resetEdgeMatrices() { - for ($k = 0; $k < 2; $k++) { - for ($i = 0; $i <= $this->nbrRows; $i++) { - for ($j = 0; $j <= $this->nbrCols; $j++) { - $this->edges[$k][$i][$j] = false; - } - } - } - } - - /** - * Determine if the specified isobar crosses the horizontal edge specified by its row and column - * - * @param $aRow Row index of edge to be checked - * @param $aCol Col index of edge to be checked - * @param $aIsobar Isobar value - * @return true if the isobar is crossing this edge - */ - function isobarHCrossing($aRow,$aCol,$aIsobar) { - - if( $aCol >= $this->nbrCols-1 ) { - JpGraphError::RaiseL(28003,$aCol); - //'ContourPlot Internal Error: isobarHCrossing: Coloumn index too large (%d)' - } - if( $aRow >= $this->nbrRows ) { - JpGraphError::RaiseL(28004,$aRow); - //'ContourPlot Internal Error: isobarHCrossing: Row index too large (%d)' - } - - $v1 = $this->dataPoints[$aRow][$aCol]; - $v2 = $this->dataPoints[$aRow][$aCol+1]; - - return ($aIsobar-$v1)*($aIsobar-$v2) < 0 ; - - } - - /** - * Determine if the specified isobar crosses the vertical edge specified by its row and column - * - * @param $aRow Row index of edge to be checked - * @param $aCol Col index of edge to be checked - * @param $aIsobar Isobar value - * @return true if the isobar is crossing this edge - */ - function isobarVCrossing($aRow,$aCol,$aIsobar) { - - if( $aRow >= $this->nbrRows-1) { - JpGraphError::RaiseL(28005,$aRow); - //'isobarVCrossing: Row index too large - } - if( $aCol >= $this->nbrCols ) { - JpGraphError::RaiseL(28006,$aCol); - //'isobarVCrossing: Col index too large - } - - $v1 = $this->dataPoints[$aRow][$aCol]; - $v2 = $this->dataPoints[$aRow+1][$aCol]; - - return ($aIsobar-$v1)*($aIsobar-$v2) < 0 ; - - } - - /** - * Determine all edges, horizontal and vertical that the specified isobar crosses. The crossings - * are recorded in the two edge matrices. - * - * @param $aIsobar The value of the isobar to be checked - */ - function determineIsobarEdgeCrossings($aIsobar) { - - $ib = $this->isobarValues[$aIsobar]; - - for ($i = 0; $i < $this->nbrRows-1; $i++) { - for ($j = 0; $j < $this->nbrCols-1; $j++) { - $this->edges[HORIZ_EDGE][$i][$j] = $this->isobarHCrossing($i,$j,$ib); - $this->edges[VERT_EDGE][$i][$j] = $this->isobarVCrossing($i,$j,$ib); - } - } - - // We now have the bottom and rightmost edges unsearched - for ($i = 0; $i < $this->nbrRows-1; $i++) { - $this->edges[VERT_EDGE][$i][$j] = $this->isobarVCrossing($i,$this->nbrCols-1,$ib); - } - for ($j = 0; $j < $this->nbrCols-1; $j++) { - $this->edges[HORIZ_EDGE][$i][$j] = $this->isobarHCrossing($this->nbrRows-1,$j,$ib); - } - - } - - /** - * Return the normalized coordinates for the crossing of the specified edge with the specified - * isobar- The crossing is simpy detrmined with a linear interpolation between the two vertices - * on each side of the edge and the value of the isobar - * - * @param $aRow Row of edge - * @param $aCol Column of edge - * @param $aEdgeDir Determine if this is a horizontal or vertical edge - * @param $ib The isobar value - * @return unknown_type - */ - function getCrossingCoord($aRow,$aCol,$aEdgeDir,$aIsobarVal) { - - // In order to avoid numerical problem when two vertices are very close - // we have to check and avoid dividing by close to zero denumerator. - if( $aEdgeDir == HORIZ_EDGE ) { - $d = abs($this->dataPoints[$aRow][$aCol] - $this->dataPoints[$aRow][$aCol+1]); - if( $d > 0.001 ) { - $xcoord = $aCol + abs($aIsobarVal - $this->dataPoints[$aRow][$aCol]) / $d; - } - else { - $xcoord = $aCol; - } - $ycoord = $aRow; - } - else { - $d = abs($this->dataPoints[$aRow][$aCol] - $this->dataPoints[$aRow+1][$aCol]); - if( $d > 0.001 ) { - $ycoord = $aRow + abs($aIsobarVal - $this->dataPoints[$aRow][$aCol]) / $d; - } - else { - $ycoord = $aRow; - } - $xcoord = $aCol; - } - if( $this->invert ) { - $ycoord = $this->nbrRows-1 - $ycoord; - } - return array($xcoord,$ycoord); - - } - - /** - * In order to avoid all kinds of unpleasent extra checks and complex boundary - * controls for the degenerated case where the contour levels exactly crosses - * one of the vertices we add a very small delta (0.1%) to the data point value. - * This has no visible affect but it makes the code sooooo much cleaner. - * - */ - function adjustDataPointValues() { - - $ni = count($this->isobarValues); - for ($k = 0; $k < $ni; $k++) { - $ib = $this->isobarValues[$k]; - for ($row = 0 ; $row < $this->nbrRows-1; ++$row) { - for ($col = 0 ; $col < $this->nbrCols-1; ++$col ) { - if( abs($this->dataPoints[$row][$col] - $ib) < 0.0001 ) { - $this->dataPoints[$row][$col] += $this->dataPoints[$row][$col]*0.001; - } - } - } - } - - } - - /** - * @param $aFlg - * @param $aBW - * @return unknown_type - */ - function UseHighContrastColor($aFlg=true,$aBW=false) { - $this->highcontrast = $aFlg; - $this->highcontrastbw = $aBW; - } - - /** - * Calculate suitable colors for each defined isobar - * - */ - function CalculateColors() { - if ( $this->highcontrast ) { - if ( $this->highcontrastbw ) { - for ($ib = 0; $ib < $this->nbrIsobars; $ib++) { - $this->isobarColors[$ib] = 'black'; - } - } - else { - // Use only blue/red scale - $step = round(255/($this->nbrIsobars-1)); - for ($ib = 0; $ib < $this->nbrIsobars; $ib++) { - $this->isobarColors[$ib] = array($ib*$step, 50, 255-$ib*$step); - } - } - } - else { - $n = $this->nbrIsobars; - $v = 0; $step = 1 / ($this->nbrIsobars-1); - for ($ib = 0; $ib < $this->nbrIsobars; $ib++) { - $this->isobarColors[$ib] = RGB::GetSpectrum($v); - $v += $step; - } - } - } - - /** - * This is where the main work is done. For each isobar the crossing of the edges are determined - * and then each cell is analyzed to find the 0, 2 or 4 crossings. Then the normalized coordinate - * for the crossings are determined and pushed on to the isobar stack. When the method is finished - * the $isobarCoord will hold one arrayfor each isobar where all the line segments that makes - * up the contour plot are stored. - * - * @return array( $isobarCoord, $isobarValues, $isobarColors ) - */ - function getIsobars() { - - $this->adjustDataPointValues(); - - for ($isobar = 0; $isobar < $this->nbrIsobars; $isobar++) { - - $ib = $this->isobarValues[$isobar]; - $this->resetEdgeMatrices(); - $this->determineIsobarEdgeCrossings($isobar); - $this->isobarCoord[$isobar] = array(); - - $ncoord = 0; - - for ($row = 0 ; $row < $this->nbrRows-1; ++$row) { - for ($col = 0 ; $col < $this->nbrCols-1; ++$col ) { - - // Find out how many crossings around the edges - $n = 0; - if ( $this->edges[HORIZ_EDGE][$row][$col] ) $neigh[$n++] = array($row, $col, HORIZ_EDGE); - if ( $this->edges[HORIZ_EDGE][$row+1][$col] ) $neigh[$n++] = array($row+1,$col, HORIZ_EDGE); - if ( $this->edges[VERT_EDGE][$row][$col] ) $neigh[$n++] = array($row, $col, VERT_EDGE); - if ( $this->edges[VERT_EDGE][$row][$col+1] ) $neigh[$n++] = array($row, $col+1,VERT_EDGE); - - if ( $n == 2 ) { - $n1=0; $n2=1; - $this->isobarCoord[$isobar][$ncoord++] = array( - $this->getCrossingCoord($neigh[$n1][0],$neigh[$n1][1],$neigh[$n1][2],$ib), - $this->getCrossingCoord($neigh[$n2][0],$neigh[$n2][1],$neigh[$n2][2],$ib) ); - } - elseif ( $n == 4 ) { - // We must determine how to connect the edges either northwest->southeast or - // northeast->southwest. We do that by calculating the imaginary middle value of - // the cell by averaging the for corners. This will compared with the value of the - // top left corner will help determine the orientation of the ridge/creek - $midval = ($this->dataPoints[$row][$col]+$this->dataPoints[$row][$col+1]+$this->dataPoints[$row+1][$col]+$this->dataPoints[$row+1][$col+1])/4; - $v = $this->dataPoints[$row][$col]; - if( $midval == $ib ) { - // Orientation "+" - $n1=0; $n2=1; $n3=2; $n4=3; - } elseif ( ($midval > $ib && $v > $ib) || ($midval < $ib && $v < $ib) ) { - // Orientation of ridge/valley = "\" - $n1=0; $n2=3; $n3=2; $n4=1; - } elseif ( ($midval > $ib && $v < $ib) || ($midval < $ib && $v > $ib) ) { - // Orientation of ridge/valley = "/" - $n1=0; $n2=2; $n3=3; $n4=1; - } - - $this->isobarCoord[$isobar][$ncoord++] = array( - $this->getCrossingCoord($neigh[$n1][0],$neigh[$n1][1],$neigh[$n1][2],$ib), - $this->getCrossingCoord($neigh[$n2][0],$neigh[$n2][1],$neigh[$n2][2],$ib) ); - - $this->isobarCoord[$isobar][$ncoord++] = array( - $this->getCrossingCoord($neigh[$n3][0],$neigh[$n3][1],$neigh[$n3][2],$ib), - $this->getCrossingCoord($neigh[$n4][0],$neigh[$n4][1],$neigh[$n4][2],$ib) ); - - } - } - } - } - - if( count($this->isobarColors) == 0 ) { - // No manually specified colors. Calculate them automatically. - $this->CalculateColors(); - } - return array( $this->isobarCoord, $this->isobarValues, $this->isobarColors ); - } -} - - -/** - * This class represent a plotting of a contour outline of data given as a X-Y matrice - * - */ -class ContourPlot extends Plot { - - private $contour, $contourCoord, $contourVal, $contourColor; - private $nbrCountours = 0 ; - private $dataMatrix = array(); - private $invertLegend = false; - private $interpFactor = 1; - private $flipData = false; - private $isobar = 10; - private $showLegend = false; - private $highcontrast = false, $highcontrastbw = false; - private $manualIsobarColors = array(); - - /** - * Construct a contour plotting algorithm. The end result of the algorithm is a sequence of - * line segments for each isobar given as two vertices. - * - * @param $aDataMatrix The Z-data to be used - * @param $aIsobar A mixed variable, if it is an integer then this specified the number of isobars to use. - * The values of the isobars are automatically detrmined to be equ-spaced between the min/max value of the - * data. If it is an array then it explicetely gives the isobar values - * @param $aInvert By default the matrice with row index 0 corresponds to Y-value 0, i.e. in the bottom of - * the plot. If this argument is true then the row with the highest index in the matrice corresponds to - * Y-value 0. In affect flipping the matrice around an imaginary horizontal axis. - * @param $aHighContrast Use high contrast colors (blue/red:ish) - * @param $aHighContrastBW Use only black colors for contours - * @return an instance of the contour plot algorithm - */ - function __construct($aDataMatrix, $aIsobar=10, $aFactor=1, $aInvert=false, $aIsobarColors=array()) { - - $this->dataMatrix = $aDataMatrix; - $this->flipData = $aInvert; - $this->isobar = $aIsobar; - $this->interpFactor = $aFactor; - - if ( $this->interpFactor > 1 ) { - - if( $this->interpFactor > 5 ) { - JpGraphError::RaiseL(28007);// ContourPlot interpolation factor is too large (>5) - } - - $ip = new MeshInterpolate(); - $this->dataMatrix = $ip->Linear($this->dataMatrix, $this->interpFactor); - } - - $this->contour = new Contour($this->dataMatrix,$this->isobar,$aIsobarColors); - - if( is_array($aIsobar) ) - $this->nbrContours = count($aIsobar); - else - $this->nbrContours = $aIsobar; - } - - - /** - * Flipe the data around the center - * - * @param $aFlg - * - */ - function SetInvert($aFlg=true) { - $this->flipData = $aFlg; - } - - /** - * Set the colors for the isobar lines - * - * @param $aColorArray - * - */ - function SetIsobarColors($aColorArray) { - $this->manualIsobarColors = $aColorArray; - } - - /** - * Show the legend - * - * @param $aFlg true if the legend should be shown - * - */ - function ShowLegend($aFlg=true) { - $this->showLegend = $aFlg; - } - - - /** - * @param $aFlg true if the legend should start with the lowest isobar on top - * @return unknown_type - */ - function Invertlegend($aFlg=true) { - $this->invertLegend = $aFlg; - } - - /* Internal method. Give the min value to be used for the scaling - * - */ - function Min() { - return array(0,0); - } - - /* Internal method. Give the max value to be used for the scaling - * - */ - function Max() { - return array(count($this->dataMatrix[0])-1,count($this->dataMatrix)-1); - } - - /** - * Internal ramewrok method to setup the legend to be used for this plot. - * @param $aGraph The parent graph class - */ - function Legend($aGraph) { - - if( ! $this->showLegend ) - return; - - if( $this->invertLegend ) { - for ($i = 0; $i < $this->nbrContours; $i++) { - $aGraph->legend->Add(sprintf('%.1f',$this->contourVal[$i]), $this->contourColor[$i]); - } - } - else { - for ($i = $this->nbrContours-1; $i >= 0 ; $i--) { - $aGraph->legend->Add(sprintf('%.1f',$this->contourVal[$i]), $this->contourColor[$i]); - } - } - } - - - /** - * Framework function which gets called before the Stroke() method is called - * - * @see Plot#PreScaleSetup($aGraph) - * - */ - function PreScaleSetup($aGraph) { - $xn = count($this->dataMatrix[0])-1; - $yn = count($this->dataMatrix)-1; - - $aGraph->xaxis->scale->Update($aGraph->img,0,$xn); - $aGraph->yaxis->scale->Update($aGraph->img,0,$yn); - - $this->contour->SetInvert($this->flipData); - list($this->contourCoord,$this->contourVal,$this->contourColor) = $this->contour->getIsobars(); - } - - /** - * Use high contrast color schema - * - * @param $aFlg True, to use high contrast color - * @param $aBW True, Use only black and white color schema - */ - function UseHighContrastColor($aFlg=true,$aBW=false) { - $this->highcontrast = $aFlg; - $this->highcontrastbw = $aBW; - $this->contour->UseHighContrastColor($this->highcontrast,$this->highcontrastbw); - } - - /** - * Internal method. Stroke the contour plot to the graph - * - * @param $img Image handler - * @param $xscale Instance of the xscale to use - * @param $yscale Instance of the yscale to use - */ - function Stroke($img,$xscale,$yscale) { - - if( count($this->manualIsobarColors) > 0 ) { - $this->contourColor = $this->manualIsobarColors; - if( count($this->manualIsobarColors) != $this->nbrContours ) { - JpGraphError::RaiseL(28002); - } - } - - $img->SetLineWeight($this->line_weight); - - for ($c = 0; $c < $this->nbrContours; $c++) { - - $img->SetColor( $this->contourColor[$c] ); - - $n = count($this->contourCoord[$c]); - $i = 0; - while ( $i < $n ) { - list($x1,$y1) = $this->contourCoord[$c][$i][0]; - $x1t = $xscale->Translate($x1); - $y1t = $yscale->Translate($y1); - - list($x2,$y2) = $this->contourCoord[$c][$i++][1]; - $x2t = $xscale->Translate($x2); - $y2t = $yscale->Translate($y2); - - $img->Line($x1t,$y1t,$x2t,$y2t); - } - - } - } - -} - -// EOF -?> diff --git a/#jpgraph/src/jpgraph_date.php b/#jpgraph/src/jpgraph_date.php deleted file mode 100644 index db4c441c..00000000 --- a/#jpgraph/src/jpgraph_date.php +++ /dev/null @@ -1,499 +0,0 @@ -type=$aType; - $this->scale=array($aMin,$aMax); - $this->world_size=$aMax-$aMin; - $this->ticks = new LinearTicks(); - $this->intscale=true; - } - - - //------------------------------------------------------------------------------------------ - // Utility Function AdjDate() - // Description: Will round a given time stamp to an even year, month or day - // argument. - //------------------------------------------------------------------------------------------ - - function AdjDate($aTime,$aRound=0,$aYearType=false,$aMonthType=false,$aDayType=false) { - $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); - $h=0;$i=0;$s=0; - if( $aYearType !== false ) { - $yearAdj = array(0=>1, 1=>2, 2=>5); - if( $aRound == 0 ) { - $y = floor($y/$yearAdj[$aYearType])*$yearAdj[$aYearType]; - } - else { - ++$y; - $y = ceil($y/$yearAdj[$aYearType])*$yearAdj[$aYearType]; - } - $m=1;$d=1; - } - elseif( $aMonthType !== false ) { - $monthAdj = array(0=>1, 1=>6); - if( $aRound == 0 ) { - $m = floor($m/$monthAdj[$aMonthType])*$monthAdj[$aMonthType]; - $d=1; - } - else { - ++$m; - $m = ceil($m/$monthAdj[$aMonthType])*$monthAdj[$aMonthType]; - $d=1; - } - } - elseif( $aDayType !== false ) { - if( $aDayType == 0 ) { - if( $aRound == 1 ) { - //++$d; - $h=23;$i=59;$s=59; - } - } - else { - // Adjust to an even week boundary. - $w = (int)date('w',$aTime); // Day of week 0=Sun, 6=Sat - if( true ) { // Adjust to start on Mon - if( $w==0 ) $w=6; - else --$w; - } - if( $aRound == 0 ) { - $d -= $w; - } - else { - $d += (7-$w); - $h=23;$i=59;$s=59; - } - } - } - return mktime($h,$i,$s,$m,$d,$y); - - } - - //------------------------------------------------------------------------------------------ - // Wrapper for AdjDate that will round a timestamp to an even date rounding - // it downwards. - //------------------------------------------------------------------------------------------ - function AdjStartDate($aTime,$aYearType=false,$aMonthType=false,$aDayType=false) { - return $this->AdjDate($aTime,0,$aYearType,$aMonthType,$aDayType); - } - - //------------------------------------------------------------------------------------------ - // Wrapper for AdjDate that will round a timestamp to an even date rounding - // it upwards - //------------------------------------------------------------------------------------------ - function AdjEndDate($aTime,$aYearType=false,$aMonthType=false,$aDayType=false) { - return $this->AdjDate($aTime,1,$aYearType,$aMonthType,$aDayType); - } - - //------------------------------------------------------------------------------------------ - // Utility Function AdjTime() - // Description: Will round a given time stamp to an even time according to - // argument. - //------------------------------------------------------------------------------------------ - - function AdjTime($aTime,$aRound=0,$aHourType=false,$aMinType=false,$aSecType=false) { - $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); - $h = (int)date('H',$aTime); $i = (int)date('i',$aTime); $s = (int)date('s',$aTime); - if( $aHourType !== false ) { - $aHourType %= 6; - $hourAdj = array(0=>1, 1=>2, 2=>3, 3=>4, 4=>6, 5=>12); - if( $aRound == 0 ) - $h = floor($h/$hourAdj[$aHourType])*$hourAdj[$aHourType]; - else { - if( ($h % $hourAdj[$aHourType]==0) && ($i > 0 || $s > 0) ) { - $h++; - } - $h = ceil($h/$hourAdj[$aHourType])*$hourAdj[$aHourType]; - if( $h >= 24 ) { - $aTime += 86400; - $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); - $h -= 24; - } - } - $i=0;$s=0; - } - elseif( $aMinType !== false ) { - $aMinType %= 5; - $minAdj = array(0=>1, 1=>5, 2=>10, 3=>15, 4=>30); - if( $aRound == 0 ) { - $i = floor($i/$minAdj[$aMinType])*$minAdj[$aMinType]; - } - else { - if( ($i % $minAdj[$aMinType]==0) && $s > 0 ) { - $i++; - } - $i = ceil($i/$minAdj[$aMinType])*$minAdj[$aMinType]; - if( $i >= 60) { - $aTime += 3600; - $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); - $h = (int)date('H',$aTime); $i = 0; - } - } - $s=0; - } - elseif( $aSecType !== false ) { - $aSecType %= 5; - $secAdj = array(0=>1, 1=>5, 2=>10, 3=>15, 4=>30); - if( $aRound == 0 ) { - $s = floor($s/$secAdj[$aSecType])*$secAdj[$aSecType]; - } - else { - $s = ceil($s/$secAdj[$aSecType]*1.0)*$secAdj[$aSecType]; - if( $s >= 60) { - $s=0; - $aTime += 60; - $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); - $h = (int)date('H',$aTime); $i = (int)date('i',$aTime); - } - } - } - return mktime($h,$i,$s,$m,$d,$y); - } - - //------------------------------------------------------------------------------------------ - // Wrapper for AdjTime that will round a timestamp to an even time rounding - // it downwards. - // Example: AdjStartTime(mktime(18,27,13,2,22,2005),false,2) => 18:20 - //------------------------------------------------------------------------------------------ - function AdjStartTime($aTime,$aHourType=false,$aMinType=false,$aSecType=false) { - return $this->AdjTime($aTime,0,$aHourType,$aMinType,$aSecType); - } - - //------------------------------------------------------------------------------------------ - // Wrapper for AdjTime that will round a timestamp to an even time rounding - // it upwards - // Example: AdjEndTime(mktime(18,27,13,2,22,2005),false,2) => 18:30 - //------------------------------------------------------------------------------------------ - function AdjEndTime($aTime,$aHourType=false,$aMinType=false,$aSecType=false) { - return $this->AdjTime($aTime,1,$aHourType,$aMinType,$aSecType); - } - - //------------------------------------------------------------------------------------------ - // DateAutoScale - // Autoscale a date axis given start and end time - // Returns an array ($start,$end,$major,$minor,$format) - //------------------------------------------------------------------------------------------ - function DoDateAutoScale($aStartTime,$aEndTime,$aDensity=0,$aAdjust=true) { - // Format of array - // array ( Decision point, array( array( Major-scale-step-array ), - // array( Minor-scale-step-array ), - // array( 0=date-adjust, 1=time-adjust, adjustment-alignment) ) - // - $scalePoints = - array( - /* Intervall larger than 10 years */ - SECPERYEAR*10,array(array(SECPERYEAR*5,SECPERYEAR*2), - array(SECPERYEAR), - array(0,YEARADJ_1, 0,YEARADJ_1) ), - - /* Intervall larger than 2 years */ - SECPERYEAR*2,array(array(SECPERYEAR),array(SECPERYEAR), - array(0,YEARADJ_1) ), - - /* Intervall larger than 90 days (approx 3 month) */ - SECPERDAY*90,array(array(SECPERDAY*30,SECPERDAY*14,SECPERDAY*7,SECPERDAY), - array(SECPERDAY*5,SECPERDAY*7,SECPERDAY,SECPERDAY), - array(0,MONTHADJ_1, 0,DAYADJ_WEEK, 0,DAYADJ_1, 0,DAYADJ_1)), - - /* Intervall larger than 30 days (approx 1 month) */ - SECPERDAY*30,array(array(SECPERDAY*14,SECPERDAY*7,SECPERDAY*2, SECPERDAY), - array(SECPERDAY,SECPERDAY,SECPERDAY,SECPERDAY), - array(0,DAYADJ_WEEK, 0,DAYADJ_1, 0,DAYADJ_1, 0,DAYADJ_1)), - - /* Intervall larger than 7 days */ - SECPERDAY*7,array(array(SECPERDAY,SECPERHOUR*12,SECPERHOUR*6,SECPERHOUR*2), - array(SECPERHOUR*6,SECPERHOUR*3,SECPERHOUR,SECPERHOUR), - array(0,DAYADJ_1, 1,HOURADJ_12, 1,HOURADJ_6, 1,HOURADJ_1)), - - /* Intervall larger than 1 day */ - SECPERDAY,array(array(SECPERDAY,SECPERHOUR*12,SECPERHOUR*6,SECPERHOUR*2,SECPERHOUR), - array(SECPERHOUR*6,SECPERHOUR*2,SECPERHOUR,SECPERHOUR,SECPERHOUR), - array(1,HOURADJ_12, 1,HOURADJ_6, 1,HOURADJ_1, 1,HOURADJ_1)), - - /* Intervall larger than 12 hours */ - SECPERHOUR*12,array(array(SECPERHOUR*2,SECPERHOUR,SECPERMIN*30,900,600), - array(1800,1800,900,300,300), - array(1,HOURADJ_1, 1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ), - - /* Intervall larger than 2 hours */ - SECPERHOUR*2,array(array(SECPERHOUR,SECPERMIN*30,900,600,300), - array(1800,900,300,120,60), - array(1,HOURADJ_1, 1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ), - - /* Intervall larger than 1 hours */ - SECPERHOUR,array(array(SECPERMIN*30,900,600,300),array(900,300,120,60), - array(1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ), - - /* Intervall larger than 30 min */ - SECPERMIN*30,array(array(SECPERMIN*15,SECPERMIN*10,SECPERMIN*5,SECPERMIN), - array(300,300,60,10), - array(1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5, 1,MINADJ_1)), - - /* Intervall larger than 1 min */ - SECPERMIN,array(array(SECPERMIN,15,10,5), - array(15,5,2,1), - array(1,MINADJ_1, 1,SECADJ_15, 1,SECADJ_10, 1,SECADJ_5)), - - /* Intervall larger than 10 sec */ - 10,array(array(5,2), - array(1,1), - array(1,SECADJ_5, 1,SECADJ_1)), - - /* Intervall larger than 1 sec */ - 1,array(array(1), - array(1), - array(1,SECADJ_1)), - ); - - $ns = count($scalePoints); - // Establish major and minor scale units for the date scale - $diff = $aEndTime - $aStartTime; - if( $diff < 1 ) return false; - $done=false; - $i=0; - while( ! $done ) { - if( $diff > $scalePoints[2*$i] ) { - // Get major and minor scale for this intervall - $scaleSteps = $scalePoints[2*$i+1]; - $major = $scaleSteps[0][min($aDensity,count($scaleSteps[0])-1)]; - // Try to find out which minor step looks best - $minor = $scaleSteps[1][min($aDensity,count($scaleSteps[1])-1)]; - if( $aAdjust ) { - // Find out how we should align the start and end timestamps - $idx = 2*min($aDensity,floor(count($scaleSteps[2])/2)-1); - if( $scaleSteps[2][$idx] === 0 ) { - // Use date adjustment - $adj = $scaleSteps[2][$idx+1]; - if( $adj >= 30 ) { - $start = $this->AdjStartDate($aStartTime,$adj-30); - $end = $this->AdjEndDate($aEndTime,$adj-30); - } - elseif( $adj >= 20 ) { - $start = $this->AdjStartDate($aStartTime,false,$adj-20); - $end = $this->AdjEndDate($aEndTime,false,$adj-20); - } - else { - $start = $this->AdjStartDate($aStartTime,false,false,$adj); - $end = $this->AdjEndDate($aEndTime,false,false,$adj); - // We add 1 second for date adjustment to make sure we end on 00:00 the following day - // This makes the final major tick be srawn when we step day-by-day instead of ending - // on xx:59:59 which would not draw the final major tick - $end++; - } - } - else { - // Use time adjustment - $adj = $scaleSteps[2][$idx+1]; - if( $adj >= 30 ) { - $start = $this->AdjStartTime($aStartTime,$adj-30); - $end = $this->AdjEndTime($aEndTime,$adj-30); - } - elseif( $adj >= 20 ) { - $start = $this->AdjStartTime($aStartTime,false,$adj-20); - $end = $this->AdjEndTime($aEndTime,false,$adj-20); - } - else { - $start = $this->AdjStartTime($aStartTime,false,false,$adj); - $end = $this->AdjEndTime($aEndTime,false,false,$adj); - } - } - } - // If the overall date span is larger than 1 day ten we show date - $format = ''; - if( ($end-$start) > SECPERDAY ) { - $format = 'Y-m-d '; - } - // If the major step is less than 1 day we need to whow hours + min - if( $major < SECPERDAY ) { - $format .= 'H:i'; - } - // If the major step is less than 1 min we need to show sec - if( $major < 60 ) { - $format .= ':s'; - } - $done=true; - } - ++$i; - } - return array($start,$end,$major,$minor,$format); - } - - // Overrides the automatic determined date format. Must be a valid date() format string - function SetDateFormat($aFormat) { - $this->date_format = $aFormat; - $this->ticks->SetLabelDateFormat($this->date_format); - } - - function AdjustForDST($aFlg=true) { - $this->ticks->AdjustForDST($aFlg); - } - - - function SetDateAlign($aStartAlign,$aEndAlign=false) { - if( $aEndAlign === false ) { - $aEndAlign=$aStartAlign; - } - $this->iStartAlign = $aStartAlign; - $this->iEndAlign = $aEndAlign; - } - - function SetTimeAlign($aStartAlign,$aEndAlign=false) { - if( $aEndAlign === false ) { - $aEndAlign=$aStartAlign; - } - $this->iStartTimeAlign = $aStartAlign; - $this->iEndTimeAlign = $aEndAlign; - } - - - function AutoScale($img,$aStartTime,$aEndTime,$aNumSteps,$_adummy=false) { - // We need to have one dummy argument to make the signature of AutoScale() - // identical to LinearScale::AutoScale - if( $aStartTime == $aEndTime ) { - // Special case when we only have one data point. - // Create a small artifical intervall to do the autoscaling - $aStartTime -= 10; - $aEndTime += 10; - } - $done=false; - $i=0; - while( ! $done && $i < 5) { - list($adjstart,$adjend,$maj,$min,$format) = $this->DoDateAutoScale($aStartTime,$aEndTime,$i); - $n = floor(($adjend-$adjstart)/$maj); - if( $n * 1.7 > $aNumSteps ) { - $done=true; - } - $i++; - } - - /* - if( 0 ) { // DEBUG - echo " Start =".date("Y-m-d H:i:s",$aStartTime)."
"; - echo " End =".date("Y-m-d H:i:s",$aEndTime)."
"; - echo "Adj Start =".date("Y-m-d H:i:s",$adjstart)."
"; - echo "Adj End =".date("Y-m-d H:i:s",$adjend)."

"; - echo "Major = $maj s, ".floor($maj/60)."min, ".floor($maj/3600)."h, ".floor($maj/86400)."day
"; - echo "Min = $min s, ".floor($min/60)."min, ".floor($min/3600)."h, ".floor($min/86400)."day
"; - echo "Format=$format

"; - } - */ - - if( $this->iStartTimeAlign !== false && $this->iStartAlign !== false ) { - JpGraphError::RaiseL(3001); - //('It is only possible to use either SetDateAlign() or SetTimeAlign() but not both'); - } - - if( $this->iStartTimeAlign !== false ) { - if( $this->iStartTimeAlign >= 30 ) { - $adjstart = $this->AdjStartTime($aStartTime,$this->iStartTimeAlign-30); - } - elseif( $this->iStartTimeAlign >= 20 ) { - $adjstart = $this->AdjStartTime($aStartTime,false,$this->iStartTimeAlign-20); - } - else { - $adjstart = $this->AdjStartTime($aStartTime,false,false,$this->iStartTimeAlign); - } - } - if( $this->iEndTimeAlign !== false ) { - if( $this->iEndTimeAlign >= 30 ) { - $adjend = $this->AdjEndTime($aEndTime,$this->iEndTimeAlign-30); - } - elseif( $this->iEndTimeAlign >= 20 ) { - $adjend = $this->AdjEndTime($aEndTime,false,$this->iEndTimeAlign-20); - } - else { - $adjend = $this->AdjEndTime($aEndTime,false,false,$this->iEndTimeAlign); - } - } - - - - if( $this->iStartAlign !== false ) { - if( $this->iStartAlign >= 30 ) { - $adjstart = $this->AdjStartDate($aStartTime,$this->iStartAlign-30); - } - elseif( $this->iStartAlign >= 20 ) { - $adjstart = $this->AdjStartDate($aStartTime,false,$this->iStartAlign-20); - } - else { - $adjstart = $this->AdjStartDate($aStartTime,false,false,$this->iStartAlign); - } - } - if( $this->iEndAlign !== false ) { - if( $this->iEndAlign >= 30 ) { - $adjend = $this->AdjEndDate($aEndTime,$this->iEndAlign-30); - } - elseif( $this->iEndAlign >= 20 ) { - $adjend = $this->AdjEndDate($aEndTime,false,$this->iEndAlign-20); - } - else { - $adjend = $this->AdjEndDate($aEndTime,false,false,$this->iEndAlign); - } - } - $this->Update($img,$adjstart,$adjend); - if( ! $this->ticks->IsSpecified() ) - $this->ticks->Set($maj,$min); - if( $this->date_format == '' ) - $this->ticks->SetLabelDateFormat($format); - else - $this->ticks->SetLabelDateFormat($this->date_format); - } -} - - -?> diff --git a/#jpgraph/src/jpgraph_errhandler.inc.php b/#jpgraph/src/jpgraph_errhandler.inc.php deleted file mode 100644 index c15361e3..00000000 --- a/#jpgraph/src/jpgraph_errhandler.inc.php +++ /dev/null @@ -1,369 +0,0 @@ -lt = $_jpg_messages; - } - - function Get($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { - GLOBAL $__jpg_err_locale; - if( !isset($this->lt[$errnbr]) ) { - return 'Internal error: The specified error message ('.$errnbr.') does not exist in the chosen locale ('.$__jpg_err_locale.')'; - } - $ea = $this->lt[$errnbr]; - $j=0; - if( $a1 !== null ) { - $argv[$j++] = $a1; - if( $a2 !== null ) { - $argv[$j++] = $a2; - if( $a3 !== null ) { - $argv[$j++] = $a3; - if( $a4 !== null ) { - $argv[$j++] = $a4; - if( $a5 !== null ) { - $argv[$j++] = $a5; - } - } - } - } - } - $numargs = $j; - if( $ea[1] != $numargs ) { - // Error message argument count do not match. - // Just return the error message without arguments. - return $ea[0]; - } - switch( $numargs ) { - case 1: - $msg = sprintf($ea[0],$argv[0]); - break; - case 2: - $msg = sprintf($ea[0],$argv[0],$argv[1]); - break; - case 3: - $msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2]); - break; - case 4: - $msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2],$argv[3]); - break; - case 5: - $msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2],$argv[3],$argv[4]); - break; - case 0: - default: - $msg = sprintf($ea[0]); - break; - } - return $msg; - } -} - -// -// A wrapper class that is used to access the specified error object -// (to hide the global error parameter and avoid having a GLOBAL directive -// in all methods. -// -class JpGraphError { - private static $__iImgFlg = true; - private static $__iLogFile = ''; - private static $__iTitle = 'JpGraph Error: '; - public static function Raise($aMsg,$aHalt=true){ - throw new JpGraphException($aMsg); - } - public static function SetErrLocale($aLoc) { - GLOBAL $__jpg_err_locale ; - $__jpg_err_locale = $aLoc; - } - public static function RaiseL($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { - throw new JpGraphExceptionL($errnbr,$a1,$a2,$a3,$a4,$a5); - } - public static function SetImageFlag($aFlg=true) { - self::$__iImgFlg = $aFlg; - } - public static function GetImageFlag() { - return self::$__iImgFlg; - } - public static function SetLogFile($aFile) { - self::$__iLogFile = $aFile; - } - public static function GetLogFile() { - return self::$__iLogFile; - } - public static function SetTitle($aTitle) { - self::$__iTitle = $aTitle; - } - public static function GetTitle() { - return self::$__iTitle; - } -} - -class JpGraphException extends Exception { - // Redefine the exception so message isn't optional - public function __construct($message, $code = 0) { - // make sure everything is assigned properly - parent::__construct($message, $code); - } - // custom string representation of object - public function _toString() { - return __CLASS__ . ": [{$this->code}]: {$this->message} at " . basename($this->getFile()) . ":" . $this->getLine() . "\n" . $this->getTraceAsString() . "\n"; - } - // custom representation of error as an image - public function Stroke() { - if( JpGraphError::GetImageFlag() ) { - $errobj = new JpGraphErrObjectImg(); - $errobj->SetTitle(JpGraphError::GetTitle()); - } - else { - $errobj = new JpGraphErrObject(); - $errobj->SetTitle(JpGraphError::GetTitle()); - $errobj->SetStrokeDest(JpGraphError::GetLogFile()); - } - $errobj->Raise($this->getMessage()); - } - static public function defaultHandler(Exception $exception) { - global $__jpg_OldHandler; - if( $exception instanceof JpGraphException ) { - $exception->Stroke(); - } - else { - // Restore old handler - if( $__jpg_OldHandler !== NULL ) { - set_exception_handler($__jpg_OldHandler); - } - throw $exception; - } - } -} - -class JpGraphExceptionL extends JpGraphException { - // Redefine the exception so message isn't optional - public function __construct($errcode,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { - // make sure everything is assigned properly - $errtxt = new ErrMsgText(); - JpGraphError::SetTitle('JpGraph Error: '.$errcode); - parent::__construct($errtxt->Get($errcode,$a1,$a2,$a3,$a4,$a5), 0); - } -} - -// Setup the default handler -global $__jpg_OldHandler; -$__jpg_OldHandler = set_exception_handler(array('JpGraphException','defaultHandler')); - -// -// First of all set up a default error handler -// - -//============================================================= -// The default trivial text error handler. -//============================================================= -class JpGraphErrObject { - - protected $iTitle = "JpGraph error: "; - protected $iDest = false; - - - function __construct() { - // Empty. Reserved for future use - } - - function SetTitle($aTitle) { - $this->iTitle = $aTitle; - } - - function SetStrokeDest($aDest) { - $this->iDest = $aDest; - } - - // If aHalt is true then execution can't continue. Typical used for fatal errors - function Raise($aMsg,$aHalt=false) { - if( $this->iDest != '' ) { - if( $this->iDest == 'syslog' ) { - error_log($this->iTitle.$aMsg); - } - else { - $str = '['.date('r').'] '.$this->iTitle.$aMsg."\n"; - $f = @fopen($this->iDest,'a'); - if( $f ) { - @fwrite($f,$str); - @fclose($f); - } - } - } - else { - $aMsg = $this->iTitle.$aMsg; - // Check SAPI and if we are called from the command line - // send the error to STDERR instead - if( PHP_SAPI == 'cli' ) { - fwrite(STDERR,$aMsg); - } - else { - echo $aMsg; - } - } - if( $aHalt ) - exit(1); - } -} - -//============================================================== -// An image based error handler -//============================================================== -class JpGraphErrObjectImg extends JpGraphErrObject { - - function __construct() { - parent::__construct(); - // Empty. Reserved for future use - } - - function Raise($aMsg,$aHalt=true) { - $img_iconerror = - 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAaV'. - 'BMVEX//////2Xy8mLl5V/Z2VvMzFi/v1WyslKlpU+ZmUyMjEh/'. - 'f0VyckJlZT9YWDxMTDjAwMDy8sLl5bnY2K/MzKW/v5yyspKlpY'. - 'iYmH+MjHY/PzV/f2xycmJlZVlZWU9MTEXY2Ms/PzwyMjLFTjea'. - 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'. - 'IAAAsSAdLdfvwAAAAHdElNRQfTBgISOCqusfs5AAABLUlEQVR4'. - '2tWV3XKCMBBGWfkranCIVClKLd/7P2Q3QsgCxjDTq+6FE2cPH+'. - 'xJ0Ogn2lQbsT+Wrs+buAZAV4W5T6Bs0YXBBwpKgEuIu+JERAX6'. - 'wM2rHjmDdEITmsQEEmWADgZm6rAjhXsoMGY9B/NZBwJzBvn+e3'. - 'wHntCAJdGu9SviwIwoZVDxPB9+Rc0TSEbQr0j3SA1gwdSn6Db0'. - '6Tm1KfV6yzWGQO7zdpvyKLKBDmRFjzeB3LYgK7r6A/noDAfjtS'. - 'IXaIzbJSv6WgUebTMV4EoRB8a2mQiQjgtF91HdKDKZ1gtFtQjk'. - 'YcWaR5OKOhkYt+ZsTFdJRfPAApOpQYJTNHvCRSJR6SJngQadfc'. - 'vd69OLMddVOPCGVnmrFD8bVYd3JXfxXPtLR/+mtv59/ALWiiMx'. - 'qL72fwAAAABJRU5ErkJggg==' ; - - - if( function_exists("imagetypes") ) { - $supported = imagetypes(); - } else { - $supported = 0; - } - - if( !function_exists('imagecreatefromstring') ) { - $supported = 0; - } - - if( ob_get_length() || headers_sent() || !($supported & IMG_PNG) ) { - // Special case for headers already sent or that the installation doesn't support - // the PNG format (which the error icon is encoded in). - // Dont return an image since it can't be displayed - die($this->iTitle.' '.$aMsg); - } - - $aMsg = wordwrap($aMsg,55); - $lines = substr_count($aMsg,"\n"); - - // Create the error icon GD - $erricon = Image::CreateFromString(base64_decode($img_iconerror)); - - // Create an image that contains the error text. - $w=400; - $h=100 + 15*max(0,$lines-3); - - $img = new Image($w,$h); - - - // Drop shadow - $img->SetColor("gray"); - $img->FilledRectangle(5,5,$w-1,$h-1,10); - $img->SetColor("gray:0.7"); - $img->FilledRectangle(5,5,$w-3,$h-3,10); - - // Window background - $img->SetColor("lightblue"); - $img->FilledRectangle(1,1,$w-5,$h-5); - $img->CopyCanvasH($img->img,$erricon,5,30,0,0,40,40); - - // Window border - $img->SetColor("black"); - $img->Rectangle(1,1,$w-5,$h-5); - $img->Rectangle(0,0,$w-4,$h-4); - - // Window top row - $img->SetColor("darkred"); - for($y=3; $y < 18; $y += 2 ) - $img->Line(1,$y,$w-6,$y); - - // "White shadow" - $img->SetColor("white"); - - // Left window edge - $img->Line(2,2,2,$h-5); - $img->Line(2,2,$w-6,2); - - // "Gray button shadow" - $img->SetColor("darkgray"); - - // Gray window shadow - $img->Line(2,$h-6,$w-5,$h-6); - $img->Line(3,$h-7,$w-5,$h-7); - - // Window title - $m = floor($w/2-5); - $l = 110; - $img->SetColor("lightgray:1.3"); - $img->FilledRectangle($m-$l,2,$m+$l,16); - - // Stroke text - $img->SetColor("darkred"); - $img->SetFont(FF_FONT2,FS_BOLD); - $img->StrokeText($m-90,15,$this->iTitle); - $img->SetColor("black"); - $img->SetFont(FF_FONT1,FS_NORMAL); - $txt = new Text($aMsg,52,25); - $txt->SetFont(FF_FONT1); - $txt->Align("left","top"); - $txt->Stroke($img); - if ($this->iDest) { - $img->Stream($this->iDest); - } else { - $img->Headers(); - $img->Stream(); - } - if( $aHalt ) - die(); - } -} - - - -if( ! USE_IMAGE_ERROR_HANDLER ) { - JpGraphError::SetImageFlag(false); -} -?> diff --git a/#jpgraph/src/jpgraph_error.php b/#jpgraph/src/jpgraph_error.php deleted file mode 100644 index 3ef3ca5b..00000000 --- a/#jpgraph/src/jpgraph_error.php +++ /dev/null @@ -1,157 +0,0 @@ -numpoints /= 2; - } - //--------------- - // PUBLIC METHODS - - // Gets called before any axis are stroked - function PreStrokeAdjust($graph) { - if( $this->center ) { - $a=0.5; $b=0.5; - ++$this->numpoints; - } else { - $a=0; $b=0; - } - $graph->xaxis->scale->ticks->SetXLabelOffset($a); - $graph->SetTextScaleOff($b); - //$graph->xaxis->scale->ticks->SupressMinorTickMarks(); - } - - // Method description - function Stroke($img,$xscale,$yscale) { - $numpoints=count($this->coords[0])/2; - $img->SetColor($this->color); - $img->SetLineWeight($this->weight); - - if( isset($this->coords[1]) ) { - if( count($this->coords[1])!=$numpoints ) - JpGraphError::RaiseL(2003,count($this->coords[1]),$numpoints); - //("Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])." Number of Y-points:$numpoints"); - else - $exist_x = true; - } - else - $exist_x = false; - - for( $i=0; $i<$numpoints; ++$i) { - if( $exist_x ) - $x=$this->coords[1][$i]; - else - $x=$i; - - if( !is_numeric($x) || - !is_numeric($this->coords[0][$i*2]) || !is_numeric($this->coords[0][$i*2+1]) ) { - continue; - } - - $xt = $xscale->Translate($x); - $yt1 = $yscale->Translate($this->coords[0][$i*2]); - $yt2 = $yscale->Translate($this->coords[0][$i*2+1]); - $img->Line($xt,$yt1,$xt,$yt2); - $img->Line($xt-$this->errwidth,$yt1,$xt+$this->errwidth,$yt1); - $img->Line($xt-$this->errwidth,$yt2,$xt+$this->errwidth,$yt2); - } - return true; - } -} // Class - - -//=================================================== -// CLASS ErrorLinePlot -// Description: Combine a line and error plot -// THIS IS A DEPRECATED PLOT TYPE JUST KEPT FOR -// BACKWARD COMPATIBILITY -//=================================================== -class ErrorLinePlot extends ErrorPlot { - public $line=null; - //--------------- - // CONSTRUCTOR - function __construct($datay,$datax=false) { - parent::__construct($datay,$datax); - // Calculate line coordinates as the average of the error limits - $n = count($datay); - for($i=0; $i < $n; $i+=2 ) { - $ly[]=($datay[$i]+$datay[$i+1])/2; - } - $this->line=new LinePlot($ly,$datax); - } - - //--------------- - // PUBLIC METHODS - function Legend($graph) { - if( $this->legend != "" ) - $graph->legend->Add($this->legend,$this->color); - $this->line->Legend($graph); - } - - function Stroke($img,$xscale,$yscale) { - parent::Stroke($img,$xscale,$yscale); - $this->line->Stroke($img,$xscale,$yscale); - } -} // Class - - -//=================================================== -// CLASS LineErrorPlot -// Description: Combine a line and error plot -//=================================================== -class LineErrorPlot extends ErrorPlot { - public $line=null; - //--------------- - // CONSTRUCTOR - // Data is (val, errdeltamin, errdeltamax) - function __construct($datay,$datax=false) { - $ly=array(); $ey=array(); - $n = count($datay); - if( $n % 3 != 0 ) { - JpGraphError::RaiseL(4002); - //('Error in input data to LineErrorPlot. Number of data points must be a multiple of 3'); - } - for($i=0; $i < $n; $i+=3 ) { - $ly[]=$datay[$i]; - $ey[]=$datay[$i]+$datay[$i+1]; - $ey[]=$datay[$i]+$datay[$i+2]; - } - parent::__construct($ey,$datax); - $this->line=new LinePlot($ly,$datax); - } - - //--------------- - // PUBLIC METHODS - function Legend($graph) { - if( $this->legend != "" ) - $graph->legend->Add($this->legend,$this->color); - $this->line->Legend($graph); - } - - function Stroke($img,$xscale,$yscale) { - parent::Stroke($img,$xscale,$yscale); - $this->line->Stroke($img,$xscale,$yscale); - } -} // Class - - -/* EOF */ -?> diff --git a/#jpgraph/src/jpgraph_flags.php b/#jpgraph/src/jpgraph_flags.php deleted file mode 100644 index a7e21877..00000000 --- a/#jpgraph/src/jpgraph_flags.php +++ /dev/null @@ -1,376 +0,0 @@ - 'afgh', - 'Republic of Angola' => 'agla', - 'Republic of Albania' => 'alba', - 'Alderney' => 'alde', - 'Democratic and Popular Republic of Algeria' => 'alge', - 'Territory of American Samoa' => 'amsa', - 'Principality of Andorra' => 'andr', - 'British Overseas Territory of Anguilla' => 'angu', - 'Antarctica' => 'anta', - 'Argentine Republic' => 'arge', - 'League of Arab States' => 'arle', - 'Republic of Armenia' => 'arme', - 'Aruba' => 'arub', - 'Commonwealth of Australia' => 'astl', - 'Republic of Austria' => 'aust', - 'Azerbaijani Republic' => 'azer', - 'Bangladesh' => 'bngl', - 'British Antarctic Territory' => 'bant', - 'Kingdom of Belgium' => 'belg', - 'British Overseas Territory of Bermuda' => 'berm', - 'Commonwealth of the Bahamas' => 'bhms', - 'Kingdom of Bahrain' => 'bhrn', - 'Republic of Belarus' => 'blru', - 'Republic of Bolivia' => 'blva', - 'Belize' => 'blze', - 'Republic of Benin' => 'bnin', - 'Republic of Botswana' => 'bots', - 'Federative Republic of Brazil' => 'braz', - 'Barbados' => 'brbd', - 'British Indian Ocean Territory' => 'brin', - 'Brunei Darussalam' => 'brun', - 'Republic of Burkina' => 'bufa', - 'Republic of Bulgaria' => 'bulg', - 'Republic of Burundi' => 'buru', - 'Overseas Territory of the British Virgin Islands' => 'bvis', - 'Central African Republic' => 'cafr', - 'Kingdom of Cambodia' => 'camb', - 'Republic of Cameroon' => 'came', - 'Dominion of Canada' => 'cana', - 'Caribbean Community' => 'cari', - 'Republic of Cape Verde' => 'cave', - 'Republic of Chad' => 'chad', - 'Republic of Chile' => 'chil', - 'Peoples Republic of China' => 'chin', - 'Territory of Christmas Island' => 'chms', - 'Commonwealth of Independent States' => 'cins', - 'Cook Islands' => 'ckis', - 'Republic of Colombia' => 'clmb', - 'Territory of Cocos Islands' => 'cois', - 'Commonwealth' => 'comn', - 'Union of the Comoros' => 'como', - 'Republic of the Congo' => 'cong', - 'Republic of Costa Rica' => 'corc', - 'Republic of Croatia' => 'croa', - 'Republic of Cuba' => 'cuba', - 'British Overseas Territory of the Cayman Islands' => 'cyis', - 'Republic of Cyprus' => 'cypr', - 'The Czech Republic' => 'czec', - 'Kingdom of Denmark' => 'denm', - 'Republic of Djibouti' => 'djib', - 'Commonwealth of Dominica' => 'domn', - 'Dominican Republic' => 'dore', - 'Republic of Ecuador' => 'ecua', - 'Arab Republic of Egypt' => 'egyp', - 'Republic of El Salvador' => 'elsa', - 'England' => 'engl', - 'Republic of Equatorial Guinea' => 'eqgu', - 'State of Eritrea' => 'erit', - 'Republic of Estonia' => 'estn', - 'Ethiopia' => 'ethp', - 'European Union' => 'euun', - 'British Overseas Territory of the Falkland Islands' => 'fais', - 'International Federation of Vexillological Associations' => 'fiav', - 'Republic of Fiji' => 'fiji', - 'Republic of Finland' => 'finl', - 'Territory of French Polynesia' => 'fpol', - 'French Republic' => 'fran', - 'Overseas Department of French Guiana' => 'frgu', - 'Gabonese Republic' => 'gabn', - 'Republic of the Gambia' => 'gamb', - 'Republic of Georgia' => 'geor', - 'Federal Republic of Germany' => 'germ', - 'Republic of Ghana' => 'ghan', - 'Gibraltar' => 'gibr', - 'Hellenic Republic' => 'grec', - 'State of Grenada' => 'gren', - 'Overseas Department of Guadeloupe' => 'guad', - 'Territory of Guam' => 'guam', - 'Republic of Guatemala' => 'guat', - 'The Bailiwick of Guernsey' => 'guer', - 'Republic of Guinea' => 'guin', - 'Republic of Haiti' => 'hait', - 'Hong Kong Special Administrative Region' => 'hokn', - 'Republic of Honduras' => 'hond', - 'Republic of Hungary' => 'hung', - 'Republic of Iceland' => 'icel', - 'International Committee of the Red Cross' => 'icrc', - 'Republic of India' => 'inda', - 'Republic of Indonesia' => 'indn', - 'Republic of Iraq' => 'iraq', - 'Republic of Ireland' => 'irel', - 'Organization of the Islamic Conference' => 'isco', - 'Isle of Man' => 'isma', - 'State of Israel' => 'isra', - 'Italian Republic' => 'ital', - 'Jamaica' => 'jama', - 'Japan' => 'japa', - 'The Bailiwick of Jersey' => 'jers', - 'Hashemite Kingdom of Jordan' => 'jord', - 'Republic of Kazakhstan' => 'kazk', - 'Republic of Kenya' => 'keny', - 'Republic of Kiribati' => 'kirb', - 'State of Kuwait' => 'kuwa', - 'Kyrgyz Republic' => 'kyrg', - 'Republic of Latvia' => 'latv', - 'Lebanese Republic' => 'leba', - 'Kingdom of Lesotho' => 'lest', - 'Republic of Liberia' => 'libe', - 'Principality of Liechtenstein' => 'liec', - 'Republic of Lithuania' => 'lith', - 'Grand Duchy of Luxembourg' => 'luxe', - 'Macao Special Administrative Region' => 'maca', - 'Republic of Macedonia' => 'mace', - 'Republic of Madagascar' => 'mada', - 'Republic of the Marshall Islands' => 'mais', - 'Republic of Mali' => 'mali', - 'Federation of Malaysia' => 'mals', - 'Republic of Malta' => 'malt', - 'Republic of Malawi' => 'malw', - 'Overseas Department of Martinique' => 'mart', - 'Islamic Republic of Mauritania' => 'maur', - 'Territorial Collectivity of Mayotte' => 'mayt', - 'United Mexican States' => 'mexc', - 'Federated States of Micronesia' => 'micr', - 'Midway Islands' => 'miis', - 'Republic of Moldova' => 'mold', - 'Principality of Monaco' => 'mona', - 'Republic of Mongolia' => 'mong', - 'British Overseas Territory of Montserrat' => 'mont', - 'Kingdom of Morocco' => 'morc', - 'Republic of Mozambique' => 'moza', - 'Republic of Mauritius' => 'mrts', - 'Union of Myanmar' => 'myan', - 'Republic of Namibia' => 'namb', - 'North Atlantic Treaty Organization' => 'nato', - 'Republic of Nauru' => 'naur', - 'Turkish Republic of Northern Cyprus' => 'ncyp', - 'Netherlands Antilles' => 'nean', - 'Kingdom of Nepal' => 'nepa', - 'Kingdom of the Netherlands' => 'neth', - 'Territory of Norfolk Island' => 'nfis', - 'Federal Republic of Nigeria' => 'ngra', - 'Republic of Nicaragua' => 'nica', - 'Republic of Niger' => 'nigr', - 'Niue' => 'niue', - 'Commonwealth of the Northern Mariana Islands' => 'nmar', - 'Province of Northern Ireland' => 'noir', - 'Nordic Council' => 'nord', - 'Kingdom of Norway' => 'norw', - 'Territory of New Caledonia and Dependencies' => 'nwca', - 'New Zealand' => 'nwze', - 'Organization of American States' => 'oast', - 'Organization of African Unity' => 'oaun', - 'International Olympic Committee' => 'olym', - 'Sultanate of Oman' => 'oman', - 'Islamic Republic of Pakistan' => 'paks', - 'Republic of Palau' => 'pala', - 'Independent State of Papua New Guinea' => 'pang', - 'Republic of Paraguay' => 'para', - 'Republic of Peru' => 'peru', - 'Republic of the Philippines' => 'phil', - 'British Overseas Territory of the Pitcairn Islands' => 'piis', - 'Republic of Poland' => 'pola', - 'Republic of Portugal' => 'port', - 'Commonwealth of Puerto Rico' => 'purc', - 'State of Qatar' => 'qata', - 'Russian Federation' => 'russ', - 'Romania' => 'rmna', - 'Republic of Rwanda' => 'rwan', - 'Kingdom of Saudi Arabia' => 'saar', - 'Republic of San Marino' => 'sama', - 'Nordic Sami Conference' => 'sami', - 'Sark' => 'sark', - 'Scotland' => 'scot', - 'Principality of Seborga' => 'sebo', - 'Republic of Serbia' => 'serb', - 'Republic of Sierra Leone' => 'sile', - 'Republic of Singapore' => 'sing', - 'Republic of Korea' => 'skor', - 'Republic of Slovenia' => 'slva', - 'Somali Republic' => 'smla', - 'Republic of Somaliland' => 'smld', - 'Republic of South Africa' => 'soaf', - 'Solomon Islands' => 'sois', - 'Kingdom of Spain' => 'span', - 'Secretariat of the Pacific Community' => 'spco', - 'Democratic Socialist Republic of Sri Lanka' => 'srla', - 'Saint Lucia' => 'stlu', - 'Republic of the Sudan' => 'suda', - 'Republic of Suriname' => 'surn', - 'Slovak Republic' => 'svka', - 'Kingdom of Sweden' => 'swdn', - 'Swiss Confederation' => 'swit', - 'Syrian Arab Republic' => 'syra', - 'Kingdom of Swaziland' => 'szld', - 'Republic of China' => 'taiw', - 'Taiwan' => 'taiw', - 'Republic of Tajikistan' => 'tajk', - 'United Republic of Tanzania' => 'tanz', - 'Kingdom of Thailand' => 'thal', - 'Autonomous Region of Tibet' => 'tibe', - 'Turkmenistan' => 'tkst', - 'Togolese Republic' => 'togo', - 'Tokelau' => 'toke', - 'Kingdom of Tonga' => 'tong', - 'Tristan da Cunha' => 'trdc', - 'Tromelin' => 'tris', - 'Republic of Tunisia' => 'tuns', - 'Republic of Turkey' => 'turk', - 'Tuvalu' => 'tuva', - 'United Arab Emirates' => 'uaem', - 'Republic of Uganda' => 'ugan', - 'Ukraine' => 'ukrn', - 'United Kingdom of Great Britain' => 'unkg', - 'United Nations' => 'unna', - 'United States of America' => 'unst', - 'Oriental Republic of Uruguay' => 'urgy', - 'Virgin Islands of the United States' => 'usvs', - 'Republic of Uzbekistan' => 'uzbk', - 'State of the Vatican City' => 'vacy', - 'Republic of Vanuatu' => 'vant', - 'Bolivarian Republic of Venezuela' => 'venz', - 'Republic of Yemen' => 'yemn', - 'Democratic Republic of Congo' => 'zare', - 'Republic of Zimbabwe' => 'zbwe' ) ; - - - private $iFlagCount = -1; - private $iFlagSetMap = array( - FLAGSIZE1 => 'flags_thumb35x35', - FLAGSIZE2 => 'flags_thumb60x60', - FLAGSIZE3 => 'flags_thumb100x100', - FLAGSIZE4 => 'flags' - ); - - private $iFlagData ; - private $iOrdIdx=array(); - - function FlagImages($aSize=FLAGSIZE1) { - switch($aSize) { - case FLAGSIZE1 : - case FLAGSIZE2 : - case FLAGSIZE3 : - case FLAGSIZE4 : - $file = dirname(__FILE__).'/'.$this->iFlagSetMap[$aSize].'.dat'; - $fp = fopen($file,'rb'); - $rawdata = fread($fp,filesize($file)); - $this->iFlagData = unserialize($rawdata); - break; - default: - JpGraphError::RaiseL(5001,$aSize); - //('Unknown flag size. ('.$aSize.')'); - } - $this->iFlagCount = count($this->iCountryNameMap); - } - - function GetNum() { - return $this->iFlagCount; - } - - function GetImgByName($aName,&$outFullName) { - $idx = $this->GetIdxByName($aName,$outFullName); - return $this->GetImgByIdx($idx); - } - - function GetImgByIdx($aIdx) { - if( array_key_exists($aIdx,$this->iFlagData) ) { - $d = $this->iFlagData[$aIdx][1]; - return Image::CreateFromString($d); - } - else { - JpGraphError::RaiseL(5002,$aIdx); - //("Flag index \"�$aIdx\" does not exist."); - } - } - - function GetIdxByOrdinal($aOrd,&$outFullName) { - $aOrd--; - $n = count($this->iOrdIdx); - if( $n == 0 ) { - reset($this->iCountryNameMap); - $this->iOrdIdx=array(); - $i=0; - while( list($key,$val) = each($this->iCountryNameMap) ) { - $this->iOrdIdx[$i++] = array($val,$key); - } - $tmp=$this->iOrdIdx[$aOrd]; - $outFullName = $tmp[1]; - return $tmp[0]; - - } - elseif( $aOrd >= 0 && $aOrd < $n ) { - $tmp=$this->iOrdIdx[$aOrd]; - $outFullName = $tmp[1]; - return $tmp[0]; - } - else { - JpGraphError::RaiseL(5003,$aOrd); - //('Invalid ordinal number specified for flag index.'); - } - } - - function GetIdxByName($aName,&$outFullName) { - - if( is_integer($aName) ) { - $idx = $this->GetIdxByOrdinal($aName,$outFullName); - return $idx; - } - - $found=false; - $aName = strtolower($aName); - $nlen = strlen($aName); - reset($this->iCountryNameMap); - // Start by trying to match exact index name - while( list($key,$val) = each($this->iCountryNameMap) ) { - if( $nlen == strlen($val) && $val == $aName ) { - $found=true; - break; - } - } - if( !$found ) { - reset($this->iCountryNameMap); - // If the exact index doesn't work try a (partial) full name - while( list($key,$val) = each($this->iCountryNameMap) ) { - if( strpos(strtolower($key), $aName) !== false ) { - $found=true; - break; - } - } - } - if( $found ) { - $outFullName = $key; - return $val; - } - else { - JpGraphError::RaiseL(5004,$aName); - //("The (partial) country name \"$aName\" does not have a cooresponding flag image. The flag may still exist but under another name, e.g. insted of \"usa\" try \"united states\"."); - } - } -} - - - - -?> diff --git a/#jpgraph/src/jpgraph_gantt.php b/#jpgraph/src/jpgraph_gantt.php deleted file mode 100644 index d5afa654..00000000 --- a/#jpgraph/src/jpgraph_gantt.php +++ /dev/null @@ -1,3955 +0,0 @@ -vgrid = new LineProperty(); - } - - function Hide($aF=true) { - $this->iShow=!$aF; - } - - function Show($aF=true) { - $this->iShow=$aF; - } - - // Specify font - function SetFont($aFFamily,$aFStyle=FS_NORMAL,$aFSize=10) { - $this->iFFamily = $aFFamily; - $this->iFStyle = $aFStyle; - $this->iFSize = $aFSize; - } - - function SetStyle($aStyle) { - $this->iStyle = $aStyle; - } - - function SetColumnMargin($aLeft,$aRight) { - $this->iLeftColMargin = $aLeft; - $this->iRightColMargin = $aRight; - } - - function SetFontColor($aFontColor) { - $this->iFontColor = $aFontColor; - } - - function SetColor($aColor) { - $this->iColor = $aColor; - } - - function SetBackgroundColor($aColor) { - $this->iBackgroundColor = $aColor; - } - - function SetColTitles($aTitles,$aWidth=null) { - $this->iTitles = $aTitles; - $this->iWidth = $aWidth; - } - - function SetMinColWidth($aWidths) { - $n = min(count($this->iTitles),count($aWidths)); - for($i=0; $i < $n; ++$i ) { - if( !empty($aWidths[$i]) ) { - if( empty($this->iWidth[$i]) ) { - $this->iWidth[$i] = $aWidths[$i]; - } - else { - $this->iWidth[$i] = max($this->iWidth[$i],$aWidths[$i]); - } - } - } - } - - function GetWidth($aImg) { - $txt = new TextProperty(); - $txt->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - $n = count($this->iTitles) ; - $rm=$this->iRightColMargin; - $w = 0; - for($h=0, $i=0; $i < $n; ++$i ) { - $w += $this->iLeftColMargin; - $txt->Set($this->iTitles[$i]); - if( !empty($this->iWidth[$i]) ) { - $w1 = max($txt->GetWidth($aImg)+$rm,$this->iWidth[$i]); - } - else { - $w1 = $txt->GetWidth($aImg)+$rm; - } - $this->iWidth[$i] = $w1; - $w += $w1; - $h = max($h,$txt->GetHeight($aImg)); - } - $this->iHeight = $h+$this->iTopHeaderMargin; - $txt=''; - return $w; - } - - function GetColStart($aImg,&$aStart,$aAddLeftMargin=false) { - $n = count($this->iTitles) ; - $adj = $aAddLeftMargin ? $this->iLeftColMargin : 0; - $aStart=array($aImg->left_margin+$adj); - for( $i=1; $i < $n; ++$i ) { - $aStart[$i] = $aStart[$i-1]+$this->iLeftColMargin+$this->iWidth[$i-1]; - } - } - - // Adjust headers left, right or centered - function SetHeaderAlign($aAlign) { - $this->iHeaderAlign=$aAlign; - } - - function Stroke($aImg,$aXLeft,$aYTop,$aXRight,$aYBottom,$aUseTextHeight=false) { - - if( !$this->iShow ) return; - - $txt = new TextProperty(); - $txt->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - $txt->SetColor($this->iFontColor); - $txt->SetAlign($this->iHeaderAlign,'top'); - $n=count($this->iTitles); - - if( $n == 0 ) - return; - - $x = $aXLeft; - $h = $this->iHeight; - $yTop = $aUseTextHeight ? $aYBottom-$h-$this->iTopColMargin-$this->iBottomColMargin : $aYTop ; - - if( $h < 0 ) { - JpGraphError::RaiseL(6001); - //('Internal error. Height for ActivityTitles is < 0'); - } - - $aImg->SetLineWeight(1); - // Set background color - $aImg->SetColor($this->iBackgroundColor); - $aImg->FilledRectangle($aXLeft,$yTop,$aXRight,$aYBottom-1); - - if( $this->iStyle == 1 ) { - // Make a 3D effect - $aImg->SetColor('white'); - $aImg->Line($aXLeft,$yTop+1,$aXRight,$yTop+1); - } - - for($i=0; $i < $n; ++$i ) { - if( $this->iStyle == 1 ) { - // Make a 3D effect - $aImg->SetColor('white'); - $aImg->Line($x+1,$yTop,$x+1,$aYBottom); - } - $x += $this->iLeftColMargin; - $txt->Set($this->iTitles[$i]); - - // Adjust the text anchor position according to the choosen alignment - $xp = $x; - if( $this->iHeaderAlign == 'center' ) { - $xp = (($x-$this->iLeftColMargin)+($x+$this->iWidth[$i]))/2; - } - elseif( $this->iHeaderAlign == 'right' ) { - $xp = $x +$this->iWidth[$i]-$this->iRightColMargin; - } - - $txt->Stroke($aImg,$xp,$yTop+$this->iTopHeaderMargin); - $x += $this->iWidth[$i]; - if( $i < $n-1 ) { - $aImg->SetColor($this->iColor); - $aImg->Line($x,$yTop,$x,$aYBottom); - } - } - - $aImg->SetColor($this->iColor); - $aImg->Line($aXLeft,$yTop, $aXRight,$yTop); - - // Stroke vertical column dividers - $cols=array(); - $this->GetColStart($aImg,$cols); - $n=count($cols); - for( $i=1; $i < $n; ++$i ) { - $this->vgrid->Stroke($aImg,$cols[$i],$aYBottom,$cols[$i], - $aImg->height - $aImg->bottom_margin); - } - } -} - - -//=================================================== -// CLASS GanttGraph -// Description: Main class to handle gantt graphs -//=================================================== -class GanttGraph extends Graph { - public $scale; // Public accessible - public $hgrid=null; - private $iObj=array(); // Gantt objects - private $iLabelHMarginFactor=0.2; // 10% margin on each side of the labels - private $iLabelVMarginFactor=0.4; // 40% margin on top and bottom of label - private $iLayout=GANTT_FROMTOP; // Could also be GANTT_EVEN - private $iSimpleFont = FF_FONT1,$iSimpleFontSize=11; - private $iSimpleStyle=GANTT_RDIAG,$iSimpleColor='yellow',$iSimpleBkgColor='red'; - private $iSimpleProgressBkgColor='gray',$iSimpleProgressColor='darkgreen'; - private $iSimpleProgressStyle=GANTT_SOLID; - private $iZoomFactor = 1.0; - //--------------- - // CONSTRUCTOR - // Create a new gantt graph - function __construct($aWidth=0,$aHeight=0,$aCachedName="",$aTimeOut=0,$aInline=true) { - - // Backward compatibility - if( $aWidth == -1 ) $aWidth=0; - if( $aHeight == -1 ) $aHeight=0; - - if( $aWidth< 0 || $aHeight < 0 ) { - JpgraphError::RaiseL(6002); - //("You can't specify negative sizes for Gantt graph dimensions. Use 0 to indicate that you want the library to automatically determine a dimension."); - } - parent::__construct($aWidth,$aHeight,$aCachedName,$aTimeOut,$aInline); - $this->scale = new GanttScale($this->img); - - // Default margins - $this->img->SetMargin(15,17,25,15); - - $this->hgrid = new HorizontalGridLine(); - - $this->scale->ShowHeaders(GANTT_HWEEK|GANTT_HDAY); - $this->SetBox(); - } - - //--------------- - // PUBLIC METHODS - - // - - function SetSimpleFont($aFont,$aSize) { - $this->iSimpleFont = $aFont; - $this->iSimpleFontSize = $aSize; - } - - function SetSimpleStyle($aBand,$aColor,$aBkgColor) { - $this->iSimpleStyle = $aBand; - $this->iSimpleColor = $aColor; - $this->iSimpleBkgColor = $aBkgColor; - } - - // A utility function to help create basic Gantt charts - function CreateSimple($data,$constrains=array(),$progress=array()) { - $num = count($data); - for( $i=0; $i < $num; ++$i) { - switch( $data[$i][1] ) { - case ACTYPE_GROUP: - // Create a slightly smaller height bar since the - // "wings" at the end will make it look taller - $a = new GanttBar($data[$i][0],$data[$i][2],$data[$i][3],$data[$i][4],'',8); - $a->title->SetFont($this->iSimpleFont,FS_BOLD,$this->iSimpleFontSize); - $a->rightMark->Show(); - $a->rightMark->SetType(MARK_RIGHTTRIANGLE); - $a->rightMark->SetWidth(8); - $a->rightMark->SetColor('black'); - $a->rightMark->SetFillColor('black'); - - $a->leftMark->Show(); - $a->leftMark->SetType(MARK_LEFTTRIANGLE); - $a->leftMark->SetWidth(8); - $a->leftMark->SetColor('black'); - $a->leftMark->SetFillColor('black'); - - $a->SetPattern(BAND_SOLID,'black'); - $csimpos = 6; - break; - - case ACTYPE_NORMAL: - $a = new GanttBar($data[$i][0],$data[$i][2],$data[$i][3],$data[$i][4],'',10); - $a->title->SetFont($this->iSimpleFont,FS_NORMAL,$this->iSimpleFontSize); - $a->SetPattern($this->iSimpleStyle,$this->iSimpleColor); - $a->SetFillColor($this->iSimpleBkgColor); - // Check if this activity should have a constrain line - $n = count($constrains); - for( $j=0; $j < $n; ++$j ) { - if( empty($constrains[$j]) || (count($constrains[$j]) != 3) ) { - JpGraphError::RaiseL(6003,$j); - //("Invalid format for Constrain parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Constrain-To,Constrain-Type)"); - } - if( $constrains[$j][0]==$data[$i][0] ) { - $a->SetConstrain($constrains[$j][1],$constrains[$j][2],'black',ARROW_S2,ARROWT_SOLID); - } - } - - // Check if this activity have a progress bar - $n = count($progress); - for( $j=0; $j < $n; ++$j ) { - - if( empty($progress[$j]) || (count($progress[$j]) != 2) ) { - JpGraphError::RaiseL(6004,$j); - //("Invalid format for Progress parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Progress)"); - } - if( $progress[$j][0]==$data[$i][0] ) { - $a->progress->Set($progress[$j][1]); - $a->progress->SetPattern($this->iSimpleProgressStyle, - $this->iSimpleProgressColor); - $a->progress->SetFillColor($this->iSimpleProgressBkgColor); - //$a->progress->SetPattern($progress[$j][2],$progress[$j][3]); - break; - } - } - $csimpos = 6; - break; - - case ACTYPE_MILESTONE: - $a = new MileStone($data[$i][0],$data[$i][2],$data[$i][3]); - $a->title->SetFont($this->iSimpleFont,FS_NORMAL,$this->iSimpleFontSize); - $a->caption->SetFont($this->iSimpleFont,FS_NORMAL,$this->iSimpleFontSize); - $csimpos = 5; - break; - default: - die('Unknown activity type'); - break; - } - - // Setup caption - $a->caption->Set($data[$i][$csimpos-1]); - - // Check if this activity should have a CSIM target�? - if( !empty($data[$i][$csimpos]) ) { - $a->SetCSIMTarget($data[$i][$csimpos]); - $a->SetCSIMAlt($data[$i][$csimpos+1]); - } - if( !empty($data[$i][$csimpos+2]) ) { - $a->title->SetCSIMTarget($data[$i][$csimpos+2]); - $a->title->SetCSIMAlt($data[$i][$csimpos+3]); - } - - $this->Add($a); - } - } - - // Set user specified scale zoom factor when auto sizing is used - function SetZoomFactor($aZoom) { - $this->iZoomFactor = $aZoom; - } - - - // Set what headers should be shown - function ShowHeaders($aFlg) { - $this->scale->ShowHeaders($aFlg); - } - - // Specify the fraction of the font height that should be added - // as vertical margin - function SetLabelVMarginFactor($aVal) { - $this->iLabelVMarginFactor = $aVal; - } - - // Synonym to the method above - function SetVMarginFactor($aVal) { - $this->iLabelVMarginFactor = $aVal; - } - - - // Add a new Gantt object - function Add($aObject) { - if( is_array($aObject) && count($aObject) > 0 ) { - $cl = $aObject[0]; - if( class_exists('IconPlot',false) && ($cl instanceof IconPlot) ) { - $this->AddIcon($aObject); - } - elseif( class_exists('Text',false) && ($cl instanceof Text) ) { - $this->AddText($aObject); - } - else { - $n = count($aObject); - for($i=0; $i < $n; ++$i) - $this->iObj[] = $aObject[$i]; - } - } - else { - if( class_exists('IconPlot',false) && ($aObject instanceof IconPlot) ) { - $this->AddIcon($aObject); - } - elseif( class_exists('Text',false) && ($aObject instanceof Text) ) { - $this->AddText($aObject); - } - else { - $this->iObj[] = $aObject; - } - } - } - - function StrokeTexts() { - // Stroke any user added text objects - if( $this->texts != null ) { - $n = count($this->texts); - for($i=0; $i < $n; ++$i) { - if( $this->texts[$i]->iScalePosX !== null && $this->texts[$i]->iScalePosY !== null ) { - $x = $this->scale->TranslateDate($this->texts[$i]->iScalePosX); - $y = $this->scale->TranslateVertPos($this->texts[$i]->iScalePosY); - $y -= $this->scale->GetVertSpacing()/2; - } - else { - $x = $y = null; - } - $this->texts[$i]->Stroke($this->img,$x,$y); - } - } - } - - // Override inherit method from Graph and give a warning message - function SetScale($aAxisType,$aYMin=1,$aYMax=1,$aXMin=1,$aXMax=1) { - JpGraphError::RaiseL(6005); - //("SetScale() is not meaningfull with Gantt charts."); - } - - // Specify the date range for Gantt graphs (if this is not set it will be - // automtically determined from the input data) - function SetDateRange($aStart,$aEnd) { - // Adjust the start and end so that the indicate the - // begining and end of respective start and end days - if( strpos($aStart,':') === false ) - $aStart = date('Y-m-d 00:00',strtotime($aStart)); - if( strpos($aEnd,':') === false ) - $aEnd = date('Y-m-d 23:59',strtotime($aEnd)); - $this->scale->SetRange($aStart,$aEnd); - } - - // Get the maximum width of the activity titles columns for the bars - // The name is lightly misleading since we from now on can have - // multiple columns in the label section. When this was first written - // it only supported a single label, hence the name. - function GetMaxLabelWidth() { - $m=10; - if( $this->iObj != null ) { - $marg = $this->scale->actinfo->iLeftColMargin+$this->scale->actinfo->iRightColMargin; - $n = count($this->iObj); - for($i=0; $i < $n; ++$i) { - if( !empty($this->iObj[$i]->title) ) { - if( $this->iObj[$i]->title->HasTabs() ) { - list($tot,$w) = $this->iObj[$i]->title->GetWidth($this->img,true); - $m=max($m,$tot); - } - else - $m=max($m,$this->iObj[$i]->title->GetWidth($this->img)); - } - } - } - return $m; - } - - // Get the maximum height of the titles for the bars - function GetMaxLabelHeight() { - $m=10; - if( $this->iObj != null ) { - $n = count($this->iObj); - // We can not include the title of GnttVLine since that title is stroked at the bottom - // of the Gantt bar and not in the activity title columns - for($i=0; $i < $n; ++$i) { - if( !empty($this->iObj[$i]->title) && !($this->iObj[$i] instanceof GanttVLine) ) { - $m=max($m,$this->iObj[$i]->title->GetHeight($this->img)); - } - } - } - return $m; - } - - function GetMaxBarAbsHeight() { - $m=0; - if( $this->iObj != null ) { - $m = $this->iObj[0]->GetAbsHeight($this->img); - $n = count($this->iObj); - for($i=1; $i < $n; ++$i) { - $m=max($m,$this->iObj[$i]->GetAbsHeight($this->img)); - } - } - return $m; - } - - // Get the maximum used line number (vertical position) for bars - function GetBarMaxLineNumber() { - $m=1; - if( $this->iObj != null ) { - $m = $this->iObj[0]->GetLineNbr(); - $n = count($this->iObj); - for($i=1; $i < $n; ++$i) { - $m=max($m,$this->iObj[$i]->GetLineNbr()); - } - } - return $m; - } - - // Get the minumum and maximum used dates for all bars - function GetBarMinMax() { - $start = 0 ; - $n = count($this->iObj); - while( $start < $n && $this->iObj[$start]->GetMaxDate() === false ) - ++$start; - if( $start >= $n ) { - JpgraphError::RaiseL(6006); - //('Cannot autoscale Gantt chart. No dated activities exist. [GetBarMinMax() start >= n]'); - } - - $max=$this->scale->NormalizeDate($this->iObj[$start]->GetMaxDate()); - $min=$this->scale->NormalizeDate($this->iObj[$start]->GetMinDate()); - - for($i=$start+1; $i < $n; ++$i) { - $rmax = $this->scale->NormalizeDate($this->iObj[$i]->GetMaxDate()); - if( $rmax != false ) - $max=Max($max,$rmax); - $rmin = $this->scale->NormalizeDate($this->iObj[$i]->GetMinDate()); - if( $rmin != false ) - $min=Min($min,$rmin); - } - $minDate = date("Y-m-d",$min); - $min = strtotime($minDate); - $maxDate = date("Y-m-d 23:59",$max); - $max = strtotime($maxDate); - return array($min,$max); - } - - // Create a new auto sized canvas if the user hasn't specified a size - // The size is determined by what scale the user has choosen and hence - // the minimum width needed to display the headers. Some margins are - // also added to make it better looking. - function AutoSize() { - - if( $this->img->img == null ) { - // The predefined left, right, top, bottom margins. - // Note that the top margin might incease depending on - // the title. - $hadj = $vadj = 0; - if( $this->doshadow ) { - $hadj = $this->shadow_width; - $vadj = $this->shadow_width+5; - } - - $lm = $this->img->left_margin; - $rm = $this->img->right_margin +$hadj; - $rm += 2 ; - $tm = $this->img->top_margin; - $bm = $this->img->bottom_margin + $vadj; - $bm += 2; - - // If there are any added GanttVLine we must make sure that the - // bottom margin is wide enough to hold a title. - $n = count($this->iObj); - for($i=0; $i < $n; ++$i) { - if( $this->iObj[$i] instanceof GanttVLine ) { - $bm = max($bm,$this->iObj[$i]->title->GetHeight($this->img)+10); - } - } - - // First find out the height - $n=$this->GetBarMaxLineNumber()+1; - $m=max($this->GetMaxLabelHeight(),$this->GetMaxBarAbsHeight()); - $height=$n*((1+$this->iLabelVMarginFactor)*$m); - - // Add the height of the scale titles - $h=$this->scale->GetHeaderHeight(); - $height += $h; - - // Calculate the top margin needed for title and subtitle - if( $this->title->t != "" ) { - $tm += $this->title->GetFontHeight($this->img); - } - if( $this->subtitle->t != "" ) { - $tm += $this->subtitle->GetFontHeight($this->img); - } - - // ...and then take the bottom and top plot margins into account - $height += $tm + $bm + $this->scale->iTopPlotMargin + $this->scale->iBottomPlotMargin; - // Now find the minimum width for the chart required - - // If day scale or smaller is shown then we use the day font width - // as the base size unit. - // If only weeks or above is displayed we use a modified unit to - // get a smaller image. - if( $this->scale->IsDisplayHour() || $this->scale->IsDisplayMinute() ) { - // Add 2 pixel margin on each side - $fw=$this->scale->day->GetFontWidth($this->img)+4; - } - elseif( $this->scale->IsDisplayWeek() ) { - $fw = 8; - } - elseif( $this->scale->IsDisplayMonth() ) { - $fw = 4; - } - else { - $fw = 2; - } - - $nd=$this->scale->GetNumberOfDays(); - - if( $this->scale->IsDisplayDay() ) { - // If the days are displayed we also need to figure out - // how much space each day's title will require. - switch( $this->scale->day->iStyle ) { - case DAYSTYLE_LONG : - $txt = "Monday"; - break; - case DAYSTYLE_LONGDAYDATE1 : - $txt = "Monday 23 Jun"; - break; - case DAYSTYLE_LONGDAYDATE2 : - $txt = "Monday 23 Jun 2003"; - break; - case DAYSTYLE_SHORT : - $txt = "Mon"; - break; - case DAYSTYLE_SHORTDAYDATE1 : - $txt = "Mon 23/6"; - break; - case DAYSTYLE_SHORTDAYDATE2 : - $txt = "Mon 23 Jun"; - break; - case DAYSTYLE_SHORTDAYDATE3 : - $txt = "Mon 23"; - break; - case DAYSTYLE_SHORTDATE1 : - $txt = "23/6"; - break; - case DAYSTYLE_SHORTDATE2 : - $txt = "23 Jun"; - break; - case DAYSTYLE_SHORTDATE3 : - $txt = "Mon 23"; - break; - case DAYSTYLE_SHORTDATE4 : - $txt = "88"; - break; - case DAYSTYLE_CUSTOM : - $txt = date($this->scale->day->iLabelFormStr,strtotime('2003-12-20 18:00')); - break; - case DAYSTYLE_ONELETTER : - default: - $txt = "M"; - break; - } - $fw = $this->scale->day->GetStrWidth($this->img,$txt)+6; - } - - // If we have hours enabled we must make sure that each day has enough - // space to fit the number of hours to be displayed. - if( $this->scale->IsDisplayHour() ) { - // Depending on what format the user has choose we need different amount - // of space. We therefore create a typical string for the choosen format - // and determine the length of that string. - switch( $this->scale->hour->iStyle ) { - case HOURSTYLE_HMAMPM: - $txt = '12:00pm'; - break; - case HOURSTYLE_H24: - // 13 - $txt = '24'; - break; - case HOURSTYLE_HAMPM: - $txt = '12pm'; - break; - case HOURSTYLE_CUSTOM: - $txt = date($this->scale->hour->iLabelFormStr,strtotime('2003-12-20 18:00')); - break; - case HOURSTYLE_HM24: - default: - $txt = '24:00'; - break; - } - - $hfw = $this->scale->hour->GetStrWidth($this->img,$txt)+6; - $mw = $hfw; - if( $this->scale->IsDisplayMinute() ) { - // Depending on what format the user has choose we need different amount - // of space. We therefore create a typical string for the choosen format - // and determine the length of that string. - switch( $this->scale->minute->iStyle ) { - case HOURSTYLE_CUSTOM: - $txt2 = date($this->scale->minute->iLabelFormStr,strtotime('2005-05-15 18:55')); - break; - case MINUTESTYLE_MM: - default: - $txt2 = '15'; - break; - } - - $mfw = $this->scale->minute->GetStrWidth($this->img,$txt2)+6; - $n2 = ceil(60 / $this->scale->minute->GetIntervall() ); - $mw = $n2 * $mfw; - } - $hfw = $hfw < $mw ? $mw : $hfw ; - $n = ceil(24*60 / $this->scale->TimeToMinutes($this->scale->hour->GetIntervall()) ); - $hw = $n * $hfw; - $fw = $fw < $hw ? $hw : $fw ; - } - - // We need to repeat this code block here as well. - // THIS iS NOT A MISTAKE ! - // We really need it since we need to adjust for minutes both in the case - // where hour scale is shown and when it is not shown. - - if( $this->scale->IsDisplayMinute() ) { - // Depending on what format the user has choose we need different amount - // of space. We therefore create a typical string for the choosen format - // and determine the length of that string. - switch( $this->scale->minute->iStyle ) { - case HOURSTYLE_CUSTOM: - $txt = date($this->scale->minute->iLabelFormStr,strtotime('2005-05-15 18:55')); - break; - case MINUTESTYLE_MM: - default: - $txt = '15'; - break; - } - - $mfw = $this->scale->minute->GetStrWidth($this->img,$txt)+6; - $n = ceil(60 / $this->scale->TimeToMinutes($this->scale->minute->GetIntervall()) ); - $mw = $n * $mfw; - $fw = $fw < $mw ? $mw : $fw ; - } - - // If we display week we must make sure that 7*$fw is enough - // to fit up to 10 characters of the week font (if the week is enabled) - if( $this->scale->IsDisplayWeek() ) { - // Depending on what format the user has choose we need different amount - // of space - $fsw = strlen($this->scale->week->iLabelFormStr); - if( $this->scale->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR ) { - $fsw += 8; - } - elseif( $this->scale->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR ) { - $fsw += 7; - } - else { - $fsw += 4; - } - - $ww = $fsw*$this->scale->week->GetFontWidth($this->img); - if( 7*$fw < $ww ) { - $fw = ceil($ww/7); - } - } - - if( !$this->scale->IsDisplayDay() && !$this->scale->IsDisplayHour() && - !( ($this->scale->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR || - $this->scale->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR) && $this->scale->IsDisplayWeek() ) ) { - // If we don't display the individual days we can shrink the - // scale a little bit. This is a little bit pragmatic at the - // moment and should be re-written to take into account - // a) What scales exactly are shown and - // b) what format do they use so we know how wide we need to - // make each scale text space at minimum. - $fw /= 2; - if( !$this->scale->IsDisplayWeek() ) { - $fw /= 1.8; - } - } - - $cw = $this->GetMaxActInfoColWidth() ; - $this->scale->actinfo->SetMinColWidth($cw); - if( $this->img->width <= 0 ) { - // Now determine the width for the activity titles column - - // Firdst find out the maximum width of each object column - $titlewidth = max(max($this->GetMaxLabelWidth(), - $this->scale->tableTitle->GetWidth($this->img)), - $this->scale->actinfo->GetWidth($this->img)); - - // Add the width of the vertivcal divider line - $titlewidth += $this->scale->divider->iWeight*2; - - // Adjust the width by the user specified zoom factor - $fw *= $this->iZoomFactor; - - // Now get the total width taking - // titlewidth, left and rigt margin, dayfont size - // into account - $width = $titlewidth + $nd*$fw + $lm+$rm; - } - else { - $width = $this->img->width; - } - - $width = round($width); - $height = round($height); - // Make a sanity check on image size - if( $width > MAX_GANTTIMG_SIZE_W || $height > MAX_GANTTIMG_SIZE_H ) { - JpgraphError::RaiseL(6007,$width,$height); - //("Sanity check for automatic Gantt chart size failed. Either the width (=$width) or height (=$height) is larger than MAX_GANTTIMG_SIZE. This could potentially be caused by a wrong date in one of the activities."); - } - $this->img->CreateImgCanvas($width,$height); - $this->img->SetMargin($lm,$rm,$tm,$bm); - } - } - - // Return an array width the maximum width for each activity - // column. This is used when we autosize the columns where we need - // to find out the maximum width of each column. In order to do that we - // must walk through all the objects, sigh... - function GetMaxActInfoColWidth() { - $n = count($this->iObj); - if( $n == 0 ) return; - $w = array(); - $m = $this->scale->actinfo->iLeftColMargin + $this->scale->actinfo->iRightColMargin; - - for( $i=0; $i < $n; ++$i ) { - $tmp = $this->iObj[$i]->title->GetColWidth($this->img,$m); - $nn = count($tmp); - for( $j=0; $j < $nn; ++$j ) { - if( empty($w[$j]) ) - $w[$j] = $tmp[$j]; - else - $w[$j] = max($w[$j],$tmp[$j]); - } - } - return $w; - } - - // Stroke the gantt chart - function Stroke($aStrokeFileName="") { - - // If the filename is the predefined value = '_csim_special_' - // we assume that the call to stroke only needs to do enough - // to correctly generate the CSIM maps. - // We use this variable to skip things we don't strictly need - // to do to generate the image map to improve performance - // a best we can. Therefor you will see a lot of tests !$_csim in the - // code below. - $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); - - // Should we autoscale dates? - - if( !$this->scale->IsRangeSet() ) { - list($min,$max) = $this->GetBarMinMax(); - $this->scale->SetRange($min,$max); - } - - $this->scale->AdjustStartEndDay(); - - // Check if we should autoscale the image - $this->AutoSize(); - - // Should we start from the top or just spread the bars out even over the - // available height - $this->scale->SetVertLayout($this->iLayout); - if( $this->iLayout == GANTT_FROMTOP ) { - $maxheight=max($this->GetMaxLabelHeight(),$this->GetMaxBarAbsHeight()); - $this->scale->SetVertSpacing($maxheight*(1+$this->iLabelVMarginFactor)); - } - // If it hasn't been set find out the maximum line number - if( $this->scale->iVertLines == -1 ) - $this->scale->iVertLines = $this->GetBarMaxLineNumber()+1; - - $maxwidth=max($this->scale->actinfo->GetWidth($this->img), - max($this->GetMaxLabelWidth(), - $this->scale->tableTitle->GetWidth($this->img))); - - $this->scale->SetLabelWidth($maxwidth+$this->scale->divider->iWeight);//*(1+$this->iLabelHMarginFactor)); - - if( !$_csim ) { - $this->StrokePlotArea(); - if( $this->iIconDepth == DEPTH_BACK ) { - $this->StrokeIcons(); - } - } - - $this->scale->Stroke(); - - if( !$_csim ) { - // Due to a minor off by 1 bug we need to temporarily adjust the margin - $this->img->right_margin--; - $this->StrokePlotBox(); - $this->img->right_margin++; - } - - // Stroke Grid line - $this->hgrid->Stroke($this->img,$this->scale); - - $n = count($this->iObj); - for($i=0; $i < $n; ++$i) { - //$this->iObj[$i]->SetLabelLeftMargin(round($maxwidth*$this->iLabelHMarginFactor/2)); - $this->iObj[$i]->Stroke($this->img,$this->scale); - } - - $this->StrokeTitles(); - - if( !$_csim ) { - $this->StrokeConstrains(); - $this->footer->Stroke($this->img); - - - if( $this->iIconDepth == DEPTH_FRONT) { - $this->StrokeIcons(); - } - - // Stroke all added user texts - $this->StrokeTexts(); - - // Should we do any final image transformation - if( $this->iImgTrans ) { - if( !class_exists('ImgTrans',false) ) { - require_once('jpgraph_imgtrans.php'); - } - - $tform = new ImgTrans($this->img->img); - $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, - $this->iImgTransDirection,$this->iImgTransHighQ, - $this->iImgTransMinSize,$this->iImgTransFillColor, - $this->iImgTransBorder); - } - - - // If the filename is given as the special "__handle" - // then the image handler is returned and the image is NOT - // streamed back - if( $aStrokeFileName == _IMG_HANDLER ) { - return $this->img->img; - } - else { - // Finally stream the generated picture - $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline, - $aStrokeFileName); - } - } - } - - function StrokeConstrains() { - $n = count($this->iObj); - - // Stroke all constrains - for($i=0; $i < $n; ++$i) { - - // Some gantt objects may not have constraints associated with them - // for example we can add IconPlots which doesn't have this property. - if( empty($this->iObj[$i]->constraints) ) continue; - - $numConstrains = count($this->iObj[$i]->constraints); - - for( $k = 0; $k < $numConstrains; $k++ ) { - $vpos = $this->iObj[$i]->constraints[$k]->iConstrainRow; - if( $vpos >= 0 ) { - $c1 = $this->iObj[$i]->iConstrainPos; - - // Find out which object is on the target row - $targetobj = -1; - for( $j=0; $j < $n && $targetobj == -1; ++$j ) { - if( $this->iObj[$j]->iVPos == $vpos ) { - $targetobj = $j; - } - } - if( $targetobj == -1 ) { - JpGraphError::RaiseL(6008,$this->iObj[$i]->iVPos,$vpos); - //('You have specifed a constrain from row='.$this->iObj[$i]->iVPos.' to row='.$vpos.' which does not have any activity.'); - } - $c2 = $this->iObj[$targetobj]->iConstrainPos; - if( count($c1) == 4 && count($c2 ) == 4) { - switch( $this->iObj[$i]->constraints[$k]->iConstrainType ) { - case CONSTRAIN_ENDSTART: - if( $c1[1] < $c2[1] ) { - $link = new GanttLink($c1[2],$c1[3],$c2[0],$c2[1]); - } - else { - $link = new GanttLink($c1[2],$c1[1],$c2[0],$c2[3]); - } - $link->SetPath(3); - break; - case CONSTRAIN_STARTEND: - if( $c1[1] < $c2[1] ) { - $link = new GanttLink($c1[0],$c1[3],$c2[2],$c2[1]); - } - else { - $link = new GanttLink($c1[0],$c1[1],$c2[2],$c2[3]); - } - $link->SetPath(0); - break; - case CONSTRAIN_ENDEND: - if( $c1[1] < $c2[1] ) { - $link = new GanttLink($c1[2],$c1[3],$c2[2],$c2[1]); - } - else { - $link = new GanttLink($c1[2],$c1[1],$c2[2],$c2[3]); - } - $link->SetPath(1); - break; - case CONSTRAIN_STARTSTART: - if( $c1[1] < $c2[1] ) { - $link = new GanttLink($c1[0],$c1[3],$c2[0],$c2[1]); - } - else { - $link = new GanttLink($c1[0],$c1[1],$c2[0],$c2[3]); - } - $link->SetPath(3); - break; - default: - JpGraphError::RaiseL(6009,$this->iObj[$i]->iVPos,$vpos); - //('Unknown constrain type specified from row='.$this->iObj[$i]->iVPos.' to row='.$vpos); - break; - } - - $link->SetColor($this->iObj[$i]->constraints[$k]->iConstrainColor); - $link->SetArrow($this->iObj[$i]->constraints[$k]->iConstrainArrowSize, - $this->iObj[$i]->constraints[$k]->iConstrainArrowType); - - $link->Stroke($this->img); - } - } - } - } - } - - function GetCSIMAreas() { - if( !$this->iHasStroked ) - $this->Stroke(_CSIM_SPECIALFILE); - - $csim = $this->title->GetCSIMAreas(); - $csim .= $this->subtitle->GetCSIMAreas(); - $csim .= $this->subsubtitle->GetCSIMAreas(); - - $n = count($this->iObj); - for( $i=$n-1; $i >= 0; --$i ) - $csim .= $this->iObj[$i]->GetCSIMArea(); - return $csim; - } -} - -//=================================================== -// CLASS PredefIcons -// Description: Predefined icons for use with Gantt charts -//=================================================== -define('GICON_WARNINGRED',0); -define('GICON_TEXT',1); -define('GICON_ENDCONS',2); -define('GICON_MAIL',3); -define('GICON_STARTCONS',4); -define('GICON_CALC',5); -define('GICON_MAGNIFIER',6); -define('GICON_LOCK',7); -define('GICON_STOP',8); -define('GICON_WARNINGYELLOW',9); -define('GICON_FOLDEROPEN',10); -define('GICON_FOLDER',11); -define('GICON_TEXTIMPORTANT',12); - -class PredefIcons { - private $iBuiltinIcon = null, $iLen = -1 ; - - function GetLen() { - return $this->iLen ; - } - - function GetImg($aIdx) { - if( $aIdx < 0 || $aIdx >= $this->iLen ) { - JpGraphError::RaiseL(6010,$aIdx); - //('Illegal icon index for Gantt builtin icon ['.$aIdx.']'); - } - return Image::CreateFromString(base64_decode($this->iBuiltinIcon[$aIdx][1])); - } - - function __construct() { - //========================================================== - // warning.png - //========================================================== - $this->iBuiltinIcon[0][0]= 1043 ; - $this->iBuiltinIcon[0][1]= - 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. - 'B3RJTUUH0wgKFSgilWPhUQAAA6BJREFUeNrtl91rHFUYh5/3zMx+Z5JNUoOamCZNaqTZ6IWIkqRiQWmi1IDetHfeiCiltgXBP8AL'. - '0SIUxf/AvfRSBS9EKILFFqyIH9CEmFZtPqrBJLs7c+b1YneT3WTTbNsUFPLCcAbmzPt73o9zzgzs2Z793231UOdv3w9k9Z2uzOdA'. - '5+2+79yNeL7Hl7hw7oeixRMZ6PJM26W18DNAm/Vh7lR8fqh97NmMF11es1iFpMATqdirwMNA/J4DpIzkr5YsAF1PO6gIMYHRdPwl'. - 'oO2elmB+qH3sm7XozbkgYvy8SzYnZPtcblyM6I+5z3jQ+0vJfgpEu56BfI9vUkbyi2HZd1QJoeWRiAjBd4SDCW8SSAOy6wBHMzF7'. - 'YdV2A+ROuvRPLfHoiSU0EMY/cDAIhxJeGngKaN1VgHyPL7NBxI1K9P4QxBzw3K1zJ/zkG8B9uwaQ7/HNsRZv9kohBGD0o7JqMYS/'. - '/ynPidQw/LrBiPBcS/yFCT95DvB2BWAy4575PaQbQKW+tPd3GCItu2odKI++YxiKu0d26oWmAD7paZU/rLz37VqIijD2YbnzNBBE'. - 'IBHf8K8qjL7vYhCGErEU8CTg3xXAeMp96GrJEqkyXkm9Bhui1xfsunjdGhcYLq+IzjsGmBt5YH/cmJkFq6gIqlon3u4LxdKGuCIo'. - 'Qu41g0E41po+2R33Xt5uz9kRIB2UTle7PnfKrROP1HD4sRjZlq0lzhwoZ6rDNeTi3nEg1si/7FT7kYQbXS6E5E65tA5uRF9tutq0'. - 'K/VwAF+/FbIYWt6+tjQM/AqUms7A4Wy6d7YSfSNxgMmzi0ycWWworio4QJvj4LpuL5BqugTnXzzqJsJwurrlNhJXFaavW67NRw3F'. - 'q+aJcCQVe9fzvJGmAY7/dPH0gi0f64OveGxa+usCuQMeZ0+kt8BVrX+qPO9Bzx0MgqBvs+a2PfDdYIf+WAjXU1ub4tqNaPPzRs8A'. - 'blrli+WVn79cXn0cWKl+tGx7HLc7pu3CSmnfitL+l1UihAhwjFkPQev4K/fSABjBM8JCaFuurJU+rgW41SroA8aNMVNAFtgHJCsn'. - 'XGy/58QVxAC9MccJtZ5kIzNlW440WrJ2ea4YPA9cAooA7i0A/gS+iqLoOpB1HOegqrYB3UBmJrAtQAJwpwPr1Ry92wVlgZsiYlW1'. - 'uX1gU36dymgqYxJIJJNJT1W9QqHgNwFQBGYqo94OwHZQUuPD7ACglSvc+5n5T9m/wfJJX4U9qzEAAAAASUVORK5CYII=' ; - - //========================================================== - // edit.png - //========================================================== - $this->iBuiltinIcon[1][0]= 959 ; - $this->iBuiltinIcon[1][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAFgAWABY9j+ZuwAAAAlwSFlz'. - 'AAALEAAACxABrSO9dQAAAAd0SU1FB9AKDAwbIEXOA6AAAAM8SURBVHicpdRPaBxlHMbx76ZvsmOTmm1dsEqQSIIsEmGVBAQjivEQ'. - 'PAUJngpWsAWlBw8egpQepKwplN4ULEG9CjkEyUFKlSJrWTG0IU51pCsdYW2ncUPjdtp9Z+f3vuNhu8nKbmhaf5cZeGc+PO8zf1Lc'. - 'm0KhkACICCKCMeaBjiLC0tLSnjNvPmuOHRpH0TZTU1M8zBi9wakzn7OFTs5sw8YYACYmJrre7HkeuVyu69qPF77hlT1XmZ0eQ03O'. - 'wOLJTvhBx1rLz18VmJ0eY+jVd2FxDkKXnvYLHgb97OgLzE4ON9Hzc1B1QaQzsed5O0Lta3Ec89OnR5h5McfQ+Mw2qgQUnfBOPbZ3'. - 'bK3l+xOvMT0+3ERLp5FNF6UEjcL32+DdVmGt5WLhDYYPZrbRqreFumXwql0S3w9tnDvLWD5PZigPpdOwuYpSCo3C8wU3UHxQdHbf'. - 'cZIkNM6dxcnlUM4k1eUFMlUPpUADbpkttFarHe6oYqeOr6yt4RzMQHYUcUsQVtGicHDwKprViuLDkkOtVnsHCHZVRVy/zcj1i5Af'. - 'h8AjdIts+hUcGcYPK3iBtKM3gD/uAzf/AdY2mmmVgy6X8YNNKmGIvyloPcB8SUin07RQ4EZHFdsdG0wkJEnEaHAJxvKEpSLeaokV'. - 'r4zWmhUZYLlY4b1D03y5eIEWCtS7vsciAgiIxkQRabWOrlQor66y4pUphoJb1jiO4uO5o0S3q6RSqVbiOmC7VCEgAhLSaDQ48dH7'. - 'vD46REY0iysegSjKQciRt99ib7qXwX0O+pG4teM6YKHLB9JMq4mTmF9/+AKA4wvLZByH7OgYL7+UY2qvw/7Bfg5kHiXjJFyv3CGO'. - 'Y1rof+BW4t/XLiPG0DCGr79d4XzRxRnIMn98huXSTYyJ6et1UNYQhRvcinpJq86H3wGPPPM0iBDd+QffD1g4eZjLvuG7S1Wef26E'. - 'J7L7eSx7gAHVg7V3MSbi6m/r93baBd6qQjerAJg/9Ql/XrvG0ON1+vv7GH3qSfY5fahUnSTpwZgIEQesaVXRPbHRG/xyJSAxMYlp'. - 'EOm71HUINiY7mGb95l/8jZCyQmJjMDGJjUmsdCROtZ0n/P/Z8v4Fs2MTUUf7vYoAAAAASUVORK5CYII=' ; - - //========================================================== - // endconstrain.png - //========================================================== - $this->iBuiltinIcon[2][0]= 666 ; - $this->iBuiltinIcon[2][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'. - 'AAALDwAACw8BkvkDpQAAAAd0SU1FB9ALEREILkh0+eQAAAIXSURBVHictZU9aFNRFMd/N81HX77aptJUWmp1LHRpIcWhg5sIDlUQ'. - 'LAXB4t7RRUpwEhy7iQ46CCIoSHcl0CFaoVARU2MFMYktadLXJNok7x2HtCExvuYFmnO4w/3gx+Gc/z1HKRTdMEdXqHbB/sgc/sic'. - 'nDoYAI8XwDa8o1RMLT+2hAsigtTvbIGVqhX46szUifBGswUeCPgAGB7QeLk0X4Ork+HOxo1VgSqGASjMqkn8W4r4vVtEgI/RRQEL'. - 'vaoGD85cl5V3nySR/S1mxWxab7f35PnntNyMJeRr9kCMqiHTy09EoeToLwggx6ymiMOD/VwcD7Oa/MHkcIiQx026WGYto5P/U+ZZ'. - '7gD0QwDuT5z9N3LrVPi0Xs543eQPKkRzaS54eviJIp4tMFQFMllAWN2qcRZHBnixNM8NYD162xq8u7ePSQ+GX2Pjwxc2dB2cLtB8'. - '7GgamCb0anBYBeChMtl8855CarclxU1gvViiUK4w2OMkNDnGeJ8bt9fH90yOnOkCwLFTwhzykhvtYzOWoBBbY//R3dbaNTYhf2RO'. - 'QpeuUMzv188MlwuHy0H13HnE48UzMcL0WAtUHX8OxZHoG1URiFw7rnLLCswuSPD1ulze/iWjT2PSf+dBXRFtVVGIvzqph0pQL7VE'. - 'avXYaXXxPwsnt0imdttCocMmZBdK7YU9D8wuNOW0nXc6QWzPsSa5naZ1beb9BbGB6dxGtMnXAAAAAElFTkSuQmCC' ; - - //========================================================== - // mail.png - //========================================================== - $this->iBuiltinIcon[3][0]= 1122 ; - $this->iBuiltinIcon[3][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'. - 'AAALEAAACxABrSO9dQAAAAd0SU1FB9AJHAMfFvL9OU8AAAPfSURBVHictZRdaBRXFMd/987H7tbNx8aYtGCrEexDsOBDaKHFxirb'. - 'h0qhsiY0ykppKq1osI99C4H2WSiFFMHWUhXBrjRi0uCmtSEUGgP1QWqhWjGkoW7M1kTX3WRn5p4+TJJNGolQ6IXDnDtz+N0z/3PP'. - 'UWBIpdpYa23b9g09PZ2kUrOrvmUyGVKp1Ao/mUyi56YnVgWfO/P1CihAd/dJMpmaNROIRq8BkM1m0bH6TasC3j6QXgFdXI+DR6PR'. - 'JX/Pno8B+KLnMKqlpUU8z8MYs2RBEDzWf9J+0RcRbMdxGBsbw/fmCXwPMUEYID4iAVp8wIRmDIHMo4yHSIBSASKC+CWE0C/PF9jU'. - '3B6Cp+4M07C5FUtKGNvGwQJctPgIsgD2wRhEIqAMGB+UQYkHJgYYZD7P1HwVlmWhHcfhyk83KeRGUW4t6CgoG5SNUS4KBWgQDUov'. - '7AGlwYASBVqH0Bk49dXpCviVV3dw/tI1Bvr7kMIIlh0NYUpjlF0BAYvcxSXmEVLKceHSCJm+PnbueBHbtkNwTXUNBzo6aGpq4sSZ'. - 'GwT5H7BsF6Wdf1GWHQAoM0upeI9PT1yioS7B7tdaSdSuw7KsUGMAy7HYsmUztTW1nMwM0txssX1rlHjjS5jy/Uq2YkK/eJuLl6/z'. - 'x+1xkslW6mrixGIODx8EFSlEBC0+tmXT0NhA2763iEUjnLv4C8XpUbSbAB1mKkGJ3J83Od77HW5EszvZSqK2iljMIeJaRGNuJePF'. - '6mspY7BJ1DXwQnCd2fxGRq5OUCz8xt72dyhMZcn++Cu3xu9SKhdp2b4ZHWnAtTSxmIWlhcIjlksR3lNBYzlxZsb7+f7ne+xtSzOd'. - 'u83szH1OnThOPp/n+a0beeP1l4mvq+PU2Qyd+5PY1RuwlAqLYFaBfbTbyPSdfgaH77A//QF4f1O/vpr6RJyq+C5Kc/M8FbFxXItY'. - 'xOHDrvfo/fxLDnbsJBp5BowBReVWYAzabeTh5ABDw7cWoNNL3YYYNtSv57lnn6Z+Qx01VeuIuBa2DV1HD3H63BAPZu4u1WGpeLHq'. - 'Rh7+NcjA0O+0p4+CNwXigwnbWlQQdpuEpli+n+PIkcOc//YKuckJJFh2K2anrjFw+QZt6S6kPImIF/b+cqAJD1LihWAxC61twBTo'. - 'fPcQF/oGsVW5ovHQlavs2/8+uYnRVSOUgHAmmAClBIOBwKC0gPjhIRgEIX2wg7NnwpZW3d3d4vs+vu8TBMGK51rvPM9b8hdteZxd'. - 'LBbVR8feJDs0Rlv6GFKeXJ21rNRXESxMPR+CBUl0nN7PjtO+dye7Up/8v1I88bf/ixT/AO1/hZsqW+C6AAAAAElFTkSuQmCC' ; - - //========================================================== - // startconstrain.png - //========================================================== - $this->iBuiltinIcon[4][0]= 725 ; - $this->iBuiltinIcon[4][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'. - 'AAALDgAACw4BQL7hQQAAAAd0SU1FB9ALEREICJp5fBkAAAJSSURBVHic3dS9a1NRGMfx77kxtS+xqS9FG6p1ER3qVJpBQUUc3CRU'. - 'BwURVLB1EAuKIP0THJQiiNRJBK3iJl18AyeltRZa0bbaJMbUNmlNSm5e7s25j0NqpSSmyag/OMM9POdzDuflwn8djz8gClVRrVEV'. - 'ur4Bl1FTNSzLrSS6vbml0jUUwSXj8Qfk3PkLtLW2AeBIybmrgz3+gFzpucjlE4f4btuFTuWuCF5XDr3a3UPf6cM8GQvxzbsRAJdh'. - 'ScfxSywml5j7mVypN0eGEJ0tebIre+zxB6Tv7jPReS2hREpOvpmUXU+H5eC913JnNCSRVE60pUVbWoZjprR39Yq70bdqj4pW7PEH'. - '5FpvL9e79jOTTHM7ssDL6CJZ08LbvAGnrpZg2mI2Z/MlZfN8IkxuSwu4V9+WIrj7zFlOHfXzKrLIi2SGh5ECKjnNVNxkQEc55vOw'. - 'rb6O8JLFdHyJ+ayFElUeHvjwkfteL/V7fKTSkFvIQE4DoLI2Mz/muTkTApcBKIwaN8pwIUrKw+ajWwDknAO0d/r4zFaMuRS63sWm'. - 'RoOdm+vRIriUYjKexrQV+t1o0YEVwfZSVJmD/dIABJuO0LG3lRFx0GOfiAELE9OgCrfU0XnIp5FwGLEy5WEAOxlR5uN+ARhP7GN3'. - '5w7Gv4bQI2+xpt4jjv2nWBmIlcExE2vDAHYioszBZXw6CPE4ADoWVHmd/tuwlZR9eXYyoszBfpiNQqaAOU5+TXRN+DeeenADPT9b'. - 'EVgKVsutKPl0TGWGhwofoquaoKK4apsq/tH/e/kFwBMXLgAEKK4AAAAASUVORK5CYII=' ; - - //========================================================== - // calc.png - //========================================================== - $this->iBuiltinIcon[5][0]= 589 ; - $this->iBuiltinIcon[5][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAA4AIwBbgMF12wAAAAlwSFlz'. - 'AAALEQAACxEBf2RfkQAAAAd0SU1FB9AHBxQeFsqn0wQAAAHKSURBVHicnZWff+RAGIef3U/gcOEgUAgUCgcLhYXCwsHBQeGgUDgs'. - 'FgMHB4VA/4Bg4XChWFgIFIqBwkJhsRAYeOGF+TQHmWSTTbKd9pU37/x45jvfTDITXEynAbdWKVQB0NazcVm0alcL4rJaRVzm+w/e'. - '3iwAkzbYRcnnYgI04GCvsxxSPabYaEdt2Ra6D0atcvvvDmyrMWBX1zPq2ircP/Tk98DiJtjV/fim6ziOCL6dDHZNhxQ3arIMsox4'. - 'vejleL2Ay9+jaw6A+4OSICG2cacGKhsGxg+CxeqAQS0Y7BYJvowq7iGMOhXHEfzpvpQkA9bLKgOgWKt+4Lo1mM9hs9m17QNsJ70P'. - 'Fjc/O52joogoX8MZKiBiAFxd9Z1vcj9wfSpUlDRNMcYQxzFpmnJ0FPH8nDe1MQaWSz9woQpWSZKEojDkeaWoKAyr1tlu+s48wfVx'. - 'u7n5i7jthmGIiEGcT+36PP+gFeJrxWLhb0UA/lb4ggGs1T0rZs0zwM/ZjNfilcIY5tutPxgOW3F6dUX464LrKILLiw+A7WErrl+2'. - 'rABG1EL/BilZP8DjU2uR4U+2E49P1Z8QJmNXUzl24A9GBT0IruCfi86d9x+D12RGzt+pNAAAAABJRU5ErkJggg==' ; - - //========================================================== - // mag.png - //========================================================== - $this->iBuiltinIcon[6][0]= 1415 ; - $this->iBuiltinIcon[6][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'. - 'AAALDAAACwwBP0AiyAAAAAd0SU1FB9ALDxEWDY6Ul+UAAAUESURBVHicdZVrbFRFGIafsyyF0nalV1R6WiggaAptlzsr1OgEogmC'. - '0IgoBAsBgkIrBAPEhBj/AP6xRTCUFEwRI4jcgsitXMrFCJptJWvBNpXYbbXtbtttt6e7e86ec/yxadlCfZPJZDIz73zzzjfvR2VL'. - 'F7U+hf0HD2JduIzTFy6SlJRkPtkcDgdCCE65OxFC8NPV6wghyM7OptankJ2dzbSC5QghEEIgCSHog9PpNAF27dlN6miZuPgElB4/'. - 'nmY3O7ZtByA1NVUCkGWZweD1eklJScESTbqxuIjrd+/x6uIl5M19hSy7nfGOeUxf+g7VjU1sKi7C4/GYsiyz7tAJAD4/cRaA1tZW'. - 'AHIPnECUVGD1+/3U19ebG4uLeHf1akamjsIwoVnVCOvQEdLoVILYYmMo3PIxSBJflpSaDX5FAmju1QAYv/8k/s8+wLVxOU0jR2LZ'. - '8sMFAApWrCApbRRDrRZirBYSLBKaoRPQw3SFernf2sav7T0Ubt4KwL4FMwF4Vu8FoHBCKgCzDhwHwLIhZ7y5a89u4m2JhA0wTdDC'. - 'OrphEjJMNElCHxKDEjaobmvlfo/Krj27CQQCJsCGJW8C0KXqAMxMiosQA8hZWcTFx9OsaniDKh1qmG7VoFsL0x0K06kbeAMhWpRe'. - '/KpG+gwHAKUnz7Dz3BUMw6DK18nuw99wt0Nh6VdHI8RJicmETQgFg7SFwjSrGv+oKp6ghldV6dZ0ugJBlF6FmCESQ2w2AIqXLsan'. - 'BrFYLJTnTCBrdBqveeopWZiPFaBHUegJhegMqGgxEkHDwB/UaQ9rdIV06v0+TD2EEQjQFtAY0dsNgNvt5sialQAIIXh7wQKuVf6J'. - 'gTsSccPDWlQstClBGjr9eHpVWvUQncEwdYEedF8noQ4vmYmpZMTH0nTvDn25vLbrNmu7bvfnsYEbAMnhcPDgwQPzUo2LJusw/mhp'. - 'QwlHNO0KBAnoIfxtrcQMT2De1Mm891wyUzNlUlJSpIyMDBobGzlzr5rFM/Koq6vrP8ASGxsLwPmKcvIShjPGZiPOakE3VFB8hHwd'. - 'vJAxhrk5L7Ly+RQuH/sWgPdXrwFg/6HDFBUsIj09nehfbAWwPWOT9n5RYhqGwarNWxkRM5TRCfF4U1PQsDDJFk9uYhwXvzvKjm3b'. - 'KSsro3DJInNW5RXp7u2bAKSlpeH1esnPz6eqqgqLpmmcr3Fht9ulfaV7mZk1Bs+lM6T1djM9fhg5egDPpTNMy5TZsW07kydPYdWM'. - 'aXx96ixOp9O8cfUa80srmDpjOgAulytiQqZpMnvObLbt/JTtHxXj9/tRVdU0DGOAufRpevPDTeac0hJyc3NxOOawfv161lVWS6eX'. - 'z+9/UOCxu1VWVvaTRGv16NFfjB2bNeAQp9NpTpmSM4DcbrdL0WsGDKLRR+52uwe1yP8jb2lpYfikyY9t80n03UCWZeaXVjw1f+zs'. - 'Oen+/d+pqanhzp2fKSsrw+l0mi6XiyPl5ZGITdN8fAVJwjRNJEmi1qfw1kw7siyTnJxMe3s71dXV3GpoZO64DG41NPJylvxU5D/e'. - 'qJKsfWQD9IkaZ2RmUvr9aV4aGYcQgjfO3aWoYBF5eXm4ewIsu/CbdPz1aWb0/p1bNoOrQxlUiuiaFo3c3FyEEOx9+C9CCD6paaTW'. - 'p/TXyYkTJ0Xe59jf7QOyAKDWp/QXxcFQ61P4pT3ShBBcvnUHIQTjxmX19/8BCeVg+/GPpskAAAAASUVORK5CYII=' ; - - //========================================================== - // lock.png - //========================================================== - $this->iBuiltinIcon[7][0]= 963 ; - $this->iBuiltinIcon[7][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz'. - 'AAALCwAACwsBbQSEtwAAAAd0SU1FB9AKAw0XDmwMOwIAAANASURBVHic7ZXfS1t3GMY/3+PprI7aisvo2YU6h6ATA8JW4rrlsF4U'. - 'qiAsF9mhl0N2cYTRy9G/wptAYWPD9iJtRy5asDe7cYFmyjaXOLaMImOrmkRrjL9yTmIS3120JybWQgfb3R74wuc8Lzw858vLOUpE'. - 'OK6pqSm2trbY39+nu7tbPHYch7m5OcLhMIA67kWj0aMQEWk6tm17rNm2LSIie3t7ksvlJJ1OSyqVkls3Z8SyLMnlcqTTaVKpFLdu'. - 'zmBZVj1HeY2VUti2TSQSQSml2bZdi0QirK2tMT09zerqKtlslqGhISYnJ4nHv2N+foFsNquOe9FotLlxOBwmk8lgWRbhcFgymYxY'. - 'liUi0mqaJoAuIi2macrdO7fFsizx3to0Te7euV1vrXtXEgqFmJmZYWVlhXK5LB4/U9kwDL784kYV0A3DYHd3m4sXRymXywKoRi8U'. - 'Ch01DgQCJBIJLMsiEAhIIpHw2uLz+eqtYrEYIqKZpimxWEyCwaCMjY01zYPBIJpXqVQqsby8TLVabWKA/v5+RkZGMAyDrq4ulFKH'. - 'HsfjcWZnZ+ns7KTRqwcnk0mKxSKFQqGJlVKtruuSTCYB6O3trW9UI/v9/iZPB/j8s2HOnX0FgHfeXpeffnzK+fWf+fijvhLs0PtG'. - 'D/n1OJ9+MsrlSwb3733DwMCAt1EyPj6uACYmJp56168NU6nUqFSE9nZdPE7+WqC/r4NKTagcCJVqDaUUB5VDAA4Pa9x7sMLlSwan'. - 'WjRmv13D7/erpaWlo604qOp88OF7LC48rPNosMq5Th+Dgxd4/XyA1rbzADi7j8jnf2P++wdcvSr8MJ/i8eomAKlUqn41OsDAQDeD'. - 'g++yuPCwzm/2vU8+n2a7sMFfj79mp7BBuVzioFSiXHJx3SKuW2Rzy0Up9dxnQVvODALQerqNRn4ZKe0Mvtc6TpzpmqbxalcY9Ato'. - '2v06t515C73YQftZB9GLnDrt4LoujuPgOA4Ui+C6yOpXJwZrJ7r/gv4P/u+D9W7fLxTz+1ScQxrZ3atRLaVxdjbY2d184R6/sLHe'. - 'opHP7/Do90Ua+WWUyezzZHObP/7cfX54/dowE1d66s8TV3oE+Mfn+L/zb4XmHPjRG9YjAAAAAElFTkSuQmCC' ; - - //========================================================== - // stop.png - //========================================================== - $this->iBuiltinIcon[8][0]= 889 ; - $this->iBuiltinIcon[8][1]= - 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz'. - 'AAALDwAACw8BkvkDpQAAAAd0SU1FB9AJDwEvNyD6M/0AAAL2SURBVHic1ZTLaxVnGIefb2bO5OScHJN4oWrFNqcUJYoUEgU3/Qf6'. - 'F7gwCkIrvdBLUtqqiLhSg9bgBduFSHZdiG5ctkJ3xRDbUFwUmghNzBDanPGMkzOX79LFJGPMOSd204U/+Bbzvd/78F4H/ieJdoad'. - 'pZKxRFszAI/DcP0HazXY22v+HB01kee1PA/v3zfnjx4xgGnHcNZe7OvuNj+cOEF1ZATv5nUA4jhBSgmADCVWo8Ge2Of9wb18P/G7'. - 'oUXmYi30zqlTVEdGWLh1g2D6MYlKkXGE0Vl8aa2GEB149+4xXSzyoOIw/mimiZV/DPb25pFOj13A9gOMEChhUEqhVYqWKUk9QAUp'. - 'sT/P4s8PmKlUmNhQaIJbkDVqBbpw6wZ2zUc4Nm+ePku5p4eOrgpueQOFUoVCVxcD4+N07dpF9+5tVJeWGPBjhvr7WF1zC8ASgtcP'. - 'H8a7eZ1odh4sh50nzwCw9ZNh3M4Stutiu0X2nB/LyjZ6lcIbVTpdQU/jWVPzLADM8+ZGBRdtC7wrF/O7bR99iu26VL86iU4SAH4b'. - 'Po5d6AQhstMSvGyI4wS5FJBKSRwnzF8byx/u+PjzzMF1mfryQ1K/jnCahqp1xEopjFLoNEFJSRJHzF799gWHqa+/QKcSUXBI609f'. - 'Al5W4teQSiHDOipNUKnMI13RvnOXAIEKQixvGWya98SC560MFwPiqEG86JM8q79Q06lvhnOndy5/B6GPCUOMUu3BQgg8z0M3GmBZ'. - 'iGJn3v2VmsqnfzNx7FDueODuj8ROCFpjtG5TCmOYv32bJ09msP0ISydMfnAUgF8/O45RAA6WTPjlvXcB+Gn7FuRf/zAnNX6x3ARe'. - 'PSdmqL+P/YHkwMGDOGWDZTlQcNBRhPEComgB/YeHfq2InF1kLlXUOkpMbio1bd7aATRD/X0M1lPeSlM2vt2X1XBZjZnpLG2tmZO6'. - 'LbQVOIcP+HG2UauH3xgwBqOz9Cc3l1tC24Fz+MvUDroeGNb5if9H/1dM/wLPCYMw9fryKgAAAABJRU5ErkJggg==' ; - - //========================================================== - // error.png - //========================================================== - $this->iBuiltinIcon[9][0]= 541 ; - $this->iBuiltinIcon[9][1]= - 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAaVBMVEX//////2Xy8mLl5V/Z2VvMzFi/v1WyslKlpU+ZmUyMjEh/'. - 'f0VyckJlZT9YWDxMTDjAwMDy8sLl5bnY2K/MzKW/v5yyspKlpYiYmH+MjHY/PzV/f2xycmJlZVlZWU9MTEXY2Ms/PzwyMjLFTjea'. - 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTCAkUMSj9wWSOAAABLUlEQVR4'. - '2s2U3ZKCMAxGjfzJanFAXFkUle/9H9JUKA1gKTN7Yy6YMjl+kNPK5rlZVSuxf1ZRnlZxFYAm93NnIKvR+MEHUgqBXx93wZGIUrSe'. - 'h+ctEgbpiMo3iQ4kioHCGxir/ZYUbr7AgPXs9bX0BCYM8vN/cPe8oQYzom3tVsSBMVHEoOJ5dm5F1RsIe9CtqGgRacCAkUvRtevT'. - 'e2pd6vOWF+gCuc/brcuhyARakBU9FgK5bUBWdHEH8tHpDsZnRTZQGzdLVvQ3CzyYZiTAmSIODEwzFCAdJopuvbpeZDisJ4pKEcjD'. - 'ijWPJhU1MjCo9dkYfiUVjQNTDKY6CVbR6A0niUSZjRwFanR0l9i/TyvGnFdqwStq5axMfDbyBksld/FUumvxS/Bd9VyJvQDWiiMx'. - 'iOsCHgAAAABJRU5ErkJggg==' ; - - //========================================================== - // openfolder.png - //========================================================== - $this->iBuiltinIcon[10][0]= 2040 ; - $this->iBuiltinIcon[10][1]= - 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEANAAtwClFht71AAAAAlwSFlz'. - 'AAALEAAACxABrSO9dQAAAAd0SU1FB9AKDQ4RIXMeaLcAAAd1SURBVHicxZd7jBXVHcc/58zcvTNzH8vusqw8FsTsKiCUUh5WBZXG'. - 'GkOptmqwNWsWLKXFGlEpzZI0AWNKSy0WhDS22gJKtWlTsSRqzYIuLGB2WVvDIwQMZQMsy2OFfdzde+/OnHP6x907vJaFpjb9JZM5'. - 'c85Mfp/f9/s7Jxn4P4e41gtSyp78WGvtfdEAcqDFYUOH9HS0NhGk9tPb/ilSyp789UUB2AMuqhQy3Uzm7HGkE6W3dTNZMRI3EcWO'. - 'jf9ClLmWBT3dzW8jUsevWHCG3UpWl+IkHSxnbDh/Mcz12NevBcuWXTmf6TjnXvJ88gDmVB3pw3+nt3UzHa1NqMzBS2zqPLGFjtMN'. - 'ZNr3XdW+qyqwZcFk76HX/tHWfuQvyO4W7qhaHwL8efkMRlRUpPv7rqD0RrJ+FgAjLy1a20OIxZJEEuNCRfIApj+om4bGM3u2/sYU'. - '9J41d8973f3Dhg1pISTV1dXXBRNJxPGFCzhou+DCQrScZOkktNaeDZjamgeZ9MgiYmVDccvHhjAzJw0NTh8/alyZMaVJicp0iTHj'. - 'JpgNv38tjWUhhGROdbUL9W5/MH5XCkjlcibi+KIop5LVHLKEu8A/f4r286doa9pGrGwYAAsfqbbH3b8MgO/Nqgy6WvdbbXHMkEFJ'. - '4xUOMVEvaTZu3BgmvF4Yk4hz9rO/Ulr5cE9owae/rcGxohSOuiWkC2IjcIqKyPZm+OmCH7GhoZEF077EEzVVweAbJ+riEeO0Ey8y'. - 'UubqOHn0AOgMwvf59txnBrSp9dgxKmf/+kIP1NY8SFk0jh5ajmNHAWg5b2E5EexojGHjbiVRMoRMNs0LC+Yz46vTuH3enN7BI8fr'. - 'qFdo0BoVZNC9aVSQ4fNjBzEmQJiARxb+/AqYPMAVB5FsPU5v37g9OxgLhe14ZM5/ju052E6MNZvf5pmHHuLmmWOkEysxUtpGAtme'. - 'dtHTflJkezqQto3jFRnLssyf1jydxiiM7zNnye/c3ZsqLu2BN5fcMfzrv/hby1tPzmRUoihcTJ87CwQI2yLtDcIqsIjYUf51qBlf'. - 'OnScOSrdQUOMURkiXsLUzJnvbGhoBGDHH5cGyZLhOpYoNl5hqYnYEXOu5fDl9eYAHntx98n8hFHZcPHUuTSxSASAeK/CGIOxJJ0f'. - 'bOGNPU280dgkq6Y2yu8vfjCIlwwzr+/ZQ/PHO0gOLuO5qsftDQ2NbN+4OCgqG6WTxWVaq6zpF+DiSHWnicdylp3r6aZTWthIOrNp'. - 'ktHcvBu0sHX1Sm6ozB3B42d90zZA9bQp7PvgPSzXZfnqX/HS4DKKK2+x69Y/HURs26iBAN5ccsfw7774UcumF37C6f07KSt2OHji'. - 'DEUJD0tISjyPrrSPlAKvN0JP/U4O1NfjuhG2rvklN1SOpfXwftpbTqAyKRrff5fb7rs9V1R7m4wlz2ihA3HpmXflUWyOH2umpLiY'. - 'ui3v8M+6bWzfsRNbSgqkxaCkiy0simMuEWEhpcRzIhQWOIAh6tiAwS4owInFiTou5dOnMnl2NR++ujBwXEc9terD6M43nrj6LgAB'. - 'QnDPA9/irtkP8JRS7Hr/3T6YekDQ1pEiEXOwpUVJzCVlZZFS4mZtkpEo9ChAkDp/jtLMBACy6S4RiQghLyv5cgBRPnKUOX6smUGF'. - 'hSil0MYw9d77mPy1e5mnFE3batm3czvb6nYgEJztSFGU9LCRlMRdUjIH0+lnEMIwPNXD3NumoVJnrMCJaiciMUZfvQnz4QcBSvV1'. - 'vjE5GK358t0zmXDnDB79saLpo20c+aSRD+t25JTp7GZQwsEWFiVxl6hlUf/WO9z32CxmL1rOe6u/I2KuwGhzLQCB7/sYY9Bah3el'. - 'FKbvrrVm4vS7GH/7ncx+chEHGz7myCeNbPtoO0JI2jq78WIRLGkzsqs7V5SfFV5EovXACoiqqsfNpk2vo5VCWtYFBfoU0VoTBAFa'. - 'a7TRaK2p+MoURk+cxMzq+Rzbv49DDbuo27UTW9h0dedssPxuK+kIfN8XxhgDYPVXf2Fh4XKtFIl4AiklAlBKAYRKKK36wHIweTCt'. - 'NfHiEkaOn8j0+7/BmDFjaT30GbHywSxcuZkpFfFg+m1jjZ/NmnVvNfRvwd69e8WBA/uNFAIh4JVXXmHsmDHE4vEQQgjQ2lxQIm9N'. - 'nz35q3BEOZOHzaG2thaA4mRU+L29It+IV21CpbRQfeMFC35gRB/M2rVrubnyZmLxWJhECBEmz/eHyo/7lMlH3LFFujsthNFCCGOu'. - '+WNyeUgpjSVzMKtWraKyshLPdcPEeYWCIEBdpIxSivr6eta8vI7d6+cGnhdV06pe1QP+F/QXWmuRL+jZZ58LlVmxYgUVFRV4rhtu'. - '4TzMxXAA6XRaRAtsYUkx8I/JtSJQOlSwpmZpCLN8+fPcdNNoHMfB9/0QJgRoP295TlR7UVv8xxZcHMuWIZ9/Hn35vG3JEGZpzVJG'. - 'jx5N1IlitKahsZE1L69j69qHgx+urFX/lQL9JYdLlfnZihUhzOLFi8N3Ml1dthOxVH/f/8/CtqSJ2JaJ2JZ59J7RPsC/AViJsQS/'. - 'dBntAAAAAElFTkSuQmCC' ; - - //========================================================== - // folder.png - //========================================================== - $this->iBuiltinIcon[11][0]= 1824 ; - $this->iBuiltinIcon[11][1]= - 'iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz'. - 'AAALEAAACxABrSO9dQAAAAd0SU1FB9ECAQgFFyd9cRUAAAadSURBVHiczdhvbBP3Hcfx9/2xfefEOA5JoCNNnIT8AdtZmYBETJsI'. - '6+jQOlQihT1AYgytqzZpD1atfyYqlT1h0lRpT7aRJ4NQpRvZGELVuo5Ua9jEJDIETQsNQyPBsUJMWGPnj//e+e72wNg4xElMR6ed'. - 'ZNln3933dZ/f93f6yfB/sgmrHdDV1WXlPg8NDZUDScD8LFFFEZZlWYZhWMFg0Orq6sq/gDJAfFy1iiZy9OjrVnj4JzQ1rMWqfxm/'. - '309jYyNtbW0kEgnu3bvH4cOH88c/jqSKQl4/XGkd+eVtAN46up1LH92ktqYS++ZX8Pv9NDQ0sGnTJlKpFOFwmO7u7vy5IyMjeVRd'. - 'XV1+WEOh0IrY4pDnq6wXX/sTiCJaMkFZdRNqxefoe7VtCSqXVDqdZnZ2ltraWkzTpKqqijt3JpFlG7dvj7NzZ1f++qFQyA3EClHL'. - 'Ql743nFkhxPDtJAd5eTaYSVUfX09lZWVlJWVIUnSg7sVQMBCUcu4ceMGe/bsIRQK1QAzOcyykIM9P0KyudAyCWyqG8nhwqa4SkLt'. - '3r0bVVVxu924XC40TUOWZUQxe97CwgIdHR2LMHIxSCaVInVvFElxE0vMY1Pd2NUKJMWNTXHlUfF//4vETJCelwbpFm3MjP2dt37x'. - 'AlN+PzU1NViWRSwW4+7du3g8HjweD4qi5EFAJzAExIpCANbooxhplfB0FJvTg6xWIqsVRVF6MopkU3FXPcnkJxGU0VEAdF2noqKC'. - 'W3/8DpnqLjzep2lubsblcjE8PExHR8fboVDID9xYFpLBDpJF0jDQIncQpWlkm31FlFLtp9PfyuW/vYQj1kPSuRW/38+lj27S2Q7v'. - '/aWXUBVUffVNtm3blivVCEwsC5Eyc5iiApEpDEAXMqQdldhSiWVQHjJagud+8Fuexck/zv+K82dfoSbSCsDe75/km+4GVPd6+l5t'. - '4zJHcqVUYN2yEEtZQDCSJCueRAYsPY49HsFIZVG6p25JUumFafT4DKJN4amtT7Nz38sk5+5A70HMtEYyMkFiZhxzjQ/poXrLQrRU'. - 'DFGEeFpAlkQkm4pRiCpIKodKzk0T/2QMh+piPjxKZPwiSkUtu/b9mNnJEWS7E8nhAmvpM60oJDkXJxqNozxRRUxPIesispBBlsXV'. - 'UaKEFo8gzoaJhz8s2lOmrpUG+WBhJ9/60g+Z+fDXTAXfxllRjl1VkO0OFATsYhYliiK21ZKKhhHnFveUqSdKgwAEOp7F2v51vvw8'. - 'XH7/N1wd/BlTweuUV65BdtgfoLTSkipsdD3tRi0VYpommUwGwzDwdT5HYEc3giAwcvH3jLz3BlPB67jWeZBEKYsSBWwpHZtNKo4q'. - 'aHTDsJeeiGEYWJaFZVmYpommaRiGQdPnv0bb1m8gSRL/vPIOV979aR4lmAJ2p4qCgCxksNuKJ6VNpx4NYhgGpmkuQhmGQTqdxjAM'. - 'qr2d7HtxEEEQuH1tkKvvvkF44tqDnrIcKJKAPf1g+LAUElq8dIiu60sApmnm93Pfzc7OYhgGrie+wFe++ztcLhcT1wf54PzPCU9c'. - 'w7XWjWS3IdsdOAUBWZAxrRJnTQ6SG5bce2FCpmkughmGQSqVYm5uDtnj44sH38TtdhP6+Dwf//V4ttHXrkGURZJaic8RgHQ6jWma'. - 'SJKUL5RLKNfIOczDKF3XSSaTRCIRhLJWntp3nGfWrSMxc5OLf3iNP4+68T9Ub9nF76lTpxgfHycajZJKpdA0LZ9GbjYV7hcDWZaF'. - 'pmnMz88Ti8UYunSLmu1HFi2aVkxkaGjINTY2ttDb24vX6+XQoUNs3ryZ8vJyIDu1BUFYkkxhgxeiWlpaOHPmDE1NTdTX1xe98eWG'. - 'JnF/9dQZCoXUYDA4AOD1ejlw4ACtra2Ul5fniwmCkEcUJiUIAoFAgL6+Pnw+H21tbfT39z8SxCS7hHsfWH9/8dL4MKqnp4eWlhac'. - 'TmcekEvMNE2am5s5ceIEgUCA9vZ2Tp48ic/nY3j4UsmQHCYOjJHtpeBKqL1799Lc3IzT6UTXdRobGxkYGKC9vZ3W1tZ8Ko86NJ8a'. - 'tXHjRo4dO8bp06fZsmULGzZsoL+/n0AggNfr5ezZs/8VpGTU5OSkc//+/acBfD4f1dXV7Nq1i4aGBs6dO4fP5+Pq1SuPBbIiyjTN'. - 'RUnV1dUNXLhwAa/Xy44dO4jFYgBEo9FFF1r134BPuYlk16LrAYXsAlmtq6sbKDwoFAp9m+ykuP5ZQVZF3f8tCdwCov8LyHIoAANI'. - 'AXf/A1TI0XCDh7OWAAAAAElFTkSuQmCC' ; - - //========================================================== - // file_important.png - //========================================================== - $this->iBuiltinIcon[12][0]= 1785 ; - $this->iBuiltinIcon[12][1]= - 'iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz'. - 'AAALDwAACw8BkvkDpQAAAAd0SU1FB9ECDAcjDeD3lKsAAAZ2SURBVHicrZhPaFzHHcc/897s7lutJCsr2VHsOHWMk0MPbsBUrcnF'. - 'OFRdSo6FNhdB6SGHlpDmYtJCDyoxyKe6EBxKQkt7KKL0T6ABo0NbciqigtC6PhWKI2NFqqxdSd7V2/dmftPDvPd212t55dCBYfbN'. - 'zpvfZ77z+/1mdhUjytWrV93Hf/24eD5z9gwiMlDjOKbb7dLtdhER2u02u7u73Lp1CxEZBw4AeZwdNQqkMd9wbziFGINJUt6rRbz5'. - '1ptUq1XK5TJBEAAUMHt7e+zu7gKwvLzMysoKwAng/uNg9CgQgFKlgg1DUJ67Vqtx6tQpZmdniaIIpRTOOZRSdDoddnZ2aLfbLC8v'. - 's7S0xJUrV7ZGwQSj1PhhfRodVdDlMrpc5vup5Z2fvMPdu3fZ29vDWjvwztjYGPV6nVqtRqVS4dKlSywtLQFsAdOH2XwsCEApg3jl'. - 'w98Rak2gvYjNZpNms0mSJDjnHgkDMDc3dySYQ0Ea8w139YUX0OUKulzyg7UmCEO+l1huvHuDra0t9vf3h1TJYSqVypFhHquIrlQI'. - 'S5qv/uIDAC7/4bcEQYAKvK+0Wq1DVQGIoog7d+4cCeaRII35hrt+8SsEOkRlUaEyR0UpFIrXHxyMVKVUKnHv3r0jwRwaNelBjBjL'. - 'Sz/7KYuLiwAsLi7y4z/9kY9e+TpkCuSqjI+Po7XuAWeKXLt2DWNMUZMkwRjDhQsXWFtbK6JpCCT3jfQgxomPtPX19YHWicM5x3c2'. - '73Pj3Ru8/aO3mZqaolKpoHVvyuvXr/Ppnf/Q7uzz380NPtu4y/qnG+ztd1hfX2dtbQ3gIvDnRyqSxl1UoPjyz98D4PTp0wPtq39Z'. - '4fdzLxegrVaLVqvF5OQkYRgWqpRKJZ77wvNsbW1RG5tgfKLOTH2G7Z1twqBQrgrMDvhInjfSOCY5iIv+hYWFgRZArEWsZWF941Bf'. - 'SdMUgMnJCWpjVU4cn+HUyePM1Gc4+fRUPkzBI5w1jbukcczLv/5l0XfmzJmBFuCba38r/CRXpT+CrDUoZ0jjB4RYonJAOYRobJKT'. - 'z5zgqfqxAbsFSH6mpHFM2qdGXh4VnoViD6mSJF2cTQeqDqBaKVHWmonJCWpZjhkC6anR5WsffTgwaHV1FaUUq6urA/2v3f5k4LnV'. - 'arG9tUn3oI2YBCcWHYAxMVYs1qZEZY2SFB2aYZDGfMN9d7uJiWPSeFiNo5Rclc3NTXZbO6RpF7EJVixYA9agwwDnUiqlEPdQ3imi'. - 'Jo27BGHIt/7x9yEjc3Nzh27Na7c/4TdffKl4bja3ae5MUIu0T/HOEIaOpJt4gwoSsVTK4SBIY77hFtY3ABBjBiZ90rKwvsH77/+K'. - 't37wOhO1iPpTk4SBw1mLsz6CnKQ4l3qV+kE+t9XHlNZOk+bUJLVIE1VCcIJWQmJ6qjj30NbcXLkZMt8YPig+Z3n1G5fZ39/j/vY2'. - '9ckqZT2Ochbn0p4qNkU/dDfUADdXbh4HXgRO4zNdEU0XL1784PLly5w9e7Z4SazFOfGrEotDcOKrcoJPmrYIXf/Zop3QNd1skuGt'. - 'cUAb2MgAxvHZTgFUq1Wmp6eZnZ0F8JlTjDduDThBnDeECEoJtbGIp6enqEblzCcEZ1PECU4yVRiOGgd0gc+AB0CZvkv1sWPHOHfu'. - 'HOfPn8da41cpkkltEBEPJhYnBkTQJcdYVKGkgRxCfBsq5xXNgAa2Bn+hjTOgHEKBP8pzRUxykIH4ifLJRTJAl+UMBJzPHQ6bfe/f'. - 'cWIzPxlUpD+zugzIZtVk1d8znBAqRxgoQuVQgSJQ3h9C5QhDRYgjUILCAzlnEdsHYTKfMTEBcP7F54YUGVmc2GLlIn6ve6v0ahSt'. - '8X25TzjJ+rIx1grKpQPWR4LkGVVsMgghvS0qjPdvm5OeceOTWA5Evo2mFzkjQfL7hZPUy5yvvF/uPFQL3+nbDmsLCEmT3sTmCTNr'. - 'rogT6yFsOix3ftw7OwQhkvSU6CuinhCk0+kAkFoBazEEICHaHHiPVmU0gnUp4EAc1mYrF0EBVpwPi34VrBkwPxKk3W5ju/e5/c+d'. - 'bGUHIAIuydTIE5zfc5Wr4lJcahHnHTP3CVGm78DrgY38N+DEibp7dmYKdAQmBh1hjEFjis+9CTWYGK21H6PxPyOI0DobYwzZF/z7'. - '7jadTvJtYG0kCD7lfwl49ijgT1gc0AH+dZSJA/xB+Mz/GSIvFoj/B7H1mAd8CO/zAAAAAElFTkSuQmCC' ; - - $this->iLen = count($this->iBuiltinIcon); - } -} - -//=================================================== -// Global cache for builtin images -//=================================================== -$_gPredefIcons = new PredefIcons(); - -//=================================================== -// CLASS IconImage -// Description: Holds properties for an icon image -//=================================================== -class IconImage { - private $iGDImage=null; - private $iWidth,$iHeight; - private $ixalign='left',$iyalign='center'; - private $iScale=1.0; - - function __construct($aIcon,$aScale=1) { - GLOBAL $_gPredefIcons ; - if( is_string($aIcon) ) { - $this->iGDImage = Graph::LoadBkgImage('',$aIcon); - } - elseif( is_integer($aIcon) ) { - // Builtin image - $this->iGDImage = $_gPredefIcons->GetImg($aIcon); - } - else { - JpGraphError::RaiseL(6011); - //('Argument to IconImage must be string or integer'); - } - $this->iScale = $aScale; - $this->iWidth = Image::GetWidth($this->iGDImage); - $this->iHeight = Image::GetHeight($this->iGDImage); - } - - function GetWidth() { - return round($this->iScale*$this->iWidth); - } - - function GetHeight() { - return round($this->iScale*$this->iHeight); - } - - function SetAlign($aX='left',$aY='center') { - $this->ixalign = $aX; - $this->iyalign = $aY; - } - - function Stroke($aImg,$x,$y) { - - if( $this->ixalign == 'right' ) { - $x -= $this->iWidth; - } - elseif( $this->ixalign == 'center' ) { - $x -= round($this->iWidth/2*$this->iScale); - } - - if( $this->iyalign == 'bottom' ) { - $y -= $this->iHeight; - } - elseif( $this->iyalign == 'center' ) { - $y -= round($this->iHeight/2*$this->iScale); - } - - $aImg->Copy($this->iGDImage, - $x,$y,0,0, - round($this->iWidth*$this->iScale),round($this->iHeight*$this->iScale), - $this->iWidth,$this->iHeight); - } -} - - -//=================================================== -// CLASS TextProperty -// Description: Holds properties for a text -//=================================================== -class TextProperty { - public $iShow=true; - public $csimtarget='',$csimwintarget='',$csimalt=''; - private $iFFamily=FF_FONT1,$iFStyle=FS_NORMAL,$iFSize=10; - private $iFontArray=array(); - private $iColor="black"; - private $iText=""; - private $iHAlign="left",$iVAlign="bottom"; - - //--------------- - // CONSTRUCTOR - function __construct($aTxt='') { - $this->iText = $aTxt; - } - - //--------------- - // PUBLIC METHODS - function Set($aTxt) { - $this->iText = $aTxt; - } - - function SetCSIMTarget($aTarget,$aAltText='',$aWinTarget='') { - if( is_string($aTarget) ) - $aTarget = array($aTarget); - $this->csimtarget=$aTarget; - - if( is_string($aWinTarget) ) - $aWinTarget = array($aWinTarget); - $this->csimwintarget=$aWinTarget; - - if( is_string($aAltText) ) - $aAltText = array($aAltText); - $this->csimalt=$aAltText; - - } - - function SetCSIMAlt($aAltText) { - if( is_string($aAltText) ) - $aAltText = array($aAltText); - $this->csimalt=$aAltText; - } - - // Set text color - function SetColor($aColor) { - $this->iColor = $aColor; - } - - function HasTabs() { - if( is_string($this->iText) ) { - return substr_count($this->iText,"\t") > 0; - } - elseif( is_array($this->iText) ) { - return false; - } - } - - // Get number of tabs in string - function GetNbrTabs() { - if( is_string($this->iText) ) { - return substr_count($this->iText,"\t") ; - } - else{ - return 0; - } - } - - // Set alignment - function Align($aHAlign,$aVAlign="bottom") { - $this->iHAlign=$aHAlign; - $this->iVAlign=$aVAlign; - } - - // Synonym - function SetAlign($aHAlign,$aVAlign="bottom") { - $this->iHAlign=$aHAlign; - $this->iVAlign=$aVAlign; - } - - // Specify font - function SetFont($aFFamily,$aFStyle=FS_NORMAL,$aFSize=10) { - $this->iFFamily = $aFFamily; - $this->iFStyle = $aFStyle; - $this->iFSize = $aFSize; - } - - function SetColumnFonts($aFontArray) { - if( !is_array($aFontArray) || count($aFontArray[0]) != 3 ) { - JpGraphError::RaiseL(6033); - // 'Array of fonts must contain arrays with 3 elements, i.e. (Family, Style, Size)' - } - $this->iFontArray = $aFontArray; - } - - - function IsColumns() { - return is_array($this->iText) ; - } - - // Get width of text. If text contains several columns separated by - // tabs then return both the total width as well as an array with a - // width for each column. - function GetWidth($aImg,$aUseTabs=false,$aTabExtraMargin=1.1) { - $extra_margin=4; - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - if( is_string($this->iText) ) { - if( strlen($this->iText) == 0 ) return 0; - $tmp = preg_split('/\t/',$this->iText); - if( count($tmp) <= 1 || !$aUseTabs ) { - $w = $aImg->GetTextWidth($this->iText); - return $w + 2*$extra_margin; - } - else { - $tot=0; - $n = count($tmp); - for($i=0; $i < $n; ++$i) { - $res[$i] = $aImg->GetTextWidth($tmp[$i]); - $tot += $res[$i]*$aTabExtraMargin; - } - return array(round($tot),$res); - } - } - elseif( is_object($this->iText) ) { - // A single icon - return $this->iText->GetWidth()+2*$extra_margin; - } - elseif( is_array($this->iText) ) { - // Must be an array of texts. In this case we return the sum of the - // length + a fixed margin of 4 pixels on each text string - $n = count($this->iText); - $nf = count($this->iFontArray); - for( $i=0, $w=0; $i < $n; ++$i ) { - if( $i < $nf ) { - $aImg->SetFont($this->iFontArray[$i][0],$this->iFontArray[$i][1],$this->iFontArray[$i][2]); - } - else { - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - } - $tmp = $this->iText[$i]; - if( is_string($tmp) ) { - $w += $aImg->GetTextWidth($tmp)+$extra_margin; - } - else { - if( is_object($tmp) === false ) { - JpGraphError::RaiseL(6012); - } - $w += $tmp->GetWidth()+$extra_margin; - } - } - return $w; - } - else { - JpGraphError::RaiseL(6012); - } - } - - // for the case where we have multiple columns this function returns the width of each - // column individually. If there is no columns just return the width of the single - // column as an array of one - function GetColWidth($aImg,$aMargin=0) { - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - if( is_array($this->iText) ) { - $n = count($this->iText); - $nf = count($this->iFontArray); - for( $i=0, $w=array(); $i < $n; ++$i ) { - $tmp = $this->iText[$i]; - if( is_string($tmp) ) { - if( $i < $nf ) { - $aImg->SetFont($this->iFontArray[$i][0],$this->iFontArray[$i][1],$this->iFontArray[$i][2]); - } - else { - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - } - $w[$i] = $aImg->GetTextWidth($tmp)+$aMargin; - } - else { - if( is_object($tmp) === false ) { - JpGraphError::RaiseL(6012); - } - $w[$i] = $tmp->GetWidth()+$aMargin; - } - } - return $w; - } - else { - return array($this->GetWidth($aImg)); - } - } - - // Get total height of text - function GetHeight($aImg) { - $nf = count($this->iFontArray); - $maxheight = -1; - - if( $nf > 0 ) { - // We have to find out the largest font and take that one as the - // height of the row - for($i=0; $i < $nf; ++$i ) { - $aImg->SetFont($this->iFontArray[$i][0],$this->iFontArray[$i][1],$this->iFontArray[$i][2]); - $height = $aImg->GetFontHeight(); - $maxheight = max($height,$maxheight); - } - } - - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - $height = $aImg->GetFontHeight(); - $maxheight = max($height,$maxheight); - return $maxheight; - } - - // Unhide/hide the text - function Show($aShow=true) { - $this->iShow=$aShow; - } - - // Stroke text at (x,y) coordinates. If the text contains tabs then the - // x parameter should be an array of positions to be used for each successive - // tab mark. If no array is supplied then the tabs will be ignored. - function Stroke($aImg,$aX,$aY) { - if( $this->iShow ) { - $aImg->SetColor($this->iColor); - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - $aImg->SetTextAlign($this->iHAlign,$this->iVAlign); - if( $this->GetNbrTabs() < 1 ) { - if( is_string($this->iText) ) { - if( is_array($aX) ) $aX=$aX[0]; - if( is_array($aY) ) $aY=$aY[0]; - $aImg->StrokeText($aX,$aY,$this->iText); - } - elseif( is_array($this->iText) && ($n = count($this->iText)) > 0 ) { - $ax = is_array($aX) ; - $ay = is_array($aY) ; - if( $ax && $ay ) { - // Nothing; both are already arrays - } - elseif( $ax ) { - $aY = array_fill(0,$n,$aY); - } - elseif( $ay ) { - $aX = array_fill(0,$n,$aX); - } - else { - $aX = array_fill(0,$n,$aX); - $aY = array_fill(0,$n,$aY); - } - $n = min($n, count($aX) ) ; - $n = min($n, count($aY) ) ; - for($i=0; $i < $n; ++$i ) { - $tmp = $this->iText[$i]; - if( is_object($tmp) ) { - $tmp->Stroke($aImg,$aX[$i],$aY[$i]); - } - else { - if( $i < count($this->iFontArray) ) { - $font = $this->iFontArray[$i]; - $aImg->SetFont($font[0],$font[1],$font[2]); - } - else { - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - } - $aImg->StrokeText($aX[$i],$aY[$i],str_replace("\t"," ",$tmp)); - } - } - } - } - else { - $tmp = preg_split('/\t/',$this->iText); - $n = min(count($tmp),count($aX)); - for($i=0; $i < $n; ++$i) { - if( $i < count($this->iFontArray) ) { - $font = $this->iFontArray[$i]; - $aImg->SetFont($font[0],$font[1],$font[2]); - } - else { - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - } - $aImg->StrokeText($aX[$i],$aY,$tmp[$i]); - } - } - } - } -} - -//=================================================== -// CLASS HeaderProperty -// Description: Data encapsulating class to hold property -// for each type of the scale headers -//=================================================== -class HeaderProperty { - public $grid; - public $iShowLabels=true,$iShowGrid=true; - public $iTitleVertMargin=3,$iFFamily=FF_FONT0,$iFStyle=FS_NORMAL,$iFSize=8; - public $iStyle=0; - public $iFrameColor="black",$iFrameWeight=1; - public $iBackgroundColor="white"; - public $iWeekendBackgroundColor="lightgray",$iSundayTextColor="red"; // these are only used with day scale - public $iTextColor="black"; - public $iLabelFormStr="%d"; - public $iIntervall = 1; - - //--------------- - // CONSTRUCTOR - function __construct() { - $this->grid = new LineProperty(); - } - - //--------------- - // PUBLIC METHODS - function Show($aShow=true) { - $this->iShowLabels = $aShow; - } - - function SetIntervall($aInt) { - $this->iIntervall = $aInt; - } - - function SetInterval($aInt) { - $this->iIntervall = $aInt; - } - - function GetIntervall() { - return $this->iIntervall ; - } - - function SetFont($aFFamily,$aFStyle=FS_NORMAL,$aFSize=10) { - $this->iFFamily = $aFFamily; - $this->iFStyle = $aFStyle; - $this->iFSize = $aFSize; - } - - function SetFontColor($aColor) { - $this->iTextColor = $aColor; - } - - function GetFontHeight($aImg) { - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - return $aImg->GetFontHeight(); - } - - function GetFontWidth($aImg) { - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - return $aImg->GetFontWidth(); - } - - function GetStrWidth($aImg,$aStr) { - $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); - return $aImg->GetTextWidth($aStr); - } - - function SetStyle($aStyle) { - $this->iStyle = $aStyle; - } - - function SetBackgroundColor($aColor) { - $this->iBackgroundColor=$aColor; - } - - function SetFrameWeight($aWeight) { - $this->iFrameWeight=$aWeight; - } - - function SetFrameColor($aColor) { - $this->iFrameColor=$aColor; - } - - // Only used by day scale - function SetWeekendColor($aColor) { - $this->iWeekendBackgroundColor=$aColor; - } - - // Only used by day scale - function SetSundayFontColor($aColor) { - $this->iSundayTextColor=$aColor; - } - - function SetTitleVertMargin($aMargin) { - $this->iTitleVertMargin=$aMargin; - } - - function SetLabelFormatString($aStr) { - $this->iLabelFormStr=$aStr; - } - - function SetFormatString($aStr) { - $this->SetLabelFormatString($aStr); - } - - -} - -//=================================================== -// CLASS GanttScale -// Description: Responsible for calculating and showing -// the scale in a gantt chart. This includes providing methods for -// converting dates to position in the chart as well as stroking the -// date headers (days, week, etc). -//=================================================== -class GanttScale { - public $minute,$hour,$day,$week,$month,$year; - public $divider,$dividerh,$tableTitle; - public $iStartDate=-1,$iEndDate=-1; - // Number of gantt bar position (n.b not necessariliy the same as the number of bars) - // we could have on bar in position 1, and one bar in position 5 then there are two - // bars but the number of bar positions is 5 - public $actinfo; - public $iTopPlotMargin=10,$iBottomPlotMargin=15; - public $iVertLines=-1; - public $iVertHeaderSize=-1; - // The width of the labels (defaults to the widest of all labels) - private $iLabelWidth; - // Out image to stroke the scale to - private $iImg; - private $iTableHeaderBackgroundColor="white",$iTableHeaderFrameColor="black"; - private $iTableHeaderFrameWeight=1; - private $iAvailableHeight=-1,$iVertSpacing=-1; - private $iDateLocale; - private $iVertLayout=GANTT_EVEN; - private $iUsePlotWeekendBackground=true; - private $iWeekStart = 1; // Default to have weekends start on Monday - - //--------------- - // CONSTRUCTOR - function __construct($aImg) { - $this->iImg = $aImg; - $this->iDateLocale = new DateLocale(); - - $this->minute = new HeaderProperty(); - $this->minute->SetIntervall(15); - $this->minute->SetLabelFormatString('i'); - $this->minute->SetFont(FF_FONT0); - $this->minute->grid->SetColor("gray"); - - $this->hour = new HeaderProperty(); - $this->hour->SetFont(FF_FONT0); - $this->hour->SetIntervall(6); - $this->hour->SetStyle(HOURSTYLE_HM24); - $this->hour->SetLabelFormatString('H:i'); - $this->hour->grid->SetColor("gray"); - - $this->day = new HeaderProperty(); - $this->day->grid->SetColor("gray"); - $this->day->SetLabelFormatString('l'); - - $this->week = new HeaderProperty(); - $this->week->SetLabelFormatString("w%d"); - $this->week->SetFont(FF_FONT1); - - $this->month = new HeaderProperty(); - $this->month->SetFont(FF_FONT1,FS_BOLD); - - $this->year = new HeaderProperty(); - $this->year->SetFont(FF_FONT1,FS_BOLD); - - $this->divider=new LineProperty(); - $this->dividerh=new LineProperty(); - $this->dividerh->SetWeight(2); - $this->divider->SetWeight(6); - $this->divider->SetColor('gray'); - $this->divider->SetStyle('fancy'); - - $this->tableTitle=new TextProperty(); - $this->tableTitle->Show(false); - $this->actinfo = new GanttActivityInfo(); - } - - //--------------- - // PUBLIC METHODS - // Specify what headers should be visible - function ShowHeaders($aFlg) { - $this->day->Show($aFlg & GANTT_HDAY); - $this->week->Show($aFlg & GANTT_HWEEK); - $this->month->Show($aFlg & GANTT_HMONTH); - $this->year->Show($aFlg & GANTT_HYEAR); - $this->hour->Show($aFlg & GANTT_HHOUR); - $this->minute->Show($aFlg & GANTT_HMIN); - - // Make some default settings of gridlines whihc makes sense - if( $aFlg & GANTT_HWEEK ) { - $this->month->grid->Show(false); - $this->year->grid->Show(false); - } - if( $aFlg & GANTT_HHOUR ) { - $this->day->grid->SetColor("black"); - } - } - - // Should the weekend background stretch all the way down in the plotarea - function UseWeekendBackground($aShow) { - $this->iUsePlotWeekendBackground = $aShow; - } - - // Have a range been specified? - function IsRangeSet() { - return $this->iStartDate!=-1 && $this->iEndDate!=-1; - } - - // Should the layout be from top or even? - function SetVertLayout($aLayout) { - $this->iVertLayout = $aLayout; - } - - // Which locale should be used? - function SetDateLocale($aLocale) { - $this->iDateLocale->Set($aLocale); - } - - // Number of days we are showing - function GetNumberOfDays() { - return round(($this->iEndDate-$this->iStartDate)/SECPERDAY); - } - - // The width of the actual plot area - function GetPlotWidth() { - $img=$this->iImg; - return $img->width - $img->left_margin - $img->right_margin; - } - - // Specify the width of the titles(labels) for the activities - // (This is by default set to the minimum width enought for the - // widest title) - function SetLabelWidth($aLabelWidth) { - $this->iLabelWidth=$aLabelWidth; - } - - // Which day should the week start? - // 0==Sun, 1==Monday, 2==Tuesday etc - function SetWeekStart($aStartDay) { - $this->iWeekStart = $aStartDay % 7; - - //Recalculate the startday since this will change the week start - $this->SetRange($this->iStartDate,$this->iEndDate); - } - - // Do we show min scale? - function IsDisplayMinute() { - return $this->minute->iShowLabels; - } - - // Do we show day scale? - function IsDisplayHour() { - return $this->hour->iShowLabels; - } - - - // Do we show day scale? - function IsDisplayDay() { - return $this->day->iShowLabels; - } - - // Do we show week scale? - function IsDisplayWeek() { - return $this->week->iShowLabels; - } - - // Do we show month scale? - function IsDisplayMonth() { - return $this->month->iShowLabels; - } - - // Do we show year scale? - function IsDisplayYear() { - return $this->year->iShowLabels; - } - - // Specify spacing (in percent of bar height) between activity bars - function SetVertSpacing($aSpacing) { - $this->iVertSpacing = $aSpacing; - } - - // Specify scale min and max date either as timestamp or as date strings - // Always round to the nearest week boundary - function SetRange($aMin,$aMax) { - $this->iStartDate = $this->NormalizeDate($aMin); - $this->iEndDate = $this->NormalizeDate($aMax); - } - - - // Adjust the start and end date so they fit to beginning/ending - // of the week taking the specified week start day into account. - function AdjustStartEndDay() { - - if( !($this->IsDisplayYear() ||$this->IsDisplayMonth() || $this->IsDisplayWeek()) ) { - // Don't adjust - return; - } - - // Get day in week for start and ending date (Sun==0) - $ds=strftime("%w",$this->iStartDate); - $de=strftime("%w",$this->iEndDate); - - // We want to start on iWeekStart day. But first we subtract a week - // if the startdate is "behind" the day the week start at. - // This way we ensure that the given start date is always included - // in the range. If we don't do this the nearest correct weekday in the week - // to start at might be later than the start date. - if( $ds < $this->iWeekStart ) - $d = strtotime('-7 day',$this->iStartDate); - else - $d = $this->iStartDate; - $adjdate = strtotime(($this->iWeekStart-$ds).' day',$d /*$this->iStartDate*/ ); - $this->iStartDate = $adjdate; - - // We want to end on the last day of the week - $preferredEndDay = ($this->iWeekStart+6)%7; - if( $preferredEndDay != $de ) { - // Solve equivalence eq: $de + x ~ $preferredDay (mod 7) - $adj = (7+($preferredEndDay - $de)) % 7; - $adjdate = strtotime("+$adj day",$this->iEndDate); - $this->iEndDate = $adjdate; - } - } - - // Specify background for the table title area (upper left corner of the table) - function SetTableTitleBackground($aColor) { - $this->iTableHeaderBackgroundColor = $aColor; - } - - /////////////////////////////////////// - // PRIVATE Methods - - // Determine the height of all the scale headers combined - function GetHeaderHeight() { - $img=$this->iImg; - $height=1; - if( $this->minute->iShowLabels ) { - $height += $this->minute->GetFontHeight($img); - $height += $this->minute->iTitleVertMargin; - } - if( $this->hour->iShowLabels ) { - $height += $this->hour->GetFontHeight($img); - $height += $this->hour->iTitleVertMargin; - } - if( $this->day->iShowLabels ) { - $height += $this->day->GetFontHeight($img); - $height += $this->day->iTitleVertMargin; - } - if( $this->week->iShowLabels ) { - $height += $this->week->GetFontHeight($img); - $height += $this->week->iTitleVertMargin; - } - if( $this->month->iShowLabels ) { - $height += $this->month->GetFontHeight($img); - $height += $this->month->iTitleVertMargin; - } - if( $this->year->iShowLabels ) { - $height += $this->year->GetFontHeight($img); - $height += $this->year->iTitleVertMargin; - } - return $height; - } - - // Get width (in pixels) for a single day - function GetDayWidth() { - return ($this->GetPlotWidth()-$this->iLabelWidth+1)/$this->GetNumberOfDays(); - } - - // Get width (in pixels) for a single hour - function GetHourWidth() { - return $this->GetDayWidth() / 24 ; - } - - function GetMinuteWidth() { - return $this->GetHourWidth() / 60 ; - } - - // Nuber of days in a year - function GetNumDaysInYear($aYear) { - if( $this->IsLeap($aYear) ) - return 366; - else - return 365; - } - - // Get week number - function GetWeekNbr($aDate,$aSunStart=true) { - // We can't use the internal strftime() since it gets the weeknumber - // wrong since it doesn't follow ISO on all systems since this is - // system linrary dependent. - // Even worse is that this works differently if we are on a Windows - // or UNIX box (it even differs between UNIX boxes how strftime() - // is natively implemented) - // - // Credit to Nicolas Hoizey for this elegant - // version of Week Nbr calculation. - - $day = $this->NormalizeDate($aDate); - if( $aSunStart ) - $day += 60*60*24; - - /*------------------------------------------------------------------------- - According to ISO-8601 : - "Week 01 of a year is per definition the first week that has the Thursday in this year, - which is equivalent to the week that contains the fourth day of January. - In other words, the first week of a new year is the week that has the majority of its - days in the new year." - - Be carefull, with PHP, -3 % 7 = -3, instead of 4 !!! - - day of year = date("z", $day) + 1 - offset to thursday = 3 - (date("w", $day) + 6) % 7 - first thursday of year = 1 + (11 - date("w", mktime(0, 0, 0, 1, 1, date("Y", $day)))) % 7 - week number = (thursday's day of year - first thursday's day of year) / 7 + 1 - ---------------------------------------------------------------------------*/ - - $thursday = $day + 60 * 60 * 24 * (3 - (date("w", $day) + 6) % 7); // take week's thursday - $week = 1 + (date("z", $thursday) - (11 - date("w", mktime(0, 0, 0, 1, 1, date("Y", $thursday)))) % 7) / 7; - - return $week; - } - - // Is year a leap year? - function IsLeap($aYear) { - // Is the year a leap year? - //$year = 0+date("Y",$aDate); - if( $aYear % 4 == 0) - if( !($aYear % 100 == 0) || ($aYear % 400 == 0) ) - return true; - return false; - } - - // Get current year - function GetYear($aDate) { - return 0+Date("Y",$aDate); - } - - // Return number of days in a year - function GetNumDaysInMonth($aMonth,$aYear) { - $days=array(31,28,31,30,31,30,31,31,30,31,30,31); - $daysl=array(31,29,31,30,31,30,31,31,30,31,30,31); - if( $this->IsLeap($aYear)) - return $daysl[$aMonth]; - else - return $days[$aMonth]; - } - - // Get day in month - function GetMonthDayNbr($aDate) { - return 0+strftime("%d",$aDate); - } - - // Get day in year - function GetYearDayNbr($aDate) { - return 0+strftime("%j",$aDate); - } - - // Get month number - function GetMonthNbr($aDate) { - return 0+strftime("%m",$aDate); - } - - // Translate a date to screen coordinates (horizontal scale) - function TranslateDate($aDate) { - // - // In order to handle the problem with Daylight savings time - // the scale written with equal number of seconds per day beginning - // with the start date. This means that we "cement" the state of - // DST as it is in the start date. If later the scale includes the - // switchover date (depends on the locale) we need to adjust back - // if the date we try to translate has a different DST status since - // we would otherwise be off by one hour. - $aDate = $this->NormalizeDate($aDate); - $tmp = localtime($aDate); - $cloc = $tmp[8]; - $tmp = localtime($this->iStartDate); - $sloc = $tmp[8]; - $offset = 0; - if( $sloc != $cloc) { - if( $sloc ) - $offset = 3600; - else - $offset = -3600; - } - $img=$this->iImg; - return ($aDate-$this->iStartDate-$offset)/SECPERDAY*$this->GetDayWidth()+$img->left_margin+$this->iLabelWidth;; - } - - // Get screen coordinatesz for the vertical position for a bar - function TranslateVertPos($aPos,$atTop=false) { - $img=$this->iImg; - if( $aPos > $this->iVertLines ) - JpGraphError::RaiseL(6015,$aPos); - // 'Illegal vertical position %d' - if( $this->iVertLayout == GANTT_EVEN ) { - // Position the top bar at 1 vert spacing from the scale - $pos = round($img->top_margin + $this->iVertHeaderSize + ($aPos+1)*$this->iVertSpacing); - } - else { - // position the top bar at 1/2 a vert spacing from the scale - $pos = round($img->top_margin + $this->iVertHeaderSize + $this->iTopPlotMargin + ($aPos+1)*$this->iVertSpacing); - } - - if( $atTop ) - $pos -= $this->iVertSpacing; - - return $pos; - } - - // What is the vertical spacing? - function GetVertSpacing() { - return $this->iVertSpacing; - } - - // Convert a date to timestamp - function NormalizeDate($aDate) { - if( $aDate === false ) return false; - if( is_string($aDate) ) { - $t = strtotime($aDate); - if( $t === FALSE || $t === -1 ) { - JpGraphError::RaiseL(6016,$aDate); - //("Date string ($aDate) specified for Gantt activity can not be interpretated. Please make sure it is a valid time string, e.g. 2005-04-23 13:30"); - } - return $t; - } - elseif( is_int($aDate) || is_float($aDate) ) - return $aDate; - else - JpGraphError::RaiseL(6017,$aDate); - //Unknown date format in GanttScale ($aDate)."); - } - - - // Convert a time string to minutes - - function TimeToMinutes($aTimeString) { - // Split in hours and minutes - $pos=strpos($aTimeString,':'); - $minint=60; - if( $pos === false ) { - $hourint = $aTimeString; - $minint = 0; - } - else { - $hourint = floor(substr($aTimeString,0,$pos)); - $minint = floor(substr($aTimeString,$pos+1)); - } - $minint += 60 * $hourint; - return $minint; - } - - // Stroke the day scale (including gridlines) - function StrokeMinutes($aYCoord,$getHeight=false) { - $img=$this->iImg; - $xt=$img->left_margin+$this->iLabelWidth; - $yt=$aYCoord+$img->top_margin; - if( $this->minute->iShowLabels ) { - $img->SetFont($this->minute->iFFamily,$this->minute->iFStyle,$this->minute->iFSize); - $yb = $yt + $img->GetFontHeight() + - $this->minute->iTitleVertMargin + $this->minute->iFrameWeight; - if( $getHeight ) { - return $yb - $img->top_margin; - } - $xb = $img->width-$img->right_margin+1; - $img->SetColor($this->minute->iBackgroundColor); - $img->FilledRectangle($xt,$yt,$xb,$yb); - - $x = $xt; - $img->SetTextAlign("center"); - $day = date('w',$this->iStartDate); - $minint = $this->minute->GetIntervall() ; - - if( 60 % $minint !== 0 ) { - JpGraphError::RaiseL(6018,$minint); - //'Intervall for minutes must divide the hour evenly, e.g. 1,5,10,12,15,20,30 etc You have specified an intervall of '.$minint.' minutes.'); - } - - - $n = 60 / $minint; - $datestamp = $this->iStartDate; - $width = $this->GetHourWidth() / $n ; - if( $width < 8 ) { - // TO small width to draw minute scale - JpGraphError::RaiseL(6019,$width); - //('The available width ('.$width.') for minutes are to small for this scale to be displayed. Please use auto-sizing or increase the width of the graph.'); - } - - $nh = ceil(24*60 / $this->TimeToMinutes($this->hour->GetIntervall()) ); - $nd = $this->GetNumberOfDays(); - // Convert to intervall to seconds - $minint *= 60; - for($j=0; $j < $nd; ++$j, $day += 1, $day %= 7) { - for( $k=0; $k < $nh; ++$k ) { - for($i=0; $i < $n ;++$i, $x+=$width, $datestamp += $minint ) { - if( $day==6 || $day==0 ) { - - $img->PushColor($this->day->iWeekendBackgroundColor); - if( $this->iUsePlotWeekendBackground ) - $img->FilledRectangle($x,$yt+$this->day->iFrameWeight,$x+$width,$img->height-$img->bottom_margin); - else - $img->FilledRectangle($x,$yt+$this->day->iFrameWeight,$x+$width,$yb-$this->day->iFrameWeight); - $img->PopColor(); - - } - - if( $day==0 ) - $img->SetColor($this->day->iSundayTextColor); - else - $img->SetColor($this->day->iTextColor); - - switch( $this->minute->iStyle ) { - case MINUTESTYLE_CUSTOM: - $txt = date($this->minute->iLabelFormStr,$datestamp); - break; - case MINUTESTYLE_MM: - default: - // 15 - $txt = date('i',$datestamp); - break; - } - $img->StrokeText(round($x+$width/2),round($yb-$this->minute->iTitleVertMargin),$txt); - - // Fix a rounding problem the wrong way .. - // If we also have hour scale then don't draw the firsta or last - // gridline since that will be overwritten by the hour scale gridline if such exists. - // However, due to the propagation of rounding of the 'x+=width' term in the loop - // this might sometimes be one pixel of so we fix this by not drawing it. - // The proper way to fix it would be to re-calculate the scale for each step and - // not using the additive term. - if( !(($i == $n || $i==0) && $this->hour->iShowLabels && $this->hour->grid->iShow) ) { - $img->SetColor($this->minute->grid->iColor); - $img->SetLineWeight($this->minute->grid->iWeight); - $img->Line($x,$yt,$x,$yb); - $this->minute->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); - } - } - } - } - $img->SetColor($this->minute->iFrameColor); - $img->SetLineWeight($this->minute->iFrameWeight); - $img->Rectangle($xt,$yt,$xb,$yb); - return $yb - $img->top_margin; - } - return $aYCoord; - } - - // Stroke the day scale (including gridlines) - function StrokeHours($aYCoord,$getHeight=false) { - $img=$this->iImg; - $xt=$img->left_margin+$this->iLabelWidth; - $yt=$aYCoord+$img->top_margin; - if( $this->hour->iShowLabels ) { - $img->SetFont($this->hour->iFFamily,$this->hour->iFStyle,$this->hour->iFSize); - $yb = $yt + $img->GetFontHeight() + - $this->hour->iTitleVertMargin + $this->hour->iFrameWeight; - if( $getHeight ) { - return $yb - $img->top_margin; - } - $xb = $img->width-$img->right_margin+1; - $img->SetColor($this->hour->iBackgroundColor); - $img->FilledRectangle($xt,$yt,$xb,$yb); - - $x = $xt; - $img->SetTextAlign("center"); - $tmp = $this->hour->GetIntervall() ; - $minint = $this->TimeToMinutes($tmp); - if( 1440 % $minint !== 0 ) { - JpGraphError::RaiseL(6020,$tmp); - //('Intervall for hours must divide the day evenly, e.g. 0:30, 1:00, 1:30, 4:00 etc. You have specified an intervall of '.$tmp); - } - - $n = ceil(24*60 / $minint ); - $datestamp = $this->iStartDate; - $day = date('w',$this->iStartDate); - $doback = !$this->minute->iShowLabels; - $width = $this->GetDayWidth() / $n ; - for($j=0; $j < $this->GetNumberOfDays(); ++$j, $day += 1,$day %= 7) { - for($i=0; $i < $n ;++$i, $x+=$width) { - if( $day==6 || $day==0 ) { - - $img->PushColor($this->day->iWeekendBackgroundColor); - if( $this->iUsePlotWeekendBackground && $doback ) - $img->FilledRectangle($x,$yt+$this->day->iFrameWeight,$x+$width,$img->height-$img->bottom_margin); - else - $img->FilledRectangle($x,$yt+$this->day->iFrameWeight,$x+$width,$yb-$this->day->iFrameWeight); - $img->PopColor(); - - } - - if( $day==0 ) - $img->SetColor($this->day->iSundayTextColor); - else - $img->SetColor($this->day->iTextColor); - - switch( $this->hour->iStyle ) { - case HOURSTYLE_HMAMPM: - // 1:35pm - $txt = date('g:ia',$datestamp); - break; - case HOURSTYLE_H24: - // 13 - $txt = date('H',$datestamp); - break; - case HOURSTYLE_HAMPM: - $txt = date('ga',$datestamp); - break; - case HOURSTYLE_CUSTOM: - $txt = date($this->hour->iLabelFormStr,$datestamp); - break; - case HOURSTYLE_HM24: - default: - $txt = date('H:i',$datestamp); - break; - } - $img->StrokeText(round($x+$width/2),round($yb-$this->hour->iTitleVertMargin),$txt); - $img->SetColor($this->hour->grid->iColor); - $img->SetLineWeight($this->hour->grid->iWeight); - $img->Line($x,$yt,$x,$yb); - $this->hour->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); - //$datestamp += $minint*60 - $datestamp = mktime(date('H',$datestamp),date('i',$datestamp)+$minint,0, - date("m",$datestamp),date("d",$datestamp)+1,date("Y",$datestamp)); - - } - } - $img->SetColor($this->hour->iFrameColor); - $img->SetLineWeight($this->hour->iFrameWeight); - $img->Rectangle($xt,$yt,$xb,$yb); - return $yb - $img->top_margin; - } - return $aYCoord; - } - - - // Stroke the day scale (including gridlines) - function StrokeDays($aYCoord,$getHeight=false) { - $img=$this->iImg; - $daywidth=$this->GetDayWidth(); - $xt=$img->left_margin+$this->iLabelWidth; - $yt=$aYCoord+$img->top_margin; - if( $this->day->iShowLabels ) { - $img->SetFont($this->day->iFFamily,$this->day->iFStyle,$this->day->iFSize); - $yb=$yt + $img->GetFontHeight() + $this->day->iTitleVertMargin + $this->day->iFrameWeight; - if( $getHeight ) { - return $yb - $img->top_margin; - } - $xb=$img->width-$img->right_margin+1; - $img->SetColor($this->day->iBackgroundColor); - $img->FilledRectangle($xt,$yt,$xb,$yb); - - $x = $xt; - $img->SetTextAlign("center"); - $day = date('w',$this->iStartDate); - $datestamp = $this->iStartDate; - - $doback = !($this->hour->iShowLabels || $this->minute->iShowLabels); - - setlocale(LC_TIME,$this->iDateLocale->iLocale); - - for($i=0; $i < $this->GetNumberOfDays(); ++$i, $x+=$daywidth, $day += 1,$day %= 7) { - if( $day==6 || $day==0 ) { - $img->SetColor($this->day->iWeekendBackgroundColor); - if( $this->iUsePlotWeekendBackground && $doback) - $img->FilledRectangle($x,$yt+$this->day->iFrameWeight, - $x+$daywidth,$img->height-$img->bottom_margin); - else - $img->FilledRectangle($x,$yt+$this->day->iFrameWeight, - $x+$daywidth,$yb-$this->day->iFrameWeight); - } - - $mn = strftime('%m',$datestamp); - if( $mn[0]=='0' ) - $mn = $mn[1]; - - switch( $this->day->iStyle ) { - case DAYSTYLE_LONG: - // "Monday" - $txt = strftime('%A',$datestamp); - break; - case DAYSTYLE_SHORT: - // "Mon" - $txt = strftime('%a',$datestamp); - break; - case DAYSTYLE_SHORTDAYDATE1: - // "Mon 23/6" - $txt = strftime('%a %d/'.$mn,$datestamp); - break; - case DAYSTYLE_SHORTDAYDATE2: - // "Mon 23 Jun" - $txt = strftime('%a %d %b',$datestamp); - break; - case DAYSTYLE_SHORTDAYDATE3: - // "Mon 23 Jun 2003" - $txt = strftime('%a %d %b %Y',$datestamp); - break; - case DAYSTYLE_LONGDAYDATE1: - // "Monday 23 Jun" - $txt = strftime('%A %d %b',$datestamp); - break; - case DAYSTYLE_LONGDAYDATE2: - // "Monday 23 Jun 2003" - $txt = strftime('%A %d %b %Y',$datestamp); - break; - case DAYSTYLE_SHORTDATE1: - // "23/6" - $txt = strftime('%d/'.$mn,$datestamp); - break; - case DAYSTYLE_SHORTDATE2: - // "23 Jun" - $txt = strftime('%d %b',$datestamp); - break; - case DAYSTYLE_SHORTDATE3: - // "Mon 23" - $txt = strftime('%a %d',$datestamp); - break; - case DAYSTYLE_SHORTDATE4: - // "23" - $txt = strftime('%d',$datestamp); - break; - case DAYSTYLE_CUSTOM: - // Custom format - $txt = strftime($this->day->iLabelFormStr,$datestamp); - break; - case DAYSTYLE_ONELETTER: - default: - // "M" - $txt = strftime('%A',$datestamp); - $txt = strtoupper($txt[0]); - break; - } - - if( $day==0 ) - $img->SetColor($this->day->iSundayTextColor); - else - $img->SetColor($this->day->iTextColor); - $img->StrokeText(round($x+$daywidth/2+1), - round($yb-$this->day->iTitleVertMargin),$txt); - $img->SetColor($this->day->grid->iColor); - $img->SetLineWeight($this->day->grid->iWeight); - $img->Line($x,$yt,$x,$yb); - $this->day->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); - $datestamp = mktime(0,0,0,date("m",$datestamp),date("d",$datestamp)+1,date("Y",$datestamp)); - //$datestamp += SECPERDAY; - - } - $img->SetColor($this->day->iFrameColor); - $img->SetLineWeight($this->day->iFrameWeight); - $img->Rectangle($xt,$yt,$xb,$yb); - return $yb - $img->top_margin; - } - return $aYCoord; - } - - // Stroke week header and grid - function StrokeWeeks($aYCoord,$getHeight=false) { - if( $this->week->iShowLabels ) { - $img=$this->iImg; - $yt=$aYCoord+$img->top_margin; - $img->SetFont($this->week->iFFamily,$this->week->iFStyle,$this->week->iFSize); - $yb=$yt + $img->GetFontHeight() + $this->week->iTitleVertMargin + $this->week->iFrameWeight; - - if( $getHeight ) { - return $yb - $img->top_margin; - } - - $xt=$img->left_margin+$this->iLabelWidth; - $weekwidth=$this->GetDayWidth()*7; - $wdays=$this->iDateLocale->GetDayAbb(); - $xb=$img->width-$img->right_margin+1; - $week = $this->iStartDate; - $weeknbr=$this->GetWeekNbr($week); - $img->SetColor($this->week->iBackgroundColor); - $img->FilledRectangle($xt,$yt,$xb,$yb); - $img->SetColor($this->week->grid->iColor); - $x = $xt; - if( $this->week->iStyle==WEEKSTYLE_WNBR ) { - $img->SetTextAlign("center"); - $txtOffset = $weekwidth/2+1; - } - elseif( $this->week->iStyle==WEEKSTYLE_FIRSTDAY || - $this->week->iStyle==WEEKSTYLE_FIRSTDAY2 || - $this->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR || - $this->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR ) { - $img->SetTextAlign("left"); - $txtOffset = 3; - } - else { - JpGraphError::RaiseL(6021); - //("Unknown formatting style for week."); - } - - for($i=0; $i<$this->GetNumberOfDays()/7; ++$i, $x+=$weekwidth) { - $img->PushColor($this->week->iTextColor); - - if( $this->week->iStyle==WEEKSTYLE_WNBR ) - $txt = sprintf($this->week->iLabelFormStr,$weeknbr); - elseif( $this->week->iStyle==WEEKSTYLE_FIRSTDAY || - $this->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR ) - $txt = date("j/n",$week); - elseif( $this->week->iStyle==WEEKSTYLE_FIRSTDAY2 || - $this->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR ) { - $monthnbr = date("n",$week)-1; - $shortmonth = $this->iDateLocale->GetShortMonthName($monthnbr); - $txt = Date("j",$week)." ".$shortmonth; - } - - if( $this->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR || - $this->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR ) { - $w = sprintf($this->week->iLabelFormStr,$weeknbr); - $txt .= ' '.$w; - } - - $img->StrokeText(round($x+$txtOffset), - round($yb-$this->week->iTitleVertMargin),$txt); - - $week = strtotime('+7 day',$week); - $weeknbr = $this->GetWeekNbr($week); - $img->PopColor(); - $img->SetLineWeight($this->week->grid->iWeight); - $img->Line($x,$yt,$x,$yb); - $this->week->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); - } - $img->SetColor($this->week->iFrameColor); - $img->SetLineWeight($this->week->iFrameWeight); - $img->Rectangle($xt,$yt,$xb,$yb); - return $yb-$img->top_margin; - } - return $aYCoord; - } - - // Format the mont scale header string - function GetMonthLabel($aMonthNbr,$year) { - $sn = $this->iDateLocale->GetShortMonthName($aMonthNbr); - $ln = $this->iDateLocale->GetLongMonthName($aMonthNbr); - switch($this->month->iStyle) { - case MONTHSTYLE_SHORTNAME: - $m=$sn; - break; - case MONTHSTYLE_LONGNAME: - $m=$ln; - break; - case MONTHSTYLE_SHORTNAMEYEAR2: - $m=$sn." '".substr("".$year,2); - break; - case MONTHSTYLE_SHORTNAMEYEAR4: - $m=$sn." ".$year; - break; - case MONTHSTYLE_LONGNAMEYEAR2: - $m=$ln." '".substr("".$year,2); - break; - case MONTHSTYLE_LONGNAMEYEAR4: - $m=$ln." ".$year; - break; - case MONTHSTYLE_FIRSTLETTER: - $m=$sn[0]; - break; - } - return $m; - } - - // Stroke month scale and gridlines - function StrokeMonths($aYCoord,$getHeight=false) { - if( $this->month->iShowLabels ) { - $img=$this->iImg; - $img->SetFont($this->month->iFFamily,$this->month->iFStyle,$this->month->iFSize); - $yt=$aYCoord+$img->top_margin; - $yb=$yt + $img->GetFontHeight() + $this->month->iTitleVertMargin + $this->month->iFrameWeight; - if( $getHeight ) { - return $yb - $img->top_margin; - } - $monthnbr = $this->GetMonthNbr($this->iStartDate)-1; - $xt=$img->left_margin+$this->iLabelWidth; - $xb=$img->width-$img->right_margin+1; - - $img->SetColor($this->month->iBackgroundColor); - $img->FilledRectangle($xt,$yt,$xb,$yb); - - $img->SetLineWeight($this->month->grid->iWeight); - $img->SetColor($this->month->iTextColor); - $year = 0+strftime("%Y",$this->iStartDate); - $img->SetTextAlign("center"); - if( $this->GetMonthNbr($this->iStartDate) == $this->GetMonthNbr($this->iEndDate) - && $this->GetYear($this->iStartDate)==$this->GetYear($this->iEndDate) ) { - $monthwidth=$this->GetDayWidth()*($this->GetMonthDayNbr($this->iEndDate) - $this->GetMonthDayNbr($this->iStartDate) + 1); - } - else { - $monthwidth=$this->GetDayWidth()*($this->GetNumDaysInMonth($monthnbr,$year)-$this->GetMonthDayNbr($this->iStartDate)+1); - } - // Is it enough space to stroke the first month? - $monthName = $this->GetMonthLabel($monthnbr,$year); - if( $monthwidth >= 1.2*$img->GetTextWidth($monthName) ) { - $img->SetColor($this->month->iTextColor); - $img->StrokeText(round($xt+$monthwidth/2+1), - round($yb-$this->month->iTitleVertMargin), - $monthName); - } - $x = $xt + $monthwidth; - while( $x < $xb ) { - $img->SetColor($this->month->grid->iColor); - $img->Line($x,$yt,$x,$yb); - $this->month->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); - $monthnbr++; - if( $monthnbr==12 ) { - $monthnbr=0; - $year++; - } - $monthName = $this->GetMonthLabel($monthnbr,$year); - $monthwidth=$this->GetDayWidth()*$this->GetNumDaysInMonth($monthnbr,$year); - if( $x + $monthwidth < $xb ) - $w = $monthwidth; - else - $w = $xb-$x; - if( $w >= 1.2*$img->GetTextWidth($monthName) ) { - $img->SetColor($this->month->iTextColor); - $img->StrokeText(round($x+$w/2+1), - round($yb-$this->month->iTitleVertMargin),$monthName); - } - $x += $monthwidth; - } - $img->SetColor($this->month->iFrameColor); - $img->SetLineWeight($this->month->iFrameWeight); - $img->Rectangle($xt,$yt,$xb,$yb); - return $yb-$img->top_margin; - } - return $aYCoord; - } - - // Stroke year scale and gridlines - function StrokeYears($aYCoord,$getHeight=false) { - if( $this->year->iShowLabels ) { - $img=$this->iImg; - $yt=$aYCoord+$img->top_margin; - $img->SetFont($this->year->iFFamily,$this->year->iFStyle,$this->year->iFSize); - $yb=$yt + $img->GetFontHeight() + $this->year->iTitleVertMargin + $this->year->iFrameWeight; - - if( $getHeight ) { - return $yb - $img->top_margin; - } - - $xb=$img->width-$img->right_margin+1; - $xt=$img->left_margin+$this->iLabelWidth; - $year = $this->GetYear($this->iStartDate); - $img->SetColor($this->year->iBackgroundColor); - $img->FilledRectangle($xt,$yt,$xb,$yb); - $img->SetLineWeight($this->year->grid->iWeight); - $img->SetTextAlign("center"); - if( $year == $this->GetYear($this->iEndDate) ) - $yearwidth=$this->GetDayWidth()*($this->GetYearDayNbr($this->iEndDate)-$this->GetYearDayNbr($this->iStartDate)+1); - else - $yearwidth=$this->GetDayWidth()*($this->GetNumDaysInYear($year)-$this->GetYearDayNbr($this->iStartDate)+1); - - // The space for a year must be at least 20% bigger than the actual text - // so we allow 10% margin on each side - if( $yearwidth >= 1.20*$img->GetTextWidth("".$year) ) { - $img->SetColor($this->year->iTextColor); - $img->StrokeText(round($xt+$yearwidth/2+1), - round($yb-$this->year->iTitleVertMargin), - $year); - } - $x = $xt + $yearwidth; - while( $x < $xb ) { - $img->SetColor($this->year->grid->iColor); - $img->Line($x,$yt,$x,$yb); - $this->year->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); - $year += 1; - $yearwidth=$this->GetDayWidth()*$this->GetNumDaysInYear($year); - if( $x + $yearwidth < $xb ) - $w = $yearwidth; - else - $w = $xb-$x; - if( $w >= 1.2*$img->GetTextWidth("".$year) ) { - $img->SetColor($this->year->iTextColor); - $img->StrokeText(round($x+$w/2+1), - round($yb-$this->year->iTitleVertMargin), - $year); - } - $x += $yearwidth; - } - $img->SetColor($this->year->iFrameColor); - $img->SetLineWeight($this->year->iFrameWeight); - $img->Rectangle($xt,$yt,$xb,$yb); - return $yb-$img->top_margin; - } - return $aYCoord; - } - - // Stroke table title (upper left corner) - function StrokeTableHeaders($aYBottom) { - $img=$this->iImg; - $xt=$img->left_margin; - $yt=$img->top_margin; - $xb=$xt+$this->iLabelWidth; - $yb=$aYBottom+$img->top_margin; - - if( $this->tableTitle->iShow ) { - $img->SetColor($this->iTableHeaderBackgroundColor); - $img->FilledRectangle($xt,$yt,$xb,$yb); - $this->tableTitle->Align("center","top"); - $this->tableTitle->Stroke($img,$xt+($xb-$xt)/2+1,$yt+2); - $img->SetColor($this->iTableHeaderFrameColor); - $img->SetLineWeight($this->iTableHeaderFrameWeight); - $img->Rectangle($xt,$yt,$xb,$yb); - } - - $this->actinfo->Stroke($img,$xt,$yt,$xb,$yb,$this->tableTitle->iShow); - - - // Draw the horizontal dividing line - $this->dividerh->Stroke($img,$xt,$yb,$img->width-$img->right_margin,$yb); - - // Draw the vertical dividing line - // We do the width "manually" since we want the line only to grow - // to the left - $fancy = $this->divider->iStyle == 'fancy' ; - if( $fancy ) { - $this->divider->iStyle = 'solid'; - } - - $tmp = $this->divider->iWeight; - $this->divider->iWeight=1; - $y = $img->height-$img->bottom_margin; - for($i=0; $i < $tmp; ++$i ) { - $this->divider->Stroke($img,$xb-$i,$yt,$xb-$i,$y); - } - - // Should we draw "fancy" divider - if( $fancy ) { - $img->SetLineWeight(1); - $img->SetColor($this->iTableHeaderFrameColor); - $img->Line($xb,$yt,$xb,$y); - $img->Line($xb-$tmp+1,$yt,$xb-$tmp+1,$y); - $img->SetColor('white'); - $img->Line($xb-$tmp+2,$yt,$xb-$tmp+2,$y); - } - } - - // Main entry point to stroke scale - function Stroke() { - if( !$this->IsRangeSet() ) { - JpGraphError::RaiseL(6022); - //("Gantt scale has not been specified."); - } - $img=$this->iImg; - - // If minutes are displayed then hour interval must be 1 - if( $this->IsDisplayMinute() && $this->hour->GetIntervall() > 1 ) { - JpGraphError::RaiseL(6023); - //('If you display both hour and minutes the hour intervall must be 1 (Otherwise it doesn\' make sense to display minutes).'); - } - - // Stroke all headers. As argument we supply the offset from the - // top which depends on any previous headers - - // First find out the height of each header - $offy=$this->StrokeYears(0,true); - $offm=$this->StrokeMonths($offy,true); - $offw=$this->StrokeWeeks($offm,true); - $offd=$this->StrokeDays($offw,true); - $offh=$this->StrokeHours($offd,true); - $offmin=$this->StrokeMinutes($offh,true); - - - // ... then we can stroke them in the "backwards order to ensure that - // the larger scale gridlines is stroked over the smaller scale gridline - $this->StrokeMinutes($offh); - $this->StrokeHours($offd); - $this->StrokeDays($offw); - $this->StrokeWeeks($offm); - $this->StrokeMonths($offy); - $this->StrokeYears(0); - - // Now when we now the oaverall size of the scale headers - // we can stroke the overall table headers - $this->StrokeTableHeaders($offmin); - - // Now we can calculate the correct scaling factor for each vertical position - $this->iAvailableHeight = $img->height - $img->top_margin - $img->bottom_margin - $offd; - - $this->iVertHeaderSize = $offmin; - if( $this->iVertSpacing == -1 ) - $this->iVertSpacing = $this->iAvailableHeight / $this->iVertLines; - } -} - - -//=================================================== -// CLASS GanttConstraint -// Just a structure to store all the values for a constraint -//=================================================== -class GanttConstraint { - public $iConstrainRow; - public $iConstrainType; - public $iConstrainColor; - public $iConstrainArrowSize; - public $iConstrainArrowType; - - //--------------- - // CONSTRUCTOR - function __construct($aRow,$aType,$aColor,$aArrowSize,$aArrowType){ - $this->iConstrainType = $aType; - $this->iConstrainRow = $aRow; - $this->iConstrainColor=$aColor; - $this->iConstrainArrowSize=$aArrowSize; - $this->iConstrainArrowType=$aArrowType; - } -} - - -//=================================================== -// CLASS GanttPlotObject -// The common signature for a Gantt object -//=================================================== -class GanttPlotObject { - public $title,$caption; - public $csimarea='',$csimtarget='',$csimwintarget='',$csimalt=''; - public $constraints = array(); - public $iCaptionMargin=5; - public $iConstrainPos=array(); - protected $iStart=""; // Start date - public $iVPos=0; // Vertical position - protected $iLabelLeftMargin=2; // Title margin - - function __construct() { - $this->title = new TextProperty(); - $this->title->Align('left','center'); - $this->caption = new TextProperty(); - } - - function GetCSIMArea() { - return $this->csimarea; - } - - function SetCSIMTarget($aTarget,$aAlt='',$aWinTarget='') { - if( !is_string($aTarget) ) { - $tv = substr(var_export($aTarget,true),0,40); - JpGraphError::RaiseL(6024,$tv); - //('CSIM Target must be specified as a string.'."\nStart of target is:\n$tv"); - } - if( !is_string($aAlt) ) { - $tv = substr(var_export($aAlt,true),0,40); - JpGraphError::RaiseL(6025,$tv); - //('CSIM Alt text must be specified as a string.'."\nStart of alt text is:\n$tv"); - } - - $this->csimtarget=$aTarget; - $this->csimwintarget=$aWinTarget; - $this->csimalt=$aAlt; - } - - function SetCSIMAlt($aAlt) { - if( !is_string($aAlt) ) { - $tv = substr(var_export($aAlt,true),0,40); - JpGraphError::RaiseL(6025,$tv); - //('CSIM Alt text must be specified as a string.'."\nStart of alt text is:\n$tv"); - } - $this->csimalt=$aAlt; - } - - function SetConstrain($aRow,$aType,$aColor='black',$aArrowSize=ARROW_S2,$aArrowType=ARROWT_SOLID) { - $this->constraints[] = new GanttConstraint($aRow, $aType, $aColor, $aArrowSize, $aArrowType); - } - - function SetConstrainPos($xt,$yt,$xb,$yb) { - $this->iConstrainPos = array($xt,$yt,$xb,$yb); - } - - function GetMinDate() { - return $this->iStart; - } - - function GetMaxDate() { - return $this->iStart; - } - - function SetCaptionMargin($aMarg) { - $this->iCaptionMargin=$aMarg; - } - - function GetAbsHeight($aImg) { - return 0; - } - - function GetLineNbr() { - return $this->iVPos; - } - - function SetLabelLeftMargin($aOff) { - $this->iLabelLeftMargin=$aOff; - } - - function StrokeActInfo($aImg,$aScale,$aYPos) { - $cols=array(); - $aScale->actinfo->GetColStart($aImg,$cols,true); - $this->title->Stroke($aImg,$cols,$aYPos); - } -} - -//=================================================== -// CLASS Progress -// Holds parameters for the progress indicator -// displyed within a bar -//=================================================== -class Progress { - public $iProgress=-1; - public $iPattern=GANTT_SOLID; - public $iColor="black", $iFillColor='black'; - public $iDensity=98, $iHeight=0.65; - - function Set($aProg) { - if( $aProg < 0.0 || $aProg > 1.0 ) { - JpGraphError::RaiseL(6027); - //("Progress value must in range [0, 1]"); - } - $this->iProgress = $aProg; - } - - function SetPattern($aPattern,$aColor="blue",$aDensity=98) { - $this->iPattern = $aPattern; - $this->iColor = $aColor; - $this->iDensity = $aDensity; - } - - function SetFillColor($aColor) { - $this->iFillColor = $aColor; - } - - function SetHeight($aHeight) { - $this->iHeight = $aHeight; - } -} - -define('GANTT_HGRID1',0); -define('GANTT_HGRID2',1); - -//=================================================== -// CLASS HorizontalGridLine -// Responsible for drawinf horizontal gridlines and filled alternatibg rows -//=================================================== -class HorizontalGridLine { - private $iGraph=NULL; - private $iRowColor1 = '', $iRowColor2 = ''; - private $iShow=false; - private $line=null; - private $iStart=0; // 0=from left margin, 1=just along header - - function __construct() { - $this->line = new LineProperty(); - $this->line->SetColor('gray@0.4'); - $this->line->SetStyle('dashed'); - } - - function Show($aShow=true) { - $this->iShow = $aShow; - } - - function SetRowFillColor($aColor1,$aColor2='') { - $this->iRowColor1 = $aColor1; - $this->iRowColor2 = $aColor2; - } - - function SetStart($aStart) { - $this->iStart = $aStart; - } - - function Stroke($aImg,$aScale) { - - if( ! $this->iShow ) return; - - // Get horizontal width of line - /* - $limst = $aScale->iStartDate; - $limen = $aScale->iEndDate; - $xt = round($aScale->TranslateDate($aScale->iStartDate)); - $xb = round($aScale->TranslateDate($limen)); - */ - - if( $this->iStart === 0 ) { - $xt = $aImg->left_margin-1; - } - else { - $xt = round($aScale->TranslateDate($aScale->iStartDate))+1; - } - - $xb = $aImg->width-$aImg->right_margin; - - $yt = round($aScale->TranslateVertPos(0)); - $yb = round($aScale->TranslateVertPos(1)); - $height = $yb - $yt; - - // Loop around for all lines in the chart - for($i=0; $i < $aScale->iVertLines; ++$i ) { - $yb = $yt - $height; - $this->line->Stroke($aImg,$xt,$yb,$xb,$yb); - if( $this->iRowColor1 !== '' ) { - if( $i % 2 == 0 ) { - $aImg->PushColor($this->iRowColor1); - $aImg->FilledRectangle($xt,$yt,$xb,$yb); - $aImg->PopColor(); - } - elseif( $this->iRowColor2 !== '' ) { - $aImg->PushColor($this->iRowColor2); - $aImg->FilledRectangle($xt,$yt,$xb,$yb); - $aImg->PopColor(); - } - } - $yt = round($aScale->TranslateVertPos($i+1)); - } - $yb = $yt - $height; - $this->line->Stroke($aImg,$xt,$yb,$xb,$yb); - } -} - - -//=================================================== -// CLASS GanttBar -// Responsible for formatting individual gantt bars -//=================================================== -class GanttBar extends GanttPlotObject { - public $progress; - public $leftMark,$rightMark; - private $iEnd; - private $iHeightFactor=0.5; - private $iFillColor="white",$iFrameColor="black"; - private $iShadow=false,$iShadowColor="darkgray",$iShadowWidth=1,$iShadowFrame="black"; - private $iPattern=GANTT_RDIAG,$iPatternColor="blue",$iPatternDensity=95; - private $iBreakStyle=false, $iBreakLineStyle='dotted',$iBreakLineWeight=1; - //--------------- - // CONSTRUCTOR - function __construct($aPos,$aLabel,$aStart,$aEnd,$aCaption="",$aHeightFactor=0.6) { - parent::__construct(); - $this->iStart = $aStart; - // Is the end date given as a date or as number of days added to start date? - if( is_string($aEnd) ) { - // If end date has been specified without a time we will asssume - // end date is at the end of that date - if( strpos($aEnd,':') === false ) { - $this->iEnd = strtotime($aEnd)+SECPERDAY-1; - } - else { - $this->iEnd = $aEnd; - } - } - elseif(is_int($aEnd) || is_float($aEnd) ) { - $this->iEnd = strtotime($aStart)+round($aEnd*SECPERDAY); - } - $this->iVPos = $aPos; - $this->iHeightFactor = $aHeightFactor; - $this->title->Set($aLabel); - $this->caption = new TextProperty($aCaption); - $this->caption->Align("left","center"); - $this->leftMark =new PlotMark(); - $this->leftMark->Hide(); - $this->rightMark=new PlotMark(); - $this->rightMark->Hide(); - $this->progress = new Progress(); - } - - //--------------- - // PUBLIC METHODS - function SetShadow($aShadow=true,$aColor="gray") { - $this->iShadow=$aShadow; - $this->iShadowColor=$aColor; - } - - function SetBreakStyle($aFlg=true,$aLineStyle='dotted',$aLineWeight=1) { - $this->iBreakStyle = $aFlg; - $this->iBreakLineStyle = $aLineStyle; - $this->iBreakLineWeight = $aLineWeight; - } - - function GetMaxDate() { - return $this->iEnd; - } - - function SetHeight($aHeight) { - $this->iHeightFactor = $aHeight; - } - - function SetColor($aColor) { - $this->iFrameColor = $aColor; - } - - function SetFillColor($aColor) { - $this->iFillColor = $aColor; - } - - function GetAbsHeight($aImg) { - if( is_int($this->iHeightFactor) || $this->leftMark->show || $this->rightMark->show ) { - $m=-1; - if( is_int($this->iHeightFactor) ) - $m = $this->iHeightFactor; - if( $this->leftMark->show ) - $m = max($m,$this->leftMark->width*2); - if( $this->rightMark->show ) - $m = max($m,$this->rightMark->width*2); - return $m; - } - else - return -1; - } - - function SetPattern($aPattern,$aColor="blue",$aDensity=95) { - $this->iPattern = $aPattern; - $this->iPatternColor = $aColor; - $this->iPatternDensity = $aDensity; - } - - function Stroke($aImg,$aScale) { - $factory = new RectPatternFactory(); - $prect = $factory->Create($this->iPattern,$this->iPatternColor); - $prect->SetDensity($this->iPatternDensity); - - // If height factor is specified as a float between 0,1 then we take it as meaning - // percetage of the scale width between horizontal line. - // If it is an integer > 1 we take it to mean the absolute height in pixels - if( $this->iHeightFactor > -0.0 && $this->iHeightFactor <= 1.1) - $vs = $aScale->GetVertSpacing()*$this->iHeightFactor; - elseif(is_int($this->iHeightFactor) && $this->iHeightFactor>2 && $this->iHeightFactor < 200 ) - $vs = $this->iHeightFactor; - else { - JpGraphError::RaiseL(6028,$this->iHeightFactor); - // ("Specified height (".$this->iHeightFactor.") for gantt bar is out of range."); - } - - // Clip date to min max dates to show - $st = $aScale->NormalizeDate($this->iStart); - $en = $aScale->NormalizeDate($this->iEnd); - - $limst = max($st,$aScale->iStartDate); - $limen = min($en,$aScale->iEndDate); - - $xt = round($aScale->TranslateDate($limst)); - $xb = round($aScale->TranslateDate($limen)); - $yt = round($aScale->TranslateVertPos($this->iVPos)-$vs-($aScale->GetVertSpacing()/2-$vs/2)); - $yb = round($aScale->TranslateVertPos($this->iVPos)-($aScale->GetVertSpacing()/2-$vs/2)); - $middle = round($yt+($yb-$yt)/2); - $this->StrokeActInfo($aImg,$aScale,$middle); - - // CSIM for title - if( ! empty($this->title->csimtarget) ) { - $colwidth = $this->title->GetColWidth($aImg); - $colstarts=array(); - $aScale->actinfo->GetColStart($aImg,$colstarts,true); - $n = min(count($colwidth),count($this->title->csimtarget)); - for( $i=0; $i < $n; ++$i ) { - $title_xt = $colstarts[$i]; - $title_xb = $title_xt + $colwidth[$i]; - $coords = "$title_xt,$yt,$title_xb,$yt,$title_xb,$yb,$title_xt,$yb"; - - if( ! empty($this->title->csimtarget[$i]) ) { - $this->csimarea .= "title->csimtarget[$i]."\""; - - if( ! empty($this->title->csimwintarget[$i]) ) { - $this->csimarea .= "target=\"".$this->title->csimwintarget[$i]."\" "; - } - - if( ! empty($this->title->csimalt[$i]) ) { - $tmp = $this->title->csimalt[$i]; - $this->csimarea .= " title=\"$tmp\" alt=\"$tmp\" "; - } - $this->csimarea .= " />\n"; - } - } - } - - // Check if the bar is totally outside the current scale range - if( $en < $aScale->iStartDate || $st > $aScale->iEndDate ) - return; - - - // Remember the positions for the bar - $this->SetConstrainPos($xt,$yt,$xb,$yb); - - - - $prect->ShowFrame(false); - $prect->SetBackground($this->iFillColor); - if( $this->iBreakStyle ) { - $aImg->SetColor($this->iFrameColor); - $olds = $aImg->SetLineStyle($this->iBreakLineStyle); - $oldw = $aImg->SetLineWeight($this->iBreakLineWeight); - $aImg->StyleLine($xt,$yt,$xb,$yt); - $aImg->StyleLine($xt,$yb,$xb,$yb); - $aImg->SetLineStyle($olds); - $aImg->SetLineWeight($oldw); - } - else { - if( $this->iShadow ) { - $aImg->SetColor($this->iFrameColor); - $aImg->ShadowRectangle($xt,$yt,$xb,$yb,$this->iFillColor,$this->iShadowWidth,$this->iShadowColor); - $prect->SetPos(new Rectangle($xt+1,$yt+1,$xb-$xt-$this->iShadowWidth-2,$yb-$yt-$this->iShadowWidth-2)); - $prect->Stroke($aImg); - } - else { - $prect->SetPos(new Rectangle($xt,$yt,$xb-$xt+1,$yb-$yt+1)); - $prect->Stroke($aImg); - $aImg->SetColor($this->iFrameColor); - $aImg->Rectangle($xt,$yt,$xb,$yb); - } - } - // CSIM for bar - if( ! empty($this->csimtarget) ) { - - $coords = "$xt,$yt,$xb,$yt,$xb,$yb,$xt,$yb"; - $this->csimarea .= "csimtarget."\""; - - if( !empty($this->csimwintarget) ) { - $this->csimarea .= " target=\"".$this->csimwintarget."\" "; - } - - if( $this->csimalt != '' ) { - $tmp = $this->csimalt; - $this->csimarea .= " title=\"$tmp\" alt=\"$tmp\" "; - } - $this->csimarea .= " />\n"; - } - - // Draw progress bar inside activity bar - if( $this->progress->iProgress > 0 ) { - - $xtp = $aScale->TranslateDate($st); - $xbp = $aScale->TranslateDate($en); - $len = ($xbp-$xtp)*$this->progress->iProgress; - - $endpos = $xtp+$len; - if( $endpos > $xt ) { - - // Take away the length of the progress that is not visible (before the start date) - $len -= ($xt-$xtp); - - // Is the the progress bar visible after the start date? - if( $xtp < $xt ) - $xtp = $xt; - - // Make sure that the progess bar doesn't extend over the end date - if( $xtp+$len-1 > $xb ) - $len = $xb - $xtp ; - - $prog = $factory->Create($this->progress->iPattern,$this->progress->iColor); - $prog->SetDensity($this->progress->iDensity); - $prog->SetBackground($this->progress->iFillColor); - $barheight = ($yb-$yt+1); - if( $this->iShadow ) - $barheight -= $this->iShadowWidth; - $progressheight = floor($barheight*$this->progress->iHeight); - $marg = ceil(($barheight-$progressheight)/2); - $pos = new Rectangle($xtp,$yt + $marg, $len,$barheight-2*$marg); - $prog->SetPos($pos); - $prog->Stroke($aImg); - } - } - - // We don't plot the end mark if the bar has been capped - if( $limst == $st ) { - $y = $middle; - // We treat the RIGHT and LEFT triangle mark a little bi - // special so that these marks are placed right under the - // bar. - if( $this->leftMark->GetType() == MARK_LEFTTRIANGLE ) { - $y = $yb ; - } - $this->leftMark->Stroke($aImg,$xt,$y); - } - if( $limen == $en ) { - $y = $middle; - // We treat the RIGHT and LEFT triangle mark a little bi - // special so that these marks are placed right under the - // bar. - if( $this->rightMark->GetType() == MARK_RIGHTTRIANGLE ) { - $y = $yb ; - } - $this->rightMark->Stroke($aImg,$xb,$y); - - $margin = $this->iCaptionMargin; - if( $this->rightMark->show ) - $margin += $this->rightMark->GetWidth(); - $this->caption->Stroke($aImg,$xb+$margin,$middle); - } - } -} - -//=================================================== -// CLASS MileStone -// Responsible for formatting individual milestones -//=================================================== -class MileStone extends GanttPlotObject { - public $mark; - - //--------------- - // CONSTRUCTOR - function __construct($aVPos,$aLabel,$aDate,$aCaption="") { - GanttPlotObject::__construct(); - $this->caption->Set($aCaption); - $this->caption->Align("left","center"); - $this->caption->SetFont(FF_FONT1,FS_BOLD); - $this->title->Set($aLabel); - $this->title->SetColor("darkred"); - $this->mark = new PlotMark(); - $this->mark->SetWidth(10); - $this->mark->SetType(MARK_DIAMOND); - $this->mark->SetColor("darkred"); - $this->mark->SetFillColor("darkred"); - $this->iVPos = $aVPos; - $this->iStart = $aDate; - } - - //--------------- - // PUBLIC METHODS - - function GetAbsHeight($aImg) { - return max($this->title->GetHeight($aImg),$this->mark->GetWidth()); - } - - function Stroke($aImg,$aScale) { - // Put the mark in the middle at the middle of the day - $d = $aScale->NormalizeDate($this->iStart)+SECPERDAY/2; - $x = $aScale->TranslateDate($d); - $y = $aScale->TranslateVertPos($this->iVPos)-($aScale->GetVertSpacing()/2); - - $this->StrokeActInfo($aImg,$aScale,$y); - - // CSIM for title - if( ! empty($this->title->csimtarget) ) { - - $yt = round($y - $this->title->GetHeight($aImg)/2); - $yb = round($y + $this->title->GetHeight($aImg)/2); - - $colwidth = $this->title->GetColWidth($aImg); - $colstarts=array(); - $aScale->actinfo->GetColStart($aImg,$colstarts,true); - $n = min(count($colwidth),count($this->title->csimtarget)); - for( $i=0; $i < $n; ++$i ) { - $title_xt = $colstarts[$i]; - $title_xb = $title_xt + $colwidth[$i]; - $coords = "$title_xt,$yt,$title_xb,$yt,$title_xb,$yb,$title_xt,$yb"; - - if( !empty($this->title->csimtarget[$i]) ) { - - $this->csimarea .= "title->csimtarget[$i]."\""; - - if( !empty($this->title->csimwintarget[$i]) ) { - $this->csimarea .= "target=\"".$this->title->csimwintarget[$i]."\""; - } - - if( ! empty($this->title->csimalt[$i]) ) { - $tmp = $this->title->csimalt[$i]; - $this->csimarea .= " title=\"$tmp\" alt=\"$tmp\" "; - } - $this->csimarea .= " />\n"; - } - } - } - - if( $d < $aScale->iStartDate || $d > $aScale->iEndDate ) - return; - - // Remember the coordinates for any constrains linking to - // this milestone - $w = $this->mark->GetWidth()/2; - $this->SetConstrainPos($x,round($y-$w),$x,round($y+$w)); - - // Setup CSIM - if( $this->csimtarget != '' ) { - $this->mark->SetCSIMTarget( $this->csimtarget ); - $this->mark->SetCSIMAlt( $this->csimalt ); - } - - $this->mark->Stroke($aImg,$x,$y); - $this->caption->Stroke($aImg,$x+$this->mark->width/2+$this->iCaptionMargin,$y); - - $this->csimarea .= $this->mark->GetCSIMAreas(); - } -} - - -//=================================================== -// CLASS GanttVLine -// Responsible for formatting individual milestones -//=================================================== - -class TextPropertyBelow extends TextProperty { - function __construct($aTxt='') { - parent::__construct($aTxt); - } - - function GetColWidth($aImg,$aMargin=0) { - // Since we are not stroking the title in the columns - // but rather under the graph we want this to return 0. - return array(0); - } -} - -class GanttVLine extends GanttPlotObject { - - private $iLine,$title_margin=3, $iDayOffset=0.5; - private $iStartRow = -1, $iEndRow = -1; - - //--------------- - // CONSTRUCTOR - function __construct($aDate,$aTitle="",$aColor="darkred",$aWeight=2,$aStyle="solid") { - GanttPlotObject::__construct(); - $this->iLine = new LineProperty(); - $this->iLine->SetColor($aColor); - $this->iLine->SetWeight($aWeight); - $this->iLine->SetStyle($aStyle); - $this->iStart = $aDate; - $this->title = new TextPropertyBelow(); - $this->title->Set($aTitle); - } - - //--------------- - // PUBLIC METHODS - - // Set start and end rows for the VLine. By default the entire heigh of the - // Gantt chart is used - function SetRowSpan($aStart, $aEnd=-1) { - $this->iStartRow = $aStart; - $this->iEndRow = $aEnd; - } - - function SetDayOffset($aOff=0.5) { - if( $aOff < 0.0 || $aOff > 1.0 ) { - JpGraphError::RaiseL(6029); - //("Offset for vertical line must be in range [0,1]"); - } - $this->iDayOffset = $aOff; - } - - function SetTitleMargin($aMarg) { - $this->title_margin = $aMarg; - } - - function SetWeight($aWeight) { - $this->iLine->SetWeight($aWeight); - } - - function Stroke($aImg,$aScale) { - $d = $aScale->NormalizeDate($this->iStart); - if( $d < $aScale->iStartDate || $d > $aScale->iEndDate ) - return; - if($this->iDayOffset != 0.0) - $d += 24*60*60*$this->iDayOffset; - $x = $aScale->TranslateDate($d);//d=1006858800, - - if( $this->iStartRow > -1 ) { - $y1 = $aScale->TranslateVertPos($this->iStartRow,true) ; - } - else { - $y1 = $aScale->iVertHeaderSize+$aImg->top_margin; - } - - if( $this->iEndRow > -1 ) { - $y2 = $aScale->TranslateVertPos($this->iEndRow); - } - else { - $y2 = $aImg->height - $aImg->bottom_margin; - } - - $this->iLine->Stroke($aImg,$x,$y1,$x,$y2); - $this->title->Align("center","top"); - $this->title->Stroke($aImg,$x,$y2+$this->title_margin); - } -} - -//=================================================== -// CLASS LinkArrow -// Handles the drawing of a an arrow -//=================================================== -class LinkArrow { - private $ix,$iy; - private $isizespec = array( - array(2,3),array(3,5),array(3,8),array(6,15),array(8,22)); - private $iDirection=ARROW_DOWN,$iType=ARROWT_SOLID,$iSize=ARROW_S2; - private $iColor='black'; - - function __construct($x,$y,$aDirection,$aType=ARROWT_SOLID,$aSize=ARROW_S2) { - $this->iDirection = $aDirection; - $this->iType = $aType; - $this->iSize = $aSize; - $this->ix = $x; - $this->iy = $y; - } - - function SetColor($aColor) { - $this->iColor = $aColor; - } - - function SetSize($aSize) { - $this->iSize = $aSize; - } - - function SetType($aType) { - $this->iType = $aType; - } - - function Stroke($aImg) { - list($dx,$dy) = $this->isizespec[$this->iSize]; - $x = $this->ix; - $y = $this->iy; - switch ( $this->iDirection ) { - case ARROW_DOWN: - $c = array($x,$y,$x-$dx,$y-$dy,$x+$dx,$y-$dy,$x,$y); - break; - case ARROW_UP: - $c = array($x,$y,$x-$dx,$y+$dy,$x+$dx,$y+$dy,$x,$y); - break; - case ARROW_LEFT: - $c = array($x,$y,$x+$dy,$y-$dx,$x+$dy,$y+$dx,$x,$y); - break; - case ARROW_RIGHT: - $c = array($x,$y,$x-$dy,$y-$dx,$x-$dy,$y+$dx,$x,$y); - break; - default: - JpGraphError::RaiseL(6030); - //('Unknown arrow direction for link.'); - die(); - break; - } - $aImg->SetColor($this->iColor); - switch( $this->iType ) { - case ARROWT_SOLID: - $aImg->FilledPolygon($c); - break; - case ARROWT_OPEN: - $aImg->Polygon($c); - break; - default: - JpGraphError::RaiseL(6031); - //('Unknown arrow type for link.'); - die(); - break; - } - } -} - -//=================================================== -// CLASS GanttLink -// Handles the drawing of a link line between 2 points -//=================================================== - -class GanttLink { - private $ix1,$ix2,$iy1,$iy2; - private $iPathType=2,$iPathExtend=15; - private $iColor='black',$iWeight=1; - private $iArrowSize=ARROW_S2,$iArrowType=ARROWT_SOLID; - - function __construct($x1=0,$y1=0,$x2=0,$y2=0) { - $this->ix1 = $x1; - $this->ix2 = $x2; - $this->iy1 = $y1; - $this->iy2 = $y2; - } - - function SetPos($x1,$y1,$x2,$y2) { - $this->ix1 = $x1; - $this->ix2 = $x2; - $this->iy1 = $y1; - $this->iy2 = $y2; - } - - function SetPath($aPath) { - $this->iPathType = $aPath; - } - - function SetColor($aColor) { - $this->iColor = $aColor; - } - - function SetArrow($aSize,$aType=ARROWT_SOLID) { - $this->iArrowSize = $aSize; - $this->iArrowType = $aType; - } - - function SetWeight($aWeight) { - $this->iWeight = $aWeight; - } - - function Stroke($aImg) { - // The way the path for the arrow is constructed is partly based - // on some heuristics. This is not an exact science but draws the - // path in a way that, for me, makes esthetic sence. For example - // if the start and end activities are very close we make a small - // detour to endter the target horixontally. If there are more - // space between axctivities then no suh detour is made and the - // target is "hit" directly vertical. I have tried to keep this - // simple. no doubt this could become almost infinitive complex - // and have some real AI. Feel free to modify this. - // This will no-doubt be tweaked as times go by. One design aim - // is to avoid having the user choose what types of arrow - // he wants. - - // The arrow is drawn between (x1,y1) to (x2,y2) - $x1 = $this->ix1 ; - $x2 = $this->ix2 ; - $y1 = $this->iy1 ; - $y2 = $this->iy2 ; - - // Depending on if the target is below or above we have to - // handle thi different. - if( $y2 > $y1 ) { - $arrowtype = ARROW_DOWN; - $midy = round(($y2-$y1)/2+$y1); - if( $x2 > $x1 ) { - switch ( $this->iPathType ) { - case 0: - $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); - break; - case 1: - case 2: - case 3: - $c = array($x1,$y1,$x2,$y1,$x2,$y2); - break; - default: - JpGraphError::RaiseL(6032,$this->iPathType); - //('Internal error: Unknown path type (='.$this->iPathType .') specified for link.'); - exit(1); - break; - } - } - else { - switch ( $this->iPathType ) { - case 0: - case 1: - $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); - break; - case 2: - // Always extend out horizontally a bit from the first point - // If we draw a link back in time (end to start) and the bars - // are very close we also change the path so it comes in from - // the left on the activity - $c = array($x1,$y1,$x1+$this->iPathExtend,$y1, - $x1+$this->iPathExtend,$midy, - $x2,$midy,$x2,$y2); - break; - case 3: - if( $y2-$midy < 6 ) { - $c = array($x1,$y1,$x1,$midy, - $x2-$this->iPathExtend,$midy, - $x2-$this->iPathExtend,$y2, - $x2,$y2); - $arrowtype = ARROW_RIGHT; - } - else { - $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); - } - break; - default: - JpGraphError::RaiseL(6032,$this->iPathType); - //('Internal error: Unknown path type specified for link.'); - exit(1); - break; - } - } - $arrow = new LinkArrow($x2,$y2,$arrowtype); - } - else { - // Y2 < Y1 - $arrowtype = ARROW_UP; - $midy = round(($y1-$y2)/2+$y2); - if( $x2 > $x1 ) { - switch ( $this->iPathType ) { - case 0: - case 1: - $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); - break; - case 3: - if( $midy-$y2 < 8 ) { - $arrowtype = ARROW_RIGHT; - $c = array($x1,$y1,$x1,$y2,$x2,$y2); - } - else { - $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); - } - break; - default: - JpGraphError::RaiseL(6032,$this->iPathType); - //('Internal error: Unknown path type specified for link.'); - break; - } - } - else { - switch ( $this->iPathType ) { - case 0: - case 1: - $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); - break; - case 2: - // Always extend out horizontally a bit from the first point - $c = array($x1,$y1,$x1+$this->iPathExtend,$y1, - $x1+$this->iPathExtend,$midy, - $x2,$midy,$x2,$y2); - break; - case 3: - if( $midy-$y2 < 16 ) { - $arrowtype = ARROW_RIGHT; - $c = array($x1,$y1,$x1,$midy,$x2-$this->iPathExtend,$midy, - $x2-$this->iPathExtend,$y2, - $x2,$y2); - } - else { - $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); - } - break; - default: - JpGraphError::RaiseL(6032,$this->iPathType); - //('Internal error: Unknown path type specified for link.'); - break; - } - } - $arrow = new LinkArrow($x2,$y2,$arrowtype); - } - $aImg->SetColor($this->iColor); - $aImg->SetLineWeight($this->iWeight); - $aImg->Polygon($c); - $aImg->SetLineWeight(1); - $arrow->SetColor($this->iColor); - $arrow->SetSize($this->iArrowSize); - $arrow->SetType($this->iArrowType); - $arrow->Stroke($aImg); - } -} - -// -?> diff --git a/#jpgraph/src/jpgraph_gb2312.php b/#jpgraph/src/jpgraph_gb2312.php deleted file mode 100644 index eff07cbc..00000000 --- a/#jpgraph/src/jpgraph_gb2312.php +++ /dev/null @@ -1,1552 +0,0 @@ - 12288, 8482 => 12289, 8483 => 12290, 8484 => 12539, 8485 => 713, - 8486 => 711, 8487 => 168, 8488 => 12291, 8489 => 12293, 8490 => 8213, - 8491 => 65374, 8492 => 8214, 8493 => 8230, 8494 => 8216, 8495 => 8217, - 8496 => 8220, 8497 => 8221, 8498 => 12308, 8499 => 12309, 8500 => 12296, - 8501 => 12297, 8502 => 12298, 8503 => 12299, 8504 => 12300, 8505 => 12301, - 8506 => 12302, 8507 => 12303, 8508 => 12310, 8509 => 12311, 8510 => 12304, - 8511 => 12305, 8512 => 177, 8513 => 215, 8514 => 247, 8515 => 8758, - 8516 => 8743, 8517 => 8744, 8518 => 8721, 8519 => 8719, 8520 => 8746, - 8521 => 8745, 8522 => 8712, 8523 => 8759, 8524 => 8730, 8525 => 8869, - 8526 => 8741, 8527 => 8736, 8528 => 8978, 8529 => 8857, 8530 => 8747, - 8531 => 8750, 8532 => 8801, 8533 => 8780, 8534 => 8776, 8535 => 8765, - 8536 => 8733, 8537 => 8800, 8538 => 8814, 8539 => 8815, 8540 => 8804, - 8541 => 8805, 8542 => 8734, 8543 => 8757, 8544 => 8756, 8545 => 9794, - 8546 => 9792, 8547 => 176, 8548 => 8242, 8549 => 8243, 8550 => 8451, - 8551 => 65284, 8552 => 164, 8553 => 65504, 8554 => 65505, 8555 => 8240, - 8556 => 167, 8557 => 8470, 8558 => 9734, 8559 => 9733, 8560 => 9675, - 8561 => 9679, 8562 => 9678, 8563 => 9671, 8564 => 9670, 8565 => 9633, - 8566 => 9632, 8567 => 9651, 8568 => 9650, 8569 => 8251, 8570 => 8594, - 8571 => 8592, 8572 => 8593, 8573 => 8595, 8574 => 12307, 8753 => 9352, - 8754 => 9353, 8755 => 9354, 8756 => 9355, 8757 => 9356, 8758 => 9357, - 8759 => 9358, 8760 => 9359, 8761 => 9360, 8762 => 9361, 8763 => 9362, - 8764 => 9363, 8765 => 9364, 8766 => 9365, 8767 => 9366, 8768 => 9367, - 8769 => 9368, 8770 => 9369, 8771 => 9370, 8772 => 9371, 8773 => 9332, - 8774 => 9333, 8775 => 9334, 8776 => 9335, 8777 => 9336, 8778 => 9337, - 8779 => 9338, 8780 => 9339, 8781 => 9340, 8782 => 9341, 8783 => 9342, - 8784 => 9343, 8785 => 9344, 8786 => 9345, 8787 => 9346, 8788 => 9347, - 8789 => 9348, 8790 => 9349, 8791 => 9350, 8792 => 9351, 8793 => 9312, - 8794 => 9313, 8795 => 9314, 8796 => 9315, 8797 => 9316, 8798 => 9317, - 8799 => 9318, 8800 => 9319, 8801 => 9320, 8802 => 9321, 8805 => 12832, - 8806 => 12833, 8807 => 12834, 8808 => 12835, 8809 => 12836, 8810 => 12837, - 8811 => 12838, 8812 => 12839, 8813 => 12840, 8814 => 12841, 8817 => 8544, - 8818 => 8545, 8819 => 8546, 8820 => 8547, 8821 => 8548, 8822 => 8549, - 8823 => 8550, 8824 => 8551, 8825 => 8552, 8826 => 8553, 8827 => 8554, - 8828 => 8555, 8993 => 65281, 8994 => 65282, 8995 => 65283, 8996 => 65509, - 8997 => 65285, 8998 => 65286, 8999 => 65287, 9000 => 65288, 9001 => 65289, - 9002 => 65290, 9003 => 65291, 9004 => 65292, 9005 => 65293, 9006 => 65294, - 9007 => 65295, 9008 => 65296, 9009 => 65297, 9010 => 65298, 9011 => 65299, - 9012 => 65300, 9013 => 65301, 9014 => 65302, 9015 => 65303, 9016 => 65304, - 9017 => 65305, 9018 => 65306, 9019 => 65307, 9020 => 65308, 9021 => 65309, - 9022 => 65310, 9023 => 65311, 9024 => 65312, 9025 => 65313, 9026 => 65314, - 9027 => 65315, 9028 => 65316, 9029 => 65317, 9030 => 65318, 9031 => 65319, - 9032 => 65320, 9033 => 65321, 9034 => 65322, 9035 => 65323, 9036 => 65324, - 9037 => 65325, 9038 => 65326, 9039 => 65327, 9040 => 65328, 9041 => 65329, - 9042 => 65330, 9043 => 65331, 9044 => 65332, 9045 => 65333, 9046 => 65334, - 9047 => 65335, 9048 => 65336, 9049 => 65337, 9050 => 65338, 9051 => 65339, - 9052 => 65340, 9053 => 65341, 9054 => 65342, 9055 => 65343, 9056 => 65344, - 9057 => 65345, 9058 => 65346, 9059 => 65347, 9060 => 65348, 9061 => 65349, - 9062 => 65350, 9063 => 65351, 9064 => 65352, 9065 => 65353, 9066 => 65354, - 9067 => 65355, 9068 => 65356, 9069 => 65357, 9070 => 65358, 9071 => 65359, - 9072 => 65360, 9073 => 65361, 9074 => 65362, 9075 => 65363, 9076 => 65364, - 9077 => 65365, 9078 => 65366, 9079 => 65367, 9080 => 65368, 9081 => 65369, - 9082 => 65370, 9083 => 65371, 9084 => 65372, 9085 => 65373, 9086 => 65507, - 9249 => 12353, 9250 => 12354, 9251 => 12355, 9252 => 12356, 9253 => 12357, - 9254 => 12358, 9255 => 12359, 9256 => 12360, 9257 => 12361, 9258 => 12362, - 9259 => 12363, 9260 => 12364, 9261 => 12365, 9262 => 12366, 9263 => 12367, - 9264 => 12368, 9265 => 12369, 9266 => 12370, 9267 => 12371, 9268 => 12372, - 9269 => 12373, 9270 => 12374, 9271 => 12375, 9272 => 12376, 9273 => 12377, - 9274 => 12378, 9275 => 12379, 9276 => 12380, 9277 => 12381, 9278 => 12382, - 9279 => 12383, 9280 => 12384, 9281 => 12385, 9282 => 12386, 9283 => 12387, - 9284 => 12388, 9285 => 12389, 9286 => 12390, 9287 => 12391, 9288 => 12392, - 9289 => 12393, 9290 => 12394, 9291 => 12395, 9292 => 12396, 9293 => 12397, - 9294 => 12398, 9295 => 12399, 9296 => 12400, 9297 => 12401, 9298 => 12402, - 9299 => 12403, 9300 => 12404, 9301 => 12405, 9302 => 12406, 9303 => 12407, - 9304 => 12408, 9305 => 12409, 9306 => 12410, 9307 => 12411, 9308 => 12412, - 9309 => 12413, 9310 => 12414, 9311 => 12415, 9312 => 12416, 9313 => 12417, - 9314 => 12418, 9315 => 12419, 9316 => 12420, 9317 => 12421, 9318 => 12422, - 9319 => 12423, 9320 => 12424, 9321 => 12425, 9322 => 12426, 9323 => 12427, - 9324 => 12428, 9325 => 12429, 9326 => 12430, 9327 => 12431, 9328 => 12432, - 9329 => 12433, 9330 => 12434, 9331 => 12435, 9505 => 12449, 9506 => 12450, - 9507 => 12451, 9508 => 12452, 9509 => 12453, 9510 => 12454, 9511 => 12455, - 9512 => 12456, 9513 => 12457, 9514 => 12458, 9515 => 12459, 9516 => 12460, - 9517 => 12461, 9518 => 12462, 9519 => 12463, 9520 => 12464, 9521 => 12465, - 9522 => 12466, 9523 => 12467, 9524 => 12468, 9525 => 12469, 9526 => 12470, - 9527 => 12471, 9528 => 12472, 9529 => 12473, 9530 => 12474, 9531 => 12475, - 9532 => 12476, 9533 => 12477, 9534 => 12478, 9535 => 12479, 9536 => 12480, - 9537 => 12481, 9538 => 12482, 9539 => 12483, 9540 => 12484, 9541 => 12485, - 9542 => 12486, 9543 => 12487, 9544 => 12488, 9545 => 12489, 9546 => 12490, - 9547 => 12491, 9548 => 12492, 9549 => 12493, 9550 => 12494, 9551 => 12495, - 9552 => 12496, 9553 => 12497, 9554 => 12498, 9555 => 12499, 9556 => 12500, - 9557 => 12501, 9558 => 12502, 9559 => 12503, 9560 => 12504, 9561 => 12505, - 9562 => 12506, 9563 => 12507, 9564 => 12508, 9565 => 12509, 9566 => 12510, - 9567 => 12511, 9568 => 12512, 9569 => 12513, 9570 => 12514, 9571 => 12515, - 9572 => 12516, 9573 => 12517, 9574 => 12518, 9575 => 12519, 9576 => 12520, - 9577 => 12521, 9578 => 12522, 9579 => 12523, 9580 => 12524, 9581 => 12525, - 9582 => 12526, 9583 => 12527, 9584 => 12528, 9585 => 12529, 9586 => 12530, - 9587 => 12531, 9588 => 12532, 9589 => 12533, 9590 => 12534, 9761 => 913, - 9762 => 914, 9763 => 915, 9764 => 916, 9765 => 917, 9766 => 918, - 9767 => 919, 9768 => 920, 9769 => 921, 9770 => 922, 9771 => 923, - 9772 => 924, 9773 => 925, 9774 => 926, 9775 => 927, 9776 => 928, - 9777 => 929, 9778 => 931, 9779 => 932, 9780 => 933, 9781 => 934, - 9782 => 935, 9783 => 936, 9784 => 937, 9793 => 945, 9794 => 946, - 9795 => 947, 9796 => 948, 9797 => 949, 9798 => 950, 9799 => 951, - 9800 => 952, 9801 => 953, 9802 => 954, 9803 => 955, 9804 => 956, - 9805 => 957, 9806 => 958, 9807 => 959, 9808 => 960, 9809 => 961, - 9810 => 963, 9811 => 964, 9812 => 965, 9813 => 966, 9814 => 967, - 9815 => 968, 9816 => 969, 10017 => 1040, 10018 => 1041, 10019 => 1042, - 10020 => 1043, 10021 => 1044, 10022 => 1045, 10023 => 1025, 10024 => 1046, - 10025 => 1047, 10026 => 1048, 10027 => 1049, 10028 => 1050, 10029 => 1051, - 10030 => 1052, 10031 => 1053, 10032 => 1054, 10033 => 1055, 10034 => 1056, - 10035 => 1057, 10036 => 1058, 10037 => 1059, 10038 => 1060, 10039 => 1061, - 10040 => 1062, 10041 => 1063, 10042 => 1064, 10043 => 1065, 10044 => 1066, - 10045 => 1067, 10046 => 1068, 10047 => 1069, 10048 => 1070, 10049 => 1071, - 10065 => 1072, 10066 => 1073, 10067 => 1074, 10068 => 1075, 10069 => 1076, - 10070 => 1077, 10071 => 1105, 10072 => 1078, 10073 => 1079, 10074 => 1080, - 10075 => 1081, 10076 => 1082, 10077 => 1083, 10078 => 1084, 10079 => 1085, - 10080 => 1086, 10081 => 1087, 10082 => 1088, 10083 => 1089, 10084 => 1090, - 10085 => 1091, 10086 => 1092, 10087 => 1093, 10088 => 1094, 10089 => 1095, - 10090 => 1096, 10091 => 1097, 10092 => 1098, 10093 => 1099, 10094 => 1100, - 10095 => 1101, 10096 => 1102, 10097 => 1103, 10273 => 257, 10274 => 225, - 10275 => 462, 10276 => 224, 10277 => 275, 10278 => 233, 10279 => 283, - 10280 => 232, 10281 => 299, 10282 => 237, 10283 => 464, 10284 => 236, - 10285 => 333, 10286 => 243, 10287 => 466, 10288 => 242, 10289 => 363, - 10290 => 250, 10291 => 468, 10292 => 249, 10293 => 470, 10294 => 472, - 10295 => 474, 10296 => 476, 10297 => 252, 10298 => 234, 10309 => 12549, - 10310 => 12550, 10311 => 12551, 10312 => 12552, 10313 => 12553, 10314 => 12554, - 10315 => 12555, 10316 => 12556, 10317 => 12557, 10318 => 12558, 10319 => 12559, - 10320 => 12560, 10321 => 12561, 10322 => 12562, 10323 => 12563, 10324 => 12564, - 10325 => 12565, 10326 => 12566, 10327 => 12567, 10328 => 12568, 10329 => 12569, - 10330 => 12570, 10331 => 12571, 10332 => 12572, 10333 => 12573, 10334 => 12574, - 10335 => 12575, 10336 => 12576, 10337 => 12577, 10338 => 12578, 10339 => 12579, - 10340 => 12580, 10341 => 12581, 10342 => 12582, 10343 => 12583, 10344 => 12584, - 10345 => 12585, 10532 => 9472, 10533 => 9473, 10534 => 9474, 10535 => 9475, - 10536 => 9476, 10537 => 9477, 10538 => 9478, 10539 => 9479, 10540 => 9480, - 10541 => 9481, 10542 => 9482, 10543 => 9483, 10544 => 9484, 10545 => 9485, - 10546 => 9486, 10547 => 9487, 10548 => 9488, 10549 => 9489, 10550 => 9490, - 10551 => 9491, 10552 => 9492, 10553 => 9493, 10554 => 9494, 10555 => 9495, - 10556 => 9496, 10557 => 9497, 10558 => 9498, 10559 => 9499, 10560 => 9500, - 10561 => 9501, 10562 => 9502, 10563 => 9503, 10564 => 9504, 10565 => 9505, - 10566 => 9506, 10567 => 9507, 10568 => 9508, 10569 => 9509, 10570 => 9510, - 10571 => 9511, 10572 => 9512, 10573 => 9513, 10574 => 9514, 10575 => 9515, - 10576 => 9516, 10577 => 9517, 10578 => 9518, 10579 => 9519, 10580 => 9520, - 10581 => 9521, 10582 => 9522, 10583 => 9523, 10584 => 9524, 10585 => 9525, - 10586 => 9526, 10587 => 9527, 10588 => 9528, 10589 => 9529, 10590 => 9530, - 10591 => 9531, 10592 => 9532, 10593 => 9533, 10594 => 9534, 10595 => 9535, - 10596 => 9536, 10597 => 9537, 10598 => 9538, 10599 => 9539, 10600 => 9540, - 10601 => 9541, 10602 => 9542, 10603 => 9543, 10604 => 9544, 10605 => 9545, - 10606 => 9546, 10607 => 9547, 12321 => 21834, 12322 => 38463, 12323 => 22467, - 12324 => 25384, 12325 => 21710, 12326 => 21769, 12327 => 21696, 12328 => 30353, - 12329 => 30284, 12330 => 34108, 12331 => 30702, 12332 => 33406, 12333 => 30861, - 12334 => 29233, 12335 => 38552, 12336 => 38797, 12337 => 27688, 12338 => 23433, - 12339 => 20474, 12340 => 25353, 12341 => 26263, 12342 => 23736, 12343 => 33018, - 12344 => 26696, 12345 => 32942, 12346 => 26114, 12347 => 30414, 12348 => 20985, - 12349 => 25942, 12350 => 29100, 12351 => 32753, 12352 => 34948, 12353 => 20658, - 12354 => 22885, 12355 => 25034, 12356 => 28595, 12357 => 33453, 12358 => 25420, - 12359 => 25170, 12360 => 21485, 12361 => 21543, 12362 => 31494, 12363 => 20843, - 12364 => 30116, 12365 => 24052, 12366 => 25300, 12367 => 36299, 12368 => 38774, - 12369 => 25226, 12370 => 32793, 12371 => 22365, 12372 => 38712, 12373 => 32610, - 12374 => 29240, 12375 => 30333, 12376 => 26575, 12377 => 30334, 12378 => 25670, - 12379 => 20336, 12380 => 36133, 12381 => 25308, 12382 => 31255, 12383 => 26001, - 12384 => 29677, 12385 => 25644, 12386 => 25203, 12387 => 33324, 12388 => 39041, - 12389 => 26495, 12390 => 29256, 12391 => 25198, 12392 => 25292, 12393 => 20276, - 12394 => 29923, 12395 => 21322, 12396 => 21150, 12397 => 32458, 12398 => 37030, - 12399 => 24110, 12400 => 26758, 12401 => 27036, 12402 => 33152, 12403 => 32465, - 12404 => 26834, 12405 => 30917, 12406 => 34444, 12407 => 38225, 12408 => 20621, - 12409 => 35876, 12410 => 33502, 12411 => 32990, 12412 => 21253, 12413 => 35090, - 12414 => 21093, 12577 => 34180, 12578 => 38649, 12579 => 20445, 12580 => 22561, - 12581 => 39281, 12582 => 23453, 12583 => 25265, 12584 => 25253, 12585 => 26292, - 12586 => 35961, 12587 => 40077, 12588 => 29190, 12589 => 26479, 12590 => 30865, - 12591 => 24754, 12592 => 21329, 12593 => 21271, 12594 => 36744, 12595 => 32972, - 12596 => 36125, 12597 => 38049, 12598 => 20493, 12599 => 29384, 12600 => 22791, - 12601 => 24811, 12602 => 28953, 12603 => 34987, 12604 => 22868, 12605 => 33519, - 12606 => 26412, 12607 => 31528, 12608 => 23849, 12609 => 32503, 12610 => 29997, - 12611 => 27893, 12612 => 36454, 12613 => 36856, 12614 => 36924, 12615 => 40763, - 12616 => 27604, 12617 => 37145, 12618 => 31508, 12619 => 24444, 12620 => 30887, - 12621 => 34006, 12622 => 34109, 12623 => 27605, 12624 => 27609, 12625 => 27606, - 12626 => 24065, 12627 => 24199, 12628 => 30201, 12629 => 38381, 12630 => 25949, - 12631 => 24330, 12632 => 24517, 12633 => 36767, 12634 => 22721, 12635 => 33218, - 12636 => 36991, 12637 => 38491, 12638 => 38829, 12639 => 36793, 12640 => 32534, - 12641 => 36140, 12642 => 25153, 12643 => 20415, 12644 => 21464, 12645 => 21342, - 12646 => 36776, 12647 => 36777, 12648 => 36779, 12649 => 36941, 12650 => 26631, - 12651 => 24426, 12652 => 33176, 12653 => 34920, 12654 => 40150, 12655 => 24971, - 12656 => 21035, 12657 => 30250, 12658 => 24428, 12659 => 25996, 12660 => 28626, - 12661 => 28392, 12662 => 23486, 12663 => 25672, 12664 => 20853, 12665 => 20912, - 12666 => 26564, 12667 => 19993, 12668 => 31177, 12669 => 39292, 12670 => 28851, - 12833 => 30149, 12834 => 24182, 12835 => 29627, 12836 => 33760, 12837 => 25773, - 12838 => 25320, 12839 => 38069, 12840 => 27874, 12841 => 21338, 12842 => 21187, - 12843 => 25615, 12844 => 38082, 12845 => 31636, 12846 => 20271, 12847 => 24091, - 12848 => 33334, 12849 => 33046, 12850 => 33162, 12851 => 28196, 12852 => 27850, - 12853 => 39539, 12854 => 25429, 12855 => 21340, 12856 => 21754, 12857 => 34917, - 12858 => 22496, 12859 => 19981, 12860 => 24067, 12861 => 27493, 12862 => 31807, - 12863 => 37096, 12864 => 24598, 12865 => 25830, 12866 => 29468, 12867 => 35009, - 12868 => 26448, 12869 => 25165, 12870 => 36130, 12871 => 30572, 12872 => 36393, - 12873 => 37319, 12874 => 24425, 12875 => 33756, 12876 => 34081, 12877 => 39184, - 12878 => 21442, 12879 => 34453, 12880 => 27531, 12881 => 24813, 12882 => 24808, - 12883 => 28799, 12884 => 33485, 12885 => 33329, 12886 => 20179, 12887 => 27815, - 12888 => 34255, 12889 => 25805, 12890 => 31961, 12891 => 27133, 12892 => 26361, - 12893 => 33609, 12894 => 21397, 12895 => 31574, 12896 => 20391, 12897 => 20876, - 12898 => 27979, 12899 => 23618, 12900 => 36461, 12901 => 25554, 12902 => 21449, - 12903 => 33580, 12904 => 33590, 12905 => 26597, 12906 => 30900, 12907 => 25661, - 12908 => 23519, 12909 => 23700, 12910 => 24046, 12911 => 35815, 12912 => 25286, - 12913 => 26612, 12914 => 35962, 12915 => 25600, 12916 => 25530, 12917 => 34633, - 12918 => 39307, 12919 => 35863, 12920 => 32544, 12921 => 38130, 12922 => 20135, - 12923 => 38416, 12924 => 39076, 12925 => 26124, 12926 => 29462, 13089 => 22330, - 13090 => 23581, 13091 => 24120, 13092 => 38271, 13093 => 20607, 13094 => 32928, - 13095 => 21378, 13096 => 25950, 13097 => 30021, 13098 => 21809, 13099 => 20513, - 13100 => 36229, 13101 => 25220, 13102 => 38046, 13103 => 26397, 13104 => 22066, - 13105 => 28526, 13106 => 24034, 13107 => 21557, 13108 => 28818, 13109 => 36710, - 13110 => 25199, 13111 => 25764, 13112 => 25507, 13113 => 24443, 13114 => 28552, - 13115 => 37108, 13116 => 33251, 13117 => 36784, 13118 => 23576, 13119 => 26216, - 13120 => 24561, 13121 => 27785, 13122 => 38472, 13123 => 36225, 13124 => 34924, - 13125 => 25745, 13126 => 31216, 13127 => 22478, 13128 => 27225, 13129 => 25104, - 13130 => 21576, 13131 => 20056, 13132 => 31243, 13133 => 24809, 13134 => 28548, - 13135 => 35802, 13136 => 25215, 13137 => 36894, 13138 => 39563, 13139 => 31204, - 13140 => 21507, 13141 => 30196, 13142 => 25345, 13143 => 21273, 13144 => 27744, - 13145 => 36831, 13146 => 24347, 13147 => 39536, 13148 => 32827, 13149 => 40831, - 13150 => 20360, 13151 => 23610, 13152 => 36196, 13153 => 32709, 13154 => 26021, - 13155 => 28861, 13156 => 20805, 13157 => 20914, 13158 => 34411, 13159 => 23815, - 13160 => 23456, 13161 => 25277, 13162 => 37228, 13163 => 30068, 13164 => 36364, - 13165 => 31264, 13166 => 24833, 13167 => 31609, 13168 => 20167, 13169 => 32504, - 13170 => 30597, 13171 => 19985, 13172 => 33261, 13173 => 21021, 13174 => 20986, - 13175 => 27249, 13176 => 21416, 13177 => 36487, 13178 => 38148, 13179 => 38607, - 13180 => 28353, 13181 => 38500, 13182 => 26970, 13345 => 30784, 13346 => 20648, - 13347 => 30679, 13348 => 25616, 13349 => 35302, 13350 => 22788, 13351 => 25571, - 13352 => 24029, 13353 => 31359, 13354 => 26941, 13355 => 20256, 13356 => 33337, - 13357 => 21912, 13358 => 20018, 13359 => 30126, 13360 => 31383, 13361 => 24162, - 13362 => 24202, 13363 => 38383, 13364 => 21019, 13365 => 21561, 13366 => 28810, - 13367 => 25462, 13368 => 38180, 13369 => 22402, 13370 => 26149, 13371 => 26943, - 13372 => 37255, 13373 => 21767, 13374 => 28147, 13375 => 32431, 13376 => 34850, - 13377 => 25139, 13378 => 32496, 13379 => 30133, 13380 => 33576, 13381 => 30913, - 13382 => 38604, 13383 => 36766, 13384 => 24904, 13385 => 29943, 13386 => 35789, - 13387 => 27492, 13388 => 21050, 13389 => 36176, 13390 => 27425, 13391 => 32874, - 13392 => 33905, 13393 => 22257, 13394 => 21254, 13395 => 20174, 13396 => 19995, - 13397 => 20945, 13398 => 31895, 13399 => 37259, 13400 => 31751, 13401 => 20419, - 13402 => 36479, 13403 => 31713, 13404 => 31388, 13405 => 25703, 13406 => 23828, - 13407 => 20652, 13408 => 33030, 13409 => 30209, 13410 => 31929, 13411 => 28140, - 13412 => 32736, 13413 => 26449, 13414 => 23384, 13415 => 23544, 13416 => 30923, - 13417 => 25774, 13418 => 25619, 13419 => 25514, 13420 => 25387, 13421 => 38169, - 13422 => 25645, 13423 => 36798, 13424 => 31572, 13425 => 30249, 13426 => 25171, - 13427 => 22823, 13428 => 21574, 13429 => 27513, 13430 => 20643, 13431 => 25140, - 13432 => 24102, 13433 => 27526, 13434 => 20195, 13435 => 36151, 13436 => 34955, - 13437 => 24453, 13438 => 36910, 13601 => 24608, 13602 => 32829, 13603 => 25285, - 13604 => 20025, 13605 => 21333, 13606 => 37112, 13607 => 25528, 13608 => 32966, - 13609 => 26086, 13610 => 27694, 13611 => 20294, 13612 => 24814, 13613 => 28129, - 13614 => 35806, 13615 => 24377, 13616 => 34507, 13617 => 24403, 13618 => 25377, - 13619 => 20826, 13620 => 33633, 13621 => 26723, 13622 => 20992, 13623 => 25443, - 13624 => 36424, 13625 => 20498, 13626 => 23707, 13627 => 31095, 13628 => 23548, - 13629 => 21040, 13630 => 31291, 13631 => 24764, 13632 => 36947, 13633 => 30423, - 13634 => 24503, 13635 => 24471, 13636 => 30340, 13637 => 36460, 13638 => 28783, - 13639 => 30331, 13640 => 31561, 13641 => 30634, 13642 => 20979, 13643 => 37011, - 13644 => 22564, 13645 => 20302, 13646 => 28404, 13647 => 36842, 13648 => 25932, - 13649 => 31515, 13650 => 29380, 13651 => 28068, 13652 => 32735, 13653 => 23265, - 13654 => 25269, 13655 => 24213, 13656 => 22320, 13657 => 33922, 13658 => 31532, - 13659 => 24093, 13660 => 24351, 13661 => 36882, 13662 => 32532, 13663 => 39072, - 13664 => 25474, 13665 => 28359, 13666 => 30872, 13667 => 28857, 13668 => 20856, - 13669 => 38747, 13670 => 22443, 13671 => 30005, 13672 => 20291, 13673 => 30008, - 13674 => 24215, 13675 => 24806, 13676 => 22880, 13677 => 28096, 13678 => 27583, - 13679 => 30857, 13680 => 21500, 13681 => 38613, 13682 => 20939, 13683 => 20993, - 13684 => 25481, 13685 => 21514, 13686 => 38035, 13687 => 35843, 13688 => 36300, - 13689 => 29241, 13690 => 30879, 13691 => 34678, 13692 => 36845, 13693 => 35853, - 13694 => 21472, 13857 => 19969, 13858 => 30447, 13859 => 21486, 13860 => 38025, - 13861 => 39030, 13862 => 40718, 13863 => 38189, 13864 => 23450, 13865 => 35746, - 13866 => 20002, 13867 => 19996, 13868 => 20908, 13869 => 33891, 13870 => 25026, - 13871 => 21160, 13872 => 26635, 13873 => 20375, 13874 => 24683, 13875 => 20923, - 13876 => 27934, 13877 => 20828, 13878 => 25238, 13879 => 26007, 13880 => 38497, - 13881 => 35910, 13882 => 36887, 13883 => 30168, 13884 => 37117, 13885 => 30563, - 13886 => 27602, 13887 => 29322, 13888 => 29420, 13889 => 35835, 13890 => 22581, - 13891 => 30585, 13892 => 36172, 13893 => 26460, 13894 => 38208, 13895 => 32922, - 13896 => 24230, 13897 => 28193, 13898 => 22930, 13899 => 31471, 13900 => 30701, - 13901 => 38203, 13902 => 27573, 13903 => 26029, 13904 => 32526, 13905 => 22534, - 13906 => 20817, 13907 => 38431, 13908 => 23545, 13909 => 22697, 13910 => 21544, - 13911 => 36466, 13912 => 25958, 13913 => 39039, 13914 => 22244, 13915 => 38045, - 13916 => 30462, 13917 => 36929, 13918 => 25479, 13919 => 21702, 13920 => 22810, - 13921 => 22842, 13922 => 22427, 13923 => 36530, 13924 => 26421, 13925 => 36346, - 13926 => 33333, 13927 => 21057, 13928 => 24816, 13929 => 22549, 13930 => 34558, - 13931 => 23784, 13932 => 40517, 13933 => 20420, 13934 => 39069, 13935 => 35769, - 13936 => 23077, 13937 => 24694, 13938 => 21380, 13939 => 25212, 13940 => 36943, - 13941 => 37122, 13942 => 39295, 13943 => 24681, 13944 => 32780, 13945 => 20799, - 13946 => 32819, 13947 => 23572, 13948 => 39285, 13949 => 27953, 13950 => 20108, - 14113 => 36144, 14114 => 21457, 14115 => 32602, 14116 => 31567, 14117 => 20240, - 14118 => 20047, 14119 => 38400, 14120 => 27861, 14121 => 29648, 14122 => 34281, - 14123 => 24070, 14124 => 30058, 14125 => 32763, 14126 => 27146, 14127 => 30718, - 14128 => 38034, 14129 => 32321, 14130 => 20961, 14131 => 28902, 14132 => 21453, - 14133 => 36820, 14134 => 33539, 14135 => 36137, 14136 => 29359, 14137 => 39277, - 14138 => 27867, 14139 => 22346, 14140 => 33459, 14141 => 26041, 14142 => 32938, - 14143 => 25151, 14144 => 38450, 14145 => 22952, 14146 => 20223, 14147 => 35775, - 14148 => 32442, 14149 => 25918, 14150 => 33778, 14151 => 38750, 14152 => 21857, - 14153 => 39134, 14154 => 32933, 14155 => 21290, 14156 => 35837, 14157 => 21536, - 14158 => 32954, 14159 => 24223, 14160 => 27832, 14161 => 36153, 14162 => 33452, - 14163 => 37210, 14164 => 21545, 14165 => 27675, 14166 => 20998, 14167 => 32439, - 14168 => 22367, 14169 => 28954, 14170 => 27774, 14171 => 31881, 14172 => 22859, - 14173 => 20221, 14174 => 24575, 14175 => 24868, 14176 => 31914, 14177 => 20016, - 14178 => 23553, 14179 => 26539, 14180 => 34562, 14181 => 23792, 14182 => 38155, - 14183 => 39118, 14184 => 30127, 14185 => 28925, 14186 => 36898, 14187 => 20911, - 14188 => 32541, 14189 => 35773, 14190 => 22857, 14191 => 20964, 14192 => 20315, - 14193 => 21542, 14194 => 22827, 14195 => 25975, 14196 => 32932, 14197 => 23413, - 14198 => 25206, 14199 => 25282, 14200 => 36752, 14201 => 24133, 14202 => 27679, - 14203 => 31526, 14204 => 20239, 14205 => 20440, 14206 => 26381, 14369 => 28014, - 14370 => 28074, 14371 => 31119, 14372 => 34993, 14373 => 24343, 14374 => 29995, - 14375 => 25242, 14376 => 36741, 14377 => 20463, 14378 => 37340, 14379 => 26023, - 14380 => 33071, 14381 => 33105, 14382 => 24220, 14383 => 33104, 14384 => 36212, - 14385 => 21103, 14386 => 35206, 14387 => 36171, 14388 => 22797, 14389 => 20613, - 14390 => 20184, 14391 => 38428, 14392 => 29238, 14393 => 33145, 14394 => 36127, - 14395 => 23500, 14396 => 35747, 14397 => 38468, 14398 => 22919, 14399 => 32538, - 14400 => 21648, 14401 => 22134, 14402 => 22030, 14403 => 35813, 14404 => 25913, - 14405 => 27010, 14406 => 38041, 14407 => 30422, 14408 => 28297, 14409 => 24178, - 14410 => 29976, 14411 => 26438, 14412 => 26577, 14413 => 31487, 14414 => 32925, - 14415 => 36214, 14416 => 24863, 14417 => 31174, 14418 => 25954, 14419 => 36195, - 14420 => 20872, 14421 => 21018, 14422 => 38050, 14423 => 32568, 14424 => 32923, - 14425 => 32434, 14426 => 23703, 14427 => 28207, 14428 => 26464, 14429 => 31705, - 14430 => 30347, 14431 => 39640, 14432 => 33167, 14433 => 32660, 14434 => 31957, - 14435 => 25630, 14436 => 38224, 14437 => 31295, 14438 => 21578, 14439 => 21733, - 14440 => 27468, 14441 => 25601, 14442 => 25096, 14443 => 40509, 14444 => 33011, - 14445 => 30105, 14446 => 21106, 14447 => 38761, 14448 => 33883, 14449 => 26684, - 14450 => 34532, 14451 => 38401, 14452 => 38548, 14453 => 38124, 14454 => 20010, - 14455 => 21508, 14456 => 32473, 14457 => 26681, 14458 => 36319, 14459 => 32789, - 14460 => 26356, 14461 => 24218, 14462 => 32697, 14625 => 22466, 14626 => 32831, - 14627 => 26775, 14628 => 24037, 14629 => 25915, 14630 => 21151, 14631 => 24685, - 14632 => 40858, 14633 => 20379, 14634 => 36524, 14635 => 20844, 14636 => 23467, - 14637 => 24339, 14638 => 24041, 14639 => 27742, 14640 => 25329, 14641 => 36129, - 14642 => 20849, 14643 => 38057, 14644 => 21246, 14645 => 27807, 14646 => 33503, - 14647 => 29399, 14648 => 22434, 14649 => 26500, 14650 => 36141, 14651 => 22815, - 14652 => 36764, 14653 => 33735, 14654 => 21653, 14655 => 31629, 14656 => 20272, - 14657 => 27837, 14658 => 23396, 14659 => 22993, 14660 => 40723, 14661 => 21476, - 14662 => 34506, 14663 => 39592, 14664 => 35895, 14665 => 32929, 14666 => 25925, - 14667 => 39038, 14668 => 22266, 14669 => 38599, 14670 => 21038, 14671 => 29916, - 14672 => 21072, 14673 => 23521, 14674 => 25346, 14675 => 35074, 14676 => 20054, - 14677 => 25296, 14678 => 24618, 14679 => 26874, 14680 => 20851, 14681 => 23448, - 14682 => 20896, 14683 => 35266, 14684 => 31649, 14685 => 39302, 14686 => 32592, - 14687 => 24815, 14688 => 28748, 14689 => 36143, 14690 => 20809, 14691 => 24191, - 14692 => 36891, 14693 => 29808, 14694 => 35268, 14695 => 22317, 14696 => 30789, - 14697 => 24402, 14698 => 40863, 14699 => 38394, 14700 => 36712, 14701 => 39740, - 14702 => 35809, 14703 => 30328, 14704 => 26690, 14705 => 26588, 14706 => 36330, - 14707 => 36149, 14708 => 21053, 14709 => 36746, 14710 => 28378, 14711 => 26829, - 14712 => 38149, 14713 => 37101, 14714 => 22269, 14715 => 26524, 14716 => 35065, - 14717 => 36807, 14718 => 21704, 14881 => 39608, 14882 => 23401, 14883 => 28023, - 14884 => 27686, 14885 => 20133, 14886 => 23475, 14887 => 39559, 14888 => 37219, - 14889 => 25000, 14890 => 37039, 14891 => 38889, 14892 => 21547, 14893 => 28085, - 14894 => 23506, 14895 => 20989, 14896 => 21898, 14897 => 32597, 14898 => 32752, - 14899 => 25788, 14900 => 25421, 14901 => 26097, 14902 => 25022, 14903 => 24717, - 14904 => 28938, 14905 => 27735, 14906 => 27721, 14907 => 22831, 14908 => 26477, - 14909 => 33322, 14910 => 22741, 14911 => 22158, 14912 => 35946, 14913 => 27627, - 14914 => 37085, 14915 => 22909, 14916 => 32791, 14917 => 21495, 14918 => 28009, - 14919 => 21621, 14920 => 21917, 14921 => 33655, 14922 => 33743, 14923 => 26680, - 14924 => 31166, 14925 => 21644, 14926 => 20309, 14927 => 21512, 14928 => 30418, - 14929 => 35977, 14930 => 38402, 14931 => 27827, 14932 => 28088, 14933 => 36203, - 14934 => 35088, 14935 => 40548, 14936 => 36154, 14937 => 22079, 14938 => 40657, - 14939 => 30165, 14940 => 24456, 14941 => 29408, 14942 => 24680, 14943 => 21756, - 14944 => 20136, 14945 => 27178, 14946 => 34913, 14947 => 24658, 14948 => 36720, - 14949 => 21700, 14950 => 28888, 14951 => 34425, 14952 => 40511, 14953 => 27946, - 14954 => 23439, 14955 => 24344, 14956 => 32418, 14957 => 21897, 14958 => 20399, - 14959 => 29492, 14960 => 21564, 14961 => 21402, 14962 => 20505, 14963 => 21518, - 14964 => 21628, 14965 => 20046, 14966 => 24573, 14967 => 29786, 14968 => 22774, - 14969 => 33899, 14970 => 32993, 14971 => 34676, 14972 => 29392, 14973 => 31946, - 14974 => 28246, 15137 => 24359, 15138 => 34382, 15139 => 21804, 15140 => 25252, - 15141 => 20114, 15142 => 27818, 15143 => 25143, 15144 => 33457, 15145 => 21719, - 15146 => 21326, 15147 => 29502, 15148 => 28369, 15149 => 30011, 15150 => 21010, - 15151 => 21270, 15152 => 35805, 15153 => 27088, 15154 => 24458, 15155 => 24576, - 15156 => 28142, 15157 => 22351, 15158 => 27426, 15159 => 29615, 15160 => 26707, - 15161 => 36824, 15162 => 32531, 15163 => 25442, 15164 => 24739, 15165 => 21796, - 15166 => 30186, 15167 => 35938, 15168 => 28949, 15169 => 28067, 15170 => 23462, - 15171 => 24187, 15172 => 33618, 15173 => 24908, 15174 => 40644, 15175 => 30970, - 15176 => 34647, 15177 => 31783, 15178 => 30343, 15179 => 20976, 15180 => 24822, - 15181 => 29004, 15182 => 26179, 15183 => 24140, 15184 => 24653, 15185 => 35854, - 15186 => 28784, 15187 => 25381, 15188 => 36745, 15189 => 24509, 15190 => 24674, - 15191 => 34516, 15192 => 22238, 15193 => 27585, 15194 => 24724, 15195 => 24935, - 15196 => 21321, 15197 => 24800, 15198 => 26214, 15199 => 36159, 15200 => 31229, - 15201 => 20250, 15202 => 28905, 15203 => 27719, 15204 => 35763, 15205 => 35826, - 15206 => 32472, 15207 => 33636, 15208 => 26127, 15209 => 23130, 15210 => 39746, - 15211 => 27985, 15212 => 28151, 15213 => 35905, 15214 => 27963, 15215 => 20249, - 15216 => 28779, 15217 => 33719, 15218 => 25110, 15219 => 24785, 15220 => 38669, - 15221 => 36135, 15222 => 31096, 15223 => 20987, 15224 => 22334, 15225 => 22522, - 15226 => 26426, 15227 => 30072, 15228 => 31293, 15229 => 31215, 15230 => 31637, - 15393 => 32908, 15394 => 39269, 15395 => 36857, 15396 => 28608, 15397 => 35749, - 15398 => 40481, 15399 => 23020, 15400 => 32489, 15401 => 32521, 15402 => 21513, - 15403 => 26497, 15404 => 26840, 15405 => 36753, 15406 => 31821, 15407 => 38598, - 15408 => 21450, 15409 => 24613, 15410 => 30142, 15411 => 27762, 15412 => 21363, - 15413 => 23241, 15414 => 32423, 15415 => 25380, 15416 => 20960, 15417 => 33034, - 15418 => 24049, 15419 => 34015, 15420 => 25216, 15421 => 20864, 15422 => 23395, - 15423 => 20238, 15424 => 31085, 15425 => 21058, 15426 => 24760, 15427 => 27982, - 15428 => 23492, 15429 => 23490, 15430 => 35745, 15431 => 35760, 15432 => 26082, - 15433 => 24524, 15434 => 38469, 15435 => 22931, 15436 => 32487, 15437 => 32426, - 15438 => 22025, 15439 => 26551, 15440 => 22841, 15441 => 20339, 15442 => 23478, - 15443 => 21152, 15444 => 33626, 15445 => 39050, 15446 => 36158, 15447 => 30002, - 15448 => 38078, 15449 => 20551, 15450 => 31292, 15451 => 20215, 15452 => 26550, - 15453 => 39550, 15454 => 23233, 15455 => 27516, 15456 => 30417, 15457 => 22362, - 15458 => 23574, 15459 => 31546, 15460 => 38388, 15461 => 29006, 15462 => 20860, - 15463 => 32937, 15464 => 33392, 15465 => 22904, 15466 => 32516, 15467 => 33575, - 15468 => 26816, 15469 => 26604, 15470 => 30897, 15471 => 30839, 15472 => 25315, - 15473 => 25441, 15474 => 31616, 15475 => 20461, 15476 => 21098, 15477 => 20943, - 15478 => 33616, 15479 => 27099, 15480 => 37492, 15481 => 36341, 15482 => 36145, - 15483 => 35265, 15484 => 38190, 15485 => 31661, 15486 => 20214, 15649 => 20581, - 15650 => 33328, 15651 => 21073, 15652 => 39279, 15653 => 28176, 15654 => 28293, - 15655 => 28071, 15656 => 24314, 15657 => 20725, 15658 => 23004, 15659 => 23558, - 15660 => 27974, 15661 => 27743, 15662 => 30086, 15663 => 33931, 15664 => 26728, - 15665 => 22870, 15666 => 35762, 15667 => 21280, 15668 => 37233, 15669 => 38477, - 15670 => 34121, 15671 => 26898, 15672 => 30977, 15673 => 28966, 15674 => 33014, - 15675 => 20132, 15676 => 37066, 15677 => 27975, 15678 => 39556, 15679 => 23047, - 15680 => 22204, 15681 => 25605, 15682 => 38128, 15683 => 30699, 15684 => 20389, - 15685 => 33050, 15686 => 29409, 15687 => 35282, 15688 => 39290, 15689 => 32564, - 15690 => 32478, 15691 => 21119, 15692 => 25945, 15693 => 37237, 15694 => 36735, - 15695 => 36739, 15696 => 21483, 15697 => 31382, 15698 => 25581, 15699 => 25509, - 15700 => 30342, 15701 => 31224, 15702 => 34903, 15703 => 38454, 15704 => 25130, - 15705 => 21163, 15706 => 33410, 15707 => 26708, 15708 => 26480, 15709 => 25463, - 15710 => 30571, 15711 => 31469, 15712 => 27905, 15713 => 32467, 15714 => 35299, - 15715 => 22992, 15716 => 25106, 15717 => 34249, 15718 => 33445, 15719 => 30028, - 15720 => 20511, 15721 => 20171, 15722 => 30117, 15723 => 35819, 15724 => 23626, - 15725 => 24062, 15726 => 31563, 15727 => 26020, 15728 => 37329, 15729 => 20170, - 15730 => 27941, 15731 => 35167, 15732 => 32039, 15733 => 38182, 15734 => 20165, - 15735 => 35880, 15736 => 36827, 15737 => 38771, 15738 => 26187, 15739 => 31105, - 15740 => 36817, 15741 => 28908, 15742 => 28024, 15905 => 23613, 15906 => 21170, - 15907 => 33606, 15908 => 20834, 15909 => 33550, 15910 => 30555, 15911 => 26230, - 15912 => 40120, 15913 => 20140, 15914 => 24778, 15915 => 31934, 15916 => 31923, - 15917 => 32463, 15918 => 20117, 15919 => 35686, 15920 => 26223, 15921 => 39048, - 15922 => 38745, 15923 => 22659, 15924 => 25964, 15925 => 38236, 15926 => 24452, - 15927 => 30153, 15928 => 38742, 15929 => 31455, 15930 => 31454, 15931 => 20928, - 15932 => 28847, 15933 => 31384, 15934 => 25578, 15935 => 31350, 15936 => 32416, - 15937 => 29590, 15938 => 38893, 15939 => 20037, 15940 => 28792, 15941 => 20061, - 15942 => 37202, 15943 => 21417, 15944 => 25937, 15945 => 26087, 15946 => 33276, - 15947 => 33285, 15948 => 21646, 15949 => 23601, 15950 => 30106, 15951 => 38816, - 15952 => 25304, 15953 => 29401, 15954 => 30141, 15955 => 23621, 15956 => 39545, - 15957 => 33738, 15958 => 23616, 15959 => 21632, 15960 => 30697, 15961 => 20030, - 15962 => 27822, 15963 => 32858, 15964 => 25298, 15965 => 25454, 15966 => 24040, - 15967 => 20855, 15968 => 36317, 15969 => 36382, 15970 => 38191, 15971 => 20465, - 15972 => 21477, 15973 => 24807, 15974 => 28844, 15975 => 21095, 15976 => 25424, - 15977 => 40515, 15978 => 23071, 15979 => 20518, 15980 => 30519, 15981 => 21367, - 15982 => 32482, 15983 => 25733, 15984 => 25899, 15985 => 25225, 15986 => 25496, - 15987 => 20500, 15988 => 29237, 15989 => 35273, 15990 => 20915, 15991 => 35776, - 15992 => 32477, 15993 => 22343, 15994 => 33740, 15995 => 38055, 15996 => 20891, - 15997 => 21531, 15998 => 23803, 16161 => 20426, 16162 => 31459, 16163 => 27994, - 16164 => 37089, 16165 => 39567, 16166 => 21888, 16167 => 21654, 16168 => 21345, - 16169 => 21679, 16170 => 24320, 16171 => 25577, 16172 => 26999, 16173 => 20975, - 16174 => 24936, 16175 => 21002, 16176 => 22570, 16177 => 21208, 16178 => 22350, - 16179 => 30733, 16180 => 30475, 16181 => 24247, 16182 => 24951, 16183 => 31968, - 16184 => 25179, 16185 => 25239, 16186 => 20130, 16187 => 28821, 16188 => 32771, - 16189 => 25335, 16190 => 28900, 16191 => 38752, 16192 => 22391, 16193 => 33499, - 16194 => 26607, 16195 => 26869, 16196 => 30933, 16197 => 39063, 16198 => 31185, - 16199 => 22771, 16200 => 21683, 16201 => 21487, 16202 => 28212, 16203 => 20811, - 16204 => 21051, 16205 => 23458, 16206 => 35838, 16207 => 32943, 16208 => 21827, - 16209 => 22438, 16210 => 24691, 16211 => 22353, 16212 => 21549, 16213 => 31354, - 16214 => 24656, 16215 => 23380, 16216 => 25511, 16217 => 25248, 16218 => 21475, - 16219 => 25187, 16220 => 23495, 16221 => 26543, 16222 => 21741, 16223 => 31391, - 16224 => 33510, 16225 => 37239, 16226 => 24211, 16227 => 35044, 16228 => 22840, - 16229 => 22446, 16230 => 25358, 16231 => 36328, 16232 => 33007, 16233 => 22359, - 16234 => 31607, 16235 => 20393, 16236 => 24555, 16237 => 23485, 16238 => 27454, - 16239 => 21281, 16240 => 31568, 16241 => 29378, 16242 => 26694, 16243 => 30719, - 16244 => 30518, 16245 => 26103, 16246 => 20917, 16247 => 20111, 16248 => 30420, - 16249 => 23743, 16250 => 31397, 16251 => 33909, 16252 => 22862, 16253 => 39745, - 16254 => 20608, 16417 => 39304, 16418 => 24871, 16419 => 28291, 16420 => 22372, - 16421 => 26118, 16422 => 25414, 16423 => 22256, 16424 => 25324, 16425 => 25193, - 16426 => 24275, 16427 => 38420, 16428 => 22403, 16429 => 25289, 16430 => 21895, - 16431 => 34593, 16432 => 33098, 16433 => 36771, 16434 => 21862, 16435 => 33713, - 16436 => 26469, 16437 => 36182, 16438 => 34013, 16439 => 23146, 16440 => 26639, - 16441 => 25318, 16442 => 31726, 16443 => 38417, 16444 => 20848, 16445 => 28572, - 16446 => 35888, 16447 => 25597, 16448 => 35272, 16449 => 25042, 16450 => 32518, - 16451 => 28866, 16452 => 28389, 16453 => 29701, 16454 => 27028, 16455 => 29436, - 16456 => 24266, 16457 => 37070, 16458 => 26391, 16459 => 28010, 16460 => 25438, - 16461 => 21171, 16462 => 29282, 16463 => 32769, 16464 => 20332, 16465 => 23013, - 16466 => 37226, 16467 => 28889, 16468 => 28061, 16469 => 21202, 16470 => 20048, - 16471 => 38647, 16472 => 38253, 16473 => 34174, 16474 => 30922, 16475 => 32047, - 16476 => 20769, 16477 => 22418, 16478 => 25794, 16479 => 32907, 16480 => 31867, - 16481 => 27882, 16482 => 26865, 16483 => 26974, 16484 => 20919, 16485 => 21400, - 16486 => 26792, 16487 => 29313, 16488 => 40654, 16489 => 31729, 16490 => 29432, - 16491 => 31163, 16492 => 28435, 16493 => 29702, 16494 => 26446, 16495 => 37324, - 16496 => 40100, 16497 => 31036, 16498 => 33673, 16499 => 33620, 16500 => 21519, - 16501 => 26647, 16502 => 20029, 16503 => 21385, 16504 => 21169, 16505 => 30782, - 16506 => 21382, 16507 => 21033, 16508 => 20616, 16509 => 20363, 16510 => 20432, - 16673 => 30178, 16674 => 31435, 16675 => 31890, 16676 => 27813, 16677 => 38582, - 16678 => 21147, 16679 => 29827, 16680 => 21737, 16681 => 20457, 16682 => 32852, - 16683 => 33714, 16684 => 36830, 16685 => 38256, 16686 => 24265, 16687 => 24604, - 16688 => 28063, 16689 => 24088, 16690 => 25947, 16691 => 33080, 16692 => 38142, - 16693 => 24651, 16694 => 28860, 16695 => 32451, 16696 => 31918, 16697 => 20937, - 16698 => 26753, 16699 => 31921, 16700 => 33391, 16701 => 20004, 16702 => 36742, - 16703 => 37327, 16704 => 26238, 16705 => 20142, 16706 => 35845, 16707 => 25769, - 16708 => 32842, 16709 => 20698, 16710 => 30103, 16711 => 29134, 16712 => 23525, - 16713 => 36797, 16714 => 28518, 16715 => 20102, 16716 => 25730, 16717 => 38243, - 16718 => 24278, 16719 => 26009, 16720 => 21015, 16721 => 35010, 16722 => 28872, - 16723 => 21155, 16724 => 29454, 16725 => 29747, 16726 => 26519, 16727 => 30967, - 16728 => 38678, 16729 => 20020, 16730 => 37051, 16731 => 40158, 16732 => 28107, - 16733 => 20955, 16734 => 36161, 16735 => 21533, 16736 => 25294, 16737 => 29618, - 16738 => 33777, 16739 => 38646, 16740 => 40836, 16741 => 38083, 16742 => 20278, - 16743 => 32666, 16744 => 20940, 16745 => 28789, 16746 => 38517, 16747 => 23725, - 16748 => 39046, 16749 => 21478, 16750 => 20196, 16751 => 28316, 16752 => 29705, - 16753 => 27060, 16754 => 30827, 16755 => 39311, 16756 => 30041, 16757 => 21016, - 16758 => 30244, 16759 => 27969, 16760 => 26611, 16761 => 20845, 16762 => 40857, - 16763 => 32843, 16764 => 21657, 16765 => 31548, 16766 => 31423, 16929 => 38534, - 16930 => 22404, 16931 => 25314, 16932 => 38471, 16933 => 27004, 16934 => 23044, - 16935 => 25602, 16936 => 31699, 16937 => 28431, 16938 => 38475, 16939 => 33446, - 16940 => 21346, 16941 => 39045, 16942 => 24208, 16943 => 28809, 16944 => 25523, - 16945 => 21348, 16946 => 34383, 16947 => 40065, 16948 => 40595, 16949 => 30860, - 16950 => 38706, 16951 => 36335, 16952 => 36162, 16953 => 40575, 16954 => 28510, - 16955 => 31108, 16956 => 24405, 16957 => 38470, 16958 => 25134, 16959 => 39540, - 16960 => 21525, 16961 => 38109, 16962 => 20387, 16963 => 26053, 16964 => 23653, - 16965 => 23649, 16966 => 32533, 16967 => 34385, 16968 => 27695, 16969 => 24459, - 16970 => 29575, 16971 => 28388, 16972 => 32511, 16973 => 23782, 16974 => 25371, - 16975 => 23402, 16976 => 28390, 16977 => 21365, 16978 => 20081, 16979 => 25504, - 16980 => 30053, 16981 => 25249, 16982 => 36718, 16983 => 20262, 16984 => 20177, - 16985 => 27814, 16986 => 32438, 16987 => 35770, 16988 => 33821, 16989 => 34746, - 16990 => 32599, 16991 => 36923, 16992 => 38179, 16993 => 31657, 16994 => 39585, - 16995 => 35064, 16996 => 33853, 16997 => 27931, 16998 => 39558, 16999 => 32476, - 17000 => 22920, 17001 => 40635, 17002 => 29595, 17003 => 30721, 17004 => 34434, - 17005 => 39532, 17006 => 39554, 17007 => 22043, 17008 => 21527, 17009 => 22475, - 17010 => 20080, 17011 => 40614, 17012 => 21334, 17013 => 36808, 17014 => 33033, - 17015 => 30610, 17016 => 39314, 17017 => 34542, 17018 => 28385, 17019 => 34067, - 17020 => 26364, 17021 => 24930, 17022 => 28459, 17185 => 35881, 17186 => 33426, - 17187 => 33579, 17188 => 30450, 17189 => 27667, 17190 => 24537, 17191 => 33725, - 17192 => 29483, 17193 => 33541, 17194 => 38170, 17195 => 27611, 17196 => 30683, - 17197 => 38086, 17198 => 21359, 17199 => 33538, 17200 => 20882, 17201 => 24125, - 17202 => 35980, 17203 => 36152, 17204 => 20040, 17205 => 29611, 17206 => 26522, - 17207 => 26757, 17208 => 37238, 17209 => 38665, 17210 => 29028, 17211 => 27809, - 17212 => 30473, 17213 => 23186, 17214 => 38209, 17215 => 27599, 17216 => 32654, - 17217 => 26151, 17218 => 23504, 17219 => 22969, 17220 => 23194, 17221 => 38376, - 17222 => 38391, 17223 => 20204, 17224 => 33804, 17225 => 33945, 17226 => 27308, - 17227 => 30431, 17228 => 38192, 17229 => 29467, 17230 => 26790, 17231 => 23391, - 17232 => 30511, 17233 => 37274, 17234 => 38753, 17235 => 31964, 17236 => 36855, - 17237 => 35868, 17238 => 24357, 17239 => 31859, 17240 => 31192, 17241 => 35269, - 17242 => 27852, 17243 => 34588, 17244 => 23494, 17245 => 24130, 17246 => 26825, - 17247 => 30496, 17248 => 32501, 17249 => 20885, 17250 => 20813, 17251 => 21193, - 17252 => 23081, 17253 => 32517, 17254 => 38754, 17255 => 33495, 17256 => 25551, - 17257 => 30596, 17258 => 34256, 17259 => 31186, 17260 => 28218, 17261 => 24217, - 17262 => 22937, 17263 => 34065, 17264 => 28781, 17265 => 27665, 17266 => 25279, - 17267 => 30399, 17268 => 25935, 17269 => 24751, 17270 => 38397, 17271 => 26126, - 17272 => 34719, 17273 => 40483, 17274 => 38125, 17275 => 21517, 17276 => 21629, - 17277 => 35884, 17278 => 25720, 17441 => 25721, 17442 => 34321, 17443 => 27169, - 17444 => 33180, 17445 => 30952, 17446 => 25705, 17447 => 39764, 17448 => 25273, - 17449 => 26411, 17450 => 33707, 17451 => 22696, 17452 => 40664, 17453 => 27819, - 17454 => 28448, 17455 => 23518, 17456 => 38476, 17457 => 35851, 17458 => 29279, - 17459 => 26576, 17460 => 25287, 17461 => 29281, 17462 => 20137, 17463 => 22982, - 17464 => 27597, 17465 => 22675, 17466 => 26286, 17467 => 24149, 17468 => 21215, - 17469 => 24917, 17470 => 26408, 17471 => 30446, 17472 => 30566, 17473 => 29287, - 17474 => 31302, 17475 => 25343, 17476 => 21738, 17477 => 21584, 17478 => 38048, - 17479 => 37027, 17480 => 23068, 17481 => 32435, 17482 => 27670, 17483 => 20035, - 17484 => 22902, 17485 => 32784, 17486 => 22856, 17487 => 21335, 17488 => 30007, - 17489 => 38590, 17490 => 22218, 17491 => 25376, 17492 => 33041, 17493 => 24700, - 17494 => 38393, 17495 => 28118, 17496 => 21602, 17497 => 39297, 17498 => 20869, - 17499 => 23273, 17500 => 33021, 17501 => 22958, 17502 => 38675, 17503 => 20522, - 17504 => 27877, 17505 => 23612, 17506 => 25311, 17507 => 20320, 17508 => 21311, - 17509 => 33147, 17510 => 36870, 17511 => 28346, 17512 => 34091, 17513 => 25288, - 17514 => 24180, 17515 => 30910, 17516 => 25781, 17517 => 25467, 17518 => 24565, - 17519 => 23064, 17520 => 37247, 17521 => 40479, 17522 => 23615, 17523 => 25423, - 17524 => 32834, 17525 => 23421, 17526 => 21870, 17527 => 38218, 17528 => 38221, - 17529 => 28037, 17530 => 24744, 17531 => 26592, 17532 => 29406, 17533 => 20957, - 17534 => 23425, 17697 => 25319, 17698 => 27870, 17699 => 29275, 17700 => 25197, - 17701 => 38062, 17702 => 32445, 17703 => 33043, 17704 => 27987, 17705 => 20892, - 17706 => 24324, 17707 => 22900, 17708 => 21162, 17709 => 24594, 17710 => 22899, - 17711 => 26262, 17712 => 34384, 17713 => 30111, 17714 => 25386, 17715 => 25062, - 17716 => 31983, 17717 => 35834, 17718 => 21734, 17719 => 27431, 17720 => 40485, - 17721 => 27572, 17722 => 34261, 17723 => 21589, 17724 => 20598, 17725 => 27812, - 17726 => 21866, 17727 => 36276, 17728 => 29228, 17729 => 24085, 17730 => 24597, - 17731 => 29750, 17732 => 25293, 17733 => 25490, 17734 => 29260, 17735 => 24472, - 17736 => 28227, 17737 => 27966, 17738 => 25856, 17739 => 28504, 17740 => 30424, - 17741 => 30928, 17742 => 30460, 17743 => 30036, 17744 => 21028, 17745 => 21467, - 17746 => 20051, 17747 => 24222, 17748 => 26049, 17749 => 32810, 17750 => 32982, - 17751 => 25243, 17752 => 21638, 17753 => 21032, 17754 => 28846, 17755 => 34957, - 17756 => 36305, 17757 => 27873, 17758 => 21624, 17759 => 32986, 17760 => 22521, - 17761 => 35060, 17762 => 36180, 17763 => 38506, 17764 => 37197, 17765 => 20329, - 17766 => 27803, 17767 => 21943, 17768 => 30406, 17769 => 30768, 17770 => 25256, - 17771 => 28921, 17772 => 28558, 17773 => 24429, 17774 => 34028, 17775 => 26842, - 17776 => 30844, 17777 => 31735, 17778 => 33192, 17779 => 26379, 17780 => 40527, - 17781 => 25447, 17782 => 30896, 17783 => 22383, 17784 => 30738, 17785 => 38713, - 17786 => 25209, 17787 => 25259, 17788 => 21128, 17789 => 29749, 17790 => 27607, - 17953 => 21860, 17954 => 33086, 17955 => 30130, 17956 => 30382, 17957 => 21305, - 17958 => 30174, 17959 => 20731, 17960 => 23617, 17961 => 35692, 17962 => 31687, - 17963 => 20559, 17964 => 29255, 17965 => 39575, 17966 => 39128, 17967 => 28418, - 17968 => 29922, 17969 => 31080, 17970 => 25735, 17971 => 30629, 17972 => 25340, - 17973 => 39057, 17974 => 36139, 17975 => 21697, 17976 => 32856, 17977 => 20050, - 17978 => 22378, 17979 => 33529, 17980 => 33805, 17981 => 24179, 17982 => 20973, - 17983 => 29942, 17984 => 35780, 17985 => 23631, 17986 => 22369, 17987 => 27900, - 17988 => 39047, 17989 => 23110, 17990 => 30772, 17991 => 39748, 17992 => 36843, - 17993 => 31893, 17994 => 21078, 17995 => 25169, 17996 => 38138, 17997 => 20166, - 17998 => 33670, 17999 => 33889, 18000 => 33769, 18001 => 33970, 18002 => 22484, - 18003 => 26420, 18004 => 22275, 18005 => 26222, 18006 => 28006, 18007 => 35889, - 18008 => 26333, 18009 => 28689, 18010 => 26399, 18011 => 27450, 18012 => 26646, - 18013 => 25114, 18014 => 22971, 18015 => 19971, 18016 => 20932, 18017 => 28422, - 18018 => 26578, 18019 => 27791, 18020 => 20854, 18021 => 26827, 18022 => 22855, - 18023 => 27495, 18024 => 30054, 18025 => 23822, 18026 => 33040, 18027 => 40784, - 18028 => 26071, 18029 => 31048, 18030 => 31041, 18031 => 39569, 18032 => 36215, - 18033 => 23682, 18034 => 20062, 18035 => 20225, 18036 => 21551, 18037 => 22865, - 18038 => 30732, 18039 => 22120, 18040 => 27668, 18041 => 36804, 18042 => 24323, - 18043 => 27773, 18044 => 27875, 18045 => 35755, 18046 => 25488, 18209 => 24688, - 18210 => 27965, 18211 => 29301, 18212 => 25190, 18213 => 38030, 18214 => 38085, - 18215 => 21315, 18216 => 36801, 18217 => 31614, 18218 => 20191, 18219 => 35878, - 18220 => 20094, 18221 => 40660, 18222 => 38065, 18223 => 38067, 18224 => 21069, - 18225 => 28508, 18226 => 36963, 18227 => 27973, 18228 => 35892, 18229 => 22545, - 18230 => 23884, 18231 => 27424, 18232 => 27465, 18233 => 26538, 18234 => 21595, - 18235 => 33108, 18236 => 32652, 18237 => 22681, 18238 => 34103, 18239 => 24378, - 18240 => 25250, 18241 => 27207, 18242 => 38201, 18243 => 25970, 18244 => 24708, - 18245 => 26725, 18246 => 30631, 18247 => 20052, 18248 => 20392, 18249 => 24039, - 18250 => 38808, 18251 => 25772, 18252 => 32728, 18253 => 23789, 18254 => 20431, - 18255 => 31373, 18256 => 20999, 18257 => 33540, 18258 => 19988, 18259 => 24623, - 18260 => 31363, 18261 => 38054, 18262 => 20405, 18263 => 20146, 18264 => 31206, - 18265 => 29748, 18266 => 21220, 18267 => 33465, 18268 => 25810, 18269 => 31165, - 18270 => 23517, 18271 => 27777, 18272 => 38738, 18273 => 36731, 18274 => 27682, - 18275 => 20542, 18276 => 21375, 18277 => 28165, 18278 => 25806, 18279 => 26228, - 18280 => 27696, 18281 => 24773, 18282 => 39031, 18283 => 35831, 18284 => 24198, - 18285 => 29756, 18286 => 31351, 18287 => 31179, 18288 => 19992, 18289 => 37041, - 18290 => 29699, 18291 => 27714, 18292 => 22234, 18293 => 37195, 18294 => 27845, - 18295 => 36235, 18296 => 21306, 18297 => 34502, 18298 => 26354, 18299 => 36527, - 18300 => 23624, 18301 => 39537, 18302 => 28192, 18465 => 21462, 18466 => 23094, - 18467 => 40843, 18468 => 36259, 18469 => 21435, 18470 => 22280, 18471 => 39079, - 18472 => 26435, 18473 => 37275, 18474 => 27849, 18475 => 20840, 18476 => 30154, - 18477 => 25331, 18478 => 29356, 18479 => 21048, 18480 => 21149, 18481 => 32570, - 18482 => 28820, 18483 => 30264, 18484 => 21364, 18485 => 40522, 18486 => 27063, - 18487 => 30830, 18488 => 38592, 18489 => 35033, 18490 => 32676, 18491 => 28982, - 18492 => 29123, 18493 => 20873, 18494 => 26579, 18495 => 29924, 18496 => 22756, - 18497 => 25880, 18498 => 22199, 18499 => 35753, 18500 => 39286, 18501 => 25200, - 18502 => 32469, 18503 => 24825, 18504 => 28909, 18505 => 22764, 18506 => 20161, - 18507 => 20154, 18508 => 24525, 18509 => 38887, 18510 => 20219, 18511 => 35748, - 18512 => 20995, 18513 => 22922, 18514 => 32427, 18515 => 25172, 18516 => 20173, - 18517 => 26085, 18518 => 25102, 18519 => 33592, 18520 => 33993, 18521 => 33635, - 18522 => 34701, 18523 => 29076, 18524 => 28342, 18525 => 23481, 18526 => 32466, - 18527 => 20887, 18528 => 25545, 18529 => 26580, 18530 => 32905, 18531 => 33593, - 18532 => 34837, 18533 => 20754, 18534 => 23418, 18535 => 22914, 18536 => 36785, - 18537 => 20083, 18538 => 27741, 18539 => 20837, 18540 => 35109, 18541 => 36719, - 18542 => 38446, 18543 => 34122, 18544 => 29790, 18545 => 38160, 18546 => 38384, - 18547 => 28070, 18548 => 33509, 18549 => 24369, 18550 => 25746, 18551 => 27922, - 18552 => 33832, 18553 => 33134, 18554 => 40131, 18555 => 22622, 18556 => 36187, - 18557 => 19977, 18558 => 21441, 18721 => 20254, 18722 => 25955, 18723 => 26705, - 18724 => 21971, 18725 => 20007, 18726 => 25620, 18727 => 39578, 18728 => 25195, - 18729 => 23234, 18730 => 29791, 18731 => 33394, 18732 => 28073, 18733 => 26862, - 18734 => 20711, 18735 => 33678, 18736 => 30722, 18737 => 26432, 18738 => 21049, - 18739 => 27801, 18740 => 32433, 18741 => 20667, 18742 => 21861, 18743 => 29022, - 18744 => 31579, 18745 => 26194, 18746 => 29642, 18747 => 33515, 18748 => 26441, - 18749 => 23665, 18750 => 21024, 18751 => 29053, 18752 => 34923, 18753 => 38378, - 18754 => 38485, 18755 => 25797, 18756 => 36193, 18757 => 33203, 18758 => 21892, - 18759 => 27733, 18760 => 25159, 18761 => 32558, 18762 => 22674, 18763 => 20260, - 18764 => 21830, 18765 => 36175, 18766 => 26188, 18767 => 19978, 18768 => 23578, - 18769 => 35059, 18770 => 26786, 18771 => 25422, 18772 => 31245, 18773 => 28903, - 18774 => 33421, 18775 => 21242, 18776 => 38902, 18777 => 23569, 18778 => 21736, - 18779 => 37045, 18780 => 32461, 18781 => 22882, 18782 => 36170, 18783 => 34503, - 18784 => 33292, 18785 => 33293, 18786 => 36198, 18787 => 25668, 18788 => 23556, - 18789 => 24913, 18790 => 28041, 18791 => 31038, 18792 => 35774, 18793 => 30775, - 18794 => 30003, 18795 => 21627, 18796 => 20280, 18797 => 36523, 18798 => 28145, - 18799 => 23072, 18800 => 32453, 18801 => 31070, 18802 => 27784, 18803 => 23457, - 18804 => 23158, 18805 => 29978, 18806 => 32958, 18807 => 24910, 18808 => 28183, - 18809 => 22768, 18810 => 29983, 18811 => 29989, 18812 => 29298, 18813 => 21319, - 18814 => 32499, 18977 => 30465, 18978 => 30427, 18979 => 21097, 18980 => 32988, - 18981 => 22307, 18982 => 24072, 18983 => 22833, 18984 => 29422, 18985 => 26045, - 18986 => 28287, 18987 => 35799, 18988 => 23608, 18989 => 34417, 18990 => 21313, - 18991 => 30707, 18992 => 25342, 18993 => 26102, 18994 => 20160, 18995 => 39135, - 18996 => 34432, 18997 => 23454, 18998 => 35782, 18999 => 21490, 19000 => 30690, - 19001 => 20351, 19002 => 23630, 19003 => 39542, 19004 => 22987, 19005 => 24335, - 19006 => 31034, 19007 => 22763, 19008 => 19990, 19009 => 26623, 19010 => 20107, - 19011 => 25325, 19012 => 35475, 19013 => 36893, 19014 => 21183, 19015 => 26159, - 19016 => 21980, 19017 => 22124, 19018 => 36866, 19019 => 20181, 19020 => 20365, - 19021 => 37322, 19022 => 39280, 19023 => 27663, 19024 => 24066, 19025 => 24643, - 19026 => 23460, 19027 => 35270, 19028 => 35797, 19029 => 25910, 19030 => 25163, - 19031 => 39318, 19032 => 23432, 19033 => 23551, 19034 => 25480, 19035 => 21806, - 19036 => 21463, 19037 => 30246, 19038 => 20861, 19039 => 34092, 19040 => 26530, - 19041 => 26803, 19042 => 27530, 19043 => 25234, 19044 => 36755, 19045 => 21460, - 19046 => 33298, 19047 => 28113, 19048 => 30095, 19049 => 20070, 19050 => 36174, - 19051 => 23408, 19052 => 29087, 19053 => 34223, 19054 => 26257, 19055 => 26329, - 19056 => 32626, 19057 => 34560, 19058 => 40653, 19059 => 40736, 19060 => 23646, - 19061 => 26415, 19062 => 36848, 19063 => 26641, 19064 => 26463, 19065 => 25101, - 19066 => 31446, 19067 => 22661, 19068 => 24246, 19069 => 25968, 19070 => 28465, - 19233 => 24661, 19234 => 21047, 19235 => 32781, 19236 => 25684, 19237 => 34928, - 19238 => 29993, 19239 => 24069, 19240 => 26643, 19241 => 25332, 19242 => 38684, - 19243 => 21452, 19244 => 29245, 19245 => 35841, 19246 => 27700, 19247 => 30561, - 19248 => 31246, 19249 => 21550, 19250 => 30636, 19251 => 39034, 19252 => 33308, - 19253 => 35828, 19254 => 30805, 19255 => 26388, 19256 => 28865, 19257 => 26031, - 19258 => 25749, 19259 => 22070, 19260 => 24605, 19261 => 31169, 19262 => 21496, - 19263 => 19997, 19264 => 27515, 19265 => 32902, 19266 => 23546, 19267 => 21987, - 19268 => 22235, 19269 => 20282, 19270 => 20284, 19271 => 39282, 19272 => 24051, - 19273 => 26494, 19274 => 32824, 19275 => 24578, 19276 => 39042, 19277 => 36865, - 19278 => 23435, 19279 => 35772, 19280 => 35829, 19281 => 25628, 19282 => 33368, - 19283 => 25822, 19284 => 22013, 19285 => 33487, 19286 => 37221, 19287 => 20439, - 19288 => 32032, 19289 => 36895, 19290 => 31903, 19291 => 20723, 19292 => 22609, - 19293 => 28335, 19294 => 23487, 19295 => 35785, 19296 => 32899, 19297 => 37240, - 19298 => 33948, 19299 => 31639, 19300 => 34429, 19301 => 38539, 19302 => 38543, - 19303 => 32485, 19304 => 39635, 19305 => 30862, 19306 => 23681, 19307 => 31319, - 19308 => 36930, 19309 => 38567, 19310 => 31071, 19311 => 23385, 19312 => 25439, - 19313 => 31499, 19314 => 34001, 19315 => 26797, 19316 => 21766, 19317 => 32553, - 19318 => 29712, 19319 => 32034, 19320 => 38145, 19321 => 25152, 19322 => 22604, - 19323 => 20182, 19324 => 23427, 19325 => 22905, 19326 => 22612, 19489 => 29549, - 19490 => 25374, 19491 => 36427, 19492 => 36367, 19493 => 32974, 19494 => 33492, - 19495 => 25260, 19496 => 21488, 19497 => 27888, 19498 => 37214, 19499 => 22826, - 19500 => 24577, 19501 => 27760, 19502 => 22349, 19503 => 25674, 19504 => 36138, - 19505 => 30251, 19506 => 28393, 19507 => 22363, 19508 => 27264, 19509 => 30192, - 19510 => 28525, 19511 => 35885, 19512 => 35848, 19513 => 22374, 19514 => 27631, - 19515 => 34962, 19516 => 30899, 19517 => 25506, 19518 => 21497, 19519 => 28845, - 19520 => 27748, 19521 => 22616, 19522 => 25642, 19523 => 22530, 19524 => 26848, - 19525 => 33179, 19526 => 21776, 19527 => 31958, 19528 => 20504, 19529 => 36538, - 19530 => 28108, 19531 => 36255, 19532 => 28907, 19533 => 25487, 19534 => 28059, - 19535 => 28372, 19536 => 32486, 19537 => 33796, 19538 => 26691, 19539 => 36867, - 19540 => 28120, 19541 => 38518, 19542 => 35752, 19543 => 22871, 19544 => 29305, - 19545 => 34276, 19546 => 33150, 19547 => 30140, 19548 => 35466, 19549 => 26799, - 19550 => 21076, 19551 => 36386, 19552 => 38161, 19553 => 25552, 19554 => 39064, - 19555 => 36420, 19556 => 21884, 19557 => 20307, 19558 => 26367, 19559 => 22159, - 19560 => 24789, 19561 => 28053, 19562 => 21059, 19563 => 23625, 19564 => 22825, - 19565 => 28155, 19566 => 22635, 19567 => 30000, 19568 => 29980, 19569 => 24684, - 19570 => 33300, 19571 => 33094, 19572 => 25361, 19573 => 26465, 19574 => 36834, - 19575 => 30522, 19576 => 36339, 19577 => 36148, 19578 => 38081, 19579 => 24086, - 19580 => 21381, 19581 => 21548, 19582 => 28867, 19745 => 27712, 19746 => 24311, - 19747 => 20572, 19748 => 20141, 19749 => 24237, 19750 => 25402, 19751 => 33351, - 19752 => 36890, 19753 => 26704, 19754 => 37230, 19755 => 30643, 19756 => 21516, - 19757 => 38108, 19758 => 24420, 19759 => 31461, 19760 => 26742, 19761 => 25413, - 19762 => 31570, 19763 => 32479, 19764 => 30171, 19765 => 20599, 19766 => 25237, - 19767 => 22836, 19768 => 36879, 19769 => 20984, 19770 => 31171, 19771 => 31361, - 19772 => 22270, 19773 => 24466, 19774 => 36884, 19775 => 28034, 19776 => 23648, - 19777 => 22303, 19778 => 21520, 19779 => 20820, 19780 => 28237, 19781 => 22242, - 19782 => 25512, 19783 => 39059, 19784 => 33151, 19785 => 34581, 19786 => 35114, - 19787 => 36864, 19788 => 21534, 19789 => 23663, 19790 => 33216, 19791 => 25302, - 19792 => 25176, 19793 => 33073, 19794 => 40501, 19795 => 38464, 19796 => 39534, - 19797 => 39548, 19798 => 26925, 19799 => 22949, 19800 => 25299, 19801 => 21822, - 19802 => 25366, 19803 => 21703, 19804 => 34521, 19805 => 27964, 19806 => 23043, - 19807 => 29926, 19808 => 34972, 19809 => 27498, 19810 => 22806, 19811 => 35916, - 19812 => 24367, 19813 => 28286, 19814 => 29609, 19815 => 39037, 19816 => 20024, - 19817 => 28919, 19818 => 23436, 19819 => 30871, 19820 => 25405, 19821 => 26202, - 19822 => 30358, 19823 => 24779, 19824 => 23451, 19825 => 23113, 19826 => 19975, - 19827 => 33109, 19828 => 27754, 19829 => 29579, 19830 => 20129, 19831 => 26505, - 19832 => 32593, 19833 => 24448, 19834 => 26106, 19835 => 26395, 19836 => 24536, - 19837 => 22916, 19838 => 23041, 20001 => 24013, 20002 => 24494, 20003 => 21361, - 20004 => 38886, 20005 => 36829, 20006 => 26693, 20007 => 22260, 20008 => 21807, - 20009 => 24799, 20010 => 20026, 20011 => 28493, 20012 => 32500, 20013 => 33479, - 20014 => 33806, 20015 => 22996, 20016 => 20255, 20017 => 20266, 20018 => 23614, - 20019 => 32428, 20020 => 26410, 20021 => 34074, 20022 => 21619, 20023 => 30031, - 20024 => 32963, 20025 => 21890, 20026 => 39759, 20027 => 20301, 20028 => 28205, - 20029 => 35859, 20030 => 23561, 20031 => 24944, 20032 => 21355, 20033 => 30239, - 20034 => 28201, 20035 => 34442, 20036 => 25991, 20037 => 38395, 20038 => 32441, - 20039 => 21563, 20040 => 31283, 20041 => 32010, 20042 => 38382, 20043 => 21985, - 20044 => 32705, 20045 => 29934, 20046 => 25373, 20047 => 34583, 20048 => 28065, - 20049 => 31389, 20050 => 25105, 20051 => 26017, 20052 => 21351, 20053 => 25569, - 20054 => 27779, 20055 => 24043, 20056 => 21596, 20057 => 38056, 20058 => 20044, - 20059 => 27745, 20060 => 35820, 20061 => 23627, 20062 => 26080, 20063 => 33436, - 20064 => 26791, 20065 => 21566, 20066 => 21556, 20067 => 27595, 20068 => 27494, - 20069 => 20116, 20070 => 25410, 20071 => 21320, 20072 => 33310, 20073 => 20237, - 20074 => 20398, 20075 => 22366, 20076 => 25098, 20077 => 38654, 20078 => 26212, - 20079 => 29289, 20080 => 21247, 20081 => 21153, 20082 => 24735, 20083 => 35823, - 20084 => 26132, 20085 => 29081, 20086 => 26512, 20087 => 35199, 20088 => 30802, - 20089 => 30717, 20090 => 26224, 20091 => 22075, 20092 => 21560, 20093 => 38177, - 20094 => 29306, 20257 => 31232, 20258 => 24687, 20259 => 24076, 20260 => 24713, - 20261 => 33181, 20262 => 22805, 20263 => 24796, 20264 => 29060, 20265 => 28911, - 20266 => 28330, 20267 => 27728, 20268 => 29312, 20269 => 27268, 20270 => 34989, - 20271 => 24109, 20272 => 20064, 20273 => 23219, 20274 => 21916, 20275 => 38115, - 20276 => 27927, 20277 => 31995, 20278 => 38553, 20279 => 25103, 20280 => 32454, - 20281 => 30606, 20282 => 34430, 20283 => 21283, 20284 => 38686, 20285 => 36758, - 20286 => 26247, 20287 => 23777, 20288 => 20384, 20289 => 29421, 20290 => 19979, - 20291 => 21414, 20292 => 22799, 20293 => 21523, 20294 => 25472, 20295 => 38184, - 20296 => 20808, 20297 => 20185, 20298 => 40092, 20299 => 32420, 20300 => 21688, - 20301 => 36132, 20302 => 34900, 20303 => 33335, 20304 => 38386, 20305 => 28046, - 20306 => 24358, 20307 => 23244, 20308 => 26174, 20309 => 38505, 20310 => 29616, - 20311 => 29486, 20312 => 21439, 20313 => 33146, 20314 => 39301, 20315 => 32673, - 20316 => 23466, 20317 => 38519, 20318 => 38480, 20319 => 32447, 20320 => 30456, - 20321 => 21410, 20322 => 38262, 20323 => 39321, 20324 => 31665, 20325 => 35140, - 20326 => 28248, 20327 => 20065, 20328 => 32724, 20329 => 31077, 20330 => 35814, - 20331 => 24819, 20332 => 21709, 20333 => 20139, 20334 => 39033, 20335 => 24055, - 20336 => 27233, 20337 => 20687, 20338 => 21521, 20339 => 35937, 20340 => 33831, - 20341 => 30813, 20342 => 38660, 20343 => 21066, 20344 => 21742, 20345 => 22179, - 20346 => 38144, 20347 => 28040, 20348 => 23477, 20349 => 28102, 20350 => 26195, - 20513 => 23567, 20514 => 23389, 20515 => 26657, 20516 => 32918, 20517 => 21880, - 20518 => 31505, 20519 => 25928, 20520 => 26964, 20521 => 20123, 20522 => 27463, - 20523 => 34638, 20524 => 38795, 20525 => 21327, 20526 => 25375, 20527 => 25658, - 20528 => 37034, 20529 => 26012, 20530 => 32961, 20531 => 35856, 20532 => 20889, - 20533 => 26800, 20534 => 21368, 20535 => 34809, 20536 => 25032, 20537 => 27844, - 20538 => 27899, 20539 => 35874, 20540 => 23633, 20541 => 34218, 20542 => 33455, - 20543 => 38156, 20544 => 27427, 20545 => 36763, 20546 => 26032, 20547 => 24571, - 20548 => 24515, 20549 => 20449, 20550 => 34885, 20551 => 26143, 20552 => 33125, - 20553 => 29481, 20554 => 24826, 20555 => 20852, 20556 => 21009, 20557 => 22411, - 20558 => 24418, 20559 => 37026, 20560 => 34892, 20561 => 37266, 20562 => 24184, - 20563 => 26447, 20564 => 24615, 20565 => 22995, 20566 => 20804, 20567 => 20982, - 20568 => 33016, 20569 => 21256, 20570 => 27769, 20571 => 38596, 20572 => 29066, - 20573 => 20241, 20574 => 20462, 20575 => 32670, 20576 => 26429, 20577 => 21957, - 20578 => 38152, 20579 => 31168, 20580 => 34966, 20581 => 32483, 20582 => 22687, - 20583 => 25100, 20584 => 38656, 20585 => 34394, 20586 => 22040, 20587 => 39035, - 20588 => 24464, 20589 => 35768, 20590 => 33988, 20591 => 37207, 20592 => 21465, - 20593 => 26093, 20594 => 24207, 20595 => 30044, 20596 => 24676, 20597 => 32110, - 20598 => 23167, 20599 => 32490, 20600 => 32493, 20601 => 36713, 20602 => 21927, - 20603 => 23459, 20604 => 24748, 20605 => 26059, 20606 => 29572, 20769 => 36873, - 20770 => 30307, 20771 => 30505, 20772 => 32474, 20773 => 38772, 20774 => 34203, - 20775 => 23398, 20776 => 31348, 20777 => 38634, 20778 => 34880, 20779 => 21195, - 20780 => 29071, 20781 => 24490, 20782 => 26092, 20783 => 35810, 20784 => 23547, - 20785 => 39535, 20786 => 24033, 20787 => 27529, 20788 => 27739, 20789 => 35757, - 20790 => 35759, 20791 => 36874, 20792 => 36805, 20793 => 21387, 20794 => 25276, - 20795 => 40486, 20796 => 40493, 20797 => 21568, 20798 => 20011, 20799 => 33469, - 20800 => 29273, 20801 => 34460, 20802 => 23830, 20803 => 34905, 20804 => 28079, - 20805 => 38597, 20806 => 21713, 20807 => 20122, 20808 => 35766, 20809 => 28937, - 20810 => 21693, 20811 => 38409, 20812 => 28895, 20813 => 28153, 20814 => 30416, - 20815 => 20005, 20816 => 30740, 20817 => 34578, 20818 => 23721, 20819 => 24310, - 20820 => 35328, 20821 => 39068, 20822 => 38414, 20823 => 28814, 20824 => 27839, - 20825 => 22852, 20826 => 25513, 20827 => 30524, 20828 => 34893, 20829 => 28436, - 20830 => 33395, 20831 => 22576, 20832 => 29141, 20833 => 21388, 20834 => 30746, - 20835 => 38593, 20836 => 21761, 20837 => 24422, 20838 => 28976, 20839 => 23476, - 20840 => 35866, 20841 => 39564, 20842 => 27523, 20843 => 22830, 20844 => 40495, - 20845 => 31207, 20846 => 26472, 20847 => 25196, 20848 => 20335, 20849 => 30113, - 20850 => 32650, 20851 => 27915, 20852 => 38451, 20853 => 27687, 20854 => 20208, - 20855 => 30162, 20856 => 20859, 20857 => 26679, 20858 => 28478, 20859 => 36992, - 20860 => 33136, 20861 => 22934, 20862 => 29814, 21025 => 25671, 21026 => 23591, - 21027 => 36965, 21028 => 31377, 21029 => 35875, 21030 => 23002, 21031 => 21676, - 21032 => 33280, 21033 => 33647, 21034 => 35201, 21035 => 32768, 21036 => 26928, - 21037 => 22094, 21038 => 32822, 21039 => 29239, 21040 => 37326, 21041 => 20918, - 21042 => 20063, 21043 => 39029, 21044 => 25494, 21045 => 19994, 21046 => 21494, - 21047 => 26355, 21048 => 33099, 21049 => 22812, 21050 => 28082, 21051 => 19968, - 21052 => 22777, 21053 => 21307, 21054 => 25558, 21055 => 38129, 21056 => 20381, - 21057 => 20234, 21058 => 34915, 21059 => 39056, 21060 => 22839, 21061 => 36951, - 21062 => 31227, 21063 => 20202, 21064 => 33008, 21065 => 30097, 21066 => 27778, - 21067 => 23452, 21068 => 23016, 21069 => 24413, 21070 => 26885, 21071 => 34433, - 21072 => 20506, 21073 => 24050, 21074 => 20057, 21075 => 30691, 21076 => 20197, - 21077 => 33402, 21078 => 25233, 21079 => 26131, 21080 => 37009, 21081 => 23673, - 21082 => 20159, 21083 => 24441, 21084 => 33222, 21085 => 36920, 21086 => 32900, - 21087 => 30123, 21088 => 20134, 21089 => 35028, 21090 => 24847, 21091 => 27589, - 21092 => 24518, 21093 => 20041, 21094 => 30410, 21095 => 28322, 21096 => 35811, - 21097 => 35758, 21098 => 35850, 21099 => 35793, 21100 => 24322, 21101 => 32764, - 21102 => 32716, 21103 => 32462, 21104 => 33589, 21105 => 33643, 21106 => 22240, - 21107 => 27575, 21108 => 38899, 21109 => 38452, 21110 => 23035, 21111 => 21535, - 21112 => 38134, 21113 => 28139, 21114 => 23493, 21115 => 39278, 21116 => 23609, - 21117 => 24341, 21118 => 38544, 21281 => 21360, 21282 => 33521, 21283 => 27185, - 21284 => 23156, 21285 => 40560, 21286 => 24212, 21287 => 32552, 21288 => 33721, - 21289 => 33828, 21290 => 33829, 21291 => 33639, 21292 => 34631, 21293 => 36814, - 21294 => 36194, 21295 => 30408, 21296 => 24433, 21297 => 39062, 21298 => 30828, - 21299 => 26144, 21300 => 21727, 21301 => 25317, 21302 => 20323, 21303 => 33219, - 21304 => 30152, 21305 => 24248, 21306 => 38605, 21307 => 36362, 21308 => 34553, - 21309 => 21647, 21310 => 27891, 21311 => 28044, 21312 => 27704, 21313 => 24703, - 21314 => 21191, 21315 => 29992, 21316 => 24189, 21317 => 20248, 21318 => 24736, - 21319 => 24551, 21320 => 23588, 21321 => 30001, 21322 => 37038, 21323 => 38080, - 21324 => 29369, 21325 => 27833, 21326 => 28216, 21327 => 37193, 21328 => 26377, - 21329 => 21451, 21330 => 21491, 21331 => 20305, 21332 => 37321, 21333 => 35825, - 21334 => 21448, 21335 => 24188, 21336 => 36802, 21337 => 28132, 21338 => 20110, - 21339 => 30402, 21340 => 27014, 21341 => 34398, 21342 => 24858, 21343 => 33286, - 21344 => 20313, 21345 => 20446, 21346 => 36926, 21347 => 40060, 21348 => 24841, - 21349 => 28189, 21350 => 28180, 21351 => 38533, 21352 => 20104, 21353 => 23089, - 21354 => 38632, 21355 => 19982, 21356 => 23679, 21357 => 31161, 21358 => 23431, - 21359 => 35821, 21360 => 32701, 21361 => 29577, 21362 => 22495, 21363 => 33419, - 21364 => 37057, 21365 => 21505, 21366 => 36935, 21367 => 21947, 21368 => 23786, - 21369 => 24481, 21370 => 24840, 21371 => 27442, 21372 => 29425, 21373 => 32946, - 21374 => 35465, 21537 => 28020, 21538 => 23507, 21539 => 35029, 21540 => 39044, - 21541 => 35947, 21542 => 39533, 21543 => 40499, 21544 => 28170, 21545 => 20900, - 21546 => 20803, 21547 => 22435, 21548 => 34945, 21549 => 21407, 21550 => 25588, - 21551 => 36757, 21552 => 22253, 21553 => 21592, 21554 => 22278, 21555 => 29503, - 21556 => 28304, 21557 => 32536, 21558 => 36828, 21559 => 33489, 21560 => 24895, - 21561 => 24616, 21562 => 38498, 21563 => 26352, 21564 => 32422, 21565 => 36234, - 21566 => 36291, 21567 => 38053, 21568 => 23731, 21569 => 31908, 21570 => 26376, - 21571 => 24742, 21572 => 38405, 21573 => 32792, 21574 => 20113, 21575 => 37095, - 21576 => 21248, 21577 => 38504, 21578 => 20801, 21579 => 36816, 21580 => 34164, - 21581 => 37213, 21582 => 26197, 21583 => 38901, 21584 => 23381, 21585 => 21277, - 21586 => 30776, 21587 => 26434, 21588 => 26685, 21589 => 21705, 21590 => 28798, - 21591 => 23472, 21592 => 36733, 21593 => 20877, 21594 => 22312, 21595 => 21681, - 21596 => 25874, 21597 => 26242, 21598 => 36190, 21599 => 36163, 21600 => 33039, - 21601 => 33900, 21602 => 36973, 21603 => 31967, 21604 => 20991, 21605 => 34299, - 21606 => 26531, 21607 => 26089, 21608 => 28577, 21609 => 34468, 21610 => 36481, - 21611 => 22122, 21612 => 36896, 21613 => 30338, 21614 => 28790, 21615 => 29157, - 21616 => 36131, 21617 => 25321, 21618 => 21017, 21619 => 27901, 21620 => 36156, - 21621 => 24590, 21622 => 22686, 21623 => 24974, 21624 => 26366, 21625 => 36192, - 21626 => 25166, 21627 => 21939, 21628 => 28195, 21629 => 26413, 21630 => 36711, - 21793 => 38113, 21794 => 38392, 21795 => 30504, 21796 => 26629, 21797 => 27048, - 21798 => 21643, 21799 => 20045, 21800 => 28856, 21801 => 35784, 21802 => 25688, - 21803 => 25995, 21804 => 23429, 21805 => 31364, 21806 => 20538, 21807 => 23528, - 21808 => 30651, 21809 => 27617, 21810 => 35449, 21811 => 31896, 21812 => 27838, - 21813 => 30415, 21814 => 26025, 21815 => 36759, 21816 => 23853, 21817 => 23637, - 21818 => 34360, 21819 => 26632, 21820 => 21344, 21821 => 25112, 21822 => 31449, - 21823 => 28251, 21824 => 32509, 21825 => 27167, 21826 => 31456, 21827 => 24432, - 21828 => 28467, 21829 => 24352, 21830 => 25484, 21831 => 28072, 21832 => 26454, - 21833 => 19976, 21834 => 24080, 21835 => 36134, 21836 => 20183, 21837 => 32960, - 21838 => 30260, 21839 => 38556, 21840 => 25307, 21841 => 26157, 21842 => 25214, - 21843 => 27836, 21844 => 36213, 21845 => 29031, 21846 => 32617, 21847 => 20806, - 21848 => 32903, 21849 => 21484, 21850 => 36974, 21851 => 25240, 21852 => 21746, - 21853 => 34544, 21854 => 36761, 21855 => 32773, 21856 => 38167, 21857 => 34071, - 21858 => 36825, 21859 => 27993, 21860 => 29645, 21861 => 26015, 21862 => 30495, - 21863 => 29956, 21864 => 30759, 21865 => 33275, 21866 => 36126, 21867 => 38024, - 21868 => 20390, 21869 => 26517, 21870 => 30137, 21871 => 35786, 21872 => 38663, - 21873 => 25391, 21874 => 38215, 21875 => 38453, 21876 => 33976, 21877 => 25379, - 21878 => 30529, 21879 => 24449, 21880 => 29424, 21881 => 20105, 21882 => 24596, - 21883 => 25972, 21884 => 25327, 21885 => 27491, 21886 => 25919, 22049 => 24103, - 22050 => 30151, 22051 => 37073, 22052 => 35777, 22053 => 33437, 22054 => 26525, - 22055 => 25903, 22056 => 21553, 22057 => 34584, 22058 => 30693, 22059 => 32930, - 22060 => 33026, 22061 => 27713, 22062 => 20043, 22063 => 32455, 22064 => 32844, - 22065 => 30452, 22066 => 26893, 22067 => 27542, 22068 => 25191, 22069 => 20540, - 22070 => 20356, 22071 => 22336, 22072 => 25351, 22073 => 27490, 22074 => 36286, - 22075 => 21482, 22076 => 26088, 22077 => 32440, 22078 => 24535, 22079 => 25370, - 22080 => 25527, 22081 => 33267, 22082 => 33268, 22083 => 32622, 22084 => 24092, - 22085 => 23769, 22086 => 21046, 22087 => 26234, 22088 => 31209, 22089 => 31258, - 22090 => 36136, 22091 => 28825, 22092 => 30164, 22093 => 28382, 22094 => 27835, - 22095 => 31378, 22096 => 20013, 22097 => 30405, 22098 => 24544, 22099 => 38047, - 22100 => 34935, 22101 => 32456, 22102 => 31181, 22103 => 32959, 22104 => 37325, - 22105 => 20210, 22106 => 20247, 22107 => 33311, 22108 => 21608, 22109 => 24030, - 22110 => 27954, 22111 => 35788, 22112 => 31909, 22113 => 36724, 22114 => 32920, - 22115 => 24090, 22116 => 21650, 22117 => 30385, 22118 => 23449, 22119 => 26172, - 22120 => 39588, 22121 => 29664, 22122 => 26666, 22123 => 34523, 22124 => 26417, - 22125 => 29482, 22126 => 35832, 22127 => 35803, 22128 => 36880, 22129 => 31481, - 22130 => 28891, 22131 => 29038, 22132 => 25284, 22133 => 30633, 22134 => 22065, - 22135 => 20027, 22136 => 33879, 22137 => 26609, 22138 => 21161, 22139 => 34496, - 22140 => 36142, 22141 => 38136, 22142 => 31569, 22305 => 20303, 22306 => 27880, - 22307 => 31069, 22308 => 39547, 22309 => 25235, 22310 => 29226, 22311 => 25341, - 22312 => 19987, 22313 => 30742, 22314 => 36716, 22315 => 25776, 22316 => 36186, - 22317 => 31686, 22318 => 26729, 22319 => 24196, 22320 => 35013, 22321 => 22918, - 22322 => 25758, 22323 => 22766, 22324 => 29366, 22325 => 26894, 22326 => 38181, - 22327 => 36861, 22328 => 36184, 22329 => 22368, 22330 => 32512, 22331 => 35846, - 22332 => 20934, 22333 => 25417, 22334 => 25305, 22335 => 21331, 22336 => 26700, - 22337 => 29730, 22338 => 33537, 22339 => 37196, 22340 => 21828, 22341 => 30528, - 22342 => 28796, 22343 => 27978, 22344 => 20857, 22345 => 21672, 22346 => 36164, - 22347 => 23039, 22348 => 28363, 22349 => 28100, 22350 => 23388, 22351 => 32043, - 22352 => 20180, 22353 => 31869, 22354 => 28371, 22355 => 23376, 22356 => 33258, - 22357 => 28173, 22358 => 23383, 22359 => 39683, 22360 => 26837, 22361 => 36394, - 22362 => 23447, 22363 => 32508, 22364 => 24635, 22365 => 32437, 22366 => 37049, - 22367 => 36208, 22368 => 22863, 22369 => 25549, 22370 => 31199, 22371 => 36275, - 22372 => 21330, 22373 => 26063, 22374 => 31062, 22375 => 35781, 22376 => 38459, - 22377 => 32452, 22378 => 38075, 22379 => 32386, 22380 => 22068, 22381 => 37257, - 22382 => 26368, 22383 => 32618, 22384 => 23562, 22385 => 36981, 22386 => 26152, - 22387 => 24038, 22388 => 20304, 22389 => 26590, 22390 => 20570, 22391 => 20316, - 22392 => 22352, 22393 => 24231, 22561 => 20109, 22562 => 19980, 22563 => 20800, - 22564 => 19984, 22565 => 24319, 22566 => 21317, 22567 => 19989, 22568 => 20120, - 22569 => 19998, 22570 => 39730, 22571 => 23404, 22572 => 22121, 22573 => 20008, - 22574 => 31162, 22575 => 20031, 22576 => 21269, 22577 => 20039, 22578 => 22829, - 22579 => 29243, 22580 => 21358, 22581 => 27664, 22582 => 22239, 22583 => 32996, - 22584 => 39319, 22585 => 27603, 22586 => 30590, 22587 => 40727, 22588 => 20022, - 22589 => 20127, 22590 => 40720, 22591 => 20060, 22592 => 20073, 22593 => 20115, - 22594 => 33416, 22595 => 23387, 22596 => 21868, 22597 => 22031, 22598 => 20164, - 22599 => 21389, 22600 => 21405, 22601 => 21411, 22602 => 21413, 22603 => 21422, - 22604 => 38757, 22605 => 36189, 22606 => 21274, 22607 => 21493, 22608 => 21286, - 22609 => 21294, 22610 => 21310, 22611 => 36188, 22612 => 21350, 22613 => 21347, - 22614 => 20994, 22615 => 21000, 22616 => 21006, 22617 => 21037, 22618 => 21043, - 22619 => 21055, 22620 => 21056, 22621 => 21068, 22622 => 21086, 22623 => 21089, - 22624 => 21084, 22625 => 33967, 22626 => 21117, 22627 => 21122, 22628 => 21121, - 22629 => 21136, 22630 => 21139, 22631 => 20866, 22632 => 32596, 22633 => 20155, - 22634 => 20163, 22635 => 20169, 22636 => 20162, 22637 => 20200, 22638 => 20193, - 22639 => 20203, 22640 => 20190, 22641 => 20251, 22642 => 20211, 22643 => 20258, - 22644 => 20324, 22645 => 20213, 22646 => 20261, 22647 => 20263, 22648 => 20233, - 22649 => 20267, 22650 => 20318, 22651 => 20327, 22652 => 25912, 22653 => 20314, - 22654 => 20317, 22817 => 20319, 22818 => 20311, 22819 => 20274, 22820 => 20285, - 22821 => 20342, 22822 => 20340, 22823 => 20369, 22824 => 20361, 22825 => 20355, - 22826 => 20367, 22827 => 20350, 22828 => 20347, 22829 => 20394, 22830 => 20348, - 22831 => 20396, 22832 => 20372, 22833 => 20454, 22834 => 20456, 22835 => 20458, - 22836 => 20421, 22837 => 20442, 22838 => 20451, 22839 => 20444, 22840 => 20433, - 22841 => 20447, 22842 => 20472, 22843 => 20521, 22844 => 20556, 22845 => 20467, - 22846 => 20524, 22847 => 20495, 22848 => 20526, 22849 => 20525, 22850 => 20478, - 22851 => 20508, 22852 => 20492, 22853 => 20517, 22854 => 20520, 22855 => 20606, - 22856 => 20547, 22857 => 20565, 22858 => 20552, 22859 => 20558, 22860 => 20588, - 22861 => 20603, 22862 => 20645, 22863 => 20647, 22864 => 20649, 22865 => 20666, - 22866 => 20694, 22867 => 20742, 22868 => 20717, 22869 => 20716, 22870 => 20710, - 22871 => 20718, 22872 => 20743, 22873 => 20747, 22874 => 20189, 22875 => 27709, - 22876 => 20312, 22877 => 20325, 22878 => 20430, 22879 => 40864, 22880 => 27718, - 22881 => 31860, 22882 => 20846, 22883 => 24061, 22884 => 40649, 22885 => 39320, - 22886 => 20865, 22887 => 22804, 22888 => 21241, 22889 => 21261, 22890 => 35335, - 22891 => 21264, 22892 => 20971, 22893 => 22809, 22894 => 20821, 22895 => 20128, - 22896 => 20822, 22897 => 20147, 22898 => 34926, 22899 => 34980, 22900 => 20149, - 22901 => 33044, 22902 => 35026, 22903 => 31104, 22904 => 23348, 22905 => 34819, - 22906 => 32696, 22907 => 20907, 22908 => 20913, 22909 => 20925, 22910 => 20924, - 23073 => 20935, 23074 => 20886, 23075 => 20898, 23076 => 20901, 23077 => 35744, - 23078 => 35750, 23079 => 35751, 23080 => 35754, 23081 => 35764, 23082 => 35765, - 23083 => 35767, 23084 => 35778, 23085 => 35779, 23086 => 35787, 23087 => 35791, - 23088 => 35790, 23089 => 35794, 23090 => 35795, 23091 => 35796, 23092 => 35798, - 23093 => 35800, 23094 => 35801, 23095 => 35804, 23096 => 35807, 23097 => 35808, - 23098 => 35812, 23099 => 35816, 23100 => 35817, 23101 => 35822, 23102 => 35824, - 23103 => 35827, 23104 => 35830, 23105 => 35833, 23106 => 35836, 23107 => 35839, - 23108 => 35840, 23109 => 35842, 23110 => 35844, 23111 => 35847, 23112 => 35852, - 23113 => 35855, 23114 => 35857, 23115 => 35858, 23116 => 35860, 23117 => 35861, - 23118 => 35862, 23119 => 35865, 23120 => 35867, 23121 => 35864, 23122 => 35869, - 23123 => 35871, 23124 => 35872, 23125 => 35873, 23126 => 35877, 23127 => 35879, - 23128 => 35882, 23129 => 35883, 23130 => 35886, 23131 => 35887, 23132 => 35890, - 23133 => 35891, 23134 => 35893, 23135 => 35894, 23136 => 21353, 23137 => 21370, - 23138 => 38429, 23139 => 38434, 23140 => 38433, 23141 => 38449, 23142 => 38442, - 23143 => 38461, 23144 => 38460, 23145 => 38466, 23146 => 38473, 23147 => 38484, - 23148 => 38495, 23149 => 38503, 23150 => 38508, 23151 => 38514, 23152 => 38516, - 23153 => 38536, 23154 => 38541, 23155 => 38551, 23156 => 38576, 23157 => 37015, - 23158 => 37019, 23159 => 37021, 23160 => 37017, 23161 => 37036, 23162 => 37025, - 23163 => 37044, 23164 => 37043, 23165 => 37046, 23166 => 37050, 23329 => 37048, - 23330 => 37040, 23331 => 37071, 23332 => 37061, 23333 => 37054, 23334 => 37072, - 23335 => 37060, 23336 => 37063, 23337 => 37075, 23338 => 37094, 23339 => 37090, - 23340 => 37084, 23341 => 37079, 23342 => 37083, 23343 => 37099, 23344 => 37103, - 23345 => 37118, 23346 => 37124, 23347 => 37154, 23348 => 37150, 23349 => 37155, - 23350 => 37169, 23351 => 37167, 23352 => 37177, 23353 => 37187, 23354 => 37190, - 23355 => 21005, 23356 => 22850, 23357 => 21154, 23358 => 21164, 23359 => 21165, - 23360 => 21182, 23361 => 21759, 23362 => 21200, 23363 => 21206, 23364 => 21232, - 23365 => 21471, 23366 => 29166, 23367 => 30669, 23368 => 24308, 23369 => 20981, - 23370 => 20988, 23371 => 39727, 23372 => 21430, 23373 => 24321, 23374 => 30042, - 23375 => 24047, 23376 => 22348, 23377 => 22441, 23378 => 22433, 23379 => 22654, - 23380 => 22716, 23381 => 22725, 23382 => 22737, 23383 => 22313, 23384 => 22316, - 23385 => 22314, 23386 => 22323, 23387 => 22329, 23388 => 22318, 23389 => 22319, - 23390 => 22364, 23391 => 22331, 23392 => 22338, 23393 => 22377, 23394 => 22405, - 23395 => 22379, 23396 => 22406, 23397 => 22396, 23398 => 22395, 23399 => 22376, - 23400 => 22381, 23401 => 22390, 23402 => 22387, 23403 => 22445, 23404 => 22436, - 23405 => 22412, 23406 => 22450, 23407 => 22479, 23408 => 22439, 23409 => 22452, - 23410 => 22419, 23411 => 22432, 23412 => 22485, 23413 => 22488, 23414 => 22490, - 23415 => 22489, 23416 => 22482, 23417 => 22456, 23418 => 22516, 23419 => 22511, - 23420 => 22520, 23421 => 22500, 23422 => 22493, 23585 => 22539, 23586 => 22541, - 23587 => 22525, 23588 => 22509, 23589 => 22528, 23590 => 22558, 23591 => 22553, - 23592 => 22596, 23593 => 22560, 23594 => 22629, 23595 => 22636, 23596 => 22657, - 23597 => 22665, 23598 => 22682, 23599 => 22656, 23600 => 39336, 23601 => 40729, - 23602 => 25087, 23603 => 33401, 23604 => 33405, 23605 => 33407, 23606 => 33423, - 23607 => 33418, 23608 => 33448, 23609 => 33412, 23610 => 33422, 23611 => 33425, - 23612 => 33431, 23613 => 33433, 23614 => 33451, 23615 => 33464, 23616 => 33470, - 23617 => 33456, 23618 => 33480, 23619 => 33482, 23620 => 33507, 23621 => 33432, - 23622 => 33463, 23623 => 33454, 23624 => 33483, 23625 => 33484, 23626 => 33473, - 23627 => 33449, 23628 => 33460, 23629 => 33441, 23630 => 33450, 23631 => 33439, - 23632 => 33476, 23633 => 33486, 23634 => 33444, 23635 => 33505, 23636 => 33545, - 23637 => 33527, 23638 => 33508, 23639 => 33551, 23640 => 33543, 23641 => 33500, - 23642 => 33524, 23643 => 33490, 23644 => 33496, 23645 => 33548, 23646 => 33531, - 23647 => 33491, 23648 => 33553, 23649 => 33562, 23650 => 33542, 23651 => 33556, - 23652 => 33557, 23653 => 33504, 23654 => 33493, 23655 => 33564, 23656 => 33617, - 23657 => 33627, 23658 => 33628, 23659 => 33544, 23660 => 33682, 23661 => 33596, - 23662 => 33588, 23663 => 33585, 23664 => 33691, 23665 => 33630, 23666 => 33583, - 23667 => 33615, 23668 => 33607, 23669 => 33603, 23670 => 33631, 23671 => 33600, - 23672 => 33559, 23673 => 33632, 23674 => 33581, 23675 => 33594, 23676 => 33587, - 23677 => 33638, 23678 => 33637, 23841 => 33640, 23842 => 33563, 23843 => 33641, - 23844 => 33644, 23845 => 33642, 23846 => 33645, 23847 => 33646, 23848 => 33712, - 23849 => 33656, 23850 => 33715, 23851 => 33716, 23852 => 33696, 23853 => 33706, - 23854 => 33683, 23855 => 33692, 23856 => 33669, 23857 => 33660, 23858 => 33718, - 23859 => 33705, 23860 => 33661, 23861 => 33720, 23862 => 33659, 23863 => 33688, - 23864 => 33694, 23865 => 33704, 23866 => 33722, 23867 => 33724, 23868 => 33729, - 23869 => 33793, 23870 => 33765, 23871 => 33752, 23872 => 22535, 23873 => 33816, - 23874 => 33803, 23875 => 33757, 23876 => 33789, 23877 => 33750, 23878 => 33820, - 23879 => 33848, 23880 => 33809, 23881 => 33798, 23882 => 33748, 23883 => 33759, - 23884 => 33807, 23885 => 33795, 23886 => 33784, 23887 => 33785, 23888 => 33770, - 23889 => 33733, 23890 => 33728, 23891 => 33830, 23892 => 33776, 23893 => 33761, - 23894 => 33884, 23895 => 33873, 23896 => 33882, 23897 => 33881, 23898 => 33907, - 23899 => 33927, 23900 => 33928, 23901 => 33914, 23902 => 33929, 23903 => 33912, - 23904 => 33852, 23905 => 33862, 23906 => 33897, 23907 => 33910, 23908 => 33932, - 23909 => 33934, 23910 => 33841, 23911 => 33901, 23912 => 33985, 23913 => 33997, - 23914 => 34000, 23915 => 34022, 23916 => 33981, 23917 => 34003, 23918 => 33994, - 23919 => 33983, 23920 => 33978, 23921 => 34016, 23922 => 33953, 23923 => 33977, - 23924 => 33972, 23925 => 33943, 23926 => 34021, 23927 => 34019, 23928 => 34060, - 23929 => 29965, 23930 => 34104, 23931 => 34032, 23932 => 34105, 23933 => 34079, - 23934 => 34106, 24097 => 34134, 24098 => 34107, 24099 => 34047, 24100 => 34044, - 24101 => 34137, 24102 => 34120, 24103 => 34152, 24104 => 34148, 24105 => 34142, - 24106 => 34170, 24107 => 30626, 24108 => 34115, 24109 => 34162, 24110 => 34171, - 24111 => 34212, 24112 => 34216, 24113 => 34183, 24114 => 34191, 24115 => 34169, - 24116 => 34222, 24117 => 34204, 24118 => 34181, 24119 => 34233, 24120 => 34231, - 24121 => 34224, 24122 => 34259, 24123 => 34241, 24124 => 34268, 24125 => 34303, - 24126 => 34343, 24127 => 34309, 24128 => 34345, 24129 => 34326, 24130 => 34364, - 24131 => 24318, 24132 => 24328, 24133 => 22844, 24134 => 22849, 24135 => 32823, - 24136 => 22869, 24137 => 22874, 24138 => 22872, 24139 => 21263, 24140 => 23586, - 24141 => 23589, 24142 => 23596, 24143 => 23604, 24144 => 25164, 24145 => 25194, - 24146 => 25247, 24147 => 25275, 24148 => 25290, 24149 => 25306, 24150 => 25303, - 24151 => 25326, 24152 => 25378, 24153 => 25334, 24154 => 25401, 24155 => 25419, - 24156 => 25411, 24157 => 25517, 24158 => 25590, 24159 => 25457, 24160 => 25466, - 24161 => 25486, 24162 => 25524, 24163 => 25453, 24164 => 25516, 24165 => 25482, - 24166 => 25449, 24167 => 25518, 24168 => 25532, 24169 => 25586, 24170 => 25592, - 24171 => 25568, 24172 => 25599, 24173 => 25540, 24174 => 25566, 24175 => 25550, - 24176 => 25682, 24177 => 25542, 24178 => 25534, 24179 => 25669, 24180 => 25665, - 24181 => 25611, 24182 => 25627, 24183 => 25632, 24184 => 25612, 24185 => 25638, - 24186 => 25633, 24187 => 25694, 24188 => 25732, 24189 => 25709, 24190 => 25750, - 24353 => 25722, 24354 => 25783, 24355 => 25784, 24356 => 25753, 24357 => 25786, - 24358 => 25792, 24359 => 25808, 24360 => 25815, 24361 => 25828, 24362 => 25826, - 24363 => 25865, 24364 => 25893, 24365 => 25902, 24366 => 24331, 24367 => 24530, - 24368 => 29977, 24369 => 24337, 24370 => 21343, 24371 => 21489, 24372 => 21501, - 24373 => 21481, 24374 => 21480, 24375 => 21499, 24376 => 21522, 24377 => 21526, - 24378 => 21510, 24379 => 21579, 24380 => 21586, 24381 => 21587, 24382 => 21588, - 24383 => 21590, 24384 => 21571, 24385 => 21537, 24386 => 21591, 24387 => 21593, - 24388 => 21539, 24389 => 21554, 24390 => 21634, 24391 => 21652, 24392 => 21623, - 24393 => 21617, 24394 => 21604, 24395 => 21658, 24396 => 21659, 24397 => 21636, - 24398 => 21622, 24399 => 21606, 24400 => 21661, 24401 => 21712, 24402 => 21677, - 24403 => 21698, 24404 => 21684, 24405 => 21714, 24406 => 21671, 24407 => 21670, - 24408 => 21715, 24409 => 21716, 24410 => 21618, 24411 => 21667, 24412 => 21717, - 24413 => 21691, 24414 => 21695, 24415 => 21708, 24416 => 21721, 24417 => 21722, - 24418 => 21724, 24419 => 21673, 24420 => 21674, 24421 => 21668, 24422 => 21725, - 24423 => 21711, 24424 => 21726, 24425 => 21787, 24426 => 21735, 24427 => 21792, - 24428 => 21757, 24429 => 21780, 24430 => 21747, 24431 => 21794, 24432 => 21795, - 24433 => 21775, 24434 => 21777, 24435 => 21799, 24436 => 21802, 24437 => 21863, - 24438 => 21903, 24439 => 21941, 24440 => 21833, 24441 => 21869, 24442 => 21825, - 24443 => 21845, 24444 => 21823, 24445 => 21840, 24446 => 21820, 24609 => 21815, - 24610 => 21846, 24611 => 21877, 24612 => 21878, 24613 => 21879, 24614 => 21811, - 24615 => 21808, 24616 => 21852, 24617 => 21899, 24618 => 21970, 24619 => 21891, - 24620 => 21937, 24621 => 21945, 24622 => 21896, 24623 => 21889, 24624 => 21919, - 24625 => 21886, 24626 => 21974, 24627 => 21905, 24628 => 21883, 24629 => 21983, - 24630 => 21949, 24631 => 21950, 24632 => 21908, 24633 => 21913, 24634 => 21994, - 24635 => 22007, 24636 => 21961, 24637 => 22047, 24638 => 21969, 24639 => 21995, - 24640 => 21996, 24641 => 21972, 24642 => 21990, 24643 => 21981, 24644 => 21956, - 24645 => 21999, 24646 => 21989, 24647 => 22002, 24648 => 22003, 24649 => 21964, - 24650 => 21965, 24651 => 21992, 24652 => 22005, 24653 => 21988, 24654 => 36756, - 24655 => 22046, 24656 => 22024, 24657 => 22028, 24658 => 22017, 24659 => 22052, - 24660 => 22051, 24661 => 22014, 24662 => 22016, 24663 => 22055, 24664 => 22061, - 24665 => 22104, 24666 => 22073, 24667 => 22103, 24668 => 22060, 24669 => 22093, - 24670 => 22114, 24671 => 22105, 24672 => 22108, 24673 => 22092, 24674 => 22100, - 24675 => 22150, 24676 => 22116, 24677 => 22129, 24678 => 22123, 24679 => 22139, - 24680 => 22140, 24681 => 22149, 24682 => 22163, 24683 => 22191, 24684 => 22228, - 24685 => 22231, 24686 => 22237, 24687 => 22241, 24688 => 22261, 24689 => 22251, - 24690 => 22265, 24691 => 22271, 24692 => 22276, 24693 => 22282, 24694 => 22281, - 24695 => 22300, 24696 => 24079, 24697 => 24089, 24698 => 24084, 24699 => 24081, - 24700 => 24113, 24701 => 24123, 24702 => 24124, 24865 => 24119, 24866 => 24132, - 24867 => 24148, 24868 => 24155, 24869 => 24158, 24870 => 24161, 24871 => 23692, - 24872 => 23674, 24873 => 23693, 24874 => 23696, 24875 => 23702, 24876 => 23688, - 24877 => 23704, 24878 => 23705, 24879 => 23697, 24880 => 23706, 24881 => 23708, - 24882 => 23733, 24883 => 23714, 24884 => 23741, 24885 => 23724, 24886 => 23723, - 24887 => 23729, 24888 => 23715, 24889 => 23745, 24890 => 23735, 24891 => 23748, - 24892 => 23762, 24893 => 23780, 24894 => 23755, 24895 => 23781, 24896 => 23810, - 24897 => 23811, 24898 => 23847, 24899 => 23846, 24900 => 23854, 24901 => 23844, - 24902 => 23838, 24903 => 23814, 24904 => 23835, 24905 => 23896, 24906 => 23870, - 24907 => 23860, 24908 => 23869, 24909 => 23916, 24910 => 23899, 24911 => 23919, - 24912 => 23901, 24913 => 23915, 24914 => 23883, 24915 => 23882, 24916 => 23913, - 24917 => 23924, 24918 => 23938, 24919 => 23961, 24920 => 23965, 24921 => 35955, - 24922 => 23991, 24923 => 24005, 24924 => 24435, 24925 => 24439, 24926 => 24450, - 24927 => 24455, 24928 => 24457, 24929 => 24460, 24930 => 24469, 24931 => 24473, - 24932 => 24476, 24933 => 24488, 24934 => 24493, 24935 => 24501, 24936 => 24508, - 24937 => 34914, 24938 => 24417, 24939 => 29357, 24940 => 29360, 24941 => 29364, - 24942 => 29367, 24943 => 29368, 24944 => 29379, 24945 => 29377, 24946 => 29390, - 24947 => 29389, 24948 => 29394, 24949 => 29416, 24950 => 29423, 24951 => 29417, - 24952 => 29426, 24953 => 29428, 24954 => 29431, 24955 => 29441, 24956 => 29427, - 24957 => 29443, 24958 => 29434, 25121 => 29435, 25122 => 29463, 25123 => 29459, - 25124 => 29473, 25125 => 29450, 25126 => 29470, 25127 => 29469, 25128 => 29461, - 25129 => 29474, 25130 => 29497, 25131 => 29477, 25132 => 29484, 25133 => 29496, - 25134 => 29489, 25135 => 29520, 25136 => 29517, 25137 => 29527, 25138 => 29536, - 25139 => 29548, 25140 => 29551, 25141 => 29566, 25142 => 33307, 25143 => 22821, - 25144 => 39143, 25145 => 22820, 25146 => 22786, 25147 => 39267, 25148 => 39271, - 25149 => 39272, 25150 => 39273, 25151 => 39274, 25152 => 39275, 25153 => 39276, - 25154 => 39284, 25155 => 39287, 25156 => 39293, 25157 => 39296, 25158 => 39300, - 25159 => 39303, 25160 => 39306, 25161 => 39309, 25162 => 39312, 25163 => 39313, - 25164 => 39315, 25165 => 39316, 25166 => 39317, 25167 => 24192, 25168 => 24209, - 25169 => 24203, 25170 => 24214, 25171 => 24229, 25172 => 24224, 25173 => 24249, - 25174 => 24245, 25175 => 24254, 25176 => 24243, 25177 => 36179, 25178 => 24274, - 25179 => 24273, 25180 => 24283, 25181 => 24296, 25182 => 24298, 25183 => 33210, - 25184 => 24516, 25185 => 24521, 25186 => 24534, 25187 => 24527, 25188 => 24579, - 25189 => 24558, 25190 => 24580, 25191 => 24545, 25192 => 24548, 25193 => 24574, - 25194 => 24581, 25195 => 24582, 25196 => 24554, 25197 => 24557, 25198 => 24568, - 25199 => 24601, 25200 => 24629, 25201 => 24614, 25202 => 24603, 25203 => 24591, - 25204 => 24589, 25205 => 24617, 25206 => 24619, 25207 => 24586, 25208 => 24639, - 25209 => 24609, 25210 => 24696, 25211 => 24697, 25212 => 24699, 25213 => 24698, - 25214 => 24642, 25377 => 24682, 25378 => 24701, 25379 => 24726, 25380 => 24730, - 25381 => 24749, 25382 => 24733, 25383 => 24707, 25384 => 24722, 25385 => 24716, - 25386 => 24731, 25387 => 24812, 25388 => 24763, 25389 => 24753, 25390 => 24797, - 25391 => 24792, 25392 => 24774, 25393 => 24794, 25394 => 24756, 25395 => 24864, - 25396 => 24870, 25397 => 24853, 25398 => 24867, 25399 => 24820, 25400 => 24832, - 25401 => 24846, 25402 => 24875, 25403 => 24906, 25404 => 24949, 25405 => 25004, - 25406 => 24980, 25407 => 24999, 25408 => 25015, 25409 => 25044, 25410 => 25077, - 25411 => 24541, 25412 => 38579, 25413 => 38377, 25414 => 38379, 25415 => 38385, - 25416 => 38387, 25417 => 38389, 25418 => 38390, 25419 => 38396, 25420 => 38398, - 25421 => 38403, 25422 => 38404, 25423 => 38406, 25424 => 38408, 25425 => 38410, - 25426 => 38411, 25427 => 38412, 25428 => 38413, 25429 => 38415, 25430 => 38418, - 25431 => 38421, 25432 => 38422, 25433 => 38423, 25434 => 38425, 25435 => 38426, - 25436 => 20012, 25437 => 29247, 25438 => 25109, 25439 => 27701, 25440 => 27732, - 25441 => 27740, 25442 => 27722, 25443 => 27811, 25444 => 27781, 25445 => 27792, - 25446 => 27796, 25447 => 27788, 25448 => 27752, 25449 => 27753, 25450 => 27764, - 25451 => 27766, 25452 => 27782, 25453 => 27817, 25454 => 27856, 25455 => 27860, - 25456 => 27821, 25457 => 27895, 25458 => 27896, 25459 => 27889, 25460 => 27863, - 25461 => 27826, 25462 => 27872, 25463 => 27862, 25464 => 27898, 25465 => 27883, - 25466 => 27886, 25467 => 27825, 25468 => 27859, 25469 => 27887, 25470 => 27902, - 25633 => 27961, 25634 => 27943, 25635 => 27916, 25636 => 27971, 25637 => 27976, - 25638 => 27911, 25639 => 27908, 25640 => 27929, 25641 => 27918, 25642 => 27947, - 25643 => 27981, 25644 => 27950, 25645 => 27957, 25646 => 27930, 25647 => 27983, - 25648 => 27986, 25649 => 27988, 25650 => 27955, 25651 => 28049, 25652 => 28015, - 25653 => 28062, 25654 => 28064, 25655 => 27998, 25656 => 28051, 25657 => 28052, - 25658 => 27996, 25659 => 28000, 25660 => 28028, 25661 => 28003, 25662 => 28186, - 25663 => 28103, 25664 => 28101, 25665 => 28126, 25666 => 28174, 25667 => 28095, - 25668 => 28128, 25669 => 28177, 25670 => 28134, 25671 => 28125, 25672 => 28121, - 25673 => 28182, 25674 => 28075, 25675 => 28172, 25676 => 28078, 25677 => 28203, - 25678 => 28270, 25679 => 28238, 25680 => 28267, 25681 => 28338, 25682 => 28255, - 25683 => 28294, 25684 => 28243, 25685 => 28244, 25686 => 28210, 25687 => 28197, - 25688 => 28228, 25689 => 28383, 25690 => 28337, 25691 => 28312, 25692 => 28384, - 25693 => 28461, 25694 => 28386, 25695 => 28325, 25696 => 28327, 25697 => 28349, - 25698 => 28347, 25699 => 28343, 25700 => 28375, 25701 => 28340, 25702 => 28367, - 25703 => 28303, 25704 => 28354, 25705 => 28319, 25706 => 28514, 25707 => 28486, - 25708 => 28487, 25709 => 28452, 25710 => 28437, 25711 => 28409, 25712 => 28463, - 25713 => 28470, 25714 => 28491, 25715 => 28532, 25716 => 28458, 25717 => 28425, - 25718 => 28457, 25719 => 28553, 25720 => 28557, 25721 => 28556, 25722 => 28536, - 25723 => 28530, 25724 => 28540, 25725 => 28538, 25726 => 28625, 25889 => 28617, - 25890 => 28583, 25891 => 28601, 25892 => 28598, 25893 => 28610, 25894 => 28641, - 25895 => 28654, 25896 => 28638, 25897 => 28640, 25898 => 28655, 25899 => 28698, - 25900 => 28707, 25901 => 28699, 25902 => 28729, 25903 => 28725, 25904 => 28751, - 25905 => 28766, 25906 => 23424, 25907 => 23428, 25908 => 23445, 25909 => 23443, - 25910 => 23461, 25911 => 23480, 25912 => 29999, 25913 => 39582, 25914 => 25652, - 25915 => 23524, 25916 => 23534, 25917 => 35120, 25918 => 23536, 25919 => 36423, - 25920 => 35591, 25921 => 36790, 25922 => 36819, 25923 => 36821, 25924 => 36837, - 25925 => 36846, 25926 => 36836, 25927 => 36841, 25928 => 36838, 25929 => 36851, - 25930 => 36840, 25931 => 36869, 25932 => 36868, 25933 => 36875, 25934 => 36902, - 25935 => 36881, 25936 => 36877, 25937 => 36886, 25938 => 36897, 25939 => 36917, - 25940 => 36918, 25941 => 36909, 25942 => 36911, 25943 => 36932, 25944 => 36945, - 25945 => 36946, 25946 => 36944, 25947 => 36968, 25948 => 36952, 25949 => 36962, - 25950 => 36955, 25951 => 26297, 25952 => 36980, 25953 => 36989, 25954 => 36994, - 25955 => 37000, 25956 => 36995, 25957 => 37003, 25958 => 24400, 25959 => 24407, - 25960 => 24406, 25961 => 24408, 25962 => 23611, 25963 => 21675, 25964 => 23632, - 25965 => 23641, 25966 => 23409, 25967 => 23651, 25968 => 23654, 25969 => 32700, - 25970 => 24362, 25971 => 24361, 25972 => 24365, 25973 => 33396, 25974 => 24380, - 25975 => 39739, 25976 => 23662, 25977 => 22913, 25978 => 22915, 25979 => 22925, - 25980 => 22953, 25981 => 22954, 25982 => 22947, 26145 => 22935, 26146 => 22986, - 26147 => 22955, 26148 => 22942, 26149 => 22948, 26150 => 22994, 26151 => 22962, - 26152 => 22959, 26153 => 22999, 26154 => 22974, 26155 => 23045, 26156 => 23046, - 26157 => 23005, 26158 => 23048, 26159 => 23011, 26160 => 23000, 26161 => 23033, - 26162 => 23052, 26163 => 23049, 26164 => 23090, 26165 => 23092, 26166 => 23057, - 26167 => 23075, 26168 => 23059, 26169 => 23104, 26170 => 23143, 26171 => 23114, - 26172 => 23125, 26173 => 23100, 26174 => 23138, 26175 => 23157, 26176 => 33004, - 26177 => 23210, 26178 => 23195, 26179 => 23159, 26180 => 23162, 26181 => 23230, - 26182 => 23275, 26183 => 23218, 26184 => 23250, 26185 => 23252, 26186 => 23224, - 26187 => 23264, 26188 => 23267, 26189 => 23281, 26190 => 23254, 26191 => 23270, - 26192 => 23256, 26193 => 23260, 26194 => 23305, 26195 => 23319, 26196 => 23318, - 26197 => 23346, 26198 => 23351, 26199 => 23360, 26200 => 23573, 26201 => 23580, - 26202 => 23386, 26203 => 23397, 26204 => 23411, 26205 => 23377, 26206 => 23379, - 26207 => 23394, 26208 => 39541, 26209 => 39543, 26210 => 39544, 26211 => 39546, - 26212 => 39551, 26213 => 39549, 26214 => 39552, 26215 => 39553, 26216 => 39557, - 26217 => 39560, 26218 => 39562, 26219 => 39568, 26220 => 39570, 26221 => 39571, - 26222 => 39574, 26223 => 39576, 26224 => 39579, 26225 => 39580, 26226 => 39581, - 26227 => 39583, 26228 => 39584, 26229 => 39586, 26230 => 39587, 26231 => 39589, - 26232 => 39591, 26233 => 32415, 26234 => 32417, 26235 => 32419, 26236 => 32421, - 26237 => 32424, 26238 => 32425, 26401 => 32429, 26402 => 32432, 26403 => 32446, - 26404 => 32448, 26405 => 32449, 26406 => 32450, 26407 => 32457, 26408 => 32459, - 26409 => 32460, 26410 => 32464, 26411 => 32468, 26412 => 32471, 26413 => 32475, - 26414 => 32480, 26415 => 32481, 26416 => 32488, 26417 => 32491, 26418 => 32494, - 26419 => 32495, 26420 => 32497, 26421 => 32498, 26422 => 32525, 26423 => 32502, - 26424 => 32506, 26425 => 32507, 26426 => 32510, 26427 => 32513, 26428 => 32514, - 26429 => 32515, 26430 => 32519, 26431 => 32520, 26432 => 32523, 26433 => 32524, - 26434 => 32527, 26435 => 32529, 26436 => 32530, 26437 => 32535, 26438 => 32537, - 26439 => 32540, 26440 => 32539, 26441 => 32543, 26442 => 32545, 26443 => 32546, - 26444 => 32547, 26445 => 32548, 26446 => 32549, 26447 => 32550, 26448 => 32551, - 26449 => 32554, 26450 => 32555, 26451 => 32556, 26452 => 32557, 26453 => 32559, - 26454 => 32560, 26455 => 32561, 26456 => 32562, 26457 => 32563, 26458 => 32565, - 26459 => 24186, 26460 => 30079, 26461 => 24027, 26462 => 30014, 26463 => 37013, - 26464 => 29582, 26465 => 29585, 26466 => 29614, 26467 => 29602, 26468 => 29599, - 26469 => 29647, 26470 => 29634, 26471 => 29649, 26472 => 29623, 26473 => 29619, - 26474 => 29632, 26475 => 29641, 26476 => 29640, 26477 => 29669, 26478 => 29657, - 26479 => 39036, 26480 => 29706, 26481 => 29673, 26482 => 29671, 26483 => 29662, - 26484 => 29626, 26485 => 29682, 26486 => 29711, 26487 => 29738, 26488 => 29787, - 26489 => 29734, 26490 => 29733, 26491 => 29736, 26492 => 29744, 26493 => 29742, - 26494 => 29740, 26657 => 29723, 26658 => 29722, 26659 => 29761, 26660 => 29788, - 26661 => 29783, 26662 => 29781, 26663 => 29785, 26664 => 29815, 26665 => 29805, - 26666 => 29822, 26667 => 29852, 26668 => 29838, 26669 => 29824, 26670 => 29825, - 26671 => 29831, 26672 => 29835, 26673 => 29854, 26674 => 29864, 26675 => 29865, - 26676 => 29840, 26677 => 29863, 26678 => 29906, 26679 => 29882, 26680 => 38890, - 26681 => 38891, 26682 => 38892, 26683 => 26444, 26684 => 26451, 26685 => 26462, - 26686 => 26440, 26687 => 26473, 26688 => 26533, 26689 => 26503, 26690 => 26474, - 26691 => 26483, 26692 => 26520, 26693 => 26535, 26694 => 26485, 26695 => 26536, - 26696 => 26526, 26697 => 26541, 26698 => 26507, 26699 => 26487, 26700 => 26492, - 26701 => 26608, 26702 => 26633, 26703 => 26584, 26704 => 26634, 26705 => 26601, - 26706 => 26544, 26707 => 26636, 26708 => 26585, 26709 => 26549, 26710 => 26586, - 26711 => 26547, 26712 => 26589, 26713 => 26624, 26714 => 26563, 26715 => 26552, - 26716 => 26594, 26717 => 26638, 26718 => 26561, 26719 => 26621, 26720 => 26674, - 26721 => 26675, 26722 => 26720, 26723 => 26721, 26724 => 26702, 26725 => 26722, - 26726 => 26692, 26727 => 26724, 26728 => 26755, 26729 => 26653, 26730 => 26709, - 26731 => 26726, 26732 => 26689, 26733 => 26727, 26734 => 26688, 26735 => 26686, - 26736 => 26698, 26737 => 26697, 26738 => 26665, 26739 => 26805, 26740 => 26767, - 26741 => 26740, 26742 => 26743, 26743 => 26771, 26744 => 26731, 26745 => 26818, - 26746 => 26990, 26747 => 26876, 26748 => 26911, 26749 => 26912, 26750 => 26873, - 26913 => 26916, 26914 => 26864, 26915 => 26891, 26916 => 26881, 26917 => 26967, - 26918 => 26851, 26919 => 26896, 26920 => 26993, 26921 => 26937, 26922 => 26976, - 26923 => 26946, 26924 => 26973, 26925 => 27012, 26926 => 26987, 26927 => 27008, - 26928 => 27032, 26929 => 27000, 26930 => 26932, 26931 => 27084, 26932 => 27015, - 26933 => 27016, 26934 => 27086, 26935 => 27017, 26936 => 26982, 26937 => 26979, - 26938 => 27001, 26939 => 27035, 26940 => 27047, 26941 => 27067, 26942 => 27051, - 26943 => 27053, 26944 => 27092, 26945 => 27057, 26946 => 27073, 26947 => 27082, - 26948 => 27103, 26949 => 27029, 26950 => 27104, 26951 => 27021, 26952 => 27135, - 26953 => 27183, 26954 => 27117, 26955 => 27159, 26956 => 27160, 26957 => 27237, - 26958 => 27122, 26959 => 27204, 26960 => 27198, 26961 => 27296, 26962 => 27216, - 26963 => 27227, 26964 => 27189, 26965 => 27278, 26966 => 27257, 26967 => 27197, - 26968 => 27176, 26969 => 27224, 26970 => 27260, 26971 => 27281, 26972 => 27280, - 26973 => 27305, 26974 => 27287, 26975 => 27307, 26976 => 29495, 26977 => 29522, - 26978 => 27521, 26979 => 27522, 26980 => 27527, 26981 => 27524, 26982 => 27538, - 26983 => 27539, 26984 => 27533, 26985 => 27546, 26986 => 27547, 26987 => 27553, - 26988 => 27562, 26989 => 36715, 26990 => 36717, 26991 => 36721, 26992 => 36722, - 26993 => 36723, 26994 => 36725, 26995 => 36726, 26996 => 36728, 26997 => 36727, - 26998 => 36729, 26999 => 36730, 27000 => 36732, 27001 => 36734, 27002 => 36737, - 27003 => 36738, 27004 => 36740, 27005 => 36743, 27006 => 36747, 27169 => 36749, - 27170 => 36750, 27171 => 36751, 27172 => 36760, 27173 => 36762, 27174 => 36558, - 27175 => 25099, 27176 => 25111, 27177 => 25115, 27178 => 25119, 27179 => 25122, - 27180 => 25121, 27181 => 25125, 27182 => 25124, 27183 => 25132, 27184 => 33255, - 27185 => 29935, 27186 => 29940, 27187 => 29951, 27188 => 29967, 27189 => 29969, - 27190 => 29971, 27191 => 25908, 27192 => 26094, 27193 => 26095, 27194 => 26096, - 27195 => 26122, 27196 => 26137, 27197 => 26482, 27198 => 26115, 27199 => 26133, - 27200 => 26112, 27201 => 28805, 27202 => 26359, 27203 => 26141, 27204 => 26164, - 27205 => 26161, 27206 => 26166, 27207 => 26165, 27208 => 32774, 27209 => 26207, - 27210 => 26196, 27211 => 26177, 27212 => 26191, 27213 => 26198, 27214 => 26209, - 27215 => 26199, 27216 => 26231, 27217 => 26244, 27218 => 26252, 27219 => 26279, - 27220 => 26269, 27221 => 26302, 27222 => 26331, 27223 => 26332, 27224 => 26342, - 27225 => 26345, 27226 => 36146, 27227 => 36147, 27228 => 36150, 27229 => 36155, - 27230 => 36157, 27231 => 36160, 27232 => 36165, 27233 => 36166, 27234 => 36168, - 27235 => 36169, 27236 => 36167, 27237 => 36173, 27238 => 36181, 27239 => 36185, - 27240 => 35271, 27241 => 35274, 27242 => 35275, 27243 => 35276, 27244 => 35278, - 27245 => 35279, 27246 => 35280, 27247 => 35281, 27248 => 29294, 27249 => 29343, - 27250 => 29277, 27251 => 29286, 27252 => 29295, 27253 => 29310, 27254 => 29311, - 27255 => 29316, 27256 => 29323, 27257 => 29325, 27258 => 29327, 27259 => 29330, - 27260 => 25352, 27261 => 25394, 27262 => 25520, 27425 => 25663, 27426 => 25816, - 27427 => 32772, 27428 => 27626, 27429 => 27635, 27430 => 27645, 27431 => 27637, - 27432 => 27641, 27433 => 27653, 27434 => 27655, 27435 => 27654, 27436 => 27661, - 27437 => 27669, 27438 => 27672, 27439 => 27673, 27440 => 27674, 27441 => 27681, - 27442 => 27689, 27443 => 27684, 27444 => 27690, 27445 => 27698, 27446 => 25909, - 27447 => 25941, 27448 => 25963, 27449 => 29261, 27450 => 29266, 27451 => 29270, - 27452 => 29232, 27453 => 34402, 27454 => 21014, 27455 => 32927, 27456 => 32924, - 27457 => 32915, 27458 => 32956, 27459 => 26378, 27460 => 32957, 27461 => 32945, - 27462 => 32939, 27463 => 32941, 27464 => 32948, 27465 => 32951, 27466 => 32999, - 27467 => 33000, 27468 => 33001, 27469 => 33002, 27470 => 32987, 27471 => 32962, - 27472 => 32964, 27473 => 32985, 27474 => 32973, 27475 => 32983, 27476 => 26384, - 27477 => 32989, 27478 => 33003, 27479 => 33009, 27480 => 33012, 27481 => 33005, - 27482 => 33037, 27483 => 33038, 27484 => 33010, 27485 => 33020, 27486 => 26389, - 27487 => 33042, 27488 => 35930, 27489 => 33078, 27490 => 33054, 27491 => 33068, - 27492 => 33048, 27493 => 33074, 27494 => 33096, 27495 => 33100, 27496 => 33107, - 27497 => 33140, 27498 => 33113, 27499 => 33114, 27500 => 33137, 27501 => 33120, - 27502 => 33129, 27503 => 33148, 27504 => 33149, 27505 => 33133, 27506 => 33127, - 27507 => 22605, 27508 => 23221, 27509 => 33160, 27510 => 33154, 27511 => 33169, - 27512 => 28373, 27513 => 33187, 27514 => 33194, 27515 => 33228, 27516 => 26406, - 27517 => 33226, 27518 => 33211, 27681 => 33217, 27682 => 33190, 27683 => 27428, - 27684 => 27447, 27685 => 27449, 27686 => 27459, 27687 => 27462, 27688 => 27481, - 27689 => 39121, 27690 => 39122, 27691 => 39123, 27692 => 39125, 27693 => 39129, - 27694 => 39130, 27695 => 27571, 27696 => 24384, 27697 => 27586, 27698 => 35315, - 27699 => 26000, 27700 => 40785, 27701 => 26003, 27702 => 26044, 27703 => 26054, - 27704 => 26052, 27705 => 26051, 27706 => 26060, 27707 => 26062, 27708 => 26066, - 27709 => 26070, 27710 => 28800, 27711 => 28828, 27712 => 28822, 27713 => 28829, - 27714 => 28859, 27715 => 28864, 27716 => 28855, 27717 => 28843, 27718 => 28849, - 27719 => 28904, 27720 => 28874, 27721 => 28944, 27722 => 28947, 27723 => 28950, - 27724 => 28975, 27725 => 28977, 27726 => 29043, 27727 => 29020, 27728 => 29032, - 27729 => 28997, 27730 => 29042, 27731 => 29002, 27732 => 29048, 27733 => 29050, - 27734 => 29080, 27735 => 29107, 27736 => 29109, 27737 => 29096, 27738 => 29088, - 27739 => 29152, 27740 => 29140, 27741 => 29159, 27742 => 29177, 27743 => 29213, - 27744 => 29224, 27745 => 28780, 27746 => 28952, 27747 => 29030, 27748 => 29113, - 27749 => 25150, 27750 => 25149, 27751 => 25155, 27752 => 25160, 27753 => 25161, - 27754 => 31035, 27755 => 31040, 27756 => 31046, 27757 => 31049, 27758 => 31067, - 27759 => 31068, 27760 => 31059, 27761 => 31066, 27762 => 31074, 27763 => 31063, - 27764 => 31072, 27765 => 31087, 27766 => 31079, 27767 => 31098, 27768 => 31109, - 27769 => 31114, 27770 => 31130, 27771 => 31143, 27772 => 31155, 27773 => 24529, - 27774 => 24528, 27937 => 24636, 27938 => 24669, 27939 => 24666, 27940 => 24679, - 27941 => 24641, 27942 => 24665, 27943 => 24675, 27944 => 24747, 27945 => 24838, - 27946 => 24845, 27947 => 24925, 27948 => 25001, 27949 => 24989, 27950 => 25035, - 27951 => 25041, 27952 => 25094, 27953 => 32896, 27954 => 32895, 27955 => 27795, - 27956 => 27894, 27957 => 28156, 27958 => 30710, 27959 => 30712, 27960 => 30720, - 27961 => 30729, 27962 => 30743, 27963 => 30744, 27964 => 30737, 27965 => 26027, - 27966 => 30765, 27967 => 30748, 27968 => 30749, 27969 => 30777, 27970 => 30778, - 27971 => 30779, 27972 => 30751, 27973 => 30780, 27974 => 30757, 27975 => 30764, - 27976 => 30755, 27977 => 30761, 27978 => 30798, 27979 => 30829, 27980 => 30806, - 27981 => 30807, 27982 => 30758, 27983 => 30800, 27984 => 30791, 27985 => 30796, - 27986 => 30826, 27987 => 30875, 27988 => 30867, 27989 => 30874, 27990 => 30855, - 27991 => 30876, 27992 => 30881, 27993 => 30883, 27994 => 30898, 27995 => 30905, - 27996 => 30885, 27997 => 30932, 27998 => 30937, 27999 => 30921, 28000 => 30956, - 28001 => 30962, 28002 => 30981, 28003 => 30964, 28004 => 30995, 28005 => 31012, - 28006 => 31006, 28007 => 31028, 28008 => 40859, 28009 => 40697, 28010 => 40699, - 28011 => 40700, 28012 => 30449, 28013 => 30468, 28014 => 30477, 28015 => 30457, - 28016 => 30471, 28017 => 30472, 28018 => 30490, 28019 => 30498, 28020 => 30489, - 28021 => 30509, 28022 => 30502, 28023 => 30517, 28024 => 30520, 28025 => 30544, - 28026 => 30545, 28027 => 30535, 28028 => 30531, 28029 => 30554, 28030 => 30568, - 28193 => 30562, 28194 => 30565, 28195 => 30591, 28196 => 30605, 28197 => 30589, - 28198 => 30592, 28199 => 30604, 28200 => 30609, 28201 => 30623, 28202 => 30624, - 28203 => 30640, 28204 => 30645, 28205 => 30653, 28206 => 30010, 28207 => 30016, - 28208 => 30030, 28209 => 30027, 28210 => 30024, 28211 => 30043, 28212 => 30066, - 28213 => 30073, 28214 => 30083, 28215 => 32600, 28216 => 32609, 28217 => 32607, - 28218 => 35400, 28219 => 32616, 28220 => 32628, 28221 => 32625, 28222 => 32633, - 28223 => 32641, 28224 => 32638, 28225 => 30413, 28226 => 30437, 28227 => 34866, - 28228 => 38021, 28229 => 38022, 28230 => 38023, 28231 => 38027, 28232 => 38026, - 28233 => 38028, 28234 => 38029, 28235 => 38031, 28236 => 38032, 28237 => 38036, - 28238 => 38039, 28239 => 38037, 28240 => 38042, 28241 => 38043, 28242 => 38044, - 28243 => 38051, 28244 => 38052, 28245 => 38059, 28246 => 38058, 28247 => 38061, - 28248 => 38060, 28249 => 38063, 28250 => 38064, 28251 => 38066, 28252 => 38068, - 28253 => 38070, 28254 => 38071, 28255 => 38072, 28256 => 38073, 28257 => 38074, - 28258 => 38076, 28259 => 38077, 28260 => 38079, 28261 => 38084, 28262 => 38088, - 28263 => 38089, 28264 => 38090, 28265 => 38091, 28266 => 38092, 28267 => 38093, - 28268 => 38094, 28269 => 38096, 28270 => 38097, 28271 => 38098, 28272 => 38101, - 28273 => 38102, 28274 => 38103, 28275 => 38105, 28276 => 38104, 28277 => 38107, - 28278 => 38110, 28279 => 38111, 28280 => 38112, 28281 => 38114, 28282 => 38116, - 28283 => 38117, 28284 => 38119, 28285 => 38120, 28286 => 38122, 28449 => 38121, - 28450 => 38123, 28451 => 38126, 28452 => 38127, 28453 => 38131, 28454 => 38132, - 28455 => 38133, 28456 => 38135, 28457 => 38137, 28458 => 38140, 28459 => 38141, - 28460 => 38143, 28461 => 38147, 28462 => 38146, 28463 => 38150, 28464 => 38151, - 28465 => 38153, 28466 => 38154, 28467 => 38157, 28468 => 38158, 28469 => 38159, - 28470 => 38162, 28471 => 38163, 28472 => 38164, 28473 => 38165, 28474 => 38166, - 28475 => 38168, 28476 => 38171, 28477 => 38173, 28478 => 38174, 28479 => 38175, - 28480 => 38178, 28481 => 38186, 28482 => 38187, 28483 => 38185, 28484 => 38188, - 28485 => 38193, 28486 => 38194, 28487 => 38196, 28488 => 38198, 28489 => 38199, - 28490 => 38200, 28491 => 38204, 28492 => 38206, 28493 => 38207, 28494 => 38210, - 28495 => 38197, 28496 => 38212, 28497 => 38213, 28498 => 38214, 28499 => 38217, - 28500 => 38220, 28501 => 38222, 28502 => 38223, 28503 => 38226, 28504 => 38227, - 28505 => 38228, 28506 => 38230, 28507 => 38231, 28508 => 38232, 28509 => 38233, - 28510 => 38235, 28511 => 38238, 28512 => 38239, 28513 => 38237, 28514 => 38241, - 28515 => 38242, 28516 => 38244, 28517 => 38245, 28518 => 38246, 28519 => 38247, - 28520 => 38248, 28521 => 38249, 28522 => 38250, 28523 => 38251, 28524 => 38252, - 28525 => 38255, 28526 => 38257, 28527 => 38258, 28528 => 38259, 28529 => 38202, - 28530 => 30695, 28531 => 30700, 28532 => 38601, 28533 => 31189, 28534 => 31213, - 28535 => 31203, 28536 => 31211, 28537 => 31238, 28538 => 23879, 28539 => 31235, - 28540 => 31234, 28541 => 31262, 28542 => 31252, 28705 => 31289, 28706 => 31287, - 28707 => 31313, 28708 => 40655, 28709 => 39333, 28710 => 31344, 28711 => 30344, - 28712 => 30350, 28713 => 30355, 28714 => 30361, 28715 => 30372, 28716 => 29918, - 28717 => 29920, 28718 => 29996, 28719 => 40480, 28720 => 40482, 28721 => 40488, - 28722 => 40489, 28723 => 40490, 28724 => 40491, 28725 => 40492, 28726 => 40498, - 28727 => 40497, 28728 => 40502, 28729 => 40504, 28730 => 40503, 28731 => 40505, - 28732 => 40506, 28733 => 40510, 28734 => 40513, 28735 => 40514, 28736 => 40516, - 28737 => 40518, 28738 => 40519, 28739 => 40520, 28740 => 40521, 28741 => 40523, - 28742 => 40524, 28743 => 40526, 28744 => 40529, 28745 => 40533, 28746 => 40535, - 28747 => 40538, 28748 => 40539, 28749 => 40540, 28750 => 40542, 28751 => 40547, - 28752 => 40550, 28753 => 40551, 28754 => 40552, 28755 => 40553, 28756 => 40554, - 28757 => 40555, 28758 => 40556, 28759 => 40561, 28760 => 40557, 28761 => 40563, - 28762 => 30098, 28763 => 30100, 28764 => 30102, 28765 => 30112, 28766 => 30109, - 28767 => 30124, 28768 => 30115, 28769 => 30131, 28770 => 30132, 28771 => 30136, - 28772 => 30148, 28773 => 30129, 28774 => 30128, 28775 => 30147, 28776 => 30146, - 28777 => 30166, 28778 => 30157, 28779 => 30179, 28780 => 30184, 28781 => 30182, - 28782 => 30180, 28783 => 30187, 28784 => 30183, 28785 => 30211, 28786 => 30193, - 28787 => 30204, 28788 => 30207, 28789 => 30224, 28790 => 30208, 28791 => 30213, - 28792 => 30220, 28793 => 30231, 28794 => 30218, 28795 => 30245, 28796 => 30232, - 28797 => 30229, 28798 => 30233, 28961 => 30235, 28962 => 30268, 28963 => 30242, - 28964 => 30240, 28965 => 30272, 28966 => 30253, 28967 => 30256, 28968 => 30271, - 28969 => 30261, 28970 => 30275, 28971 => 30270, 28972 => 30259, 28973 => 30285, - 28974 => 30302, 28975 => 30292, 28976 => 30300, 28977 => 30294, 28978 => 30315, - 28979 => 30319, 28980 => 32714, 28981 => 31462, 28982 => 31352, 28983 => 31353, - 28984 => 31360, 28985 => 31366, 28986 => 31368, 28987 => 31381, 28988 => 31398, - 28989 => 31392, 28990 => 31404, 28991 => 31400, 28992 => 31405, 28993 => 31411, - 28994 => 34916, 28995 => 34921, 28996 => 34930, 28997 => 34941, 28998 => 34943, - 28999 => 34946, 29000 => 34978, 29001 => 35014, 29002 => 34999, 29003 => 35004, - 29004 => 35017, 29005 => 35042, 29006 => 35022, 29007 => 35043, 29008 => 35045, - 29009 => 35057, 29010 => 35098, 29011 => 35068, 29012 => 35048, 29013 => 35070, - 29014 => 35056, 29015 => 35105, 29016 => 35097, 29017 => 35091, 29018 => 35099, - 29019 => 35082, 29020 => 35124, 29021 => 35115, 29022 => 35126, 29023 => 35137, - 29024 => 35174, 29025 => 35195, 29026 => 30091, 29027 => 32997, 29028 => 30386, - 29029 => 30388, 29030 => 30684, 29031 => 32786, 29032 => 32788, 29033 => 32790, - 29034 => 32796, 29035 => 32800, 29036 => 32802, 29037 => 32805, 29038 => 32806, - 29039 => 32807, 29040 => 32809, 29041 => 32808, 29042 => 32817, 29043 => 32779, - 29044 => 32821, 29045 => 32835, 29046 => 32838, 29047 => 32845, 29048 => 32850, - 29049 => 32873, 29050 => 32881, 29051 => 35203, 29052 => 39032, 29053 => 39040, - 29054 => 39043, 29217 => 39049, 29218 => 39052, 29219 => 39053, 29220 => 39055, - 29221 => 39060, 29222 => 39066, 29223 => 39067, 29224 => 39070, 29225 => 39071, - 29226 => 39073, 29227 => 39074, 29228 => 39077, 29229 => 39078, 29230 => 34381, - 29231 => 34388, 29232 => 34412, 29233 => 34414, 29234 => 34431, 29235 => 34426, - 29236 => 34428, 29237 => 34427, 29238 => 34472, 29239 => 34445, 29240 => 34443, - 29241 => 34476, 29242 => 34461, 29243 => 34471, 29244 => 34467, 29245 => 34474, - 29246 => 34451, 29247 => 34473, 29248 => 34486, 29249 => 34500, 29250 => 34485, - 29251 => 34510, 29252 => 34480, 29253 => 34490, 29254 => 34481, 29255 => 34479, - 29256 => 34505, 29257 => 34511, 29258 => 34484, 29259 => 34537, 29260 => 34545, - 29261 => 34546, 29262 => 34541, 29263 => 34547, 29264 => 34512, 29265 => 34579, - 29266 => 34526, 29267 => 34548, 29268 => 34527, 29269 => 34520, 29270 => 34513, - 29271 => 34563, 29272 => 34567, 29273 => 34552, 29274 => 34568, 29275 => 34570, - 29276 => 34573, 29277 => 34569, 29278 => 34595, 29279 => 34619, 29280 => 34590, - 29281 => 34597, 29282 => 34606, 29283 => 34586, 29284 => 34622, 29285 => 34632, - 29286 => 34612, 29287 => 34609, 29288 => 34601, 29289 => 34615, 29290 => 34623, - 29291 => 34690, 29292 => 34594, 29293 => 34685, 29294 => 34686, 29295 => 34683, - 29296 => 34656, 29297 => 34672, 29298 => 34636, 29299 => 34670, 29300 => 34699, - 29301 => 34643, 29302 => 34659, 29303 => 34684, 29304 => 34660, 29305 => 34649, - 29306 => 34661, 29307 => 34707, 29308 => 34735, 29309 => 34728, 29310 => 34770, - 29473 => 34758, 29474 => 34696, 29475 => 34693, 29476 => 34733, 29477 => 34711, - 29478 => 34691, 29479 => 34731, 29480 => 34789, 29481 => 34732, 29482 => 34741, - 29483 => 34739, 29484 => 34763, 29485 => 34771, 29486 => 34749, 29487 => 34769, - 29488 => 34752, 29489 => 34762, 29490 => 34779, 29491 => 34794, 29492 => 34784, - 29493 => 34798, 29494 => 34838, 29495 => 34835, 29496 => 34814, 29497 => 34826, - 29498 => 34843, 29499 => 34849, 29500 => 34873, 29501 => 34876, 29502 => 32566, - 29503 => 32578, 29504 => 32580, 29505 => 32581, 29506 => 33296, 29507 => 31482, - 29508 => 31485, 29509 => 31496, 29510 => 31491, 29511 => 31492, 29512 => 31509, - 29513 => 31498, 29514 => 31531, 29515 => 31503, 29516 => 31559, 29517 => 31544, - 29518 => 31530, 29519 => 31513, 29520 => 31534, 29521 => 31537, 29522 => 31520, - 29523 => 31525, 29524 => 31524, 29525 => 31539, 29526 => 31550, 29527 => 31518, - 29528 => 31576, 29529 => 31578, 29530 => 31557, 29531 => 31605, 29532 => 31564, - 29533 => 31581, 29534 => 31584, 29535 => 31598, 29536 => 31611, 29537 => 31586, - 29538 => 31602, 29539 => 31601, 29540 => 31632, 29541 => 31654, 29542 => 31655, - 29543 => 31672, 29544 => 31660, 29545 => 31645, 29546 => 31656, 29547 => 31621, - 29548 => 31658, 29549 => 31644, 29550 => 31650, 29551 => 31659, 29552 => 31668, - 29553 => 31697, 29554 => 31681, 29555 => 31692, 29556 => 31709, 29557 => 31706, - 29558 => 31717, 29559 => 31718, 29560 => 31722, 29561 => 31756, 29562 => 31742, - 29563 => 31740, 29564 => 31759, 29565 => 31766, 29566 => 31755, 29729 => 31775, - 29730 => 31786, 29731 => 31782, 29732 => 31800, 29733 => 31809, 29734 => 31808, - 29735 => 33278, 29736 => 33281, 29737 => 33282, 29738 => 33284, 29739 => 33260, - 29740 => 34884, 29741 => 33313, 29742 => 33314, 29743 => 33315, 29744 => 33325, - 29745 => 33327, 29746 => 33320, 29747 => 33323, 29748 => 33336, 29749 => 33339, - 29750 => 33331, 29751 => 33332, 29752 => 33342, 29753 => 33348, 29754 => 33353, - 29755 => 33355, 29756 => 33359, 29757 => 33370, 29758 => 33375, 29759 => 33384, - 29760 => 34942, 29761 => 34949, 29762 => 34952, 29763 => 35032, 29764 => 35039, - 29765 => 35166, 29766 => 32669, 29767 => 32671, 29768 => 32679, 29769 => 32687, - 29770 => 32688, 29771 => 32690, 29772 => 31868, 29773 => 25929, 29774 => 31889, - 29775 => 31901, 29776 => 31900, 29777 => 31902, 29778 => 31906, 29779 => 31922, - 29780 => 31932, 29781 => 31933, 29782 => 31937, 29783 => 31943, 29784 => 31948, - 29785 => 31949, 29786 => 31944, 29787 => 31941, 29788 => 31959, 29789 => 31976, - 29790 => 33390, 29791 => 26280, 29792 => 32703, 29793 => 32718, 29794 => 32725, - 29795 => 32741, 29796 => 32737, 29797 => 32742, 29798 => 32745, 29799 => 32750, - 29800 => 32755, 29801 => 31992, 29802 => 32119, 29803 => 32166, 29804 => 32174, - 29805 => 32327, 29806 => 32411, 29807 => 40632, 29808 => 40628, 29809 => 36211, - 29810 => 36228, 29811 => 36244, 29812 => 36241, 29813 => 36273, 29814 => 36199, - 29815 => 36205, 29816 => 35911, 29817 => 35913, 29818 => 37194, 29819 => 37200, - 29820 => 37198, 29821 => 37199, 29822 => 37220, 29985 => 37218, 29986 => 37217, - 29987 => 37232, 29988 => 37225, 29989 => 37231, 29990 => 37245, 29991 => 37246, - 29992 => 37234, 29993 => 37236, 29994 => 37241, 29995 => 37260, 29996 => 37253, - 29997 => 37264, 29998 => 37261, 29999 => 37265, 30000 => 37282, 30001 => 37283, - 30002 => 37290, 30003 => 37293, 30004 => 37294, 30005 => 37295, 30006 => 37301, - 30007 => 37300, 30008 => 37306, 30009 => 35925, 30010 => 40574, 30011 => 36280, - 30012 => 36331, 30013 => 36357, 30014 => 36441, 30015 => 36457, 30016 => 36277, - 30017 => 36287, 30018 => 36284, 30019 => 36282, 30020 => 36292, 30021 => 36310, - 30022 => 36311, 30023 => 36314, 30024 => 36318, 30025 => 36302, 30026 => 36303, - 30027 => 36315, 30028 => 36294, 30029 => 36332, 30030 => 36343, 30031 => 36344, - 30032 => 36323, 30033 => 36345, 30034 => 36347, 30035 => 36324, 30036 => 36361, - 30037 => 36349, 30038 => 36372, 30039 => 36381, 30040 => 36383, 30041 => 36396, - 30042 => 36398, 30043 => 36387, 30044 => 36399, 30045 => 36410, 30046 => 36416, - 30047 => 36409, 30048 => 36405, 30049 => 36413, 30050 => 36401, 30051 => 36425, - 30052 => 36417, 30053 => 36418, 30054 => 36433, 30055 => 36434, 30056 => 36426, - 30057 => 36464, 30058 => 36470, 30059 => 36476, 30060 => 36463, 30061 => 36468, - 30062 => 36485, 30063 => 36495, 30064 => 36500, 30065 => 36496, 30066 => 36508, - 30067 => 36510, 30068 => 35960, 30069 => 35970, 30070 => 35978, 30071 => 35973, - 30072 => 35992, 30073 => 35988, 30074 => 26011, 30075 => 35286, 30076 => 35294, - 30077 => 35290, 30078 => 35292, 30241 => 35301, 30242 => 35307, 30243 => 35311, - 30244 => 35390, 30245 => 35622, 30246 => 38739, 30247 => 38633, 30248 => 38643, - 30249 => 38639, 30250 => 38662, 30251 => 38657, 30252 => 38664, 30253 => 38671, - 30254 => 38670, 30255 => 38698, 30256 => 38701, 30257 => 38704, 30258 => 38718, - 30259 => 40832, 30260 => 40835, 30261 => 40837, 30262 => 40838, 30263 => 40839, - 30264 => 40840, 30265 => 40841, 30266 => 40842, 30267 => 40844, 30268 => 40702, - 30269 => 40715, 30270 => 40717, 30271 => 38585, 30272 => 38588, 30273 => 38589, - 30274 => 38606, 30275 => 38610, 30276 => 30655, 30277 => 38624, 30278 => 37518, - 30279 => 37550, 30280 => 37576, 30281 => 37694, 30282 => 37738, 30283 => 37834, - 30284 => 37775, 30285 => 37950, 30286 => 37995, 30287 => 40063, 30288 => 40066, - 30289 => 40069, 30290 => 40070, 30291 => 40071, 30292 => 40072, 30293 => 31267, - 30294 => 40075, 30295 => 40078, 30296 => 40080, 30297 => 40081, 30298 => 40082, - 30299 => 40084, 30300 => 40085, 30301 => 40090, 30302 => 40091, 30303 => 40094, - 30304 => 40095, 30305 => 40096, 30306 => 40097, 30307 => 40098, 30308 => 40099, - 30309 => 40101, 30310 => 40102, 30311 => 40103, 30312 => 40104, 30313 => 40105, - 30314 => 40107, 30315 => 40109, 30316 => 40110, 30317 => 40112, 30318 => 40113, - 30319 => 40114, 30320 => 40115, 30321 => 40116, 30322 => 40117, 30323 => 40118, - 30324 => 40119, 30325 => 40122, 30326 => 40123, 30327 => 40124, 30328 => 40125, - 30329 => 40132, 30330 => 40133, 30331 => 40134, 30332 => 40135, 30333 => 40138, - 30334 => 40139, 30497 => 40140, 30498 => 40141, 30499 => 40142, 30500 => 40143, - 30501 => 40144, 30502 => 40147, 30503 => 40148, 30504 => 40149, 30505 => 40151, - 30506 => 40152, 30507 => 40153, 30508 => 40156, 30509 => 40157, 30510 => 40159, - 30511 => 40162, 30512 => 38780, 30513 => 38789, 30514 => 38801, 30515 => 38802, - 30516 => 38804, 30517 => 38831, 30518 => 38827, 30519 => 38819, 30520 => 38834, - 30521 => 38836, 30522 => 39601, 30523 => 39600, 30524 => 39607, 30525 => 40536, - 30526 => 39606, 30527 => 39610, 30528 => 39612, 30529 => 39617, 30530 => 39616, - 30531 => 39621, 30532 => 39618, 30533 => 39627, 30534 => 39628, 30535 => 39633, - 30536 => 39749, 30537 => 39747, 30538 => 39751, 30539 => 39753, 30540 => 39752, - 30541 => 39757, 30542 => 39761, 30543 => 39144, 30544 => 39181, 30545 => 39214, - 30546 => 39253, 30547 => 39252, 30548 => 39647, 30549 => 39649, 30550 => 39654, - 30551 => 39663, 30552 => 39659, 30553 => 39675, 30554 => 39661, 30555 => 39673, - 30556 => 39688, 30557 => 39695, 30558 => 39699, 30559 => 39711, 30560 => 39715, - 30561 => 40637, 30562 => 40638, 30563 => 32315, 30564 => 40578, 30565 => 40583, - 30566 => 40584, 30567 => 40587, 30568 => 40594, 30569 => 37846, 30570 => 40605, - 30571 => 40607, 30572 => 40667, 30573 => 40668, 30574 => 40669, 30575 => 40672, - 30576 => 40671, 30577 => 40674, 30578 => 40681, 30579 => 40679, 30580 => 40677, - 30581 => 40682, 30582 => 40687, 30583 => 40738, 30584 => 40748, 30585 => 40751, - 30586 => 40761, 30587 => 40759, 30588 => 40765, 30589 => 40766, 30590 => 40772, - 0 => 0 ); - - function gb2utf8($gb) { - if( !trim($gb) ) return $gb; - $utf8=''; - while($gb) { - if( ord(substr($gb,0,1)) > 127 ) { - $t=substr($gb,0,2); - $gb=substr($gb,2); - $utf8 .= $this->u2utf8($this->codetable[hexdec(bin2hex($t))-0x8080]); - } - else { - $t=substr($gb,0,1); - $gb=substr($gb,1); - $utf8 .= $this->u2utf8($t); - } - } - return $utf8; - } - - function u2utf8($c) { - $str=''; - if ($c < 0x80) { - $str.=$c; - } - else if ($c < 0x800) { - $str.=chr(0xC0 | $c>>6); - $str.=chr(0x80 | $c & 0x3F); - } - else if ($c < 0x10000) { - $str.=chr(0xE0 | $c>>12); - $str.=chr(0x80 | $c>>6 & 0x3F); - $str.=chr(0x80 | $c & 0x3F); - } - else if ($c < 0x200000) { - $str.=chr(0xF0 | $c>>18); - $str.=chr(0x80 | $c>>12 & 0x3F); - $str.=chr(0x80 | $c>>6 & 0x3F); - $str.=chr(0x80 | $c & 0x3F); - } - return $str; - } - -} // END Class - -?> diff --git a/#jpgraph/src/jpgraph_gradient.php b/#jpgraph/src/jpgraph_gradient.php deleted file mode 100644 index 225cf60c..00000000 --- a/#jpgraph/src/jpgraph_gradient.php +++ /dev/null @@ -1,434 +0,0 @@ -img = $img; - } - - - function SetNumColors($aNum) { - $this->numcolors=$aNum; - } - //--------------- - // PUBLIC METHODS - // Produce a gradient filled rectangle with a smooth transition between - // two colors. - // ($xl,$yt) Top left corner - // ($xr,$yb) Bottom right - // $from_color Starting color in gradient - // $to_color End color in the gradient - // $style Which way is the gradient oriented? - function FilledRectangle($xl,$yt,$xr,$yb,$from_color,$to_color,$style=1) { - $this->img->SetLineWeight(1); - switch( $style ) { - case GRAD_VER: - $steps = ceil(abs($xr-$xl)+1); - $delta = $xr>=$xl ? 1 : -1; - $this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); - for( $i=0, $x=$xl; $i < $steps; ++$i ) { - $this->img->current_color = $colors[$i]; - $this->img->Line($x,$yt,$x,$yb); - $x += $delta; - } - break; - - case GRAD_HOR: - $steps = ceil(abs($yb-$yt)+1); - $delta = $yb >= $yt ? 1 : -1; - $this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); - for($i=0,$y=$yt; $i < $steps; ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($xl,$y,$xr,$y); - $y += $delta; - } - break; - - case GRAD_MIDHOR: - $steps = ceil(abs($yb-$yt)/2); - $delta = $yb >= $yt ? 1 : -1; - $this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); - for($y=$yt, $i=0; $i < $steps; ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($xl,$y,$xr,$y); - $y += $delta; - } - --$i; - if( abs($yb-$yt) % 2 == 1 ) { - --$steps; - } - for($j=0; $j < $steps; ++$j, --$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($xl,$y,$xr,$y); - $y += $delta; - } - $this->img->Line($xl,$y,$xr,$y); - break; - - case GRAD_MIDVER: - $steps = ceil(abs($xr-$xl)/2); - $delta = $xr>=$xl ? 1 : -1; - $this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); - for($x=$xl, $i=0; $i < $steps; ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - --$i; - if( abs($xr-$xl) % 2 == 1 ) { - --$steps; - } - for($j=0; $j < $steps; ++$j, --$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - $this->img->Line($x,$yb,$x,$yt); - break; - - case GRAD_WIDE_MIDVER: - $diff = ceil(abs($xr-$xl)); - $steps = floor(abs($diff)/3); - $firststep = $diff - 2*$steps ; - $delta = $xr >= $xl ? 1 : -1; - $this->GetColArray($from_color,$to_color,$firststep,$colors,$this->numcolors); - for($x=$xl, $i=0; $i < $firststep; ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - --$i; - $this->img->current_color = $colors[$i]; - for($j=0; $j< $steps; ++$j) { - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - - for($j=0; $j < $steps; ++$j, --$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - break; - - case GRAD_WIDE_MIDHOR: - $diff = ceil(abs($yb-$yt)); - $steps = floor(abs($diff)/3); - $firststep = $diff - 2*$steps ; - $delta = $yb >= $yt? 1 : -1; - $this->GetColArray($from_color,$to_color,$firststep,$colors,$this->numcolors); - for($y=$yt, $i=0; $i < $firststep; ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($xl,$y,$xr,$y); - $y += $delta; - } - --$i; - $this->img->current_color = $colors[$i]; - for($j=0; $j < $steps; ++$j) { - $this->img->Line($xl,$y,$xr,$y); - $y += $delta; - } - for($j=0; $j < $steps; ++$j, --$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($xl,$y,$xr,$y); - $y += $delta; - } - break; - - case GRAD_LEFT_REFLECTION: - $steps1 = ceil(0.3*abs($xr-$xl)); - $delta = $xr>=$xl ? 1 : -1; - - $from_color = $this->img->rgb->Color($from_color); - $adj = 1.4; - $m = ($adj-1.0)*(255-min(255,min($from_color[0],min($from_color[1],$from_color[2])))); - $from_color2 = array(min(255,$from_color[0]+$m), - min(255,$from_color[1]+$m), min(255,$from_color[2]+$m)); - - $this->GetColArray($from_color2,$to_color,$steps1,$colors,$this->numcolors); - $n = count($colors); - for($x=$xl, $i=0; $i < $steps1 && $i < $n; ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - $steps2 = max(1,ceil(0.08*abs($xr-$xl))); - $this->img->SetColor($to_color); - for($j=0; $j< $steps2; ++$j) { - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - $steps = abs($xr-$xl)-$steps1-$steps2; - $this->GetColArray($to_color,$from_color,$steps,$colors,$this->numcolors); - $n = count($colors); - for($i=0; $i < $steps && $i < $n; ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - break; - - case GRAD_RIGHT_REFLECTION: - $steps1 = ceil(0.7*abs($xr-$xl)); - $delta = $xr>=$xl ? 1 : -1; - - $this->GetColArray($from_color,$to_color,$steps1,$colors,$this->numcolors); - $n = count($colors); - for($x=$xl, $i=0; $i < $steps1 && $i < $n; ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - $steps2 = max(1,ceil(0.08*abs($xr-$xl))); - $this->img->SetColor($to_color); - for($j=0; $j< $steps2; ++$j) { - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - - $from_color = $this->img->rgb->Color($from_color); - $adj = 1.4; - $m = ($adj-1.0)*(255-min(255,min($from_color[0],min($from_color[1],$from_color[2])))); - $from_color = array(min(255,$from_color[0]+$m), - min(255,$from_color[1]+$m), min(255,$from_color[2]+$m)); - - $steps = abs($xr-$xl)-$steps1-$steps2; - $this->GetColArray($to_color,$from_color,$steps,$colors,$this->numcolors); - $n = count($colors); - for($i=0; $i < $steps && $i < $n; ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - break; - - case GRAD_CENTER: - $steps = ceil(min(($yb-$yt)+1,($xr-$xl)+1)/2); - $this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); - $dx = ($xr-$xl)/2; - $dy = ($yb-$yt)/2; - $x=$xl;$y=$yt;$x2=$xr;$y2=$yb; - $n = count($colors); - for($x=$xl, $i=0; $x < $xl+$dx && $y < $yt+$dy && $i < $n; ++$x, ++$y, --$x2, --$y2, ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Rectangle($x,$y,$x2,$y2); - } - $this->img->Line($x,$y,$x2,$y2); - break; - - case GRAD_RAISED_PANEL: - // right to left - $steps1 = $xr-$xl; - $delta = $xr>=$xl ? 1 : -1; - $this->GetColArray($to_color,$from_color,$steps1,$colors,$this->numcolors); - $n = count($colors); - for($x=$xl, $i=0; $i < $steps1 && $i < $n; ++$i) { - $this->img->current_color = $colors[$i]; - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - - // left to right - $xr -= 3; - $xl += 3; - $yb -= 3; - $yt += 3; - $steps2 = $xr-$xl; - $delta = $xr>=$xl ? 1 : -1; - for($x=$xl, $j=$steps2; $j >= 0; --$j) { - $this->img->current_color = $colors[$j]; - $this->img->Line($x,$yb,$x,$yt); - $x += $delta; - } - break; - - case GRAD_DIAGONAL: - // use the longer dimension to determine the required number of steps. - // first loop draws from one corner to the mid-diagonal and the second - // loop draws from the mid-diagonal to the opposing corner. - if($xr-$xl > $yb - $yt) { - // width is greater than height -> use x-dimension for steps - $steps = $xr-$xl; - $delta = $xr>=$xl ? 1 : -1; - $this->GetColArray($from_color,$to_color,$steps*2,$colors,$this->numcolors); - $n = count($colors); - - for($x=$xl, $i=0; $i < $steps && $i < $n; ++$i) { - $this->img->current_color = $colors[$i]; - $y = $yt+($i/$steps)*($yb-$yt)*$delta; - $this->img->Line($x,$yt,$xl,$y); - $x += $delta; - } - - for($x=$xl, $i = 0; $i < $steps && $i < $n; ++$i) { - $this->img->current_color = $colors[$steps+$i]; - $y = $yt+($i/$steps)*($yb-$yt)*$delta; - $this->img->Line($x,$yb,$xr,$y); - $x += $delta; - } - } else { - // height is greater than width -> use y-dimension for steps - $steps = $yb-$yt; - $delta = $yb>=$yt ? 1 : -1; - $this->GetColArray($from_color,$to_color,$steps*2,$colors,$this->numcolors); - $n = count($colors); - - for($y=$yt, $i=0; $i < $steps && $i < $n; ++$i) { - $this->img->current_color = $colors[$i]; - $x = $xl+($i/$steps)*($xr-$xl)*$delta; - $this->img->Line($x,$yt,$xl,$y); - $y += $delta; - } - - for($y=$yt, $i = 0; $i < $steps && $i < $n; ++$i) { - $this->img->current_color = $colors[$steps+$i]; - $x = $xl+($i/$steps)*($xr-$xl)*$delta; - $this->img->Line($x,$yb,$xr,$y); - $x += $delta; - } - - } - break; - - default: - JpGraphError::RaiseL(7001,$style); - //("Unknown gradient style (=$style)."); - break; - } - } - - // Fill a special case of a polygon with a flat bottom - // with a gradient. Can be used for filled line plots. - // Please note that this is NOT a generic gradient polygon fill - // routine. It assumes that the bottom is flat (like a drawing - // of a mountain) - function FilledFlatPolygon($pts,$from_color,$to_color) { - if( count($pts) == 0 ) return; - - $maxy=$pts[1]; - $miny=$pts[1]; - $n = count($pts) ; - for( $i=0, $idx=0; $i < $n; $i += 2) { - $x = round($pts[$i]); - $y = round($pts[$i+1]); - $miny = min($miny,$y); - $maxy = max($maxy,$y); - } - - $colors = array(); - $this->GetColArray($from_color,$to_color,abs($maxy-$miny)+1,$colors,$this->numcolors); - for($i=$miny, $idx=0; $i <= $maxy; ++$i ) { - $colmap[$i] = $colors[$idx++]; - } - - $n = count($pts)/2 ; - $idx = 0 ; - while( $idx < $n-1 ) { - $p1 = array(round($pts[$idx*2]),round($pts[$idx*2+1])); - $p2 = array(round($pts[++$idx*2]),round($pts[$idx*2+1])); - - // Find the largest rectangle we can fill - $y = max($p1[1],$p2[1]) ; - for($yy=$maxy; $yy > $y; --$yy) { - $this->img->current_color = $colmap[$yy]; - $this->img->Line($p1[0],$yy,$p2[0]-1,$yy); - } - - if( $p1[1] == $p2[1] ) { - continue; - } - - // Fill the rest using lines (slow...) - $slope = ($p2[0]-$p1[0])/($p1[1]-$p2[1]); - $x1 = $p1[0]; - $x2 = $p2[0]-1; - $start = $y; - if( $p1[1] > $p2[1] ) { - while( $y >= $p2[1] ) { - $x1=$slope*($start-$y)+$p1[0]; - $this->img->current_color = $colmap[$y]; - $this->img->Line($x1,$y,$x2,$y); - --$y; - } - } - else { - while( $y >= $p1[1] ) { - $x2=$p2[0]+$slope*($start-$y); - $this->img->current_color = $colmap[$y]; - $this->img->Line($x1,$y,$x2,$y); - --$y; - } - } - } - } - - //--------------- - // PRIVATE METHODS - // Add to the image color map the necessary colors to do the transition - // between the two colors using $numcolors intermediate colors - function GetColArray($from_color,$to_color,$arr_size,&$colors,$numcols=100) { - if( $arr_size==0 ) { - return; - } - - // If color is given as text get it's corresponding r,g,b values - $from_color = $this->img->rgb->Color($from_color); - $to_color = $this->img->rgb->Color($to_color); - - $rdelta=($to_color[0]-$from_color[0])/$numcols; - $gdelta=($to_color[1]-$from_color[1])/$numcols; - $bdelta=($to_color[2]-$from_color[2])/$numcols; - $colorsperstep = $numcols/$arr_size; - $prevcolnum = -1; - $from_alpha = $from_color[3]; - $to_alpha = $to_color[3]; - $adelta = ( $to_alpha - $from_alpha ) / $numcols ; - for ($i=0; $i < $arr_size; ++$i) { - $colnum = floor($colorsperstep*$i); - if ( $colnum == $prevcolnum ) { - $colors[$i] = $colidx; - } - else { - $r = floor($from_color[0] + $colnum*$rdelta); - $g = floor($from_color[1] + $colnum*$gdelta); - $b = floor($from_color[2] + $colnum*$bdelta); - $alpha = $from_alpha + $colnum*$adelta; - $colidx = $this->img->rgb->Allocate(sprintf("#%02x%02x%02x",$r,$g,$b),$alpha); - $colors[$i] = $colidx; - } - $prevcolnum = $colnum; - } - } -} // Class - -?> diff --git a/#jpgraph/src/jpgraph_iconplot.php b/#jpgraph/src/jpgraph_iconplot.php deleted file mode 100644 index 584f8017..00000000 --- a/#jpgraph/src/jpgraph_iconplot.php +++ /dev/null @@ -1,190 +0,0 @@ -iFile = $aFile; - $this->iX=$aX; - $this->iY=$aY; - $this->iScale= $aScale; - if( $aMix < 0 || $aMix > 100 ) { - JpGraphError::RaiseL(8001); //('Mix value for icon must be between 0 and 100.'); - } - $this->iMix = $aMix ; - } - - function SetCountryFlag($aFlag,$aX=0,$aY=0,$aScale=1.0,$aMix=100,$aStdSize=3) { - $this->iCountryFlag = $aFlag; - $this->iX=$aX; - $this->iY=$aY; - $this->iScale= $aScale; - if( $aMix < 0 || $aMix > 100 ) { - JpGraphError::RaiseL(8001);//'Mix value for icon must be between 0 and 100.'); - } - $this->iMix = $aMix; - $this->iCountryStdSize = $aStdSize; - } - - function SetPos($aX,$aY) { - $this->iX=$aX; - $this->iY=$aY; - } - - function CreateFromString($aStr) { - $this->iImgString = $aStr; - } - - function SetScalePos($aX,$aY) { - $this->iScalePosX = $aX; - $this->iScalePosY = $aY; - } - - function SetScale($aScale) { - $this->iScale = $aScale; - } - - function SetMix($aMix) { - if( $aMix < 0 || $aMix > 100 ) { - JpGraphError::RaiseL(8001);//('Mix value for icon must be between 0 and 100.'); - } - $this->iMix = $aMix ; - } - - function SetAnchor($aXAnchor='left',$aYAnchor='center') { - if( !in_array($aXAnchor,$this->iAnchors) || - !in_array($aYAnchor,$this->iAnchors) ) { - JpGraphError::RaiseL(8002);//("Anchor position for icons must be one of 'top', 'bottom', 'left', 'right' or 'center'"); - } - $this->iHorAnchor=$aXAnchor; - $this->iVertAnchor=$aYAnchor; - } - - function PreStrokeAdjust($aGraph) { - // Nothing to do ... - } - - function DoLegend($aGraph) { - // Nothing to do ... - } - - function Max() { - return array(false,false); - } - - - // The next four function are framework function tht gets called - // from Gantt and is not menaiungfull in the context of Icons but - // they must be implemented to avoid errors. - function GetMaxDate() { return false; } - function GetMinDate() { return false; } - function GetLineNbr() { return 0; } - function GetAbsHeight() {return 0; } - - - function Min() { - return array(false,false); - } - - function StrokeMargin(&$aImg) { - return true; - } - - function Stroke($aImg,$axscale=null,$ayscale=null) { - $this->StrokeWithScale($aImg,$axscale,$ayscale); - } - - function StrokeWithScale($aImg,$axscale,$ayscale) { - if( $this->iScalePosX === null || $this->iScalePosY === null || - $axscale === null || $ayscale === null ) { - $this->_Stroke($aImg); - } - else { - $this->_Stroke($aImg, - round($axscale->Translate($this->iScalePosX)), - round($ayscale->Translate($this->iScalePosY))); - } - } - - function GetWidthHeight() { - $dummy=0; - return $this->_Stroke($dummy,null,null,true); - } - - function _Stroke($aImg,$x=null,$y=null,$aReturnWidthHeight=false) { - if( $this->iFile != '' && $this->iCountryFlag != '' ) { - JpGraphError::RaiseL(8003);//('It is not possible to specify both an image file and a country flag for the same icon.'); - } - if( $this->iFile != '' ) { - $gdimg = Graph::LoadBkgImage('',$this->iFile); - } - elseif( $this->iImgString != '') { - $gdimg = Image::CreateFromString($this->iImgString); - } - - else { - if( ! class_exists('FlagImages',false) ) { - JpGraphError::RaiseL(8004);//('In order to use Country flags as icons you must include the "jpgraph_flags.php" file.'); - } - $fobj = new FlagImages($this->iCountryStdSize); - $dummy=''; - $gdimg = $fobj->GetImgByName($this->iCountryFlag,$dummy); - } - - $iconw = imagesx($gdimg); - $iconh = imagesy($gdimg); - - if( $aReturnWidthHeight ) { - return array(round($iconw*$this->iScale),round($iconh*$this->iScale)); - } - - if( $x !== null && $y !== null ) { - $this->iX = $x; $this->iY = $y; - } - if( $this->iX >= 0 && $this->iX <= 1.0 ) { - $w = imagesx($aImg->img); - $this->iX = round($w*$this->iX); - } - if( $this->iY >= 0 && $this->iY <= 1.0 ) { - $h = imagesy($aImg->img); - $this->iY = round($h*$this->iY); - } - - if( $this->iHorAnchor == 'center' ) - $this->iX -= round($iconw*$this->iScale/2); - if( $this->iHorAnchor == 'right' ) - $this->iX -= round($iconw*$this->iScale); - if( $this->iVertAnchor == 'center' ) - $this->iY -= round($iconh*$this->iScale/2); - if( $this->iVertAnchor == 'bottom' ) - $this->iY -= round($iconh*$this->iScale); - - $aImg->CopyMerge($gdimg,$this->iX,$this->iY,0,0, - round($iconw*$this->iScale),round($iconh*$this->iScale), - $iconw,$iconh, - $this->iMix); - } -} - -?> diff --git a/#jpgraph/src/jpgraph_imgtrans.php b/#jpgraph/src/jpgraph_imgtrans.php deleted file mode 100644 index 411a7811..00000000 --- a/#jpgraph/src/jpgraph_imgtrans.php +++ /dev/null @@ -1,223 +0,0 @@ -gdImg = $aGdImg; - } - - // -------------------------------------------------------------------- - // _TransVert3D() and _TransHor3D() are helper methods to - // Skew3D(). - // -------------------------------------------------------------------- - function _TransVert3D($aGdImg,$aHorizon=100,$aSkewDist=120,$aDir=SKEW3D_DOWN,$aMinSize=true,$aFillColor='#FFFFFF',$aQuality=false,$aBorder=false,$aHorizonPos=0.5) { - - - // Parameter check - if( $aHorizonPos < 0 || $aHorizonPos > 1.0 ) { - JpGraphError::RaiseL(9001); - //("Value for image transformation out of bounds.\nVanishing point on horizon must be specified as a value between 0 and 1."); - } - - $w = imagesx($aGdImg); - $h = imagesy($aGdImg); - - // Create new image - $ww = $w; - if( $aMinSize ) - $hh = ceil($h * $aHorizon / ($aSkewDist+$h)); - else - $hh = $h; - - $newgdh = imagecreatetruecolor($ww,$hh); - $crgb = new RGB( $newgdh ); - $fillColor = $crgb->Allocate($aFillColor); - imagefilledrectangle($newgdh,0,0,$ww-1,$hh-1,$fillColor); - - if( $aBorder ) { - $colidx = $crgb->Allocate($aBorder); - imagerectangle($newgdh,0,0,$ww-1,$hh-1,$colidx); - } - - $mid = round($w * $aHorizonPos); - - $last=$h; - for($y=0; $y < $h; ++$y) { - - $yp = $h-$y-1; - $yt = floor($yp * $aHorizon / ($aSkewDist + $yp)); - - if( !$aQuality ) { - if( $last <= $yt ) continue ; - $last = $yt; - } - - for($x=0; $x < $w; ++$x) { - $xt = ($x-$mid) * $aSkewDist / ($aSkewDist + $yp); - if( $aDir == SKEW3D_UP ) - $rgb = imagecolorat($aGdImg,$x,$h-$y-1); - else - $rgb = imagecolorat($aGdImg,$x,$y); - $r = ($rgb >> 16) & 0xFF; - $g = ($rgb >> 8) & 0xFF; - $b = $rgb & 0xFF; - $colidx = imagecolorallocate($newgdh,$r,$g,$b); - $xt = round($xt+$mid); - if( $aDir == SKEW3D_UP ) { - $syt = $yt; - } - else { - $syt = $hh-$yt-1; - } - - if( !empty($set[$yt]) ) { - $nrgb = imagecolorat($newgdh,$xt,$syt); - $nr = ($nrgb >> 16) & 0xFF; - $ng = ($nrgb >> 8) & 0xFF; - $nb = $nrgb & 0xFF; - $colidx = imagecolorallocate($newgdh,floor(($r+$nr)/2), - floor(($g+$ng)/2),floor(($b+$nb)/2)); - } - - imagesetpixel($newgdh,$xt,$syt,$colidx); - } - - $set[$yt] = true; - } - - return $newgdh; - } - - // -------------------------------------------------------------------- - // _TransVert3D() and _TransHor3D() are helper methods to - // Skew3D(). - // -------------------------------------------------------------------- - function _TransHor3D($aGdImg,$aHorizon=100,$aSkewDist=120,$aDir=SKEW3D_LEFT,$aMinSize=true,$aFillColor='#FFFFFF',$aQuality=false,$aBorder=false,$aHorizonPos=0.5) { - - $w = imagesx($aGdImg); - $h = imagesy($aGdImg); - - // Create new image - $hh = $h; - if( $aMinSize ) - $ww = ceil($w * $aHorizon / ($aSkewDist+$w)); - else - $ww = $w; - - $newgdh = imagecreatetruecolor($ww,$hh); - $crgb = new RGB( $newgdh ); - $fillColor = $crgb->Allocate($aFillColor); - imagefilledrectangle($newgdh,0,0,$ww-1,$hh-1,$fillColor); - - if( $aBorder ) { - $colidx = $crgb->Allocate($aBorder); - imagerectangle($newgdh,0,0,$ww-1,$hh-1,$colidx); - } - - $mid = round($h * $aHorizonPos); - - $last = -1; - for($x=0; $x < $w-1; ++$x) { - $xt = floor($x * $aHorizon / ($aSkewDist + $x)); - if( !$aQuality ) { - if( $last >= $xt ) continue ; - $last = $xt; - } - - for($y=0; $y < $h; ++$y) { - $yp = $h-$y-1; - $yt = ($yp-$mid) * $aSkewDist / ($aSkewDist + $x); - - if( $aDir == SKEW3D_RIGHT ) - $rgb = imagecolorat($aGdImg,$w-$x-1,$y); - else - $rgb = imagecolorat($aGdImg,$x,$y); - $r = ($rgb >> 16) & 0xFF; - $g = ($rgb >> 8) & 0xFF; - $b = $rgb & 0xFF; - $colidx = imagecolorallocate($newgdh,$r,$g,$b); - $yt = floor($hh-$yt-$mid-1); - if( $aDir == SKEW3D_RIGHT ) { - $sxt = $ww-$xt-1; - } - else - $sxt = $xt ; - - if( !empty($set[$xt]) ) { - $nrgb = imagecolorat($newgdh,$sxt,$yt); - $nr = ($nrgb >> 16) & 0xFF; - $ng = ($nrgb >> 8) & 0xFF; - $nb = $nrgb & 0xFF; - $colidx = imagecolorallocate($newgdh,floor(($r+$nr)/2), - floor(($g+$ng)/2),floor(($b+$nb)/2)); - } - imagesetpixel($newgdh,$sxt,$yt,$colidx); - } - - $set[$xt] = true; - } - - return $newgdh; - } - - // -------------------------------------------------------------------- - // Skew image for the apperance of a 3D effect - // This transforms an image into a 3D-skewed version - // of the image. The transformation is specified by giving the height - // of the artificial horizon and specifying a "skew" factor which - // is the distance on the horizon line between the point of - // convergence and perspective line. - // - // The function returns the GD handle of the transformed image - // leaving the original image untouched. - // - // Parameters: - // * $aGdImg, GD handle to the image to be transformed - // * $aHorizon, Distance to the horizon - // * $aSkewDist, Distance from the horizon point of convergence - // on the horizon line to the perspective points. A larger - // value will fore-shorten the image more - // * $aDir, parameter specifies type of convergence. This of this - // as the walls in a room you are looking at. This specifies if the - // image should be applied on the left,right,top or bottom walls. - // * $aMinSize, true=make the new image just as big as needed, - // false = keep the image the same size as the original image - // * $aFillColor, Background fill color in the image - // * $aHiQuality, true=performa some interpolation that improves - // the image quality but at the expense of performace. Enabling - // high quality will have a dramatic effect on the time it takes - // to transform an image. - // * $aBorder, if set to anything besides false this will draw a - // a border of the speciied color around the image - // -------------------------------------------------------------------- - function Skew3D($aHorizon=120,$aSkewDist=150,$aDir=SKEW3D_DOWN,$aHiQuality=false,$aMinSize=true,$aFillColor='#FFFFFF',$aBorder=false) { - return $this->_Skew3D($this->gdImg,$aHorizon,$aSkewDist,$aDir,$aHiQuality, - $aMinSize,$aFillColor,$aBorder); - } - - function _Skew3D($aGdImg,$aHorizon=120,$aSkewDist=150,$aDir=SKEW3D_DOWN,$aHiQuality=false,$aMinSize=true,$aFillColor='#FFFFFF',$aBorder=false) { - if( $aDir == SKEW3D_DOWN || $aDir == SKEW3D_UP ) - return $this->_TransVert3D($aGdImg,$aHorizon,$aSkewDist,$aDir,$aMinSize,$aFillColor,$aHiQuality,$aBorder); - else - return $this->_TransHor3D($aGdImg,$aHorizon,$aSkewDist,$aDir,$aMinSize,$aFillColor,$aHiQuality,$aBorder); - - } - -} - - -?> diff --git a/#jpgraph/src/jpgraph_led.php b/#jpgraph/src/jpgraph_led.php deleted file mode 100644 index 83bb2692..00000000 --- a/#jpgraph/src/jpgraph_led.php +++ /dev/null @@ -1,311 +0,0 @@ - array('red','darkred:0.9','red:0.3'),// 0 - LEDC_GREEN => array('green','darkgreen','green:0.3'),// 1 - LEDC_BLUE => array('lightblue:0.9','darkblue:0.85','darkblue:0.7'),// 2 - LEDC_YELLOW => array('yellow','yellow:0.4','yellow:0.3'),// 3 - LEDC_GRAY => array('gray:1.4','darkgray:0.85','darkgray:0.7'), - LEDC_CHOCOLATE => array('chocolate','chocolate:0.7','chocolate:0.5'), - LEDC_PERU => array('peru:0.95','peru:0.6','peru:0.5'), - LEDC_GOLDENROD => array('goldenrod','goldenrod:0.6','goldenrod:0.5'), - LEDC_KHAKI => array('khaki:0.7','khaki:0.4','khaki:0.3'), - LEDC_OLIVE => array('#808000','#808000:0.7','#808000:0.6'), - LEDC_LIMEGREEN => array('limegreen:0.9','limegreen:0.5','limegreen:0.4'), - LEDC_FORESTGREEN => array('forestgreen','forestgreen:0.7','forestgreen:0.5'), - LEDC_TEAL => array('teal','teal:0.7','teal:0.5'), - LEDC_STEELBLUE => array('steelblue','steelblue:0.65','steelblue:0.5'), - LEDC_NAVY => array('navy:1.3','navy:0.95','navy:0.8'),//14 - LEDC_INVERTGRAY => array('darkgray','lightgray:1.5','white')//15 - ), - - /* Each line of the character is encoded as a 4 bit value - 0 ____ - 1 ___x - 2 __x_ - 3 __xx - 4 _x__ - 5 _x_x - 6 _xx_ - 7 _xxx - 8 x___ - 9 x__x - 10 x_x_ - 11 x_xx - 12 xx__ - 13 xx_x - 14 xxx_ - 15 xxxx - */ - - $iLEDSpec = array( - 0 => array(6,9,11,15,13,9,6), - 1 => array(2,6,10,2,2,2,2), - 2 => array(6,9,1,2,4,8,15), - 3 => array(6,9,1,6,1,9,6), - 4 => array(1,3,5,9,15,1,1), - 5 => array(15,8,8,14,1,9,6), - 6 => array(6,8,8,14,9,9,6), - 7 => array(15,1,1,2,4,4,4), - 8 => array(6,9,9,6,9,9,6), - 9 => array(6,9,9,7,1,1,6), - '!' => array(4,4,4,4,4,0,4), - '?' => array(6,9,1,2,2,0,2), - '#' => array(0,9,15,9,15,9,0), - '@' => array(6,9,11,11,10,9,6), - '-' => array(0,0,0,15,0,0,0), - '_' => array(0,0,0,0,0,0,15), - '=' => array(0,0,15,0,15,0,0), - '+' => array(0,0,4,14,4,0,0), - '|' => array(4,4,4,4,4,4,4), //vertical line, used for simulate rus 'Ы' - ',' => array(0,0,0,0,0,12,4), - '.' => array(0,0,0,0,0,12,12), - ':' => array(12,12,0,0,0,12,12), - ';' => array(12,12,0,0,0,12,4), - '[' => array(3,2,2,2,2,2,3), - ']' => array(12,4,4,4,4,4,12), - '(' => array(1,2,2,2,2,2,1), - ')' => array(8,4,4,4,4,4,8), - '{' => array(3,2,2,6,2,2,3), - '}' => array(12,4,4,6,4,4,12), - '<' => array(1,2,4,8,4,2,1), - '>' => array(8,4,2,1,2,4,8), - '*' => array(9,6,15,6,9,0,0), - '"' => array(10,10,0,0,0,0,0), - '\'' => array(4,4,0,0,0,0,0), - '`' => array(4,2,0,0,0,0,0), - '~' => array(13,11,0,0,0,0,0), - '^' => array(4,10,0,0,0,0,0), - '\\' => array(8,8,4,6,2,1,1), - '/' => array(1,1,2,6,4,8,8), - '%' => array(1,9,2,6,4,9,8), - '&' => array(0,4,10,4,11,10,5), - '$' => array(2,7,8,6,1,14,4), - ' ' => array(0,0,0,0,0,0,0), - '•' => array(0,0,6,6,0,0,0), //149 - '°' => array(14,10,14,0,0,0,0), //176 - '†' => array(4,4,14,4,4,4,4), //134 - '‡' => array(4,4,14,4,14,4,4), //135 - '±' => array(0,4,14,4,0,14,0), //177 - '‰' => array(0,4,2,15,2,4,0), //137 show right arrow - '™' => array(0,2,4,15,4,2,0), //156 show left arrow - 'Ў' => array(0,0,8,8,0,0,0), //159 show small hi-stick - that need for simulate rus 'Ф' - "\t" => array(8,8,8,0,0,0,0), //show hi-stick - that need for simulate rus 'У' - "\r" => array(8,8,8,8,8,8,8), //vertical line - that need for simulate 'M', 'W' and rus 'М','Ш' ,'Щ' - "\n" => array(15,15,15,15,15,15,15), //fill up - that need for simulate rus 'Ж' - "Ґ" => array(10,5,10,5,10,5,10), //chess - "µ" => array(15,0,15,0,15,0,15), //4 horizontal lines - // latin - 'A' => array(6,9,9,15,9,9,9), - 'B' => array(14,9,9,14,9,9,14), - 'C' => array(6,9,8,8,8,9,6), - 'D' => array(14,9,9,9,9,9,14), - 'E' => array(15,8,8,14,8,8,15), - 'F' => array(15,8,8,14,8,8,8), - 'G' => array(6,9,8,8,11,9,6), - 'H' => array(9,9,9,15,9,9,9), - 'I' => array(14,4,4,4,4,4,14), - 'J' => array(15,1,1,1,1,9,6), - 'K' => array(8,9,10,12,12,10,9), - 'L' => array(8,8,8,8,8,8,15), - 'M' => array(8,13,10,8,8,8,8),// need to add \r - 'N' => array(9,9,13,11,9,9,9), - 'O' => array(6,9,9,9,9,9,6), - 'P' => array(14,9,9,14,8,8,8), - 'Q' => array(6,9,9,9,13,11,6), - 'R' => array(14,9,9,14,12,10,9), - 'S' => array(6,9,8,6,1,9,6), - 'T' => array(14,4,4,4,4,4,4), - 'U' => array(9,9,9,9,9,9,6), - 'V' => array(0,0,0,10,10,10,4), - 'W' => array(8,8,8,8,10,13,8),// need to add \r - 'X' => array(9,9,6,6,6,9,9), - 'Y' => array(10,10,10,10,4,4,4), - 'Z' => array(15,1,2,6,4,8,15), - // russian utf-8 - 'А' => array(6,9,9,15,9,9,9), - 'Б' => array(14,8,8,14,9,9,14), - 'В' => array(14,9,9,14,9,9,14), - 'Г' => array(15,8,8,8,8,8,8), - 'Д' => array(14,9,9,9,9,9,14), - 'Е' => array(15,8,8,14,8,8,15), - 'Ё' => array(6,15,8,14,8,8,15), - //Ж is combine: >\n< - 'З' => array(6,9,1,2,1,9,6), - 'И' => array(9,9,9,11,13,9,9), - 'Й' => array(13,9,9,11,13,9,9), - 'К' => array(9,10,12,10,9,9,9), - 'Л' => array(7,9,9,9,9,9,9), - 'М' => array(8,13,10,8,8,8,8),// need to add \r - 'Н' => array(9,9,9,15,9,9,9), - 'О' => array(6,9,9,9,9,9,6), - 'П' => array(15,9,9,9,9,9,9), - 'Р' => array(14,9,9,14,8,8,8), - 'С' => array(6,9,8,8,8,9,6), - 'Т' => array(14,4,4,4,4,4,4), - 'У' => array(9,9,9,7,1,9,6), - 'Ф' => array(2,7,10,10,7,2,2),// need to add Ў - 'Х' => array(9,9,6,6,6,9,9), - 'Ц' => array(10,10,10,10,10,15,1), - 'Ч' => array(9,9,9,7,1,1,1), - 'Ш' => array(10,10,10,10,10,10,15),// \r - 'Щ' => array(10,10,10,10,10,15,0),// need to add \r - 'Ъ' => array(12,4,4,6,5,5,6), - 'Ы' => array(8,8,8,14,9,9,14),// need to add | - 'Ь' => array(8,8,8,14,9,9,14), - 'Э' => array(6,9,1,7,1,9,6), - 'Ю' => array(2,2,2,3,2,2,2),// need to add O - 'Я' => array(7,9,9,7,3,5,9) - ), - - $iSuperSampling = 3, $iMarg = 1, $iRad = 4; - - function __construct($aRadius = 2, $aMargin= 0.6) { - $this->iRad = $aRadius; - $this->iMarg = $aMargin; - } - - function SetSupersampling($aSuperSampling = 2) { - $this->iSuperSampling = $aSuperSampling; - } - - function _GetLED($aLedIdx, $aColor = 0) { - $width= $this->iLED_X*$this->iRad*2 + ($this->iLED_X+1)*$this->iMarg + $this->iRad ; - $height= $this->iLED_Y*$this->iRad*2 + ($this->iLED_Y)*$this->iMarg + $this->iRad * 2; - - // Adjust radious for supersampling - $rad = $this->iRad * $this->iSuperSampling; - - // Margin in between "Led" dots - $marg = $this->iMarg * $this->iSuperSampling; - - $swidth = $width*$this->iSuperSampling; - $sheight = $height*$this->iSuperSampling; - - $simg = new RotImage($swidth, $sheight, 0, DEFAULT_GFORMAT, false); - $simg->SetColor($this->iColorSchema[$aColor][2]); - $simg->FilledRectangle(0, 0, $swidth-1, $sheight-1); - - if( array_key_exists($aLedIdx, $this->iLEDSpec) ) { - $d = $this->iLEDSpec[$aLedIdx]; - } - else { - $d = array(0,0,0,0,0,0,0); - } - - for($r = 0; $r < 7; ++$r) { - $dr = $d[$r]; - for($c = 0; $c < 4; ++$c) { - if( ($dr & pow(2,3-$c)) !== 0 ) { - $color = $this->iColorSchema[$aColor][0]; - } - else { - $color = $this->iColorSchema[$aColor][1]; - } - - $x = 2*$rad*$c+$rad + ($c+1)*$marg + $rad ; - $y = 2*$rad*$r+$rad + ($r+1)*$marg + $rad ; - - $simg->SetColor($color); - $simg->FilledCircle($x,$y,$rad); - } - } - - $img = new Image($width, $height, DEFAULT_GFORMAT, false); - $img->Copy($simg->img, 0, 0, 0, 0, $width, $height, $swidth, $sheight); - $simg->Destroy(); - unset($simg); - return $img; - } - - - function Stroke($aValStr, $aColor = 0, $aFileName = '') { - $this->StrokeNumber($aValStr, $aColor, $aFileName); - } - - - function StrokeNumber($aValStr, $aColor = 0, $aFileName = '') { - if( $aColor < 0 || $aColor >= sizeof($this->iColorSchema) ) { - $aColor = 0; - } - - if(($n = mb_strlen($aValStr,'utf8')) == 0) { - $aValStr = ' '; - $n = 1; - } - - for($i = 0; $i < $n; ++$i) { - $d = mb_substr($aValStr, $i, 1, 'utf8'); - if( ctype_digit($d) ) { - $d = (int)$d; - } - else { - $d = strtoupper($d); - } - $digit_img[$i] = $this->_GetLED($d, $aColor); - } - - $w = imagesx($digit_img[0]->img); - $h = imagesy($digit_img[0]->img); - - $number_img = new Image($w*$n, $h, DEFAULT_GFORMAT, false); - - for($i = 0; $i < $n; ++$i) { - $number_img->Copy($digit_img[$i]->img, $i*$w, 0, 0, 0, $w, $h, $w, $h); - } - - if( $aFileName != '' ) { - $number_img->Stream($aFileName); - } else { - $number_img->Headers(); - $number_img->Stream(); - } - } -} -?> diff --git a/#jpgraph/src/jpgraph_legend.inc.php b/#jpgraph/src/jpgraph_legend.inc.php deleted file mode 100644 index c7f38b51..00000000 --- a/#jpgraph/src/jpgraph_legend.inc.php +++ /dev/null @@ -1,494 +0,0 @@ -hide=$aHide; - } - - function SetHColMargin($aXMarg) { - $this->xmargin = $aXMarg; - } - - function SetVColMargin($aSpacing) { - $this->ylinespacing = $aSpacing ; - } - - function SetLeftMargin($aXMarg) { - $this->xlmargin = $aXMarg; - } - - // Synonym - function SetLineSpacing($aSpacing) { - $this->ylinespacing = $aSpacing ; - } - - function SetShadow($aShow='gray',$aWidth=4) { - if( is_string($aShow) ) { - $this->shadow_color = $aShow; - $this->shadow=true; - } - else { - $this->shadow = $aShow; - } - $this->shadow_width = $aWidth; - } - - function SetMarkAbsSize($aSize) { - $this->mark_abs_vsize = $aSize ; - $this->mark_abs_hsize = $aSize ; - } - - function SetMarkAbsVSize($aSize) { - $this->mark_abs_vsize = $aSize ; - } - - function SetMarkAbsHSize($aSize) { - $this->mark_abs_hsize = $aSize ; - } - - function SetLineWeight($aWeight) { - $this->weight = $aWeight; - } - - function SetFrameWeight($aWeight) { - $this->frameweight = $aWeight; - } - - function SetLayout($aDirection=LEGEND_VERT) { - $this->layout_n = $aDirection==LEGEND_VERT ? 1 : 99 ; - } - - function SetColumns($aCols) { - $this->layout_n = $aCols ; - } - - function SetReverse($f=true) { - $this->reverse = $f ; - } - - // Set color on frame around box - function SetColor($aFontColor,$aColor='black') { - $this->font_color=$aFontColor; - $this->color=$aColor; - } - - function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) { - $this->font_family = $aFamily; - $this->font_style = $aStyle; - $this->font_size = $aSize; - } - - function SetPos($aX,$aY,$aHAlign='right',$aVAlign='top') { - $this->Pos($aX,$aY,$aHAlign,$aVAlign); - } - - function SetAbsPos($aX,$aY,$aHAlign='right',$aVAlign='top') { - $this->xabspos=$aX; - $this->yabspos=$aY; - $this->halign=$aHAlign; - $this->valign=$aVAlign; - } - - function Pos($aX,$aY,$aHAlign='right',$aVAlign='top') { - if( !($aX<1 && $aY<1) ) { - JpGraphError::RaiseL(25120);//(" Position for legend must be given as percentage in range 0-1"); - } - $this->xpos=$aX; - $this->ypos=$aY; - $this->halign=$aHAlign; - $this->valign=$aVAlign; - } - - function SetFillColor($aColor) { - $this->fill_color=$aColor; - } - - function Clear() { - $this->txtcol = array(); - } - - function Add($aTxt,$aColor,$aPlotmark='',$aLinestyle=0,$csimtarget='',$csimalt='',$csimwintarget='') { - $this->txtcol[]=array($aTxt,$aColor,$aPlotmark,$aLinestyle,$csimtarget,$csimalt,$csimwintarget); - } - - function GetCSIMAreas() { - return $this->csimareas; - } - - function SetBackgroundGradient($aFrom='navy',$aTo='silver',$aGradType=2) { - $this->bkg_gradtype=$aGradType; - $this->bkg_gradfrom = $aFrom; - $this->bkg_gradto = $aTo; - } - - function HasItems() { - return (boolean)(count($this->txtcol)); - } - - function Stroke($aImg) { - // Constant - $fillBoxFrameWeight=1; - - if( $this->hide ) return; - - $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); - - if( $this->reverse ) { - $this->txtcol = array_reverse($this->txtcol); - } - - $n=count($this->txtcol); - if( $n == 0 ) return; - - // Find out the max width and height of each column to be able - // to size the legend box. - $numcolumns = ($n > $this->layout_n ? $this->layout_n : $n); - for( $i=0; $i < $numcolumns; ++$i ) { - $colwidth[$i] = $aImg->GetTextWidth($this->txtcol[$i][0]) + - 2*$this->xmargin + 2*$this->mark_abs_hsize; - $colheight[$i] = 0; - - } - - // Find our maximum height in each row - $rows = 0 ; $rowheight[0] = 0; - for( $i=0; $i < $n; ++$i ) { - $h = max($this->mark_abs_vsize,$aImg->GetTextHeight($this->txtcol[$i][0]))+$this->ylinespacing; - - // Makes sure we always have a minimum of 1/4 (1/2 on each side) of the mark as space - // between two vertical legend entries - //$h = round(max($h,$this->mark_abs_vsize+$this->ymargin)); - //echo "Textheight #$i: tetxheight=".$aImg->GetTextHeight($this->txtcol[$i][0]).', '; - //echo "h=$h ({$this->mark_abs_vsize},{$this->ymargin})
"; - if( $i % $numcolumns == 0 ) { - $rows++; - $rowheight[$rows-1] = 0; - } - $rowheight[$rows-1] = max($rowheight[$rows-1],$h)+1; - } - - $abs_height = 0; - for( $i=0; $i < $rows; ++$i ) { - $abs_height += $rowheight[$i] ; - } - - // Make sure that the height is at least as high as mark size + ymargin - $abs_height = max($abs_height,$this->mark_abs_vsize); - $abs_height += $this->ybottom_margin; - - // Find out the maximum width in each column - for( $i=$numcolumns; $i < $n; ++$i ) { - $colwidth[$i % $numcolumns] = max( - $aImg->GetTextWidth($this->txtcol[$i][0])+2*$this->xmargin+2*$this->mark_abs_hsize, - $colwidth[$i % $numcolumns]); - } - - // Get the total width - $mtw = 0; - for( $i=0; $i < $numcolumns; ++$i ) { - $mtw += $colwidth[$i] ; - } - - // remove the last rows interpace margin (since there is no next row) - $abs_height -= $this->ylinespacing; - - - // Find out maximum width we need for legend box - $abs_width = $mtw+$this->xlmargin+($numcolumns-1)*$this->mark_abs_hsize; - - if( $this->xabspos === -1 && $this->yabspos === -1 ) { - $this->xabspos = $this->xpos*$aImg->width ; - $this->yabspos = $this->ypos*$aImg->height ; - } - - // Positioning of the legend box - if( $this->halign == 'left' ) { - $xp = $this->xabspos; - } - elseif( $this->halign == 'center' ) { - $xp = $this->xabspos - $abs_width/2; - } - else { - $xp = $aImg->width - $this->xabspos - $abs_width; - } - - $yp=$this->yabspos; - if( $this->valign == 'center' ) { - $yp-=$abs_height/2; - } - elseif( $this->valign == 'bottom' ) { - $yp-=$abs_height; - } - - // Stroke legend box - $aImg->SetColor($this->color); - $aImg->SetLineWeight($this->frameweight); - $aImg->SetLineStyle('solid'); - - if( $this->shadow ) { - $aImg->ShadowRectangle($xp,$yp, - $xp+$abs_width+$this->shadow_width+2, - $yp+$abs_height+$this->shadow_width+2, - $this->fill_color,$this->shadow_width+2,$this->shadow_color); - } - else { - $aImg->SetColor($this->fill_color); - $aImg->FilledRectangle($xp,$yp,$xp+$abs_width,$yp+$abs_height); - $aImg->SetColor($this->color); - $aImg->Rectangle($xp,$yp,$xp+$abs_width,$yp+$abs_height); - } - - if( $this->bkg_gradtype >= 0 ) { - $grad = new Gradient($aImg); - $grad->FilledRectangle($xp+1, $yp+1, - $xp+$abs_width-3, $yp+$abs_height-3, - $this->bkg_gradfrom, $this->bkg_gradto, - $this->bkg_gradtype); - } - - // x1,y1 is the position for the legend marker + text - // The vertical position is the baseline position for the text - // and every marker is adjusted acording to that. - - // For multiline texts this get more complicated. - - $x1 = $xp + $this->xlmargin; - $y1 = $yp + $rowheight[0] - $this->ylinespacing + 2 ; // The ymargin is included in rowheight - - // Now, y1 is the bottom vertical position of the first legend, i.e if - // the legend has multiple lines it is the bottom line. - - $grad = new Gradient($aImg); - $patternFactory = null; - - // Now stroke each legend in turn - // Each plot has added the following information to the legend - // p[0] = Legend text - // p[1] = Color, - // p[2] = For markers a reference to the PlotMark object - // p[3] = For lines the line style, for gradient the negative gradient style - // p[4] = CSIM target - // p[5] = CSIM Alt text - $i = 1 ; $row = 0; - foreach($this->txtcol as $p) { - - // STROKE DEBUG BOX - if( _JPG_DEBUG ) { - $aImg->SetLineWeight(1); - $aImg->SetColor('red'); - $aImg->SetLineStyle('solid'); - $aImg->Rectangle($x1,$y1,$xp+$abs_width-1,$y1-$rowheight[$row]); - } - - $aImg->SetLineWeight($this->weight); - $x1 = round($x1)+1; // We add one to not collide with the border - $y1=round($y1); - - // This is the center offset up from the baseline which is - // considered the "center" of the marks. This gets slightly complicated since - // we need to consider if the text is a multiline paragraph or if it is only - // a single line. The reason is that for single line the y1 corresponds to the baseline - // and that is fine. However for a multiline paragraph there is no single baseline - // and in that case the y1 corresponds to the lowest y for the bounding box. In that - // case we center the mark in the middle of the paragraph - if( !preg_match('/\n/',$p[0]) ) { - // Single line - $marky = ceil($y1-$this->mark_abs_vsize/2)-1; - } else { - // Paragraph - $marky = $y1 - $aImg->GetTextHeight($p[0])/2; - - // echo "y1=$y1, p[o]={$p[0]}, marky=$marky
"; - } - - //echo "
Mark #$i: marky=$marky
"; - - $x1 += $this->mark_abs_hsize; - - if ( !empty($p[2]) && $p[2]->GetType() > -1 ) { - - - // Make a plot mark legend. This is constructed with a mark which - // is run through with a line - - // First construct a bit of the line that looks exactly like the - // line in the plot - $aImg->SetColor($p[1]); - if( is_string($p[3]) || $p[3]>0 ) { - $aImg->SetLineStyle($p[3]); - $aImg->StyleLine($x1-$this->mark_abs_hsize,$marky,$x1+$this->mark_abs_hsize,$marky); - } - - // Stroke a mark using image - if( $p[2]->GetType() == MARK_IMG ) { - $p[2]->Stroke($aImg,$x1,$marky); - } - - // Stroke a mark with the standard size - // (As long as it is not an image mark ) - if( $p[2]->GetType() != MARK_IMG ) { - - // Clear any user callbacks since we ont want them called for - // the legend marks - $p[2]->iFormatCallback = ''; - $p[2]->iFormatCallback2 = ''; - - // Since size for circles is specified as the radius - // this means that we must half the size to make the total - // width behave as the other marks - if( $p[2]->GetType() == MARK_FILLEDCIRCLE || $p[2]->GetType() == MARK_CIRCLE ) { - $p[2]->SetSize(min($this->mark_abs_vsize,$this->mark_abs_hsize)/2); - $p[2]->Stroke($aImg,$x1,$marky); - } - else { - $p[2]->SetSize(min($this->mark_abs_vsize,$this->mark_abs_hsize)); - $p[2]->Stroke($aImg,$x1,$marky); - } - } - } - elseif ( !empty($p[2]) && (is_string($p[3]) || $p[3]>0 ) ) { - // Draw a styled line - $aImg->SetColor($p[1]); - $aImg->SetLineStyle($p[3]); - $aImg->StyleLine($x1-$this->mark_abs_hsize,$marky,$x1+$this->mark_abs_hsize,$marky); - $aImg->StyleLine($x1-$this->mark_abs_hsize,$marky+1,$x1+$this->mark_abs_hsize,$marky+1); - } - else { - // Draw a colored box - $color = $p[1] ; - - // We make boxes slightly larger to better show - $boxsize = max($this->mark_abs_vsize,$this->mark_abs_hsize) + 2 ; - - $ym = $marky-ceil($boxsize/2) ; // Marker y-coordinate - - // We either need to plot a gradient or a - // pattern. To differentiate we use a kludge. - // Patterns have a p[3] value of < -100 - if( $p[3] < -100 ) { - // p[1][0] == iPattern, p[1][1] == iPatternColor, p[1][2] == iPatternDensity - if( $patternFactory == null ) { - $patternFactory = new RectPatternFactory(); - } - $prect = $patternFactory->Create($p[1][0],$p[1][1],1); - $prect->SetBackground($p[1][3]); - $prect->SetDensity($p[1][2]+1); - $prect->SetPos(new Rectangle($x1,$ym,$boxsize,$boxsize)); - $prect->Stroke($aImg); - $prect=null; - } - else { - if( is_array($color) && count($color)==2 ) { - // The client want a gradient color - $grad->FilledRectangle($x1-$boxsize/2,$ym, - $x1+$boxsize/2,$ym+$boxsize, - $color[0],$color[1],-$p[3]); - } - else { - $aImg->SetColor($p[1]); - $aImg->FilledRectangle($x1-$boxsize/2,$ym, $x1+$boxsize/2,$ym+$boxsize); - } - - // Draw a plot frame line - $aImg->SetColor($this->color); - $aImg->SetLineWeight($fillBoxFrameWeight); - $aImg->Rectangle($x1-$boxsize/2,$ym, - $x1+$boxsize/2,$ym+$boxsize); - } - } - $aImg->SetColor($this->font_color); - $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); - $aImg->SetTextAlign('left','baseline'); - - $debug=false; - $aImg->StrokeText($x1+$this->mark_abs_hsize+$this->xmargin,$y1,$p[0], - 0,'left',$debug); - - // Add CSIM for Legend if defined - if( !empty($p[4]) ) { - - $xs = $x1 - $this->mark_abs_hsize ; - $ys = $y1 + 1 ; - $xe = $x1 + $aImg->GetTextWidth($p[0]) + $this->mark_abs_hsize + $this->xmargin ; - $ye = $y1-$rowheight[$row]+1; - $coords = "$xs,$ys,$xe,$y1,$xe,$ye,$xs,$ye"; - if( ! empty($p[4]) ) { - $this->csimareas .= "csimareas .= " target=\"".$p[6]."\""; - } - - if( !empty($p[5]) ) { - $tmp=sprintf($p[5],$p[0]); - $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; - } - $this->csimareas .= " />\n"; - } - } - - if( $i >= $this->layout_n ) { - $x1 = $xp+$this->xlmargin; - $row++; - if( !empty($rowheight[$row]) ) - $y1 += $rowheight[$row]; - $i = 1; - } - else { - $x1 += $colwidth[($i-1) % $numcolumns] ; - ++$i; - } - } - } -} // Class - -?> diff --git a/#jpgraph/src/jpgraph_line.php b/#jpgraph/src/jpgraph_line.php deleted file mode 100644 index 21dd8213..00000000 --- a/#jpgraph/src/jpgraph_line.php +++ /dev/null @@ -1,682 +0,0 @@ -mark = new PlotMark() ; - $this->color = ColorFactory::getColor(); - $this->fill_color = $this->color; - } - //--------------- - // PUBLIC METHODS - - function SetFilled($aFlg=true) { - $this->filled = $aFlg; - } - - function SetBarCenter($aFlag=true) { - $this->barcenter=$aFlag; - } - - function SetStyle($aStyle) { - $this->line_style=$aStyle; - } - - function SetStepStyle($aFlag=true) { - $this->step_style = $aFlag; - } - - function SetColor($aColor) { - parent::SetColor($aColor); - } - - function SetFillFromYMin($f=true) { - $this->fillFromMin = $f ; - } - - function SetFillFromYMax($f=true) { - $this->fillFromMax = $f ; - } - - function SetFillColor($aColor,$aFilled=true) { - //$this->color = $aColor; - $this->fill_color=$aColor; - $this->filled=$aFilled; - } - - function SetFillGradient($aFromColor,$aToColor,$aNumColors=100,$aFilled=true) { - $this->fillgrad_fromcolor = $aFromColor; - $this->fillgrad_tocolor = $aToColor; - $this->fillgrad_numcolors = $aNumColors; - $this->filled = $aFilled; - $this->fillgrad = true; - } - - function Legend($graph) { - if( $this->legend!="" ) { - if( $this->filled && !$this->fillgrad ) { - $graph->legend->Add($this->legend, - $this->fill_color,$this->mark,0, - $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } - elseif( $this->fillgrad ) { - $color=array($this->fillgrad_fromcolor,$this->fillgrad_tocolor); - // In order to differentiate between gradients and cooors specified as an RGB triple - $graph->legend->Add($this->legend,$color,"",-2 /* -GRAD_HOR */, - $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } else { - $graph->legend->Add($this->legend, - $this->color,$this->mark,$this->line_style, - $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } - } - } - - function AddArea($aMin=0,$aMax=0,$aFilled=LP_AREA_NOT_FILLED,$aColor="gray9",$aBorder=LP_AREA_BORDER) { - if($aMin > $aMax) { - // swap - $tmp = $aMin; - $aMin = $aMax; - $aMax = $tmp; - } - $this->filledAreas[] = array($aMin,$aMax,$aColor,$aFilled,$aBorder); - } - - // Gets called before any axis are stroked - function PreStrokeAdjust($graph) { - - // If another plot type have already adjusted the - // offset we don't touch it. - // (We check for empty in case the scale is a log scale - // and hence doesn't contain any xlabel_offset) - if( empty($graph->xaxis->scale->ticks->xlabel_offset) || $graph->xaxis->scale->ticks->xlabel_offset == 0 ) { - if( $this->center ) { - ++$this->numpoints; - $a=0.5; $b=0.5; - } else { - $a=0; $b=0; - } - $graph->xaxis->scale->ticks->SetXLabelOffset($a); - $graph->SetTextScaleOff($b); - //$graph->xaxis->scale->ticks->SupressMinorTickMarks(); - } - } - - function SetFastStroke($aFlg=true) { - $this->iFastStroke = $aFlg; - } - - function FastStroke($img,$xscale,$yscale,$aStartPoint=0,$exist_x=true) { - // An optimized stroke for many data points with no extra - // features but 60% faster. You can't have values or line styles, or null - // values in plots. - $numpoints=count($this->coords[0]); - if( $this->barcenter ) { - $textadj = 0.5-$xscale->text_scale_off; - } - else { - $textadj = 0; - } - - $img->SetColor($this->color); - $img->SetLineWeight($this->weight); - $pnts=$aStartPoint; - while( $pnts < $numpoints ) { - if( $exist_x ) { - $x=$this->coords[1][$pnts]; - } - else { - $x=$pnts+$textadj; - } - $xt = $xscale->Translate($x); - $y=$this->coords[0][$pnts]; - $yt = $yscale->Translate($y); - if( is_numeric($y) ) { - $cord[] = $xt; - $cord[] = $yt; - } - elseif( $y == '-' && $pnts > 0 ) { - // Just ignore - } - else { - JpGraphError::RaiseL(10002);//('Plot too complicated for fast line Stroke. Use standard Stroke()'); - } - ++$pnts; - } // WHILE - - $img->Polygon($cord,false,true); - } - - function Stroke($img,$xscale,$yscale) { - $idx=0; - $numpoints=count($this->coords[0]); - if( isset($this->coords[1]) ) { - if( count($this->coords[1])!=$numpoints ) { - JpGraphError::RaiseL(2003,count($this->coords[1]),$numpoints); - //("Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])." Number of Y-points:$numpoints"); - } - else { - $exist_x = true; - } - } - else { - $exist_x = false; - } - - if( $this->barcenter ) { - $textadj = 0.5-$xscale->text_scale_off; - } - else { - $textadj = 0; - } - - // Find the first numeric data point - $startpoint=0; - while( $startpoint < $numpoints && !is_numeric($this->coords[0][$startpoint]) ) { - ++$startpoint; - } - - // Bail out if no data points - if( $startpoint == $numpoints ) return; - - if( $this->iFastStroke ) { - $this->FastStroke($img,$xscale,$yscale,$startpoint,$exist_x); - return; - } - - if( $exist_x ) { - $xs=$this->coords[1][$startpoint]; - } - else { - $xs= $textadj+$startpoint; - } - - $img->SetStartPoint($xscale->Translate($xs), - $yscale->Translate($this->coords[0][$startpoint])); - - if( $this->filled ) { - if( $this->fillFromMax ) { - //$max = $yscale->GetMaxVal(); - $cord[$idx++] = $xscale->Translate($xs); - $cord[$idx++] = $yscale->scale_abs[1]; - } - else { - $min = $yscale->GetMinVal(); - if( $min > 0 || $this->fillFromMin ) { - $fillmin = $yscale->scale_abs[0];//Translate($min); - } - else { - $fillmin = $yscale->Translate(0); - } - - $cord[$idx++] = $xscale->Translate($xs); - $cord[$idx++] = $fillmin; - } - } - $xt = $xscale->Translate($xs); - $yt = $yscale->Translate($this->coords[0][$startpoint]); - $cord[$idx++] = $xt; - $cord[$idx++] = $yt; - $yt_old = $yt; - $xt_old = $xt; - $y_old = $this->coords[0][$startpoint]; - - $this->value->Stroke($img,$this->coords[0][$startpoint],$xt,$yt); - - $img->SetColor($this->color); - $img->SetLineWeight($this->weight); - $img->SetLineStyle($this->line_style); - $pnts=$startpoint+1; - $firstnonumeric = false; - - - while( $pnts < $numpoints ) { - - if( $exist_x ) { - $x=$this->coords[1][$pnts]; - } - else { - $x=$pnts+$textadj; - } - $xt = $xscale->Translate($x); - $yt = $yscale->Translate($this->coords[0][$pnts]); - - $y=$this->coords[0][$pnts]; - if( $this->step_style ) { - // To handle null values within step style we need to record the - // first non numeric value so we know from where to start if the - // non value is '-'. - if( is_numeric($y) ) { - $firstnonumeric = false; - if( is_numeric($y_old) ) { - $img->StyleLine($xt_old,$yt_old,$xt,$yt_old); - $img->StyleLine($xt,$yt_old,$xt,$yt); - } - elseif( $y_old == '-' ) { - $img->StyleLine($xt_first,$yt_first,$xt,$yt_first); - $img->StyleLine($xt,$yt_first,$xt,$yt); - } - else { - $yt_old = $yt; - $xt_old = $xt; - } - $cord[$idx++] = $xt; - $cord[$idx++] = $yt_old; - $cord[$idx++] = $xt; - $cord[$idx++] = $yt; - } - elseif( $firstnonumeric==false ) { - $firstnonumeric = true; - $yt_first = $yt_old; - $xt_first = $xt_old; - } - } - else { - $tmp1=$y; - $prev=$this->coords[0][$pnts-1]; - if( $tmp1==='' || $tmp1===NULL || $tmp1==='X' ) $tmp1 = 'x'; - if( $prev==='' || $prev===null || $prev==='X' ) $prev = 'x'; - - if( is_numeric($y) || (is_string($y) && $y != '-') ) { - if( is_numeric($y) && (is_numeric($prev) || $prev === '-' ) ) { - $img->StyleLineTo($xt,$yt); - } - else { - $img->SetStartPoint($xt,$yt); - } - } - if( $this->filled && $tmp1 !== '-' ) { - if( $tmp1 === 'x' ) { - $cord[$idx++] = $cord[$idx-3]; - $cord[$idx++] = $fillmin; - } - elseif( $prev === 'x' ) { - $cord[$idx++] = $xt; - $cord[$idx++] = $fillmin; - $cord[$idx++] = $xt; - $cord[$idx++] = $yt; - } - else { - $cord[$idx++] = $xt; - $cord[$idx++] = $yt; - } - } - else { - if( is_numeric($tmp1) && (is_numeric($prev) || $prev === '-' ) ) { - $cord[$idx++] = $xt; - $cord[$idx++] = $yt; - } - } - } - $yt_old = $yt; - $xt_old = $xt; - $y_old = $y; - - $this->StrokeDataValue($img,$this->coords[0][$pnts],$xt,$yt); - - ++$pnts; - } - - if( $this->filled ) { - $cord[$idx++] = $xt; - if( $this->fillFromMax ) { - $cord[$idx++] = $yscale->scale_abs[1]; - } - else { - if( $min > 0 || $this->fillFromMin ) { - $cord[$idx++] = $yscale->Translate($min); - } - else { - $cord[$idx++] = $yscale->Translate(0); - } - } - if( $this->fillgrad ) { - $img->SetLineWeight(1); - $grad = new Gradient($img); - $grad->SetNumColors($this->fillgrad_numcolors); - $grad->FilledFlatPolygon($cord,$this->fillgrad_fromcolor,$this->fillgrad_tocolor); - $img->SetLineWeight($this->weight); - } - else { - $img->SetColor($this->fill_color); - $img->FilledPolygon($cord); - } - if( $this->weight > 0 ) { - $img->SetLineWeight($this->weight); - $img->SetColor($this->color); - // Remove first and last coordinate before drawing the line - // sine we otherwise get the vertical start and end lines which - // doesn't look appropriate - $img->Polygon(array_slice($cord,2,count($cord)-4)); - } - } - - if(!empty($this->filledAreas)) { - - $minY = $yscale->Translate($yscale->GetMinVal()); - $factor = ($this->step_style ? 4 : 2); - - for($i = 0; $i < sizeof($this->filledAreas); ++$i) { - // go through all filled area elements ordered by insertion - // fill polygon array - $areaCoords[] = $cord[$this->filledAreas[$i][0] * $factor]; - $areaCoords[] = $minY; - - $areaCoords = - array_merge($areaCoords, - array_slice($cord, - $this->filledAreas[$i][0] * $factor, - ($this->filledAreas[$i][1] - $this->filledAreas[$i][0] + ($this->step_style ? 0 : 1)) * $factor)); - $areaCoords[] = $areaCoords[sizeof($areaCoords)-2]; // last x - $areaCoords[] = $minY; // last y - - if($this->filledAreas[$i][3]) { - $img->SetColor($this->filledAreas[$i][2]); - $img->FilledPolygon($areaCoords); - $img->SetColor($this->color); - } - // Check if we should draw the frame. - // If not we still re-draw the line since it might have been - // partially overwritten by the filled area and it doesn't look - // very good. - if( $this->filledAreas[$i][4] ) { - $img->Polygon($areaCoords); - } - else { - $img->Polygon($cord); - } - - $areaCoords = array(); - } - } - - if( $this->mark->type == -1 || $this->mark->show == false ) - return; - - for( $pnts=0; $pnts<$numpoints; ++$pnts) { - - if( $exist_x ) { - $x=$this->coords[1][$pnts]; - } - else { - $x=$pnts+$textadj; - } - $xt = $xscale->Translate($x); - $yt = $yscale->Translate($this->coords[0][$pnts]); - - if( is_numeric($this->coords[0][$pnts]) ) { - if( !empty($this->csimtargets[$pnts]) ) { - if( !empty($this->csimwintargets[$pnts]) ) { - $this->mark->SetCSIMTarget($this->csimtargets[$pnts],$this->csimwintargets[$pnts]); - } - else { - $this->mark->SetCSIMTarget($this->csimtargets[$pnts]); - } - $this->mark->SetCSIMAlt($this->csimalts[$pnts]); - } - if( $exist_x ) { - $x=$this->coords[1][$pnts]; - } - else { - $x=$pnts; - } - $this->mark->SetCSIMAltVal($this->coords[0][$pnts],$x); - $this->mark->Stroke($img,$xt,$yt); - $this->csimareas .= $this->mark->GetCSIMAreas(); - } - } - } -} // Class - - -//=================================================== -// CLASS AccLinePlot -// Description: -//=================================================== -class AccLinePlot extends Plot { - protected $plots=null,$nbrplots=0; - private $iStartEndZero=true; - //--------------- - // CONSTRUCTOR - function __construct($plots) { - $this->plots = $plots; - $this->nbrplots = count($plots); - $this->numpoints = $plots[0]->numpoints; - - // Verify that all plots have the same number of data points - for( $i=1; $i < $this->nbrplots; ++$i ) { - if( $plots[$i]->numpoints != $this->numpoints ) { - JpGraphError::RaiseL(10003);//('Each plot in an accumulated lineplot must have the same number of data points',0) - } - } - - for($i=0; $i < $this->nbrplots; ++$i ) { - $this->LineInterpolate($this->plots[$i]->coords[0]); - } - } - - //--------------- - // PUBLIC METHODS - function Legend($graph) { - foreach( $this->plots as $p ) { - $p->DoLegend($graph); - } - } - - function Max() { - list($xmax) = $this->plots[0]->Max(); - $nmax=0; - $n = count($this->plots); - for($i=0; $i < $n; ++$i) { - $nc = count($this->plots[$i]->coords[0]); - $nmax = max($nmax,$nc); - list($x) = $this->plots[$i]->Max(); - $xmax = Max($xmax,$x); - } - for( $i = 0; $i < $nmax; $i++ ) { - // Get y-value for line $i by adding the - // individual bars from all the plots added. - // It would be wrong to just add the - // individual plots max y-value since that - // would in most cases give to large y-value. - $y=$this->plots[0]->coords[0][$i]; - for( $j = 1; $j < $this->nbrplots; $j++ ) { - $y += $this->plots[ $j ]->coords[0][$i]; - } - $ymax[$i] = $y; - } - $ymax = max($ymax); - return array($xmax,$ymax); - } - - function Min() { - $nmax=0; - list($xmin,$ysetmin) = $this->plots[0]->Min(); - $n = count($this->plots); - for($i=0; $i < $n; ++$i) { - $nc = count($this->plots[$i]->coords[0]); - $nmax = max($nmax,$nc); - list($x,$y) = $this->plots[$i]->Min(); - $xmin = Min($xmin,$x); - $ysetmin = Min($y,$ysetmin); - } - for( $i = 0; $i < $nmax; $i++ ) { - // Get y-value for line $i by adding the - // individual bars from all the plots added. - // It would be wrong to just add the - // individual plots min y-value since that - // would in most cases give to small y-value. - $y=$this->plots[0]->coords[0][$i]; - for( $j = 1; $j < $this->nbrplots; $j++ ) { - $y += $this->plots[ $j ]->coords[0][$i]; - } - $ymin[$i] = $y; - } - $ymin = Min($ysetmin,Min($ymin)); - return array($xmin,$ymin); - } - - // Gets called before any axis are stroked - function PreStrokeAdjust($graph) { - - // If another plot type have already adjusted the - // offset we don't touch it. - // (We check for empty in case the scale is a log scale - // and hence doesn't contain any xlabel_offset) - - if( empty($graph->xaxis->scale->ticks->xlabel_offset) || - $graph->xaxis->scale->ticks->xlabel_offset == 0 ) { - if( $this->center ) { - ++$this->numpoints; - $a=0.5; $b=0.5; - } else { - $a=0; $b=0; - } - $graph->xaxis->scale->ticks->SetXLabelOffset($a); - $graph->SetTextScaleOff($b); - $graph->xaxis->scale->ticks->SupressMinorTickMarks(); - } - - } - - function SetInterpolateMode($aIntMode) { - $this->iStartEndZero=$aIntMode; - } - - // Replace all '-' with an interpolated value. We use straightforward - // linear interpolation. If the data starts with one or several '-' they - // will be replaced by the the first valid data point - function LineInterpolate(&$aData) { - - $n=count($aData); - $i=0; - - // If first point is undefined we will set it to the same as the first - // valid data - if( $aData[$i]==='-' ) { - // Find the first valid data - while( $i < $n && $aData[$i]==='-' ) { - ++$i; - } - if( $i < $n ) { - for($j=0; $j < $i; ++$j ) { - if( $this->iStartEndZero ) - $aData[$i] = 0; - else - $aData[$j] = $aData[$i]; - } - } - else { - // All '-' => Error - return false; - } - } - - while($i < $n) { - while( $i < $n && $aData[$i] !== '-' ) { - ++$i; - } - if( $i < $n ) { - $pstart=$i-1; - - // Now see how long this segment of '-' are - while( $i < $n && $aData[$i] === '-' ) { - ++$i; - } - if( $i < $n ) { - $pend=$i; - $size=$pend-$pstart; - $k=($aData[$pend]-$aData[$pstart])/$size; - // Replace the segment of '-' with a linear interpolated value. - for($j=1; $j < $size; ++$j ) { - $aData[$pstart+$j] = $aData[$pstart] + $j*$k ; - } - } - else { - // There are no valid end point. The '-' goes all the way to the end - // In that case we just set all the remaining values the the same as the - // last valid data point. - for( $j=$pstart+1; $j < $n; ++$j ) - if( $this->iStartEndZero ) { - $aData[$j] = 0; - } - else { - $aData[$j] = $aData[$pstart] ; - } - } - } - } - return true; - } - - // To avoid duplicate of line drawing code here we just - // change the y-values for each plot and then restore it - // after we have made the stroke. We must do this copy since - // it wouldn't be possible to create an acc line plot - // with the same graphs, i.e AccLinePlot(array($pl,$pl,$pl)); - // since this method would have a side effect. - function Stroke($img,$xscale,$yscale) { - $img->SetLineWeight($this->weight); - $this->numpoints = count($this->plots[0]->coords[0]); - // Allocate array - $coords[$this->nbrplots][$this->numpoints]=0; - for($i=0; $i<$this->numpoints; $i++) { - $coords[0][$i]=$this->plots[0]->coords[0][$i]; - $accy=$coords[0][$i]; - for($j=1; $j<$this->nbrplots; ++$j ) { - $coords[$j][$i] = $this->plots[$j]->coords[0][$i]+$accy; - $accy = $coords[$j][$i]; - } - } - for($j=$this->nbrplots-1; $j>=0; --$j) { - $p=$this->plots[$j]; - for( $i=0; $i<$this->numpoints; ++$i) { - $tmp[$i]=$p->coords[0][$i]; - $p->coords[0][$i]=$coords[$j][$i]; - } - $p->Stroke($img,$xscale,$yscale); - for( $i=0; $i<$this->numpoints; ++$i) { - $p->coords[0][$i]=$tmp[$i]; - } - $p->coords[0][]=$tmp; - } - } -} // Class - - -/* EOF */ -?> diff --git a/#jpgraph/src/jpgraph_log.php b/#jpgraph/src/jpgraph_log.php deleted file mode 100644 index d5146ecd..00000000 --- a/#jpgraph/src/jpgraph_log.php +++ /dev/null @@ -1,305 +0,0 @@ -ticks = new LogTicks(); - $this->name = 'log'; - } - - //---------------- - // PUBLIC METHODS - - // Translate between world and screen - function Translate($a) { - if( !is_numeric($a) ) { - if( $a != '' && $a != '-' && $a != 'x' ) { - JpGraphError::RaiseL(11001); - // ('Your data contains non-numeric values.'); - } - return 1; - } - if( $a < 0 ) { - JpGraphError::RaiseL(11002); - //("Negative data values can not be used in a log scale."); - exit(1); - } - if( $a==0 ) $a=1; - $a=log10($a); - return ceil($this->off + ($a*1.0 - $this->scale[0]) * $this->scale_factor); - } - - // Relative translate (don't include offset) usefull when we just want - // to know the relative position (in pixels) on the axis - function RelTranslate($a) { - if( !is_numeric($a) ) { - if( $a != '' && $a != '-' && $a != 'x' ) { - JpGraphError::RaiseL(11001); - //('Your data contains non-numeric values.'); - } - return 1; - } - if( $a==0 ) { - $a=1; - } - $a=log10($a); - return round(($a*1.0 - $this->scale[0]) * $this->scale_factor); - } - - // Use bcpow() for increased precision - function GetMinVal() { - if( function_exists("bcpow") ) { - return round(bcpow(10,$this->scale[0],15),14); - } - else { - return round(pow(10,$this->scale[0]),14); - } - } - - function GetMaxVal() { - if( function_exists("bcpow") ) { - return round(bcpow(10,$this->scale[1],15),14); - } - else { - return round(pow(10,$this->scale[1]),14); - } - } - - // Logarithmic autoscaling is much simplier since we just - // set the min and max to logs of the min and max values. - // Note that for log autoscale the "maxstep" the fourth argument - // isn't used. This is just included to give the method the same - // signature as the linear counterpart. - function AutoScale($img,$min,$max,$maxsteps,$majend=true) { - if( $min==0 ) $min=1; - - if( $max <= 0 ) { - JpGraphError::RaiseL(11004); - //('Scale error for logarithmic scale. You have a problem with your data values. The max value must be greater than 0. It is mathematically impossible to have 0 in a logarithmic scale.'); - } - if( is_numeric($this->autoscale_min) ) { - $smin = round($this->autoscale_min); - $smax = ceil(log10($max)); - if( $min >= $max ) { - JpGraphError::RaiseL(25071);//('You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.'); - } - } - else { - $smin = floor(log10($min)); - if( is_numeric($this->autoscale_max) ) { - $smax = round($this->autoscale_max); - if( $smin >= $smax ) { - JpGraphError::RaiseL(25072);//('You have specified a max value with SetAutoMax() which is smaller than the miminum value used for the scale. This is not possible.'); - } - } - else - $smax = ceil(log10($max)); - } - - $this->Update($img,$smin,$smax); - } - //--------------- - // PRIVATE METHODS -} // Class - -//=================================================== -// CLASS LogTicks -// Description: -//=================================================== -class LogTicks extends Ticks{ - private $label_logtype=LOGLABELS_MAGNITUDE; - private $ticklabels_pos = array(); - //--------------- - // CONSTRUCTOR - function LogTicks() { - } - //--------------- - // PUBLIC METHODS - function IsSpecified() { - return true; - } - - function SetLabelLogType($aType) { - $this->label_logtype = $aType; - } - - // For log scale it's meaningless to speak about a major step - // We just return -1 to make the framework happy (specifically - // StrokeLabels() ) - function GetMajor() { - return -1; - } - - function SetTextLabelStart($aStart) { - JpGraphError::RaiseL(11005); - //('Specifying tick interval for a logarithmic scale is undefined. Remove any calls to SetTextLabelStart() or SetTextTickInterval() on the logarithmic scale.'); - } - - function SetXLabelOffset($dummy) { - // For log scales we dont care about XLabel offset - } - - // Draw ticks on image "img" using scale "scale". The axis absolute - // position in the image is specified in pos, i.e. for an x-axis - // it specifies the absolute y-coord and for Y-ticks it specified the - // absolute x-position. - function Stroke($img,$scale,$pos) { - $start = $scale->GetMinVal(); - $limit = $scale->GetMaxVal(); - $nextMajor = 10*$start; - $step = $nextMajor / 10.0; - - - $img->SetLineWeight($this->weight); - - if( $scale->type == "y" ) { - // member direction specified if the ticks should be on - // left or right side. - $a=$pos + $this->direction*$this->GetMinTickAbsSize(); - $a2=$pos + $this->direction*$this->GetMajTickAbsSize(); - - $count=1; - $this->maj_ticks_pos[0]=$scale->Translate($start); - $this->maj_ticklabels_pos[0]=$scale->Translate($start); - if( $this->supress_first ) - $this->maj_ticks_label[0]=""; - else { - if( $this->label_formfunc != '' ) { - $f = $this->label_formfunc; - $this->maj_ticks_label[0]=call_user_func($f,$start); - } - elseif( $this->label_logtype == LOGLABELS_PLAIN ) { - $this->maj_ticks_label[0]=$start; - } - else { - $this->maj_ticks_label[0]='10^'.round(log10($start)); - } - } - $i=1; - for($y=$start; $y<=$limit; $y+=$step,++$count ) { - $ys=$scale->Translate($y); - $this->ticks_pos[]=$ys; - $this->ticklabels_pos[]=$ys; - if( $count % 10 == 0 ) { - if( !$this->supress_tickmarks ) { - if( $this->majcolor!="" ) { - $img->PushColor($this->majcolor); - $img->Line($pos,$ys,$a2,$ys); - $img->PopColor(); - } - else { - $img->Line($pos,$ys,$a2,$ys); - } - } - - $this->maj_ticks_pos[$i]=$ys; - $this->maj_ticklabels_pos[$i]=$ys; - - if( $this->label_formfunc != '' ) { - $f = $this->label_formfunc; - $this->maj_ticks_label[$i]=call_user_func($f,$nextMajor); - } - elseif( $this->label_logtype == 0 ) { - $this->maj_ticks_label[$i]=$nextMajor; - } - else { - $this->maj_ticks_label[$i]='10^'.round(log10($nextMajor)); - } - ++$i; - $nextMajor *= 10; - $step *= 10; - $count=1; - } - else { - if( !$this->supress_tickmarks && !$this->supress_minor_tickmarks) { - if( $this->mincolor!="" ) { - $img->PushColor($this->mincolor); - } - $img->Line($pos,$ys,$a,$ys); - if( $this->mincolor!="" ) { - $img->PopColor(); - } - } - } - } - } - else { - $a=$pos - $this->direction*$this->GetMinTickAbsSize(); - $a2=$pos - $this->direction*$this->GetMajTickAbsSize(); - $count=1; - $this->maj_ticks_pos[0]=$scale->Translate($start); - $this->maj_ticklabels_pos[0]=$scale->Translate($start); - if( $this->supress_first ) { - $this->maj_ticks_label[0]=""; - } - else { - if( $this->label_formfunc != '' ) { - $f = $this->label_formfunc; - $this->maj_ticks_label[0]=call_user_func($f,$start); - } - elseif( $this->label_logtype == 0 ) { - $this->maj_ticks_label[0]=$start; - } - else { - $this->maj_ticks_label[0]='10^'.round(log10($start)); - } - } - $i=1; - for($x=$start; $x<=$limit; $x+=$step,++$count ) { - $xs=$scale->Translate($x); - $this->ticks_pos[]=$xs; - $this->ticklabels_pos[]=$xs; - if( $count % 10 == 0 ) { - if( !$this->supress_tickmarks ) { - $img->Line($xs,$pos,$xs,$a2); - } - $this->maj_ticks_pos[$i]=$xs; - $this->maj_ticklabels_pos[$i]=$xs; - - if( $this->label_formfunc != '' ) { - $f = $this->label_formfunc; - $this->maj_ticks_label[$i]=call_user_func($f,$nextMajor); - } - elseif( $this->label_logtype == 0 ) { - $this->maj_ticks_label[$i]=$nextMajor; - } - else { - $this->maj_ticks_label[$i]='10^'.round(log10($nextMajor)); - } - ++$i; - $nextMajor *= 10; - $step *= 10; - $count=1; - } - else { - if( !$this->supress_tickmarks && !$this->supress_minor_tickmarks) { - $img->Line($xs,$pos,$xs,$a); - } - } - } - } - return true; - } -} // Class -/* EOF */ -?> diff --git a/#jpgraph/src/jpgraph_meshinterpolate.inc.php b/#jpgraph/src/jpgraph_meshinterpolate.inc.php deleted file mode 100644 index 7e8ae535..00000000 --- a/#jpgraph/src/jpgraph_meshinterpolate.inc.php +++ /dev/null @@ -1,105 +0,0 @@ -Linear($aData,$aFactor); -} - -/** - * Utility class to interpolate a given data matrix - * - */ -class MeshInterpolate { - private $data = array(); - - /** - * Calculate the mid points of the given rectangle which has its top left - * corner at $row,$col. The $aFactordecides how many spliots should be done. - * i.e. how many more divisions should be done recursively - * - * @param $row Top left corner of square to work with - * @param $col Top left corner of square to work with - * $param $aFactor In how many subsquare should we split this square. A value of 1 indicates that no action - */ - function IntSquare( $aRow, $aCol, $aFactor ) { - if ( $aFactor <= 1 ) - return; - - $step = pow( 2, $aFactor-1 ); - - $v0 = $this->data[$aRow][$aCol]; - $v1 = $this->data[$aRow][$aCol + $step]; - $v2 = $this->data[$aRow + $step][$aCol]; - $v3 = $this->data[$aRow + $step][$aCol + $step]; - - $this->data[$aRow][$aCol + $step / 2] = ( $v0 + $v1 ) / 2; - $this->data[$aRow + $step / 2][$aCol] = ( $v0 + $v2 ) / 2; - $this->data[$aRow + $step][$aCol + $step / 2] = ( $v2 + $v3 ) / 2; - $this->data[$aRow + $step / 2][$aCol + $step] = ( $v1 + $v3 ) / 2; - $this->data[$aRow + $step / 2][$aCol + $step / 2] = ( $v0 + $v1 + $v2 + $v3 ) / 4; - - $this->IntSquare( $aRow, $aCol, $aFactor-1 ); - $this->IntSquare( $aRow, $aCol + $step / 2, $aFactor-1 ); - $this->IntSquare( $aRow + $step / 2, $aCol, $aFactor-1 ); - $this->IntSquare( $aRow + $step / 2, $aCol + $step / 2, $aFactor-1 ); - } - - /** - * Interpolate values in a matrice so that the total number of data points - * in vert and horizontal axis are $aIntNbr more. For example $aIntNbr=2 will - * make the data matrice have tiwce as many vertical and horizontal dta points. - * - * Note: This will blow up the matrcide in memory size in the order of $aInNbr^2 - * - * @param $ &$aData The original data matricde - * @param $aInNbr Interpolation factor - * @return the interpolated matrice - */ - function Linear( &$aData, $aIntFactor ) { - $step = pow( 2, $aIntFactor-1 ); - - $orig_cols = count( $aData[0] ); - $orig_rows = count( $aData ); - // Number of new columns/rows - // N = (a-1) * 2^(f-1) + 1 - $p = pow( 2, $aIntFactor-1 ); - $new_cols = $p * ( $orig_cols - 1 ) + 1; - $new_rows = $p * ( $orig_rows - 1 ) + 1; - - $this->data = array_fill( 0, $new_rows, array_fill( 0, $new_cols, 0 ) ); - // Initialize the new matrix with the values that we know - for ( $i = 0; $i < $new_rows; $i++ ) { - for ( $j = 0; $j < $new_cols; $j++ ) { - $v = 0 ; - if ( ( $i % $step == 0 ) && ( $j % $step == 0 ) ) { - $v = $aData[$i / $step][$j / $step]; - } - $this->data[$i][$j] = $v; - } - } - - for ( $i = 0; $i < $new_rows-1; $i += $step ) { - for ( $j = 0; $j < $new_cols-1; $j += $step ) { - $this->IntSquare( $i, $j, $aIntFactor ); - } - } - - return $this->data; - } -} - -?> diff --git a/#jpgraph/src/jpgraph_mgraph.php b/#jpgraph/src/jpgraph_mgraph.php deleted file mode 100644 index 80b2b6d7..00000000 --- a/#jpgraph/src/jpgraph_mgraph.php +++ /dev/null @@ -1,345 +0,0 @@ -iWidth = $aWidth; - $this->iHeight = $aHeight; - - // If the cached version exist just read it directly from the - // cache, stream it back to browser and exit - if( $aCachedName!='' && READ_CACHE && $aInline ) { - $this->cache = new ImgStreamCache(); - $this->cache->SetTimeOut($aTimeOut); - $image = new Image(); - if( $this->cache->GetAndStream($image,$aCachedName) ) { - exit(); - } - } - $this->inline = $aInline; - $this->cache_name = $aCachedName; - - $this->title = new Text(); - $this->title->ParagraphAlign('center'); - $this->title->SetFont(FF_FONT2,FS_BOLD); - $this->title->SetMargin(3); - $this->title->SetAlign('center'); - - $this->subtitle = new Text(); - $this->subtitle->ParagraphAlign('center'); - $this->subtitle->SetFont(FF_FONT1,FS_BOLD); - $this->subtitle->SetMargin(3); - $this->subtitle->SetAlign('center'); - - $this->subsubtitle = new Text(); - $this->subsubtitle->ParagraphAlign('center'); - $this->subsubtitle->SetFont(FF_FONT1,FS_NORMAL); - $this->subsubtitle->SetMargin(3); - $this->subsubtitle->SetAlign('center'); - - $this->footer = new Footer(); - - } - - // Specify background fill color for the combined graph - function SetFillColor($aColor) { - $this->iFillColor = $aColor; - } - - // Add a frame around the combined graph - function SetFrame($aFlg,$aColor='black',$aWeight=1) { - $this->iDoFrame = $aFlg; - $this->iFrameColor = $aColor; - $this->iFrameWeight = $aWeight; - } - - // Specify a background image blend - function SetBackgroundImageMix($aMix) { - $this->background_image_mix = $aMix ; - } - - // Specify a background image - function SetBackgroundImage($aFileName,$aCenter_aX=NULL,$aY=NULL) { - // Second argument can be either a boolean value or - // a numeric - $aCenter=TRUE; - $aX=NULL; - - if( is_numeric($aCenter_aX) ) { - $aX=$aCenter_aX; - } - - // Get extension to determine image type - $e = explode('.',$aFileName); - if( !$e ) { - JpGraphError::RaiseL(12002,$aFileName); - //('Incorrect file name for MGraph::SetBackgroundImage() : '.$aFileName.' Must have a valid image extension (jpg,gif,png) when using autodetection of image type'); - } - - $valid_formats = array('png', 'jpg', 'gif'); - $aImgFormat = strtolower($e[count($e)-1]); - if ($aImgFormat == 'jpeg') { - $aImgFormat = 'jpg'; - } - elseif (!in_array($aImgFormat, $valid_formats) ) { - JpGraphError::RaiseL(12003,$aImgFormat,$aFileName); - //('Unknown file extension ($aImgFormat) in MGraph::SetBackgroundImage() for filename: '.$aFileName); - } - - $this->background_image = $aFileName; - $this->background_image_center=$aCenter; - $this->background_image_format=$aImgFormat; - $this->background_image_x = $aX; - $this->background_image_y = $aY; - } - - function _strokeBackgroundImage() { - if( $this->background_image == '' ) return; - - $bkgimg = Graph::LoadBkgImage('',$this->background_image); - - // Background width & Heoght - $bw = imagesx($bkgimg); - $bh = imagesy($bkgimg); - - // Canvas width and height - $cw = imagesx($this->img); - $ch = imagesy($this->img); - - if( $this->doshadow ) { - $cw -= $this->shadow_width; - $ch -= $this->shadow_width; - } - - if( $this->background_image_x === NULL || $this->background_image_y === NULL ) { - if( $this->background_image_center ) { - // Center original image in the plot area - $x = round($cw/2-$bw/2); $y = round($ch/2-$bh/2); - } - else { - // Just copy the image from left corner, no resizing - $x=0; $y=0; - } - } - else { - $x = $this->background_image_x; - $y = $this->background_image_y; - } - imagecopymerge($this->img,$bkgimg,$x,$y,0,0,$bw,$bh,$this->background_image_mix); - } - - function AddMix($aGraph,$x=0,$y=0,$mix=100,$fx=0,$fy=0,$w=0,$h=0) { - $this->_gdImgHandle($aGraph->Stroke( _IMG_HANDLER),$x,$y,$fx=0,$fy=0,$w,$h,$mix); - } - - function Add($aGraph,$x=0,$y=0,$fx=0,$fy=0,$w=0,$h=0) { - $this->_gdImgHandle($aGraph->Stroke( _IMG_HANDLER),$x,$y,$fx=0,$fy=0,$w,$h); - } - - function _gdImgHandle($agdCanvas,$x,$y,$fx=0,$fy=0,$w=0,$h=0,$mix=100) { - if( $w == 0 ) { - $w = @imagesx($agdCanvas); - } - if( $w === NULL ) { - JpGraphError::RaiseL(12007); - //('Argument to MGraph::Add() is not a valid GD image handle.'); - return; - } - if( $h == 0 ) { - $h = @imagesy($agdCanvas); - } - $this->iGraphs[$this->iCnt++] = array($agdCanvas,$x,$y,$fx,$fy,$w,$h,$mix); - } - - function SetMargin($lm,$rm,$tm,$bm) { - $this->lm = $lm; - $this->rm = $rm; - $this->tm = $tm; - $this->bm = $bm; - } - - function SetExpired($aFlg=true) { - $this->expired = $aFlg; - } - - function SetImgFormat($aFormat,$aQuality=75) { - $this->image_format = $aFormat; - $this->image_quality = $aQuality; - } - - // Set the shadow around the whole image - function SetShadow($aShowShadow=true,$aShadowWidth=4,$aShadowColor='gray@0.3') { - $this->doshadow = $aShowShadow; - $this->shadow_color = $aShadowColor; - $this->shadow_width = $aShadowWidth; - $this->footer->iBottomMargin += $aShadowWidth; - $this->footer->iRightMargin += $aShadowWidth; - } - - function StrokeTitle($image,$w,$h) { - // Stroke title - if( $this->title->t !== '' ) { - - $margin = 3; - - $y = $this->title->margin; - if( $this->title->halign == 'center' ) { - $this->title->Center(0,$w,$y); - } - elseif( $this->title->halign == 'left' ) { - $this->title->SetPos($this->title->margin+2,$y); - } - elseif( $this->title->halign == 'right' ) { - $indent = 0; - if( $this->doshadow ) { - $indent = $this->shadow_width+2; - } - $this->title->SetPos($w-$this->title->margin-$indent,$y,'right'); - } - $this->title->Stroke($image); - - // ... and subtitle - $y += $this->title->GetTextHeight($image) + $margin + $this->subtitle->margin; - if( $this->subtitle->halign == 'center' ) { - $this->subtitle->Center(0,$w,$y); - } - elseif( $this->subtitle->halign == 'left' ) { - $this->subtitle->SetPos($this->subtitle->margin+2,$y); - } - elseif( $this->subtitle->halign == 'right' ) { - $indent = 0; - if( $this->doshadow ) { - $indent = $this->shadow_width+2; - } - $this->subtitle->SetPos($this->img->width-$this->subtitle->margin-$indent,$y,'right'); - } - $this->subtitle->Stroke($image); - - // ... and subsubtitle - $y += $this->subtitle->GetTextHeight($image) + $margin + $this->subsubtitle->margin; - if( $this->subsubtitle->halign == 'center' ) { - $this->subsubtitle->Center(0,$w,$y); - } - elseif( $this->subsubtitle->halign == 'left' ) { - $this->subsubtitle->SetPos($this->subsubtitle->margin+2,$y); - } - elseif( $this->subsubtitle->halign == 'right' ) { - $indent = 0; - if( $this->doshadow ) { - $indent = $this->shadow_width+2; - } - $this->subsubtitle->SetPos($w-$this->subsubtitle->margin-$indent,$y,'right'); - } - $this->subsubtitle->Stroke($image); - - } - } - - function Stroke($aFileName='') { - // Find out the necessary size for the container image - $w=0; $h=0; - for($i=0; $i < $this->iCnt; ++$i ) { - $maxw = $this->iGraphs[$i][1]+$this->iGraphs[$i][5]; - $maxh = $this->iGraphs[$i][2]+$this->iGraphs[$i][6]; - $w = max( $w, $maxw ); - $h = max( $h, $maxh ); - } - $w += $this->lm+$this->rm; - $h += $this->tm+$this->bm; - - // User specified width,height overrides - if( $this->iWidth !== NULL && $this->iWidth !== 0 ) $w = $this->iWidth; - if( $this->iHeight!== NULL && $this->iHeight !== 0) $h = $this->iHeight; - - if( $this->doshadow ) { - $w += $this->shadow_width; - $h += $this->shadow_width; - } - - $image = new Image($w,$h); - $image->SetImgFormat( $this->image_format,$this->image_quality); - - if( $this->doshadow ) { - $image->SetColor($this->iFrameColor); - $image->ShadowRectangle(0,0,$w-1,$h-1,$this->iFillColor,$this->shadow_width,$this->shadow_color); - $w -= $this->shadow_width; - $h -= $this->shadow_width; - } - else { - $image->SetColor($this->iFillColor); - $image->FilledRectangle(0,0,$w-1,$h-1); - } - $image->SetExpired($this->expired); - - $this->img = $image->img; - $this->_strokeBackgroundImage(); - - if( $this->iDoFrame && ! $this->doshadow ) { - $image->SetColor($this->iFrameColor); - $image->SetLineWeight($this->iFrameWeight); - $image->Rectangle(0,0,$w-1,$h-1); - } - - // Copy all sub graphs to the container - for($i=0; $i < $this->iCnt; ++$i ) { - $image->CopyMerge($this->iGraphs[$i][0], - $this->iGraphs[$i][1]+$this->lm,$this->iGraphs[$i][2]+$this->tm, - $this->iGraphs[$i][3],$this->iGraphs[$i][4], - $this->iGraphs[$i][5],$this->iGraphs[$i][6], - -1,-1, /* Full from width and height */ - $this->iGraphs[$i][7]); - - - } - - $this->StrokeTitle($image,$w,$h); - $this->footer->Stroke($image); - - // Output image - if( $aFileName == _IMG_HANDLER ) { - return $image->img; - } - else { - //Finally stream the generated picture - $this->cache = new ImgStreamCache(); - $this->cache->PutAndStream($image,$this->cache_name,$this->inline,$aFileName); - } - } -} - -// EOF - -?> diff --git a/#jpgraph/src/jpgraph_pie.php b/#jpgraph/src/jpgraph_pie.php deleted file mode 100644 index c79d30fa..00000000 --- a/#jpgraph/src/jpgraph_pie.php +++ /dev/null @@ -1,1495 +0,0 @@ - array(136,34,40,45,46,62,63,134,74,10,120,136,141,168,180,77,209,218,346,395,89,430), - "pastel" => array(27,415,128,59,66,79,105,110,42,147,152,230,236,240,331,337,405,38), - "water" => array(8,370,24,40,335,56,213,237,268,14,326,387,10,388), - "sand" => array(27,168,34,170,19,50,65,72,131,209,46,393)); - protected $setslicecolors=array(); - protected $labeltype=0; // Default to percentage - protected $pie_border=true,$pie_interior_border=true; - public $value; - protected $ishadowcolor='',$ishadowdrop=4; - protected $ilabelposadj=1; - protected $legendcsimtargets = array(),$legendcsimwintargets = array(); - protected $legendcsimalts = array(); - protected $adjusted_data = array(); - public $guideline = null; - protected $guidelinemargin=10,$iShowGuideLineForSingle = false; - protected $iGuideLineCurve = false,$iGuideVFactor=1.4,$iGuideLineRFactor=0.8; - protected $la = array(); // Holds the exact angle for each label - - //--------------- - // CONSTRUCTOR - function __construct($data) { - $this->data = array_reverse($data); - $this->title = new Text(""); - $this->title->SetFont(FF_DEFAULT,FS_BOLD); - $this->value = new DisplayValue(); - $this->value->Show(); - $this->value->SetFormat('%.1f%%'); - $this->guideline = new LineProperty(); - } - - //--------------- - // PUBLIC METHODS - function SetCenter($x,$y=0.5) { - $this->posx = $x; - $this->posy = $y; - } - - // Enable guideline and set drwaing policy - function SetGuideLines($aFlg=true,$aCurved=true,$aAlways=false) { - $this->guideline->Show($aFlg); - $this->iShowGuideLineForSingle = $aAlways; - $this->iGuideLineCurve = $aCurved; - } - - // Adjuste the distance between labels and labels and pie - function SetGuideLinesAdjust($aVFactor,$aRFactor=0.8) { - $this->iGuideVFactor=$aVFactor; - $this->iGuideLineRFactor=$aRFactor; - } - - function SetColor($aColor) { - $this->color = $aColor; - } - - function SetSliceColors($aColors) { - $this->setslicecolors = $aColors; - } - - function SetShadow($aColor='darkgray',$aDropWidth=4) { - $this->ishadowcolor = $aColor; - $this->ishadowdrop = $aDropWidth; - } - - function SetCSIMTargets($aTargets,$aAlts='',$aWinTargets='') { - $this->csimtargets=array_reverse($aTargets); - if( is_array($aWinTargets) ) - $this->csimwintargets=array_reverse($aWinTargets); - if( is_array($aAlts) ) - $this->csimalts=array_reverse($aAlts); - } - - function GetCSIMareas() { - return $this->csimareas; - } - - function AddSliceToCSIM($i,$xc,$yc,$radius,$sa,$ea) { - //Slice number, ellipse centre (x,y), height, width, start angle, end angle - while( $sa > 2*M_PI ) $sa = $sa - 2*M_PI; - while( $ea > 2*M_PI ) $ea = $ea - 2*M_PI; - - $sa = 2*M_PI - $sa; - $ea = 2*M_PI - $ea; - - // Special case when we have only one slice since then both start and end - // angle will be == 0 - if( abs($sa - $ea) < 0.0001 ) { - $sa=2*M_PI; $ea=0; - } - - //add coordinates of the centre to the map - $xc = floor($xc);$yc=floor($yc); - $coords = "$xc, $yc"; - - //add coordinates of the first point on the arc to the map - $xp = floor(($radius*cos($ea))+$xc); - $yp = floor($yc-$radius*sin($ea)); - $coords.= ", $xp, $yp"; - - //add coordinates every 0.2 radians - $a=$ea+0.2; - - // If we cross the 360-limit with a slice we need to handle - // the fact that end angle is smaller than start - if( $sa < $ea ) { - while ($a <= 2*M_PI) { - $xp = floor($radius*cos($a)+$xc); - $yp = floor($yc-$radius*sin($a)); - $coords.= ", $xp, $yp"; - $a += 0.2; - } - $a -= 2*M_PI; - } - - - while ($a < $sa) { - $xp = floor($radius*cos($a)+$xc); - $yp = floor($yc-$radius*sin($a)); - $coords.= ", $xp, $yp"; - $a += 0.2; - } - - //Add the last point on the arc - $xp = floor($radius*cos($sa)+$xc); - $yp = floor($yc-$radius*sin($sa)); - $coords.= ", $xp, $yp"; - if( !empty($this->csimtargets[$i]) ) { - $this->csimareas .= "csimtargets[$i]."\""; - $tmp=""; - if( !empty($this->csimwintargets[$i]) ) { - $this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; - } - if( !empty($this->csimalts[$i]) ) { - $tmp=sprintf($this->csimalts[$i],$this->data[$i]); - $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; - } - $this->csimareas .= " />\n"; - } - } - - - function SetTheme($aTheme) { -// JpGraphError::RaiseL(15012,$aTheme); -// return; - - if( in_array($aTheme,array_keys($this->themearr)) ) { - $this->theme = $aTheme; - $this->is_using_plot_theme = true; - } else { - JpGraphError::RaiseL(15001,$aTheme);//("PiePLot::SetTheme() Unknown theme: $aTheme"); - } - } - - function ExplodeSlice($e,$radius=20) { - if( ! is_integer($e) ) - JpGraphError::RaiseL(15002);//('Argument to PiePlot::ExplodeSlice() must be an integer'); - $this->explode_radius[$e]=$radius; - } - - function ExplodeAll($radius=20) { - $this->explode_all=true; - $this->explode_r = $radius; - } - - function Explode($aExplodeArr) { - if( !is_array($aExplodeArr) ) { - JpGraphError::RaiseL(15003); - //("Argument to PiePlot::Explode() must be an array with integer distances."); - } - $this->explode_radius = $aExplodeArr; - } - - function SetStartAngle($aStart) { - if( $aStart < 0 || $aStart > 360 ) { - JpGraphError::RaiseL(15004);//('Slice start angle must be between 0 and 360 degrees.'); - } - if( $aStart == 0 ) { - $this->startangle = 0; - } - else { - $this->startangle = 360-$aStart; - $this->startangle *= M_PI/180; - } - } - - // Size in percentage - function SetSize($aSize) { - if( ($aSize>0 && $aSize<=0.5) || ($aSize>10 && $aSize<1000) ) - $this->radius = $aSize; - else - JpGraphError::RaiseL(15006); - //("PiePlot::SetSize() Radius for pie must either be specified as a fraction [0, 0.5] of the size of the image or as an absolute size in pixels in the range [10, 1000]"); - } - - // Set label arrays - function SetLegends($aLegend) { - $this->legends = $aLegend; - } - - // Set text labels for slices - function SetLabels($aLabels,$aLblPosAdj="auto") { - $this->labels = array_reverse($aLabels); - $this->ilabelposadj=$aLblPosAdj; - } - - function SetLabelPos($aLblPosAdj) { - $this->ilabelposadj=$aLblPosAdj; - } - - // Should we display actual value or percentage? - function SetLabelType($aType) { - if( $aType < 0 || $aType > 2 ) - JpGraphError::RaiseL(15008,$aType); - //("PiePlot::SetLabelType() Type for pie plots must be 0 or 1 (not $t)."); - $this->labeltype = $aType; - } - - // Deprecated. - function SetValueType($aType) { - $this->SetLabelType($aType); - } - - // Should the circle around a pie plot be displayed - function ShowBorder($exterior=true,$interior=true) { - $this->pie_border = $exterior; - $this->pie_interior_border = $interior; - } - - // Setup the legends - function Legend($graph) { - $colors = array_keys($graph->img->rgb->rgb_table); - sort($colors); - $ta=$this->themearr[$this->theme]; - $n = count($this->data); - - if( $this->setslicecolors==null ) { - $numcolors=count($ta); - if( class_exists('PiePlot3D',false) && ($this instanceof PiePlot3D) ) { - $ta = array_reverse(array_slice($ta,0,$n)); - } - } - else { - $this->setslicecolors = array_slice($this->setslicecolors,0,$n); - $numcolors=count($this->setslicecolors); - if( $graph->pieaa && !($this instanceof PiePlot3D) ) { - $this->setslicecolors = array_reverse($this->setslicecolors); - } - } - - $sum=0; - for($i=0; $i < $n; ++$i) - $sum += $this->data[$i]; - - // Bail out with error if the sum is 0 - if( $sum==0 ) - JpGraphError::RaiseL(15009);//("Illegal pie plot. Sum of all data is zero for Pie!"); - - // Make sure we don't plot more values than data points - // (in case the user added more legends than data points) - $n = min(count($this->legends),count($this->data)); - if( $this->legends != "" ) { - $this->legends = array_reverse(array_slice($this->legends,0,$n)); - } - for( $i=$n-1; $i >= 0; --$i ) { - $l = $this->legends[$i]; - // Replace possible format with actual values - if( count($this->csimalts) > $i ) { - $fmt = $this->csimalts[$i]; - } - else { - $fmt = "%d"; // Deafult Alt if no other has been specified - } - if( $this->labeltype==0 ) { - $l = sprintf($l,100*$this->data[$i]/$sum); - $alt = sprintf($fmt,$this->data[$i]); - - } - elseif( $this->labeltype == 1) { - $l = sprintf($l,$this->data[$i]); - $alt = sprintf($fmt,$this->data[$i]); - - } - else { - $l = sprintf($l,$this->adjusted_data[$i]); - $alt = sprintf($fmt,$this->adjusted_data[$i]); - } - - if( empty($this->csimwintargets[$i]) ) { - $wintarg = ''; - } - else { - $wintarg = $this->csimwintargets[$i]; - } - - if( $this->setslicecolors==null ) { - $graph->legend->Add($l,$colors[$ta[$i%$numcolors]],"",0,$this->csimtargets[$i],$alt,$wintarg); - } - else { - $graph->legend->Add($l,$this->setslicecolors[$i%$numcolors],"",0,$this->csimtargets[$i],$alt,$wintarg); - } - } - } - - // Adjust the rounded percetage value so that the sum of - // of the pie slices are always 100% - // Using the Hare/Niemeyer method - function AdjPercentage($aData,$aPrec=0) { - $mul=100; - if( $aPrec > 0 && $aPrec < 3 ) { - if( $aPrec == 1 ) - $mul=1000; - else - $mul=10000; - } - - $tmp = array(); - $result = array(); - $quote_sum=0; - $n = count($aData) ; - for( $i=0, $sum=0; $i < $n; ++$i ) - $sum+=$aData[$i]; - foreach($aData as $index => $value) { - $tmp_percentage=$value/$sum*$mul; - $result[$index]=floor($tmp_percentage); - $tmp[$index]=$tmp_percentage-$result[$index]; - $quote_sum+=$result[$index]; - } - if( $quote_sum == $mul) { - if( $mul > 100 ) { - $tmp = $mul / 100; - for( $i=0; $i < $n; ++$i ) { - $result[$i] /= $tmp ; - } - } - return $result; - } - arsort($tmp,SORT_NUMERIC); - reset($tmp); - for($i=0; $i < $mul-$quote_sum; $i++) - { - $result[key($tmp)]++; - next($tmp); - } - if( $mul > 100 ) { - $tmp = $mul / 100; - for( $i=0; $i < $n; ++$i ) { - $result[$i] /= $tmp ; - } - } - return $result; - } - - - function Stroke($img,$aaoption=0) { - // aaoption is used to handle antialias - // aaoption == 0 a normal pie - // aaoption == 1 just the body - // aaoption == 2 just the values - - // Explode scaling. If anti alias we scale the image - // twice and we also need to scale the exploding distance - $expscale = $aaoption === 1 ? 2 : 1; - - if( $this->labeltype == 2 ) { - // Adjust the data so that it will add up to 100% - $this->adjusted_data = $this->AdjPercentage($this->data); - } - - if ($this->use_plot_theme_colors) { - $this->setslicecolors = null; - } - - $colors = array_keys($img->rgb->rgb_table); - sort($colors); - $ta=$this->themearr[$this->theme]; - $n = count($this->data); - - if( $this->setslicecolors==null ) { - $numcolors=count($ta); - } - else { - // We need to create an array of colors as long as the data - // since we need to reverse it to get the colors in the right order - $numcolors=count($this->setslicecolors); - $i = 2*$numcolors; - while( $n > $i ) { - $this->setslicecolors = array_merge($this->setslicecolors,$this->setslicecolors); - $i += $n; - } - $tt = array_slice($this->setslicecolors,0,$n % $numcolors); - $this->setslicecolors = array_merge($this->setslicecolors,$tt); - $this->setslicecolors = array_reverse($this->setslicecolors); - } - - // Draw the slices - $sum=0; - for($i=0; $i < $n; ++$i) - $sum += $this->data[$i]; - - // Bail out with error if the sum is 0 - if( $sum==0 ) { - JpGraphError::RaiseL(15009);//("Sum of all data is 0 for Pie."); - } - - // Set up the pie-circle - if( $this->radius <= 1 ) { - $radius = floor($this->radius*min($img->width,$img->height)); - } - else { - $radius = $aaoption === 1 ? $this->radius*2 : $this->radius; - } - - if( $this->posx <= 1 && $this->posx > 0 ) { - $xc = round($this->posx*$img->width); - } - else { - $xc = $this->posx ; - } - - if( $this->posy <= 1 && $this->posy > 0 ) { - $yc = round($this->posy*$img->height); - } - else { - $yc = $this->posy ; - } - - $n = count($this->data); - - if( $this->explode_all ) { - for($i=0; $i < $n; ++$i) { - $this->explode_radius[$i]=$this->explode_r; - } - } - - // If we have a shadow and not just drawing the labels - if( $this->ishadowcolor != "" && $aaoption !== 2) { - $accsum=0; - $angle2 = $this->startangle; - $img->SetColor($this->ishadowcolor); - for($i=0; $sum > 0 && $i < $n; ++$i) { - $j = $n-$i-1; - $d = $this->data[$i]; - $angle1 = $angle2; - $accsum += $d; - $angle2 = $this->startangle+2*M_PI*$accsum/$sum; - if( empty($this->explode_radius[$j]) ) { - $this->explode_radius[$j]=0; - } - - if( $d < 0.00001 ) continue; - - $la = 2*M_PI - (abs($angle2-$angle1)/2.0+$angle1); - - $xcm = $xc + $this->explode_radius[$j]*cos($la)*$expscale; - $ycm = $yc - $this->explode_radius[$j]*sin($la)*$expscale; - - $xcm += $this->ishadowdrop*$expscale; - $ycm += $this->ishadowdrop*$expscale; - - $_sa = round($angle1*180/M_PI); - $_ea = round($angle2*180/M_PI); - - // The CakeSlice method draws a full circle in case of start angle = end angle - // for pie slices we don't want this behaviour unless we only have one - // slice in the pie in case it is the wanted behaviour - if( $_ea-$_sa > 0.1 || $n==1 ) { - $img->CakeSlice($xcm,$ycm,$radius-1,$radius-1, - $angle1*180/M_PI,$angle2*180/M_PI,$this->ishadowcolor); - } - } - } - - //-------------------------------------------------------------------------------- - // This is the main loop to draw each cake slice - //-------------------------------------------------------------------------------- - - // Set up the accumulated sum, start angle for first slice and border color - $accsum=0; - $angle2 = $this->startangle; - $img->SetColor($this->color); - - // Loop though all the slices if there is a pie to draw (sum>0) - // There are n slices in total - for($i=0; $sum>0 && $i < $n; ++$i) { - - // $j is the actual index used for the slice - $j = $n-$i-1; - - // Make sure we havea valid distance to explode the slice - if( empty($this->explode_radius[$j]) ) { - $this->explode_radius[$j]=0; - } - - // The actual numeric value for the slice - $d = $this->data[$i]; - - $angle1 = $angle2; - - // Accumlate the sum - $accsum += $d; - - // The new angle when we add the "size" of this slice - // angle1 is then the start and angle2 the end of this slice - $angle2 = $this->NormAngle($this->startangle+2*M_PI*$accsum/$sum); - - // We avoid some trouble by not allowing end angle to be 0, in that case - // we translate to 360 - - // la is used to hold the label angle, which is centered on the slice - if( $angle2 < 0.0001 && $angle1 > 0.0001 ) { - $this->la[$i] = 2*M_PI - (abs(2*M_PI-$angle1)/2.0+$angle1); - } - elseif( $angle1 > $angle2 ) { - // The case where the slice crosses the 3 a'clock line - // Remember that the slices are counted clockwise and - // labels are counted counter clockwise so we need to revert with 2 PI - $this->la[$i] = 2*M_PI-$this->NormAngle($angle1 + ((2*M_PI - $angle1)+$angle2)/2); - } - else { - $this->la[$i] = 2*M_PI - (abs($angle2-$angle1)/2.0+$angle1); - } - - // Too avoid rounding problems we skip the slice if it is too small - if( $d < 0.00001 ) continue; - - // If the user has specified an array of colors for each slice then use - // that a color otherwise use the theme array (ta) of colors - if( $this->setslicecolors==null ) { - $slicecolor=$colors[$ta[$i%$numcolors]]; - } - else { - $slicecolor=$this->setslicecolors[$i%$numcolors]; - } - -// $_sa = round($angle1*180/M_PI); -// $_ea = round($angle2*180/M_PI); -// $_la = round($this->la[$i]*180/M_PI); -// echo "Slice#$i: ang1=$_sa , ang2=$_ea, la=$_la, color=$slicecolor
"; - - - // If we have enabled antialias then we don't draw any border so - // make the bordedr color the same as the slice color - if( $this->pie_interior_border && $aaoption===0 ) { - $img->SetColor($this->color); - } - else { - $img->SetColor($slicecolor); - } - $arccolor = $this->pie_border && $aaoption===0 ? $this->color : ""; - - // Calculate the x,y coordinates for the base of this slice taking - // the exploded distance into account. Here we use the mid angle as the - // ray of extension and we have the mid angle handy as it is also the - // label angle - $xcm = $xc + $this->explode_radius[$j]*cos($this->la[$i])*$expscale; - $ycm = $yc - $this->explode_radius[$j]*sin($this->la[$i])*$expscale; - - // If we are not just drawing the labels then draw this cake slice - if( $aaoption !== 2 ) { - - $_sa = round($angle1*180/M_PI); - $_ea = round($angle2*180/M_PI); - $_la = round($this->la[$i]*180/M_PI); - //echo "[$i] sa=$_sa, ea=$_ea, la[$i]=$_la, (color=$slicecolor)
"; - - // The CakeSlice method draws a full circle in case of start angle = end angle - // for pie slices we want this in case the slice have a value larger than 99% of the - // total sum - if( abs($_ea-$_sa) >= 1 || $d == $sum ) { - $img->CakeSlice($xcm,$ycm,$radius-1,$radius-1,$_sa,$_ea,$slicecolor,$arccolor); - } - } - - // If the CSIM is used then make sure we register a CSIM area for this slice as well - if( $this->csimtargets && $aaoption !== 1 ) { - $this->AddSliceToCSIM($i,$xcm,$ycm,$radius,$angle1,$angle2); - } - } - - // Format the titles for each slice - if( $aaoption !== 2 ) { - for( $i=0; $i < $n; ++$i) { - if( $this->labeltype==0 ) { - if( $sum != 0 ) - $l = 100.0*$this->data[$i]/$sum; - else - $l = 0.0; - } - elseif( $this->labeltype==1 ) { - $l = $this->data[$i]*1.0; - } - else { - $l = $this->adjusted_data[$i]; - } - if( isset($this->labels[$i]) && is_string($this->labels[$i]) ) - $this->labels[$i]=sprintf($this->labels[$i],$l); - else - $this->labels[$i]=$l; - } - } - - if( $this->value->show && $aaoption !== 1 ) { - $this->StrokeAllLabels($img,$xc,$yc,$radius); - } - - // Adjust title position - if( $aaoption !== 1 ) { - $this->title->SetPos($xc, - $yc-$this->title->GetFontHeight($img)-$radius-$this->title->margin, - "center","bottom"); - $this->title->Stroke($img); - } - - } - - //--------------- - // PRIVATE METHODS - - function NormAngle($a) { - while( $a < 0 ) $a += 2*M_PI; - while( $a > 2*M_PI ) $a -= 2*M_PI; - return $a; - } - - function Quadrant($a) { - $a=$this->NormAngle($a); - if( $a > 0 && $a <= M_PI/2 ) - return 0; - if( $a > M_PI/2 && $a <= M_PI ) - return 1; - if( $a > M_PI && $a <= 1.5*M_PI ) - return 2; - if( $a > 1.5*M_PI ) - return 3; - } - - function StrokeGuideLabels($img,$xc,$yc,$radius) { - $n = count($this->labels); - - //----------------------------------------------------------------------- - // Step 1 of the algorithm is to construct a number of clusters - // a cluster is defined as all slices within the same quadrant (almost) - // that has an angular distance less than the treshold - //----------------------------------------------------------------------- - $tresh_hold=25 * M_PI/180; // 25 degrees difference to be in a cluster - $incluster=false; // flag if we are currently in a cluster or not - $clusters = array(); // array of clusters - $cidx=-1; // running cluster index - - // Go through all the labels and construct a number of clusters - for($i=0; $i < $n-1; ++$i) { - // Calc the angle distance between two consecutive slices - $a1=$this->la[$i]; - $a2=$this->la[$i+1]; - $q1 = $this->Quadrant($a1); - $q2 = $this->Quadrant($a2); - $diff = abs($a1-$a2); - if( $diff < $tresh_hold ) { - if( $incluster ) { - $clusters[$cidx][1]++; - // Each cluster can only cover one quadrant - // Do we cross a quadrant ( and must break the cluster) - if( $q1 != $q2 ) { - // If we cross a quadrant boundary we normally start a - // new cluster. However we need to take the 12'a clock - // and 6'a clock positions into a special consideration. - // Case 1: WE go from q=1 to q=2 if the last slice on - // the cluster for q=1 is close to 12'a clock and the - // first slice in q=0 is small we extend the previous - // cluster - if( $q1 == 1 && $q2 == 0 && $a2 > (90-15)*M_PI/180 ) { - if( $i < $n-2 ) { - $a3 = $this->la[$i+2]; - // If there isn't a cluster coming up with the next-next slice - // we extend the previous cluster to cover this slice as well - if( abs($a3-$a2) >= $tresh_hold ) { - $clusters[$cidx][1]++; - $i++; - } - } - } - elseif( $q1 == 3 && $q2 == 2 && $a2 > (270-15)*M_PI/180 ) { - if( $i < $n-2 ) { - $a3 = $this->la[$i+2]; - // If there isn't a cluster coming up with the next-next slice - // we extend the previous cluster to cover this slice as well - if( abs($a3-$a2) >= $tresh_hold ) { - $clusters[$cidx][1]++; - $i++; - } - } - } - - if( $q1==2 && $q2==1 && $a2 > (180-15)*M_PI/180 ) { - $clusters[$cidx][1]++; - $i++; - } - - $incluster = false; - } - } - elseif( $q1 == $q2) { - $incluster = true; - // Now we have a special case for quadrant 0. If we previously - // have a cluster of one in quadrant 0 we just extend that - // cluster. If we don't do this then we risk that the label - // for the cluster of one will cross the guide-line - if( $q1 == 0 && $cidx > -1 && - $clusters[$cidx][1] == 1 && - $this->Quadrant($this->la[$clusters[$cidx][0]]) == 0 ) { - $clusters[$cidx][1]++; - } - else { - $cidx++; - $clusters[$cidx][0] = $i; - $clusters[$cidx][1] = 1; - } - } - else { - // Create a "cluster" of one since we are just crossing - // a quadrant - $cidx++; - $clusters[$cidx][0] = $i; - $clusters[$cidx][1] = 1; - } - } - else { - if( $incluster ) { - // Add the last slice - $clusters[$cidx][1]++; - $incluster = false; - } - else { // Create a "cluster" of one - $cidx++; - $clusters[$cidx][0] = $i; - $clusters[$cidx][1] = 1; - } - } - } - // Handle the very last slice - if( $incluster ) { - $clusters[$cidx][1]++; - } - else { // Create a "cluster" of one - $cidx++; - $clusters[$cidx][0] = $i; - $clusters[$cidx][1] = 1; - } - - /* - if( true ) { - // Debug printout in labels - for( $i=0; $i <= $cidx; ++$i ) { - for( $j=0; $j < $clusters[$i][1]; ++$j ) { - $a = $this->la[$clusters[$i][0]+$j]; - $aa = round($a*180/M_PI); - $q = $this->Quadrant($a); - $this->labels[$clusters[$i][0]+$j]="[$q:$aa] $i:$j"; - } - } - } - */ - - //----------------------------------------------------------------------- - // Step 2 of the algorithm is use the clusters and draw the labels - // and guidelines - //----------------------------------------------------------------------- - - // We use the font height as the base factor for how far we need to - // spread the labels in the Y-direction. - $this->value->ApplyFont($img); - $fh = $img->GetFontHeight(); - $origvstep=$fh*$this->iGuideVFactor; - $this->value->SetMargin(0); - - // Number of clusters found - $nc = count($clusters); - - // Walk through all the clusters - for($i=0; $i < $nc; ++$i) { - - // Start angle and number of slices in this cluster - $csize = $clusters[$i][1]; - $a = $this->la[$clusters[$i][0]]; - $q = $this->Quadrant($a); - - // Now set up the start and end conditions to make sure that - // in each cluster we walk through the all the slices starting with the slice - // closest to the equator. Since all slices are numbered clockwise from "3'a clock" - // we have different conditions depending on in which quadrant the slice lies within. - if( $q == 0 ) { - $start = $csize-1; $idx = $start; $step = -1; $vstep = -$origvstep; - } - elseif( $q == 1 ) { - $start = 0; $idx = $start; $step = 1; $vstep = -$origvstep; - } - elseif( $q == 2 ) { - $start = $csize-1; $idx = $start; $step = -1; $vstep = $origvstep; - } - elseif( $q == 3 ) { - $start = 0; $idx = $start; $step = 1; $vstep = $origvstep; - } - - // Walk through all slices within this cluster - for($j=0; $j < $csize; ++$j) { - // Now adjust the position of the labels in each cluster starting - // with the slice that is closest to the equator of the pie - $a = $this->la[$clusters[$i][0]+$idx]; - - // Guide line start in the center of the arc of the slice - $r = $radius+$this->explode_radius[$n-1-($clusters[$i][0]+$idx)]; - $x = round($r*cos($a)+$xc); - $y = round($yc-$r*sin($a)); - - // The distance from the arc depends on chosen font and the "R-Factor" - $r += $fh*$this->iGuideLineRFactor; - - // Should the labels be placed curved along the pie or in straight columns - // outside the pie? - if( $this->iGuideLineCurve ) - $xt=round($r*cos($a)+$xc); - - // If this is the first slice in the cluster we need some first time - // proessing - if( $idx == $start ) { - if( ! $this->iGuideLineCurve ) - $xt=round($r*cos($a)+$xc); - $yt=round($yc-$r*sin($a)); - - // Some special consideration in case this cluster starts - // in quadrant 1 or 3 very close to the "equator" (< 20 degrees) - // and the previous clusters last slice is within the tolerance. - // In that case we add a font height to this labels Y-position - // so it doesn't collide with - // the slice in the previous cluster - $prevcluster = ($i + ($nc-1) ) % $nc; - $previdx=$clusters[$prevcluster][0]+$clusters[$prevcluster][1]-1; - if( $q == 1 && $a > 160*M_PI/180 ) { - // Get the angle for the previous clusters last slice - $diff = abs($a-$this->la[$previdx]); - if( $diff < $tresh_hold ) { - $yt -= $fh; - } - } - elseif( $q == 3 && $a > 340*M_PI/180 ) { - // We need to subtract 360 to compare angle distance between - // q=0 and q=3 - $diff = abs($a-$this->la[$previdx]-360*M_PI/180); - if( $diff < $tresh_hold ) { - $yt += $fh; - } - } - - } - else { - // The step is at minimum $vstep but if the slices are relatively large - // we make sure that we add at least a step that corresponds to the vertical - // distance between the centers at the arc on the slice - $prev_a = $this->la[$clusters[$i][0]+($idx-$step)]; - $dy = abs($radius*(sin($a)-sin($prev_a))*1.2); - if( $vstep > 0 ) - $yt += max($vstep,$dy); - else - $yt += min($vstep,-$dy); - } - - $label = $this->labels[$clusters[$i][0]+$idx]; - - if( $csize == 1 ) { - // A "meta" cluster with only one slice - $r = $radius+$this->explode_radius[$n-1-($clusters[$i][0]+$idx)]; - $rr = $r+$img->GetFontHeight()/2; - $xt=round($rr*cos($a)+$xc); - $yt=round($yc-$rr*sin($a)); - $this->StrokeLabel($label,$img,$xc,$yc,$a,$r); - if( $this->iShowGuideLineForSingle ) - $this->guideline->Stroke($img,$x,$y,$xt,$yt); - } - else { - $this->guideline->Stroke($img,$x,$y,$xt,$yt); - if( $q==1 || $q==2 ) { - // Left side of Pie - $this->guideline->Stroke($img,$xt,$yt,$xt-$this->guidelinemargin,$yt); - $lbladj = -$this->guidelinemargin-5; - $this->value->halign = "right"; - $this->value->valign = "center"; - } - else { - // Right side of pie - $this->guideline->Stroke($img,$xt,$yt,$xt+$this->guidelinemargin,$yt); - $lbladj = $this->guidelinemargin+5; - $this->value->halign = "left"; - $this->value->valign = "center"; - } - $this->value->Stroke($img,$label,$xt+$lbladj,$yt); - } - - // Udate idx to point to next slice in the cluster to process - $idx += $step; - } - } - } - - function StrokeAllLabels($img,$xc,$yc,$radius) { - // First normalize all angles for labels - $n = count($this->la); - for($i=0; $i < $n; ++$i) { - $this->la[$i] = $this->NormAngle($this->la[$i]); - } - if( $this->guideline->iShow ) { - $this->StrokeGuideLabels($img,$xc,$yc,$radius); - } - else { - $n = count($this->labels); - for($i=0; $i < $n; ++$i) { - $this->StrokeLabel($this->labels[$i],$img,$xc,$yc, - $this->la[$i], - $radius + $this->explode_radius[$n-1-$i]); - } - } - } - - // Position the labels of each slice - function StrokeLabel($label,$img,$xc,$yc,$a,$r) { - - // Default value - if( $this->ilabelposadj === 'auto' ) - $this->ilabelposadj = 0.65; - - // We position the values diferently depending on if they are inside - // or outside the pie - if( $this->ilabelposadj < 1.0 ) { - - $this->value->SetAlign('center','center'); - $this->value->margin = 0; - - $xt=round($this->ilabelposadj*$r*cos($a)+$xc); - $yt=round($yc-$this->ilabelposadj*$r*sin($a)); - - $this->value->Stroke($img,$label,$xt,$yt); - } - else { - - $this->value->halign = "left"; - $this->value->valign = "top"; - $this->value->margin = 0; - - // Position the axis title. - // dx, dy is the offset from the top left corner of the bounding box that sorrounds the text - // that intersects with the extension of the corresponding axis. The code looks a little - // bit messy but this is really the only way of having a reasonable position of the - // axis titles. - $this->value->ApplyFont($img); - $h=$img->GetTextHeight($label); - // For numeric values the format of the display value - // must be taken into account - if( is_numeric($label) ) { - if( $label > 0 ) - $w=$img->GetTextWidth(sprintf($this->value->format,$label)); - else - $w=$img->GetTextWidth(sprintf($this->value->negformat,$label)); - } - else - $w=$img->GetTextWidth($label); - - if( $this->ilabelposadj > 1.0 && $this->ilabelposadj < 5.0) { - $r *= $this->ilabelposadj; - } - - $r += $img->GetFontHeight()/1.5; - - $xt=round($r*cos($a)+$xc); - $yt=round($yc-$r*sin($a)); - - // Normalize angle - while( $a < 0 ) $a += 2*M_PI; - while( $a > 2*M_PI ) $a -= 2*M_PI; - - if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; - if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; - if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1; - if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dx=(1-($a-M_PI*5/4)*2/M_PI); - - if( $a>=7*M_PI/4 ) $dy=(($a-M_PI)-3*M_PI/4)*2/M_PI; - if( $a<=M_PI/4 ) $dy=(1-$a*2/M_PI); - if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dy=1; - if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dy=(1-($a-3*M_PI/4)*2/M_PI); - if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; - - $this->value->Stroke($img,$label,$xt-$dx*$w,$yt-$dy*$h); - } - } - - function UsePlotThemeColors($flag = true) { - $this->use_plot_theme_colors = $flag; - } -} // Class - - -//=================================================== -// CLASS PiePlotC -// Description: Same as a normal pie plot but with a -// filled circle in the center -//=================================================== -class PiePlotC extends PiePlot { - private $imidsize=0.5; // Fraction of total width - private $imidcolor='white'; - public $midtitle=''; - private $middlecsimtarget='',$middlecsimwintarget='',$middlecsimalt=''; - - function __construct($data,$aCenterTitle='') { - parent::__construct($data); - $this->midtitle = new Text(); - $this->midtitle->ParagraphAlign('center'); - } - - function SetMid($aTitle,$aColor='white',$aSize=0.5) { - $this->midtitle->Set($aTitle); - - $this->imidsize = $aSize ; - $this->imidcolor = $aColor ; - } - - function SetMidTitle($aTitle) { - $this->midtitle->Set($aTitle); - } - - function SetMidSize($aSize) { - $this->imidsize = $aSize ; - } - - function SetMidColor($aColor) { - $this->imidcolor = $aColor ; - } - - function SetMidCSIM($aTarget,$aAlt='',$aWinTarget='') { - $this->middlecsimtarget = $aTarget; - $this->middlecsimwintarget = $aWinTarget; - $this->middlecsimalt = $aAlt; - } - - function AddSliceToCSIM($i,$xc,$yc,$radius,$sa,$ea) { - //Slice number, ellipse centre (x,y), radius, start angle, end angle - while( $sa > 2*M_PI ) $sa = $sa - 2*M_PI; - while( $ea > 2*M_PI ) $ea = $ea - 2*M_PI; - - $sa = 2*M_PI - $sa; - $ea = 2*M_PI - $ea; - - // Special case when we have only one slice since then both start and end - // angle will be == 0 - if( abs($sa - $ea) < 0.0001 ) { - $sa=2*M_PI; $ea=0; - } - - // Add inner circle first point - $xp = floor(($this->imidsize*$radius*cos($ea))+$xc); - $yp = floor($yc-($this->imidsize*$radius*sin($ea))); - $coords = "$xp, $yp"; - - //add coordinates every 0.25 radians - $a=$ea+0.25; - - // If we cross the 360-limit with a slice we need to handle - // the fact that end angle is smaller than start - if( $sa < $ea ) { - while ($a <= 2*M_PI) { - $xp = floor($radius*cos($a)+$xc); - $yp = floor($yc-$radius*sin($a)); - $coords.= ", $xp, $yp"; - $a += 0.25; - } - $a -= 2*M_PI; - } - - while ($a < $sa) { - $xp = floor(($this->imidsize*$radius*cos($a)+$xc)); - $yp = floor($yc-($this->imidsize*$radius*sin($a))); - $coords.= ", $xp, $yp"; - $a += 0.25; - } - - // Make sure we end at the last point - $xp = floor(($this->imidsize*$radius*cos($sa)+$xc)); - $yp = floor($yc-($this->imidsize*$radius*sin($sa))); - $coords.= ", $xp, $yp"; - - // Straight line to outer circle - $xp = floor($radius*cos($sa)+$xc); - $yp = floor($yc-$radius*sin($sa)); - $coords.= ", $xp, $yp"; - - //add coordinates every 0.25 radians - $a=$sa - 0.25; - while ($a > $ea) { - $xp = floor($radius*cos($a)+$xc); - $yp = floor($yc-$radius*sin($a)); - $coords.= ", $xp, $yp"; - $a -= 0.25; - } - - //Add the last point on the arc - $xp = floor($radius*cos($ea)+$xc); - $yp = floor($yc-$radius*sin($ea)); - $coords.= ", $xp, $yp"; - - // Close the arc - $xp = floor(($this->imidsize*$radius*cos($ea))+$xc); - $yp = floor($yc-($this->imidsize*$radius*sin($ea))); - $coords .= ", $xp, $yp"; - - if( !empty($this->csimtargets[$i]) ) { - $this->csimareas .= "csimtargets[$i]."\""; - if( !empty($this->csimwintargets[$i]) ) { - $this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; - } - if( !empty($this->csimalts[$i]) ) { - $tmp=sprintf($this->csimalts[$i],$this->data[$i]); - $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; - } - $this->csimareas .= " />\n"; - } - } - - - function Stroke($img,$aaoption=0) { - - // Stroke the pie but don't stroke values - $tmp = $this->value->show; - $this->value->show = false; - parent::Stroke($img,$aaoption); - $this->value->show = $tmp; - - $xc = round($this->posx*$img->width); - $yc = round($this->posy*$img->height); - - $radius = floor($this->radius * min($img->width,$img->height)) ; - - - if( $this->imidsize > 0 && $aaoption !== 2 ) { - - if( $this->ishadowcolor != "" ) { - $img->SetColor($this->ishadowcolor); - $img->FilledCircle($xc+$this->ishadowdrop,$yc+$this->ishadowdrop, - round($radius*$this->imidsize)); - } - - $img->SetColor($this->imidcolor); - $img->FilledCircle($xc,$yc,round($radius*$this->imidsize)); - - if( $this->pie_border && $aaoption === 0 ) { - $img->SetColor($this->color); - $img->Circle($xc,$yc,round($radius*$this->imidsize)); - } - - if( !empty($this->middlecsimtarget) ) - $this->AddMiddleCSIM($xc,$yc,round($radius*$this->imidsize)); - - } - - if( $this->value->show && $aaoption !== 1) { - $this->StrokeAllLabels($img,$xc,$yc,$radius); - $this->midtitle->SetPos($xc,$yc,'center','center'); - $this->midtitle->Stroke($img); - } - - } - - function AddMiddleCSIM($xc,$yc,$r) { - $xc=round($xc);$yc=round($yc);$r=round($r); - $this->csimareas .= "middlecsimtarget."\""; - if( !empty($this->middlecsimwintarget) ) { - $this->csimareas .= " target=\"".$this->middlecsimwintarget."\""; - } - if( !empty($this->middlecsimalt) ) { - $tmp = $this->middlecsimalt; - $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; - } - $this->csimareas .= " />\n"; - } - - function StrokeLabel($label,$img,$xc,$yc,$a,$r) { - - if( $this->ilabelposadj === 'auto' ) - $this->ilabelposadj = (1-$this->imidsize)/2+$this->imidsize; - - parent::StrokeLabel($label,$img,$xc,$yc,$a,$r); - - } - -} - - -//=================================================== -// CLASS PieGraph -// Description: -//=================================================== -class PieGraph extends Graph { - private $posx, $posy, $radius; - private $legends=array(); - public $plots=array(); - public $pieaa = false ; - //--------------- - // CONSTRUCTOR - function __construct($width=300,$height=200,$cachedName="",$timeout=0,$inline=1) { - parent::__construct($width,$height,$cachedName,$timeout,$inline); - $this->posx=$width/2; - $this->posy=$height/2; - $this->SetColor(array(255,255,255)); - - if ($this->graph_theme) { - $this->graph_theme->ApplyGraph($this); - } - } - - //--------------- - // PUBLIC METHODS - function Add($aObj) { - - if( is_array($aObj) && count($aObj) > 0 ) - $cl = $aObj[0]; - else - $cl = $aObj; - - if( $cl instanceof Text ) - $this->AddText($aObj); - elseif( class_exists('IconPlot',false) && ($cl instanceof IconPlot) ) - $this->AddIcon($aObj); - else { - if( is_array($aObj) ) { - $n = count($aObj); - for($i=0; $i < $n; ++$i ) { - //if ($aObj[$i]->theme) { - // $this->ClearTheme(); - //} - $this->plots[] = $aObj[$i]; - } - } - else { - //if ($aObj->theme) { - // $this->ClearTheme(); - //} - $this->plots[] = $aObj; - } - } - - if ($this->graph_theme) { - $this->graph_theme->SetupPlot($aObj); - if ($aObj->is_using_plot_theme) { - $aObj->UsePlotThemeColors(); - } - } - } - - function SetAntiAliasing($aFlg=true) { - $this->pieaa = $aFlg; - } - - function SetColor($c) { - $this->SetMarginColor($c); - } - - - function DisplayCSIMAreas() { - $csim=""; - foreach($this->plots as $p ) { - $csim .= $p->GetCSIMareas(); - } - - $csim.= $this->legend->GetCSIMareas(); - if (preg_match_all("/area shape=\"(\w+)\" coords=\"([0-9\, ]+)\"/", $csim, $coords)) { - $this->img->SetColor($this->csimcolor); - $n = count($coords[0]); - for ($i=0; $i < $n; $i++) { - if ($coords[1][$i]=="poly") { - preg_match_all('/\s*([0-9]+)\s*,\s*([0-9]+)\s*,*/',$coords[2][$i],$pts); - $this->img->SetStartPoint($pts[1][count($pts[0])-1],$pts[2][count($pts[0])-1]); - $m = count($pts[0]); - for ($j=0; $j < $m; $j++) { - $this->img->LineTo($pts[1][$j],$pts[2][$j]); - } - } else if ($coords[1][$i]=="rect") { - $pts = preg_split('/,/', $coords[2][$i]); - $this->img->SetStartPoint($pts[0],$pts[1]); - $this->img->LineTo($pts[2],$pts[1]); - $this->img->LineTo($pts[2],$pts[3]); - $this->img->LineTo($pts[0],$pts[3]); - $this->img->LineTo($pts[0],$pts[1]); - - } - } - } - } - - // Method description - function Stroke($aStrokeFileName="") { - - // If the filename is the predefined value = '_csim_special_' - // we assume that the call to stroke only needs to do enough - // to correctly generate the CSIM maps. - // We use this variable to skip things we don't strictly need - // to do to generate the image map to improve performance - // a best we can. Therefor you will see a lot of tests !$_csim in the - // code below. - $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); - - // If we are called the second time (perhaps the user has called GetHTMLImageMap() - // himself then the legends have alsready been populated once in order to get the - // CSIM coordinats. Since we do not want the legends to be populated a second time - // we clear the legends - $this->legend->Clear(); - - // We need to know if we have stroked the plot in the - // GetCSIMareas. Otherwise the CSIM hasn't been generated - // and in the case of GetCSIM called before stroke to generate - // CSIM without storing an image to disk GetCSIM must call Stroke. - $this->iHasStroked = true; - - $n = count($this->plots); - - if( $this->pieaa ) { - - if( !$_csim ) { - if( $this->background_image != "" ) { - $this->StrokeFrameBackground(); - } - else { - $this->StrokeFrame(); - $this->StrokeBackgroundGrad(); - } - } - - - $w = $this->img->width; - $h = $this->img->height; - $oldimg = $this->img->img; - - $this->img->CreateImgCanvas(2*$w,2*$h); - - $this->img->SetColor( $this->margin_color ); - $this->img->FilledRectangle(0,0,2*$w-1,2*$h-1); - - // Make all icons *2 i size since we will be scaling down the - // imahe to do the anti aliasing - $ni = count($this->iIcons); - for($i=0; $i < $ni; ++$i) { - $this->iIcons[$i]->iScale *= 2 ; - if( $this->iIcons[$i]->iX > 1 ) - $this->iIcons[$i]->iX *= 2 ; - if( $this->iIcons[$i]->iY > 1 ) - $this->iIcons[$i]->iY *= 2 ; - } - - $this->StrokeIcons(); - - for($i=0; $i < $n; ++$i) { - if( $this->plots[$i]->posx > 1 ) - $this->plots[$i]->posx *= 2 ; - if( $this->plots[$i]->posy > 1 ) - $this->plots[$i]->posy *= 2 ; - - $this->plots[$i]->Stroke($this->img,1); - - if( $this->plots[$i]->posx > 1 ) - $this->plots[$i]->posx /= 2 ; - if( $this->plots[$i]->posy > 1 ) - $this->plots[$i]->posy /= 2 ; - } - - $indent = $this->doframe ? ($this->frame_weight + ($this->doshadow ? $this->shadow_width : 0 )) : 0 ; - $indent += $this->framebevel ? $this->framebeveldepth + 1 : 0 ; - $this->img->CopyCanvasH($oldimg,$this->img->img,$indent,$indent,$indent,$indent, - $w-2*$indent,$h-2*$indent,2*($w-$indent),2*($h-$indent)); - - $this->img->img = $oldimg ; - $this->img->width = $w ; - $this->img->height = $h ; - - for($i=0; $i < $n; ++$i) { - $this->plots[$i]->Stroke($this->img,2); // Stroke labels - $this->plots[$i]->Legend($this); - } - - } - else { - - if( !$_csim ) { - if( $this->background_image != "" ) { - $this->StrokeFrameBackground(); - } - else { - $this->StrokeFrame(); - $this->StrokeBackgroundGrad(); - } - } - - $this->StrokeIcons(); - - for($i=0; $i < $n; ++$i) { - $this->plots[$i]->Stroke($this->img); - $this->plots[$i]->Legend($this); - } - } - - $this->legend->Stroke($this->img); - $this->footer->Stroke($this->img); - $this->StrokeTitles(); - - if( !$_csim ) { - - // Stroke texts - if( $this->texts != null ) { - $n = count($this->texts); - for($i=0; $i < $n; ++$i ) { - $this->texts[$i]->Stroke($this->img); - } - } - - if( _JPG_DEBUG ) { - $this->DisplayCSIMAreas(); - } - - // Should we do any final image transformation - if( $this->iImgTrans ) { - if( !class_exists('ImgTrans',false) ) { - require_once('jpgraph_imgtrans.php'); - //JpGraphError::Raise('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.'); - } - - $tform = new ImgTrans($this->img->img); - $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, - $this->iImgTransDirection,$this->iImgTransHighQ, - $this->iImgTransMinSize,$this->iImgTransFillColor, - $this->iImgTransBorder); - } - - - // If the filename is given as the special "__handle" - // then the image handler is returned and the image is NOT - // streamed back - if( $aStrokeFileName == _IMG_HANDLER ) { - return $this->img->img; - } - else { - // Finally stream the generated picture - $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline, - $aStrokeFileName); - } - } - } -} // Class - -/* EOF */ -?> diff --git a/#jpgraph/src/jpgraph_pie3d.php b/#jpgraph/src/jpgraph_pie3d.php deleted file mode 100644 index 52b8631e..00000000 --- a/#jpgraph/src/jpgraph_pie3d.php +++ /dev/null @@ -1,933 +0,0 @@ -radius = 0.5; - $this->data = $data; - $this->title = new Text(""); - $this->title->SetFont(FF_FONT1,FS_BOLD); - $this->value = new DisplayValue(); - $this->value->Show(); - $this->value->SetFormat('%.0f%%'); - } - - //--------------- - // PUBLIC METHODS - - // Set label arrays - function SetLegends($aLegend) { - $this->legends = array_reverse(array_slice($aLegend,0,count($this->data))); - } - - function SetSliceColors($aColors) { - $this->setslicecolors = $aColors; - } - - function Legend($aGraph) { - parent::Legend($aGraph); - $aGraph->legend->txtcol = array_reverse($aGraph->legend->txtcol); - } - - function SetCSIMTargets($aTargets,$aAlts='',$aWinTargets='') { - $this->csimtargets = $aTargets; - $this->csimwintargets = $aWinTargets; - $this->csimalts = $aAlts; - } - - // Should the slices be separated by a line? If color is specified as "" no line - // will be used to separate pie slices. - function SetEdge($aColor='black',$aWeight=1) { - $this->edgecolor = $aColor; - $this->edgeweight = $aWeight; - } - - // Specify projection angle for 3D in degrees - // Must be between 20 and 70 degrees - function SetAngle($a) { - if( $a<5 || $a>90 ) { - JpGraphError::RaiseL(14002); - //("PiePlot3D::SetAngle() 3D Pie projection angle must be between 5 and 85 degrees."); - } - else { - $this->angle = $a; - } - } - - function Add3DSliceToCSIM($i,$xc,$yc,$height,$width,$thick,$sa,$ea) { //Slice number, ellipse centre (x,y), height, width, start angle, end angle - - $sa *= M_PI/180; - $ea *= M_PI/180; - - //add coordinates of the centre to the map - $coords = "$xc, $yc"; - - //add coordinates of the first point on the arc to the map - $xp = floor($width*cos($sa)/2+$xc); - $yp = floor($yc-$height*sin($sa)/2); - $coords.= ", $xp, $yp"; - - //If on the front half, add the thickness offset - if ($sa >= M_PI && $sa <= 2*M_PI*1.01) { - $yp = floor($yp+$thick); - $coords.= ", $xp, $yp"; - } - - //add coordinates every 0.2 radians - $a=$sa+0.2; - while ($a<$ea) { - $xp = floor($width*cos($a)/2+$xc); - if ($a >= M_PI && $a <= 2*M_PI*1.01) { - $yp = floor($yc-($height*sin($a)/2)+$thick); - } else { - $yp = floor($yc-$height*sin($a)/2); - } - $coords.= ", $xp, $yp"; - $a += 0.2; - } - - //Add the last point on the arc - $xp = floor($width*cos($ea)/2+$xc); - $yp = floor($yc-$height*sin($ea)/2); - - - if ($ea >= M_PI && $ea <= 2*M_PI*1.01) { - $coords.= ", $xp, ".floor($yp+$thick); - } - $coords.= ", $xp, $yp"; - $alt=''; - - if( !empty($this->csimtargets[$i]) ) { - $this->csimareas .= "csimtargets[$i]."\""; - - if( !empty($this->csimwintargets[$i]) ) { - $this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; - } - - if( !empty($this->csimalts[$i]) ) { - $tmp=sprintf($this->csimalts[$i],$this->data[$i]); - $this->csimareas .= "alt=\"$tmp\" title=\"$tmp\" "; - } - $this->csimareas .= " />\n"; - } - - } - - function SetLabels($aLabels,$aLblPosAdj="auto") { - $this->labels = $aLabels; - $this->ilabelposadj=$aLblPosAdj; - } - - - // Distance from the pie to the labels - function SetLabelMargin($m) { - $this->value->SetMargin($m); - } - - // Show a thin line from the pie to the label for a specific slice - function ShowLabelHint($f=true) { - $this->showlabelhint=$f; - } - - // Set color of hint line to label for each slice - function SetLabelHintColor($c) { - $this->labelhintcolor=$c; - } - - function SetHeight($aHeight) { - $this->iThickness = $aHeight; - } - - - // Normalize Angle between 0-360 - function NormAngle($a) { - // Normalize anle to 0 to 2M_PI - // - if( $a > 0 ) { - while($a > 360) $a -= 360; - } - else { - while($a < 0) $a += 360; - } - if( $a < 0 ) - $a = 360 + $a; - - if( $a == 360 ) $a=0; - return $a; - } - - - - // Draw one 3D pie slice at position ($xc,$yc) with height $z - function Pie3DSlice($img,$xc,$yc,$w,$h,$sa,$ea,$z,$fillcolor,$shadow=0.65) { - - // Due to the way the 3D Pie algorithm works we are - // guaranteed that any slice we get into this method - // belongs to either the left or right side of the - // pie ellipse. Hence, no slice will cross 90 or 270 - // point. - if( ($sa < 90 && $ea > 90) || ( ($sa > 90 && $sa < 270) && $ea > 270) ) { - JpGraphError::RaiseL(14003);//('Internal assertion failed. Pie3D::Pie3DSlice'); - exit(1); - } - - $p[] = array(); - - // Setup pre-calculated values - $rsa = $sa/180*M_PI; // to Rad - $rea = $ea/180*M_PI; // to Rad - $sinsa = sin($rsa); - $cossa = cos($rsa); - $sinea = sin($rea); - $cosea = cos($rea); - - // p[] is the points for the overall slice and - // pt[] is the points for the top pie - - // Angular step when approximating the arc with a polygon train. - $step = 0.05; - - if( $sa >= 270 ) { - if( $ea > 360 || ($ea > 0 && $ea <= 90) ) { - if( $ea > 0 && $ea <= 90 ) { - // Adjust angle to simplify conditions in loops - $rea += 2*M_PI; - } - - $p = array($xc,$yc,$xc,$yc+$z, - $xc+$w*$cossa,$z+$yc-$h*$sinsa); - $pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa); - - for( $a=$rsa; $a < 2*M_PI; $a += $step ) { - $tca = cos($a); - $tsa = sin($a); - $p[] = $xc+$w*$tca; - $p[] = $z+$yc-$h*$tsa; - $pt[] = $xc+$w*$tca; - $pt[] = $yc-$h*$tsa; - } - - $pt[] = $xc+$w; - $pt[] = $yc; - - $p[] = $xc+$w; - $p[] = $z+$yc; - $p[] = $xc+$w; - $p[] = $yc; - $p[] = $xc; - $p[] = $yc; - - for( $a=2*M_PI+$step; $a < $rea; $a += $step ) { - $pt[] = $xc + $w*cos($a); - $pt[] = $yc - $h*sin($a); - } - - $pt[] = $xc+$w*$cosea; - $pt[] = $yc-$h*$sinea; - $pt[] = $xc; - $pt[] = $yc; - - } - else { - $p = array($xc,$yc,$xc,$yc+$z, - $xc+$w*$cossa,$z+$yc-$h*$sinsa); - $pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa); - - $rea = $rea == 0.0 ? 2*M_PI : $rea; - for( $a=$rsa; $a < $rea; $a += $step ) { - $tca = cos($a); - $tsa = sin($a); - $p[] = $xc+$w*$tca; - $p[] = $z+$yc-$h*$tsa; - $pt[] = $xc+$w*$tca; - $pt[] = $yc-$h*$tsa; - } - - $pt[] = $xc+$w*$cosea; - $pt[] = $yc-$h*$sinea; - $pt[] = $xc; - $pt[] = $yc; - - $p[] = $xc+$w*$cosea; - $p[] = $z+$yc-$h*$sinea; - $p[] = $xc+$w*$cosea; - $p[] = $yc-$h*$sinea; - $p[] = $xc; - $p[] = $yc; - } - } - elseif( $sa >= 180 ) { - $p = array($xc,$yc,$xc,$yc+$z,$xc+$w*$cosea,$z+$yc-$h*$sinea); - $pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea); - - for( $a=$rea; $a>$rsa; $a -= $step ) { - $tca = cos($a); - $tsa = sin($a); - $p[] = $xc+$w*$tca; - $p[] = $z+$yc-$h*$tsa; - $pt[] = $xc+$w*$tca; - $pt[] = $yc-$h*$tsa; - } - - $pt[] = $xc+$w*$cossa; - $pt[] = $yc-$h*$sinsa; - $pt[] = $xc; - $pt[] = $yc; - - $p[] = $xc+$w*$cossa; - $p[] = $z+$yc-$h*$sinsa; - $p[] = $xc+$w*$cossa; - $p[] = $yc-$h*$sinsa; - $p[] = $xc; - $p[] = $yc; - - } - elseif( $sa >= 90 ) { - if( $ea > 180 ) { - $p = array($xc,$yc,$xc,$yc+$z,$xc+$w*$cosea,$z+$yc-$h*$sinea); - $pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea); - - for( $a=$rea; $a > M_PI; $a -= $step ) { - $tca = cos($a); - $tsa = sin($a); - $p[] = $xc+$w*$tca; - $p[] = $z + $yc - $h*$tsa; - $pt[] = $xc+$w*$tca; - $pt[] = $yc-$h*$tsa; - } - - $p[] = $xc-$w; - $p[] = $z+$yc; - $p[] = $xc-$w; - $p[] = $yc; - $p[] = $xc; - $p[] = $yc; - - $pt[] = $xc-$w; - $pt[] = $z+$yc; - $pt[] = $xc-$w; - $pt[] = $yc; - - for( $a=M_PI-$step; $a > $rsa; $a -= $step ) { - $pt[] = $xc + $w*cos($a); - $pt[] = $yc - $h*sin($a); - } - - $pt[] = $xc+$w*$cossa; - $pt[] = $yc-$h*$sinsa; - $pt[] = $xc; - $pt[] = $yc; - - } - else { // $sa >= 90 && $ea <= 180 - $p = array($xc,$yc,$xc,$yc+$z, - $xc+$w*$cosea,$z+$yc-$h*$sinea, - $xc+$w*$cosea,$yc-$h*$sinea, - $xc,$yc); - - $pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea); - - for( $a=$rea; $a>$rsa; $a -= $step ) { - $pt[] = $xc + $w*cos($a); - $pt[] = $yc - $h*sin($a); - } - - $pt[] = $xc+$w*$cossa; - $pt[] = $yc-$h*$sinsa; - $pt[] = $xc; - $pt[] = $yc; - - } - } - else { // sa > 0 && ea < 90 - - $p = array($xc,$yc,$xc,$yc+$z, - $xc+$w*$cossa,$z+$yc-$h*$sinsa, - $xc+$w*$cossa,$yc-$h*$sinsa, - $xc,$yc); - - $pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa); - - for( $a=$rsa; $a < $rea; $a += $step ) { - $pt[] = $xc + $w*cos($a); - $pt[] = $yc - $h*sin($a); - } - - $pt[] = $xc+$w*$cosea; - $pt[] = $yc-$h*$sinea; - $pt[] = $xc; - $pt[] = $yc; - } - - $img->PushColor($fillcolor.":".$shadow); - $img->FilledPolygon($p); - $img->PopColor(); - - $img->PushColor($fillcolor); - $img->FilledPolygon($pt); - $img->PopColor(); - } - - function SetStartAngle($aStart) { - if( $aStart < 0 || $aStart > 360 ) { - JpGraphError::RaiseL(14004);//('Slice start angle must be between 0 and 360 degrees.'); - } - $this->startangle = $aStart; - } - - // Draw a 3D Pie - function Pie3D($aaoption,$img,$data,$colors,$xc,$yc,$d,$angle,$z, - $shadow=0.65,$startangle=0,$edgecolor="",$edgeweight=1) { - - //--------------------------------------------------------------------------- - // As usual the algorithm get more complicated than I originally - // envisioned. I believe that this is as simple as it is possible - // to do it with the features I want. It's a good exercise to start - // thinking on how to do this to convince your self that all this - // is really needed for the general case. - // - // The algorithm two draw 3D pies without "real 3D" is done in - // two steps. - // First imagine the pie cut in half through a thought line between - // 12'a clock and 6'a clock. It now easy to imagine that we can plot - // the individual slices for each half by starting with the topmost - // pie slice and continue down to 6'a clock. - // - // In the algortithm this is done in three principal steps - // Step 1. Do the knife cut to ensure by splitting slices that extends - // over the cut line. This is done by splitting the original slices into - // upto 3 subslices. - // Step 2. Find the top slice for each half - // Step 3. Draw the slices from top to bottom - // - // The thing that slightly complicates this scheme with all the - // angle comparisons below is that we can have an arbitrary start - // angle so we must take into account the different equivalence classes. - // For the same reason we must walk through the angle array in a - // modulo fashion. - // - // Limitations of algorithm: - // * A small exploded slice which crosses the 270 degree point - // will get slightly nagged close to the center due to the fact that - // we print the slices in Z-order and that the slice left part - // get printed first and might get slightly nagged by a larger - // slice on the right side just before the right part of the small - // slice. Not a major problem though. - //--------------------------------------------------------------------------- - - - // Determine the height of the ellippse which gives an - // indication of the inclination angle - $h = ($angle/90.0)*$d; - $sum = 0; - for($i=0; $ilabeltype == 2 ) { - $this->adjusted_data = $this->AdjPercentage($data); - } - - // Setup the start - $accsum = 0; - $a = $startangle; - $a = $this->NormAngle($a); - - // - // Step 1 . Split all slices that crosses 90 or 270 - // - $idx=0; - $adjexplode=array(); - $numcolors = count($colors); - for($i=0; $iexplode_radius[$i]) ) { - $this->explode_radius[$i]=0; - } - - $expscale=1; - if( $aaoption == 1 ) { - $expscale=2; - } - - $la = $a + $da/2; - $explode = array( $xc + $this->explode_radius[$i]*cos($la*M_PI/180)*$expscale, - $yc - $this->explode_radius[$i]*sin($la*M_PI/180) * ($h/$d) *$expscale ); - $adjexplode[$idx] = $explode; - $labeldata[$i] = array($la,$explode[0],$explode[1]); - $originalangles[$i] = array($a,$a+$da); - - $ne = $this->NormAngle($a+$da); - if( $da <= 180 ) { - // If the slice size is <= 90 it can at maximum cut across - // one boundary (either 90 or 270) where it needs to be split - $split=-1; // no split - if( ($da<=90 && ($a <= 90 && $ne > 90)) || - (($da <= 180 && $da >90) && (($a < 90 || $a >= 270) && $ne > 90)) ) { - $split = 90; - } - elseif( ($da<=90 && ($a <= 270 && $ne > 270)) || - (($da<=180 && $da>90) && ($a >= 90 && $a < 270 && ($a+$da) > 270 )) ) { - $split = 270; - } - if( $split > 0 ) { // split in two - $angles[$idx] = array($a,$split); - $adjcolors[$idx] = $colors[$i % $numcolors]; - $adjexplode[$idx] = $explode; - $angles[++$idx] = array($split,$ne); - $adjcolors[$idx] = $colors[$i % $numcolors]; - $adjexplode[$idx] = $explode; - } - else { // no split - $angles[$idx] = array($a,$ne); - $adjcolors[$idx] = $colors[$i % $numcolors]; - $adjexplode[$idx] = $explode; - } - } - else { - // da>180 - // Slice may, depending on position, cross one or two - // bonudaries - - if( $a < 90 ) $split = 90; - elseif( $a <= 270 ) $split = 270; - else $split = 90; - - $angles[$idx] = array($a,$split); - $adjcolors[$idx] = $colors[$i % $numcolors]; - $adjexplode[$idx] = $explode; - //if( $a+$da > 360-$split ) { - // For slices larger than 270 degrees we might cross - // another boundary as well. This means that we must - // split the slice further. The comparison gets a little - // bit complicated since we must take into accound that - // a pie might have a startangle >0 and hence a slice might - // wrap around the 0 angle. - // Three cases: - // a) Slice starts before 90 and hence gets a split=90, but - // we must also check if we need to split at 270 - // b) Slice starts after 90 but before 270 and slices - // crosses 90 (after a wrap around of 0) - // c) If start is > 270 (hence the firstr split is at 90) - // and the slice is so large that it goes all the way - // around 270. - if( ($a < 90 && ($a+$da > 270)) || ($a > 90 && $a<=270 && ($a+$da>360+90) ) || ($a > 270 && $this->NormAngle($a+$da)>270) ) { - $angles[++$idx] = array($split,360-$split); - $adjcolors[$idx] = $colors[$i % $numcolors]; - $adjexplode[$idx] = $explode; - $angles[++$idx] = array(360-$split,$ne); - $adjcolors[$idx] = $colors[$i % $numcolors]; - $adjexplode[$idx] = $explode; - } - else { - // Just a simple split to the previous decided - // angle. - $angles[++$idx] = array($split,$ne); - $adjcolors[$idx] = $colors[$i % $numcolors]; - $adjexplode[$idx] = $explode; - } - } - $a += $da; - $a = $this->NormAngle($a); - } - - // Total number of slices - $n = count($angles); - - for($i=0; $i<$n; ++$i) { - list($dbgs,$dbge) = $angles[$i]; - } - - // - // Step 2. Find start index (first pie that starts in upper left quadrant) - // - $minval = $angles[0][0]; - $min = 0; - for( $i=0; $i<$n; ++$i ) { - if( $angles[$i][0] < $minval ) { - $minval = $angles[$i][0]; - $min = $i; - } - } - $j = $min; - $cnt = 0; - while( $angles[$j][1] <= 90 ) { - $j++; - if( $j>=$n) { - $j=0; - } - if( $cnt > $n ) { - JpGraphError::RaiseL(14005); - //("Pie3D Internal error (#1). Trying to wrap twice when looking for start index"); - } - ++$cnt; - } - $start = $j; - - // - // Step 3. Print slices in z-order - // - $cnt = 0; - - // First stroke all the slices between 90 and 270 (left half circle) - // counterclockwise - - while( $angles[$j][0] < 270 && $aaoption !== 2 ) { - - list($x,$y) = $adjexplode[$j]; - - $this->Pie3DSlice($img,$x,$y,$d,$h,$angles[$j][0],$angles[$j][1], - $z,$adjcolors[$j],$shadow); - - $last = array($x,$y,$j); - - $j++; - if( $j >= $n ) $j=0; - if( $cnt > $n ) { - JpGraphError::RaiseL(14006); - //("Pie3D Internal Error: Z-Sorting algorithm for 3D Pies is not working properly (2). Trying to wrap twice while stroking."); - } - ++$cnt; - } - - $slice_left = $n-$cnt; - $j=$start-1; - if($j<0) $j=$n-1; - $cnt = 0; - - // The stroke all slices from 90 to -90 (right half circle) - // clockwise - while( $cnt < $slice_left && $aaoption !== 2 ) { - - list($x,$y) = $adjexplode[$j]; - - $this->Pie3DSlice($img,$x,$y,$d,$h,$angles[$j][0],$angles[$j][1], - $z,$adjcolors[$j],$shadow); - $j--; - if( $cnt > $n ) { - JpGraphError::RaiseL(14006); - //("Pie3D Internal Error: Z-Sorting algorithm for 3D Pies is not working properly (2). Trying to wrap twice while stroking."); - } - if($j<0) $j=$n-1; - $cnt++; - } - - // Now do a special thing. Stroke the last slice on the left - // halfcircle one more time. This is needed in the case where - // the slice close to 270 have been exploded. In that case the - // part of the slice close to the center of the pie might be - // slightly nagged. - if( $aaoption !== 2 ) - $this->Pie3DSlice($img,$last[0],$last[1],$d,$h,$angles[$last[2]][0], - $angles[$last[2]][1],$z,$adjcolors[$last[2]],$shadow); - - - if( $aaoption !== 1 ) { - // Now print possible labels and add csim - $this->value->ApplyFont($img); - $margin = $img->GetFontHeight()/2 + $this->value->margin ; - for($i=0; $i < count($data); ++$i ) { - $la = $labeldata[$i][0]; - $x = $labeldata[$i][1] + cos($la*M_PI/180)*($d+$margin)*$this->ilabelposadj; - $y = $labeldata[$i][2] - sin($la*M_PI/180)*($h+$margin)*$this->ilabelposadj; - if( $this->ilabelposadj >= 1.0 ) { - if( $la > 180 && $la < 360 ) $y += $z; - } - if( $this->labeltype == 0 ) { - if( $sum > 0 ) $l = 100*$data[$i]/$sum; - else $l = 0; - } - elseif( $this->labeltype == 1 ) { - $l = $data[$i]; - } - else { - $l = $this->adjusted_data[$i]; - } - if( isset($this->labels[$i]) && is_string($this->labels[$i]) ) { - $l=sprintf($this->labels[$i],$l); - } - - $this->StrokeLabels($l,$img,$labeldata[$i][0]*M_PI/180,$x,$y,$z); - - $this->Add3DSliceToCSIM($i,$labeldata[$i][1],$labeldata[$i][2],$h*2,$d*2,$z, - $originalangles[$i][0],$originalangles[$i][1]); - } - } - - // - // Finally add potential lines in pie - // - - if( $edgecolor=="" || $aaoption !== 0 ) return; - - $accsum = 0; - $a = $startangle; - $a = $this->NormAngle($a); - - $a *= M_PI/180.0; - - $idx=0; - $img->PushColor($edgecolor); - $img->SetLineWeight($edgeweight); - - $fulledge = true; - for($i=0; $i < count($data) && $fulledge; ++$i ) { - if( empty($this->explode_radius[$i]) ) { - $this->explode_radius[$i]=0; - } - if( $this->explode_radius[$i] > 0 ) { - $fulledge = false; - } - } - - - for($i=0; $i < count($data); ++$i, ++$idx ) { - - $da = $data[$i]/$sum * 2*M_PI; - $this->StrokeFullSliceFrame($img,$xc,$yc,$a,$a+$da,$d,$h,$z,$edgecolor, - $this->explode_radius[$i],$fulledge); - $a += $da; - } - $img->PopColor(); - } - - function StrokeFullSliceFrame($img,$xc,$yc,$sa,$ea,$w,$h,$z,$edgecolor,$exploderadius,$fulledge) { - $step = 0.02; - - if( $exploderadius > 0 ) { - $la = ($sa+$ea)/2; - $xc += $exploderadius*cos($la); - $yc -= $exploderadius*sin($la) * ($h/$w) ; - - } - - $p = array($xc,$yc,$xc+$w*cos($sa),$yc-$h*sin($sa)); - - for($a=$sa; $a < $ea; $a += $step ) { - $p[] = $xc + $w*cos($a); - $p[] = $yc - $h*sin($a); - } - - $p[] = $xc+$w*cos($ea); - $p[] = $yc-$h*sin($ea); - $p[] = $xc; - $p[] = $yc; - - $img->SetColor($edgecolor); - $img->Polygon($p); - - // Unfortunately we can't really draw the full edge around the whole of - // of the slice if any of the slices are exploded. The reason is that - // this algorithm is to simply. There are cases where the edges will - // "overwrite" other slices when they have been exploded. - // Doing the full, proper 3D hidden lines stiff is actually quite - // tricky. So for exploded pies we only draw the top edge. Not perfect - // but the "real" solution is much more complicated. - if( $fulledge && !( $sa > 0 && $sa < M_PI && $ea < M_PI) ) { - - if($sa < M_PI && $ea > M_PI) { - $sa = M_PI; - } - - if($sa < 2*M_PI && (($ea >= 2*M_PI) || ($ea > 0 && $ea < $sa ) ) ) { - $ea = 2*M_PI; - } - - if( $sa >= M_PI && $ea <= 2*M_PI ) { - $p = array($xc + $w*cos($sa),$yc - $h*sin($sa), - $xc + $w*cos($sa),$z + $yc - $h*sin($sa)); - - for($a=$sa+$step; $a < $ea; $a += $step ) { - $p[] = $xc + $w*cos($a); - $p[] = $z + $yc - $h*sin($a); - } - $p[] = $xc + $w*cos($ea); - $p[] = $z + $yc - $h*sin($ea); - $p[] = $xc + $w*cos($ea); - $p[] = $yc - $h*sin($ea); - $img->SetColor($edgecolor); - $img->Polygon($p); - } - } - } - - function Stroke($img,$aaoption=0) { - $n = count($this->data); - - // If user hasn't set the colors use the theme array - if( $this->setslicecolors==null ) { - $colors = array_keys($img->rgb->rgb_table); - sort($colors); - $idx_a=$this->themearr[$this->theme]; - $ca = array(); - $m = count($idx_a); - for($i=0; $i < $m; ++$i) { - $ca[$i] = $colors[$idx_a[$i]]; - } - $ca = array_reverse(array_slice($ca,0,$n)); - } - else { - $ca = $this->setslicecolors; - } - - - if( $this->posx <= 1 && $this->posx > 0 ) { - $xc = round($this->posx*$img->width); - } - else { - $xc = $this->posx ; - } - - if( $this->posy <= 1 && $this->posy > 0 ) { - $yc = round($this->posy*$img->height); - } - else { - $yc = $this->posy ; - } - - if( $this->radius <= 1 ) { - $width = floor($this->radius*min($img->width,$img->height)); - // Make sure that the pie doesn't overflow the image border - // The 0.9 factor is simply an extra margin to leave some space - // between the pie an the border of the image. - $width = min($width,min($xc*0.9,($yc*90/$this->angle-$width/4)*0.9)); - } - else { - $width = $this->radius * ($aaoption === 1 ? 2 : 1 ) ; - } - - // Add a sanity check for width - if( $width < 1 ) { - JpGraphError::RaiseL(14007);//("Width for 3D Pie is 0. Specify a size > 0"); - } - - // Establish a thickness. By default the thickness is a fifth of the - // pie slice width (=pie radius) but since the perspective depends - // on the inclination angle we use some heuristics to make the edge - // slightly thicker the less the angle. - - // Has user specified an absolute thickness? In that case use - // that instead - - if( $this->iThickness ) { - $thick = $this->iThickness; - $thick *= ($aaoption === 1 ? 2 : 1 ); - } - else { - $thick = $width/12; - } - $a = $this->angle; - - if( $a <= 30 ) $thick *= 1.6; - elseif( $a <= 40 ) $thick *= 1.4; - elseif( $a <= 50 ) $thick *= 1.2; - elseif( $a <= 60 ) $thick *= 1.0; - elseif( $a <= 70 ) $thick *= 0.8; - elseif( $a <= 80 ) $thick *= 0.7; - else $thick *= 0.6; - - $thick = floor($thick); - - if( $this->explode_all ) { - for($i=0; $i < $n; ++$i) - $this->explode_radius[$i]=$this->explode_r; - } - - $this->Pie3D($aaoption,$img,$this->data, $ca, $xc, $yc, $width, $this->angle, - $thick, 0.65, $this->startangle, $this->edgecolor, $this->edgeweight); - - // Adjust title position - if( $aaoption != 1 ) { - $this->title->SetPos($xc,$yc-$this->title->GetFontHeight($img)-$width/2-$this->title->margin, "center","bottom"); - $this->title->Stroke($img); - } - } - - //--------------- - // PRIVATE METHODS - - // Position the labels of each slice - function StrokeLabels($label,$img,$a,$xp,$yp,$z) { - $this->value->halign="left"; - $this->value->valign="top"; - - // Position the axis title. - // dx, dy is the offset from the top left corner of the bounding box that sorrounds the text - // that intersects with the extension of the corresponding axis. The code looks a little - // bit messy but this is really the only way of having a reasonable position of the - // axis titles. - $this->value->ApplyFont($img); - $h=$img->GetTextHeight($label); - // For numeric values the format of the display value - // must be taken into account - if( is_numeric($label) ) { - if( $label >= 0 ) { - $w=$img->GetTextWidth(sprintf($this->value->format,$label)); - } - else { - $w=$img->GetTextWidth(sprintf($this->value->negformat,$label)); - } - } - else { - $w=$img->GetTextWidth($label); - } - - while( $a > 2*M_PI ) { - $a -= 2*M_PI; - } - - if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; - if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; - if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1; - if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dx=(1-($a-M_PI*5/4)*2/M_PI); - - if( $a>=7*M_PI/4 ) $dy=(($a-M_PI)-3*M_PI/4)*2/M_PI; - if( $a<=M_PI/4 ) $dy=(1-$a*2/M_PI); - if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dy=1; - if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dy=(1-($a-3*M_PI/4)*2/M_PI); - if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; - - $x = round($xp-$dx*$w); - $y = round($yp-$dy*$h); - - // Mark anchor point for debugging - /* - $img->SetColor('red'); - $img->Line($xp-10,$yp,$xp+10,$yp); - $img->Line($xp,$yp-10,$xp,$yp+10); - */ - - $oldmargin = $this->value->margin; - $this->value->margin=0; - $this->value->Stroke($img,$label,$x,$y); - $this->value->margin=$oldmargin; - - } -} // Class - -/* EOF */ -?> diff --git a/#jpgraph/src/jpgraph_plotband.php b/#jpgraph/src/jpgraph_plotband.php deleted file mode 100644 index b7aef750..00000000 --- a/#jpgraph/src/jpgraph_plotband.php +++ /dev/null @@ -1,635 +0,0 @@ -x=$aX; - $this->y=$aY; - $this->w=$aWidth; - $this->h=$aHeight; - $this->xe=$aX+$aWidth-1; - $this->ye=$aY+$aHeight-1; - } -} - -//===================================================================== -// Class RectPattern -// Base class for pattern hierarchi that is used to display patterned -// bands on the graph. Any subclass that doesn't override Stroke() -// must at least implement method DoPattern($aImg) which is responsible -// for drawing the pattern onto the graph. -//===================================================================== -class RectPattern { - protected $color; - protected $weight; - protected $rect=null; - protected $doframe=true; - protected $linespacing; // Line spacing in pixels - protected $iBackgroundColor=-1; // Default is no background fill - - function __construct($aColor,$aWeight=1) { - $this->color = $aColor; - $this->weight = $aWeight; - } - - function SetBackground($aBackgroundColor) { - $this->iBackgroundColor=$aBackgroundColor; - } - - function SetPos($aRect) { - $this->rect = $aRect; - } - - function ShowFrame($aShow=true) { - $this->doframe=$aShow; - } - - function SetDensity($aDens) { - if( $aDens < 1 || $aDens > 100 ) - JpGraphError::RaiseL(16001,$aDens); - //(" Desity for pattern must be between 1 and 100. (You tried $aDens)"); - // 1% corresponds to linespacing=50 - // 100 % corresponds to linespacing 1 - $this->linespacing = floor(((100-$aDens)/100.0)*50)+1; - - } - - function Stroke($aImg) { - if( $this->rect == null ) - JpGraphError::RaiseL(16002); - //(" No positions specified for pattern."); - - if( !(is_numeric($this->iBackgroundColor) && $this->iBackgroundColor==-1) ) { - $aImg->SetColor($this->iBackgroundColor); - $aImg->FilledRectangle($this->rect->x,$this->rect->y,$this->rect->xe,$this->rect->ye); - } - - $aImg->SetColor($this->color); - $aImg->SetLineWeight($this->weight); - - // Virtual function implemented by subclass - $this->DoPattern($aImg); - - // Frame around the pattern area - if( $this->doframe ) - $aImg->Rectangle($this->rect->x,$this->rect->y,$this->rect->xe,$this->rect->ye); - } - -} - - -//===================================================================== -// Class RectPatternSolid -// Implements a solid band -//===================================================================== -class RectPatternSolid extends RectPattern { - - function __construct($aColor="black",$aWeight=1) { - parent::__construct($aColor,$aWeight); - } - - function DoPattern($aImg) { - $aImg->SetColor($this->color); - $aImg->FilledRectangle($this->rect->x,$this->rect->y, - $this->rect->xe,$this->rect->ye); - } -} - -//===================================================================== -// Class RectPatternHor -// Implements horizontal line pattern -//===================================================================== -class RectPatternHor extends RectPattern { - - function __construct($aColor="black",$aWeight=1,$aLineSpacing=7) { - parent::__construct($aColor,$aWeight); - $this->linespacing = $aLineSpacing; - } - - function DoPattern($aImg) { - $x0 = $this->rect->x; - $x1 = $this->rect->xe; - $y = $this->rect->y; - while( $y < $this->rect->ye ) { - $aImg->Line($x0,$y,$x1,$y); - $y += $this->linespacing; - } - } -} - -//===================================================================== -// Class RectPatternVert -// Implements vertical line pattern -//===================================================================== -class RectPatternVert extends RectPattern { - - function __construct($aColor="black",$aWeight=1,$aLineSpacing=7) { - parent::__construct($aColor,$aWeight); - $this->linespacing = $aLineSpacing; - } - - //-------------------- - // Private methods - // - function DoPattern($aImg) { - $x = $this->rect->x; - $y0 = $this->rect->y; - $y1 = $this->rect->ye; - while( $x < $this->rect->xe ) { - $aImg->Line($x,$y0,$x,$y1); - $x += $this->linespacing; - } - } -} - - -//===================================================================== -// Class RectPatternRDiag -// Implements right diagonal pattern -//===================================================================== -class RectPatternRDiag extends RectPattern { - - function __construct($aColor="black",$aWeight=1,$aLineSpacing=12) { - parent::__construct($aColor,$aWeight); - $this->linespacing = $aLineSpacing; - } - - function DoPattern($aImg) { - // -------------------- - // | / / / / /| - // |/ / / / / | - // | / / / / | - // -------------------- - $xe = $this->rect->xe; - $ye = $this->rect->ye; - $x0 = $this->rect->x + round($this->linespacing/2); - $y0 = $this->rect->y; - $x1 = $this->rect->x; - $y1 = $this->rect->y + round($this->linespacing/2); - - while($x0<=$xe && $y1<=$ye) { - $aImg->Line($x0,$y0,$x1,$y1); - $x0 += $this->linespacing; - $y1 += $this->linespacing; - } - - if( $xe-$x1 > $ye-$y0 ) { - // Width larger than height - $x1 = $this->rect->x + ($y1-$ye); - $y1 = $ye; - $y0 = $this->rect->y; - while( $x0 <= $xe ) { - $aImg->Line($x0,$y0,$x1,$y1); - $x0 += $this->linespacing; - $x1 += $this->linespacing; - } - - $y0=$this->rect->y + ($x0-$xe); - $x0=$xe; - } - else { - // Height larger than width - $diff = $x0-$xe; - $y0 = $diff+$this->rect->y; - $x0 = $xe; - $x1 = $this->rect->x; - while( $y1 <= $ye ) { - $aImg->Line($x0,$y0,$x1,$y1); - $y1 += $this->linespacing; - $y0 += $this->linespacing; - } - - $diff = $y1-$ye; - $y1 = $ye; - $x1 = $diff + $this->rect->x; - } - - while( $y0 <= $ye ) { - $aImg->Line($x0,$y0,$x1,$y1); - $y0 += $this->linespacing; - $x1 += $this->linespacing; - } - } -} - -//===================================================================== -// Class RectPatternLDiag -// Implements left diagonal pattern -//===================================================================== -class RectPatternLDiag extends RectPattern { - - function __construct($aColor="black",$aWeight=1,$aLineSpacing=12) { - $this->linespacing = $aLineSpacing; - parent::__construct($aColor,$aWeight); - } - - function DoPattern($aImg) { - // -------------------- - // |\ \ \ \ \ | - // | \ \ \ \ \| - // | \ \ \ \ | - // |------------------| - $xe = $this->rect->xe; - $ye = $this->rect->ye; - $x0 = $this->rect->x + round($this->linespacing/2); - $y0 = $this->rect->ye; - $x1 = $this->rect->x; - $y1 = $this->rect->ye - round($this->linespacing/2); - - while($x0<=$xe && $y1>=$this->rect->y) { - $aImg->Line($x0,$y0,$x1,$y1); - $x0 += $this->linespacing; - $y1 -= $this->linespacing; - } - if( $xe-$x1 > $ye-$this->rect->y ) { - // Width larger than height - $x1 = $this->rect->x + ($this->rect->y-$y1); - $y0=$ye; $y1=$this->rect->y; - while( $x0 <= $xe ) { - $aImg->Line($x0,$y0,$x1,$y1); - $x0 += $this->linespacing; - $x1 += $this->linespacing; - } - - $y0=$this->rect->ye - ($x0-$xe); - $x0=$xe; - } - else { - // Height larger than width - $diff = $x0-$xe; - $y0 = $ye-$diff; - $x0 = $xe; - while( $y1 >= $this->rect->y ) { - $aImg->Line($x0,$y0,$x1,$y1); - $y0 -= $this->linespacing; - $y1 -= $this->linespacing; - } - $diff = $this->rect->y - $y1; - $x1 = $this->rect->x + $diff; - $y1 = $this->rect->y; - } - while( $y0 >= $this->rect->y ) { - $aImg->Line($x0,$y0,$x1,$y1); - $y0 -= $this->linespacing; - $x1 += $this->linespacing; - } - } -} - -//===================================================================== -// Class RectPattern3DPlane -// Implements "3D" plane pattern -//===================================================================== -class RectPattern3DPlane extends RectPattern { - private $alpha=50; // Parameter that specifies the distance - // to "simulated" horizon in pixel from the - // top of the band. Specifies how fast the lines - // converge. - - function __construct($aColor="black",$aWeight=1) { - parent::__construct($aColor,$aWeight); - $this->SetDensity(10); // Slightly larger default - } - - function SetHorizon($aHorizon) { - $this->alpha=$aHorizon; - } - - function DoPattern($aImg) { - // "Fake" a nice 3D grid-effect. - $x0 = $this->rect->x + $this->rect->w/2; - $y0 = $this->rect->y; - $x1 = $x0; - $y1 = $this->rect->ye; - $x0_right = $x0; - $x1_right = $x1; - - // BTW "apa" means monkey in Swedish but is really a shortform for - // "alpha+a" which was the labels I used on paper when I derived the - // geometric to get the 3D perspective right. - // $apa is the height of the bounding rectangle plus the distance to the - // artifical horizon (alpha) - $apa = $this->rect->h + $this->alpha; - - // Three cases and three loops - // 1) The endpoint of the line ends on the bottom line - // 2) The endpoint ends on the side - // 3) Horizontal lines - - // Endpoint falls on bottom line - $middle=$this->rect->x + $this->rect->w/2; - $dist=$this->linespacing; - $factor=$this->alpha /($apa); - while($x1>$this->rect->x) { - $aImg->Line($x0,$y0,$x1,$y1); - $aImg->Line($x0_right,$y0,$x1_right,$y1); - $x1 = $middle - $dist; - $x0 = $middle - $dist * $factor; - $x1_right = $middle + $dist; - $x0_right = $middle + $dist * $factor; - $dist += $this->linespacing; - } - - // Endpoint falls on sides - $dist -= $this->linespacing; - $d=$this->rect->w/2; - $c = $apa - $d*$apa/$dist; - while( $x0>$this->rect->x ) { - $aImg->Line($x0,$y0,$this->rect->x,$this->rect->ye-$c); - $aImg->Line($x0_right,$y0,$this->rect->xe,$this->rect->ye-$c); - $dist += $this->linespacing; - $x0 = $middle - $dist * $factor; - $x1 = $middle - $dist; - $x0_right = $middle + $dist * $factor; - $c = $apa - $d*$apa/$dist; - } - - // Horizontal lines - // They need some serious consideration since they are a function - // of perspective depth (alpha) and density (linespacing) - $x0=$this->rect->x; - $x1=$this->rect->xe; - $y=$this->rect->ye; - - // The first line is drawn directly. Makes the loop below slightly - // more readable. - $aImg->Line($x0,$y,$x1,$y); - $hls = $this->linespacing; - - // A correction factor for vertical "brick" line spacing to account for - // a) the difference in number of pixels hor vs vert - // b) visual apperance to make the first layer of "bricks" look more - // square. - $vls = $this->linespacing*0.6; - - $ds = $hls*($apa-$vls)/$apa; - // Get the slope for the "perspective line" going from bottom right - // corner to top left corner of the "first" brick. - - // Uncomment the following lines if you want to get a visual understanding - // of what this helpline does. BTW this mimics the way you would get the - // perspective right when drawing on paper. - /* - $x0 = $middle; - $y0 = $this->rect->ye; - $len=floor(($this->rect->ye-$this->rect->y)/$vls); - $x1 = $middle+round($len*$ds); - $y1 = $this->rect->ye-$len*$vls; - $aImg->PushColor("red"); - $aImg->Line($x0,$y0,$x1,$y1); - $aImg->PopColor(); - */ - - $y -= $vls; - $k=($this->rect->ye-($this->rect->ye-$vls))/($middle-($middle-$ds)); - $dist = $hls; - while( $y>$this->rect->y ) { - $aImg->Line($this->rect->x,$y,$this->rect->xe,$y); - $adj = $k*$dist/(1+$dist*$k/$apa); - if( $adj < 2 ) $adj=1; - $y = $this->rect->ye - round($adj); - $dist += $hls; - } - } -} - -//===================================================================== -// Class RectPatternCross -// Vert/Hor crosses -//===================================================================== -class RectPatternCross extends RectPattern { - private $vert=null; - private $hor=null; - function __construct($aColor="black",$aWeight=1) { - parent::__construct($aColor,$aWeight); - $this->vert = new RectPatternVert($aColor,$aWeight); - $this->hor = new RectPatternHor($aColor,$aWeight); - } - - function SetOrder($aDepth) { - $this->vert->SetOrder($aDepth); - $this->hor->SetOrder($aDepth); - } - - function SetPos($aRect) { - parent::SetPos($aRect); - $this->vert->SetPos($aRect); - $this->hor->SetPos($aRect); - } - - function SetDensity($aDens) { - $this->vert->SetDensity($aDens); - $this->hor->SetDensity($aDens); - } - - function DoPattern($aImg) { - $this->vert->DoPattern($aImg); - $this->hor->DoPattern($aImg); - } -} - -//===================================================================== -// Class RectPatternDiagCross -// Vert/Hor crosses -//===================================================================== - -class RectPatternDiagCross extends RectPattern { - private $left=null; - private $right=null; - function __construct($aColor="black",$aWeight=1) { - parent::__construct($aColor,$aWeight); - $this->right = new RectPatternRDiag($aColor,$aWeight); - $this->left = new RectPatternLDiag($aColor,$aWeight); - } - - function SetOrder($aDepth) { - $this->left->SetOrder($aDepth); - $this->right->SetOrder($aDepth); - } - - function SetPos($aRect) { - parent::SetPos($aRect); - $this->left->SetPos($aRect); - $this->right->SetPos($aRect); - } - - function SetDensity($aDens) { - $this->left->SetDensity($aDens); - $this->right->SetDensity($aDens); - } - - function DoPattern($aImg) { - $this->left->DoPattern($aImg); - $this->right->DoPattern($aImg); - } - -} - -//===================================================================== -// Class RectPatternFactory -// Factory class for rectangular pattern -//===================================================================== -class RectPatternFactory { - function __construct() { - // Empty - } - function Create($aPattern,$aColor,$aWeight=1) { - switch($aPattern) { - case BAND_RDIAG: - $obj = new RectPatternRDiag($aColor,$aWeight); - break; - case BAND_LDIAG: - $obj = new RectPatternLDiag($aColor,$aWeight); - break; - case BAND_SOLID: - $obj = new RectPatternSolid($aColor,$aWeight); - break; - case BAND_VLINE: - $obj = new RectPatternVert($aColor,$aWeight); - break; - case BAND_HLINE: - $obj = new RectPatternHor($aColor,$aWeight); - break; - case BAND_3DPLANE: - $obj = new RectPattern3DPlane($aColor,$aWeight); - break; - case BAND_HVCROSS: - $obj = new RectPatternCross($aColor,$aWeight); - break; - case BAND_DIAGCROSS: - $obj = new RectPatternDiagCross($aColor,$aWeight); - break; - default: - JpGraphError::RaiseL(16003,$aPattern); - //(" Unknown pattern specification ($aPattern)"); - } - return $obj; - } -} - - -//===================================================================== -// Class PlotBand -// Factory class which is used by the client. -// It is responsible for factoring the corresponding pattern -// concrete class. -//===================================================================== -class PlotBand { - public $depth; // Determine if band should be over or under the plots - private $prect=null; - private $dir, $min, $max; - - function __construct($aDir,$aPattern,$aMin,$aMax,$aColor="black",$aWeight=1,$aDepth=DEPTH_BACK) { - $f = new RectPatternFactory(); - $this->prect = $f->Create($aPattern,$aColor,$aWeight); - if( is_numeric($aMin) && is_numeric($aMax) && ($aMin > $aMax) ) - JpGraphError::RaiseL(16004); - //('Min value for plotband is larger than specified max value. Please correct.'); - $this->dir = $aDir; - $this->min = $aMin; - $this->max = $aMax; - $this->depth=$aDepth; - } - - // Set position. aRect contains absolute image coordinates - function SetPos($aRect) { - assert( $this->prect != null ) ; - $this->prect->SetPos($aRect); - } - - function ShowFrame($aFlag=true) { - $this->prect->ShowFrame($aFlag); - } - - // Set z-order. In front of pplot or in the back - function SetOrder($aDepth) { - $this->depth=$aDepth; - } - - function SetDensity($aDens) { - $this->prect->SetDensity($aDens); - } - - function GetDir() { - return $this->dir; - } - - function GetMin() { - return $this->min; - } - - function GetMax() { - return $this->max; - } - - function PreStrokeAdjust($aGraph) { - // Nothing to do - } - - // Display band - function Stroke($aImg,$aXScale,$aYScale) { - assert( $this->prect != null ) ; - if( $this->dir == HORIZONTAL ) { - if( $this->min === 'min' ) $this->min = $aYScale->GetMinVal(); - if( $this->max === 'max' ) $this->max = $aYScale->GetMaxVal(); - - // Only draw the bar if it actually appears in the range - if ($this->min < $aYScale->GetMaxVal() && $this->max > $aYScale->GetMinVal()) { - - // Trucate to limit of axis - $this->min = max($this->min, $aYScale->GetMinVal()); - $this->max = min($this->max, $aYScale->GetMaxVal()); - - $x=$aXScale->scale_abs[0]; - $y=$aYScale->Translate($this->max); - $width=$aXScale->scale_abs[1]-$aXScale->scale_abs[0]+1; - $height=abs($y-$aYScale->Translate($this->min))+1; - $this->prect->SetPos(new Rectangle($x,$y,$width,$height)); - $this->prect->Stroke($aImg); - } - } - else { // VERTICAL - if( $this->min === 'min' ) $this->min = $aXScale->GetMinVal(); - if( $this->max === 'max' ) $this->max = $aXScale->GetMaxVal(); - - // Only draw the bar if it actually appears in the range - if ($this->min < $aXScale->GetMaxVal() && $this->max > $aXScale->GetMinVal()) { - - // Trucate to limit of axis - $this->min = max($this->min, $aXScale->GetMinVal()); - $this->max = min($this->max, $aXScale->GetMaxVal()); - - $y=$aYScale->scale_abs[1]; - $x=$aXScale->Translate($this->min); - $height=abs($aYScale->scale_abs[1]-$aYScale->scale_abs[0]); - $width=abs($x-$aXScale->Translate($this->max)); - $this->prect->SetPos(new Rectangle($x,$y,$width,$height)); - $this->prect->Stroke($aImg); - } - } - } -} - - -?> diff --git a/#jpgraph/src/jpgraph_plotline.php b/#jpgraph/src/jpgraph_plotline.php deleted file mode 100644 index 4ee0f564..00000000 --- a/#jpgraph/src/jpgraph_plotline.php +++ /dev/null @@ -1,142 +0,0 @@ -direction = $aDir; - $this->color=$aColor; - $this->weight=$aWeight; - $this->scaleposition=$aPos; - } - - function SetLegend($aLegend,$aCSIM='',$aCSIMAlt='',$aCSIMWinTarget='') { - $this->legend = $aLegend; - $this->legendcsimtarget = $aCSIM; - $this->legendcsimwintarget = $aCSIMWinTarget; - $this->legendcsimalt = $aCSIMAlt; - } - - function HideLegend($f=true) { - $this->hidelegend = $f; - } - - function SetPosition($aScalePosition) { - $this->scaleposition=$aScalePosition; - } - - function SetDirection($aDir) { - $this->direction = $aDir; - } - - function SetColor($aColor) { - $this->color=$aColor; - } - - function SetWeight($aWeight) { - $this->weight=$aWeight; - } - - function SetLineStyle($aStyle) { - $this->iLineStyle = $aStyle; - } - - function GetCSIMAreas() { - return ''; - } - - //--------------- - // PRIVATE METHODS - - function DoLegend($graph) { - if( !$this->hidelegend ) $this->Legend($graph); - } - - // Framework function the chance for each plot class to set a legend - function Legend($aGraph) { - if( $this->legend != '' ) { - $dummyPlotMark = new PlotMark(); - $lineStyle = 1; - $aGraph->legend->Add($this->legend,$this->color,$dummyPlotMark,$lineStyle, - $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } - } - - function PreStrokeAdjust($aGraph) { - // Nothing to do - } - - // Called by framework to allow the object to draw - // optional information in the margin area - function StrokeMargin($aImg) { - // Nothing to do - } - - // Framework function to allow the object to adjust the scale - function PrescaleSetup($aGraph) { - // Nothing to do - } - - function Min() { - return array(null,null); - } - - function Max() { - return array(null,null); - } - - function _Stroke($aImg,$aMinX,$aMinY,$aMaxX,$aMaxY,$aXPos,$aYPos) { - $aImg->SetColor($this->color); - $aImg->SetLineWeight($this->weight); - $oldStyle = $aImg->SetLineStyle($this->iLineStyle); - if( $this->direction == VERTICAL ) { - $ymin_abs = $aMinY; - $ymax_abs = $aMaxY; - $xpos_abs = $aXPos; - $aImg->StyleLine($xpos_abs, $ymin_abs, $xpos_abs, $ymax_abs); - } - elseif( $this->direction == HORIZONTAL ) { - $xmin_abs = $aMinX; - $xmax_abs = $aMaxX; - $ypos_abs = $aYPos; - $aImg->StyleLine($xmin_abs, $ypos_abs, $xmax_abs, $ypos_abs); - } - else { - JpGraphError::RaiseL(25125);//(" Illegal direction for static line"); - } - $aImg->SetLineStyle($oldStyle); - } - - function Stroke($aImg,$aXScale,$aYScale) { - $this->_Stroke($aImg, - $aImg->left_margin, - $aYScale->Translate($aYScale->GetMinVal()), - $aImg->width-$aImg->right_margin, - $aYScale->Translate($aYScale->GetMaxVal()), - $aXScale->Translate($this->scaleposition), - $aYScale->Translate($this->scaleposition) - ); - } -} - - -?> diff --git a/#jpgraph/src/jpgraph_plotmark.inc.php b/#jpgraph/src/jpgraph_plotmark.inc.php deleted file mode 100644 index 29c4d032..00000000 --- a/#jpgraph/src/jpgraph_plotmark.inc.php +++ /dev/null @@ -1,504 +0,0 @@ -title = new Text(); - $this->title->Hide(); - $this->csimareas = ''; - $this->type=-1; - } - //--------------- - // PUBLIC METHODS - function SetType($aType,$aFileName='',$aScale=1.0) { - $this->type = $aType; - if( $aType == MARK_IMG && $aFileName=='' ) { - JpGraphError::RaiseL(23003);//('A filename must be specified if you set the mark type to MARK_IMG.'); - } - $this->iFileName = $aFileName; - $this->iScale = $aScale; - } - - function SetCallback($aFunc) { - $this->iFormatCallback = $aFunc; - } - - function SetCallbackYX($aFunc) { - $this->iFormatCallback2 = $aFunc; - } - - function GetType() { - return $this->type; - } - - function SetColor($aColor) { - $this->color=$aColor; - } - - function SetFillColor($aFillColor) { - $this->fill_color = $aFillColor; - } - - function SetWeight($aWeight) { - $this->weight = $aWeight; - } - - // Synonym for SetWidth() - function SetSize($aWidth) { - $this->width=$aWidth; - } - - function SetWidth($aWidth) { - $this->width=$aWidth; - } - - function SetDefaultWidth() { - switch( $this->type ) { - case MARK_CIRCLE: - case MARK_FILLEDCIRCLE: - $this->width=4; - break; - default: - $this->width=7; - } - } - - function GetWidth() { - return $this->width; - } - - function Hide($aHide=true) { - $this->show = !$aHide; - } - - function Show($aShow=true) { - $this->show = $aShow; - } - - function SetCSIMAltVal($aY,$aX='') { - $this->yvalue=$aY; - $this->xvalue=$aX; - } - - function SetCSIMTarget($aTarget,$aWinTarget='') { - $this->csimtarget=$aTarget; - $this->csimwintarget=$aWinTarget; - } - - function SetCSIMAlt($aAlt) { - $this->csimalt=$aAlt; - } - - function GetCSIMAreas(){ - return $this->csimareas; - } - - function AddCSIMPoly($aPts) { - $coords = round($aPts[0]).", ".round($aPts[1]); - $n = count($aPts)/2; - for( $i=1; $i < $n; ++$i){ - $coords .= ", ".round($aPts[2*$i]).", ".round($aPts[2*$i+1]); - } - $this->csimareas=""; - if( !empty($this->csimtarget) ) { - $this->csimareas .= "csimtarget)."\""; - - if( !empty($this->csimwintarget) ) { - $this->csimareas .= " target=\"".$this->csimwintarget."\" "; - } - - if( !empty($this->csimalt) ) { - $tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue); - $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\""; - } - $this->csimareas .= " />\n"; - } - } - - function AddCSIMCircle($x,$y,$r) { - $x = round($x); $y=round($y); $r=round($r); - $this->csimareas=""; - if( !empty($this->csimtarget) ) { - $this->csimareas .= "csimtarget)."\""; - - if( !empty($this->csimwintarget) ) { - $this->csimareas .= " target=\"".$this->csimwintarget."\" "; - } - - if( !empty($this->csimalt) ) { - $tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue); - $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; - } - $this->csimareas .= " />\n"; - } - } - - function Stroke($img,$x,$y) { - if( !$this->show ) return; - - if( $this->iFormatCallback != '' || $this->iFormatCallback2 != '' ) { - - if( $this->iFormatCallback != '' ) { - $f = $this->iFormatCallback; - list($width,$color,$fcolor) = call_user_func($f,$this->yvalue); - $filename = $this->iFileName; - $imgscale = $this->iScale; - } - else { - $f = $this->iFormatCallback2; - list($width,$color,$fcolor,$filename,$imgscale) = call_user_func($f,$this->yvalue,$this->xvalue); - if( $filename=="" ) $filename = $this->iFileName; - if( $imgscale=="" ) $imgscale = $this->iScale; - } - - if( $width=="" ) $width = $this->width; - if( $color=="" ) $color = $this->color; - if( $fcolor=="" ) $fcolor = $this->fill_color; - - } - else { - $fcolor = $this->fill_color; - $color = $this->color; - $width = $this->width; - $filename = $this->iFileName; - $imgscale = $this->iScale; - } - - if( $this->type == MARK_IMG || - ($this->type >= MARK_FLAG1 && $this->type <= MARK_FLAG4 ) || - $this->type >= MARK_IMG_PUSHPIN ) { - - // Note: For the builtin images we use the "filename" parameter - // to denote the color - $anchor_x = 0.5; - $anchor_y = 0.5; - switch( $this->type ) { - case MARK_FLAG1: - case MARK_FLAG2: - case MARK_FLAG3: - case MARK_FLAG4: - $this->markimg = FlagCache::GetFlagImgByName($this->type-MARK_FLAG1+1,$filename); - break; - - case MARK_IMG : - // Load an image and use that as a marker - // Small optimization, if we have already read an image don't - // waste time reading it again. - if( $this->markimg == '' || !($this->oldfilename === $filename) ) { - $this->markimg = Graph::LoadBkgImage('',$filename); - $this->oldfilename = $filename ; - } - break; - - case MARK_IMG_PUSHPIN: - case MARK_IMG_SPUSHPIN: - case MARK_IMG_LPUSHPIN: - if( $this->imgdata_pushpins == null ) { - require_once 'imgdata_pushpins.inc.php'; - $this->imgdata_pushpins = new ImgData_PushPins(); - } - $this->markimg = $this->imgdata_pushpins->GetImg($this->type,$filename); - list($anchor_x,$anchor_y) = $this->imgdata_pushpins->GetAnchor(); - break; - - case MARK_IMG_SQUARE: - if( $this->imgdata_squares == null ) { - require_once 'imgdata_squares.inc.php'; - $this->imgdata_squares = new ImgData_Squares(); - } - $this->markimg = $this->imgdata_squares->GetImg($this->type,$filename); - list($anchor_x,$anchor_y) = $this->imgdata_squares->GetAnchor(); - break; - - case MARK_IMG_STAR: - if( $this->imgdata_stars == null ) { - require_once 'imgdata_stars.inc.php'; - $this->imgdata_stars = new ImgData_Stars(); - } - $this->markimg = $this->imgdata_stars->GetImg($this->type,$filename); - list($anchor_x,$anchor_y) = $this->imgdata_stars->GetAnchor(); - break; - - case MARK_IMG_BEVEL: - if( $this->imgdata_bevels == null ) { - require_once 'imgdata_bevels.inc.php'; - $this->imgdata_bevels = new ImgData_Bevels(); - } - $this->markimg = $this->imgdata_bevels->GetImg($this->type,$filename); - list($anchor_x,$anchor_y) = $this->imgdata_bevels->GetAnchor(); - break; - - case MARK_IMG_DIAMOND: - if( $this->imgdata_diamonds == null ) { - require_once 'imgdata_diamonds.inc.php'; - $this->imgdata_diamonds = new ImgData_Diamonds(); - } - $this->markimg = $this->imgdata_diamonds->GetImg($this->type,$filename); - list($anchor_x,$anchor_y) = $this->imgdata_diamonds->GetAnchor(); - break; - - case MARK_IMG_BALL: - case MARK_IMG_SBALL: - case MARK_IMG_MBALL: - case MARK_IMG_LBALL: - if( $this->imgdata_balls == null ) { - require_once 'imgdata_balls.inc.php'; - $this->imgdata_balls = new ImgData_Balls(); - } - $this->markimg = $this->imgdata_balls->GetImg($this->type,$filename); - list($anchor_x,$anchor_y) = $this->imgdata_balls->GetAnchor(); - break; - } - - $w = $img->GetWidth($this->markimg); - $h = $img->GetHeight($this->markimg); - - $dw = round($imgscale * $w ); - $dh = round($imgscale * $h ); - - // Do potential rotation - list($x,$y) = $img->Rotate($x,$y); - - $dx = round($x-$dw*$anchor_x); - $dy = round($y-$dh*$anchor_y); - - $this->width = max($dx,$dy); - - $img->Copy($this->markimg,$dx,$dy,0,0,$dw,$dh,$w,$h); - if( !empty($this->csimtarget) ) { - $this->csimareas = "csimtarget)."\""; - - if( !empty($this->csimwintarget) ) { - $this->csimareas .= " target=\"".$this->csimwintarget."\" "; - } - - if( !empty($this->csimalt) ) { - $tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue); - $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; - } - $this->csimareas .= " />\n"; - } - - // Stroke title - $this->title->Align("center","top"); - $this->title->Stroke($img,$x,$y+round($dh/2)); - return; - } - - $weight = $this->weight; - $dx=round($width/2,0); - $dy=round($width/2,0); - $pts=0; - - switch( $this->type ) { - case MARK_SQUARE: - $c[]=$x-$dx;$c[]=$y-$dy; - $c[]=$x+$dx;$c[]=$y-$dy; - $c[]=$x+$dx;$c[]=$y+$dy; - $c[]=$x-$dx;$c[]=$y+$dy; - $c[]=$x-$dx;$c[]=$y-$dy; - $pts=5; - break; - case MARK_UTRIANGLE: - ++$dx;++$dy; - $c[]=$x-$dx;$c[]=$y+0.87*$dy; // tan(60)/2*$dx - $c[]=$x;$c[]=$y-0.87*$dy; - $c[]=$x+$dx;$c[]=$y+0.87*$dy; - $c[]=$x-$dx;$c[]=$y+0.87*$dy; // tan(60)/2*$dx - $pts=4; - break; - case MARK_DTRIANGLE: - ++$dx;++$dy; - $c[]=$x;$c[]=$y+0.87*$dy; // tan(60)/2*$dx - $c[]=$x-$dx;$c[]=$y-0.87*$dy; - $c[]=$x+$dx;$c[]=$y-0.87*$dy; - $c[]=$x;$c[]=$y+0.87*$dy; // tan(60)/2*$dx - $pts=4; - break; - case MARK_DIAMOND: - $c[]=$x;$c[]=$y+$dy; - $c[]=$x-$dx;$c[]=$y; - $c[]=$x;$c[]=$y-$dy; - $c[]=$x+$dx;$c[]=$y; - $c[]=$x;$c[]=$y+$dy; - $pts=5; - break; - case MARK_LEFTTRIANGLE: - $c[]=$x;$c[]=$y; - $c[]=$x;$c[]=$y+2*$dy; - $c[]=$x+$dx*2;$c[]=$y; - $c[]=$x;$c[]=$y; - $pts=4; - break; - case MARK_RIGHTTRIANGLE: - $c[]=$x-$dx*2;$c[]=$y; - $c[]=$x;$c[]=$y+2*$dy; - $c[]=$x;$c[]=$y; - $c[]=$x-$dx*2;$c[]=$y; - $pts=4; - break; - case MARK_FLASH: - $dy *= 2; - $c[]=$x+$dx/2; $c[]=$y-$dy; - $c[]=$x-$dx+$dx/2; $c[]=$y+$dy*0.7-$dy; - $c[]=$x+$dx/2; $c[]=$y+$dy*1.3-$dy; - $c[]=$x-$dx+$dx/2; $c[]=$y+2*$dy-$dy; - $img->SetLineWeight($weight); - $img->SetColor($color); - $img->Polygon($c); - $img->SetLineWeight(1); - $this->AddCSIMPoly($c); - break; - } - - if( $pts>0 ) { - $this->AddCSIMPoly($c); - $img->SetLineWeight($weight); - $img->SetColor($fcolor); - $img->FilledPolygon($c); - $img->SetColor($color); - $img->Polygon($c); - $img->SetLineWeight(1); - } - elseif( $this->type==MARK_CIRCLE ) { - $img->SetColor($color); - $img->Circle($x,$y,$width); - $this->AddCSIMCircle($x,$y,$width); - } - elseif( $this->type==MARK_FILLEDCIRCLE ) { - $img->SetColor($fcolor); - $img->FilledCircle($x,$y,$width); - $img->SetColor($color); - $img->Circle($x,$y,$width); - $this->AddCSIMCircle($x,$y,$width); - } - elseif( $this->type==MARK_CROSS ) { - // Oversize by a pixel to match the X - $img->SetColor($color); - $img->SetLineWeight($weight); - $img->Line($x,$y+$dy+1,$x,$y-$dy-1); - $img->Line($x-$dx-1,$y,$x+$dx+1,$y); - $this->AddCSIMCircle($x,$y,$dx); - } - elseif( $this->type==MARK_X ) { - $img->SetColor($color); - $img->SetLineWeight($weight); - $img->Line($x+$dx,$y+$dy,$x-$dx,$y-$dy); - $img->Line($x-$dx,$y+$dy,$x+$dx,$y-$dy); - $this->AddCSIMCircle($x,$y,$dx+$dy); - } - elseif( $this->type==MARK_STAR ) { - $img->SetColor($color); - $img->SetLineWeight($weight); - $img->Line($x+$dx,$y+$dy,$x-$dx,$y-$dy); - $img->Line($x-$dx,$y+$dy,$x+$dx,$y-$dy); - // Oversize by a pixel to match the X - $img->Line($x,$y+$dy+1,$x,$y-$dy-1); - $img->Line($x-$dx-1,$y,$x+$dx+1,$y); - $this->AddCSIMCircle($x,$y,$dx+$dy); - } - - // Stroke title - $this->title->Align("center","center"); - $this->title->Stroke($img,$x,$y); - } -} // Class - - - -//======================================================================== -// CLASS ImgData -// Description: Base class for all image data classes that contains the -// real image data. -//======================================================================== -class ImgData { - protected $name = ''; // Each subclass gives a name - protected $an = array(); // Data array names - protected $colors = array(); // Available colors - protected $index = array(); // Index for colors - protected $maxidx = 0 ; // Max color index - protected $anchor_x=0.5, $anchor_y=0.5 ; // Where is the center of the image - - function __construct() { - // Empty - } - - // Create a GD image from the data and return a GD handle - function GetImg($aMark,$aIdx) { - $n = $this->an[$aMark]; - if( is_string($aIdx) ) { - if( !in_array($aIdx,$this->colors) ) { - JpGraphError::RaiseL(23001,$this->name,$aIdx);//('This marker "'.($this->name).'" does not exist in color: '.$aIdx); - } - $idx = $this->index[$aIdx]; - } - elseif( !is_integer($aIdx) || - (is_integer($aIdx) && $aIdx > $this->maxidx ) ) { - JpGraphError::RaiseL(23002,$this->name);//('Mark color index too large for marker "'.($this->name).'"'); - } - else - $idx = $aIdx ; - return Image::CreateFromString(base64_decode($this->{$n}[$idx][1])); - } - - function GetAnchor() { - return array($this->anchor_x,$this->anchor_y); - } -} - - -// Keep a global flag cache to reduce memory usage -$_gFlagCache=array( -1 => null, -2 => null, -3 => null, -4 => null, -); -// Only supposed to b called as statics -class FlagCache { - - static function GetFlagImgByName($aSize,$aName) { - global $_gFlagCache; - require_once('jpgraph_flags.php'); - if( $_gFlagCache[$aSize] === null ) { - $_gFlagCache[$aSize] = new FlagImages($aSize); - } - $f = $_gFlagCache[$aSize]; - $idx = $f->GetIdxByName($aName,$aFullName); - return $f->GetImgByIdx($idx); - } -} - -?> diff --git a/#jpgraph/src/jpgraph_polar.php b/#jpgraph/src/jpgraph_polar.php deleted file mode 100644 index 62c6bbc8..00000000 --- a/#jpgraph/src/jpgraph_polar.php +++ /dev/null @@ -1,897 +0,0 @@ -numpoints = $n/2; - $this->coord = $aData; - $this->mark = new PlotMark(); - } - - function SetWeight($aWeight) { - $this->iLineWeight = $aWeight; - } - - function SetColor($aColor){ - $this->iColor = $aColor; - } - - function SetFillColor($aColor){ - $this->iFillColor = $aColor; - } - - function Max() { - $m = $this->coord[1]; - $i=1; - while( $i < $this->numpoints ) { - $m = max($m,$this->coord[2*$i+1]); - ++$i; - } - return $m; - } - // Set href targets for CSIM - function SetCSIMTargets($aTargets,$aAlts=null) { - $this->csimtargets=$aTargets; - $this->csimalts=$aAlts; - } - - // Get all created areas - function GetCSIMareas() { - return $this->csimareas; - } - - function SetLegend($aLegend,$aCSIM="",$aCSIMAlt="") { - $this->legend = $aLegend; - $this->legendcsimtarget = $aCSIM; - $this->legendcsimalt = $aCSIMAlt; - } - - // Private methods - - function Legend($aGraph) { - $color = $this->iColor ; - if( $this->legend != "" ) { - if( $this->iFillColor!='' ) { - $color = $this->iFillColor; - $aGraph->legend->Add($this->legend,$color,$this->mark,0, - $this->legendcsimtarget,$this->legendcsimalt); - } - else { - $aGraph->legend->Add($this->legend,$color,$this->mark,$this->line_style, - $this->legendcsimtarget,$this->legendcsimalt); - } - } - } - - function Stroke($img,$scale) { - - $i=0; - $p=array(); - $this->csimareas=''; - while($i < $this->numpoints) { - list($x1,$y1) = $scale->PTranslate($this->coord[2*$i],$this->coord[2*$i+1]); - $p[2*$i] = $x1; - $p[2*$i+1] = $y1; - - if( isset($this->csimtargets[$i]) ) { - $this->mark->SetCSIMTarget($this->csimtargets[$i]); - $this->mark->SetCSIMAlt($this->csimalts[$i]); - $this->mark->SetCSIMAltVal($this->coord[2*$i], $this->coord[2*$i+1]); - $this->mark->Stroke($img,$x1,$y1); - $this->csimareas .= $this->mark->GetCSIMAreas(); - } - else { - $this->mark->Stroke($img,$x1,$y1); - } - - ++$i; - } - - if( $this->iFillColor != '' ) { - $img->SetColor($this->iFillColor); - $img->FilledPolygon($p); - } - $img->SetLineWeight($this->iLineWeight); - $img->SetColor($this->iColor); - $img->Polygon($p,$this->iFillColor!=''); - } -} - -//-------------------------------------------------------------------------- -// class PolarAxis -//-------------------------------------------------------------------------- -class PolarAxis extends Axis { - private $angle_step=15,$angle_color='lightgray',$angle_label_color='black'; - private $angle_fontfam=FF_FONT1,$angle_fontstyle=FS_NORMAL,$angle_fontsize=10; - private $angle_fontcolor = 'navy'; - private $gridminor_color='lightgray',$gridmajor_color='lightgray'; - private $show_minor_grid = false, $show_major_grid = true ; - private $show_angle_mark=true, $show_angle_grid=true, $show_angle_label=true; - private $angle_tick_len=3, $angle_tick_len2=3, $angle_tick_color='black'; - private $show_angle_tick=true; - private $radius_tick_color='black'; - - function __construct($img,$aScale) { - parent::__construct($img,$aScale); - } - - function ShowAngleDegreeMark($aFlg=true) { - $this->show_angle_mark = $aFlg; - } - - function SetAngleStep($aStep) { - $this->angle_step=$aStep; - } - - function HideTicks($aFlg=true,$aAngleFlg=true) { - parent::HideTicks($aFlg,$aFlg); - $this->show_angle_tick = !$aAngleFlg; - } - - function ShowAngleLabel($aFlg=true) { - $this->show_angle_label = $aFlg; - } - - function ShowGrid($aMajor=true,$aMinor=false,$aAngle=true) { - $this->show_minor_grid = $aMinor; - $this->show_major_grid = $aMajor; - $this->show_angle_grid = $aAngle ; - } - - function SetAngleFont($aFontFam,$aFontStyle=FS_NORMAL,$aFontSize=10) { - $this->angle_fontfam = $aFontFam; - $this->angle_fontstyle = $aFontStyle; - $this->angle_fontsize = $aFontSize; - } - - function SetColor($aColor,$aRadColor='',$aAngleColor='') { - if( $aAngleColor == '' ) - $aAngleColor=$aColor; - parent::SetColor($aColor,$aRadColor); - $this->angle_fontcolor = $aAngleColor; - } - - function SetGridColor($aMajorColor,$aMinorColor='',$aAngleColor='') { - if( $aMinorColor == '' ) - $aMinorColor = $aMajorColor; - if( $aAngleColor == '' ) - $aAngleColor = $aMajorColor; - - $this->gridminor_color = $aMinorColor; - $this->gridmajor_color = $aMajorColor; - $this->angle_color = $aAngleColor; - } - - function SetTickColors($aRadColor,$aAngleColor='') { - $this->radius_tick_color = $aRadColor; - $this->angle_tick_color = $aAngleColor; - } - - // Private methods - function StrokeGrid($pos) { - $x = round($this->img->left_margin + $this->img->plotwidth/2); - $this->scale->ticks->Stroke($this->img,$this->scale,$pos); - - // Stroke the minor arcs - $pmin = array(); - $p = $this->scale->ticks->ticks_pos; - $n = count($p); - $i = 0; - $this->img->SetColor($this->gridminor_color); - while( $i < $n ) { - $r = $p[$i]-$x+1; - $pmin[]=$r; - if( $this->show_minor_grid ) { - $this->img->Circle($x,$pos,$r); - } - $i++; - } - - $limit = max($this->img->plotwidth,$this->img->plotheight)*1.4 ; - while( $r < $limit ) { - $off = $r; - $i=1; - $r = $off + round($p[$i]-$x+1); - while( $r < $limit && $i < $n ) { - $r = $off+$p[$i]-$x; - $pmin[]=$r; - if( $this->show_minor_grid ) { - $this->img->Circle($x,$pos,$r); - } - $i++; - } - } - - // Stroke the major arcs - if( $this->show_major_grid ) { - // First determine how many minor step on - // every major step. We have recorded the minor radius - // in pmin and use these values. This is done in order - // to avoid rounding errors if we were to recalculate the - // different major radius. - $pmaj = $this->scale->ticks->maj_ticks_pos; - $p = $this->scale->ticks->ticks_pos; - if( $this->scale->name == 'lin' ) { - $step=round(($pmaj[1] - $pmaj[0])/($p[1] - $p[0])); - } - else { - $step=9; - } - $n = round(count($pmin)/$step); - $i = 0; - $this->img->SetColor($this->gridmajor_color); - $limit = max($this->img->plotwidth,$this->img->plotheight)*1.4 ; - $off = $r; - $i=0; - $r = $pmin[$i*$step]; - while( $r < $limit && $i < $n ) { - $r = $pmin[$i*$step]; - $this->img->Circle($x,$pos,$r); - $i++; - } - } - - // Draw angles - if( $this->show_angle_grid ) { - $this->img->SetColor($this->angle_color); - $d = max($this->img->plotheight,$this->img->plotwidth)*1.4 ; - $a = 0; - $p = $this->scale->ticks->ticks_pos; - $start_radius = $p[1]-$x; - while( $a < 360 ) { - if( $a == 90 || $a == 270 ) { - // Make sure there are no rounding problem with - // exactly vertical lines - $this->img->Line($x+$start_radius*cos($a/180*M_PI)+1, - $pos-$start_radius*sin($a/180*M_PI), - $x+$start_radius*cos($a/180*M_PI)+1, - $pos-$d*sin($a/180*M_PI)); - - } - else { - $this->img->Line($x+$start_radius*cos($a/180*M_PI)+1, - $pos-$start_radius*sin($a/180*M_PI), - $x+$d*cos($a/180*M_PI), - $pos-$d*sin($a/180*M_PI)); - } - $a += $this->angle_step; - } - } - } - - function StrokeAngleLabels($pos,$type) { - - if( !$this->show_angle_label ) - return; - - $x0 = round($this->img->left_margin+$this->img->plotwidth/2)+1; - - $d = max($this->img->plotwidth,$this->img->plotheight)*1.42; - $a = $this->angle_step; - $t = new Text(); - $t->SetColor($this->angle_fontcolor); - $t->SetFont($this->angle_fontfam,$this->angle_fontstyle,$this->angle_fontsize); - $xright = $this->img->width - $this->img->right_margin; - $ytop = $this->img->top_margin; - $xleft = $this->img->left_margin; - $ybottom = $this->img->height - $this->img->bottom_margin; - $ha = 'left'; - $va = 'center'; - $w = $this->img->plotwidth/2; - $h = $this->img->plotheight/2; - $xt = $x0; $yt = $pos; - $margin=5; - - $tl = $this->angle_tick_len ; // Outer len - $tl2 = $this->angle_tick_len2 ; // Interior len - - $this->img->SetColor($this->angle_tick_color); - $rot90 = $this->img->a == 90 ; - - if( $type == POLAR_360 ) { - - // Corner angles of the four corners - $ca1 = atan($h/$w)/M_PI*180; - $ca2 = 180-$ca1; - $ca3 = $ca1+180; - $ca4 = 360-$ca1; - $end = 360; - - while( $a < $end ) { - $ca = cos($a/180*M_PI); - $sa = sin($a/180*M_PI); - $x = $d*$ca; - $y = $d*$sa; - $xt=1000;$yt=1000; - if( $a <= $ca1 || $a >= $ca4 ) { - $yt = $pos - $w * $y/$x; - $xt = $xright + $margin; - if( $rot90 ) { - $ha = 'center'; - $va = 'top'; - } - else { - $ha = 'left'; - $va = 'center'; - } - $x1=$xright-$tl2; $x2=$xright+$tl; - $y1=$y2=$yt; - } - elseif( $a > $ca1 && $a < $ca2 ) { - $xt = $x0 + $h * $x/$y; - $yt = $ytop - $margin; - if( $rot90 ) { - $ha = 'left'; - $va = 'center'; - } - else { - $ha = 'center'; - $va = 'bottom'; - } - $y1=$ytop+$tl2;$y2=$ytop-$tl; - $x1=$x2=$xt; - } - elseif( $a >= $ca2 && $a <= $ca3 ) { - $yt = $pos + $w * $y/$x; - $xt = $xleft - $margin; - if( $rot90 ) { - $ha = 'center'; - $va = 'bottom'; - } - else { - $ha = 'right'; - $va = 'center'; - } - $x1=$xleft+$tl2;$x2=$xleft-$tl; - $y1=$y2=$yt; - } - else { - $xt = $x0 - $h * $x/$y; - $yt = $ybottom + $margin; - if( $rot90 ) { - $ha = 'right'; - $va = 'center'; - } - else { - $ha = 'center'; - $va = 'top'; - } - $y1=$ybottom-$tl2;$y2=$ybottom+$tl; - $x1=$x2=$xt; - } - if( $a != 0 && $a != 180 ) { - $t->Align($ha,$va); - if( $this->scale->clockwise ) { - $t->Set(360-$a); - } - else { - $t->Set($a); - } - if( $this->show_angle_mark && $t->font_family > 4 ) { - $a .= SymChar::Get('degree'); - } - $t->Stroke($this->img,$xt,$yt); - if( $this->show_angle_tick ) { - $this->img->Line($x1,$y1,$x2,$y2); - } - } - $a += $this->angle_step; - } - } - else { - // POLAR_HALF - $ca1 = atan($h/$w*2)/M_PI*180; - $ca2 = 180-$ca1; - $end = 180; - while( $a < $end ) { - $ca = cos($a/180*M_PI); - $sa = sin($a/180*M_PI); - $x = $d*$ca; - $y = $d*$sa; - if( $a <= $ca1 ) { - $yt = $pos - $w * $y/$x; - $xt = $xright + $margin; - if( $rot90 ) { - $ha = 'center'; - $va = 'top'; - } - else { - $ha = 'left'; - $va = 'center'; - } - $x1=$xright-$tl2; $x2=$xright+$tl; - $y1=$y2=$yt; - } - elseif( $a > $ca1 && $a < $ca2 ) { - $xt = $x0 + 2*$h * $x/$y; - $yt = $ytop - $margin; - if( $rot90 ) { - $ha = 'left'; - $va = 'center'; - } - else { - $ha = 'center'; - $va = 'bottom'; - } - $y1=$ytop+$tl2;$y2=$ytop-$tl; - $x1=$x2=$xt; - } - elseif( $a >= $ca2 ) { - $yt = $pos + $w * $y/$x; - $xt = $xleft - $margin; - if( $rot90 ) { - $ha = 'center'; - $va = 'bottom'; - } - else { - $ha = 'right'; - $va = 'center'; - } - $x1=$xleft+$tl2;$x2=$xleft-$tl; - $y1=$y2=$yt; - } - $t->Align($ha,$va); - if( $this->show_angle_mark && $t->font_family > 4 ) { - $a .= SymChar::Get('degree'); - } - $t->Set($a); - $t->Stroke($this->img,$xt,$yt); - if( $this->show_angle_tick ) { - $this->img->Line($x1,$y1,$x2,$y2); - } - $a += $this->angle_step; - } - } - } - - function Stroke($pos,$dummy=true) { - - $this->img->SetLineWeight($this->weight); - $this->img->SetColor($this->color); - $this->img->SetFont($this->font_family,$this->font_style,$this->font_size); - if( !$this->hide_line ) { - $this->img->FilledRectangle($this->img->left_margin,$pos, - $this->img->width-$this->img->right_margin, - $pos+$this->weight-1); - } - $y=$pos+$this->img->GetFontHeight()+$this->title_margin+$this->title->margin; - if( $this->title_adjust=="high" ) { - $this->title->SetPos($this->img->width-$this->img->right_margin,$y,"right","top"); - } - elseif( $this->title_adjust=="middle" || $this->title_adjust=="center" ) { - $this->title->SetPos(($this->img->width-$this->img->left_margin-$this->img->right_margin)/2+$this->img->left_margin, - $y,"center","top"); - } - elseif($this->title_adjust=="low") { - $this->title->SetPos($this->img->left_margin,$y,"left","top"); - } - else { - JpGraphError::RaiseL(17002,$this->title_adjust); - //('Unknown alignment specified for X-axis title. ('.$this->title_adjust.')'); - } - - - if (!$this->hide_labels) { - $this->StrokeLabels($pos,false); - } - $this->img->SetColor($this->radius_tick_color); - $this->scale->ticks->Stroke($this->img,$this->scale,$pos); - - // - // Mirror the positions for the left side of the scale - // - $mid = 2*($this->img->left_margin+$this->img->plotwidth/2); - $n = count($this->scale->ticks->ticks_pos); - $i=0; - while( $i < $n ) { - $this->scale->ticks->ticks_pos[$i] = - $mid-$this->scale->ticks->ticks_pos[$i] ; - ++$i; - } - - $n = count($this->scale->ticks->maj_ticks_pos); - $i=0; - while( $i < $n ) { - $this->scale->ticks->maj_ticks_pos[$i] = - $mid-$this->scale->ticks->maj_ticks_pos[$i] ; - ++$i; - } - - $n = count($this->scale->ticks->maj_ticklabels_pos); - $i=1; - while( $i < $n ) { - $this->scale->ticks->maj_ticklabels_pos[$i] = - $mid-$this->scale->ticks->maj_ticklabels_pos[$i] ; - ++$i; - } - - // Draw the left side of the scale - $n = count($this->scale->ticks->ticks_pos); - $yu = $pos - $this->scale->ticks->direction*$this->scale->ticks->GetMinTickAbsSize(); - - - // Minor ticks - if( ! $this->scale->ticks->supress_minor_tickmarks ) { - $i=1; - while( $i < $n/2 ) { - $x = round($this->scale->ticks->ticks_pos[$i]) ; - $this->img->Line($x,$pos,$x,$yu); - ++$i; - } - } - - $n = count($this->scale->ticks->maj_ticks_pos); - $yu = $pos - $this->scale->ticks->direction*$this->scale->ticks->GetMajTickAbsSize(); - - - // Major ticks - if( ! $this->scale->ticks->supress_tickmarks ) { - $i=1; - while( $i < $n/2 ) { - $x = round($this->scale->ticks->maj_ticks_pos[$i]) ; - $this->img->Line($x,$pos,$x,$yu); - ++$i; - } - } - if (!$this->hide_labels) { - $this->StrokeLabels($pos,false); - } - $this->title->Stroke($this->img); - } -} - -class PolarScale extends LinearScale { - private $graph; - public $clockwise=false; - - function __construct($aMax,$graph,$aClockwise) { - parent::__construct(0,$aMax,'x'); - $this->graph = $graph; - $this->clockwise = $aClockwise; - } - - function SetClockwise($aFlg) { - $this->clockwise = $aFlg; - } - - function _Translate($v) { - return parent::Translate($v); - } - - function PTranslate($aAngle,$aRad) { - - $m = $this->scale[1]; - $w = $this->graph->img->plotwidth/2; - $aRad = $aRad/$m*$w; - - $a = $aAngle/180 * M_PI; - if( $this->clockwise ) { - $a = 2*M_PI-$a; - } - - $x = cos($a) * $aRad; - $y = sin($a) * $aRad; - - $x += $this->_Translate(0); - - if( $this->graph->iType == POLAR_360 ) { - $y = ($this->graph->img->top_margin + $this->graph->img->plotheight/2) - $y; - } - else { - $y = ($this->graph->img->top_margin + $this->graph->img->plotheight) - $y; - } - return array($x,$y); - } -} - -class PolarLogScale extends LogScale { - private $graph; - public $clockwise=false; - - function __construct($aMax,$graph,$aClockwise=false) { - parent::__construct(0,$aMax,'x'); - $this->graph = $graph; - $this->ticks->SetLabelLogType(LOGLABELS_MAGNITUDE); - $this->clockwise = $aClockwise; - - } - - function SetClockwise($aFlg) { - $this->clockwise = $aFlg; - } - - function PTranslate($aAngle,$aRad) { - - if( $aRad == 0 ) - $aRad = 1; - $aRad = log10($aRad); - $m = $this->scale[1]; - $w = $this->graph->img->plotwidth/2; - $aRad = $aRad/$m*$w; - - $a = $aAngle/180 * M_PI; - if( $this->clockwise ) { - $a = 2*M_PI-$a; - } - - $x = cos( $a ) * $aRad; - $y = sin( $a ) * $aRad; - - $x += $w+$this->graph->img->left_margin;//$this->_Translate(0); - if( $this->graph->iType == POLAR_360 ) { - $y = ($this->graph->img->top_margin + $this->graph->img->plotheight/2) - $y; - } - else { - $y = ($this->graph->img->top_margin + $this->graph->img->plotheight) - $y; - } - return array($x,$y); - } -} - -class PolarGraph extends Graph { - public $scale; - public $axis; - public $iType=POLAR_360; - private $iClockwise=false; - - function __construct($aWidth=300,$aHeight=200,$aCachedName="",$aTimeOut=0,$aInline=true) { - parent::__construct($aWidth,$aHeight,$aCachedName,$aTimeOut,$aInline) ; - $this->SetDensity(TICKD_DENSE); - $this->SetBox(); - $this->SetMarginColor('white'); - } - - function SetDensity($aDense) { - $this->SetTickDensity(TICKD_NORMAL,$aDense); - } - - function SetClockwise($aFlg) { - $this->scale->SetClockwise($aFlg); - } - - function Set90AndMargin($lm=0,$rm=0,$tm=0,$bm=0) { - $adj = ($this->img->height - $this->img->width)/2; - $this->SetAngle(90); - $lm2 = -$adj + ($lm-$rm+$tm+$bm)/2; - $rm2 = -$adj + (-$lm+$rm+$tm+$bm)/2; - $tm2 = $adj + ($tm-$bm+$lm+$rm)/2; - $bm2 = $adj + (-$tm+$bm+$lm+$rm)/2; - $this->SetMargin($lm2, $rm2, $tm2, $bm2); - $this->axis->SetLabelAlign('right','center'); - } - - function SetScale($aScale,$rmax=0,$dummy1=1,$dummy2=1,$dummy3=1) { - if( $aScale == 'lin' ) { - $this->scale = new PolarScale($rmax,$this,$this->iClockwise); - } - elseif( $aScale == 'log' ) { - $this->scale = new PolarLogScale($rmax,$this,$this->iClockwise); - } - else { - JpGraphError::RaiseL(17004);//('Unknown scale type for polar graph. Must be "lin" or "log"'); - } - - $this->axis = new PolarAxis($this->img,$this->scale); - $this->SetMargin(40,40,50,40); - } - - function SetType($aType) { - $this->iType = $aType; - } - - function SetPlotSize($w,$h) { - $this->SetMargin(($this->img->width-$w)/2,($this->img->width-$w)/2, - ($this->img->height-$h)/2,($this->img->height-$h)/2); - } - - // Private methods - function GetPlotsMax() { - $n = count($this->plots); - $m = $this->plots[0]->Max(); - $i=1; - while($i < $n) { - $m = max($this->plots[$i]->Max(),$m); - ++$i; - } - return $m; - } - - function Stroke($aStrokeFileName="") { - - // Start by adjusting the margin so that potential titles will fit. - $this->AdjustMarginsForTitles(); - - // If the filename is the predefined value = '_csim_special_' - // we assume that the call to stroke only needs to do enough - // to correctly generate the CSIM maps. - // We use this variable to skip things we don't strictly need - // to do to generate the image map to improve performance - // a best we can. Therefor you will see a lot of tests !$_csim in the - // code below. - $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); - - // We need to know if we have stroked the plot in the - // GetCSIMareas. Otherwise the CSIM hasn't been generated - // and in the case of GetCSIM called before stroke to generate - // CSIM without storing an image to disk GetCSIM must call Stroke. - $this->iHasStroked = true; - - //Check if we should autoscale axis - if( !$this->scale->IsSpecified() && count($this->plots)>0 ) { - $max = $this->GetPlotsMax(); - $t1 = $this->img->plotwidth; - $this->img->plotwidth /= 2; - $t2 = $this->img->left_margin; - $this->img->left_margin += $this->img->plotwidth+1; - $this->scale->AutoScale($this->img,0,$max, - $this->img->plotwidth/$this->xtick_factor/2); - $this->img->plotwidth = $t1; - $this->img->left_margin = $t2; - } - else { - // The tick calculation will use the user suplied min/max values to determine - // the ticks. If auto_ticks is false the exact user specifed min and max - // values will be used for the scale. - // If auto_ticks is true then the scale might be slightly adjusted - // so that the min and max values falls on an even major step. - //$min = 0; - $max = $this->scale->scale[1]; - $t1 = $this->img->plotwidth; - $this->img->plotwidth /= 2; - $t2 = $this->img->left_margin; - $this->img->left_margin += $this->img->plotwidth+1; - $this->scale->AutoScale($this->img,0,$max, - $this->img->plotwidth/$this->xtick_factor/2); - $this->img->plotwidth = $t1; - $this->img->left_margin = $t2; - } - - if( $this->iType == POLAR_180 ) { - $pos = $this->img->height - $this->img->bottom_margin; - } - else { - $pos = $this->img->plotheight/2 + $this->img->top_margin; - } - - if( !$_csim ) { - $this->StrokePlotArea(); - } - - $this->iDoClipping = true; - - if( $this->iDoClipping ) { - $oldimage = $this->img->CloneCanvasH(); - } - - if( !$_csim ) { - $this->axis->StrokeGrid($pos); - } - - // Stroke all plots for Y1 axis - for($i=0; $i < count($this->plots); ++$i) { - $this->plots[$i]->Stroke($this->img,$this->scale); - } - - - if( $this->iDoClipping ) { - // Clipping only supports graphs at 0 and 90 degrees - if( $this->img->a == 0 ) { - $this->img->CopyCanvasH($oldimage,$this->img->img, - $this->img->left_margin,$this->img->top_margin, - $this->img->left_margin,$this->img->top_margin, - $this->img->plotwidth+1,$this->img->plotheight+1); - } - elseif( $this->img->a == 90 ) { - $adj1 = round(($this->img->height - $this->img->width)/2); - $adj2 = round(($this->img->width - $this->img->height)/2); - $lm = $this->img->left_margin; - $rm = $this->img->right_margin; - $tm = $this->img->top_margin; - $bm = $this->img->bottom_margin; - $this->img->CopyCanvasH($oldimage,$this->img->img, - $adj2 + round(($lm-$rm+$tm+$bm)/2), - $adj1 + round(($tm-$bm+$lm+$rm)/2), - $adj2 + round(($lm-$rm+$tm+$bm)/2), - $adj1 + round(($tm-$bm+$lm+$rm)/2), - $this->img->plotheight+1, - $this->img->plotwidth+1); - } - $this->img->Destroy(); - $this->img->SetCanvasH($oldimage); - } - - if( !$_csim ) { - $this->axis->Stroke($pos); - $this->axis->StrokeAngleLabels($pos,$this->iType); - } - - if( !$_csim ) { - $this->StrokePlotBox(); - $this->footer->Stroke($this->img); - - // The titles and legends never gets rotated so make sure - // that the angle is 0 before stroking them - $aa = $this->img->SetAngle(0); - $this->StrokeTitles(); - } - - for($i=0; $i < count($this->plots) ; ++$i ) { - $this->plots[$i]->Legend($this); - } - - $this->legend->Stroke($this->img); - - if( !$_csim ) { - - $this->StrokeTexts(); - $this->img->SetAngle($aa); - - // Draw an outline around the image map - if(_JPG_DEBUG) - $this->DisplayClientSideaImageMapAreas(); - - // If the filename is given as the special "__handle" - // then the image handler is returned and the image is NOT - // streamed back - if( $aStrokeFileName == _IMG_HANDLER ) { - return $this->img->img; - } - else { - // Finally stream the generated picture - $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); - } - } - } -} - - - -?> diff --git a/#jpgraph/src/jpgraph_radar.php b/#jpgraph/src/jpgraph_radar.php deleted file mode 100644 index 1d3de628..00000000 --- a/#jpgraph/src/jpgraph_radar.php +++ /dev/null @@ -1,861 +0,0 @@ -GetMinVal(); - $limit = $aScale->GetMaxVal(); - $nextMajor = 10*$start; - $step = $nextMajor / 10.0; - $count=1; - - $ticklen_maj=5; - $dx_maj=round(sin($aAxisAngle)*$ticklen_maj); - $dy_maj=round(cos($aAxisAngle)*$ticklen_maj); - $ticklen_min=3; - $dx_min=round(sin($aAxisAngle)*$ticklen_min); - $dy_min=round(cos($aAxisAngle)*$ticklen_min); - - $aMajPos=array(); - $aMajLabel=array(); - - if( $this->supress_first ) { - $aMajLabel[] = ''; - } - else { - $aMajLabel[]=$start; - } - - $yr=$aScale->RelTranslate($start); - $xt=round($yr*cos($aAxisAngle))+$aScale->scale_abs[0]; - $yt=$aPos-round($yr*sin($aAxisAngle)); - $aMajPos[]=$xt+2*$dx_maj; - $aMajPos[]=$yt-$aImg->GetFontheight()/2; - $grid[]=$xt; - $grid[]=$yt; - - $aImg->SetLineWeight($this->weight); - - for($y=$start; $y<=$limit; $y+=$step,++$count ) { - $yr=$aScale->RelTranslate($y); - $xt=round($yr*cos($aAxisAngle))+$aScale->scale_abs[0]; - $yt=$aPos-round($yr*sin($aAxisAngle)); - if( $count % 10 == 0 ) { - $grid[]=$xt; - $grid[]=$yt; - $aMajPos[]=$xt+2*$dx_maj; - $aMajPos[]=$yt-$aImg->GetFontheight()/2; - if( !$this->supress_tickmarks ) { - if( $this->majcolor != '' ) { - $aImg->PushColor($this->majcolor); - } - $aImg->Line($xt+$dx_maj,$yt+$dy_maj,$xt-$dx_maj,$yt-$dy_maj); - if( $this->majcolor != '' ) { - $aImg->PopColor(); - } - } - if( $this->label_formfunc != '' ) { - $f=$this->label_formfunc; - $l = call_user_func($f,$nextMajor); - } - else { - $l = $nextMajor; - } - - $aMajLabel[]=$l; - $nextMajor *= 10; - $step *= 10; - $count=1; - } - else { - if( !$this->supress_minor_tickmarks ) { - if( $this->mincolor != '' ) { - $aImg->PushColor($this->mincolor); - } - $aImg->Line($xt+$dx_min,$yt+$dy_min,$xt-$dx_min,$yt-$dy_min); - if( $this->mincolor != '' ) { - $aImg->PopColor(); - } - } - } - } - } -} - -//=================================================== -// CLASS RadarLinear -// Description: Linear ticks -//=================================================== -class RadarLinearTicks extends Ticks { - - private $minor_step=1, $major_step=2; - private $xlabel_offset=0,$xtick_offset=0; - - function __construct() { - // Empty - } - - // Return major step size in world coordinates - function GetMajor() { - return $this->major_step; - } - - // Return minor step size in world coordinates - function GetMinor() { - return $this->minor_step; - } - - // Set Minor and Major ticks (in world coordinates) - function Set($aMajStep,$aMinStep=false) { - if( $aMinStep==false ) { - $aMinStep=$aMajStep; - } - - if( $aMajStep <= 0 || $aMinStep <= 0 ) { - JpGraphError::RaiseL(25064); - //JpGraphError::Raise(" Minor or major step size is 0. Check that you haven't got an accidental SetTextTicks(0) in your code. If this is not the case you might have stumbled upon a bug in JpGraph. Please report this and if possible include the data that caused the problem."); - } - - $this->major_step=$aMajStep; - $this->minor_step=$aMinStep; - $this->is_set = true; - } - - function Stroke($aImg,&$grid,$aPos,$aAxisAngle,$aScale,&$aMajPos,&$aMajLabel) { - // Prepare to draw linear ticks - $maj_step_abs = abs($aScale->scale_factor*$this->major_step); - $min_step_abs = abs($aScale->scale_factor*$this->minor_step); - $nbrmaj = round($aScale->world_abs_size/$maj_step_abs); - $nbrmin = round($aScale->world_abs_size/$min_step_abs); - $skip = round($nbrmin/$nbrmaj); // Don't draw minor on top of major - - // Draw major ticks - $ticklen2=$this->major_abs_size; - $dx=round(sin($aAxisAngle)*$ticklen2); - $dy=round(cos($aAxisAngle)*$ticklen2); - $label=$aScale->scale[0]+$this->major_step; - - $aImg->SetLineWeight($this->weight); - - $aMajPos = array(); - $aMajLabel = array(); - - for($i=1; $i<=$nbrmaj; ++$i) { - $xt=round($i*$maj_step_abs*cos($aAxisAngle))+$aScale->scale_abs[0]; - $yt=$aPos-round($i*$maj_step_abs*sin($aAxisAngle)); - - if( $this->label_formfunc != '' ) { - $f=$this->label_formfunc; - $l = call_user_func($f,$label); - } - else { - $l = $label; - } - - $aMajLabel[]=$l; - $label += $this->major_step; - $grid[]=$xt; - $grid[]=$yt; - $aMajPos[($i-1)*2]=$xt+2*$dx; - $aMajPos[($i-1)*2+1]=$yt-$aImg->GetFontheight()/2; - if( !$this->supress_tickmarks ) { - if( $this->majcolor != '' ) { - $aImg->PushColor($this->majcolor); - } - $aImg->Line($xt+$dx,$yt+$dy,$xt-$dx,$yt-$dy); - if( $this->majcolor != '' ) { - $aImg->PopColor(); - } - } - } - - // Draw minor ticks - $ticklen2=$this->minor_abs_size; - $dx=round(sin($aAxisAngle)*$ticklen2); - $dy=round(cos($aAxisAngle)*$ticklen2); - if( !$this->supress_tickmarks && !$this->supress_minor_tickmarks) { - if( $this->mincolor != '' ) { - $aImg->PushColor($this->mincolor); - } - for($i=1; $i<=$nbrmin; ++$i) { - if( ($i % $skip) == 0 ) { - continue; - } - $xt=round($i*$min_step_abs*cos($aAxisAngle))+$aScale->scale_abs[0]; - $yt=$aPos-round($i*$min_step_abs*sin($aAxisAngle)); - $aImg->Line($xt+$dx,$yt+$dy,$xt-$dx,$yt-$dy); - } - if( $this->mincolor != '' ) { - $aImg->PopColor(); - } - } - } -} - - -//=================================================== -// CLASS RadarAxis -// Description: Implements axis for the radar graph -//=================================================== -class RadarAxis extends AxisPrototype { - public $title=null; - private $title_color='navy'; - private $len=0; - - function __construct($img,$aScale,$color=array(0,0,0)) { - parent::__construct($img,$aScale,$color); - $this->len = $img->plotheight; - $this->title = new Text(); - $this->title->SetFont(FF_FONT1,FS_BOLD); - $this->color = array(0,0,0); - } - - // Stroke the axis - // $pos = Vertical position of axis - // $aAxisAngle = Axis angle - // $grid = Returns an array with positions used to draw the grid - // $lf = Label flag, TRUE if the axis should have labels - function Stroke($pos,$aAxisAngle,&$grid,$title,$lf) { - $this->img->SetColor($this->color); - - // Determine end points for the axis - $x=round($this->scale->world_abs_size*cos($aAxisAngle)+$this->scale->scale_abs[0]); - $y=round($pos-$this->scale->world_abs_size*sin($aAxisAngle)); - - // Draw axis - $this->img->SetColor($this->color); - $this->img->SetLineWeight($this->weight); - if( !$this->hide ) { - $this->img->Line($this->scale->scale_abs[0],$pos,$x,$y); - } - - $this->scale->ticks->Stroke($this->img,$grid,$pos,$aAxisAngle,$this->scale,$majpos,$majlabel); - $ncolor=0; - if( isset($this->ticks_label_colors) ) { - $ncolor=count($this->ticks_label_colors); - } - - // Draw labels - if( $lf && !$this->hide ) { - $this->img->SetFont($this->font_family,$this->font_style,$this->font_size); - $this->img->SetTextAlign('left','top'); - $this->img->SetColor($this->label_color); - - // majpos contains (x,y) coordinates for labels - if( ! $this->hide_labels ) { - $n = floor(count($majpos)/2); - for($i=0; $i < $n; ++$i) { - // Set specific label color if specified - if( $ncolor > 0 ) { - $this->img->SetColor($this->ticks_label_colors[$i % $ncolor]); - } - - if( $this->ticks_label != null && isset($this->ticks_label[$i]) ) { - $this->img->StrokeText($majpos[$i*2],$majpos[$i*2+1],$this->ticks_label[$i]); - } - else { - $this->img->StrokeText($majpos[$i*2],$majpos[$i*2+1],$majlabel[$i]); - } - } - } - } - $this->_StrokeAxisTitle($pos,$aAxisAngle,$title); - } - - function _StrokeAxisTitle($pos,$aAxisAngle,$title) { - $this->title->Set($title); - $marg=6+$this->title->margin; - $xt=round(($this->scale->world_abs_size+$marg)*cos($aAxisAngle)+$this->scale->scale_abs[0]); - $yt=round($pos-($this->scale->world_abs_size+$marg)*sin($aAxisAngle)); - - // Position the axis title. - // dx, dy is the offset from the top left corner of the bounding box that sorrounds the text - // that intersects with the extension of the corresponding axis. The code looks a little - // bit messy but this is really the only way of having a reasonable position of the - // axis titles. - if( $this->title->iWordwrap > 0 ) { - $title = wordwrap($title,$this->title->iWordwrap,"\n"); - } - - $h=$this->img->GetTextHeight($title)*1.2; - $w=$this->img->GetTextWidth($title)*1.2; - - while( $aAxisAngle > 2*M_PI ) - $aAxisAngle -= 2*M_PI; - - // Around 3 a'clock - if( $aAxisAngle>=7*M_PI/4 || $aAxisAngle <= M_PI/4 ) $dx=-0.15; // Small trimming to make the dist to the axis more even - - // Around 12 a'clock - if( $aAxisAngle>=M_PI/4 && $aAxisAngle <= 3*M_PI/4 ) $dx=($aAxisAngle-M_PI/4)*2/M_PI; - - // Around 9 a'clock - if( $aAxisAngle>=3*M_PI/4 && $aAxisAngle <= 5*M_PI/4 ) $dx=1; - - // Around 6 a'clock - if( $aAxisAngle>=5*M_PI/4 && $aAxisAngle <= 7*M_PI/4 ) $dx=(1-($aAxisAngle-M_PI*5/4)*2/M_PI); - - if( $aAxisAngle>=7*M_PI/4 ) $dy=(($aAxisAngle-M_PI)-3*M_PI/4)*2/M_PI; - if( $aAxisAngle<=M_PI/12 ) $dy=(0.5-$aAxisAngle*2/M_PI); - if( $aAxisAngle<=M_PI/4 && $aAxisAngle > M_PI/12) $dy=(1-$aAxisAngle*2/M_PI); - if( $aAxisAngle>=M_PI/4 && $aAxisAngle <= 3*M_PI/4 ) $dy=1; - if( $aAxisAngle>=3*M_PI/4 && $aAxisAngle <= 5*M_PI/4 ) $dy=(1-($aAxisAngle-3*M_PI/4)*2/M_PI); - if( $aAxisAngle>=5*M_PI/4 && $aAxisAngle <= 7*M_PI/4 ) $dy=0; - - if( !$this->hide ) { - $this->title->Stroke($this->img,$xt-$dx*$w,$yt-$dy*$h,$title); - } - } - -} // Class - - -//=================================================== -// CLASS RadarGrid -// Description: Draws grid for the radar graph -//=================================================== -class RadarGrid { //extends Grid { - private $type='solid'; - private $grid_color='#DDDDDD'; - private $show=false, $weight=1; - - function __construct() { - // Empty - } - - function SetColor($aMajColor) { - $this->grid_color = $aMajColor; - } - - function SetWeight($aWeight) { - $this->weight=$aWeight; - } - - // Specify if grid should be dashed, dotted or solid - function SetLineStyle($aType) { - $this->type = $aType; - } - - // Decide if both major and minor grid should be displayed - function Show($aShowMajor=true) { - $this->show=$aShowMajor; - } - - function Stroke($img,$grid) { - if( !$this->show ) { - return; - } - - $nbrticks = count($grid[0])/2; - $nbrpnts = count($grid); - $img->SetColor($this->grid_color); - $img->SetLineWeight($this->weight); - - for($i=0; $i<$nbrticks; ++$i) { - for($j=0; $j<$nbrpnts; ++$j) { - $pnts[$j*2]=$grid[$j][$i*2]; - $pnts[$j*2+1]=$grid[$j][$i*2+1]; - } - for($k=0; $k<$nbrpnts; ++$k ){ - $l=($k+1)%$nbrpnts; - if( $this->type == 'solid' ) - $img->Line($pnts[$k*2],$pnts[$k*2+1],$pnts[$l*2],$pnts[$l*2+1]); - elseif( $this->type == 'dotted' ) - $img->DashedLine($pnts[$k*2],$pnts[$k*2+1],$pnts[$l*2],$pnts[$l*2+1],1,6); - elseif( $this->type == 'dashed' ) - $img->DashedLine($pnts[$k*2],$pnts[$k*2+1],$pnts[$l*2],$pnts[$l*2+1],2,4); - elseif( $this->type == 'longdashed' ) - $img->DashedLine($pnts[$k*2],$pnts[$k*2+1],$pnts[$l*2],$pnts[$l*2+1],8,6); - } - $pnts=array(); - } - } -} // Class - - -//=================================================== -// CLASS RadarPlot -// Description: Plot a radarplot -//=================================================== -class RadarPlot { - public $mark=null; - public $legend=''; - public $legendcsimtarget=''; - public $legendcsimalt=''; - public $csimtargets=array(); // Array of targets for CSIM - public $csimareas=""; // Resultant CSIM area tags - public $csimalts=null; // ALT:s for corresponding target - private $data=array(); - private $fill=false, $fill_color=array(200,170,180); - private $color=array(0,0,0); - private $weight=1; - private $linestyle='solid'; - - //--------------- - // CONSTRUCTOR - function __construct($data) { - $this->data = $data; - $this->mark = new PlotMark(); - } - - function Min() { - return Min($this->data); - } - - function Max() { - return Max($this->data); - } - - function SetLegend($legend) { - $this->legend=$legend; - } - - function SetLineStyle($aStyle) { - $this->linestyle=$aStyle; - } - - function SetLineWeight($w) { - $this->weight=$w; - } - - function SetFillColor($aColor) { - $this->fill_color = $aColor; - $this->fill = true; - } - - function SetFill($f=true) { - $this->fill = $f; - } - - function SetColor($aColor,$aFillColor=false) { - $this->color = $aColor; - if( $aFillColor ) { - $this->SetFillColor($aFillColor); - $this->fill = true; - } - } - - // Set href targets for CSIM - function SetCSIMTargets($aTargets,$aAlts=null) { - $this->csimtargets=$aTargets; - $this->csimalts=$aAlts; - } - - // Get all created areas - function GetCSIMareas() { - return $this->csimareas; - } - - function Stroke($img, $pos, $scale, $startangle) { - $nbrpnts = count($this->data); - $astep=2*M_PI/$nbrpnts; - $a=$startangle; - - for($i=0; $i<$nbrpnts; ++$i) { - - // Rotate each non null point to the correct axis-angle - $cs=$scale->RelTranslate($this->data[$i]); - $x=round($cs*cos($a)+$scale->scale_abs[0]); - $y=round($pos-$cs*sin($a)); - - $pnts[$i*2]=$x; - $pnts[$i*2+1]=$y; - - // If the next point is null then we draw this polygon segment - // to the center, skip the next and draw the next segment from - // the center up to the point on the axis with the first non-null - // value and continues from that point. Some additoinal logic is necessary - // to handle the boundary conditions - if( $i < $nbrpnts-1 ) { - if( is_null($this->data[$i+1]) ) { - $cs = 0; - $x=round($cs*cos($a)+$scale->scale_abs[0]); - $y=round($pos-$cs*sin($a)); - $pnts[$i*2]=$x; - $pnts[$i*2+1]=$y; - $a += $astep; - } - } - - $a += $astep; - } - - if( $this->fill ) { - $img->SetColor($this->fill_color); - $img->FilledPolygon($pnts); - } - - $img->SetLineWeight($this->weight); - $img->SetColor($this->color); - $img->SetLineStyle($this->linestyle); - $pnts[] = $pnts[0]; - $pnts[] = $pnts[1]; - $img->Polygon($pnts); - $img->SetLineStyle('solid'); // Reset line style to default - - // Add plotmarks on top - if( $this->mark->show ) { - for($i=0; $i < $nbrpnts; ++$i) { - if( isset($this->csimtargets[$i]) ) { - $this->mark->SetCSIMTarget($this->csimtargets[$i]); - $this->mark->SetCSIMAlt($this->csimalts[$i]); - $this->mark->SetCSIMAltVal($pnts[$i*2], $pnts[$i*2+1]); - $this->mark->Stroke($img, $pnts[$i*2], $pnts[$i*2+1]); - $this->csimareas .= $this->mark->GetCSIMAreas(); - } - else { - $this->mark->Stroke($img,$pnts[$i*2],$pnts[$i*2+1]); - } - } - } - - } - - function GetCount() { - return count($this->data); - } - - function Legend($graph) { - if( $this->legend == '' ) { - return; - } - if( $this->fill ) { - $graph->legend->Add($this->legend,$this->fill_color,$this->mark); - } else { - $graph->legend->Add($this->legend,$this->color,$this->mark); - } - } - -} // Class - -//=================================================== -// CLASS RadarGraph -// Description: Main container for a radar graph -//=================================================== -class RadarGraph extends Graph { - public $grid,$axis=null; - private $posx,$posy; - private $len; - private $axis_title=null; - - function __construct($width=300,$height=200,$cachedName="",$timeout=0,$inline=1) { - parent::__construct($width,$height,$cachedName,$timeout,$inline); - $this->posx = $width/2; - $this->posy = $height/2; - $this->len = min($width,$height)*0.35; - $this->SetColor(array(255,255,255)); - $this->SetTickDensity(TICKD_NORMAL); - $this->SetScale('lin'); - $this->SetGridDepth(DEPTH_FRONT); - } - - function HideTickMarks($aFlag=true) { - $this->axis->scale->ticks->SupressTickMarks($aFlag); - } - - function ShowMinorTickmarks($aFlag=true) { - $this->yscale->ticks->SupressMinorTickMarks(!$aFlag); - } - - function SetScale($axtype,$ymin=1,$ymax=1,$dummy1=null,$dumy2=null) { - if( $axtype != 'lin' && $axtype != 'log' ) { - JpGraphError::RaiseL(18003,$axtype); - //("Illegal scale for radarplot ($axtype). Must be \"lin\" or \"log\""); - } - if( $axtype == 'lin' ) { - $this->yscale = new LinearScale($ymin,$ymax); - $this->yscale->ticks = new RadarLinearTicks(); - $this->yscale->ticks->SupressMinorTickMarks(); - } - elseif( $axtype == 'log' ) { - $this->yscale = new LogScale($ymin,$ymax); - $this->yscale->ticks = new RadarLogTicks(); - } - - $this->axis = new RadarAxis($this->img,$this->yscale); - $this->grid = new RadarGrid(); - } - - function SetSize($aSize) { - if( $aSize < 0.1 || $aSize>1 ) { - JpGraphError::RaiseL(18004,$aSize); - //("Radar Plot size must be between 0.1 and 1. (Your value=$s)"); - } - $this->len=min($this->img->width,$this->img->height)*$aSize/2; - } - - function SetPlotSize($aSize) { - $this->SetSize($aSize); - } - - function SetTickDensity($densy=TICKD_NORMAL,$dummy1=null) { - $this->ytick_factor=25; - switch( $densy ) { - case TICKD_DENSE: - $this->ytick_factor=12; - break; - case TICKD_NORMAL: - $this->ytick_factor=25; - break; - case TICKD_SPARSE: - $this->ytick_factor=40; - break; - case TICKD_VERYSPARSE: - $this->ytick_factor=70; - break; - default: - JpGraphError::RaiseL(18005,$densy); - //("RadarPlot Unsupported Tick density: $densy"); - } - } - - function SetPos($px,$py=0.5) { - $this->SetCenter($px,$py); - } - - function SetCenter($px,$py=0.5) { - if( $px >= 0 && $px <= 1 ) { - $this->posx = $this->img->width*$px; - } - else { - $this->posx = $px; - } - if( $py >= 0 && $py <= 1 ) { - $this->posy = $this->img->height*$py; - } - else { - $this->posy = $py; - } - } - - function SetColor($aColor) { - $this->SetMarginColor($aColor); - } - - function SetTitles($aTitleArray) { - $this->axis_title = $aTitleArray; - } - - function Add($aPlot) { - if( $aPlot == null ) { - JpGraphError::RaiseL(25010);//("Graph::Add() You tried to add a null plot to the graph."); - } - if( is_array($aPlot) && count($aPlot) > 0 ) { - $cl = $aPlot[0]; - } - else { - $cl = $aPlot; - } - - if( $cl instanceof Text ) $this->AddText($aPlot); - elseif( class_exists('IconPlot',false) && ($cl instanceof IconPlot) ) $this->AddIcon($aPlot); - else { - $this->plots[] = $aPlot; - } - } - - function GetPlotsYMinMax($aPlots) { - $min=$aPlots[0]->Min(); - $max=$aPlots[0]->Max(); - foreach( $this->plots as $p ) { - $max=max($max,$p->Max()); - $min=min($min,$p->Min()); - } - if( $min < 0 ) { - JpGraphError::RaiseL(18006,$min); - //("Minimum data $min (Radar plots should only be used when all data points > 0)"); - } - return array($min,$max); - } - - function StrokeIcons() { - if( $this->iIcons != null ) { - $n = count($this->iIcons); - for( $i=0; $i < $n; ++$i ) { - $this->iIcons[$i]->Stroke($this->img); - } - } - } - - function StrokeTexts() { - if( $this->texts != null ) { - $n = count($this->texts); - for( $i=0; $i < $n; ++$i ) { - $this->texts[$i]->Stroke($this->img); - } - } - } - - // Stroke the Radar graph - function Stroke($aStrokeFileName='') { - - // If the filename is the predefined value = '_csim_special_' - // we assume that the call to stroke only needs to do enough - // to correctly generate the CSIM maps. - // We use this variable to skip things we don't strictly need - // to do to generate the image map to improve performance - // a best we can. Therefor you will see a lot of tests !$_csim in the - // code below. - $_csim = ( $aStrokeFileName === _CSIM_SPECIALFILE ); - - // We need to know if we have stroked the plot in the - // GetCSIMareas. Otherwise the CSIM hasn't been generated - // and in the case of GetCSIM called before stroke to generate - // CSIM without storing an image to disk GetCSIM must call Stroke. - $this->iHasStroked = true; - - $n = count($this->plots); - // Set Y-scale - - if( !$this->yscale->IsSpecified() && count($this->plots) > 0 ) { - list($min,$max) = $this->GetPlotsYMinMax($this->plots); - $this->yscale->AutoScale($this->img,0,$max,$this->len/$this->ytick_factor); - } - elseif( $this->yscale->IsSpecified() && - ( $this->yscale->auto_ticks || !$this->yscale->ticks->IsSpecified()) ) { - - // The tick calculation will use the user suplied min/max values to determine - // the ticks. If auto_ticks is false the exact user specifed min and max - // values will be used for the scale. - // If auto_ticks is true then the scale might be slightly adjusted - // so that the min and max values falls on an even major step. - $min = $this->yscale->scale[0]; - $max = $this->yscale->scale[1]; - $this->yscale->AutoScale($this->img,$min,$max, - $this->len/$this->ytick_factor, - $this->yscale->auto_ticks); - } - - // Set start position end length of scale (in absolute pixels) - $this->yscale->SetConstants($this->posx,$this->len); - - // We need as many axis as there are data points - $nbrpnts=$this->plots[0]->GetCount(); - - // If we have no titles just number the axis 1,2,3,... - if( $this->axis_title==null ) { - for($i=0; $i < $nbrpnts; ++$i ) { - $this->axis_title[$i] = $i+1; - } - } - elseif( count($this->axis_title) < $nbrpnts) { - JpGraphError::RaiseL(18007); - // ("Number of titles does not match number of points in plot."); - } - for( $i=0; $i < $n; ++$i ) { - if( $nbrpnts != $this->plots[$i]->GetCount() ) { - JpGraphError::RaiseL(18008); - //("Each radar plot must have the same number of data points."); - } - } - - if( !$_csim ) { - if( $this->background_image != '' ) { - $this->StrokeFrameBackground(); - } - else { - $this->StrokeFrame(); - $this->StrokeBackgroundGrad(); - } - } - $astep=2*M_PI/$nbrpnts; - - if( !$_csim ) { - if( $this->iIconDepth == DEPTH_BACK ) { - $this->StrokeIcons(); - } - - - // Prepare legends - for($i=0; $i < $n; ++$i) { - $this->plots[$i]->Legend($this); - } - $this->legend->Stroke($this->img); - $this->footer->Stroke($this->img); - } - - if( !$_csim ) { - if( $this->grid_depth == DEPTH_BACK ) { - // Draw axis and grid - for( $i=0,$a=M_PI/2; $i < $nbrpnts; ++$i, $a += $astep ) { - $this->axis->Stroke($this->posy,$a,$grid[$i],$this->axis_title[$i],$i==0); - } - $this->grid->Stroke($this->img,$grid); - } - if( $this->iIconDepth == DEPTH_BACK ) { - $this->StrokeIcons(); - } - - } - - // Plot points - $a=M_PI/2; - for($i=0; $i < $n; ++$i ) { - $this->plots[$i]->Stroke($this->img, $this->posy, $this->yscale, $a); - } - - if( !$_csim ) { - if( $this->grid_depth != DEPTH_BACK ) { - // Draw axis and grid - for( $i=0,$a=M_PI/2; $i < $nbrpnts; ++$i, $a += $astep ) { - $this->axis->Stroke($this->posy,$a,$grid[$i],$this->axis_title[$i],$i==0); - } - $this->grid->Stroke($this->img,$grid); - } - - $this->StrokeTitles(); - $this->StrokeTexts(); - if( $this->iIconDepth == DEPTH_FRONT ) { - $this->StrokeIcons(); - } - } - - // Should we do any final image transformation - if( $this->iImgTrans && !$_csim ) { - if( !class_exists('ImgTrans',false) ) { - require_once('jpgraph_imgtrans.php'); - } - - $tform = new ImgTrans($this->img->img); - $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, - $this->iImgTransDirection,$this->iImgTransHighQ, - $this->iImgTransMinSize,$this->iImgTransFillColor, - $this->iImgTransBorder); - } - - if( !$_csim ) { - // If the filename is given as the special "__handle" - // then the image handler is returned and the image is NOT - // streamed back - if( $aStrokeFileName == _IMG_HANDLER ) { - return $this->img->img; - } - else { - // Finally stream the generated picture - $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); - } - } - } -} // Class - -/* EOF */ -?> diff --git a/#jpgraph/src/jpgraph_regstat.php b/#jpgraph/src/jpgraph_regstat.php deleted file mode 100644 index 0f6c96be..00000000 --- a/#jpgraph/src/jpgraph_regstat.php +++ /dev/null @@ -1,215 +0,0 @@ -y2 = array(); - $this->xdata = $xdata; - $this->ydata = $ydata; - - $n = count($ydata); - $this->n = $n; - if( $this->n !== count($xdata) ) { - JpGraphError::RaiseL(19001); - //('Spline: Number of X and Y coordinates must be the same'); - } - - // Natural spline 2:derivate == 0 at endpoints - $this->y2[0] = 0.0; - $this->y2[$n-1] = 0.0; - $delta[0] = 0.0; - - // Calculate 2:nd derivate - for($i=1; $i < $n-1; ++$i) { - $d = ($xdata[$i+1]-$xdata[$i-1]); - if( $d == 0 ) { - JpGraphError::RaiseL(19002); - //('Invalid input data for spline. Two or more consecutive input X-values are equal. Each input X-value must differ since from a mathematical point of view it must be a one-to-one mapping, i.e. each X-value must correspond to exactly one Y-value.'); - } - $s = ($xdata[$i]-$xdata[$i-1])/$d; - $p = $s*$this->y2[$i-1]+2.0; - $this->y2[$i] = ($s-1.0)/$p; - $delta[$i] = ($ydata[$i+1]-$ydata[$i])/($xdata[$i+1]-$xdata[$i]) - - ($ydata[$i]-$ydata[$i-1])/($xdata[$i]-$xdata[$i-1]); - $delta[$i] = (6.0*$delta[$i]/($xdata[$i+1]-$xdata[$i-1])-$s*$delta[$i-1])/$p; - } - - // Backward substitution - for( $j=$n-2; $j >= 0; --$j ) { - $this->y2[$j] = $this->y2[$j]*$this->y2[$j+1] + $delta[$j]; - } - } - - // Return the two new data vectors - function Get($num=50) { - $n = $this->n ; - $step = ($this->xdata[$n-1]-$this->xdata[0]) / ($num-1); - $xnew=array(); - $ynew=array(); - $xnew[0] = $this->xdata[0]; - $ynew[0] = $this->ydata[0]; - for( $j=1; $j < $num; ++$j ) { - $xnew[$j] = $xnew[0]+$j*$step; - $ynew[$j] = $this->Interpolate($xnew[$j]); - } - return array($xnew,$ynew); - } - - // Return a single interpolated Y-value from an x value - function Interpolate($xpoint) { - - $max = $this->n-1; - $min = 0; - - // Binary search to find interval - while( $max-$min > 1 ) { - $k = ($max+$min) / 2; - if( $this->xdata[$k] > $xpoint ) - $max=$k; - else - $min=$k; - } - - // Each interval is interpolated by a 3:degree polynom function - $h = $this->xdata[$max]-$this->xdata[$min]; - - if( $h == 0 ) { - JpGraphError::RaiseL(19002); - //('Invalid input data for spline. Two or more consecutive input X-values are equal. Each input X-value must differ since from a mathematical point of view it must be a one-to-one mapping, i.e. each X-value must correspond to exactly one Y-value.'); - } - - - $a = ($this->xdata[$max]-$xpoint)/$h; - $b = ($xpoint-$this->xdata[$min])/$h; - return $a*$this->ydata[$min]+$b*$this->ydata[$max]+ - (($a*$a*$a-$a)*$this->y2[$min]+($b*$b*$b-$b)*$this->y2[$max])*($h*$h)/6.0; - } -} - -//------------------------------------------------------------------------ -// CLASS Bezier -// Create a new data array from a number of control points -//------------------------------------------------------------------------ -class Bezier { - /** - * @author Thomas Despoix, openXtrem company - * @license released under QPL - * @abstract Bezier interoplated point generation, - * computed from control points data sets, based on Paul Bourke algorithm : - * http://local.wasp.uwa.edu.au/~pbourke/geometry/bezier/index2.html - */ - private $datax = array(); - private $datay = array(); - private $n=0; - - function __construct($datax, $datay, $attraction_factor = 1) { - // Adding control point multiple time will raise their attraction power over the curve - $this->n = count($datax); - if( $this->n !== count($datay) ) { - JpGraphError::RaiseL(19003); - //('Bezier: Number of X and Y coordinates must be the same'); - } - $idx=0; - foreach($datax as $datumx) { - for ($i = 0; $i < $attraction_factor; $i++) { - $this->datax[$idx++] = $datumx; - } - } - $idx=0; - foreach($datay as $datumy) { - for ($i = 0; $i < $attraction_factor; $i++) { - $this->datay[$idx++] = $datumy; - } - } - $this->n *= $attraction_factor; - } - - /** - * Return a set of data points that specifies the bezier curve with $steps points - * @param $steps Number of new points to return - * @return array($datax, $datay) - */ - function Get($steps) { - $datax = array(); - $datay = array(); - for ($i = 0; $i < $steps; $i++) { - list($datumx, $datumy) = $this->GetPoint((double) $i / (double) $steps); - $datax[$i] = $datumx; - $datay[$i] = $datumy; - } - - $datax[] = end($this->datax); - $datay[] = end($this->datay); - - return array($datax, $datay); - } - - /** - * Return one point on the bezier curve. $mu is the position on the curve where $mu is in the - * range 0 $mu < 1 where 0 is tha start point and 1 is the end point. Note that every newly computed - * point depends on all the existing points - * - * @param $mu Position on the bezier curve - * @return array($x, $y) - */ - function GetPoint($mu) { - $n = $this->n - 1; - $k = 0; - $kn = 0; - $nn = 0; - $nkn = 0; - $blend = 0.0; - $newx = 0.0; - $newy = 0.0; - - $muk = 1.0; - $munk = (double) pow(1-$mu,(double) $n); - - for ($k = 0; $k <= $n; $k++) { - $nn = $n; - $kn = $k; - $nkn = $n - $k; - $blend = $muk * $munk; - $muk *= $mu; - $munk /= (1-$mu); - while ($nn >= 1) { - $blend *= $nn; - $nn--; - if ($kn > 1) { - $blend /= (double) $kn; - $kn--; - } - if ($nkn > 1) { - $blend /= (double) $nkn; - $nkn--; - } - } - $newx += $this->datax[$k] * $blend; - $newy += $this->datay[$k] * $blend; - } - - return array($newx, $newy); - } -} - -// EOF -?> diff --git a/#jpgraph/src/jpgraph_rgb.inc.php b/#jpgraph/src/jpgraph_rgb.inc.php deleted file mode 100644 index 53892611..00000000 --- a/#jpgraph/src/jpgraph_rgb.inc.php +++ /dev/null @@ -1,615 +0,0 @@ -img = $aImg; - - // Conversion array between color names and RGB - $this->rgb_table = array( - 'aqua'=> array(0,255,255), - 'lime'=> array(0,255,0), - 'teal'=> array(0,128,128), - 'whitesmoke'=>array(245,245,245), - 'gainsboro'=>array(220,220,220), - 'oldlace'=>array(253,245,230), - 'linen'=>array(250,240,230), - 'antiquewhite'=>array(250,235,215), - 'papayawhip'=>array(255,239,213), - 'blanchedalmond'=>array(255,235,205), - 'bisque'=>array(255,228,196), - 'peachpuff'=>array(255,218,185), - 'navajowhite'=>array(255,222,173), - 'moccasin'=>array(255,228,181), - 'cornsilk'=>array(255,248,220), - 'ivory'=>array(255,255,240), - 'lemonchiffon'=>array(255,250,205), - 'seashell'=>array(255,245,238), - 'mintcream'=>array(245,255,250), - 'azure'=>array(240,255,255), - 'aliceblue'=>array(240,248,255), - 'lavender'=>array(230,230,250), - 'lavenderblush'=>array(255,240,245), - 'mistyrose'=>array(255,228,225), - 'white'=>array(255,255,255), - 'black'=>array(0,0,0), - 'darkslategray'=>array(47,79,79), - 'dimgray'=>array(105,105,105), - 'slategray'=>array(112,128,144), - 'lightslategray'=>array(119,136,153), - 'gray'=>array(190,190,190), - 'lightgray'=>array(211,211,211), - 'midnightblue'=>array(25,25,112), - 'navy'=>array(0,0,128), - 'indigo'=>array(75,0,130), - 'electricindigo'=>array(102,0,255), - 'deepindigo'=>array(138,43,226), - 'pigmentindigo'=>array(75,0,130), - 'indigodye'=>array(0,65,106), - 'cornflowerblue'=>array(100,149,237), - 'darkslateblue'=>array(72,61,139), - 'slateblue'=>array(106,90,205), - 'mediumslateblue'=>array(123,104,238), - 'lightslateblue'=>array(132,112,255), - 'mediumblue'=>array(0,0,205), - 'royalblue'=>array(65,105,225), - 'blue'=>array(0,0,255), - 'dodgerblue'=>array(30,144,255), - 'deepskyblue'=>array(0,191,255), - 'skyblue'=>array(135,206,235), - 'lightskyblue'=>array(135,206,250), - 'steelblue'=>array(70,130,180), - 'lightred'=>array(211,167,168), - 'lightsteelblue'=>array(176,196,222), - 'lightblue'=>array(173,216,230), - 'powderblue'=>array(176,224,230), - 'paleturquoise'=>array(175,238,238), - 'darkturquoise'=>array(0,206,209), - 'mediumturquoise'=>array(72,209,204), - 'turquoise'=>array(64,224,208), - 'cyan'=>array(0,255,255), - 'lightcyan'=>array(224,255,255), - 'cadetblue'=>array(95,158,160), - 'mediumaquamarine'=>array(102,205,170), - 'aquamarine'=>array(127,255,212), - 'darkgreen'=>array(0,100,0), - 'darkolivegreen'=>array(85,107,47), - 'darkseagreen'=>array(143,188,143), - 'seagreen'=>array(46,139,87), - 'mediumseagreen'=>array(60,179,113), - 'lightseagreen'=>array(32,178,170), - 'palegreen'=>array(152,251,152), - 'springgreen'=>array(0,255,127), - 'lawngreen'=>array(124,252,0), - 'green'=>array(0,255,0), - 'chartreuse'=>array(127,255,0), - 'mediumspringgreen'=>array(0,250,154), - 'greenyellow'=>array(173,255,47), - 'limegreen'=>array(50,205,50), - 'yellowgreen'=>array(154,205,50), - 'forestgreen'=>array(34,139,34), - 'olivedrab'=>array(107,142,35), - 'darkkhaki'=>array(189,183,107), - 'khaki'=>array(240,230,140), - 'palegoldenrod'=>array(238,232,170), - 'lightgoldenrodyellow'=>array(250,250,210), - 'lightyellow'=>array(255,255,200), - 'yellow'=>array(255,255,0), - 'gold'=>array(255,215,0), - 'lightgoldenrod'=>array(238,221,130), - 'goldenrod'=>array(218,165,32), - 'darkgoldenrod'=>array(184,134,11), - 'rosybrown'=>array(188,143,143), - 'indianred'=>array(205,92,92), - 'saddlebrown'=>array(139,69,19), - 'sienna'=>array(160,82,45), - 'peru'=>array(205,133,63), - 'burlywood'=>array(222,184,135), - 'beige'=>array(245,245,220), - 'wheat'=>array(245,222,179), - 'sandybrown'=>array(244,164,96), - 'tan'=>array(210,180,140), - 'chocolate'=>array(210,105,30), - 'firebrick'=>array(178,34,34), - 'brown'=>array(165,42,42), - 'darksalmon'=>array(233,150,122), - 'salmon'=>array(250,128,114), - 'lightsalmon'=>array(255,160,122), - 'orange'=>array(255,165,0), - 'darkorange'=>array(255,140,0), - 'coral'=>array(255,127,80), - 'lightcoral'=>array(240,128,128), - 'tomato'=>array(255,99,71), - 'orangered'=>array(255,69,0), - 'red'=>array(255,0,0), - 'hotpink'=>array(255,105,180), - 'deeppink'=>array(255,20,147), - 'pink'=>array(255,192,203), - 'lightpink'=>array(255,182,193), - 'palevioletred'=>array(219,112,147), - 'maroon'=>array(176,48,96), - 'mediumvioletred'=>array(199,21,133), - 'violetred'=>array(208,32,144), - 'magenta'=>array(255,0,255), - 'violet'=>array(238,130,238), - 'plum'=>array(221,160,221), - 'orchid'=>array(218,112,214), - 'mediumorchid'=>array(186,85,211), - 'darkorchid'=>array(153,50,204), - 'darkviolet'=>array(148,0,211), - 'blueviolet'=>array(138,43,226), - 'purple'=>array(160,32,240), - 'mediumpurple'=>array(147,112,219), - 'thistle'=>array(216,191,216), - 'snow1'=>array(255,250,250), - 'snow2'=>array(238,233,233), - 'snow3'=>array(205,201,201), - 'snow4'=>array(139,137,137), - 'seashell1'=>array(255,245,238), - 'seashell2'=>array(238,229,222), - 'seashell3'=>array(205,197,191), - 'seashell4'=>array(139,134,130), - 'AntiqueWhite1'=>array(255,239,219), - 'AntiqueWhite2'=>array(238,223,204), - 'AntiqueWhite3'=>array(205,192,176), - 'AntiqueWhite4'=>array(139,131,120), - 'bisque1'=>array(255,228,196), - 'bisque2'=>array(238,213,183), - 'bisque3'=>array(205,183,158), - 'bisque4'=>array(139,125,107), - 'peachPuff1'=>array(255,218,185), - 'peachpuff2'=>array(238,203,173), - 'peachpuff3'=>array(205,175,149), - 'peachpuff4'=>array(139,119,101), - 'navajowhite1'=>array(255,222,173), - 'navajowhite2'=>array(238,207,161), - 'navajowhite3'=>array(205,179,139), - 'navajowhite4'=>array(139,121,94), - 'lemonchiffon1'=>array(255,250,205), - 'lemonchiffon2'=>array(238,233,191), - 'lemonchiffon3'=>array(205,201,165), - 'lemonchiffon4'=>array(139,137,112), - 'ivory1'=>array(255,255,240), - 'ivory2'=>array(238,238,224), - 'ivory3'=>array(205,205,193), - 'ivory4'=>array(139,139,131), - 'honeydew'=>array(193,205,193), - 'lavenderblush1'=>array(255,240,245), - 'lavenderblush2'=>array(238,224,229), - 'lavenderblush3'=>array(205,193,197), - 'lavenderblush4'=>array(139,131,134), - 'mistyrose1'=>array(255,228,225), - 'mistyrose2'=>array(238,213,210), - 'mistyrose3'=>array(205,183,181), - 'mistyrose4'=>array(139,125,123), - 'azure1'=>array(240,255,255), - 'azure2'=>array(224,238,238), - 'azure3'=>array(193,205,205), - 'azure4'=>array(131,139,139), - 'slateblue1'=>array(131,111,255), - 'slateblue2'=>array(122,103,238), - 'slateblue3'=>array(105,89,205), - 'slateblue4'=>array(71,60,139), - 'royalblue1'=>array(72,118,255), - 'royalblue2'=>array(67,110,238), - 'royalblue3'=>array(58,95,205), - 'royalblue4'=>array(39,64,139), - 'dodgerblue1'=>array(30,144,255), - 'dodgerblue2'=>array(28,134,238), - 'dodgerblue3'=>array(24,116,205), - 'dodgerblue4'=>array(16,78,139), - 'steelblue1'=>array(99,184,255), - 'steelblue2'=>array(92,172,238), - 'steelblue3'=>array(79,148,205), - 'steelblue4'=>array(54,100,139), - 'deepskyblue1'=>array(0,191,255), - 'deepskyblue2'=>array(0,178,238), - 'deepskyblue3'=>array(0,154,205), - 'deepskyblue4'=>array(0,104,139), - 'skyblue1'=>array(135,206,255), - 'skyblue2'=>array(126,192,238), - 'skyblue3'=>array(108,166,205), - 'skyblue4'=>array(74,112,139), - 'lightskyblue1'=>array(176,226,255), - 'lightskyblue2'=>array(164,211,238), - 'lightskyblue3'=>array(141,182,205), - 'lightskyblue4'=>array(96,123,139), - 'slategray1'=>array(198,226,255), - 'slategray2'=>array(185,211,238), - 'slategray3'=>array(159,182,205), - 'slategray4'=>array(108,123,139), - 'lightsteelblue1'=>array(202,225,255), - 'lightsteelblue2'=>array(188,210,238), - 'lightsteelblue3'=>array(162,181,205), - 'lightsteelblue4'=>array(110,123,139), - 'lightblue1'=>array(191,239,255), - 'lightblue2'=>array(178,223,238), - 'lightblue3'=>array(154,192,205), - 'lightblue4'=>array(104,131,139), - 'lightcyan1'=>array(224,255,255), - 'lightcyan2'=>array(209,238,238), - 'lightcyan3'=>array(180,205,205), - 'lightcyan4'=>array(122,139,139), - 'paleturquoise1'=>array(187,255,255), - 'paleturquoise2'=>array(174,238,238), - 'paleturquoise3'=>array(150,205,205), - 'paleturquoise4'=>array(102,139,139), - 'cadetblue1'=>array(152,245,255), - 'cadetblue2'=>array(142,229,238), - 'cadetblue3'=>array(122,197,205), - 'cadetblue4'=>array(83,134,139), - 'turquoise1'=>array(0,245,255), - 'turquoise2'=>array(0,229,238), - 'turquoise3'=>array(0,197,205), - 'turquoise4'=>array(0,134,139), - 'cyan1'=>array(0,255,255), - 'cyan2'=>array(0,238,238), - 'cyan3'=>array(0,205,205), - 'cyan4'=>array(0,139,139), - 'darkslategray1'=>array(151,255,255), - 'darkslategray2'=>array(141,238,238), - 'darkslategray3'=>array(121,205,205), - 'darkslategray4'=>array(82,139,139), - 'aquamarine1'=>array(127,255,212), - 'aquamarine2'=>array(118,238,198), - 'aquamarine3'=>array(102,205,170), - 'aquamarine4'=>array(69,139,116), - 'darkseagreen1'=>array(193,255,193), - 'darkseagreen2'=>array(180,238,180), - 'darkseagreen3'=>array(155,205,155), - 'darkseagreen4'=>array(105,139,105), - 'seagreen1'=>array(84,255,159), - 'seagreen2'=>array(78,238,148), - 'seagreen3'=>array(67,205,128), - 'seagreen4'=>array(46,139,87), - 'palegreen1'=>array(154,255,154), - 'palegreen2'=>array(144,238,144), - 'palegreen3'=>array(124,205,124), - 'palegreen4'=>array(84,139,84), - 'springgreen1'=>array(0,255,127), - 'springgreen2'=>array(0,238,118), - 'springgreen3'=>array(0,205,102), - 'springgreen4'=>array(0,139,69), - 'chartreuse1'=>array(127,255,0), - 'chartreuse2'=>array(118,238,0), - 'chartreuse3'=>array(102,205,0), - 'chartreuse4'=>array(69,139,0), - 'olivedrab1'=>array(192,255,62), - 'olivedrab2'=>array(179,238,58), - 'olivedrab3'=>array(154,205,50), - 'olivedrab4'=>array(105,139,34), - 'darkolivegreen1'=>array(202,255,112), - 'darkolivegreen2'=>array(188,238,104), - 'darkolivegreen3'=>array(162,205,90), - 'darkolivegreen4'=>array(110,139,61), - 'khaki1'=>array(255,246,143), - 'khaki2'=>array(238,230,133), - 'khaki3'=>array(205,198,115), - 'khaki4'=>array(139,134,78), - 'lightgoldenrod1'=>array(255,236,139), - 'lightgoldenrod2'=>array(238,220,130), - 'lightgoldenrod3'=>array(205,190,112), - 'lightgoldenrod4'=>array(139,129,76), - 'yellow1'=>array(255,255,0), - 'yellow2'=>array(238,238,0), - 'yellow3'=>array(205,205,0), - 'yellow4'=>array(139,139,0), - 'gold1'=>array(255,215,0), - 'gold2'=>array(238,201,0), - 'gold3'=>array(205,173,0), - 'gold4'=>array(139,117,0), - 'goldenrod1'=>array(255,193,37), - 'goldenrod2'=>array(238,180,34), - 'goldenrod3'=>array(205,155,29), - 'goldenrod4'=>array(139,105,20), - 'darkgoldenrod1'=>array(255,185,15), - 'darkgoldenrod2'=>array(238,173,14), - 'darkgoldenrod3'=>array(205,149,12), - 'darkgoldenrod4'=>array(139,101,8), - 'rosybrown1'=>array(255,193,193), - 'rosybrown2'=>array(238,180,180), - 'rosybrown3'=>array(205,155,155), - 'rosybrown4'=>array(139,105,105), - 'indianred1'=>array(255,106,106), - 'indianred2'=>array(238,99,99), - 'indianred3'=>array(205,85,85), - 'indianred4'=>array(139,58,58), - 'sienna1'=>array(255,130,71), - 'sienna2'=>array(238,121,66), - 'sienna3'=>array(205,104,57), - 'sienna4'=>array(139,71,38), - 'burlywood1'=>array(255,211,155), - 'burlywood2'=>array(238,197,145), - 'burlywood3'=>array(205,170,125), - 'burlywood4'=>array(139,115,85), - 'wheat1'=>array(255,231,186), - 'wheat2'=>array(238,216,174), - 'wheat3'=>array(205,186,150), - 'wheat4'=>array(139,126,102), - 'tan1'=>array(255,165,79), - 'tan2'=>array(238,154,73), - 'tan3'=>array(205,133,63), - 'tan4'=>array(139,90,43), - 'chocolate1'=>array(255,127,36), - 'chocolate2'=>array(238,118,33), - 'chocolate3'=>array(205,102,29), - 'chocolate4'=>array(139,69,19), - 'firebrick1'=>array(255,48,48), - 'firebrick2'=>array(238,44,44), - 'firebrick3'=>array(205,38,38), - 'firebrick4'=>array(139,26,26), - 'brown1'=>array(255,64,64), - 'brown2'=>array(238,59,59), - 'brown3'=>array(205,51,51), - 'brown4'=>array(139,35,35), - 'salmon1'=>array(255,140,105), - 'salmon2'=>array(238,130,98), - 'salmon3'=>array(205,112,84), - 'salmon4'=>array(139,76,57), - 'lightsalmon1'=>array(255,160,122), - 'lightsalmon2'=>array(238,149,114), - 'lightsalmon3'=>array(205,129,98), - 'lightsalmon4'=>array(139,87,66), - 'orange1'=>array(255,165,0), - 'orange2'=>array(238,154,0), - 'orange3'=>array(205,133,0), - 'orange4'=>array(139,90,0), - 'darkorange1'=>array(255,127,0), - 'darkorange2'=>array(238,118,0), - 'darkorange3'=>array(205,102,0), - 'darkorange4'=>array(139,69,0), - 'coral1'=>array(255,114,86), - 'coral2'=>array(238,106,80), - 'coral3'=>array(205,91,69), - 'coral4'=>array(139,62,47), - 'tomato1'=>array(255,99,71), - 'tomato2'=>array(238,92,66), - 'tomato3'=>array(205,79,57), - 'tomato4'=>array(139,54,38), - 'orangered1'=>array(255,69,0), - 'orangered2'=>array(238,64,0), - 'orangered3'=>array(205,55,0), - 'orangered4'=>array(139,37,0), - 'deeppink1'=>array(255,20,147), - 'deeppink2'=>array(238,18,137), - 'deeppink3'=>array(205,16,118), - 'deeppink4'=>array(139,10,80), - 'hotpink1'=>array(255,110,180), - 'hotpink2'=>array(238,106,167), - 'hotpink3'=>array(205,96,144), - 'hotpink4'=>array(139,58,98), - 'pink1'=>array(255,181,197), - 'pink2'=>array(238,169,184), - 'pink3'=>array(205,145,158), - 'pink4'=>array(139,99,108), - 'lightpink1'=>array(255,174,185), - 'lightpink2'=>array(238,162,173), - 'lightpink3'=>array(205,140,149), - 'lightpink4'=>array(139,95,101), - 'palevioletred1'=>array(255,130,171), - 'palevioletred2'=>array(238,121,159), - 'palevioletred3'=>array(205,104,137), - 'palevioletred4'=>array(139,71,93), - 'maroon1'=>array(255,52,179), - 'maroon2'=>array(238,48,167), - 'maroon3'=>array(205,41,144), - 'maroon4'=>array(139,28,98), - 'violetred1'=>array(255,62,150), - 'violetred2'=>array(238,58,140), - 'violetred3'=>array(205,50,120), - 'violetred4'=>array(139,34,82), - 'magenta1'=>array(255,0,255), - 'magenta2'=>array(238,0,238), - 'magenta3'=>array(205,0,205), - 'magenta4'=>array(139,0,139), - 'mediumred'=>array(140,34,34), - 'orchid1'=>array(255,131,250), - 'orchid2'=>array(238,122,233), - 'orchid3'=>array(205,105,201), - 'orchid4'=>array(139,71,137), - 'plum1'=>array(255,187,255), - 'plum2'=>array(238,174,238), - 'plum3'=>array(205,150,205), - 'plum4'=>array(139,102,139), - 'mediumorchid1'=>array(224,102,255), - 'mediumorchid2'=>array(209,95,238), - 'mediumorchid3'=>array(180,82,205), - 'mediumorchid4'=>array(122,55,139), - 'darkorchid1'=>array(191,62,255), - 'darkorchid2'=>array(178,58,238), - 'darkorchid3'=>array(154,50,205), - 'darkorchid4'=>array(104,34,139), - 'purple1'=>array(155,48,255), - 'purple2'=>array(145,44,238), - 'purple3'=>array(125,38,205), - 'purple4'=>array(85,26,139), - 'mediumpurple1'=>array(171,130,255), - 'mediumpurple2'=>array(159,121,238), - 'mediumpurple3'=>array(137,104,205), - 'mediumpurple4'=>array(93,71,139), - 'thistle1'=>array(255,225,255), - 'thistle2'=>array(238,210,238), - 'thistle3'=>array(205,181,205), - 'thistle4'=>array(139,123,139), - 'gray1'=>array(10,10,10), - 'gray2'=>array(40,40,30), - 'gray3'=>array(70,70,70), - 'gray4'=>array(100,100,100), - 'gray5'=>array(130,130,130), - 'gray6'=>array(160,160,160), - 'gray7'=>array(190,190,190), - 'gray8'=>array(210,210,210), - 'gray9'=>array(240,240,240), - 'darkgray'=>array(100,100,100), - 'darkblue'=>array(0,0,139), - 'darkcyan'=>array(0,139,139), - 'darkmagenta'=>array(139,0,139), - 'darkred'=>array(139,0,0), - 'silver'=>array(192, 192, 192), - 'eggplant'=>array(144,176,168), - 'lightgreen'=>array(144,238,144)); - } - - - //---------------- - // PUBLIC METHODS - // Colors can be specified as either - // 1. #xxxxxx HTML style - // 2. "colorname" as a named color - // 3. array(r,g,b) RGB triple - // This function translates this to a native RGB format and returns an - // RGB triple. - - function Color($aColor) { - if (is_string($aColor)) { - $matches = array(); - // this regex will parse a color string and fill the $matches array as such: - // 0: the full match if any - // 1: a hex string preceded by a hash, can be 3 characters (#fff) or 6 (#ffffff) (4 or 5 also accepted but...) - // 2,3,4: r,g,b values in hex if the first character of the string is # - // 5: all alpha-numeric characters at the beginning of the string if string does not start with # - // 6: alpha value prefixed by @ if supplied - // 7: alpha value with @ stripped - // 8: adjust value prefixed with : if supplied - // 9: adjust value with : stripped - $regex = '/(#([0-9a-fA-F]{1,2})([0-9a-fA-F]{1,2})([0-9a-fA-F]{1,2}))?([\w]+)?(@([\d\.,]+))?(:([\d\.,]+))?/'; - if(!preg_match($regex, $aColor, $matches)) { - JpGraphError::RaiseL(25078,$aColor);//(" Unknown color: $aColor"); - } - if(empty($matches[5])) { - $r = strlen($matches[2]) == 1 ? $matches[2].$matches[2] : $matches[2]; - $g = strlen($matches[3]) == 1 ? $matches[3].$matches[3] : $matches[3]; - $b = strlen($matches[4]) == 1 ? $matches[4].$matches[4] : $matches[4]; - $r = hexdec($r); - $g = hexdec($g); - $b = hexdec($b); - }else { - if(!isset($this->rgb_table[$matches[5]]) ) { - JpGraphError::RaiseL(25078,$aColor);//(" Unknown color: $aColor"); - } - $r = $this->rgb_table[$matches[5]][0]; - $g = $this->rgb_table[$matches[5]][1]; - $b = $this->rgb_table[$matches[5]][2]; - } - $alpha = isset($matches[7]) ? str_replace(',','.',$matches[7]) : 0; - $adj = isset($matches[9]) ? str_replace(',','.',$matches[9]) : 1.0; - - if( $adj < 0 ) { - JpGraphError::RaiseL(25077);//('Adjustment factor for color must be > 0'); - } - - // Scale adj so that an adj=2 always - // makes the color 100% white (i.e. 255,255,255. - // and adj=1 neutral and adj=0 black. - if( $adj == 1) { - return array($r,$g,$b,$alpha); - } - elseif( $adj > 1 ) { - $m = ($adj-1.0)*(255-min(255,min($r,min($g,$b)))); - return array(min(255,$r+$m), min(255,$g+$m), min(255,$b+$m),$alpha); - } - elseif( $adj < 1 ) { - $m = ($adj-1.0)*max(255,max($r,max($g,$b))); - return array(max(0,$r+$m), max(0,$g+$m), max(0,$b+$m),$alpha); - } - } elseif( is_array($aColor) ) { - if(!isset($aColor[3])) $aColor[3] = 0; - return $aColor; - } - else { - JpGraphError::RaiseL(25079,$aColor,count($aColor));//(" Unknown color specification: $aColor , size=".count($aColor)); - } - } - - // Compare two colors - // return true if equal - function Equal($aCol1,$aCol2) { - $c1 = $this->Color($aCol1); - $c2 = $this->Color($aCol2); - return $c1[0]==$c2[0] && $c1[1]==$c2[1] && $c1[2]==$c2[2] ; - } - - // Allocate a new color in the current image - // Return new color index, -1 if no more colors could be allocated - function Allocate($aColor,$aAlpha=0.0) { - list ($r, $g, $b, $a) = $this->color($aColor); - // If alpha is specified in the color string then this - // takes precedence over the second argument - if( $a > 0 ) { - $aAlpha = $a; - } - if( $aAlpha < 0 || $aAlpha > 1 ) { - JpGraphError::RaiseL(25080);//('Alpha parameter for color must be between 0.0 and 1.0'); - } - return imagecolorresolvealpha($this->img, $r, $g, $b, round($aAlpha * 127)); - } - - // Try to convert an array with three valid numbers to the corresponding hex array - // This is currenly only used in processing the colors for barplots in order to be able - // to handle the case where the color might be specified as an array of colros as well. - // In that case we must be able to find out if an array of values should be interpretated as - // a single color (specifeid as an RGB triple) - static function tryHexConversion($aColor) { - if( is_array( $aColor ) ) { - if( count( $aColor ) == 3 ) { - if( is_numeric($aColor[0]) && is_numeric($aColor[1]) && is_numeric($aColor[2]) ) { - if( ($aColor[0] >= 0 && $aColor[0] <= 255) && - ($aColor[1] >= 0 && $aColor[1] <= 255) && - ($aColor[2] >= 0 && $aColor[2] <= 255) ) { - return sprintf('#%02x%02x%02x',$aColor[0],$aColor[1],$aColor[2]); - } - } - } - } - return $aColor; - } - - // Return a RGB tripple corresponding to a position in the normal light spectrum - // The argumen values is in the range [0, 1] where a value of 0 correponds to blue and - // a value of 1 corresponds to red. Values in betwen is mapped to a linear interpolation - // of the constituting colors in the visible color spectra. - // The $aDynamicRange specified how much of the dynamic range we shold use - // a value of 1.0 give the full dyanmic range and a lower value give more dark - // colors. In the extreme of 0.0 then all colors will be black. - static function GetSpectrum($aVal,$aDynamicRange=1.0) { - if( $aVal < 0 || $aVal > 1.0001 ) { - return array(0,0,0); // Invalid case - just return black - } - - $sat = round(255*$aDynamicRange); - $a = 0.25; - if( $aVal <= 0.25 ) { - return array(0, round($sat*$aVal/$a), $sat); - } - elseif( $aVal <= 0.5 ) { - return array(0, $sat, round($sat-$sat*($aVal-0.25)/$a)); - } - elseif( $aVal <= 0.75 ) { - return array(round($sat*($aVal-0.5)/$a), $sat, 0); - } - else { - return array($sat, round($sat-$sat*($aVal-0.75)/$a), 0); - } - } - -} // Class - -?> diff --git a/#jpgraph/src/jpgraph_scatter.php b/#jpgraph/src/jpgraph_scatter.php deleted file mode 100644 index fe987c2c..00000000 --- a/#jpgraph/src/jpgraph_scatter.php +++ /dev/null @@ -1,242 +0,0 @@ -iSize = $aSize; - $this->iArrowSize = $aArrowSize; - } - - function SetColor($aColor) { - $this->iColor = $aColor; - } - - function Stroke($aImg,$x,$y,$a) { - // First rotate the center coordinates - list($x,$y) = $aImg->Rotate($x,$y); - - $old_origin = $aImg->SetCenter($x,$y); - $old_a = $aImg->a; - $aImg->SetAngle(-$a+$old_a); - - $dx = round($this->iSize/2); - $c = array($x-$dx,$y,$x+$dx,$y); - $x += $dx; - - list($dx,$dy) = $this->isizespec[$this->iArrowSize]; - $ca = array($x,$y,$x-$dx,$y-$dy,$x-$dx,$y+$dy,$x,$y); - - $aImg->SetColor($this->iColor); - $aImg->Polygon($c); - $aImg->FilledPolygon($ca); - - $aImg->SetCenter($old_origin[0],$old_origin[1]); - $aImg->SetAngle($old_a); - } -} - -//=================================================== -// CLASS FieldPlot -// Description: Render a field plot -//=================================================== -class FieldPlot extends Plot { - public $arrow = ''; - private $iAngles = array(); - private $iCallback = ''; - - function __construct($datay,$datax,$angles) { - if( (count($datax) != count($datay)) ) - JpGraphError::RaiseL(20001);//("Fieldplots must have equal number of X and Y points."); - if( (count($datax) != count($angles)) ) - JpGraphError::RaiseL(20002);//("Fieldplots must have an angle specified for each X and Y points."); - - $this->iAngles = $angles; - - parent::__construct($datay,$datax); - $this->value->SetAlign('center','center'); - $this->value->SetMargin(15); - - $this->arrow = new FieldArrow(); - } - - function SetCallback($aFunc) { - $this->iCallback = $aFunc; - } - - function Stroke($img,$xscale,$yscale) { - - // Remeber base color and size - $bc = $this->arrow->iColor; - $bs = $this->arrow->iSize; - $bas = $this->arrow->iArrowSize; - - for( $i=0; $i<$this->numpoints; ++$i ) { - // Skip null values - if( $this->coords[0][$i]==="" ) - continue; - - $f = $this->iCallback; - if( $f != "" ) { - list($cc,$cs,$cas) = call_user_func($f,$this->coords[1][$i],$this->coords[0][$i],$this->iAngles[$i]); - // Fall back on global data if the callback isn't set - if( $cc == "" ) $cc = $bc; - if( $cs == "" ) $cs = $bs; - if( $cas == "" ) $cas = $bas; - $this->arrow->SetColor($cc); - $this->arrow->SetSize($cs,$cas); - } - - $xt = $xscale->Translate($this->coords[1][$i]); - $yt = $yscale->Translate($this->coords[0][$i]); - - $this->arrow->Stroke($img,$xt,$yt,$this->iAngles[$i]); - $this->value->Stroke($img,$this->coords[0][$i],$xt,$yt); - } - } - - // Framework function - function Legend($aGraph) { - if( $this->legend != "" ) { - $aGraph->legend->Add($this->legend,$this->mark->fill_color,$this->mark,0, - $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } - } -} - -//=================================================== -// CLASS ScatterPlot -// Description: Render X and Y plots -//=================================================== -class ScatterPlot extends Plot { - public $mark,$link; - private $impuls = false; - //--------------- - // CONSTRUCTOR - function __construct($datay,$datax=false) { - if( (count($datax) != count($datay)) && is_array($datax)) { - JpGraphError::RaiseL(20003);//("Scatterplot must have equal number of X and Y points."); - } - parent::__construct($datay,$datax); - $this->mark = new PlotMark(); - $this->mark->SetType(MARK_SQUARE); - $this->mark->SetColor($this->color); - $this->value->SetAlign('center','center'); - $this->value->SetMargin(0); - $this->link = new LineProperty(1,'black','solid'); - $this->link->iShow = false; - } - - //--------------- - // PUBLIC METHODS - function SetImpuls($f=true) { - $this->impuls = $f; - } - - function SetStem($f=true) { - $this->impuls = $f; - } - - // Combine the scatter plot points with a line - function SetLinkPoints($aFlag=true,$aColor="black",$aWeight=1,$aStyle='solid') { - $this->link->iShow = $aFlag; - $this->link->iColor = $aColor; - $this->link->iWeight = $aWeight; - $this->link->iStyle = $aStyle; - } - - function Stroke($img,$xscale,$yscale) { - - $ymin=$yscale->scale_abs[0]; - if( $yscale->scale[0] < 0 ) - $yzero=$yscale->Translate(0); - else - $yzero=$yscale->scale_abs[0]; - - $this->csimareas = ''; - for( $i=0; $i<$this->numpoints; ++$i ) { - - // Skip null values - if( $this->coords[0][$i]==='' || $this->coords[0][$i]==='-' || $this->coords[0][$i]==='x') - continue; - - if( isset($this->coords[1]) ) - $xt = $xscale->Translate($this->coords[1][$i]); - else - $xt = $xscale->Translate($i); - $yt = $yscale->Translate($this->coords[0][$i]); - - - if( $this->link->iShow && isset($yt_old) ) { - $img->SetColor($this->link->iColor); - $img->SetLineWeight($this->link->iWeight); - $old = $img->SetLineStyle($this->link->iStyle); - $img->StyleLine($xt_old,$yt_old,$xt,$yt); - $img->SetLineStyle($old); - } - - if( $this->impuls ) { - $img->SetColor($this->color); - $img->SetLineWeight($this->weight); - $img->Line($xt,$yzero,$xt,$yt); - } - - if( !empty($this->csimtargets[$i]) ) { - if( !empty($this->csimwintargets[$i]) ) { - $this->mark->SetCSIMTarget($this->csimtargets[$i],$this->csimwintargets[$i]); - } - else { - $this->mark->SetCSIMTarget($this->csimtargets[$i]); - } - $this->mark->SetCSIMAlt($this->csimalts[$i]); - } - - if( isset($this->coords[1]) ) { - $this->mark->SetCSIMAltVal($this->coords[0][$i],$this->coords[1][$i]); - } - else { - $this->mark->SetCSIMAltVal($this->coords[0][$i],$i); - } - - $this->mark->Stroke($img,$xt,$yt); - - $this->csimareas .= $this->mark->GetCSIMAreas(); - $this->value->Stroke($img,$this->coords[0][$i],$xt,$yt); - - $xt_old = $xt; - $yt_old = $yt; - } - } - - // Framework function - function Legend($aGraph) { - if( $this->legend != "" ) { - $aGraph->legend->Add($this->legend,$this->mark->fill_color,$this->mark,0, - $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); - } - } -} // Class -/* EOF */ -?> diff --git a/#jpgraph/src/jpgraph_stock.php b/#jpgraph/src/jpgraph_stock.php deleted file mode 100644 index 88c42084..00000000 --- a/#jpgraph/src/jpgraph_stock.php +++ /dev/null @@ -1,198 +0,0 @@ -iTupleSize ) { - JpGraphError::RaiseL(21001,$this->iTupleSize); - //('Data values for Stock charts must contain an even multiple of '.$this->iTupleSize.' data points.'); - } - parent::__construct($datay,$datax); - $this->numpoints /= $this->iTupleSize; - } - //--------------- - // PUBLIC METHODS - - function SetColor($aColor,$aColor1='white',$aColor2='darkred',$aColor3='darkred') { - $this->color = $aColor; - $this->iStockColor1 = $aColor1; - $this->iStockColor2 = $aColor2; - $this->iStockColor3 = $aColor3; - } - - function SetWidth($aWidth) { - // Make sure it's odd - $this->iWidth = 2*floor($aWidth/2)+1; - } - - function HideEndLines($aHide=true) { - $this->iEndLines = !$aHide; - } - - // Gets called before any axis are stroked - function PreStrokeAdjust($graph) { - if( $this->center ) { - $a=0.5; $b=0.5; - $this->numpoints++; - } else { - $a=0; $b=0; - } - $graph->xaxis->scale->ticks->SetXLabelOffset($a); - $graph->SetTextScaleOff($b); - } - - // Method description - function Stroke($img,$xscale,$yscale) { - $n=$this->numpoints; - if( $this->center ) $n--; - if( isset($this->coords[1]) ) { - if( count($this->coords[1])!=$n ) { - JpGraphError::RaiseL(2003,count($this->coords[1]),$n); - // ("Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])." Number of Y-points:$numpoints"); - } - else { - $exist_x = true; - } - } - else { - $exist_x = false; - } - - if( $exist_x ) { - $xs=$this->coords[1][0]; - } - else { - $xs=0; - } - - $ts = $this->iTupleSize; - $this->csimareas = ''; - for( $i=0; $i<$n; ++$i) { - - //If value is NULL, then don't draw a bar at all - if ($this->coords[0][$i*$ts] === null) continue; - - if( $exist_x ) { - $x=$this->coords[1][$i]; - if ($x === null) continue; - } - else { - $x=$i; - } - $xt = $xscale->Translate($x); - - $neg = $this->coords[0][$i*$ts] > $this->coords[0][$i*$ts+1] ; - $yopen = $yscale->Translate($this->coords[0][$i*$ts]); - $yclose = $yscale->Translate($this->coords[0][$i*$ts+1]); - $ymin = $yscale->Translate($this->coords[0][$i*$ts+2]); - $ymax = $yscale->Translate($this->coords[0][$i*$ts+3]); - - $dx = floor($this->iWidth/2); - $xl = $xt - $dx; - $xr = $xt + $dx; - - if( $neg ) { - $img->SetColor($this->iStockColor3); - } - else { - $img->SetColor($this->iStockColor1); - } - $img->FilledRectangle($xl,$yopen,$xr,$yclose); - $img->SetLineWeight($this->weight); - if( $neg ) { - $img->SetColor($this->iStockColor2); - } - else { - $img->SetColor($this->color); - } - - $img->Rectangle($xl,$yopen,$xr,$yclose); - - if( $yopen < $yclose ) { - $ytop = $yopen ; - $ybottom = $yclose ; - } - else { - $ytop = $yclose ; - $ybottom = $yopen ; - } - $img->SetColor($this->color); - $img->Line($xt,$ytop,$xt,$ymax); - $img->Line($xt,$ybottom,$xt,$ymin); - - if( $this->iEndLines ) { - $img->Line($xl,$ymax,$xr,$ymax); - $img->Line($xl,$ymin,$xr,$ymin); - } - - // A chance for subclasses to add things to the bar - // for data point i - $this->ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg); - - // Setup image maps - if( !empty($this->csimtargets[$i]) ) { - $this->csimareas.= 'csimareas .= ' href="'.$this->csimtargets[$i].'"'; - if( !empty($this->csimalts[$i]) ) { - $sval=$this->csimalts[$i]; - $this->csimareas .= " title=\"$sval\" alt=\"$sval\" "; - } - $this->csimareas.= " />\n"; - } - } - return true; - } - - // A hook for subclasses to modify the plot - function ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg) {} - -} // Class - -//=================================================== -// CLASS BoxPlot -//=================================================== -class BoxPlot extends StockPlot { - private $iPColor='black',$iNColor='white'; - - function __construct($datay,$datax=false) { - $this->iTupleSize=5; - parent::__construct($datay,$datax); - } - - function SetMedianColor($aPos,$aNeg) { - $this->iPColor = $aPos; - $this->iNColor = $aNeg; - } - - function ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg) { - if( $neg ) - $img->SetColor($this->iNColor); - else - $img->SetColor($this->iPColor); - - $y = $yscale->Translate($this->coords[0][$i*5+4]); - $img->Line($xl,$y,$xr,$y); - } -} - -/* EOF */ -?> diff --git a/#jpgraph/src/jpgraph_table.php b/#jpgraph/src/jpgraph_table.php deleted file mode 100644 index 852d78b0..00000000 --- a/#jpgraph/src/jpgraph_table.php +++ /dev/null @@ -1,1325 +0,0 @@ -iVal = new Text($aVal); - $this->iRow = $aRow; - $this->iCol = $aCol; - $this->iPRow = $aRow; // Initialiy each cell is its own parent - $this->iPCol = $aCol; - $this->iIconConstrain = array(-1,-1); - } - - function Init($aTable) { - $this->iTable = $aTable; - } - - function SetCSIMTarget($aTarget,$aAlt='',$aWinTarget='') { - $this->iCSIMtarget = $aTarget; - $this->iCSIMwintarget = $aWinTarget; - $this->iCSIMalt = $aAlt; - } - - function GetCSIMArea() { - if( $this->iCSIMtarget !== '' ) - return $this->iCSIMArea; - else - return ''; - } - - function SetImageConstrain($aType,$aVal) { - if( !in_array($aType,array(TIMG_WIDTH, TIMG_HEIGHT)) ) { - JpGraphError::RaiseL(27015); - } - $this->iIconConstrain = array($aType,$aVal); - } - - function SetCountryFlag($aFlag,$aScale=1.0,$aMix=100,$aStdSize=3) { - $this->iIcon = new IconPlot(); - $this->iIcon->SetCountryFlag($aFlag,0,0,$aScale,$aMix,$aStdSize); - } - - function SetImage($aFile,$aScale=1.0,$aMix=100) { - $this->iIcon = new IconPlot($aFile,0,0,$aScale,$aMix); - } - - function SetImageFromString($aStr,$aScale=1.0,$aMix=100) { - $this->iIcon = new IconPlot("",0,0,$aScale,$aMix); - $this->iIcon->CreateFromString($aStr); - } - - function SetRowColSpan($aRowSpan,$aColSpan) { - $this->iRowSpan = $aRowSpan; - $this->iColSpan = $aColSpan; - $this->iMerged = true; - } - - function SetMerged($aPRow,$aPCol,$aFlg=true) { - $this->iMerged = $aFlg; - $this->iPRow=$aPRow; - $this->iPCol=$aPCol; - } - - function IsMerged() { - return $this->iMerged; - } - - function SetNumberFormat($aF) { - $this->iNumberFormat = $aF; - } - - function Set($aTxt) { - $this->iVal->Set($aTxt); - } - - function SetFont($aFF,$aFS,$aFSize) { - $this->iFF = $aFF; - $this->iFS = $aFS; - $this->iFSize = $aFSize; - $this->iVal->SetFont($aFF,$aFS,$aFSize); - } - - function SetFillColor($aColor) { - $this->iBGColor=$aColor; - } - - function SetFontColor($aColor) { - $this->iFontColor=$aColor; - } - - function SetGridColor($aLeft,$aTop=null,$aBottom=null,$aRight=null) { - if( $aLeft !== null ) $this->iGridColor[0] = $aLeft; - if( $aTop !== null ) $this->iGridColor[1] = $aTop; - if( $aBottom !== null ) $this->iGridColor[2] = $aBottom; - if( $aRight !== null )$this->iGridColor[3] = $aRight; - } - - function SetGridStyle($aLeft,$aTop=null,$aBottom=null,$aRight=null) { - if( $aLeft !== null ) $this->iGridStyle[0] = $aLeft; - if( $aTop !== null ) $this->iGridStyle[1] = $aTop; - if( $aBottom !== null ) $this->iGridStyle[2] = $aBottom; - if( $aRight !== null )$this->iGridStyle[3] = $aRight; - } - - function SetGridWeight($aLeft=null,$aTop=null,$aBottom=null,$aRight=null) { - if( $aLeft !== null ) $this->iGridWeight[0] = $aLeft; - if( $aTop !== null ) $this->iGridWeight[1] = $aTop; - if( $aBottom !== null ) $this->iGridWeight[2] = $aBottom; - if( $aRight !== null ) $this->iGridWeight[3] = $aRight; - } - - function SetMargin($aLeft,$aRight,$aTop,$aBottom) { - $this->iMarginLeft=$aLeft; - $this->iMarginRight=$aRight; - $this->iMarginTop=$aTop; - $this->iMarginBottom=$aBottom; - } - - function GetWidth($aImg) { - if( $this->iIcon !== null ) { - if( $this->iIconConstrain[0] == TIMG_WIDTH ) { - $this->iIcon->SetScale(1); - $tmp = $this->iIcon->GetWidthHeight(); - $this->iIcon->SetScale($this->iIconConstrain[1]/$tmp[0]); - } - elseif( $this->iIconConstrain[0] == TIMG_HEIGHT ) { - $this->iIcon->SetScale(1); - $tmp = $this->iIcon->GetWidthHeight(); - $this->iIcon->SetScale($this->iIconConstrain[1]/$tmp[1]); - } - $tmp = $this->iIcon->GetWidthHeight(); - $iwidth = $tmp[0]; - } - else { - $iwidth=0; - } - if( $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->dir == 0 ) { - $pwidth = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->GetWidth($aImg); - } - elseif( $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->dir == 90 ) { - $pwidth = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->GetFontHeight($aImg)+2; - } - else { - $pwidth = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->GetWidth($aImg)+2; - } - - $pcolspan = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iColSpan; - return round(max($iwidth,$pwidth)/$pcolspan) + $this->iMarginLeft + $this->iMarginRight; - } - - function GetHeight($aImg) { - if( $this->iIcon !== null ) { - if( $this->iIconConstrain[0] == TIMG_WIDTH ) { - $this->iIcon->SetScale(1); - $tmp = $this->iIcon->GetWidthHeight(); - $this->iIcon->SetScale($this->iIconConstrain[1]/$tmp[0]); - } - elseif( $this->iIconConstrain[0] == TIMG_HEIGHT ) { - $this->iIcon->SetScale(1); - $tmp = $this->iIcon->GetWidthHeight(); - $this->iIcon->SetScale($this->iIconConstrain[1]/$tmp[1]); - } - $tmp = $this->iIcon->GetWidthHeight(); - $iheight = $tmp[1]; - } - else { - $iheight = 0; - } - if( $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->dir == 0 ) { - $pheight = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->GetHeight($aImg); - } - else { - $pheight = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->GetHeight($aImg)+1; - } - $prowspan = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iRowSpan; - return round(max($iheight,$pheight)/$prowspan) + $this->iMarginTop + $this->iMarginBottom; - } - - function SetAlign($aHorAlign='left',$aVertAlign='bottom') { - $aHorAlign = strtolower($aHorAlign); - $aVertAlign = strtolower($aVertAlign); - $chk = array('left','right','center','bottom','top','middle'); - if( !in_array($aHorAlign,$chk) || !in_array($aVertAlign,$chk) ) { - JpGraphError::RaiseL(27011,$aHorAlign,$aVertAlign); - } - $this->iVertAlign = $aVertAlign; - $this->iHorAlign = $aHorAlign; - } - - function AdjustMarginsForGrid() { - if( $this->iCol > 0 ) { - switch( $this->iGridStyle[0] ) { - case TGRID_SINGLE: $wf=1; break; - case TGRID_DOUBLE: $wf=3; break; - case TGRID_DOUBLE2: $wf=4; break; - } - $this->iMarginLeft += $this->iGridWeight[0]*$wf; - } - if( $this->iRow > 0 ) { - switch( $this->iGridStyle[1] ) { - case TGRID_SINGLE: $wf=1; break; - case TGRID_DOUBLE: $wf=3; break; - case TGRID_DOUBLE2: $wf=4; break; - } - $this->iMarginTop += $this->iGridWeight[1]*$wf; - } - if( $this->iRow+$this->iRowSpan-1 < $this->iTable->iSize[0]-1 ) { - switch( $this->iGridStyle[2] ) { - case TGRID_SINGLE: $wf=1; break; - case TGRID_DOUBLE: $wf=3; break; - case TGRID_DOUBLE2: $wf=4; break; - } - $this->iMarginBottom += $this->iGridWeight[2]*$wf; - } - if( $this->iCol+$this->iColSpan-1 < $this->iTable->iSize[1]-1 ) { - switch( $this->iGridStyle[3] ) { - case TGRID_SINGLE: $wf=1; break; - case TGRID_DOUBLE: $wf=3; break; - case TGRID_DOUBLE2: $wf=4; break; - } - $this->iMarginRight += $this->iGridWeight[3]*$wf; - } - } - - function StrokeVGrid($aImg,$aX,$aY,$aWidth,$aHeight,$aDir=1) { - // Left or right grid line - // For the right we increase the X-pos and for the right we decrease it. This is - // determined by the direction argument. - $idx = $aDir==1 ? 0 : 3; - - // We don't stroke the grid lines that are on the edge of the table since this is - // the place of the border. - if( ( ($this->iCol > 0 && $idx==0) || ($this->iCol+$this->iColSpan-1 < $this->iTable->iSize[1]-1 && $idx==3) ) - && $this->iGridWeight[$idx] > 0 ) { - $x = $aDir==1 ? $aX : $aX + $aWidth-1; - $y = $aY+$aHeight-1; - $aImg->SetColor($this->iGridColor[$idx]); - switch( $this->iGridStyle[$idx] ) { - case TGRID_SINGLE: - for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) - $aImg->Line($x+$i*$aDir,$aY, $x+$i*$aDir,$y); - break; - - case TGRID_DOUBLE: - for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) - $aImg->Line($x+$i*$aDir,$aY, $x+$i*$aDir,$y); - $x += $this->iGridWeight[$idx]*2; - for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) - $aImg->Line($x+$i*$aDir,$aY, $x+$i*$aDir,$y); - break; - - case TGRID_DOUBLE2: - for( $i=0; $i < $this->iGridWeight[$idx]*2; ++$i ) - $aImg->Line($x+$i*$aDir,$aY,$x+$i*$aDir,$y); - $x += $this->iGridWeight[$idx]*3; - for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) - $aImg->Line($x+$i*$aDir,$aY, $x+$i*$aDir,$y); - break; - } - } - } - - function StrokeHGrid($aImg,$aX,$aY,$aWidth,$aHeight,$aDir=1) { - // Top or bottom grid line - // For the left we increase the X-pos and for the right we decrease it. This is - // determined by the direction argument. - $idx = $aDir==1 ? 1 : 2; - - // We don't stroke the grid lines that are on the edge of the table since this is - // the place of the border. - if( ( ($this->iRow > 0 && $idx==1) || ($this->iRow+$this->iRowSpan-1 < $this->iTable->iSize[0]-1 && $idx==2) ) - && $this->iGridWeight[$idx] > 0) { - $y = $aDir==1 ? $aY : $aY+$aHeight-1; - $x = $aX+$aWidth-1; - $aImg->SetColor($this->iGridColor[$idx]); - switch( $this->iGridStyle[$idx] ) { - case TGRID_SINGLE: - for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) - $aImg->Line($aX,$y+$i, $x,$y+$i); - break; - - case TGRID_DOUBLE: - for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) - $aImg->Line($aX,$y+$i, $x,$y+$i); - $y += $this->iGridWeight[$idx]*2; - for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) - $aImg->Line($aX,$y+$i, $x,$y+$i); - break; - - case TGRID_DOUBLE2: - for( $i=0; $i < $this->iGridWeight[$idx]*2; ++$i ) - $aImg->Line($aX,$y+$i, $x,$y+$i); - $y += $this->iGridWeight[$idx]*3; - for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) - $aImg->Line($aX,$y+$i, $x,$y+$i); - break; - } - } - } - - function Stroke($aImg,$aX,$aY,$aWidth,$aHeight) { - // If this is a merged cell we only stroke if it is the parent cell. - // The parent cell holds the merged cell block - if( $this->iMerged && ($this->iRow != $this->iPRow || $this->iCol != $this->iPCol) ) { - return; - } - - if( $this->iBGColor != '' ) { - $aImg->SetColor($this->iBGColor); - $aImg->FilledRectangle($aX,$aY,$aX+$aWidth-1,$aY+$aHeight-1); - } - - $coords = $aX.','.$aY.','.($aX+$aWidth-1).','.$aY.','.($aX+$aWidth-1).','.($aY+$aHeight-1).','.$aX.','.($aY+$aHeight-1); - if( ! empty($this->iCSIMtarget) ) { - $this->iCSIMArea = 'iCSIMwintarget) ) { - $this->iCSIMArea .= " target=\"".$this->iCSIMwintarget."\""; - } - if( ! empty($this->iCSIMalt) ) { - $this->iCSIMArea .= ' alt="'.$this->iCSIMalt.'" title="'.$this->iCSIMalt."\" "; - } - $this->iCSIMArea .= " />\n"; - } - - $this->StrokeVGrid($aImg,$aX,$aY,$aWidth,$aHeight); - $this->StrokeVGrid($aImg,$aX,$aY,$aWidth,$aHeight,-1); - $this->StrokeHGrid($aImg,$aX,$aY,$aWidth,$aHeight); - $this->StrokeHGrid($aImg,$aX,$aY,$aWidth,$aHeight,-1); - - if( $this->iIcon !== null ) { - switch( $this->iHorAlign ) { - case 'left': - $x = $aX+$this->iMarginLeft; - $hanchor='left'; - break; - case 'center': - case 'middle': - $x = $aX+$this->iMarginLeft+round(($aWidth-$this->iMarginLeft-$this->iMarginRight)/2); - $hanchor='center'; - break; - case 'right': - $x = $aX+$aWidth-$this->iMarginRight-1; - $hanchor='right'; - break; - default: - JpGraphError::RaiseL(27012,$this->iHorAlign); - } - - switch( $this->iVertAlign ) { - case 'top': - $y = $aY+$this->iMarginTop; - $vanchor='top'; - break; - case 'center': - case 'middle': - $y = $aY+$this->iMarginTop+round(($aHeight-$this->iMarginTop-$this->iMarginBottom)/2); - $vanchor='center'; - break; - case 'bottom': - $y = $aY+$aHeight-1-$this->iMarginBottom; - $vanchor='bottom'; - break; - default: - JpGraphError::RaiseL(27012,$this->iVertAlign); - } - $this->iIcon->SetAnchor($hanchor,$vanchor); - $this->iIcon->_Stroke($aImg,$x,$y); - } - $this->iVal->SetColor($this->iFontColor); - $this->iVal->SetFont($this->iFF,$this->iFS,$this->iFSize); - switch( $this->iHorAlign ) { - case 'left': - $x = $aX+$this->iMarginLeft; - break; - case 'center': - case 'middle': - $x = $aX+$this->iMarginLeft+round(($aWidth-$this->iMarginLeft-$this->iMarginRight)/2); - break; - case 'right': - $x = $aX+$aWidth-$this->iMarginRight-1; - break; - default: - JpGraphError::RaiseL(27012,$this->iHorAlign); - } - // A workaround for the shortcomings in the TTF font handling in GD - // The anchor position for rotated text (=90) is to "short" so we add - // an offset based on the actual font size - if( $this->iVal->dir != 0 && $this->iVal->font_family >= 10 ) { - $aY += 4 + round($this->iVal->font_size*0.8); - } - switch( $this->iVertAlign ) { - case 'top': - $y = $aY+$this->iMarginTop; - break; - case 'center': - case 'middle': - $y = $aY+$this->iMarginTop+round(($aHeight-$this->iMarginTop-$this->iMarginBottom)/2); - //$y -= round($this->iVal->GetFontHeight($aImg)/2); - $y -= round($this->iVal->GetHeight($aImg)/2); - break; - case 'bottom': - //$y = $aY+$aHeight-1-$this->iMarginBottom-$this->iVal->GetFontHeight($aImg); - $y = $aY+$aHeight-$this->iMarginBottom-$this->iVal->GetHeight($aImg); - break; - default: - JpGraphError::RaiseL(27012,$this->iVertAlign); - } - $this->iVal->SetAlign($this->iHorAlign,'top'); - if( $this->iNumberFormat !== null && is_numeric($this->iVal->t) ) { - $this->iVal->t = sprintf($this->iNumberFormat,$this->iVal->t); - } - $this->iVal->Stroke($aImg,$x,$y); - } -} - -//--------------------------------------------------------------------- -// CLASS GTextTable -// Description: -// Graphic text table -//--------------------------------------------------------------------- -class GTextTable { - public $iCells = array(), $iSize=array(0,0); // Need to be public since they are used by the cell - private $iWidth=0, $iHeight=0; - private $iColWidth=NULL,$iRowHeight=NULL; - private $iImg=NULL; - private $iXPos=0, $iYPos=0; - private $iScaleXPos=null,$iScaleYPos=null; - private $iBGColor=''; - private $iBorderColor='black',$iBorderWeight=1; - private $iInit=false; - private $iYAnchor='top',$iXAnchor='left'; - /*----------------------------------------------------------------- - * First and second phase constructors - *----------------------------------------------------------------- - */ - function __construct() { - // Empty - } - - function Init($aRows=0,$aCols=0,$aFillText='') { - $this->iSize[0] = $aRows; - $this->iSize[1] = $aCols; - for($i=0; $i < $this->iSize[0]; ++$i) { - for($j=0; $j < $this->iSize[1]; ++$j) { - $this->iCells[$i][$j] = new GTextTableCell($aFillText,$i,$j); - $this->iCells[$i][$j]->Init($this); - } - } - $this->iInit=true; - } - - /*----------------------------------------------------------------- - * Outer border of table - *----------------------------------------------------------------- - */ - function SetBorder($aWeight=1,$aColor='black') { - $this->iBorderColor=$aColor; - $this->iBorderWeight = $aWeight; - } - - - /*----------------------------------------------------------------- - * Position in graph of table - *----------------------------------------------------------------- - */ - function SetPos($aX,$aY) { - $this->iXPos = $aX; - $this->iYPos = $aY; - } - - function SetScalePos($aX,$aY) { - $this->iScaleXPos = $aX; - $this->iScaleYPos = $aY; - } - - function SetAnchorPos($aXAnchor,$aYAnchor='top') { - $this->iXAnchor = $aXAnchor; - $this->iYAnchor = $aYAnchor; - } - - /*----------------------------------------------------------------- - * Setup country flag in a cell - *----------------------------------------------------------------- - */ - function SetCellCountryFlag($aRow,$aCol,$aFlag,$aScale=1.0,$aMix=100,$aStdSize=3) { - $this->_chkR($aRow); - $this->_chkC($aCol); - $this->iCells[$aRow][$aCol]->SetCountryFlag($aFlag,$aScale,$aMix,$aStdSize); - - } - - /*----------------------------------------------------------------- - * Setup image in a cell - *----------------------------------------------------------------- - */ - function SetCellImage($aRow,$aCol,$aFile,$aScale=1.0,$aMix=100) { - $this->_chkR($aRow); - $this->_chkC($aCol); - $this->iCells[$aRow][$aCol]->SetImage($aFile,$aScale,$aMix); - } - - function SetRowImage($aRow,$aFile,$aScale=1.0,$aMix=100) { - $this->_chkR($aRow); - for($j=0; $j < $this->iSize[1]; ++$j) { - $this->iCells[$aRow][$j]->SetImage($aFile,$aScale,$aMix); - } - } - - function SetColImage($aCol,$aFile,$aScale=1.0,$aMix=100) { - $this->_chkC($aCol); - for($j=0; $j < $this->iSize[0]; ++$j) { - $this->iCells[$j][$aCol]->SetImage($aFile,$aScale,$aMix); - } - } - - function SetImage($aFileR1,$aScaleC1=null,$aMixR2=null,$aC2=null,$aFile=null,$aScale=1.0,$aMix=100) { - if( $aScaleC1 !== null && $aMixR2!==null && $aC2!==null && $aFile!==null ) { - $this->_chkR($aArgR1); $this->_chkC($aC1); - $this->_chkR($aR2); $this->_chkC($aC2); - } - else { - if( $aScaleC1 !== null ) $aScale = $aScaleC1; - if( $aMixR2 !== null ) $aMix = $aMixR2; - $aFile = $aFileR1; - $aMixR2 = $this->iSize[0]-1; $aFileR1 = 0; - $aC2 = $this->iSize[1]-1; $aScaleC1 = 0; - } - for($i=$aArgR1; $i <= $aR2; ++$i) { - for($j=$aC1; $j <= $aC2; ++$j) { - $this->iCells[$i][$j]->SetImage($aFile,$aScale,$aMix); - } - } - } - - function SetCellImageConstrain($aRow,$aCol,$aType,$aVal) { - $this->_chkR($aRow); - $this->_chkC($aCol); - $this->iCells[$aRow][$aCol]->SetImageConstrain($aType,$aVal); - } - - /*----------------------------------------------------------------- - * Generate a HTML version of the table - *----------------------------------------------------------------- - */ - function toString() { - $t = ''; - for($i=0; $i < $this->iSize[0]; ++$i) { - $t .= ''; - for($j=0; $j < $this->iSize[1]; ++$j) { - $t .= ''; - } - $t .= ''; - } - $t .= '
'; - if( $this->iCells[$i][$j]->iMerged ) - $t .= 'M '; - $t .= 'val='.$this->iCells[$i][$j]->iVal->t; - $t .= ' (cs='.$this->iCells[$i][$j]->iColSpan. - ', rs='.$this->iCells[$i][$j]->iRowSpan.')'; - $t .= '
'; - return $t; - } - - /*----------------------------------------------------------------- - * Specify data for table - *----------------------------------------------------------------- - */ - function Set($aArg1,$aArg2=NULL,$aArg3=NULL) { - if( $aArg2===NULL && $aArg3===NULL ) { - if( is_array($aArg1) ) { - if( is_array($aArg1[0]) ) { - $m = count($aArg1); - // Find the longest row - $n=0; - for($i=0; $i < $m; ++$i) - $n = max(count($aArg1[$i]),$n); - for($i=0; $i < $m; ++$i) { - for($j=0; $j < $n; ++$j) { - if( isset($aArg1[$i][$j]) ){ - $this->_setcell($i,$j,(string)$aArg1[$i][$j]); - } - else { - $this->_setcell($i,$j); - } - } - } - $this->iSize[0] = $m; - $this->iSize[1] = $n; - $this->iInit=true; - } - else { - JpGraphError::RaiseL(27001); - //('Illegal argument to GTextTable::Set(). Array must be 2 dimensional'); - } - } - else { - JpGraphError::RaiseL(27002); - //('Illegal argument to GTextTable::Set()'); - } - } - else { - // Must be in the form (row,col,val) - $this->_chkR($aArg1); - $this->_chkC($aArg2); - $this->_setcell($aArg1,$aArg2,(string)$aArg3); - } - } - - /*--------------------------------------------------------------------- - * Cell margin setting - *--------------------------------------------------------------------- - */ - function SetPadding($aArgR1,$aC1=null,$aR2=null,$aC2=null,$aPad=null) { - if( $aC1 !== null && $aR2!==null && $aC2!==null && $aPad!==null ) { - $this->_chkR($aArgR1); $this->_chkC($aC1); - $this->_chkR($aR2); $this->_chkC($aC2); - } - else { - $aPad = $aArgR1; - $aR2 = $this->iSize[0]-1; $aArgR1 = 0; - $aC2 = $this->iSize[1]-1; $aC1 = 0; - } - for($i=$aArgR1; $i <= $aR2; ++$i) { - for($j=$aC1; $j <= $aC2; ++$j) { - $this->iCells[$i][$j]->SetMargin($aPad,$aPad,$aPad,$aPad); - } - } - } - - function SetRowPadding($aRow,$aPad) { - $this->_chkR($aRow); - for($j=0; $j < $this->iSize[1]; ++$j) { - $this->iCells[$aRow][$j]->SetMargin($aPad,$aPad,$aPad,$aPad); - } - } - - function SetColPadding($aCol,$aPad) { - $this->_chkC($aCol); - for($j=0; $j < $this->iSize[0]; ++$j) { - $this->iCells[$j][$aCol]->SetMargin($aPad,$aPad,$aPad,$aPad); - } - } - - function SetCellPadding($aRow,$aCol,$aPad) { - $this->_chkR($aRow); - $this->_chkC($aCol); - $this->iCells[$aRow][$aCol]->SetMargin($aPad,$aPad,$aPad,$aPad); - } - - - /*--------------------------------------------------------------------- - * Cell text orientation setting - *--------------------------------------------------------------------- - */ - function SetTextOrientation($aArgR1,$aC1=null,$aR2=null,$aC2=null,$aO=null) { - if( $aC1 !== null && $aR2!==null && $aC2!==null && $aPad!==null ) { - $this->_chkR($aArgR1); $this->_chkC($aC1); - $this->_chkR($aR2); $this->_chkC($aC2); - } - else { - $aO = $aArgR1; - $aR2 = $this->iSize[0]-1; $aArgR1 = 0; - $aC2 = $this->iSize[1]-1; $aC1 = 0; - } - for($i=$aArgR1; $i <= $aR2; ++$i) { - for($j=$aC1; $j <= $aC2; ++$j) { - $this->iCells[$i][$j]->iVal->SetOrientation($aO); - } - } - } - - function SetRowTextOrientation($aRow,$aO) { - $this->_chkR($aRow); - for($j=0; $j < $this->iSize[1]; ++$j) { - $this->iCells[$aRow][$j]->iVal->SetOrientation($aO); - } - } - - function SetColTextOrientation($aCol,$aO) { - $this->_chkC($aCol); - for($j=0; $j < $this->iSize[0]; ++$j) { - $this->iCells[$j][$aCol]->iVal->SetOrientation($aO); - } - } - - function SetCellTextOrientation($aRow,$aCol,$aO) { - $this->_chkR($aRow); - $this->_chkC($aCol); - $this->iCells[$aRow][$aCol]->iVal->SetOrientation($aO); - } - - - - - /*--------------------------------------------------------------------- - * Font color setting - *--------------------------------------------------------------------- - */ - - function SetColor($aArgR1,$aC1=null,$aR2=null,$aC2=null,$aArg=null) { - if( $aC1 !== null && $aR2!==null && $aC2!==null && $aArg!==null ) { - $this->_chkR($aArgR1); $this->_chkC($aC1); - $this->_chkR($aR2); $this->_chkC($aC2); - } - else { - $aArg = $aArgR1; - $aR2 = $this->iSize[0]-1; $aArgR1 = 0; - $aC2 = $this->iSize[1]-1; $aC1 = 0; - } - for($i=$aArgR1; $i <= $aR2; ++$i) { - for($j=$aC1; $j <= $aC2; ++$j) { - $this->iCells[$i][$j]->SetFontColor($aArg); - } - } - } - - function SetRowColor($aRow,$aColor) { - $this->_chkR($aRow); - for($j=0; $j < $this->iSize[1]; ++$j) { - $this->iCells[$aRow][$j]->SetFontColor($aColor); - } - } - - function SetColColor($aCol,$aColor) { - $this->_chkC($aCol); - for($i=0; $i < $this->iSize[0]; ++$i) { - $this->iCells[$i][$aCol]->SetFontColor($aColor); - } - } - - function SetCellColor($aRow,$aCol,$aColor) { - $this->_chkR($aRow); - $this->_chkC($aCol); - $this->iCells[$aRow][$aCol]->SetFontColor($aColor); - } - - /*--------------------------------------------------------------------- - * Fill color settings - *--------------------------------------------------------------------- - */ - - function SetFillColor($aArgR1,$aC1=null,$aR2=null,$aC2=null,$aArg=null) { - if( $aC1 !== null && $aR2!==null && $aC2!==null && $aArg!==null ) { - $this->_chkR($aArgR1); $this->_chkC($aC1); - $this->_chkR($aR2); $this->_chkC($aC2); - for($i=$aArgR1; $i <= $aR2; ++$i) { - for($j=$aC1; $j <= $aC2; ++$j) { - $this->iCells[$i][$j]->SetFillColor($aArg); - } - } - } - else { - $this->iBGColor = $aArgR1; - } - } - - function SetRowFillColor($aRow,$aColor) { - $this->_chkR($aRow); - for($j=0; $j < $this->iSize[1]; ++$j) { - $this->iCells[$aRow][$j]->SetFillColor($aColor); - } - } - - function SetColFillColor($aCol,$aColor) { - $this->_chkC($aCol); - for($i=0; $i < $this->iSize[0]; ++$i) { - $this->iCells[$i][$aCol]->SetFillColor($aColor); - } - } - - function SetCellFillColor($aRow,$aCol,$aColor) { - $this->_chkR($aRow); - $this->_chkC($aCol); - $this->iCells[$aRow][$aCol]->SetFillColor($aColor); - } - - /*--------------------------------------------------------------------- - * Font family setting - *--------------------------------------------------------------------- - */ - function SetFont() { - $numargs = func_num_args(); - if( $numargs == 2 || $numargs == 3 ) { - $aFF = func_get_arg(0); - $aFS = func_get_arg(1); - if( $numargs == 3 ) - $aFSize=func_get_arg(2); - else - $aFSize=10; - $aR2 = $this->iSize[0]-1; $aR1 = 0; - $aC2 = $this->iSize[1]-1; $aC1 = 0; - - } - elseif($numargs == 6 || $numargs == 7 ) { - $aR1 = func_get_arg(0); $aC1 = func_get_arg(1); - $aR2 = func_get_arg(2); $aC2 = func_get_arg(3); - $aFF = func_get_arg(4); $aFS = func_get_arg(5); - if( $numargs == 7 ) - $aFSize=func_get_arg(6); - else - $aFSize=10; - } - else { - JpGraphError::RaiseL(27003); - //('Wrong number of arguments to GTextTable::SetColor()'); - } - $this->_chkR($aR1); $this->_chkC($aC1); - $this->_chkR($aR2); $this->_chkC($aC2); - for($i=$aR1; $i <= $aR2; ++$i) { - for($j=$aC1; $j <= $aC2; ++$j) { - $this->iCells[$i][$j]->SetFont($aFF,$aFS,$aFSize); - } - } - } - - function SetRowFont($aRow,$aFF,$aFS,$aFSize=10) { - $this->_chkR($aRow); - for($j=0; $j < $this->iSize[1]; ++$j) { - $this->iCells[$aRow][$j]->SetFont($aFF,$aFS,$aFSize); - } - } - - function SetColFont($aCol,$aFF,$aFS,$aFSize=10) { - $this->_chkC($aCol); - for($i=0; $i < $this->iSize[0]; ++$i) { - $this->iCells[$i][$aCol]->SetFont($aFF,$aFS,$aFSize); - } - } - - function SetCellFont($aRow,$aCol,$aFF,$aFS,$aFSize=10) { - $this->_chkR($aRow); - $this->_chkC($aCol); - $this->iCells[$aRow][$aCol]->SetFont($aFF,$aFS,$aFSize); - } - - /*--------------------------------------------------------------------- - * Cell align settings - *--------------------------------------------------------------------- - */ - - function SetAlign($aR1HAlign=null,$aC1VAlign=null,$aR2=null,$aC2=null,$aHArg=null,$aVArg='center') { - if( $aC1VAlign !== null && $aR2!==null && $aC2!==null && $aHArg!==null ) { - $this->_chkR($aR1HAlign); $this->_chkC($aC1VAlign); - $this->_chkR($aR2); $this->_chkC($aC2); - } - else { - if( $aR1HAlign === null ) { - JpGraphError::RaiseL(27010); - } - if( $aC1VAlign === null ) { - $aC1VAlign = 'center'; - } - $aHArg = $aR1HAlign; - $aVArg = $aC1VAlign === null ? 'center' : $aC1VAlign ; - $aR2 = $this->iSize[0]-1; $aR1HAlign = 0; - $aC2 = $this->iSize[1]-1; $aC1VAlign = 0; - } - for($i=$aR1HAlign; $i <= $aR2; ++$i) { - for($j=$aC1VAlign; $j <= $aC2; ++$j) { - $this->iCells[$i][$j]->SetAlign($aHArg,$aVArg); - } - } - } - - function SetCellAlign($aRow,$aCol,$aHorAlign,$aVertAlign='bottom') { - $this->_chkR($aRow); - $this->_chkC($aCol); - $this->iCells[$aRow][$aCol]->SetAlign($aHorAlign,$aVertAlign); - } - - function SetRowAlign($aRow,$aHorAlign,$aVertAlign='bottom') { - $this->_chkR($aRow); - for($j=0; $j < $this->iSize[1]; ++$j) { - $this->iCells[$aRow][$j]->SetAlign($aHorAlign,$aVertAlign); - } - } - - function SetColAlign($aCol,$aHorAlign,$aVertAlign='bottom') { - $this->_chkC($aCol); - for($i=0; $i < $this->iSize[0]; ++$i) { - $this->iCells[$i][$aCol]->SetAlign($aHorAlign,$aVertAlign); - } - } - - /*--------------------------------------------------------------------- - * Cell number format - *--------------------------------------------------------------------- - */ - - function SetNumberFormat($aArgR1,$aC1=null,$aR2=null,$aC2=null,$aArg=null) { - if( $aC1 !== null && $aR2!==null && $aC2!==null && $aArg!==null ) { - $this->_chkR($aArgR1); $this->_chkC($aC1); - $this->_chkR($aR2); $this->_chkC($aC2); - } - else { - $aArg = $aArgR1; - $aR2 = $this->iSize[0]-1; $aArgR1 = 0; - $aC2 = $this->iSize[1]-1; $aC1 = 0; - } - if( !is_string($aArg) ) { - JpGraphError::RaiseL(27013); // argument must be a string - } - for($i=$aArgR1; $i <= $aR2; ++$i) { - for($j=$aC1; $j <= $aC2; ++$j) { - $this->iCells[$i][$j]->SetNumberFormat($aArg); - } - } - } - - function SetRowNumberFormat($aRow,$aF) { - $this->_chkR($aRow); - if( !is_string($aF) ) { - JpGraphError::RaiseL(27013); // argument must be a string - } - for($j=0; $j < $this->iSize[1]; ++$j) { - $this->iCells[$aRow][$j]->SetNumberFormat($aF); - } - } - - function SetColNumberFormat($aCol,$aF) { - $this->_chkC($aCol); - if( !is_string($aF) ) { - JpGraphError::RaiseL(27013); // argument must be a string - } - for($i=0; $i < $this->iSize[0]; ++$i) { - $this->iCells[$i][$aCol]->SetNumberFormat($aF); - } - } - - function SetCellNumberFormat($aRow,$aCol,$aF) { - $this->_chkR($aRow); $this->_chkC($aCol); - if( !is_string($aF) ) { - JpGraphError::RaiseL(27013); // argument must be a string - } - $this->iCells[$aRow][$aCol]->SetNumberFormat($aF); - } - - /*--------------------------------------------------------------------- - * Set row and column min size - *--------------------------------------------------------------------- - */ - - function SetMinColWidth($aColWidth,$aWidth=null) { - // If there is only one argument this means that all - // columns get set to the same width - if( $aWidth===null ) { - for($i=0; $i < $this->iSize[1]; ++$i) { - $this->iColWidth[$i] = $aColWidth; - } - } - else { - $this->_chkC($aColWidth); - $this->iColWidth[$aColWidth] = $aWidth; - } - } - - function SetMinRowHeight($aRowHeight,$aHeight=null) { - // If there is only one argument this means that all - // rows get set to the same height - if( $aHeight===null ) { - for($i=0; $i < $this->iSize[0]; ++$i) { - $this->iRowHeight[$i] = $aRowHeight; - } - } - else { - $this->_chkR($aRowHeight); - $this->iRowHeight[$aRowHeight] = $aHeight; - } - } - - /*--------------------------------------------------------------------- - * Grid line settings - *--------------------------------------------------------------------- - */ - - function SetGrid($aWeight=1,$aColor='black',$aStyle=TGRID_SINGLE) { - $rc = $this->iSize[0]; - $cc = $this->iSize[1]; - for($i=0; $i < $rc; ++$i) { - for($j=0; $j < $cc; ++$j) { - $this->iCells[$i][$j]->SetGridColor($aColor,$aColor); - $this->iCells[$i][$j]->SetGridWeight($aWeight,$aWeight); - $this->iCells[$i][$j]->SetGridStyle($aStyle); - } - } - } - - function SetColGrid($aCol,$aWeight=1,$aColor='black',$aStyle=TGRID_SINGLE) { - $this->_chkC($aCol); - for($i=0; $i < $this->iSize[0]; ++$i) { - $this->iCells[$i][$aCol]->SetGridWeight($aWeight); - $this->iCells[$i][$aCol]->SetGridColor($aColor); - $this->iCells[$i][$aCol]->SetGridStyle($aStyle); - } - } - - function SetRowGrid($aRow,$aWeight=1,$aColor='black',$aStyle=TGRID_SINGLE) { - $this->_chkR($aRow); - for($j=0; $j < $this->iSize[1]; ++$j) { - $this->iCells[$aRow][$j]->SetGridWeight(NULL,$aWeight); - $this->iCells[$aRow][$j]->SetGridColor(NULL,$aColor); - $this->iCells[$aRow][$j]->SetGridStyle(NULL,$aStyle); - } - } - - /*--------------------------------------------------------------------- - * Merge cells - *--------------------------------------------------------------------- - */ - - function MergeRow($aRow,$aHAlign='center',$aVAlign='center') { - $this->_chkR($aRow); - $this->MergeCells($aRow,0,$aRow,$this->iSize[1]-1,$aHAlign,$aVAlign); - } - - function MergeCol($aCol,$aHAlign='center',$aVAlign='center') { - $this->_chkC($aCol); - $this->MergeCells(0,$aCol,$this->iSize[0]-1,$aCol,$aHAlign,$aVAlign); - } - - function MergeCells($aR1,$aC1,$aR2,$aC2,$aHAlign='center',$aVAlign='center') { - if( $aR1 > $aR2 || $aC1 > $aC2 ) { - JpGraphError::RaiseL(27004); - //('GTextTable::MergeCells(). Specified cell range to be merged is not valid.'); - } - $this->_chkR($aR1); $this->_chkC($aC1); - $this->_chkR($aR2); $this->_chkC($aC2); - $rspan = $aR2-$aR1+1; - $cspan = $aC2-$aC1+1; - // Setup the parent cell for this merged group - if( $this->iCells[$aR1][$aC1]->IsMerged() ) { - JpGraphError::RaiseL(27005,$aR1,$aC1,$aR2,$aC2); - //("Cannot merge already merged cells in the range ($aR1,$aC1), ($aR2,$aC2)"); - } - $this->iCells[$aR1][$aC1]->SetRowColSpan($rspan,$cspan); - $this->iCells[$aR1][$aC1]->SetAlign($aHAlign,$aVAlign); - for($i=$aR1; $i <= $aR2; ++$i) { - for($j=$aC1; $j <= $aC2; ++$j) { - if( ! ($i == $aR1 && $j == $aC1) ) { - if( $this->iCells[$i][$j]->IsMerged() ) { - JpGraphError::RaiseL(27005,$aR1,$aC1,$aR2,$aC2); - //("Cannot merge already merged cells in the range ($aR1,$aC1), ($aR2,$aC2)"); - } - $this->iCells[$i][$j]->SetMerged($aR1,$aC1,true); - } - } - } - } - - - /*--------------------------------------------------------------------- - * CSIM methods - *--------------------------------------------------------------------- - */ - - function SetCSIMTarget($aTarget,$aAlt=null,$aAutoTarget=false) { - $m = $this->iSize[0]; - $n = $this->iSize[1]; - $csim = ''; - for($i=0; $i < $m; ++$i) { - for($j=0; $j < $n; ++$j) { - if( $aAutoTarget ) - $t = $aTarget."?row=$i&col=$j"; - else - $t = $aTarget; - $this->iCells[$i][$j]->SetCSIMTarget($t,$aAlt); - } - } - } - - function SetCellCSIMTarget($aRow,$aCol,$aTarget,$aAlt=null) { - $this->_chkR($aRow); - $this->_chkC($aCol); - $this->iCells[$aRow][$aCol]->SetCSIMTarget($aTarget,$aAlt); - } - - /*--------------------------------------------------------------------- - * Private methods - *--------------------------------------------------------------------- - */ - - function GetCSIMAreas() { - $m = $this->iSize[0]; - $n = $this->iSize[1]; - $csim = ''; - for($i=0; $i < $m; ++$i) { - for($j=0; $j < $n; ++$j) { - $csim .= $this->iCells[$i][$j]->GetCSIMArea(); - } - } - return $csim; - } - - function _chkC($aCol) { - if( ! $this->iInit ) { - JpGraphError::Raise(27014); // Table not initialized - } - if( $aCol < 0 || $aCol >= $this->iSize[1] ) - JpGraphError::RaiseL(27006,$aCol); - //("GTextTable:\nColumn argument ($aCol) is outside specified table size."); - } - - function _chkR($aRow) { - if( ! $this->iInit ) { - JpGraphError::Raise(27014); // Table not initialized - } - if( $aRow < 0 || $aRow >= $this->iSize[0] ) - JpGraphError::RaiseL(27007,$aRow); - //("GTextTable:\nRow argument ($aRow) is outside specified table size."); - } - - function _getScalePos() { - if( $this->iScaleXPos === null || $this->iScaleYPos === null ) { - return false; - } - return array($this->iScaleXPos, $this->iScaleYPos); - } - - function _autoSizeTable($aImg) { - // Get maximum column width and row height - $m = $this->iSize[0]; - $n = $this->iSize[1]; - $w=1;$h=1; - - // Get maximum row height per row - for($i=0; $i < $m; ++$i) { - $h=0; - for($j=0; $j < $n; ++$j) { - $h = max($h,$this->iCells[$i][$j]->GetHeight($aImg)); - } - if( isset($this->iRowHeight[$i]) ) { - $this->iRowHeight[$i] = max($h,$this->iRowHeight[$i]); - } - else - $this->iRowHeight[$i] = $h; - } - - // Get maximum col width per columns - for($j=0; $j < $n; ++$j) { - $w=0; - for($i=0; $i < $m; ++$i) { - $w = max($w,$this->iCells[$i][$j]->GetWidth($aImg)); - } - if( isset($this->iColWidth[$j]) ) { - $this->iColWidth[$j] = max($w,$this->iColWidth[$j]); - } - else - $this->iColWidth[$j] = $w; - } - } - - function _setcell($aRow,$aCol,$aVal='') { - if( isset($this->iCells[$aRow][$aCol]) ) { - $this->iCells[$aRow][$aCol]->Set($aVal); - } - else { - $this->iCells[$aRow][$aCol] = new GTextTableCell((string)$aVal,$aRow,$aCol); - $this->iCells[$aRow][$aCol]->Init($this); - } - } - - function StrokeWithScale($aImg,$aXScale,$aYScale) { - if( is_numeric($this->iScaleXPos) && is_numeric($this->iScaleYPos) ) { - $x = round($aXScale->Translate($this->iScaleXPos)); - $y = round($aYScale->Translate($this->iScaleYPos)); - $this->Stroke($aImg,$x,$y); - } - else { - $this->Stroke($aImg); - } - } - - function Stroke($aImg,$aX=NULL,$aY=NULL) { - if( $aX !== NULL && $aY !== NULL ) { - $this->iXPos = $aX; - $this->iYPos = $aY; - } - - $rc = $this->iSize[0]; // row count - $cc = $this->iSize[1]; // column count - - if( $rc == 0 || $cc == 0 ) { - JpGraphError::RaiseL(27009); - } - - // Adjust margins of each cell based on the weight of the grid. Each table grid line - // is actually occupying the left side and top part of each cell. - for($j=0; $j < $cc; ++$j) { - $this->iCells[0][$j]->iMarginTop += $this->iBorderWeight; - } - for($i=0; $i < $rc; ++$i) { - $this->iCells[$i][0]->iMarginLeft += $this->iBorderWeight; - } - for($i=0; $i < $rc; ++$i) { - for($j=0; $j < $cc; ++$j) { - $this->iCells[$i][$j]->AdjustMarginsForGrid(); - } - } - - // adjust row and column size depending on cell content - $this->_autoSizeTable($aImg); - - if( $this->iSize[1] != count($this->iColWidth) || $this->iSize[0] != count($this->iRowHeight) ) { - JpGraphError::RaiseL(27008); - //('Column and row size arrays must match the dimesnions of the table'); - } - - // Find out overall table size - $width=0; - for($i=0; $i < $cc; ++$i) { - $width += $this->iColWidth[$i]; - } - $height=0; - for($i=0; $i < $rc; ++$i) { - $height += $this->iRowHeight[$i]; - } - - // Adjust the X,Y position to alway be at the top left corner - // The anchor position, i.e. how the client want to interpret the specified - // x and y coordinate must be taken into account - switch( strtolower($this->iXAnchor) ) { - case 'left' : - break; - case 'center': - $this->iXPos -= round($width/2); - break; - case 'right': - $this->iXPos -= $width; - break; - } - switch( strtolower($this->iYAnchor) ) { - case 'top' : - break; - case 'center': - case 'middle': - $this->iYPos -= round($height/2); - break; - case 'bottom': - $this->iYPos -= $height; - break; - } - - // Set the overall background color of the table if set - if( $this->iBGColor !== '' ) { - $aImg->SetColor($this->iBGColor); - $aImg->FilledRectangle($this->iXPos,$this->iYPos,$this->iXPos+$width,$this->iYPos+$height); - } - - // Stroke all cells - $rpos=$this->iYPos; - for($i=0; $i < $rc; ++$i) { - $cpos=$this->iXPos; - for($j=0; $j < $cc; ++$j) { - // Calculate width and height of this cell if it is spanning - // more than one column or row - $cwidth=0; - for( $k=0; $k < $this->iCells[$i][$j]->iColSpan; ++$k ) { - $cwidth += $this->iColWidth[$j+$k]; - } - $cheight=0; - for( $k=0; $k < $this->iCells[$i][$j]->iRowSpan; ++$k ) { - $cheight += $this->iRowHeight[$i+$k]; - } - - $this->iCells[$i][$j]->Stroke($aImg,$cpos,$rpos,$cwidth,$cheight); - $cpos += $this->iColWidth[$j]; - } - $rpos += $this->iRowHeight[$i]; - } - - // Stroke outer border - $aImg->SetColor($this->iBorderColor); - if( $this->iBorderWeight == 1 ) - $aImg->Rectangle($this->iXPos,$this->iYPos,$this->iXPos+$width,$this->iYPos+$height); - else { - for( $i=0; $i < $this->iBorderWeight; ++$i ) - $aImg->Rectangle($this->iXPos+$i,$this->iYPos+$i, - $this->iXPos+$width-1+$this->iBorderWeight-$i, - $this->iYPos+$height-1+$this->iBorderWeight-$i); - } - } -} - -/* - EOF - */ -?> diff --git a/#jpgraph/src/jpgraph_text.inc.php b/#jpgraph/src/jpgraph_text.inc.php deleted file mode 100644 index 7d0f6687..00000000 --- a/#jpgraph/src/jpgraph_text.inc.php +++ /dev/null @@ -1,327 +0,0 @@ -t = $aTxt; - $this->x = round($aXAbsPos); - $this->y = round($aYAbsPos); - $this->margin = 0; - } - //--------------- - // PUBLIC METHODS - // Set the string in the text object - function Set($aTxt) { - $this->t = $aTxt; - } - - // Alias for Pos() - function SetPos($aXAbsPos=0,$aYAbsPos=0,$aHAlign="left",$aVAlign="top") { - //$this->Pos($aXAbsPos,$aYAbsPos,$aHAlign,$aVAlign); - $this->x = $aXAbsPos; - $this->y = $aYAbsPos; - $this->halign = $aHAlign; - $this->valign = $aVAlign; - } - - function SetScalePos($aX,$aY) { - $this->iScalePosX = $aX; - $this->iScalePosY = $aY; - } - - // Specify alignment for the text - function Align($aHAlign,$aVAlign="top",$aParagraphAlign="") { - $this->halign = $aHAlign; - $this->valign = $aVAlign; - if( $aParagraphAlign != "" ) - $this->paragraph_align = $aParagraphAlign; - } - - // Alias - function SetAlign($aHAlign,$aVAlign="top",$aParagraphAlign="") { - $this->Align($aHAlign,$aVAlign,$aParagraphAlign); - } - - // Specifies the alignment for a multi line text - function ParagraphAlign($aAlign) { - $this->paragraph_align = $aAlign; - } - - // Specifies the alignment for a multi line text - function SetParagraphAlign($aAlign) { - $this->paragraph_align = $aAlign; - } - - function SetShadow($aShadowColor='gray',$aShadowWidth=3) { - $this->ishadowwidth=$aShadowWidth; - $this->shadow=$aShadowColor; - $this->boxed=true; - } - - function SetWordWrap($aCol) { - $this->iWordwrap = $aCol ; - } - - // Specify that the text should be boxed. fcolor=frame color, bcolor=border color, - // $shadow=drop shadow should be added around the text. - function SetBox($aFrameColor=array(255,255,255),$aBorderColor=array(0,0,0),$aShadowColor=false,$aCornerRadius=4,$aShadowWidth=3) { - if( $aFrameColor === false ) { - $this->boxed=false; - } - else { - $this->boxed=true; - } - $this->fcolor=$aFrameColor; - $this->bcolor=$aBorderColor; - // For backwards compatibility when shadow was just true or false - if( $aShadowColor === true ) { - $aShadowColor = 'gray'; - } - $this->shadow=$aShadowColor; - $this->icornerradius=$aCornerRadius; - $this->ishadowwidth=$aShadowWidth; - } - - function SetBox2($aFrameColor=array(255,255,255),$aBorderColor=array(0,0,0),$aShadowColor=false,$aCornerRadius=4,$aShadowWidth=3) { - $this->iBoxType=2; - $this->SetBox($aFrameColor,$aBorderColor,$aShadowColor,$aCornerRadius,$aShadowWidth); - } - - // Hide the text - function Hide($aHide=true) { - $this->hide=$aHide; - } - - // This looks ugly since it's not a very orthogonal design - // but I added this "inverse" of Hide() to harmonize - // with some classes which I designed more recently (especially) - // jpgraph_gantt - function Show($aShow=true) { - $this->hide=!$aShow; - } - - // Specify font - function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) { - $this->font_family=$aFamily; - $this->font_style=$aStyle; - $this->font_size=$aSize; - } - - // Center the text between $left and $right coordinates - function Center($aLeft,$aRight,$aYAbsPos=false) { - $this->x = $aLeft + ($aRight-$aLeft )/2; - $this->halign = "center"; - if( is_numeric($aYAbsPos) ) - $this->y = $aYAbsPos; - } - - // Set text color - function SetColor($aColor) { - $this->color = $aColor; - } - - function SetAngle($aAngle) { - $this->SetOrientation($aAngle); - } - - // Orientation of text. Note only TTF fonts can have an arbitrary angle - function SetOrientation($aDirection=0) { - if( is_numeric($aDirection) ) - $this->dir=$aDirection; - elseif( $aDirection=="h" ) - $this->dir = 0; - elseif( $aDirection=="v" ) - $this->dir = 90; - else - JpGraphError::RaiseL(25051);//(" Invalid direction specified for text."); - } - - // Total width of text - function GetWidth($aImg) { - $aImg->SetFont($this->font_family,$this->font_style,$this->raw_font_size); - $w = $aImg->GetTextWidth($this->t,$this->dir); - return $w; - } - - // Hight of font - function GetFontHeight($aImg) { - $aImg->SetFont($this->font_family,$this->font_style,$this->raw_font_size); - $h = $aImg->GetFontHeight(); - return $h; - - } - - function GetTextHeight($aImg) { - $aImg->SetFont($this->font_family,$this->font_style,$this->raw_font_size); - $h = $aImg->GetTextHeight($this->t,$this->dir); - return $h; - } - - function GetHeight($aImg) { - // Synonym for GetTextHeight() - $aImg->SetFont($this->font_family,$this->font_style,$this->raw_font_size); - $h = $aImg->GetTextHeight($this->t,$this->dir); - return $h; - } - - // Set the margin which will be interpretated differently depending - // on the context. - function SetMargin($aMarg) { - $this->margin = $aMarg; - } - - function StrokeWithScale($aImg,$axscale,$ayscale) { - if( $this->iScalePosX === null || $this->iScalePosY === null ) { - $this->Stroke($aImg); - } - else { - $this->Stroke($aImg, - round($axscale->Translate($this->iScalePosX)), - round($ayscale->Translate($this->iScalePosY))); - } - } - - function SetCSIMTarget($aURITarget,$aAlt='',$aWinTarget='') { - $this->iCSIMtarget = $aURITarget; - $this->iCSIMalt = $aAlt; - $this->iCSIMWinTarget = $aWinTarget; - } - - function GetCSIMareas() { - if( $this->iCSIMtarget !== '' ) { - return $this->iCSIMarea; - } - else { - return ''; - } - } - - // Display text in image - function Stroke($aImg,$x=null,$y=null) { - - if( $x !== null ) $this->x = round($x); - if( $y !== null ) $this->y = round($y); - - // Insert newlines - if( $this->iWordwrap > 0 ) { - $this->t = wordwrap($this->t,$this->iWordwrap,"\n"); - } - - // If position been given as a fraction of the image size - // calculate the absolute position - if( $this->x < 1 && $this->x > 0 ) $this->x *= $aImg->width; - if( $this->y < 1 && $this->y > 0 ) $this->y *= $aImg->height; - - $aImg->PushColor($this->color); - $aImg->SetFont($this->font_family,$this->font_style,$this->raw_font_size); - $aImg->SetTextAlign($this->halign,$this->valign); - - if( $this->boxed ) { - if( $this->fcolor=="nofill" ) { - $this->fcolor=false; - } - - $oldweight=$aImg->SetLineWeight(1); - - if( $this->iBoxType == 2 && $this->font_family > FF_FONT2+2 ) { - - $bbox = $aImg->StrokeBoxedText2($this->x, $this->y, - $this->t, $this->dir, - $this->fcolor, - $this->bcolor, - $this->shadow, - $this->paragraph_align, - 2,4, - $this->icornerradius, - $this->ishadowwidth); - } - else { - $bbox = $aImg->StrokeBoxedText($this->x,$this->y,$this->t, - $this->dir,$this->fcolor,$this->bcolor,$this->shadow, - $this->paragraph_align,3,3,$this->icornerradius, - $this->ishadowwidth); - } - - $aImg->SetLineWeight($oldweight); - } - else { - $debug=false; - $bbox = $aImg->StrokeText($this->x,$this->y,$this->t,$this->dir,$this->paragraph_align,$debug); - } - - // Create CSIM targets - $coords = $bbox[0].','.$bbox[1].','.$bbox[2].','.$bbox[3].','.$bbox[4].','.$bbox[5].','.$bbox[6].','.$bbox[7]; - $this->iCSIMarea = "iCSIMtarget)."\" "; - if( trim($this->iCSIMalt) != '' ) { - $this->iCSIMarea .= " alt=\"".$this->iCSIMalt."\" "; - $this->iCSIMarea .= " title=\"".$this->iCSIMalt."\" "; - } - if( trim($this->iCSIMWinTarget) != '' ) { - $this->iCSIMarea .= " target=\"".$this->iCSIMWinTarget."\" "; - } - $this->iCSIMarea .= " />\n"; - - $aImg->PopColor($this->color); - } - - function __get($name) { - - if (strpos($name, 'raw_') !== false) { - // if $name == 'raw_left_margin' , return $this->_left_margin; - $variable_name = '_' . str_replace('raw_', '', $name); - return $this->$variable_name; - } - - $variable_name = '_' . $name; - - if (isset($this->$variable_name)) { - return $this->$variable_name * SUPERSAMPLING_SCALE; - } else { - JpGraphError::RaiseL('25132', $name); - } - } - - function __set($name, $value) { - $this->{'_'.$name} = $value; - } -} // Class - - -?> diff --git a/#jpgraph/src/jpgraph_theme.inc.php b/#jpgraph/src/jpgraph_theme.inc.php deleted file mode 100644 index 0cc54c47..00000000 --- a/#jpgraph/src/jpgraph_theme.inc.php +++ /dev/null @@ -1,136 +0,0 @@ -color_index = 0; - } - /** - * - */ - abstract function GetColorList(); - - /** - * - */ - abstract function ApplyPlot($plot); - - - /** - * - */ - function SetupPlot($plot) { - if (is_array($plot)) { - foreach ($plot as $obj) { - $this->ApplyPlot($obj); - } - } else { - $this->ApplyPlot($plot); - } - } - - /** - * - */ - function ApplyGraph($graph) { - - $this->graph = $graph; - $method_name = ''; - - if (get_class($graph) == 'Graph') { - $method_name = 'SetupGraph'; - } else { - $method_name = 'Setup' . get_class($graph); - } - - if (method_exists($this, $method_name)) { - $this->$method_name($graph); - } else { - JpGraphError::RaiseL(30001, $method_name, $method_name); //Theme::%s() is not defined. \nPlease make %s(\$graph) function in your theme classs. - } - } - - /** - * - */ - function PreStrokeApply($graph) { - } - - /** - * - */ - function GetThemeColors($num = 30) { - $result_list = array(); - - $old_index = $this->color_index; - $this->color_index = 0; - $count = 0; - - $i = 0; - while (true) { - for ($j = 0; $j < count($this->GetColorList()); $j++) { - if (++$count > $num) { - break 2; - } - $result_list[] = $this->GetNextColor(); - } - $i++; - } - - $this->color_index = $old_index; - - return $result_list; - } - - /** - * - */ - function GetNextColor() { - $color_list = $this->GetColorList(); - - $color = null; - if (isset($color_list[$this->color_index])) { - $color = $color_list[$this->color_index]; - } else { - $color_count = count($color_list); - if ($color_count <= $this->color_index) { - $color_tmp = $color_list[$this->color_index % $color_count]; - $brightness = 1.0 - intval($this->color_index / $color_count) * 0.2; - $rgb = new RGB(); - $color = $color_tmp . ':' . $brightness; - $color = $rgb->Color($color); - $alpha = array_pop($color); - $color = $rgb->tryHexConversion($color); - if ($alpha) { - $color .= '@' . $alpha; - } - } - } - - $this->color_index++; - - return $color; - } - -} // Class - -?> diff --git a/#jpgraph/src/jpgraph_ttf.inc.php b/#jpgraph/src/jpgraph_ttf.inc.php deleted file mode 100644 index 5a1bc3e2..00000000 --- a/#jpgraph/src/jpgraph_ttf.inc.php +++ /dev/null @@ -1,631 +0,0 @@ -g2312 == null ) { - include_once 'jpgraph_gb2312.php' ; - $this->g2312 = new GB2312toUTF8(); - } - return $this->g2312->gb2utf8($aTxt); - } - elseif( $aFF === FF_BIG5 ) { - if( !function_exists('iconv') ) { - JpGraphError::RaiseL(25006); - //('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).'); - } - return iconv('BIG5','UTF-8',$aTxt); - } - elseif( ASSUME_EUCJP_ENCODING && - ($aFF == FF_MINCHO || $aFF == FF_GOTHIC || $aFF == FF_PMINCHO || $aFF == FF_PGOTHIC) ) { - if( !function_exists('mb_convert_encoding') ) { - JpGraphError::RaiseL(25127); - } - return mb_convert_encoding($aTxt, 'UTF-8','EUC-JP'); - } - elseif( $aFF == FF_DAVID || $aFF == FF_MIRIAM || $aFF == FF_AHRON ) { - return LanguageConv::heb_iso2uni($aTxt); - } - else - return $aTxt; - } - - // Translate iso encoding to unicode - public static function iso2uni ($isoline){ - $uniline=''; - for ($i=0; $i < strlen($isoline); $i++){ - $thischar=substr($isoline,$i,1); - $charcode=ord($thischar); - $uniline.=($charcode>175) ? "&#" . (1040+($charcode-176)). ";" : $thischar; - } - return $uniline; - } - - // Translate greek iso encoding to unicode - public static function gr_iso2uni ($isoline) { - $uniline=''; - for ($i=0; $i < strlen($isoline); $i++) { - $thischar=substr($isoline,$i,1); - $charcode=ord($thischar); - $uniline.=($charcode>179 && $charcode!=183 && $charcode!=187 && $charcode!=189) ? "&#" . (900+($charcode-180)). ";" : $thischar; - } - return $uniline; - } - - // Translate greek win encoding to unicode - public static function gr_win2uni ($winline) { - $uniline=''; - for ($i=0; $i < strlen($winline); $i++) { - $thischar=substr($winline,$i,1); - $charcode=ord($thischar); - if ($charcode==161 || $charcode==162) { - $uniline.="&#" . (740+$charcode). ";"; - } - else { - $uniline.=(($charcode>183 && $charcode!=187 && $charcode!=189) || $charcode==180) ? "&#" . (900+($charcode-180)). ";" : $thischar; - } - } - return $uniline; - } - - public static function heb_iso2uni($isoline) { - $isoline = hebrev($isoline); - $o = ''; - - $n = strlen($isoline); - for($i=0; $i < $n; $i++) { - $c=ord( substr($isoline,$i,1) ); - $o .= ($c > 223) && ($c < 251) ? '&#'.(1264+$c).';' : chr($c); - } - return utf8_encode($o); - } -} - -//============================================================= -// CLASS TTF -// Description: Handle TTF font names and mapping and loading of -// font files -//============================================================= -class TTF { - private $font_files,$style_names; - - function __construct() { - - // String names for font styles to be used in error messages - $this->style_names=array( - FS_NORMAL =>'normal', - FS_BOLD =>'bold', - FS_ITALIC =>'italic', - FS_BOLDITALIC =>'bolditalic'); - - // File names for available fonts - $this->font_files=array( - FF_COURIER => array(FS_NORMAL =>'cour.ttf', - FS_BOLD =>'courbd.ttf', - FS_ITALIC =>'couri.ttf', - FS_BOLDITALIC =>'courbi.ttf' ), - FF_GEORGIA => array(FS_NORMAL =>'georgia.ttf', - FS_BOLD =>'georgiab.ttf', - FS_ITALIC =>'georgiai.ttf', - FS_BOLDITALIC =>'' ), - FF_TREBUCHE =>array(FS_NORMAL =>'trebuc.ttf', - FS_BOLD =>'trebucbd.ttf', - FS_ITALIC =>'trebucit.ttf', - FS_BOLDITALIC =>'trebucbi.ttf' ), - FF_VERDANA => array(FS_NORMAL =>'verdana.ttf', - FS_BOLD =>'verdanab.ttf', - FS_ITALIC =>'verdanai.ttf', - FS_BOLDITALIC =>'' ), - FF_TIMES => array(FS_NORMAL =>'times.ttf', - FS_BOLD =>'timesbd.ttf', - FS_ITALIC =>'timesi.ttf', - FS_BOLDITALIC =>'timesbi.ttf' ), - FF_COMIC => array(FS_NORMAL =>'comic.ttf', - FS_BOLD =>'comicbd.ttf', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - FF_ARIAL => array(FS_NORMAL =>'arial.ttf', - FS_BOLD =>'arialbd.ttf', - FS_ITALIC =>'ariali.ttf', - FS_BOLDITALIC =>'arialbi.ttf' ) , - FF_VERA => array(FS_NORMAL =>'Vera.ttf', - FS_BOLD =>'VeraBd.ttf', - FS_ITALIC =>'VeraIt.ttf', - FS_BOLDITALIC =>'VeraBI.ttf' ), - FF_VERAMONO => array(FS_NORMAL =>'VeraMono.ttf', - FS_BOLD =>'VeraMoBd.ttf', - FS_ITALIC =>'VeraMoIt.ttf', - FS_BOLDITALIC =>'VeraMoBI.ttf' ), - FF_VERASERIF=> array(FS_NORMAL =>'VeraSe.ttf', - FS_BOLD =>'VeraSeBd.ttf', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ) , - - /* Chinese fonts */ - FF_SIMSUN => array( - FS_NORMAL =>'simsun.ttc', - FS_BOLD =>'simhei.ttf', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - FF_CHINESE => array( - FS_NORMAL =>CHINESE_TTF_FONT, - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - FF_BIG5 => array( - FS_NORMAL =>CHINESE_TTF_FONT, - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - /* Japanese fonts */ - FF_MINCHO => array( - FS_NORMAL =>MINCHO_TTF_FONT, - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - FF_PMINCHO => array( - FS_NORMAL =>PMINCHO_TTF_FONT, - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - FF_GOTHIC => array( - FS_NORMAL =>GOTHIC_TTF_FONT, - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - FF_PGOTHIC => array( - FS_NORMAL =>PGOTHIC_TTF_FONT, - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - /* Hebrew fonts */ - FF_DAVID => array( - FS_NORMAL =>'DAVIDNEW.TTF', - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - FF_MIRIAM => array( - FS_NORMAL =>'MRIAMY.TTF', - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - FF_AHRON => array( - FS_NORMAL =>'ahronbd.ttf', - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - /* Misc fonts */ - FF_DIGITAL => array( - FS_NORMAL =>'DIGIRU__.TTF', - FS_BOLD =>'Digirtu_.ttf', - FS_ITALIC =>'Digir___.ttf', - FS_BOLDITALIC =>'DIGIRT__.TTF' ), - - /* This is an experimental font for the speedometer development - FF_SPEEDO => array( - FS_NORMAL =>'Speedo.ttf', - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - */ - - FF_COMPUTER => array( - FS_NORMAL =>'COMPUTER.TTF', - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - FF_CALCULATOR => array( - FS_NORMAL =>'Triad_xs.ttf', - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - /* Dejavu fonts */ - FF_DV_SANSSERIF => array( - FS_NORMAL =>array('DejaVuSans.ttf'), - FS_BOLD =>array('DejaVuSans-Bold.ttf','DejaVuSansBold.ttf'), - FS_ITALIC =>array('DejaVuSans-Oblique.ttf','DejaVuSansOblique.ttf'), - FS_BOLDITALIC =>array('DejaVuSans-BoldOblique.ttf','DejaVuSansBoldOblique.ttf') ), - - FF_DV_SANSSERIFMONO => array( - FS_NORMAL =>array('DejaVuSansMono.ttf','DejaVuMonoSans.ttf'), - FS_BOLD =>array('DejaVuSansMono-Bold.ttf','DejaVuMonoSansBold.ttf'), - FS_ITALIC =>array('DejaVuSansMono-Oblique.ttf','DejaVuMonoSansOblique.ttf'), - FS_BOLDITALIC =>array('DejaVuSansMono-BoldOblique.ttf','DejaVuMonoSansBoldOblique.ttf') ), - - FF_DV_SANSSERIFCOND => array( - FS_NORMAL =>array('DejaVuSansCondensed.ttf','DejaVuCondensedSans.ttf'), - FS_BOLD =>array('DejaVuSansCondensed-Bold.ttf','DejaVuCondensedSansBold.ttf'), - FS_ITALIC =>array('DejaVuSansCondensed-Oblique.ttf','DejaVuCondensedSansOblique.ttf'), - FS_BOLDITALIC =>array('DejaVuSansCondensed-BoldOblique.ttf','DejaVuCondensedSansBoldOblique.ttf') ), - - FF_DV_SERIF => array( - FS_NORMAL =>array('DejaVuSerif.ttf'), - FS_BOLD =>array('DejaVuSerif-Bold.ttf','DejaVuSerifBold.ttf'), - FS_ITALIC =>array('DejaVuSerif-Italic.ttf','DejaVuSerifItalic.ttf'), - FS_BOLDITALIC =>array('DejaVuSerif-BoldItalic.ttf','DejaVuSerifBoldItalic.ttf') ), - - FF_DV_SERIFCOND => array( - FS_NORMAL =>array('DejaVuSerifCondensed.ttf','DejaVuCondensedSerif.ttf'), - FS_BOLD =>array('DejaVuSerifCondensed-Bold.ttf','DejaVuCondensedSerifBold.ttf'), - FS_ITALIC =>array('DejaVuSerifCondensed-Italic.ttf','DejaVuCondensedSerifItalic.ttf'), - FS_BOLDITALIC =>array('DejaVuSerifCondensed-BoldItalic.ttf','DejaVuCondensedSerifBoldItalic.ttf') ), - - - /* Placeholders for defined fonts */ - FF_USERFONT1 => array( - FS_NORMAL =>'', - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - FF_USERFONT2 => array( - FS_NORMAL =>'', - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - FF_USERFONT3 => array( - FS_NORMAL =>'', - FS_BOLD =>'', - FS_ITALIC =>'', - FS_BOLDITALIC =>'' ), - - ); - } - - //--------------- - // PUBLIC METHODS - // Create the TTF file from the font specification - function File($family,$style=FS_NORMAL) { - $fam = @$this->font_files[$family]; - if( !$fam ) { - JpGraphError::RaiseL(25046,$family);//("Specified TTF font family (id=$family) is unknown or does not exist. Please note that TTF fonts are not distributed with JpGraph for copyright reasons. You can find the MS TTF WEB-fonts (arial, courier etc) for download at http://corefonts.sourceforge.net/"); - } - $ff = @$fam[$style]; - - // There are several optional file names. They are tried in order - // and the first one found is used - if( !is_array($ff) ) { - $ff = array($ff); - } - - $jpgraph_font_dir = dirname(__FILE__).'/fonts/'; - - foreach ($ff as $font_file) { - // All font families are guaranteed to have the normal style - - if( $font_file==='' ) - JpGraphError::RaiseL(25047,$this->style_names[$style],$this->font_files[$family][FS_NORMAL]);//('Style "'.$this->style_names[$style].'" is not available for font family '.$this->font_files[$family][FS_NORMAL].'.'); - if( !$font_file ) { - JpGraphError::RaiseL(25048,$fam);//("Unknown font style specification [$fam]."); - } - - // check jpgraph/src/fonts dir - $jpgraph_font_file = $jpgraph_font_dir . $font_file; - if (file_exists($jpgraph_font_file) === true && is_readable($jpgraph_font_file) === true) { - $font_file = $jpgraph_font_file; - break; - } - - // check OS font dir - if ($family >= FF_MINCHO && $family <= FF_PGOTHIC) { - $font_file = MBTTF_DIR.$font_file; - } else { - $font_file = TTF_DIR.$font_file; - } - if (file_exists($font_file) === true && is_readable($font_file) === true) { - break; - } - } - - if( !file_exists($font_file) ) { - JpGraphError::RaiseL(25049,$font_file);//("Font file \"$font_file\" is not readable or does not exist."); - } - - return $font_file; - } - - function SetUserFont($aNormal,$aBold='',$aItalic='',$aBoldIt='') { - $this->font_files[FF_USERFONT] = - array(FS_NORMAL => $aNormal, - FS_BOLD => $aBold, - FS_ITALIC => $aItalic, - FS_BOLDITALIC => $aBoldIt ) ; - } - - function SetUserFont1($aNormal,$aBold='',$aItalic='',$aBoldIt='') { - $this->font_files[FF_USERFONT1] = - array(FS_NORMAL => $aNormal, - FS_BOLD => $aBold, - FS_ITALIC => $aItalic, - FS_BOLDITALIC => $aBoldIt ) ; - } - - function SetUserFont2($aNormal,$aBold='',$aItalic='',$aBoldIt='') { - $this->font_files[FF_USERFONT2] = - array(FS_NORMAL => $aNormal, - FS_BOLD => $aBold, - FS_ITALIC => $aItalic, - FS_BOLDITALIC => $aBoldIt ) ; - } - - function SetUserFont3($aNormal,$aBold='',$aItalic='',$aBoldIt='') { - $this->font_files[FF_USERFONT3] = - array(FS_NORMAL => $aNormal, - FS_BOLD => $aBold, - FS_ITALIC => $aItalic, - FS_BOLDITALIC => $aBoldIt ) ; - } - -} // Class - - -//============================================================================= -// CLASS SymChar -// Description: Code values for some commonly used characters that -// normally isn't available directly on the keyboard, for example -// mathematical and greek symbols. -//============================================================================= -class SymChar { - static function Get($aSymb,$aCapital=FALSE) { - $iSymbols = array( - /* Greek */ - array('alpha','03B1','0391'), - array('beta','03B2','0392'), - array('gamma','03B3','0393'), - array('delta','03B4','0394'), - array('epsilon','03B5','0395'), - array('zeta','03B6','0396'), - array('ny','03B7','0397'), - array('eta','03B8','0398'), - array('theta','03B8','0398'), - array('iota','03B9','0399'), - array('kappa','03BA','039A'), - array('lambda','03BB','039B'), - array('mu','03BC','039C'), - array('nu','03BD','039D'), - array('xi','03BE','039E'), - array('omicron','03BF','039F'), - array('pi','03C0','03A0'), - array('rho','03C1','03A1'), - array('sigma','03C3','03A3'), - array('tau','03C4','03A4'), - array('upsilon','03C5','03A5'), - array('phi','03C6','03A6'), - array('chi','03C7','03A7'), - array('psi','03C8','03A8'), - array('omega','03C9','03A9'), - /* Money */ - array('euro','20AC'), - array('yen','00A5'), - array('pound','20A4'), - /* Math */ - array('approx','2248'), - array('neq','2260'), - array('not','2310'), - array('def','2261'), - array('inf','221E'), - array('sqrt','221A'), - array('int','222B'), - /* Misc */ - array('copy','00A9'), - array('para','00A7'), - array('tm','2122'), /* Trademark symbol */ - array('rtm','00AE'), /* Registered trademark */ - array('degree','00b0'), - array('lte','2264'), /* Less than or equal */ - array('gte','2265'), /* Greater than or equal */ - - ); - - $n = count($iSymbols); - $i=0; - $found = false; - $aSymb = strtolower($aSymb); - while( $i < $n && !$found ) { - $found = $aSymb === $iSymbols[$i++][0]; - } - if( $found ) { - $ca = $iSymbols[--$i]; - if( $aCapital && count($ca)==3 ) - $s = $ca[2]; - else - $s = $ca[1]; - return sprintf('&#%04d;',hexdec($s)); - } - else - return ''; - } -} - - -?> diff --git a/#jpgraph/src/jpgraph_utils.inc.php b/#jpgraph/src/jpgraph_utils.inc.php deleted file mode 100644 index f0d002c1..00000000 --- a/#jpgraph/src/jpgraph_utils.inc.php +++ /dev/null @@ -1,685 +0,0 @@ -iFunc = $aFunc; - $this->iXFunc = $aXFunc; - } - - function E($aXMin,$aXMax,$aSteps=50) { - $this->iMin = $aXMin; - $this->iMax = $aXMax; - $this->iStepSize = ($aXMax-$aXMin)/$aSteps; - - if( $this->iXFunc != '' ) - $t = 'for($i='.$aXMin.'; $i<='.$aXMax.'; $i += '.$this->iStepSize.') {$ya[]='.$this->iFunc.';$xa[]='.$this->iXFunc.';}'; - elseif( $this->iFunc != '' ) - $t = 'for($x='.$aXMin.'; $x<='.$aXMax.'; $x += '.$this->iStepSize.') {$ya[]='.$this->iFunc.';$xa[]=$x;} $x='.$aXMax.';$ya[]='.$this->iFunc.';$xa[]=$x;'; - else - JpGraphError::RaiseL(24001);//('FuncGenerator : No function specified. '); - - @eval($t); - - // If there is an error in the function specifcation this is the only - // way we can discover that. - if( empty($xa) || empty($ya) ) - JpGraphError::RaiseL(24002);//('FuncGenerator : Syntax error in function specification '); - - return array($xa,$ya); - } -} - - -//============================================================================= -// CLASS DateScaleUtils -// Description: Help to create a manual date scale -//============================================================================= -define('DSUTILS_MONTH',1); // Major and minor ticks on a monthly basis -define('DSUTILS_MONTH1',1); // Major and minor ticks on a monthly basis -define('DSUTILS_MONTH2',2); // Major ticks on a bi-monthly basis -define('DSUTILS_MONTH3',3); // Major icks on a tri-monthly basis -define('DSUTILS_MONTH6',4); // Major on a six-monthly basis -define('DSUTILS_WEEK1',5); // Major ticks on a weekly basis -define('DSUTILS_WEEK2',6); // Major ticks on a bi-weekly basis -define('DSUTILS_WEEK4',7); // Major ticks on a quod-weekly basis -define('DSUTILS_DAY1',8); // Major ticks on a daily basis -define('DSUTILS_DAY2',9); // Major ticks on a bi-daily basis -define('DSUTILS_DAY4',10); // Major ticks on a qoud-daily basis -define('DSUTILS_YEAR1',11); // Major ticks on a yearly basis -define('DSUTILS_YEAR2',12); // Major ticks on a bi-yearly basis -define('DSUTILS_YEAR5',13); // Major ticks on a five-yearly basis - - -class DateScaleUtils { - public static $iMin=0, $iMax=0; - - private static $starthour,$startmonth, $startday, $startyear; - private static $endmonth, $endyear, $endday; - private static $tickPositions=array(),$minTickPositions=array(); - private static $iUseWeeks = true; - - static function UseWeekFormat($aFlg) { - self::$iUseWeeks = $aFlg; - } - - static function doYearly($aType,$aMinor=false) { - $i=0; $j=0; - $m = self::$startmonth; - $y = self::$startyear; - - if( self::$startday == 1 ) { - self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); - } - ++$m; - - - switch( $aType ) { - case DSUTILS_YEAR1: - for($y=self::$startyear; $y <= self::$endyear; ++$y ) { - if( $aMinor ) { - while( $m <= 12 ) { - if( !($y == self::$endyear && $m > self::$endmonth) ) { - self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); - } - ++$m; - } - $m=1; - } - self::$tickPositions[$i++] = mktime(0,0,0,1,1,$y); - } - break; - case DSUTILS_YEAR2: - $y=self::$startyear; - while( $y <= self::$endyear ) { - self::$tickPositions[$i++] = mktime(0,0,0,1,1,$y); - for($k=0; $k < 1; ++$k ) { - ++$y; - if( $aMinor ) { - self::$minTickPositions[$j++] = mktime(0,0,0,1,1,$y); - } - } - ++$y; - } - break; - case DSUTILS_YEAR5: - $y=self::$startyear; - while( $y <= self::$endyear ) { - self::$tickPositions[$i++] = mktime(0,0,0,1,1,$y); - for($k=0; $k < 4; ++$k ) { - ++$y; - if( $aMinor ) { - self::$minTickPositions[$j++] = mktime(0,0,0,1,1,$y); - } - } - ++$y; - } - break; - } - } - - static function doDaily($aType,$aMinor=false) { - $m = self::$startmonth; - $y = self::$startyear; - $d = self::$startday; - $h = self::$starthour; - $i=0;$j=0; - - if( $h == 0 ) { - self::$tickPositions[$i++] = mktime(0,0,0,$m,$d,$y); - } - $t = mktime(0,0,0,$m,$d,$y); - - switch($aType) { - case DSUTILS_DAY1: - while( $t <= self::$iMax ) { - $t = strtotime('+1 day',$t); - self::$tickPositions[$i++] = $t; - if( $aMinor ) { - self::$minTickPositions[$j++] = strtotime('+12 hours',$t); - } - } - break; - case DSUTILS_DAY2: - while( $t <= self::$iMax ) { - $t = strtotime('+1 day',$t); - if( $aMinor ) { - self::$minTickPositions[$j++] = $t; - } - $t = strtotime('+1 day',$t); - self::$tickPositions[$i++] = $t; - } - break; - case DSUTILS_DAY4: - while( $t <= self::$iMax ) { - for($k=0; $k < 3; ++$k ) { - $t = strtotime('+1 day',$t); - if( $aMinor ) { - self::$minTickPositions[$j++] = $t; - } - } - $t = strtotime('+1 day',$t); - self::$tickPositions[$i++] = $t; - } - break; - } - } - - static function doWeekly($aType,$aMinor=false) { - $hpd = 3600*24; - $hpw = 3600*24*7; - // Find out week number of min date - $thursday = self::$iMin + $hpd * (3 - (date('w', self::$iMin) + 6) % 7); - $week = 1 + (date('z', $thursday) - (11 - date('w', mktime(0, 0, 0, 1, 1, date('Y', $thursday)))) % 7) / 7; - $daynumber = date('w',self::$iMin); - if( $daynumber == 0 ) $daynumber = 7; - $m = self::$startmonth; - $y = self::$startyear; - $d = self::$startday; - $i=0;$j=0; - // The assumption is that the weeks start on Monday. If the first day - // is later in the week then the first week tick has to be on the following - // week. - if( $daynumber == 1 ) { - self::$tickPositions[$i++] = mktime(0,0,0,$m,$d,$y); - $t = mktime(0,0,0,$m,$d,$y) + $hpw; - } - else { - $t = mktime(0,0,0,$m,$d,$y) + $hpd*(8-$daynumber); - } - - switch($aType) { - case DSUTILS_WEEK1: - $cnt=0; - break; - case DSUTILS_WEEK2: - $cnt=1; - break; - case DSUTILS_WEEK4: - $cnt=3; - break; - } - while( $t <= self::$iMax ) { - self::$tickPositions[$i++] = $t; - for($k=0; $k < $cnt; ++$k ) { - $t += $hpw; - if( $aMinor ) { - self::$minTickPositions[$j++] = $t; - } - } - $t += $hpw; - } - } - - static function doMonthly($aType,$aMinor=false) { - $monthcount=0; - $m = self::$startmonth; - $y = self::$startyear; - $i=0; $j=0; - - // Skip the first month label if it is before the startdate - if( self::$startday == 1 ) { - self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); - $monthcount=1; - } - if( $aType == 1 ) { - if( self::$startday < 15 ) { - self::$minTickPositions[$j++] = mktime(0,0,0,$m,15,$y); - } - } - ++$m; - - // Loop through all the years included in the scale - for($y=self::$startyear; $y <= self::$endyear; ++$y ) { - // Loop through all the months. There are three cases to consider: - // 1. We are in the first year and must start with the startmonth - // 2. We are in the end year and we must stop at last month of the scale - // 3. A year in between where we run through all the 12 months - $stopmonth = $y == self::$endyear ? self::$endmonth : 12; - while( $m <= $stopmonth ) { - switch( $aType ) { - case DSUTILS_MONTH1: - // Set minor tick at the middle of the month - if( $aMinor ) { - if( $m <= $stopmonth ) { - if( !($y==self::$endyear && $m==$stopmonth && self::$endday < 15) ) - self::$minTickPositions[$j++] = mktime(0,0,0,$m,15,$y); - } - } - // Major at month - // Get timestamp of first hour of first day in each month - self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); - - break; - case DSUTILS_MONTH2: - if( $aMinor ) { - // Set minor tick at start of each month - self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); - } - - // Major at every second month - // Get timestamp of first hour of first day in each month - if( $monthcount % 2 == 0 ) { - self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); - } - break; - case DSUTILS_MONTH3: - if( $aMinor ) { - // Set minor tick at start of each month - self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); - } - // Major at every third month - // Get timestamp of first hour of first day in each month - if( $monthcount % 3 == 0 ) { - self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); - } - break; - case DSUTILS_MONTH6: - if( $aMinor ) { - // Set minor tick at start of each month - self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); - } - // Major at every third month - // Get timestamp of first hour of first day in each month - if( $monthcount % 6 == 0 ) { - self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); - } - break; - } - ++$m; - ++$monthcount; - } - $m=1; - } - - // For the case where all dates are within the same month - // we want to make sure we have at least two ticks on the scale - // since the scale want work properly otherwise - if(self::$startmonth == self::$endmonth && self::$startyear == self::$endyear && $aType==1 ) { - self::$tickPositions[$i++] = mktime(0 ,0 ,0, self::$startmonth + 1, 1, self::$startyear); - } - - return array(self::$tickPositions,self::$minTickPositions); - } - - static function GetTicks($aData,$aType=1,$aMinor=false,$aEndPoints=false) { - $n = count($aData); - return self::GetTicksFromMinMax($aData[0],$aData[$n-1],$aType,$aMinor,$aEndPoints); - } - - static function GetAutoTicks($aMin,$aMax,$aMaxTicks=10,$aMinor=false) { - $diff = $aMax - $aMin; - $spd = 3600*24; - $spw = $spd*7; - $spm = $spd*30; - $spy = $spd*352; - - if( self::$iUseWeeks ) - $w = 'W'; - else - $w = 'd M'; - - // Decision table for suitable scales - // First value: Main decision point - // Second value: Array of formatting depending on divisor for wanted max number of ticks. ,.. - $tt = array( - array($spw, array(1,DSUTILS_DAY1,'d M',2,DSUTILS_DAY2,'d M',-1,DSUTILS_DAY4,'d M')), - array($spm, array(1,DSUTILS_DAY1,'d M',2,DSUTILS_DAY2,'d M',4,DSUTILS_DAY4,'d M',7,DSUTILS_WEEK1,$w,-1,DSUTILS_WEEK2,$w)), - array($spy, array(1,DSUTILS_DAY1,'d M',2,DSUTILS_DAY2,'d M',4,DSUTILS_DAY4,'d M',7,DSUTILS_WEEK1,$w,14,DSUTILS_WEEK2,$w,30,DSUTILS_MONTH1,'M',60,DSUTILS_MONTH2,'M',-1,DSUTILS_MONTH3,'M')), - array(-1, array(30,DSUTILS_MONTH1,'M-Y',60,DSUTILS_MONTH2,'M-Y',90,DSUTILS_MONTH3,'M-Y',180,DSUTILS_MONTH6,'M-Y',352,DSUTILS_YEAR1,'Y',704,DSUTILS_YEAR2,'Y',-1,DSUTILS_YEAR5,'Y'))); - - $ntt = count($tt); - $nd = floor($diff/$spd); - for($i=0; $i < $ntt; ++$i ) { - if( $diff <= $tt[$i][0] || $i==$ntt-1) { - $t = $tt[$i][1]; - $n = count($t)/3; - for( $j=0; $j < $n; ++$j ) { - if( $nd/$t[3*$j] <= $aMaxTicks || $j==$n-1) { - $type = $t[3*$j+1]; - $fs = $t[3*$j+2]; - list($tickPositions,$minTickPositions) = self::GetTicksFromMinMax($aMin,$aMax,$type,$aMinor); - return array($fs,$tickPositions,$minTickPositions,$type); - } - } - } - } - } - - static function GetTicksFromMinMax($aMin,$aMax,$aType,$aMinor=false,$aEndPoints=false) { - self::$starthour = date('G',$aMin); - self::$startmonth = date('n',$aMin); - self::$startday = date('j',$aMin); - self::$startyear = date('Y',$aMin); - self::$endmonth = date('n',$aMax); - self::$endyear = date('Y',$aMax); - self::$endday = date('j',$aMax); - self::$iMin = $aMin; - self::$iMax = $aMax; - - if( $aType <= DSUTILS_MONTH6 ) { - self::doMonthly($aType,$aMinor); - } - elseif( $aType <= DSUTILS_WEEK4 ) { - self::doWeekly($aType,$aMinor); - } - elseif( $aType <= DSUTILS_DAY4 ) { - self::doDaily($aType,$aMinor); - } - elseif( $aType <= DSUTILS_YEAR5 ) { - self::doYearly($aType,$aMinor); - } - else { - JpGraphError::RaiseL(24003); - } - // put a label at the very left data pos - if( $aEndPoints ) { - $tickPositions[$i++] = $aData[0]; - } - - // put a label at the very right data pos - if( $aEndPoints ) { - $tickPositions[$i] = $aData[$n-1]; - } - - return array(self::$tickPositions,self::$minTickPositions); - } -} - -//============================================================================= -// Class ReadFileData -//============================================================================= -Class ReadFileData { - //---------------------------------------------------------------------------- - // Desciption: - // Read numeric data from a file. - // Each value should be separated by either a new line or by a specified - // separator character (default is ','). - // Before returning the data each value is converted to a proper float - // value. The routine is robust in the sense that non numeric data in the - // file will be discarded. - // - // Returns: - // The number of data values read on success, FALSE on failure - //---------------------------------------------------------------------------- - static function FromCSV($aFile,&$aData,$aSepChar=',',$aMaxLineLength=1024) { - $rh = @fopen($aFile,'r'); - if( $rh === false ) { - return false; - } - $tmp = array(); - $lineofdata = fgetcsv($rh, 1000, ','); - while ( $lineofdata !== FALSE) { - $tmp = array_merge($tmp,$lineofdata); - $lineofdata = fgetcsv($rh, $aMaxLineLength, $aSepChar); - } - fclose($rh); - - // Now make sure that all data is numeric. By default - // all data is read as strings - $n = count($tmp); - $aData = array(); - $cnt=0; - for($i=0; $i < $n; ++$i) { - if( $tmp[$i] !== "" ) { - $aData[$cnt++] = floatval($tmp[$i]); - } - } - return $cnt; - } - - //---------------------------------------------------------------------------- - // Desciption: - // Read numeric data from a file. - // Each value should be separated by either a new line or by a specified - // separator character (default is ','). - // Before returning the data each value is converted to a proper float - // value. The routine is robust in the sense that non numeric data in the - // file will be discarded. - // - // Options: - // 'separator' => ',', - // 'enclosure' => '"', - // 'readlength' => 1024, - // 'ignore_first' => false, - // 'first_as_key' => false - // 'escape' => '\', # PHP >= 5.3 only - // - // Returns: - // The number of lines read on success, FALSE on failure - //---------------------------------------------------------------------------- - static function FromCSV2($aFile, &$aData, $aOptions = array()) { - $aDefaults = array( - 'separator' => ',', - 'enclosure' => chr(34), - 'escape' => chr(92), - 'readlength' => 1024, - 'ignore_first' => false, - 'first_as_key' => false - ); - - $aOptions = array_merge( - $aDefaults, is_array($aOptions) ? $aOptions : array()); - - if( $aOptions['first_as_key'] ) { - $aOptions['ignore_first'] = true; - } - - $rh = @fopen($aFile, 'r'); - - if( $rh === false ) { - return false; - } - - $aData = array(); - $aLine = fgetcsv($rh, - $aOptions['readlength'], - $aOptions['separator'], - $aOptions['enclosure'] - /*, $aOptions['escape'] # PHP >= 5.3 only */ - ); - - // Use numeric array keys for the columns by default - // If specified use first lines values as assoc keys instead - $keys = array_keys($aLine); - if( $aOptions['first_as_key'] ) { - $keys = array_values($aLine); - } - - $num_lines = 0; - $num_cols = count($aLine); - - while ($aLine !== false) { - if( is_array($aLine) && count($aLine) != $num_cols ) { - JpGraphError::RaiseL(24004); - // 'ReadCSV2: Column count mismatch in %s line %d' - } - - // fgetcsv returns NULL for empty lines - if( !is_null($aLine) ) { - $num_lines++; - - if( !($aOptions['ignore_first'] && $num_lines == 1) && is_numeric($aLine[0]) ) { - for( $i = 0; $i < $num_cols; $i++ ) { - $aData[ $keys[$i] ][] = floatval($aLine[$i]); - } - } - } - - $aLine = fgetcsv($rh, - $aOptions['readlength'], - $aOptions['separator'], - $aOptions['enclosure'] - /*, $aOptions['escape'] # PHP >= 5.3 only*/ - ); - } - - fclose($rh); - - if( $aOptions['ignore_first'] ) { - $num_lines--; - } - - return $num_lines; - } - - // Read data from two columns in a plain text file - static function From2Col($aFile, $aCol1, $aCol2, $aSepChar=' ') { - $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); - if( $lines === false ) { - return false; - } - $s = '/[\s]+/'; - if( $aSepChar == ',' ) { - $s = '/[\s]*,[\s]*/'; - } - elseif( $aSepChar == ';' ) { - $s = '/[\s]*;[\s]*/'; - } - foreach( $lines as $line => $datarow ) { - $split = preg_split($s,$datarow); - $aCol1[] = floatval(trim($split[0])); - $aCol2[] = floatval(trim($split[1])); - } - - return count($lines); - } - - // Read data from one columns in a plain text file - static function From1Col($aFile, $aCol1) { - $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); - if( $lines === false ) { - return false; - } - foreach( $lines as $line => $datarow ) { - $aCol1[] = floatval(trim($datarow)); - } - - return count($lines); - } - - static function FromMatrix($aFile,$aSepChar=' ') { - $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); - if( $lines === false ) { - return false; - } - $mat = array(); - $reg = '/'.$aSepChar.'/'; - foreach( $lines as $line => $datarow ) { - $row = preg_split($reg,trim($datarow)); - foreach ($row as $key => $cell ) { - $row[$key] = floatval(trim($cell)); - } - $mat[] = $row; - } - return $mat; - } - - -} - -define('__LR_EPSILON', 1.0e-8); -//============================================================================= -// Class LinearRegression -//============================================================================= -class LinearRegression { - private $ix=array(),$iy=array(); - private $ib=0, $ia=0; - private $icalculated=false; - public $iDet=0, $iCorr=0, $iStdErr=0; - - public function __construct($aDataX,$aDataY) { - if( count($aDataX) !== count($aDataY) ) { - JpGraph::Raise('LinearRegression: X and Y data array must be of equal length.'); - } - $this->ix = $aDataX; - $this->iy = $aDataY; - } - - public function Calc() { - - $this->icalculated = true; - - $n = count($this->ix); - $sx2 = 0 ; - $sy2 = 0 ; - $sxy = 0 ; - $sx = 0 ; - $sy = 0 ; - - for( $i=0; $i < $n; ++$i ) { - $sx2 += $this->ix[$i] * $this->ix[$i]; - $sy2 += $this->iy[$i] * $this->iy[$i]; - $sxy += $this->ix[$i] * $this->iy[$i]; - $sx += $this->ix[$i]; - $sy += $this->iy[$i]; - } - - if( $n*$sx2 - $sx*$sx > __LR_EPSILON ) { - $this->ib = ($n*$sxy - $sx*$sy) / ( $n*$sx2 - $sx*$sx ); - $this->ia = ( $sy - $this->ib*$sx ) / $n; - - $sx = $this->ib * ( $sxy - $sx*$sy/$n ); - $sy2 = $sy2 - $sy*$sy/$n; - $sy = $sy2 - $sx; - - $this->iDet = $sx / $sy2; - $this->iCorr = sqrt($this->iDet); - if( $n > 2 ) { - $this->iStdErr = sqrt( $sy / ($n-2) ); - } - else { - $this->iStdErr = NAN ; - } - } - else { - $this->ib = 0; - $this->ia = 0; - } - - } - - public function GetAB() { - if( $this->icalculated == false ) - $this->Calc(); - return array($this->ia, $this->ib); - } - - public function GetStat() { - if( $this->icalculated == false ) - $this->Calc(); - return array($this->iStdErr, $this->iCorr, $this->iDet); - } - - public function GetY($aMinX, $aMaxX, $aStep=1) { - if( $this->icalculated == false ) - $this->Calc(); - - $yy = array(); - $i = 0; - for( $x=$aMinX; $x <= $aMaxX; $x += $aStep ) { - $xx[$i ] = $x; - $yy[$i++] = $this->ia + $this->ib * $x; - } - - return array($xx,$yy); - } - -} - -?> diff --git a/#jpgraph/src/jpgraph_windrose.php b/#jpgraph/src/jpgraph_windrose.php deleted file mode 100644 index 8eef2cbe..00000000 --- a/#jpgraph/src/jpgraph_windrose.php +++ /dev/null @@ -1,1566 +0,0 @@ -iZeroSum=0; - foreach( $aData as $idx => $legdata ) { - $legsum = array_sum($legdata); - $maxnum = max($maxnum,count($legdata)-1); - $max = max($legsum-$legdata[0],$max); - $totlegsum += $legsum; - $this->iZeroSum += $legdata[0] ; - } - if( round($totlegsum) > 100 ) { - JpGraphError::RaiseL(22001,$legsum); - //("Total percentage for all windrose legs in a windrose plot can not exceed 100% !\n(Current max is: ".$legsum.')'); - } - $this->iMax = $max ; - $this->iMaxNum = $maxnum; - $this->iNumCirc = $this->GetNumCirc(); - $this->iMaxVal = $this->iNumCirc * $this->iDelta ; - } - - // Return number of grid circles - function GetNumCirc() { - // Never return less than 1 circles - $num = ceil($this->iMax / $this->iDelta); - return max(1,$num) ; - } - - function SetMaxValue($aMax) { - $this->iMax = $aMax; - $this->iNumCirc = $this->GetNumCirc(); - $this->iMaxVal = $this->iNumCirc * $this->iDelta ; - } - - // Set step size for circular grid - function Set($aMax,$aDelta=null) { - if( $aDelta==null ) { - $this->SetMaxValue($aMax); - return; - } - $this->iDelta = $aDelta; - $this->iNumCirc = ceil($aMax/$aDelta); //$this->GetNumCirc(); - $this->iMaxVal = $this->iNumCirc * $this->iDelta ; - $this->iMax=$aMax; - // Remember that user has specified interval so don't - // do autoscaling - $this->iManualScale = true; - } - - function AutoScale($aRadius,$aMinDist=30) { - - if( $this->iManualScale ) return; - - // Make sure distance (in pixels) between two circles - // is never less than $aMinDist pixels - $tst = ceil($aRadius / $this->iNumCirc) ; - - while( $tst <= $aMinDist && $this->iDelta < 100 ) { - $this->iDelta += 5; - $tst = ceil($aRadius / $this->GetNumCirc()) ; - } - - if( $this->iDelta >= 100 ) { - JpGraphError::RaiseL(22002);//('Graph is too small to have a scale. Please make the graph larger.'); - } - - // If the distance is to large try with multiples of 2 instead - if( $tst > $aMinDist * 3 ) { - $this->iDelta = 2; - $tst = ceil($aRadius / $this->iNumCirc) ; - - while( $tst <= $aMinDist && $this->iDelta < 100 ) { - $this->iDelta += 2; - $tst = ceil($aRadius / $this->GetNumCirc()) ; - } - - if( $this->iDelta >= 100 ) { - JpGraphError::RaiseL(22002); //('Graph is too small to have a scale. Please make the graph larger.'); - } - } - - $this->iNumCirc = $this->GetNumCirc(); - $this->iMaxVal = $this->iNumCirc * $this->iDelta ; - } - - // Return max of all leg values - function GetMax() { - return $this->iMax; - } - - function Hide($aFlg=true) { - $this->iHideLabels = $aFlg; - } - - function SetAngle($aAngle) { - $this->iAngle = $aAngle ; - } - - // Translate a Leg value to radius distance - function RelTranslate($aVal,$r,$ri) { - $tv = round($aVal/$this->iMaxVal*($r-$ri)); - return $tv ; - } - - function SetLabelAlign($aAlign) { - $this->iLblAlign = $aAlign ; - } - - function SetLabelFormat($aFmt) { - $this->iLblFmt = $aFmt ; - } - - function SetLabelFillColor($aBkgColor,$aBorderColor=false) { - - $this->iFontBkgColor = $aBkgColor; - if( $aBorderColor === false ) { - $this->iFontFrameColor = $aBkgColor; - } - else { - $this->iFontFrameColor = $aBorderColor; - } - } - - function SetFontColor($aColor) { - $this->iFontColor = $aColor ; - $this->iZFontColor = $aColor ; - } - - function SetFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { - $this->iFontFamily = $aFontFamily ; - $this->iFontStyle = $aFontStyle ; - $this->iFontSize = $aFontSize ; - $this->SetZFont($aFontFamily,$aFontStyle,$aFontSize); - } - - function SetZFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { - $this->iZFontFamily = $aFontFamily ; - $this->iZFontStyle = $aFontStyle ; - $this->iZFontSize = $aFontSize ; - } - - function SetZeroLabel($aTxt) { - $this->iLblZeroTxt = $aTxt ; - } - - function SetZFontColor($aColor) { - $this->iZFontColor = $aColor ; - } - - function StrokeLabels($aImg,$xc,$yc,$ri,$rr) { - - if( $this->iHideLabels ) return; - - // Setup some convinient vairables - $a = $this->iAngle * M_PI/180.0; - $n = $this->iNumCirc; - $d = $this->iDelta; - - // Setup the font and font color - $val = new Text(); - $val->SetFont($this->iFontFamily,$this->iFontStyle,$this->iFontSize); - $val->SetColor($this->iFontColor); - - if( $this->iFontBkgColor !== false ) { - $val->SetBox($this->iFontBkgColor,$this->iFontFrameColor); - } - - // Position the labels relative to the radiant circles - if( $this->iLblAlign == LBLALIGN_TOP ) { - if( $a > 0 && $a <= M_PI/2 ) { - $val->SetAlign('left','bottom'); - } - elseif( $a > M_PI/2 && $a <= M_PI ) { - $val->SetAlign('right','bottom'); - } - } - elseif( $this->iLblAlign == LBLALIGN_CENTER ) { - $val->SetAlign('center','center'); - } - - // Stroke the labels close to each circle - $v = $d ; - $si = sin($a); - $co = cos($a); - for( $i=0; $i < $n; ++$i, $v += $d ) { - $r = $ri + ($i+1) * $rr; - $x = $xc + $co * $r; - $y = $yc - $si * $r; - $val->Set(sprintf($this->iLblFmt,$v)); - $val->Stroke($aImg,$x,$y); - } - - // Print the text in the zero circle - if( $this->iLblZeroTxt === null ) { - $this->iLblZeroTxt = sprintf($this->iLblFmt,$this->iZeroSum); - } - else { - $this->iLblZeroTxt = sprintf($this->iLblZeroTxt,$this->iZeroSum); - } - - $val->Set($this->iLblZeroTxt); - $val->SetAlign('center','center'); - $val->SetParagraphAlign('center'); - $val->SetColor($this->iZFontColor); - $val->SetFont($this->iZFontFamily,$this->iZFontStyle,$this->iZFontSize); - $val->Stroke($aImg,$xc,$yc); - } -} - -//=================================================== -// CLASS LegendStyle -//=================================================== -class LegendStyle { - public $iLength = 40, $iMargin = 20 , $iBottomMargin=5; - public $iCircleWeight=2, $iCircleRadius = 18, $iCircleColor='black'; - public $iTxtFontFamily=FF_VERDANA,$iTxtFontStyle=FS_NORMAL,$iTxtFontSize=8; - public $iLblFontFamily=FF_VERDANA,$iLblFontStyle=FS_NORMAL,$iLblFontSize=8; - public $iCircleFontFamily=FF_VERDANA,$iCircleFontStyle=FS_NORMAL,$iCircleFontSize=8; - public $iLblFontColor='black',$iTxtFontColor='black',$iCircleFontColor='black'; - public $iShow=true; - public $iFormatString='%.1f'; - public $iTxtMargin=6, $iTxt=''; - public $iZCircleTxt='Calm'; - - function SetFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { - $this->iLblFontFamily = $aFontFamily ; - $this->iLblFontStyle = $aFontStyle ; - $this->iLblFontSize = $aFontSize ; - $this->iTxtFontFamily = $aFontFamily ; - $this->iTxtFontStyle = $aFontStyle ; - $this->iTxtFontSize = $aFontSize ; - $this->iCircleFontFamily = $aFontFamily ; - $this->iCircleFontStyle = $aFontStyle ; - $this->iCircleFontSize = $aFontSize ; - } - - function SetLFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { - $this->iLblFontFamily = $aFontFamily ; - $this->iLblFontStyle = $aFontStyle ; - $this->iLblFontSize = $aFontSize ; - } - - function SetTFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { - $this->iTxtFontFamily = $aFontFamily ; - $this->iTxtFontStyle = $aFontStyle ; - $this->iTxtFontSize = $aFontSize ; - } - - function SetCFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { - $this->iCircleFontFamily = $aFontFamily ; - $this->iCircleFontStyle = $aFontStyle ; - $this->iCircleFontSize = $aFontSize ; - } - - - function SetFontColor($aColor) { - $this->iTxtFontColor = $aColor ; - $this->iLblFontColor = $aColor ; - $this->iCircleFontColor = $aColor ; - } - - function SetTFontColor($aColor) { - $this->iTxtFontColor = $aColor ; - } - - function SetLFontColor($aColor) { - $this->iLblFontColor = $aColor ; - } - - function SetCFontColor($aColor) { - $this->iCircleFontColor = $aColor ; - } - - function SetCircleWeight($aWeight) { - $this->iCircleWeight = $aWeight; - } - - function SetCircleRadius($aRadius) { - $this->iCircleRadius = $aRadius; - } - - function SetCircleColor($aColor) { - $this->iCircleColor = $aColor ; - } - - function SetCircleText($aTxt) { - $this->iZCircleTxt = $aTxt; - } - - function SetMargin($aMarg,$aBottomMargin=5) { - $this->iMargin=$aMarg; - $this->iBottomMargin=$aBottomMargin; - } - - function SetLength($aLength) { - $this->iLength = $aLength ; - } - - function Show($aFlg=true) { - $this->iShow = $aFlg; - } - - function Hide($aFlg=true) { - $this->iShow = ! $aFlg; - } - - function SetFormat($aFmt) { - $this->iFormatString=$aFmt; - } - - function SetText($aTxt) { - $this->iTxt = $aTxt ; - } - -} - -define('RANGE_OVERLAPPING',0); -define('RANGE_DISCRETE',1); - -//=================================================== -// CLASS WindrosePlot -//=================================================== -class WindrosePlot { - private $iAntiAlias=true; - private $iData=array(); - public $iX=0.5,$iY=0.5; - public $iSize=0.55; - private $iGridColor1='gray',$iGridColor2='darkgreen'; - private $iRadialColorArray=array(); - private $iRadialWeightArray=array(); - private $iRadialStyleArray=array(); - private $iRanges = array(1,2,3,5,6,10,13.5,99.0); - private $iRangeStyle = RANGE_OVERLAPPING ; - public $iCenterSize=60; - private $iType = WINDROSE_TYPE16; - public $iFontFamily=FF_VERDANA,$iFontStyle=FS_NORMAL,$iFontSize=10; - public $iFontColor='darkgray'; - private $iRadialGridStyle='longdashed'; - private $iAllDirectionLabels = array('E','ENE','NE','NNE','N','NNW','NW','WNW','W','WSW','SW','SSW','S','SSE','SE','ESE'); - private $iStandardDirections = array(); - private $iCircGridWeight=3, $iRadialGridWeight=1; - private $iLabelMargin=12; - private $iLegweights = array(2,4,6,8,10,12,14,16,18,20); - private $iLegColors = array('orange','black','blue','red','green','purple','navy','yellow','brown'); - private $iLabelFormatString='', $iLabels=array(); - private $iLabelPositioning = LBLPOSITION_EDGE; - private $iColor='white'; - private $iShowBox=false, $iBoxColor='black',$iBoxWeight=1,$iBoxStyle='solid'; - private $iOrdinalEncoding=KEYENCODING_ANTICLOCKWISE; - public $legend=null; - - function __construct($aData) { - $this->iData = $aData; - $this->legend = new LegendStyle(); - - // Setup the scale - $this->scale = new WindrosePlotScale($this->iData); - - // default label for free type i agle and a degree sign - $this->iLabelFormatString = '%.1f'.SymChar::Get('degree'); - - $delta = 2*M_PI/16; - for( $i=0, $a=0; $i < 16; ++$i, $a += $delta ) { - $this->iStandardDirections[$this->iAllDirectionLabels[$i]] = $a; - } - } - - // Dummy method to make window plots have the same signature as the - // layout classes since windrose plots are "leaf" classes in the hierarchy - function LayoutSize() { - return 1; - } - - function SetSize($aSize) { - $this->iSize = $aSize; - } - - function SetDataKeyEncoding($aEncoding) { - $this->iOrdinalEncoding = $aEncoding; - } - - function SetColor($aColor) { - $this->iColor = $aColor; - } - - function SetRadialColors($aColors) { - $this->iRadialColorArray = $aColors; - } - - function SetRadialWeights($aWeights) { - $this->iRadialWeightArray = $aWeights; - } - - function SetRadialStyles($aStyles) { - $this->iRadialStyleArray = $aStyles; - } - - function SetBox($aColor='black',$aWeight=1, $aStyle='solid', $aShow=true) { - $this->iShowBox = $aShow ; - $this->iBoxColor = $aColor ; - $this->iBoxWeight = $aWeight ; - $this->iBoxStyle = $aStyle; - } - - function SetLabels($aLabels) { - $this->iLabels = $aLabels ; - } - - function SetLabelMargin($aMarg) { - $this->iLabelMargin = $aMarg ; - } - - function SetLabelFormat($aLblFormat) { - $this->iLabelFormatString = $aLblFormat ; - } - - function SetCompassLabels($aLabels) { - if( count($aLabels) != 16 ) { - JpgraphError::RaiseL(22004); //('Label specification for windrose directions must have 16 values (one for each compass direction).'); - } - $this->iAllDirectionLabels = $aLabels ; - - $delta = 2*M_PI/16; - for( $i=0, $a=0; $i < 16; ++$i, $a += $delta ) { - $this->iStandardDirections[$this->iAllDirectionLabels[$i]] = $a; - } - - } - - function SetCenterSize($aSize) { - $this->iCenterSize = $aSize; - } - // Alias for SetCenterSize - function SetZCircleSize($aSize) { - $this->iCenterSize = $aSize; - } - - function SetFont($aFFam,$aFStyle=FS_NORMAL,$aFSize=10) { - $this->iFontFamily = $aFFam ; - $this->iFontStyle = $aFStyle ; - $this->iFontSize = $aFSize ; - } - - function SetFontColor($aColor) { - $this->iFontColor=$aColor; - } - - function SetGridColor($aColor1,$aColor2) { - $this->iGridColor1 = $aColor1; - $this->iGridColor2 = $aColor2; - } - - function SetGridWeight($aGrid1=1,$aGrid2=2) { - $this->iCircGridWeight = $aGrid1 ; - $this->iRadialGridWeight = $aGrid2 ; - } - - function SetRadialGridStyle($aStyle) { - $aStyle = strtolower($aStyle); - if( !in_array($aStyle,array('solid','dotted','dashed','longdashed')) ) { - JpGraphError::RaiseL(22005); //("Line style for radial lines must be on of ('solid','dotted','dashed','longdashed') "); - } - $this->iRadialGridStyle=$aStyle; - } - - function SetRanges($aRanges) { - $this->iRanges = $aRanges; - } - - function SetRangeStyle($aStyle) { - $this->iRangeStyle = $aStyle; - } - - function SetRangeColors($aLegColors) { - $this->iLegColors = $aLegColors; - } - - function SetRangeWeights($aWeights) { - $n=count($aWeights); - for($i=0; $i< $n; ++$i ) { - $aWeights[$i] = floor($aWeights[$i]/2); - } - $this->iLegweights = $aWeights; - - } - - function SetType($aType) { - if( $aType < WINDROSE_TYPE4 || $aType > WINDROSE_TYPEFREE ) { - JpGraphError::RaiseL(22006); //('Illegal windrose type specified.'); - } - $this->iType = $aType; - } - - // Alias for SetPos() - function SetCenterPos($aX,$aY) { - $this->iX = $aX; - $this->iY = $aY; - } - - function SetPos($aX,$aY) { - $this->iX = $aX; - $this->iY = $aY; - } - - function SetAntiAlias($aFlag) { - $this->iAntiAlias = $aFlag ; - if( ! $aFlag ) - $this->iCircGridWeight = 1; - } - - function _ThickCircle($aImg,$aXC,$aYC,$aRad,$aWeight=2,$aColor) { - - $aImg->SetColor($aColor); - $aRad *= 2 ; - $aImg->Ellipse($aXC,$aYC,$aRad,$aRad); - if( $aWeight > 1 ) { - $aImg->Ellipse($aXC,$aYC,$aRad+1,$aRad+1); - $aImg->Ellipse($aXC,$aYC,$aRad+2,$aRad+2); - if( $aWeight > 2 ) { - $aImg->Ellipse($aXC,$aYC,$aRad+3,$aRad+3); - $aImg->Ellipse($aXC,$aYC,$aRad+3,$aRad+4); - $aImg->Ellipse($aXC,$aYC,$aRad+4,$aRad+3); - } - } - } - - function _StrokeWindLeg($aImg,$xc,$yc,$a,$ri,$r,$weight,$color) { - - // If less than 1 px long then we assume this has been caused by rounding problems - // and should not be stroked - if( $r < 1 ) return; - - $xt = $xc + cos($a)*$ri; - $yt = $yc - sin($a)*$ri; - $xxt = $xc + cos($a)*($ri+$r); - $yyt = $yc - sin($a)*($ri+$r); - - $x1 = $xt - $weight*sin($a); - $y1 = $yt - $weight*cos($a); - $x2 = $xxt - $weight*sin($a); - $y2 = $yyt - $weight*cos($a); - - $x3 = $xxt + $weight*sin($a); - $y3 = $yyt + $weight*cos($a); - $x4 = $xt + $weight*sin($a); - $y4 = $yt + $weight*cos($a); - - $pts = array($x1,$y1,$x2,$y2,$x3,$y3,$x4,$y4); - $aImg->SetColor($color); - $aImg->FilledPolygon($pts); - - } - - function _StrokeLegend($aImg,$x,$y,$scaling=1,$aReturnWidth=false) { - - if( ! $this->legend->iShow ) return 0; - - $nlc = count($this->iLegColors); - $nlw = count($this->iLegweights); - - // Setup font for ranges - $value = new Text(); - $value->SetAlign('center','bottom'); - $value->SetFont($this->legend->iLblFontFamily, - $this->legend->iLblFontStyle, - $this->legend->iLblFontSize*$scaling); - $value->SetColor($this->legend->iLblFontColor); - - // Remember x-center - $xcenter = $x ; - - // Construct format string - $fmt = $this->legend->iFormatString.'-'.$this->legend->iFormatString; - - // Make sure that the length of each range is enough to cover the - // size of the labels - $tst = sprintf($fmt,$this->iRanges[0],$this->iRanges[1]); - $value->Set($tst); - $w = $value->GetWidth($aImg); - $l = round(max($this->legend->iLength * $scaling,$w*1.5)); - - $r = $this->legend->iCircleRadius * $scaling ; - $len = 2*$r + $this->scale->iMaxNum * $l; - - // We are called just to find out the width - if( $aReturnWidth ) return $len; - - $x -= round($len/2); - $x += $r; - - // 4 pixels extra vertical margin since the circle sometimes is +/- 1 pixel of the - // theorethical radius due to imperfection in the GD library - //$y -= round(max($r,$scaling*$this->iLegweights[($this->scale->iMaxNum-1) % $nlw])+4*$scaling); - $y -= ($this->legend->iCircleRadius + 2)*$scaling+$this->legend->iBottomMargin*$scaling; - - // Adjust for bottom text - if( $this->legend->iTxt != '' ) { - // Setup font for text - $value->Set($this->legend->iTxt); - $y -= /*$this->legend->iTxtMargin + */ $value->GetHeight($aImg); - } - - // Stroke 0-circle - $this->_ThickCircle($aImg,$x,$y,$r,$this->legend->iCircleWeight, - $this->legend->iCircleColor); - - // Remember the center of the circe - $xc=$x; $yc=$y; - - $value->SetAlign('center','bottom'); - $x += $r+1; - - // Stroke all used ranges - $txty = $y - - round($this->iLegweights[($this->scale->iMaxNum-1)%$nlw]*$scaling) - 4*$scaling; - if( $this->scale->iMaxNum >= count($this->iRanges) ) { - JpGraphError::RaiseL(22007); //('To few values for the range legend.'); - } - $i=0;$idx=0; - while( $i < $this->scale->iMaxNum ) { - $y1 = $y - round($this->iLegweights[$i % $nlw]*$scaling); - $y2 = $y + round($this->iLegweights[$i % $nlw]*$scaling); - $x2 = $x + $l ; - $aImg->SetColor($this->iLegColors[$i % $nlc]); - $aImg->FilledRectangle($x,$y1,$x2,$y2); - if( $this->iRangeStyle == RANGE_OVERLAPPING ) { - $lbl = sprintf($fmt,$this->iRanges[$idx],$this->iRanges[$idx+1]); - } - else { - $lbl = sprintf($fmt,$this->iRanges[$idx],$this->iRanges[$idx+1]); - ++$idx; - } - $value->Set($lbl); - $value->Stroke($aImg,$x+$l/2,$txty); - $x = $x2; - ++$i;++$idx; - } - - // Setup circle font - $value->SetFont($this->legend->iCircleFontFamily, - $this->legend->iCircleFontStyle, - $this->legend->iCircleFontSize*$scaling); - $value->SetColor($this->legend->iCircleFontColor); - - // Stroke 0-circle text - $value->Set($this->legend->iZCircleTxt); - $value->SetAlign('center','center'); - $value->ParagraphAlign('center'); - $value->Stroke($aImg,$xc,$yc); - - // Setup circle font - $value->SetFont($this->legend->iTxtFontFamily, - $this->legend->iTxtFontStyle, - $this->legend->iTxtFontSize*$scaling); - $value->SetColor($this->legend->iTxtFontColor); - - // Draw the text under the legend - $value->Set($this->legend->iTxt); - $value->SetAlign('center','top'); - $value->SetParagraphAlign('center'); - $value->Stroke($aImg,$xcenter,$y2+$this->legend->iTxtMargin*$scaling); - } - - function SetAutoScaleAngle($aIsRegRose=true) { - - // If the user already has manually set an angle don't - // trye to find a position - if( is_numeric($this->scale->iAngle) ) - return; - - if( $aIsRegRose ) { - - // Create a complete data for all directions - // and translate string directions to ordinal values. - // This will much simplify the logic below - for( $i=0; $i < 16; ++$i ) { - $dtxt = $this->iAllDirectionLabels[$i]; - if( !empty($this->iData[$dtxt]) ) { - $data[$i] = $this->iData[$dtxt]; - } - elseif( !empty($this->iData[strtolower($dtxt)]) ) { - $data[$i] = $this->iData[strtolower($dtxt)]; - } - elseif( !empty($this->iData[$i]) ) { - $data[$i] = $this->iData[$i]; - } - else { - $data[$i] = array(); - } - } - - // Find the leg which has the lowest weighted sum of number of data around it - $c0 = array_sum($data[0]); - $c1 = array_sum($data[1]); - $found = 1; - $min = $c0+$c1*100; // Initialize to a high value - for( $i=1; $i < 15; ++$i ) { - $c2 = array_sum($data[$i+1]); - - // Weight the leg we will use more to give preference - // to a short middle leg even if the 3 way sum is similair - $w = $c0 + 3*$c1 + $c2 ; - if( $w < $min ) { - $min = $w; - $found = $i; - } - $c0 = $c1; - $c1 = $c2; - } - $this->scale->iAngle = $found*22.5; - } - else { - $n = count($this->iData); - foreach( $this->iData as $dir => $leg ) { - if( !is_numeric($dir) ) { - $pos = array_search(strtoupper($dir),$this->iAllDirectionLabels); - if( $pos !== false ) { - $dir = $pos*22.5; - } - } - $data[round($dir)] = $leg; - } - - // Get all the angles for the data and sort it - $keys = array_keys($data); - sort($keys, SORT_NUMERIC); - - $n = count($data); - $found = false; - $max = 0 ; - for( $i=0; $i < 15; ++$i ) { - $try_a = round(22.5*$i); - - if( $try_a > $keys[$n-1] ) break; - - if( in_array($try_a,$keys) ) continue; - - // Find the angle just lower than this - $j=0; - while( $j < $n && $keys[$j] <= $try_a ) ++$j; - if( $j == 0 ) { - $kj = 0; $keys[$n-1]; - $d1 = 0; abs($kj-$try_a); - } - else { - --$j; - $kj = $keys[$j]; - $d1 = abs($kj-$try_a); - } - - // Find the angle just larger than this - $l=$n-1; - while( $l >= 0 && $keys[$l] >= $try_a ) --$l; - if( $l == $n-1) { - $kl = $keys[0]; - $d2 = abs($kl-$try_a); - } - else { - ++$l; - $kl = $keys[$l]; - $d2 = abs($kl-$try_a); - } - - // Weight the distance so that legs with large spread - // gets a better weight - $w = $d1 + $d2; - if( $i == 0 ) { - $w = round(1.4 * $w); - } - $diff = abs($d1 - $d2); - $w *= (360-$diff); - if( $w > $max ) { - $found = $i; - $max = $w; - } - } - - $a = $found*22.5; - - // Some heuristics to have some preferred positions - if( $keys[$n-1] < 25 ) $a = 45; - elseif( $keys[0] > 60 ) $a = 45; - elseif( $keys[0] > 25 && $keys[$n-1] < 340 ) $a = 0; - elseif( $keys[$n-1] < 75 ) $a = 90; - elseif( $keys[$n-1] < 120 ) $a = 135; - elseif( $keys[$n-1] < 160 ) $a = 180; - - $this->scale->iAngle = $a ; - } - } - - function NormAngle($a) { - while( $a > 360 ) { - $a -= 360; - } - return $a; - } - - function SetLabelPosition($aPos) { - $this->iLabelPositioning = $aPos ; - } - - function _StrokeFreeRose($dblImg,$value,$scaling,$xc,$yc,$r,$ri) { - - // Plot radial grid lines and remember the end position - // and the angle for later use when plotting the labels - if( $this->iType != WINDROSE_TYPEFREE ) { - JpGraphError::RaiseL(22008); //('Internal error: Trying to plot free Windrose even though type is not a free windorose'); - } - - // Check if we should auto-position the angle for the - // labels. Basically we try to find a firection with smallest - // (or none) data. - $this->SetAutoScaleAngle(false); - - $nlc = count($this->iLegColors); - $nlw = count($this->iLegweights); - - // Stroke grid lines for directions and remember the - // position for the labels - $txtpos=array(); - $num = count($this->iData); - - $keys = array_keys($this->iData); - - foreach( $this->iData as $dir => $legdata ) { - if( in_array($dir,$this->iAllDirectionLabels,true) === true) { - $a = $this->iStandardDirections[strtoupper($dir)]; - if( in_array($a*180/M_PI,$keys) ) { - JpGraphError::RaiseL(22009,round($a*180/M_PI)); - //('You have specified the same direction twice, once with an angle and once with a compass direction ('.$a*180/M_PI.' degrees.)'); - } - } - elseif( is_numeric($dir) ) { - $this->NormAngle($dir); - - if( $this->iOrdinalEncoding == KEYENCODING_CLOCKWISE ) { - $dir = 360-$dir; - } - - $a = $dir * M_PI/180; - } - else { - JpGraphError::RaiseL(22010);//('Direction must either be a numeric value or one of the 16 compass directions'); - } - - $xxc = round($xc + cos($a)*$ri); - $yyc = round($yc - sin($a)*$ri); - $x = round($xc + cos($a)*$r); - $y = round($yc - sin($a)*$r); - if( empty($this->iRadialColorArray[$dir]) ) { - $dblImg->SetColor($this->iGridColor2); - } - else { - $dblImg->SetColor($this->iRadialColorArray[$dir]); - } - if( empty($this->iRadialWeightArray[$dir]) ) { - $dblImg->SetLineWeight($this->iRadialGridWeight); - } - else { - $dblImg->SetLineWeight($this->iRadialWeightArray[$dir]); - } - if( empty($this->iRadialStyleArray[$dir]) ) { - $dblImg->SetLineStyle($this->iRadialGridStyle); - } - else { - $dblImg->SetLineStyle($this->iRadialStyleArray[$dir]); - } - $dblImg->StyleLine($xxc,$yyc,$x,$y); - $txtpos[] = array($x,$y,$a); - } - $dblImg->SetLineWeight(1); - - // Setup labels - $lr = $scaling * $this->iLabelMargin; - - if( $this->iLabelPositioning == LBLPOSITION_EDGE ) { - $value->SetAlign('left','top'); - } - else { - $value->SetAlign('center','center'); - $value->SetMargin(0); - } - - for($i=0; $i < $num; ++$i ) { - - list($x,$y,$a) = $txtpos[$i]; - - // Determine the label - - $da = $a*180/M_PI; - if( $this->iOrdinalEncoding == KEYENCODING_CLOCKWISE ) { - $da = 360 - $da; - } - - //$da = 360-$da; - - if( !empty($this->iLabels[$keys[$i]]) ) { - $lbl = $this->iLabels[$keys[$i]]; - } - else { - $lbl = sprintf($this->iLabelFormatString,$da); - } - - if( $this->iLabelPositioning == LBLPOSITION_CENTER ) { - $dx = $dy = 0; - } - else { - // LBLPOSIITON_EDGE - if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; - if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; - if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1; - if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dx=(1-($a-M_PI*5/4)*2/M_PI); - - if( $a>=7*M_PI/4 ) $dy=(($a-M_PI)-3*M_PI/4)*2/M_PI; - if( $a<=M_PI/4 ) $dy=(0.5+$a*2/M_PI); - if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dy=1; - if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dy=(1-($a-3*M_PI/4)*2/M_PI); - if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; - } - - $value->Set($lbl); - $th = $value->GetHeight($dblImg); - $tw = $value->GetWidth($dblImg); - $xt=round($lr*cos($a)+$x) - $dx*$tw; - $yt=round($y-$lr*sin($a)) - $dy*$th; - - $value->Stroke($dblImg,$xt,$yt); - } - - if( __DEBUG ) { - $dblImg->SetColor('red'); - $dblImg->Circle($xc,$yc,$lr+$r); - } - - // Stroke all the legs - reset($this->iData); - $i=0; - foreach($this->iData as $dir => $legdata) { - $legdata = array_slice($legdata,1); - $nn = count($legdata); - - $a = $txtpos[$i][2]; - $rri = $ri/$scaling; - for( $j=0; $j < $nn; ++$j ) { - // We want the non scaled original radius - $legr = $this->scale->RelTranslate($legdata[$j],$r/$scaling,$ri/$scaling) ; - $this->_StrokeWindLeg($dblImg, $xc, $yc, $a, - $rri *$scaling, - $legr *$scaling, - $this->iLegweights[$j % $nlw] * $scaling, - $this->iLegColors[$j % $nlc]); - $rri += $legr; - } - ++$i; - } - } - - // Translate potential string specified compass labels to their - // corresponding index. - function FixupIndexes($aDataArray,$num) { - $ret = array(); - $keys = array_keys($aDataArray); - foreach($aDataArray as $idx => $data) { - if( is_string($idx) ) { - $idx = strtoupper($idx); - $res = array_search($idx,$this->iAllDirectionLabels); - if( $res === false ) { - JpGraphError::RaiseL(22011,$idx); //('Windrose index must be numeric or direction label. You have specified index='.$idx); - } - $idx = $res; - if( $idx % (16 / $num) !== 0 ) { - JpGraphError::RaiseL(22012); //('Windrose radial axis specification contains a direction which is not enabled.'); - } - $idx /= (16/$num) ; - - if( in_array($idx,$keys,1) ) { - JpgraphError::RaiseL(22013,$idx); //('You have specified the look&feel for the same compass direction twice, once with text and once with index (Index='.$idx.')'); - } - } - if( $idx < 0 || $idx > 15 ) { - JpgraphError::RaiseL(22014); //('Index for copmass direction must be between 0 and 15.'); - } - $ret[$idx] = $data; - } - return $ret; - } - - function _StrokeRegularRose($dblImg,$value,$scaling,$xc,$yc,$r,$ri) { - // _StrokeRegularRose($dblImg,$xc,$yc,$r,$ri) - // Plot radial grid lines and remember the end position - // and the angle for later use when plotting the labels - switch( $this->iType ) { - case WINDROSE_TYPE4: - $num = 4; break; - case WINDROSE_TYPE8: - $num = 8; break; - case WINDROSE_TYPE16: - $num = 16; break; - default: - JpGraphError::RaiseL(22015);//('You have specified an undefined Windrose plot type.'); - } - - // Check if we should auto-position the angle for the - // labels. Basically we try to find a firection with smallest - // (or none) data. - $this->SetAutoScaleAngle(true); - - $nlc = count($this->iLegColors); - $nlw = count($this->iLegweights); - - $this->iRadialColorArray = $this->FixupIndexes($this->iRadialColorArray,$num); - $this->iRadialWeightArray = $this->FixupIndexes($this->iRadialWeightArray,$num); - $this->iRadialStyleArray = $this->FixupIndexes($this->iRadialStyleArray,$num); - - $txtpos=array(); - $a = 2*M_PI/$num; - $dblImg->SetColor($this->iGridColor2); - $dblImg->SetLineStyle($this->iRadialGridStyle); - $dblImg->SetLineWeight($this->iRadialGridWeight); - - // Translate any name specified directions to the index - // so we can easily use it in the loop below - for($i=0; $i < $num; ++$i ) { - $xxc = round($xc + cos($a*$i)*$ri); - $yyc = round($yc - sin($a*$i)*$ri); - $x = round($xc + cos($a*$i)*$r); - $y = round($yc - sin($a*$i)*$r); - if( empty($this->iRadialColorArray[$i]) ) { - $dblImg->SetColor($this->iGridColor2); - } - else { - $dblImg->SetColor($this->iRadialColorArray[$i]); - } - if( empty($this->iRadialWeightArray[$i]) ) { - $dblImg->SetLineWeight($this->iRadialGridWeight); - } - else { - $dblImg->SetLineWeight($this->iRadialWeightArray[$i]); - } - if( empty($this->iRadialStyleArray[$i]) ) { - $dblImg->SetLineStyle($this->iRadialGridStyle); - } - else { - $dblImg->SetLineStyle($this->iRadialStyleArray[$i]); - } - - $dblImg->StyleLine($xxc,$yyc,$x,$y); - $txtpos[] = array($x,$y,$a*$i); - } - $dblImg->SetLineWeight(1); - - $lr = $scaling * $this->iLabelMargin; - if( $this->iLabelPositioning == LBLPOSITION_CENTER ) { - $value->SetAlign('center','center'); - } - else { - $value->SetAlign('left','top'); - $value->SetMargin(0); - $lr /= 2 ; - } - - for($i=0; $i < $num; ++$i ) { - list($x,$y,$a) = $txtpos[$i]; - - // Set the position of the label - if( $this->iLabelPositioning == LBLPOSITION_CENTER ) { - $dx = $dy = 0; - } - else { - // LBLPOSIITON_EDGE - if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; - if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; - if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1; - if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dx=(1-($a-M_PI*5/4)*2/M_PI); - - if( $a>=7*M_PI/4 ) $dy=(($a-M_PI)-3*M_PI/4)*2/M_PI; - if( $a<=M_PI/4 ) $dy=(0.5+$a*2/M_PI); - if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dy=1; - if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dy=(1-($a-3*M_PI/4)*2/M_PI); - if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; - } - - $value->Set($this->iAllDirectionLabels[$i*(16/$num)]); - $th = $value->GetHeight($dblImg); - $tw = $value->GetWidth($dblImg); - $xt=round($lr*cos($a)+$x) - $dx*$tw; - $yt=round($y-$lr*sin($a)) - $dy*$th; - - $value->Stroke($dblImg,$xt,$yt); - } - - if( __DEBUG ) { - $dblImg->SetColor("red"); - $dblImg->Circle($xc,$yc,$lr+$r); - } - - // Stroke all the legs - reset($this->iData); - $keys = array_keys($this->iData); - foreach($this->iData as $idx => $legdata) { - $legdata = array_slice($legdata,1); - $nn = count($legdata); - if( is_string($idx) ) { - $idx = strtoupper($idx); - $idx = array_search($idx,$this->iAllDirectionLabels); - if( $idx === false ) { - JpGraphError::RaiseL(22016);//('Windrose leg index must be numeric or direction label.'); - } - if( $idx % (16 / $num) !== 0 ) { - JpGraphError::RaiseL(22017);//('Windrose data contains a direction which is not enabled. Please adjust what labels are displayed.'); - } - $idx /= (16/$num) ; - - if( in_array($idx,$keys,1) ) { - JpgraphError::RaiseL(22018,$idx);//('You have specified data for the same compass direction twice, once with text and once with index (Index='.$idx.')'); - - } - } - if( $idx < 0 || $idx > 15 ) { - JpgraphError::RaiseL(22019);//('Index for direction must be between 0 and 15. You can\'t specify angles for a Regular Windplot, only index and compass directions.'); - } - $a = $idx * (360 / $num) ; - $a *= M_PI/180.0; - $rri = $ri/$scaling; - for( $j=0; $j < $nn; ++$j ) { - // We want the non scaled original radius - $legr = $this->scale->RelTranslate($legdata[$j], $r/$scaling,$ri/$scaling) ; - $this->_StrokeWindLeg($dblImg, $xc, $yc, $a, - $rri *$scaling, - $legr *$scaling, - $this->iLegweights[$j % $nlw] * $scaling, - $this->iLegColors[$j % $nlc]); - $rri += $legr; - } - } - } - - - function getWidth($aImg) { - - $scaling = 1;//$this->iAntiAlias ? 2 : 1 ; - if( $this->iSize > 0 && $this->iSize < 1 ) { - $this->iSize *= min($aImg->width,$aImg->height); - } - - - $value = new Text(); - $value->SetFont($this->iFontFamily,$this->iFontStyle,$this->iFontSize*$scaling); - $value->SetColor($this->iFontColor); - // Setup extra size around the graph needed so that the labels - // doesn't get cut. For this we need to find the largest label. - // The code below gives a possible a little to large margin. The - // really, really proper way would be to account for what angle - // the label are at - $n = count($this->iLabels); - if( $n > 0 ) { - $maxh=0;$maxw=0; - foreach($this->iLabels as $key => $lbl) { - $value->Set($lbl); - $maxw = max($maxw,$value->GetWidth($aImg)); - } - } - else { - $value->Set('888.888'); // Dummy value to get width/height - $maxw = $value->GetWidth($aImg); - } - // Add an extra margin of 50% the font size - $maxw += round($this->iFontSize*$scaling * 0.4) ; - - $valxmarg = 1.5*$maxw+2*$this->iLabelMargin*$scaling; - $w = round($this->iSize*$scaling + $valxmarg); - - // Make sure that the width of the legend fits - $legendwidth = $this->_StrokeLegend($aImg,0,0,$scaling,true)+10*$scaling; - $w = max($w,$legendwidth); - - return $w; - } - - function getHeight($aImg) { - - $scaling = 1;//$this->iAntiAlias ? 2 : 1 ; - if( $this->iSize > 0 && $this->iSize < 1 ) { - $this->iSize *= min($aImg->width,$aImg->height); - } - - $value = new Text(); - $value->SetFont($this->iFontFamily,$this->iFontStyle,$this->iFontSize*$scaling); - $value->SetColor($this->iFontColor); - // Setup extra size around the graph needed so that the labels - // doesn't get cut. For this we need to find the largest label. - // The code below gives a possible a little to large margin. The - // really, really proper way would be to account for what angle - // the label are at - $n = count($this->iLabels); - if( $n > 0 ) { - $maxh=0;$maxw=0; - foreach($this->iLabels as $key => $lbl) { - $value->Set($lbl); - $maxh = max($maxh,$value->GetHeight($aImg)); - } - } - else { - $value->Set('180.8'); // Dummy value to get width/height - $maxh = $value->GetHeight($aImg); - } - // Add an extra margin of 50% the font size - //$maxh += round($this->iFontSize*$scaling * 0.5) ; - $valymarg = 2*$maxh+2*$this->iLabelMargin*$scaling; - - $legendheight = round($this->legend->iShow ? 1 : 0); - $legendheight *= max($this->legend->iCircleRadius*2,$this->legend->iTxtFontSize*2)+ - $this->legend->iMargin + $this->legend->iBottomMargin + 2; - $legendheight *= $scaling; - $h = round($this->iSize*$scaling + $valymarg) + $legendheight ; - - return $h; - } - - function Stroke($aGraph) { - - $aImg = $aGraph->img; - - if( $this->iX > 0 && $this->iX < 1 ) { - $this->iX = round( $aImg->width * $this->iX ) ; - } - - if( $this->iY > 0 && $this->iY < 1 ) { - $this->iY = round( $aImg->height * $this->iY ) ; - } - - if( $this->iSize > 0 && $this->iSize < 1 ) { - $this->iSize *= min($aImg->width,$aImg->height); - } - - if( $this->iCenterSize > 0 && $this->iCenterSize < 1 ) { - $this->iCenterSize *= $this->iSize; - } - - $this->scale->AutoScale(($this->iSize - $this->iCenterSize)/2, round(2.5*$this->scale->iFontSize)); - - $scaling = $this->iAntiAlias ? 2 : 1 ; - - $value = new Text(); - $value->SetFont($this->iFontFamily,$this->iFontStyle,$this->iFontSize*$scaling); - $value->SetColor($this->iFontColor); - - $legendheight = round($this->legend->iShow ? 1 : 0); - $legendheight *= max($this->legend->iCircleRadius*2,$this->legend->iTxtFontSize*2)+ - $this->legend->iMargin + $this->legend->iBottomMargin + 2; - $legendheight *= $scaling; - - $w = $scaling*$this->getWidth($aImg); - $h = $scaling*$this->getHeight($aImg); - - // Copy back the double buffered image to the proper canvas - $ww = $w / $scaling ; - $hh = $h / $scaling ; - - // Create the double buffer - if( $this->iAntiAlias ) { - $dblImg = new RotImage($w,$h); - // Set the background color - $dblImg->SetColor($this->iColor); - $dblImg->FilledRectangle(0,0,$w,$h); - } - else { - $dblImg = $aImg ; - // Make sure the ix and it coordinates correpond to the new top left center - $dblImg->SetTranslation($this->iX-$w/2, $this->iY-$h/2); - } - - if( __DEBUG ) { - $dblImg->SetColor('red'); - $dblImg->Rectangle(0,0,$w-1,$h-1); - } - - $dblImg->SetColor('black'); - - if( $this->iShowBox ) { - $dblImg->SetColor($this->iBoxColor); - $old = $dblImg->SetLineWeight($this->iBoxWeight); - $dblImg->SetLineStyle($this->iBoxStyle); - $dblImg->Rectangle(0,0,$w-1,$h-1); - $dblImg->SetLineWeight($old); - } - - $xc = round($w/2); - $yc = round(($h-$legendheight)/2); - - if( __DEBUG ) { - $dblImg->SetColor('red'); - $old = $dblImg->SetLineWeight(2); - $dblImg->Line($xc-5,$yc-5,$xc+5,$yc+5); - $dblImg->Line($xc+5,$yc-5,$xc-5,$yc+5); - $dblImg->SetLineWeight($old); - } - - $this->iSize *= $scaling; - - // Inner circle size - $ri = $this->iCenterSize/2 ; - - // Full circle radius - $r = round( $this->iSize/2 ); - - // Get number of grid circles - $n = $this->scale->GetNumCirc(); - - // Plot circle grids - $ri *= $scaling ; - $rr = round(($r-$ri)/$n); - for( $i = 1; $i <= $n; ++$i ) { - $this->_ThickCircle($dblImg,$xc,$yc,$rr*$i+$ri, - $this->iCircGridWeight,$this->iGridColor1); - } - - $num = 0 ; - - if( $this->iType == WINDROSE_TYPEFREE ) { - $this->_StrokeFreeRose($dblImg,$value,$scaling,$xc,$yc,$r,$ri); - } - else { - // Check if we need to re-code the interpretation of the ordinal - // number in the data. Internally ordinal value 0 is East and then - // counted anti-clockwise. The user might choose an encoding - // that have 0 being the first axis to the right of the "N" axis and then - // counted clock-wise - if( $this->iOrdinalEncoding == KEYENCODING_CLOCKWISE ) { - if( $this->iType == WINDROSE_TYPE16 ) { - $const1 = 19; $const2 = 16; - } - elseif( $this->iType == WINDROSE_TYPE8 ) { - $const1 = 9; $const2 = 8; - } - else { - $const1 = 4; $const2 = 4; - } - $tmp = array(); - $n=count($this->iData); - foreach( $this->iData as $key => $val ) { - if( is_numeric($key) ) { - $key = ($const1 - $key) % $const2 ; - } - $tmp[$key] = $val; - } - $this->iData = $tmp; - } - $this->_StrokeRegularRose($dblImg,$value,$scaling,$xc,$yc,$r,$ri); - } - - // Stroke the labels - $this->scale->iFontSize *= $scaling; - $this->scale->iZFontSize *= $scaling; - $this->scale->StrokeLabels($dblImg,$xc,$yc,$ri,$rr); - - // Stroke the inner circle again since the legs - // might have written over it - $this->_ThickCircle($dblImg,$xc,$yc,$ri,$this->iCircGridWeight,$this->iGridColor1); - - if( $ww > $aImg->width ) { - JpgraphError::RaiseL(22020); - //('Windrose plot is too large to fit the specified Graph size. Please use WindrosePlot::SetSize() to make the plot smaller or increase the size of the Graph in the initial WindroseGraph() call.'); - } - - $x = $xc; - $y = $h; - $this->_StrokeLegend($dblImg,$x,$y,$scaling); - - if( $this->iAntiAlias ) { - $aImg->Copy($dblImg->img, $this->iX-$ww/2, $this->iY-$hh/2, 0, 0, $ww,$hh, $w,$h); - } - - // We need to restore the translation matrix - $aImg->SetTranslation(0,0); - - } - -} - -//============================================================ -// CLASS WindroseGraph -//============================================================ -class WindroseGraph extends Graph { - private $posx, $posy; - public $plots=array(); - - function __construct($width=300,$height=200,$cachedName="",$timeout=0,$inline=1) { - parent::__construct($width,$height,$cachedName,$timeout,$inline); - $this->posx=$width/2; - $this->posy=$height/2; - $this->SetColor('white'); - $this->title->SetFont(FF_VERDANA,FS_NORMAL,12); - $this->title->SetMargin(8); - $this->subtitle->SetFont(FF_VERDANA,FS_NORMAL,10); - $this->subtitle->SetMargin(0); - $this->subsubtitle->SetFont(FF_VERDANA,FS_NORMAL,8); - $this->subsubtitle->SetMargin(0); - } - - function StrokeTexts() { - if( $this->texts != null ) { - $n = count($this->texts); - for($i=0; $i < $n; ++$i ) { - $this->texts[$i]->Stroke($this->img); - } - } - } - - function StrokeIcons() { - if( $this->iIcons != null ) { - $n = count($this->iIcons); - for( $i=0; $i < $n; ++$i ) { - // Since Windrose graphs doesn't have any linear scale the position of - // each icon has to be given as absolute coordinates - $this->iIcons[$i]->_Stroke($this->img); - } - } - } - - //--------------- - // PUBLIC METHODS - function Add($aObj) { - if( is_array($aObj) && count($aObj) > 0 ) { - $cl = $aObj[0]; - } - else { - $cl = $aObj; - } - if( $cl instanceof Text ) { - $this->AddText($aObj); - } - elseif( $cl instanceof IconPlot ) { - $this->AddIcon($aObj); - } - elseif( ($cl instanceof WindrosePlot) || ($cl instanceof LayoutRect) || ($cl instanceof LayoutHor)) { - $this->plots[] = $aObj; - } - else { - JpgraphError::RaiseL(22021); - } - } - - function AddText($aTxt,$aToY2=false) { - parent::AddText($aTxt); - } - - function SetColor($c) { - $this->SetMarginColor($c); - } - - // Method description - function Stroke($aStrokeFileName="") { - - // If the filename is the predefined value = '_csim_special_' - // we assume that the call to stroke only needs to do enough - // to correctly generate the CSIM maps. - // We use this variable to skip things we don't strictly need - // to do to generate the image map to improve performance - // as best we can. Therefore you will see a lot of tests !$_csim in the - // code below. - $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); - - // We need to know if we have stroked the plot in the - // GetCSIMareas. Otherwise the CSIM hasn't been generated - // and in the case of GetCSIM called before stroke to generate - // CSIM without storing an image to disk GetCSIM must call Stroke. - $this->iHasStroked = true; - - if( $this->background_image != "" || $this->background_cflag != "" ) { - $this->StrokeFrameBackground(); - } - else { - $this->StrokeFrame(); - } - - // n holds number of plots - $n = count($this->plots); - for($i=0; $i < $n ; ++$i) { - $this->plots[$i]->Stroke($this); - } - - $this->footer->Stroke($this->img); - $this->StrokeIcons(); - $this->StrokeTexts(); - $this->StrokeTitles(); - - // If the filename is given as the special "__handle" - // then the image handler is returned and the image is NOT - // streamed back - if( $aStrokeFileName == _IMG_HANDLER ) { - return $this->img->img; - } - else { - // Finally stream the generated picture - $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline, - $aStrokeFileName); - } - } - -} // Class - -?> diff --git a/#jpgraph/src/lang/de.inc.php b/#jpgraph/src/lang/de.inc.php deleted file mode 100644 index 37ba264f..00000000 --- a/#jpgraph/src/lang/de.inc.php +++ /dev/null @@ -1,552 +0,0 @@ -,) -$_jpg_messages = array( - -/* -** Headers wurden bereits gesendet - Fehler. Dies wird als HTML formatiert, weil es direkt als text zurueckgesendet wird -*/ -10 => array('
JpGraph Fehler: -HTTP header wurden bereits gesendet.
Fehler in der Datei %s in der Zeile %d.
Erklärung:
HTTP header wurden bereits zum Browser gesendet, wobei die Daten als Text gekennzeichnet wurden, bevor die Bibliothek die Chance hatte, seinen Bild-HTTP-Header zum Browser zu schicken. Dies verhindert, dass die Bibliothek Bilddaten zum Browser schicken kann (weil sie vom Browser als Text interpretiert würden und daher nur Mist dargestellt würde).

Wahrscheinlich steht Text im Skript bevor Graph::Stroke() aufgerufen wird. Wenn dieser Text zum Browser gesendet wird, nimmt dieser an, dass die gesamten Daten aus Text bestehen. Such nach irgendwelchem Text, auch nach Leerzeichen und Zeilenumbrüchen, die eventuell bereits zum Browser gesendet wurden.

Zum Beispiel ist ein oft auftretender Fehler, eine Leerzeile am Anfang der Datei oder vor Graph::Stroke() zu lassen."<?php".

',2), - -/* -** Setup Fehler -*/ -11 => array('Es wurde kein Pfad für CACHE_DIR angegeben. Bitte gib einen Pfad CACHE_DIR in der Datei jpg-config.inc an.',0), -12 => array('Es wurde kein Pfad für TTF_DIR angegeben und der Pfad kann nicht automatisch ermittelt werden. Bitte gib den Pfad in der Datei jpg-config.inc an.',0), -13 => array('The installed PHP version (%s) is not compatible with this release of the library. The library requires at least PHP version %s',2), - -/* -** jpgraph_bar -*/ - -2001 => array('Die Anzahl der Farben ist nicht gleich der Anzahl der Vorlagen in BarPlot::SetPattern().',0), -2002 => array('Unbekannte Vorlage im Aufruf von BarPlot::SetPattern().',0), -2003 => array('Anzahl der X- und Y-Koordinaten sind nicht identisch. Anzahl der X-Koordinaten: %d; Anzahl der Y-Koordinaten: %d.',2), -2004 => array('Alle Werte für ein Balkendiagramm (barplot) müssen numerisch sein. Du hast den Wert nr [%d] == %s angegeben.',2), -2005 => array('Du hast einen leeren Vektor für die Schattierungsfarben im Balkendiagramm (barplot) angegeben.',0), -2006 => array('Unbekannte Position für die Werte der Balken: %s.',1), -2007 => array('Kann GroupBarPlot nicht aus einem leeren Vektor erzeugen.',0), -2008 => array('GroupBarPlot Element nbr %d wurde nicht definiert oder ist leer.',0), -2009 => array('Eins der Objekte, das an GroupBar weitergegeben wurde ist kein Balkendiagramm (BarPlot). Versichere Dich, dass Du den GroupBarPlot aus einem Vektor von Balkendiagrammen (barplot) oder AccBarPlot-Objekten erzeugst. (Class = %s)',1), -2010 => array('Kann AccBarPlot nicht aus einem leeren Vektor erzeugen.',0), -2011 => array('AccBarPlot-Element nbr %d wurde nicht definiert oder ist leer.',1), -2012 => array('Eins der Objekte, das an AccBar weitergegeben wurde ist kein Balkendiagramm (barplot). Versichere Dich, dass Du den AccBar-Plot aus einem Vektor von Balkendiagrammen (barplot) erzeugst. (Class=%s)',1), -2013 => array('Du hast einen leeren Vektor für die Schattierungsfarben im Balkendiagramm (barplot) angegeben.',0), -2014 => array('Die Anzahl der Datenpunkte jeder Datenreihe in AccBarPlot muss gleich sein.',0), -2015 => array('Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-coordinates',0), - - -/* -** jpgraph_date -*/ - -3001 => array('Es ist nur möglich, entweder SetDateAlign() oder SetTimeAlign() zu benutzen, nicht beides!',0), - -/* -** jpgraph_error -*/ - -4002 => array('Fehler bei den Eingabedaten von LineErrorPlot. Die Anzahl der Datenpunkte mus ein Mehrfaches von drei sein!',0), - -/* -** jpgraph_flags -*/ - -5001 => array('Unbekannte Flaggen-Größe (%d).',1), -5002 => array('Der Flaggen-Index %s existiert nicht.',1), -5003 => array('Es wurde eine ungültige Ordnungszahl (%d) für den Flaggen-Index angegeben.',1), -5004 => array('Der Landesname %s hat kein korrespondierendes Flaggenbild. Die Flagge mag existieren, abr eventuell unter einem anderen Namen, z.B. versuche "united states" statt "usa".',1), - - -/* -** jpgraph_gantt -*/ - -6001 => array('Interner Fehler. Die Höhe für ActivityTitles ist < 0.',0), -6002 => array('Es dürfen keine negativen Werte für die Gantt-Diagramm-Dimensionen angegeben werden. Verwende 0, wenn die Dimensionen automatisch ermittelt werden sollen.',0), -6003 => array('Ungültiges Format für den Bedingungs-Parameter bei Index=%d in CreateSimple(). Der Parameter muss bei index 0 starten und Vektoren in der Form (Row,Constrain-To,Constrain-Type) enthalten.',1), -6004 => array('Ungültiges Format für den Fortschritts-Parameter bei Index=%d in CreateSimple(). Der Parameter muss bei Index 0 starten und Vektoren in der Form (Row,Progress) enthalten.',1), -6005 => array('SetScale() ist nicht sinnvoll bei Gantt-Diagrammen.',0), -6006 => array('Das Gantt-Diagramm kann nicht automatisch skaliert werden. Es existieren keine Aktivitäten mit Termin. [GetBarMinMax() start >= n]',0), -6007 => array('Plausibiltätsprüfung für die automatische Gantt-Diagramm-Größe schlug fehl. Entweder die Breite (=%d) oder die Höhe (=%d) ist größer als MAX_GANTTIMG_SIZE. Dies kann möglicherweise durch einen falschen Wert bei einer Aktivität hervorgerufen worden sein.',2), -6008 => array('Du hast eine Bedingung angegeben von Reihe=%d bis Reihe=%d, die keine Aktivität hat.',2), -6009 => array('Unbekannter Bedingungstyp von Reihe=%d bis Reihe=%d',2), -6010 => array('Ungültiger Icon-Index für das eingebaute Gantt-Icon [%d]',1), -6011 => array('Argument für IconImage muss entweder ein String oder ein Integer sein.',0), -6012 => array('Unbekannter Typ bei der Gantt-Objekt-Title-Definition.',0), -6015 => array('Ungültige vertikale Position %d',1), -6016 => array('Der eingegebene Datums-String (%s) für eine Gantt-Aktivität kann nicht interpretiert werden. Versichere Dich, dass es ein gültiger Datumsstring ist, z.B. 2005-04-23 13:30',1), -6017 => array('Unbekannter Datumstyp in GanttScale (%s).',1), -6018 => array('Intervall für Minuten muss ein gerader Teiler einer Stunde sein, z.B. 1,5,10,12,15,20,30, etc. Du hast ein Intervall von %d Minuten angegeben.',1), -6019 => array('Die vorhandene Breite (%d) für die Minuten ist zu klein, um angezeigt zu werden. Bitte benutze die automatische Größenermittlung oder vergrößere die Breite des Diagramms.',1), -6020 => array('Das Intervall für die Stunden muss ein gerader Teiler eines Tages sein, z.B. 0:30, 1:00, 1:30, 4:00, etc. Du hast ein Intervall von %d eingegeben.',1), -6021 => array('Unbekanntes Format für die Woche.',0), -6022 => array('Die Gantt-Skala wurde nicht eingegeben.',0), -6023 => array('Wenn Du sowohl Stunden als auch Minuten anzeigen lassen willst, muss das Stunden-Interval gleich 1 sein (anderenfalls ist es nicht sinnvoll, Minuten anzeigen zu lassen).',0), -6024 => array('Das CSIM-Ziel muss als String angegeben werden. Der Start des Ziels ist: %d',1), -6025 => array('Der CSIM-Alt-Text muss als String angegeben werden. Der Beginn des Alt-Textes ist: %d',1), -6027 => array('Der Fortschrittswert muss im Bereich [0, 1] liegen.',0), -6028 => array('Die eingegebene Höhe (%d) für GanttBar ist nicht im zulässigen Bereich.',1), -6029 => array('Der Offset für die vertikale Linie muss im Bereich [0,1] sein.',0), -6030 => array('Unbekannte Pfeilrichtung für eine Verbindung.',0), -6031 => array('Unbekannter Pfeiltyp für eine Verbindung.',0), -6032 => array('Interner Fehler: Unbekannter Pfadtyp (=%d) für eine Verbindung.',1), -6033 => array('Array of fonts must contain arrays with 3 elements, i.e. (Family, Style, Size)',0), - -/* -** jpgraph_gradient -*/ - -7001 => array('Unbekannter Gradiententyp (=%d).',1), - -/* -** jpgraph_iconplot -*/ - -8001 => array('Der Mix-Wert für das Icon muss zwischen 0 und 100 sein.',0), -8002 => array('Die Ankerposition für Icons muss entweder "top", "bottom", "left", "right" oder "center" sein.',0), -8003 => array('Es ist nicht möglich, gleichzeitig ein Bild und eine Landesflagge für dasselbe Icon zu definieren',0), -8004 => array('Wenn Du Landesflaggen benutzen willst, musst Du die Datei "jpgraph_flags.php" hinzufügen (per include).',0), - -/* -** jpgraph_imgtrans -*/ - -9001 => array('Der Wert für die Bildtransformation ist außerhalb des zulässigen Bereichs. Der verschwindende Punkt am Horizont muss als Wert zwischen 0 und 1 angegeben werden.',0), - -/* -** jpgraph_lineplot -*/ - -10001 => array('Die Methode LinePlot::SetFilled() sollte nicht mehr benutzt werden. Benutze lieber SetFillColor()',0), -10002 => array('Der Plot ist zu kompliziert für FastLineStroke. Benutze lieber den StandardStroke()',0), -10003 => array('Each plot in an accumulated lineplot must have the same number of data points.',0), -/* -** jpgraph_log -*/ - -11001 => array('Deine Daten enthalten nicht-numerische Werte.',0), -11002 => array('Negative Werte können nicht für logarithmische Achsen verwendet werden.',0), -11003 => array('Deine Daten enthalten nicht-numerische Werte.',0), -11004 => array('Skalierungsfehler für die logarithmische Achse. Es gibt ein Problem mit den Daten der Achse. Der größte Wert muss größer sein als Null. Es ist mathematisch nicht möglich, einen Wert gleich Null in der Skala zu haben.',0), -11005 => array('Das Tick-Intervall für die logarithmische Achse ist nicht definiert. Lösche jeden Aufruf von SetTextLabelStart() oder SetTextTickInterval() bei der logarithmischen Achse.',0), - -/* -** jpgraph_mgraph -*/ - -12001 => array("Du benutzt GD 2.x und versuchst ein Nicht-Truecolor-Bild als Hintergrundbild zu benutzen. Um Hintergrundbilder mit GD 2.x zu benutzen, ist es notwendig Truecolor zu aktivieren, indem die USE_TRUECOLOR-Konstante auf TRUE gesetzt wird. Wegen eines Bugs in GD 2.0.1 ist die Qualität der Truetype-Schriften sehr schlecht, wenn man Truetype-Schriften mit Truecolor-Bildern verwendet.",0), -12002 => array('Ungültiger Dateiname für MGraph::SetBackgroundImage() : %s. Die Datei muss eine gültige Dateierweiterung haben (jpg,gif,png), wenn die automatische Typerkennung verwendet wird.',1), -12003 => array('Unbekannte Dateierweiterung (%s) in MGraph::SetBackgroundImage() für Dateiname: %s',2), -12004 => array('Das Bildformat des Hintergrundbildes (%s) wird von Deiner System-Konfiguration nicht unterstützt. ',1), -12005 => array('Das Hintergrundbild kann nicht gelesen werden: %s',1), -12006 => array('Es wurden ungültige Größen für Breite oder Höhe beim Erstellen des Bildes angegeben, (Breite=%d, Höhe=%d)',2), -12007 => array('Das Argument für MGraph::Add() ist nicht gültig für GD.',0), -12008 => array('Deine PHP- (und GD-lib-) Installation scheint keine bekannten Bildformate zu unterstützen.',0), -12009 => array('Deine PHP-Installation unterstützt das gewählte Bildformat nicht: %s',1), -12010 => array('Es konnte kein Bild als Datei %s erzeugt werden. Überprüfe, ob Du die entsprechenden Schreibrechte im aktuellen Verzeichnis hast.',1), -12011 => array('Es konnte kein Truecolor-Bild erzeugt werden. Überprüfe, ob Du wirklich die GD2-Bibliothek installiert hast.',0), -12012 => array('Es konnte kein Bild erzeugt werden. Überprüfe, ob Du wirklich die GD2-Bibliothek installiert hast.',0), - -/* -** jpgraph_pie3d -*/ - -14001 => array('Pie3D::ShowBorder(). Missbilligte Funktion. Benutze Pie3D::SetEdge(), um die Ecken der Tortenstücke zu kontrollieren.',0), -14002 => array('PiePlot3D::SetAngle() 3D-Torten-Projektionswinkel muss zwischen 5 und 85 Grad sein.',0), -14003 => array('Interne Festlegung schlug fehl. Pie3D::Pie3DSlice',0), -14004 => array('Tortenstück-Startwinkel muss zwischen 0 und 360 Grad sein.',0), -14005 => array('Pie3D Interner Fehler: Versuch, zweimal zu umhüllen bei der Suche nach dem Startindex.',0,), -14006 => array('Pie3D Interner Fehler: Z-Sortier-Algorithmus für 3D-Tortendiagramme funktioniert nicht einwandfrei (2). Versuch, zweimal zu umhüllen beim Erstellen des Bildes.',0), -14007 => array('Die Breite für das 3D-Tortendiagramm ist 0. Gib eine Breite > 0 an.',0), - -/* -** jpgraph_pie -*/ - -15001 => array('PiePLot::SetTheme() Unbekannter Stil: %s',1), -15002 => array('Argument für PiePlot::ExplodeSlice() muss ein Integer-Wert sein',0), -15003 => array('Argument für PiePlot::Explode() muss ein Vektor mit Integer-Werten sein.',0), -15004 => array('Tortenstück-Startwinkel muss zwischen 0 und 360 Grad sein.',0), -15005 => array('PiePlot::SetFont() sollte nicht mehr verwendet werden. Benutze stattdessen PiePlot->value->SetFont().',0), -15006 => array('PiePlot::SetSize() Radius für Tortendiagramm muss entweder als Bruch [0, 0.5] der Bildgröße oder als Absoluwert in Pixel im Bereich [10, 1000] angegeben werden.',0), -15007 => array('PiePlot::SetFontColor() sollte nicht mehr verwendet werden. Benutze stattdessen PiePlot->value->SetColor()..',0), -15008 => array('PiePlot::SetLabelType() der Typ für Tortendiagramme muss entweder 0 or 1 sein (nicht %d).',1), -15009 => array('Ungültiges Tortendiagramm. Die Summe aller Daten ist Null.',0), -15010 => array('Die Summe aller Daten ist Null.',0), -15011 => array('Um Bildtransformationen benutzen zu können, muss die Datei jpgraph_imgtrans.php eingefügt werden (per include).',0), // @todo translate into German -15012 => array('PiePlot::SetTheme() is no longer recommended. Use PieGraph::SetTheme()',0), - -/* -** jpgraph_plotband -*/ - -16001 => array('Die Dichte für das Pattern muss zwischen 1 und 100 sein. (Du hast %f eingegeben)',1), -16002 => array('Es wurde keine Position für das Pattern angegeben.',0), -16003 => array('Unbekannte Pattern-Definition (%d)',0), -16004 => array('Der Mindeswert für das PlotBand ist größer als der Maximalwert. Bitte korrigiere dies!',0), - - -/* -** jpgraph_polar -*/ - -17001 => array('PolarPlots müssen eine gerade Anzahl von Datenpunkten haben. Jeder Datenpunkt ist ein Tupel (Winkel, Radius).',0), -17002 => array('Unbekannte Ausrichtung für X-Achsen-Titel. (%s)',1), -//17003 => array('Set90AndMargin() wird für PolarGraph nicht unterstützt.',0), -17004 => array('Unbekannter Achsentyp für PolarGraph. Er muss entweder \'lin\' oder \'log\' sein.',0), - -/* -** jpgraph_radar -*/ - -18001 => array('ClientSideImageMaps werden für RadarPlots nicht unterstützt.',0), -18002 => array('RadarGraph::SupressTickMarks() sollte nicht mehr verwendet werden. Benutze stattdessen HideTickMarks().',0), -18003 => array('Ungültiger Achsentyp für RadarPlot (%s). Er muss entweder \'lin\' oder \'log\' sein.',1), -18004 => array('Die RadarPlot-Größe muss zwischen 0.1 und 1 sein. (Dein Wert=%f)',1), -18005 => array('RadarPlot: nicht unterstützte Tick-Dichte: %d',1), -18006 => array('Minimum Daten %f (RadarPlots sollten nur verwendet werden, wenn alle Datenpunkte einen Wert > 0 haben).',1), -18007 => array('Die Anzahl der Titel entspricht nicht der Anzahl der Datenpunkte.',0), -18008 => array('Jeder RadarPlot muss die gleiche Anzahl von Datenpunkten haben.',0), - -/* -** jpgraph_regstat -*/ - -19001 => array('Spline: Anzahl der X- und Y-Koordinaten muss gleich sein.',0), -19002 => array('Ungültige Dateneingabe für Spline. Zwei oder mehr aufeinanderfolgende X-Werte sind identisch. Jeder eigegebene X-Wert muss unterschiedlich sein, weil vom mathematischen Standpunkt ein Eins-zu-Eins-Mapping vorliegen muss, d.h. jeder X-Wert korrespondiert mit exakt einem Y-Wert.',0), -19003 => array('Bezier: Anzahl der X- und Y-Koordinaten muss gleich sein.',0), - -/* -** jpgraph_scatter -*/ - -20001 => array('Fieldplots müssen die gleiche Anzahl von X und Y Datenpunkten haben.',0), -20002 => array('Bei Fieldplots muss ein Winkel für jeden X und Y Datenpunkt angegeben werden.',0), -20003 => array('Scatterplots müssen die gleiche Anzahl von X- und Y-Datenpunkten haben.',0), - -/* -** jpgraph_stock -*/ - -21001 => array('Die Anzahl der Datenwerte für Stock-Charts müssen ein Mehrfaches von %d Datenpunkten sein.',1), - -/* -** jpgraph_plotmark -*/ - -23001 => array('Der Marker "%s" existiert nicht in der Farbe: %d',2), -23002 => array('Der Farb-Index ist zu hoch für den Marker "%s"',1), -23003 => array('Ein Dateiname muss angegeben werden, wenn Du den Marker-Typ auf MARK_IMG setzt.',0), - -/* -** jpgraph_utils -*/ - -24001 => array('FuncGenerator : Keine Funktion definiert. ',0), -24002 => array('FuncGenerator : Syntax-Fehler in der Funktionsdefinition ',0), -24003 => array('DateScaleUtils: Unknown tick type specified in call to GetTicks()',0), -24004 => array('ReadCSV2: Die anzahl der spalten fehler in %s reihe %d',2), -/* -** jpgraph -*/ - -25001 => array('Diese PHP-Installation ist nicht mit der GD-Bibliothek kompiliert. Bitte kompiliere PHP mit GD-Unterstützung neu, damit JpGraph funktioniert. (Weder die Funktion imagetypes() noch imagecreatefromstring() existiert!)',0), -25002 => array('Diese PHP-Installation scheint nicht die benötigte GD-Bibliothek zu unterstützen. Bitte schau in der PHP-Dokumentation nach, wie man die GD-Bibliothek installiert und aktiviert.',0), -25003 => array('Genereller PHP Fehler : Bei %s:%d : %s',3), -25004 => array('Genereller PHP Fehler : %s ',1), -25005 => array('PHP_SELF, die PHP-Global-Variable kann nicht ermittelt werden. PHP kann nicht von der Kommandozeile gestartet werden, wenn der Cache oder die Bilddateien automatisch benannt werden sollen.',0), -25006 => array('Die Benutzung der FF_CHINESE (FF_BIG5) Schriftfamilie benötigt die iconv() Funktion in Deiner PHP-Konfiguration. Dies wird nicht defaultmäßig in PHP kompiliert (benötigt "--width-iconv" bei der Konfiguration).',0), -25007 => array('Du versuchst das lokale (%s) zu verwenden, was von Deiner PHP-Installation nicht unterstützt wird. Hinweis: Benutze \'\', um das defaultmäßige Lokale für diese geographische Region festzulegen.',1), -25008 => array('Die Bild-Breite und Höhe in Graph::Graph() müssen numerisch sein',0), -25009 => array('Die Skalierung der Achsen muss angegeben werden mit Graph::SetScale()',0), - -25010 => array('Graph::Add() Du hast versucht, einen leeren Plot zum Graph hinzuzufügen.',0), -25011 => array('Graph::AddY2() Du hast versucht, einen leeren Plot zum Graph hinzuzufügen.',0), -25012 => array('Graph::AddYN() Du hast versucht, einen leeren Plot zum Graph hinzuzufügen.',0), -25013 => array('Es können nur Standard-Plots zu multiplen Y-Achsen hinzugefügt werden',0), -25014 => array('Graph::AddText() Du hast versucht, einen leeren Text zum Graph hinzuzufügen.',0), -25015 => array('Graph::AddLine() Du hast versucht, eine leere Linie zum Graph hinzuzufügen.',0), -25016 => array('Graph::AddBand() Du hast versucht, ein leeres Band zum Graph hinzuzufügen.',0), -25017 => array('Du benutzt GD 2.x und versuchst, ein Hintergrundbild in einem Truecolor-Bild zu verwenden. Um Hintergrundbilder mit GD 2.x zu verwenden, ist es notwendig, Truecolor zu aktivieren, indem die USE_TRUECOLOR-Konstante auf TRUE gesetzt wird. Wegen eines Bugs in GD 2.0.1 ist die Qualität der Schrift sehr schlecht, wenn Truetype-Schrift in Truecolor-Bildern verwendet werden.',0), -25018 => array('Falscher Dateiname für Graph::SetBackgroundImage() : "%s" muss eine gültige Dateinamenerweiterung (jpg,gif,png) haben, wenn die automatische Dateityperkennung verwenndet werden soll.',1), -25019 => array('Unbekannte Dateinamenerweiterung (%s) in Graph::SetBackgroundImage() für Dateiname: "%s"',2), - -25020 => array('Graph::SetScale(): Dar Maximalwert muss größer sein als der Mindestwert.',0), -25021 => array('Unbekannte Achsendefinition für die Y-Achse. (%s)',1), -25022 => array('Unbekannte Achsendefinition für die X-Achse. (%s)',1), -25023 => array('Nicht unterstützter Y2-Achsentyp: "%s" muss einer von (lin,log,int) sein.',1), -25024 => array('Nicht unterstützter X-Achsentyp: "%s" muss einer von (lin,log,int) sein.',1), -25025 => array('Nicht unterstützte Tick-Dichte: %d',1), -25026 => array('Nicht unterstützter Typ der nicht angegebenen Y-Achse. Du hast entweder: 1. einen Y-Achsentyp für automatisches Skalieren definiert, aber keine Plots angegeben. 2. eine Achse direkt definiert, aber vergessen, die Tick-Dichte zu festzulegen.',0), -25027 => array('Kann cached CSIM "%s" zum Lesen nicht öffnen.',1), -25028 => array('Apache/PHP hat keine Schreibrechte, in das CSIM-Cache-Verzeichnis (%s) zu schreiben. Überprüfe die Rechte.',1), -25029 => array('Kann nicht in das CSIM "%s" schreiben. Überprüfe die Schreibrechte und den freien Speicherplatz.',1), - -25030 => array('Fehlender Skriptname für StrokeCSIM(). Der Name des aktuellen Skriptes muss als erster Parameter von StrokeCSIM() angegeben werden.',0), -25031 => array('Der Achsentyp muss mittels Graph::SetScale() angegeben werden.',0), -25032 => array('Es existieren keine Plots für die Y-Achse nbr:%d',1), -25033 => array('',0), -25034 => array('Undefinierte X-Achse kann nicht gezeichnet werden. Es wurden keine Plots definiert.',0), -25035 => array('Du hast Clipping aktiviert. Clipping wird nur für Diagramme mit 0 oder 90 Grad Rotation unterstützt. Bitte verändere Deinen Rotationswinkel (=%d Grad) dementsprechend oder deaktiviere Clipping.',1), -25036 => array('Unbekannter Achsentyp AxisStyle() : %s',1), -25037 => array('Das Bildformat Deines Hintergrundbildes (%s) wird von Deiner System-Konfiguration nicht unterstützt. ',1), -25038 => array('Das Hintergrundbild scheint von einem anderen Typ (unterschiedliche Dateierweiterung) zu sein als der angegebene Typ. Angegebenen: %s; Datei: %s',2), -25039 => array('Hintergrundbild kann nicht gelesen werden: "%s"',1), - -25040 => array('Es ist nicht möglich, sowohl ein Hintergrundbild als auch eine Hintergrund-Landesflagge anzugeben.',0), -25041 => array('Um Landesflaggen als Hintergrund benutzen zu können, muss die Datei "jpgraph_flags.php" eingefügt werden (per include).',0), -25042 => array('Unbekanntes Hintergrundbild-Layout',0), -25043 => array('Unbekannter Titelhintergrund-Stil.',0), -25044 => array('Automatisches Skalieren kann nicht verwendet werden, weil es unmöglich ist, einen gültigen min/max Wert für die Y-Achse zu ermitteln (nur Null-Werte).',0), -25045 => array('Die Schriftfamilien FF_HANDWRT und FF_BOOK sind wegen Copyright-Problemen nicht mehr verfügbar. Diese Schriften können nicht mehr mit JpGraph verteilt werden. Bitte lade Dir Schriften von http://corefonts.sourceforge.net/ herunter.',0), -25046 => array('Angegebene TTF-Schriftfamilie (id=%d) ist unbekannt oder existiert nicht. Bitte merke Dir, dass TTF-Schriften wegen Copyright-Problemen nicht mit JpGraph mitgeliefert werden. Du findest MS-TTF-Internetschriften (arial, courier, etc.) zum Herunterladen unter http://corefonts.sourceforge.net/',1), -25047 => array('Stil %s ist nicht verfügbar für Schriftfamilie %s',2), -25048 => array('Unbekannte Schriftstildefinition [%s].',1), -25049 => array('Schriftdatei "%s" ist nicht lesbar oder existiert nicht.',1), - -25050 => array('Erstes Argument für Text::Text() muss ein String sein.',0), -25051 => array('Ungültige Richtung angegeben für Text.',0), -25052 => array('PANIK: Interner Fehler in SuperScript::Stroke(). Unbekannte vertikale Ausrichtung für Text.',0), -25053 => array('PANIK: Interner Fehler in SuperScript::Stroke(). Unbekannte horizontale Ausrichtung für Text.',0), -25054 => array('Interner Fehler: Unbekannte Grid-Achse %s',1), -25055 => array('Axis::SetTickDirection() sollte nicht mehr verwendet werden. Benutze stattdessen Axis::SetTickSide().',0), -25056 => array('SetTickLabelMargin() sollte nicht mehr verwendet werden. Benutze stattdessen Axis::SetLabelMargin().',0), -25057 => array('SetTextTicks() sollte nicht mehr verwendet werden. Benutze stattdessen SetTextTickInterval().',0), -25058 => array('TextLabelIntevall >= 1 muss angegeben werden.',0), -25059 => array('SetLabelPos() sollte nicht mehr verwendet werden. Benutze stattdessen Axis::SetLabelSide().',0), - -25060 => array('Unbekannte Ausrichtung angegeben für X-Achsentitel (%s).',1), -25061 => array('Unbekannte Ausrichtung angegeben für Y-Achsentitel (%s).',1), -25062 => array('Label unter einem Winkel werden für die Y-Achse nicht unterstützt.',0), -25063 => array('Ticks::SetPrecision() sollte nicht mehr verwendet werden. Benutze stattdessen Ticks::SetLabelFormat() (oder Ticks::SetFormatCallback()).',0), -25064 => array('Kleinere oder größere Schrittgröße ist 0. Überprüfe, ob Du fälschlicherweise SetTextTicks(0) in Deinem Skript hast. Wenn dies nicht der Fall ist, bist Du eventuell über einen Bug in JpGraph gestolpert. Bitte sende einen Report und füge den Code an, der den Fehler verursacht hat.',0), -25065 => array('Tick-Positionen müssen als array() angegeben werden',0), -25066 => array('Wenn die Tick-Positionen und -Label von Hand eingegeben werden, muss die Anzahl der Ticks und der Label gleich sein.',0), -25067 => array('Deine von Hand eingegebene Achse und Ticks sind nicht korrekt. Die Skala scheint zu klein zu sein für den Tickabstand.',0), -25068 => array('Ein Plot hat eine ungültige Achse. Dies kann beispielsweise der Fall sein, wenn Du automatisches Text-Skalieren verwendest, um ein Liniendiagramm zu zeichnen mit nur einem Datenpunkt, oder wenn die Bildfläche zu klein ist. Es kann auch der Fall sein, dass kein Datenpunkt einen numerischen Wert hat (vielleicht nur \'-\' oder \'x\').',0), -25069 => array('Grace muss größer sein als 0',0), - -25070 => array('Deine Daten enthalten nicht-numerische Werte.',0), -25071 => array('Du hast mit SetAutoMin() einen Mindestwert angegeben, der größer ist als der Maximalwert für die Achse. Dies ist nicht möglich.',0), -25072 => array('Du hast mit SetAutoMax() einen Maximalwert angegeben, der kleiner ist als der Minimalwert der Achse. Dies ist nicht möglich.',0), -25073 => array('Interner Fehler. Der Integer-Skalierungs-Algorithmus-Vergleich ist außerhalb der Grenzen (r=%f).',1), -25074 => array('Interner Fehler. Der Skalierungsbereich ist negativ (%f) [für %s Achse]. Dieses Problem könnte verursacht werden durch den Versuch, \'ungültige\' Werte in die Daten-Vektoren einzugeben (z.B. nur String- oder NULL-Werte), was beim automatischen Skalieren einen Fehler erzeugt.',2), -25075 => array('Die automatischen Ticks können nicht gesetzt werden, weil min==max.',0), -25077 => array('Einstellfaktor für die Farbe muss größer sein als 0',0), -25078 => array('Unbekannte Farbe: %s',1), -25079 => array('Unbekannte Farbdefinition: %s, Größe=%d',2), - -25080 => array('Der Alpha-Parameter für Farben muss zwischen 0.0 und 1.0 liegen.',0), -25081 => array('Das ausgewählte Grafikformat wird entweder nicht unterstützt oder ist unbekannt [%s]',1), -25082 => array('Es wurden ungültige Größen für Breite und Höhe beim Erstellen des Bildes definiert (Breite=%d, Höhe=%d).',2), -25083 => array('Es wurde eine ungültige Größe beim Kopieren des Bildes angegeben. Die Größe für das kopierte Bild wurde auf 1 Pixel oder weniger gesetzt.',0), -25084 => array('Fehler beim Erstellen eines temporären GD-Canvas. Möglicherweise liegt ein Arbeitsspeicherproblem vor.',0), -25085 => array('Ein Bild kann nicht aus dem angegebenen String erzeugt werden. Er ist entweder in einem nicht unterstützen Format oder er represäntiert ein kaputtes Bild.',0), -25086 => array('Du scheinst nur GD 1.x installiert zu haben. Um Alphablending zu aktivieren, ist GD 2.x oder höher notwendig. Bitte installiere GD 2.x oder versichere Dich, dass die Konstante USE_GD2 richtig gesetzt ist. Standardmäßig wird die installierte GD-Version automatisch erkannt. Ganz selten wird GD2 erkannt, obwohl nur GD1 installiert ist. Die Konstante USE_GD2 muss dann zu "false" gesetzt werden.',0), -25087 => array('Diese PHP-Version wurde ohne TTF-Unterstützung konfiguriert. PHP muss mit TTF-Unterstützung neu kompiliert und installiert werden.',0), -25088 => array('Die GD-Schriftunterstützung wurde falsch konfiguriert. Der Aufruf von imagefontwidth() ist fehlerhaft.',0), -25089 => array('Die GD-Schriftunterstützung wurde falsch konfiguriert. Der Aufruf von imagefontheight() ist fehlerhaft.',0), - -25090 => array('Unbekannte Richtung angegeben im Aufruf von StrokeBoxedText() [%s].',1), -25091 => array('Die interne Schrift untestützt das Schreiben von Text in einem beliebigen Winkel nicht. Benutze stattdessen TTF-Schriften.',0), -25092 => array('Es liegt entweder ein Konfigurationsproblem mit TrueType oder ein Problem beim Lesen der Schriftdatei "%s" vor. Versichere Dich, dass die Datei existiert und Leserechte und -pfad vergeben sind. (wenn \'basedir\' restriction in PHP aktiviert ist, muss die Schriftdatei im Dokumentwurzelverzeichnis abgelegt werden). Möglicherweise ist die FreeType-Bibliothek falsch installiert. Versuche, mindestens zur FreeType-Version 2.1.13 zu aktualisieren und kompiliere GD mit einem korrekten Setup neu, damit die FreeType-Bibliothek gefunden werden kann.',1), -25093 => array('Die Schriftdatei "%s" kann nicht gelesen werden beim Aufruf von Image::GetBBoxTTF. Bitte versichere Dich, dass die Schrift gesetzt wurde, bevor diese Methode aufgerufen wird, und dass die Schrift im TTF-Verzeichnis installiert ist.',1), -25094 => array('Die Textrichtung muss in einem Winkel zwischen 0 und 90 engegeben werden.',0), -25095 => array('Unbekannte Schriftfamilien-Definition. ',0), -25096 => array('Der Farbpalette können keine weiteren Farben zugewiesen werden. Dem Bild wurde bereits die größtmögliche Anzahl von Farben (%d) zugewiesen und die Palette ist voll. Verwende stattdessen ein TrueColor-Bild',0), -25097 => array('Eine Farbe wurde als leerer String im Aufruf von PushColor() angegegeben.',0), -25098 => array('Negativer Farbindex. Unpassender Aufruf von PopColor().',0), -25099 => array('Die Parameter für Helligkeit und Kontrast sind außerhalb des zulässigen Bereichs [-1,1]',0), - -25100 => array('Es liegt ein Problem mit der Farbpalette und dem GD-Setup vor. Bitte deaktiviere anti-aliasing oder verwende GD2 mit TrueColor. Wenn die GD2-Bibliothek installiert ist, versichere Dich, dass die Konstante USE_GD2 auf "true" gesetzt und TrueColor aktiviert ist.',0), -25101 => array('Ungültiges numerisches Argument für SetLineStyle(): (%d)',1), -25102 => array('Ungültiges String-Argument für SetLineStyle(): %s',1), -25103 => array('Ungültiges Argument für SetLineStyle %s',1), -25104 => array('Unbekannter Linientyp: %s',1), -25105 => array('Es wurden NULL-Daten für ein gefülltes Polygon angegeben. Sorge dafür, dass keine NULL-Daten angegeben werden.',0), -25106 => array('Image::FillToBorder : es können keine weiteren Farben zugewiesen werden.',0), -25107 => array('In Datei "%s" kann nicht geschrieben werden. Überprüfe die aktuellen Schreibrechte.',1), -25108 => array('Das Bild kann nicht gestreamt werden. Möglicherweise liegt ein Fehler im PHP/GD-Setup vor. Kompiliere PHP neu und verwende die eingebaute GD-Bibliothek, die mit PHP angeboten wird.',0), -25109 => array('Deine PHP- (und GD-lib-) Installation scheint keine bekannten Grafikformate zu unterstützen. Sorge zunächst dafür, dass GD als PHP-Modul kompiliert ist. Wenn Du außerdem JPEG-Bilder verwenden willst, musst Du die JPEG-Bibliothek installieren. Weitere Details sind in der PHP-Dokumentation zu finden.',0), - -25110 => array('Dein PHP-Installation unterstützt das gewählte Grafikformat nicht: %s',1), -25111 => array('Das gecachete Bild %s kann nicht gelöscht werden. Problem mit den Rechten?',1), -25112 => array('Das Datum der gecacheten Datei (%s) liegt in der Zukunft.',1), -25113 => array('Das gecachete Bild %s kann nicht gelöscht werden. Problem mit den Rechten?',1), -25114 => array('PHP hat nicht die erforderlichen Rechte, um in die Cache-Datei %s zu schreiben. Bitte versichere Dich, dass der Benutzer, der PHP anwendet, die entsprechenden Schreibrechte für die Datei hat, wenn Du das Cache-System in JPGraph verwenden willst.',1), -25115 => array('Berechtigung für gecachetes Bild %s kann nicht gesetzt werden. Problem mit den Rechten?',1), -25116 => array('Datei kann nicht aus dem Cache %s geöffnet werden',1), -25117 => array('Gecachetes Bild %s kann nicht zum Lesen geöffnet werden.',1), -25118 => array('Verzeichnis %s kann nicht angelegt werden. Versichere Dich, dass PHP die Schreibrechte in diesem Verzeichnis hat.',1), -25119 => array('Rechte für Datei %s können nicht gesetzt werden. Problem mit den Rechten?',1), - -25120 => array('Die Position für die Legende muss als Prozentwert im Bereich 0-1 angegeben werden.',0), -25121 => array('Eine leerer Datenvektor wurde für den Plot eingegeben. Es muss wenigstens ein Datenpunkt vorliegen.',0), -25122 => array('Stroke() muss als Subklasse der Klasse Plot definiert sein.',0), -25123 => array('Du kannst keine Text-X-Achse mit X-Koordinaten verwenden. Benutze stattdessen eine "int" oder "lin" Achse.',0), -25124 => array('Der Eingabedatenvektor mus aufeinanderfolgende Werte von 0 aufwärts beinhalten. Der angegebene Y-Vektor beginnt mit leeren Werten (NULL).',0), -25125 => array('Ungültige Richtung für statische Linie.',0), -25126 => array('Es kann kein TrueColor-Bild erzeugt werden. Überprüfe, ob die GD2-Bibliothek und PHP korrekt aufgesetzt wurden.',0), -25127 => array('The library has been configured for automatic encoding conversion of Japanese fonts. This requires that PHP has the mb_convert_encoding() function. Your PHP installation lacks this function (PHP needs the "--enable-mbstring" when compiled).',0), -25128 => array('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.',0), -25129 => array('Anti-alias can not be used with dashed lines. Please disable anti-alias or use solid lines.',0), -25130 => array('Too small plot area. (%d x %d). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins.',2), - -25131 => array('StrokeBoxedText2() only supports TTF fonts and not built-in bitmap fonts.',0), -25132 => array('Undefined property %s.',1), // @todo translate -25133 => array('Use Graph::SetTheme() after Graph::SetScale().',0), // @todo translate - -/* -** jpgraph_led -*/ - -25500 => array('Multibyte strings must be enabled in the PHP installation in order to run the LED module so that the function mb_strlen() is available. See PHP documentation for more information.',0), - - -/* -**--------------------------------------------------------------------------------------------- -** Pro-version strings -**--------------------------------------------------------------------------------------------- -*/ - -/* -** jpgraph_table -*/ - -27001 => array('GTextTable: Ungültiges Argument für Set(). Das Array-Argument muss 2-- dimensional sein.',0), -27002 => array('GTextTable: Ungültiges Argument für Set()',0), -27003 => array('GTextTable: Falsche Anzahl von Argumenten für GTextTable::SetColor()',0), -27004 => array('GTextTable: Angegebener Zellenbereich, der verschmolzen werden soll, ist ungültig.',0), -27005 => array('GTextTable: Bereits verschmolzene Zellen im Bereich (%d,%d) bis (%d,%d) können nicht ein weiteres Mal verschmolzen werden.',4), -27006 => array('GTextTable: Spalten-Argument = %d liegt außerhalb der festgelegten Tabellengröße.',1), -27007 => array('GTextTable: Zeilen-Argument = %d liegt außerhalb der festgelegten Tabellengröße.',1), -27008 => array('GTextTable: Spalten- und Zeilengröße müssen zu den Dimensionen der Tabelle passen.',0), -27009 => array('GTextTable: Die Anzahl der Tabellenspalten oder -zeilen ist 0. Versichere Dich, dass die Methoden Init() oder Set() aufgerufen werden.',0), -27010 => array('GTextTable: Es wurde keine Ausrichtung beim Aufruf von SetAlign() angegeben.',0), -27011 => array('GTextTable: Es wurde eine unbekannte Ausrichtung beim Aufruf von SetAlign() abgegeben. Horizontal=%s, Vertikal=%s',2), -27012 => array('GTextTable: Interner Fehler. Es wurde ein ungültiges Argument festgeleget %s',1), -27013 => array('GTextTable: Das Argument für FormatNumber() muss ein String sein.',0), -27014 => array('GTextTable: Die Tabelle wurde weder mit einem Aufruf von Set() noch von Init() initialisiert.',0), -27015 => array('GTextTable: Der Zellenbildbedingungstyp muss entweder TIMG_WIDTH oder TIMG_HEIGHT sein.',0), - -/* -** jpgraph_windrose -*/ - -22001 => array('Die Gesamtsumme der prozentualen Anteile aller Windrosenarme darf 100%% nicht überschreiten!\n(Aktuell max: %d)',1), -22002 => array('Das Bild ist zu klein für eine Skala. Bitte vergrößere das Bild.',0), -22004 => array('Die Etikettendefinition für Windrosenrichtungen müssen 16 Werte haben (eine für jede Kompassrichtung).',0), -22005 => array('Der Linientyp für radiale Linien muss einer von ("solid","dotted","dashed","longdashed") sein.',0), -22006 => array('Es wurde ein ungültiger Windrosentyp angegeben.',0), -22007 => array('Es wurden zu wenig Werte für die Bereichslegende angegeben.',0), -22008 => array('Interner Fehler: Versuch, eine freie Windrose zu plotten, obwohl der Typ keine freie Windrose ist.',0), -22009 => array('Du hast die gleiche Richtung zweimal angegeben, einmal mit einem Winkel und einmal mit einer Kompassrichtung (%f Grad).',0), -22010 => array('Die Richtung muss entweder ein numerischer Wert sein oder eine der 16 Kompassrichtungen',0), -22011 => array('Der Windrosenindex muss ein numerischer oder Richtungswert sein. Du hast angegeben Index=%d',1), -22012 => array('Die radiale Achsendefinition für die Windrose enthält eine nicht aktivierte Richtung.',0), -22013 => array('Du hast dasselbe Look&Feel für die gleiche Kompassrichtung zweimal engegeben, einmal mit Text und einmal mit einem Index (Index=%d)',1), -22014 => array('Der Index für eine Kompassrichtung muss zwischen 0 und 15 sein.',0), -22015 => array('Du hast einen unbekannten Windrosenplottyp angegeben.',0), -22016 => array('Der Windrosenarmindex muss ein numerischer oder ein Richtungswert sein.',0), -22017 => array('Die Windrosendaten enthalten eine Richtung, die nicht aktiviert ist. Bitte berichtige, welche Label angezeigt werden sollen.',0), -22018 => array('Du hast für dieselbe Kompassrichtung zweimal Daten angegeben, einmal mit Text und einmal mit einem Index (Index=%d)',1), -22019 => array('Der Index für eine Richtung muss zwischen 0 und 15 sein. Winkel dürfen nicht für einen regelmäßigen Windplot angegeben werden, sondern entweder ein Index oder eine Kompassrichtung.',0), -22020 => array('Der Windrosenplot ist zu groß für die angegebene Bildgröße. Benutze entweder WindrosePlot::SetSize(), um den Plot kleiner zu machen oder vergrößere das Bild im ursprünglichen Aufruf von WindroseGraph().',0), -22021 => array('It is only possible to add Text, IconPlot or WindrosePlot to a Windrose Graph',0), - -/* -** jpgraph_odometer -*/ - -13001 => array('Unbekannter Nadeltypstil (%d).',1), -13002 => array('Ein Wert für das Odometer (%f) ist außerhalb des angegebenen Bereichs [%f,%f]',3), - -/* -** jpgraph_barcode -*/ - -1001 => array('Unbekannte Kodier-Specifikation: %s',1), -1002 => array('datenvalidierung schlug fehl. [%s] kann nicht mittels der Kodierung "%s" kodiert werden',2), -1003 => array('Interner Kodierfehler. Kodieren von %s ist nicht möglich in Code 128',1), -1004 => array('Interner barcode Fehler. Unbekannter UPC-E Kodiertyp: %s',1), -1005 => array('Interner Fehler. Das Textzeichen-Tupel (%s, %s) kann nicht im Code-128 Zeichensatz C kodiert werden.',2), -1006 => array('Interner Kodierfehler für CODE 128. Es wurde versucht, CTRL in CHARSET != A zu kodieren.',0), -1007 => array('Interner Kodierfehler für CODE 128. Es wurde versucht, DEL in CHARSET != B zu kodieren.',0), -1008 => array('Interner Kodierfehler für CODE 128. Es wurde versucht, kleine Buchstaben in CHARSET != B zu kodieren.',0), -1009 => array('Kodieren mittels CODE 93 wird noch nicht unterstützt.',0), -1010 => array('Kodieren mittels POSTNET wird noch nicht unterstützt.',0), -1011 => array('Nicht untrstütztes Barcode-Backend für den Typ %s',1), - -/* -** PDF417 -*/ - -26000 => array('PDF417: The PDF417 module requires that the PHP installation must support the function bcmod(). This is normally enabled at compile time. See documentation for more information.',0), -26001 => array('PDF417: Die Anzahl der Spalten muss zwischen 1 und 30 sein.',0), -26002 => array('PDF417: Der Fehler-Level muss zwischen 0 und 8 sein.',0), -26003 => array('PDF417: Ungültiges Format für Eingabedaten, um sie mit PDF417 zu kodieren.',0), -26004 => array('PDF417: die eigebenen Daten können nicht mit Fehler-Level %d und %d spalten kodiert werden, weil daraus zu viele Symbole oder mehr als 90 Zeilen resultieren.',2), -26005 => array('PDF417: Die Datei "%s" kann nicht zum Schreiben geöffnet werden.',1), -26006 => array('PDF417: Interner Fehler. Die Eingabedatendatei für PDF417-Cluster %d ist fehlerhaft.',1), -26007 => array('PDF417: Interner Fehler. GetPattern: Ungültiger Code-Wert %d (Zeile %d)',2), -26008 => array('PDF417: Interner Fehler. Modus wurde nicht in der Modusliste!! Modus %d',1), -26009 => array('PDF417: Kodierfehler: Ungültiges Zeichen. Zeichen kann nicht mit ASCII-Code %d kodiert werden.',1), -26010 => array('PDF417: Interner Fehler: Keine Eingabedaten beim Dekodieren.',0), -26011 => array('PDF417: Kodierfehler. Numerisches Kodieren bei nicht-numerischen Daten nicht möglich.',0), -26012 => array('PDF417: Interner Fehler. Es wurden für den Binary-Kompressor keine Daten zum Dekodieren eingegeben.',0), -26013 => array('PDF417: Interner Fehler. Checksum Fehler. Koeffiziententabellen sind fehlerhaft.',0), -26014 => array('PDF417: Interner Fehler. Es wurden keine Daten zum Berechnen von Kodewörtern eingegeben.',0), -26015 => array('PDF417: Interner Fehler. Ein Eintrag 0 in die Statusübertragungstabellen ist nicht NULL. Eintrag 1 = (%s)',1), -26016 => array('PDF417: Interner Fehler: Nichtregistrierter Statusübertragungsmodus beim Dekodieren.',0), - - -/* -** jpgraph_contour -*/ - -28001 => array('Dritten parameter fur Contour muss ein vector der fargen sind.',0), -28002 => array('Die anzahlen der farges jeder isobar linien muss gleich sein.',0), -28003 => array('ContourPlot Interner Fehler: isobarHCrossing: Spalten index ist zu hoch (%d)',1), -28004 => array('ContourPlot Interner Fehler: isobarHCrossing: Reihe index ist zu hoch (%d)',1), -28005 => array('ContourPlot Interner Fehler: isobarVCrossing: Reihe index ist zu hoch (%d)',1), -28006 => array('ContourPlot Interner Fehler: isobarVCrossing: Spalten index ist zu hoch (%d)',1), -28007 => array('ContourPlot. Interpolation faktor ist zu hoch (>5)',0), - - -/* - * jpgraph_matrix and colormap -*/ -29201 => array('Min range value must be less or equal to max range value for colormaps',0), -29202 => array('The distance between min and max value is too small for numerical precision',0), -29203 => array('Number of color quantification level must be at least %d',1), -29204 => array('Number of colors (%d) is invalid for this colormap. It must be a number that can be written as: %d + k*%d',3), -29205 => array('Colormap specification out of range. Must be an integer in range [0,%d]',1), -29206 => array('Invalid object added to MatrixGraph',0), -29207 => array('Empty input data specified for MatrixPlot',0), -29208 => array('Unknown side specifiction for matrix labels "%s"',1), -29209 => array('CSIM Target matrix must be the same size as the data matrix (csim=%d x %d, data=%d x %d)',4), -29210 => array('CSIM Target for matrix labels does not match the number of labels (csim=%d, labels=%d)',2), - - -/* -* jpgraph_theme -*/ -30001 => array("Theme::%s() is not defined. \nPlease make %s(\$graph) function in your theme classs.",2), - - -); - -?> diff --git a/#jpgraph/src/lang/en.inc.php b/#jpgraph/src/lang/en.inc.php deleted file mode 100644 index 101e8bd8..00000000 --- a/#jpgraph/src/lang/en.inc.php +++ /dev/null @@ -1,545 +0,0 @@ -,) -$_jpg_messages = array( - -/* -** Headers already sent error. This is formatted as HTML different since this will be sent back directly as text -*/ -10 => array('
JpGraph Error: -HTTP headers have already been sent.
Caused by output from file %s at line %d.
Explanation:
HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it\'s image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).

Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.

For example it is a common mistake to leave a blank line before the opening "<?php".

',2), - -/* -** Setup errors -*/ -11 => array('No path specified for CACHE_DIR. Please specify CACHE_DIR manually in jpg-config.inc',0), -12 => array('No path specified for TTF_DIR and path can not be determined automatically. Please specify TTF_DIR manually (in jpg-config.inc).',0), -13 => array('The installed PHP version (%s) is not compatible with this release of the library. The library requires at least PHP version %s',2), - - -/* -** jpgraph_bar -*/ - -2001 => array('Number of colors is not the same as the number of patterns in BarPlot::SetPattern()',0), -2002 => array('Unknown pattern specified in call to BarPlot::SetPattern()',0), -2003 => array('Number of X and Y points are not equal. Number of X-points: %d Number of Y-points: %d',2), -2004 => array('All values for a barplot must be numeric. You have specified value nr [%d] == %s',2), -2005 => array('You have specified an empty array for shadow colors in the bar plot.',0), -2006 => array('Unknown position for values on bars : %s',1), -2007 => array('Cannot create GroupBarPlot from empty plot array.',0), -2008 => array('Group bar plot element nbr %d is undefined or empty.',0), -2009 => array('One of the objects submitted to GroupBar is not a BarPlot. Make sure that you create the GroupBar plot from an array of BarPlot or AccBarPlot objects. (Class = %s)',1), -2010 => array('Cannot create AccBarPlot from empty plot array.',0), -2011 => array('Acc bar plot element nbr %d is undefined or empty.',1), -2012 => array('One of the objects submitted to AccBar is not a BarPlot. Make sure that you create the AccBar plot from an array of BarPlot objects. (Class=%s)',1), -2013 => array('You have specified an empty array for shadow colors in the bar plot.',0), -2014 => array('Number of datapoints for each data set in accbarplot must be the same',0), -2015 => array('Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-coordinates',0), - - -/* -** jpgraph_date -*/ - -3001 => array('It is only possible to use either SetDateAlign() or SetTimeAlign() but not both',0), - -/* -** jpgraph_error -*/ - -4002 => array('Error in input data to LineErrorPlot. Number of data points must be a multiple of 3',0), - -/* -** jpgraph_flags -*/ - -5001 => array('Unknown flag size (%d).',1), -5002 => array('Flag index %s does not exist.',1), -5003 => array('Invalid ordinal number (%d) specified for flag index.',1), -5004 => array('The (partial) country name %s does not have a corresponding flag image. The flag may still exist but under another name, e.g. instead of "usa" try "united states".',1), - - -/* -** jpgraph_gantt -*/ - -6001 => array('Internal error. Height for ActivityTitles is < 0',0), -6002 => array('You can\'t specify negative sizes for Gantt graph dimensions. Use 0 to indicate that you want the library to automatically determine a dimension.',0), -6003 => array('Invalid format for Constrain parameter at index=%d in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Constrain-To,Constrain-Type)',1), -6004 => array('Invalid format for Progress parameter at index=%d in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Progress)',1), -6005 => array('SetScale() is not meaningful with Gantt charts.',0), -6006 => array('Cannot autoscale Gantt chart. No dated activities exist. [GetBarMinMax() start >= n]',0), -6007 => array('Sanity check for automatic Gantt chart size failed. Either the width (=%d) or height (=%d) is larger than MAX_GANTTIMG_SIZE. This could potentially be caused by a wrong date in one of the activities.',2), -6008 => array('You have specified a constrain from row=%d to row=%d which does not have any activity',2), -6009 => array('Unknown constrain type specified from row=%d to row=%d',2), -6010 => array('Illegal icon index for Gantt builtin icon [%d]',1), -6011 => array('Argument to IconImage must be string or integer',0), -6012 => array('Unknown type in Gantt object title specification',0), -6015 => array('Illegal vertical position %d',1), -6016 => array('Date string (%s) specified for Gantt activity can not be interpretated. Please make sure it is a valid time string, e.g. 2005-04-23 13:30',1), -6017 => array('Unknown date format in GanttScale (%s).',1), -6018 => array('Interval for minutes must divide the hour evenly, e.g. 1,5,10,12,15,20,30 etc You have specified an interval of %d minutes.',1), -6019 => array('The available width (%d) for minutes are to small for this scale to be displayed. Please use auto-sizing or increase the width of the graph.',1), -6020 => array('Interval for hours must divide the day evenly, e.g. 0:30, 1:00, 1:30, 4:00 etc. You have specified an interval of %d',1), -6021 => array('Unknown formatting style for week.',0), -6022 => array('Gantt scale has not been specified.',0), -6023 => array('If you display both hour and minutes the hour interval must be 1 (Otherwise it doesn\'t make sense to display minutes).',0), -6024 => array('CSIM Target must be specified as a string. Start of target is: %d',1), -6025 => array('CSIM Alt text must be specified as a string. Start of alt text is: %d',1), -6027 => array('Progress value must in range [0, 1]',0), -6028 => array('Specified height (%d) for gantt bar is out of range.',1), -6029 => array('Offset for vertical line must be in range [0,1]',0), -6030 => array('Unknown arrow direction for link.',0), -6031 => array('Unknown arrow type for link.',0), -6032 => array('Internal error: Unknown path type (=%d) specified for link.',1), -6033 => array('Array of fonts must contain arrays with 3 elements, i.e. (Family, Style, Size)',0), - -/* -** jpgraph_gradient -*/ - -7001 => array('Unknown gradient style (=%d).',1), - -/* -** jpgraph_iconplot -*/ - -8001 => array('Mix value for icon must be between 0 and 100.',0), -8002 => array('Anchor position for icons must be one of "top", "bottom", "left", "right" or "center"',0), -8003 => array('It is not possible to specify both an image file and a country flag for the same icon.',0), -8004 => array('In order to use Country flags as icons you must include the "jpgraph_flags.php" file.',0), - -/* -** jpgraph_imgtrans -*/ - -9001 => array('Value for image transformation out of bounds. Vanishing point on horizon must be specified as a value between 0 and 1.',0), - -/* -** jpgraph_lineplot -*/ - -10001 => array('LinePlot::SetFilled() is deprecated. Use SetFillColor()',0), -10002 => array('Plot too complicated for fast line Stroke. Use standard Stroke()',0), -10003 => array('Each plot in an accumulated lineplot must have the same number of data points.',0), - -/* -** jpgraph_log -*/ - -11001 => array('Your data contains non-numeric values.',0), -11002 => array('Negative data values can not be used in a log scale.',0), -11003 => array('Your data contains non-numeric values.',0), -11004 => array('Scale error for logarithmic scale. You have a problem with your data values. The max value must be greater than 0. It is mathematically impossible to have 0 in a logarithmic scale.',0), -11005 => array('Specifying tick interval for a logarithmic scale is undefined. Remove any calls to SetTextLabelStart() or SetTextTickInterval() on the logarithmic scale.',0), - -/* -** jpgraph_mgraph -*/ - -12001 => array("You are using GD 2.x and are trying to use a background images on a non truecolor image. To use background images with GD 2.x it is necessary to enable truecolor by setting the USE_TRUECOLOR constant to TRUE. Due to a bug in GD 2.0.1 using any truetype fonts with truecolor images will result in very poor quality fonts.",0), -12002 => array('Incorrect file name for MGraph::SetBackgroundImage() : %s Must have a valid image extension (jpg,gif,png) when using auto detection of image type',1), -12003 => array('Unknown file extension (%s) in MGraph::SetBackgroundImage() for filename: %s',2), -12004 => array('The image format of your background image (%s) is not supported in your system configuration. ',1), -12005 => array('Can\'t read background image: %s',1), -12006 => array('Illegal sizes specified for width or height when creating an image, (width=%d, height=%d)',2), -12007 => array('Argument to MGraph::Add() is not a valid GD image handle.',0), -12008 => array('Your PHP (and GD-lib) installation does not appear to support any known graphic formats.',0), -12009 => array('Your PHP installation does not support the chosen graphic format: %s',1), -12010 => array('Can\'t create or stream image to file %s Check that PHP has enough permission to write a file to the current directory.',1), -12011 => array('Can\'t create truecolor image. Check that you really have GD2 library installed.',0), -12012 => array('Can\'t create image. Check that you really have GD2 library installed.',0), - -/* -** jpgraph_pie3d -*/ - -14001 => array('Pie3D::ShowBorder() . Deprecated function. Use Pie3D::SetEdge() to control the edges around slices.',0), -14002 => array('PiePlot3D::SetAngle() 3D Pie projection angle must be between 5 and 85 degrees.',0), -14003 => array('Internal assertion failed. Pie3D::Pie3DSlice',0), -14004 => array('Slice start angle must be between 0 and 360 degrees.',0), -14005 => array('Pie3D Internal error: Trying to wrap twice when looking for start index',0,), -14006 => array('Pie3D Internal Error: Z-Sorting algorithm for 3D Pies is not working properly (2). Trying to wrap twice while stroking.',0), -14007 => array('Width for 3D Pie is 0. Specify a size > 0',0), - -/* -** jpgraph_pie -*/ - -15001 => array('PiePLot::SetTheme() Unknown theme: %s',1), -15002 => array('Argument to PiePlot::ExplodeSlice() must be an integer',0), -15003 => array('Argument to PiePlot::Explode() must be an array with integer distances.',0), -15004 => array('Slice start angle must be between 0 and 360 degrees.',0), -15005 => array('PiePlot::SetFont() is deprecated. Use PiePlot->value->SetFont() instead.',0), -15006 => array('PiePlot::SetSize() Radius for pie must either be specified as a fraction [0, 0.5] of the size of the image or as an absolute size in pixels in the range [10, 1000]',0), -15007 => array('PiePlot::SetFontColor() is deprecated. Use PiePlot->value->SetColor() instead.',0), -15008 => array('PiePlot::SetLabelType() Type for pie plots must be 0 or 1 (not %d).',1), -15009 => array('Illegal pie plot. Sum of all data is zero for Pie Plot',0), -15010 => array('Sum of all data is 0 for Pie.',0), -15011 => array('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.',0), -15012 => array('PiePlot::SetTheme() is no longer supported. Use PieGraph::SetTheme()',0), - -/* -** jpgraph_plotband -*/ - -16001 => array('Density for pattern must be between 1 and 100. (You tried %f)',1), -16002 => array('No positions specified for pattern.',0), -16003 => array('Unknown pattern specification (%d)',0), -16004 => array('Min value for plotband is larger than specified max value. Please correct.',0), - - -/* -** jpgraph_polar -*/ - -17001 => array('Polar plots must have an even number of data point. Each data point is a tuple (angle,radius).',0), -17002 => array('Unknown alignment specified for X-axis title. (%s)',1), -//17003 => array('Set90AndMargin() is not supported for polar graphs.',0), -17004 => array('Unknown scale type for polar graph. Must be "lin" or "log"',0), - -/* -** jpgraph_radar -*/ - -18001 => array('Client side image maps not supported for RadarPlots.',0), -18002 => array('RadarGraph::SupressTickMarks() is deprecated. Use HideTickMarks() instead.',0), -18003 => array('Illegal scale for radarplot (%s). Must be \'lin\' or \'log\'',1), -18004 => array('Radar Plot size must be between 0.1 and 1. (Your value=%f)',1), -18005 => array('RadarPlot Unsupported Tick density: %d',1), -18006 => array('Minimum data %f (Radar plots should only be used when all data points > 0)',1), -18007 => array('Number of titles does not match number of points in plot.',0), -18008 => array('Each radar plot must have the same number of data points.',0), - -/* -** jpgraph_regstat -*/ - -19001 => array('Spline: Number of X and Y coordinates must be the same',0), -19002 => array('Invalid input data for spline. Two or more consecutive input X-values are equal. Each input X-value must differ since from a mathematical point of view it must be a one-to-one mapping, i.e. each X-value must correspond to exactly one Y-value.',0), -19003 => array('Bezier: Number of X and Y coordinates must be the same',0), - -/* -** jpgraph_scatter -*/ - -20001 => array('Fieldplots must have equal number of X and Y points.',0), -20002 => array('Fieldplots must have an angle specified for each X and Y points.',0), -20003 => array('Scatterplot must have equal number of X and Y points.',0), - -/* -** jpgraph_stock -*/ - -21001 => array('Data values for Stock charts must contain an even multiple of %d data points.',1), - -/* -** jpgraph_plotmark -*/ - -23001 => array('This marker "%s" does not exist in color with index: %d',2), -23002 => array('Mark color index too large for marker "%s"',1), -23003 => array('A filename must be specified if you set the mark type to MARK_IMG.',0), - -/* -** jpgraph_utils -*/ - -24001 => array('FuncGenerator : No function specified. ',0), -24002 => array('FuncGenerator : Syntax error in function specification ',0), -24003 => array('DateScaleUtils: Unknown tick type specified in call to GetTicks()',0), -24004 => array('ReadCSV2: Column count mismatch in %s line %d',2), -/* -** jpgraph -*/ - -25001 => array('This PHP installation is not configured with the GD library. Please recompile PHP with GD support to run JpGraph. (Neither function imagetypes() nor imagecreatefromstring() does exist)',0), -25002 => array('Your PHP installation does not seem to have the required GD library. Please see the PHP documentation on how to install and enable the GD library.',0), -25003 => array('General PHP error : At %s:%d : %s',3), -25004 => array('General PHP error : %s ',1), -25005 => array('Can\'t access PHP_SELF, PHP global variable. You can\'t run PHP from command line if you want to use the \'auto\' naming of cache or image files.',0), -25006 => array('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).',0), -25007 => array('You are trying to use the locale (%s) which your PHP installation does not support. Hint: Use \'\' to indicate the default locale for this geographic region.',1), -25008 => array('Image width/height argument in Graph::Graph() must be numeric',0), -25009 => array('You must specify what scale to use with a call to Graph::SetScale()',0), - -25010 => array('Graph::Add() You tried to add a null plot to the graph.',0), -25011 => array('Graph::AddY2() You tried to add a null plot to the graph.',0), -25012 => array('Graph::AddYN() You tried to add a null plot to the graph.',0), -25013 => array('You can only add standard plots to multiple Y-axis',0), -25014 => array('Graph::AddText() You tried to add a null text to the graph.',0), -25015 => array('Graph::AddLine() You tried to add a null line to the graph.',0), -25016 => array('Graph::AddBand() You tried to add a null band to the graph.',0), -25017 => array('You are using GD 2.x and are trying to use a background images on a non truecolor image. To use background images with GD 2.x it is necessary to enable truecolor by setting the USE_TRUECOLOR constant to TRUE. Due to a bug in GD 2.0.1 using any truetype fonts with truecolor images will result in very poor quality fonts.',0), -25018 => array('Incorrect file name for Graph::SetBackgroundImage() : "%s" Must have a valid image extension (jpg,gif,png) when using auto detection of image type',1), -25019 => array('Unknown file extension (%s) in Graph::SetBackgroundImage() for filename: "%s"',2), - -25020 => array('Graph::SetScale(): Specified Max value must be larger than the specified Min value.',0), -25021 => array('Unknown scale specification for Y-scale. (%s)',1), -25022 => array('Unknown scale specification for X-scale. (%s)',1), -25023 => array('Unsupported Y2 axis type: "%s" Must be one of (lin,log,int)',1), -25024 => array('Unsupported Y axis type: "%s" Must be one of (lin,log,int)',1), -25025 => array('Unsupported Tick density: %d',1), -25026 => array('Can\'t draw unspecified Y-scale. You have either: 1. Specified an Y axis for auto scaling but have not supplied any plots. 2. Specified a scale manually but have forgot to specify the tick steps',0), -25027 => array('Can\'t open cached CSIM "%s" for reading.',1), -25028 => array('Apache/PHP does not have permission to write to the CSIM cache directory (%s). Check permissions.',1), -25029 => array('Can\'t write CSIM "%s" for writing. Check free space and permissions.',1), - -25030 => array('Missing script name in call to StrokeCSIM(). You must specify the name of the actual image script as the first parameter to StrokeCSIM().',0), -25031 => array('You must specify what scale to use with a call to Graph::SetScale().',0), -25032 => array('No plots for Y-axis nbr:%d',1), -25033 => array('',0), -25034 => array('Can\'t draw unspecified X-scale. No plots specified.',0), -25035 => array('You have enabled clipping. Clipping is only supported for graphs at 0 or 90 degrees rotation. Please adjust you current angle (=%d degrees) or disable clipping.',1), -25036 => array('Unknown AxisStyle() : %s',1), -25037 => array('The image format of your background image (%s) is not supported in your system configuration. ',1), -25038 => array('Background image seems to be of different type (has different file extension) than specified imagetype. Specified: %s File: %s',2), -25039 => array('Can\'t read background image: "%s"',1), - -25040 => array('It is not possible to specify both a background image and a background country flag.',0), -25041 => array('In order to use Country flags as backgrounds you must include the "jpgraph_flags.php" file.',0), -25042 => array('Unknown background image layout',0), -25043 => array('Unknown title background style.',0), -25044 => array('Cannot use auto scaling since it is impossible to determine a valid min/max value of the Y-axis (only null values).',0), -25045 => array('Font families FF_HANDWRT and FF_BOOK are no longer available due to copyright problem with these fonts. Fonts can no longer be distributed with JpGraph. Please download fonts from http://corefonts.sourceforge.net/',0), -25046 => array('Specified TTF font family (id=%d) is unknown or does not exist. Please note that TTF fonts are not distributed with JpGraph for copyright reasons. You can find the MS TTF WEB-fonts (arial, courier etc) for download at http://corefonts.sourceforge.net/',1), -25047 => array('Style %s is not available for font family %s',2), -25048 => array('Unknown font style specification [%s].',1), -25049 => array('Font file "%s" is not readable or does not exist.',1), - -25050 => array('First argument to Text::Text() must be a string.',0), -25051 => array('Invalid direction specified for text.',0), -25052 => array('PANIC: Internal error in SuperScript::Stroke(). Unknown vertical alignment for text',0), -25053 => array('PANIC: Internal error in SuperScript::Stroke(). Unknown horizontal alignment for text',0), -25054 => array('Internal error: Unknown grid axis %s',1), -25055 => array('Axis::SetTickDirection() is deprecated. Use Axis::SetTickSide() instead',0), -25056 => array('SetTickLabelMargin() is deprecated. Use Axis::SetLabelMargin() instead.',0), -25057 => array('SetTextTicks() is deprecated. Use SetTextTickInterval() instead.',0), -25058 => array('Text label interval must be specified >= 1.',0), -25059 => array('SetLabelPos() is deprecated. Use Axis::SetLabelSide() instead.',0), - -25060 => array('Unknown alignment specified for X-axis title. (%s)',1), -25061 => array('Unknown alignment specified for Y-axis title. (%s)',1), -25062 => array('Labels at an angle are not supported on Y-axis',0), -25063 => array('Ticks::SetPrecision() is deprecated. Use Ticks::SetLabelFormat() (or Ticks::SetFormatCallback()) instead',0), -25064 => array('Minor or major step size is 0. Check that you haven\'t got an accidental SetTextTicks(0) in your code. If this is not the case you might have stumbled upon a bug in JpGraph. Please report this and if possible include the data that caused the problem',0), -25065 => array('Tick positions must be specified as an array()',0), -25066 => array('When manually specifying tick positions and labels the number of labels must be the same as the number of specified ticks.',0), -25067 => array('Your manually specified scale and ticks is not correct. The scale seems to be too small to hold any of the specified tick marks.',0), -25068 => array('A plot has an illegal scale. This could for example be that you are trying to use text auto scaling to draw a line plot with only one point or that the plot area is too small. It could also be that no input data value is numeric (perhaps only \'-\' or \'x\')',0), -25069 => array('Grace must be larger then 0',0), -25070 => array('Either X or Y data arrays contains non-numeric values. Check that the data is really specified as numeric data and not as strings. It is an error to specify data for example as \'-2345.2\' (using quotes).',0), -25071 => array('You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.',0), -25072 => array('You have specified a max value with SetAutoMax() which is smaller than the minimum value used for the scale. This is not possible.',0), -25073 => array('Internal error. Integer scale algorithm comparison out of bound (r=%f)',1), -25074 => array('Internal error. The scale range is negative (%f) [for %s scale] This problem could potentially be caused by trying to use \"illegal\" values in the input data arrays (like trying to send in strings or only NULL values) which causes the auto scaling to fail.',2), -25075 => array('Can\'t automatically determine ticks since min==max.',0), -25077 => array('Adjustment factor for color must be > 0',0), -25078 => array('Unknown color: %s',1), -25079 => array('Unknown color specification: %s, size=%d',2), - -25080 => array('Alpha parameter for color must be between 0.0 and 1.0',0), -25081 => array('Selected graphic format is either not supported or unknown [%s]',1), -25082 => array('Illegal sizes specified for width or height when creating an image, (width=%d, height=%d)',2), -25083 => array('Illegal image size when copying image. Size for copied to image is 1 pixel or less.',0), -25084 => array('Failed to create temporary GD canvas. Possible Out of memory problem.',0), -25085 => array('An image can not be created from the supplied string. It is either in a format not supported or the string is representing an corrupt image.',0), -25086 => array('You only seem to have GD 1.x installed. To enable Alphablending requires GD 2.x or higher. Please install GD or make sure the constant USE_GD2 is specified correctly to reflect your installation. By default it tries to auto detect what version of GD you have installed. On some very rare occasions it may falsely detect GD2 where only GD1 is installed. You must then set USE_GD2 to false.',0), -25087 => array('This PHP build has not been configured with TTF support. You need to recompile your PHP installation with FreeType support.',0), -25088 => array('You have a misconfigured GD font support. The call to imagefontwidth() fails.',0), -25089 => array('You have a misconfigured GD font support. The call to imagefontheight() fails.',0), - -25090 => array('Unknown direction specified in call to StrokeBoxedText() [%s]',1), -25091 => array('Internal font does not support drawing text at arbitrary angle. Use TTF fonts instead.',0), -25092 => array('There is either a configuration problem with TrueType or a problem reading font file "%s" Make sure file exists and is in a readable place for the HTTP process. (If \'basedir\' restriction is enabled in PHP then the font file must be located in the document root.). It might also be a wrongly installed FreeType library. Try upgrading to at least FreeType 2.1.13 and recompile GD with the correct setup so it can find the new FT library.',1), -25093 => array('Can not read font file "%s" in call to Image::GetBBoxTTF. Please make sure that you have set a font before calling this method and that the font is installed in the TTF directory.',1), -25094 => array('Direction for text most be given as an angle between 0 and 90.',0), -25095 => array('Unknown font font family specification. ',0), -25096 => array('Can\'t allocate any more colors in palette image. Image has already allocated maximum of %d colors and the palette is now full. Change to a truecolor image instead',0), -25097 => array('Color specified as empty string in PushColor().',0), -25098 => array('Negative Color stack index. Unmatched call to PopColor()',0), -25099 => array('Parameters for brightness and Contrast out of range [-1,1]',0), - -25100 => array('Problem with color palette and your GD setup. Please disable anti-aliasing or use GD2 with true-color. If you have GD2 library installed please make sure that you have set the USE_GD2 constant to true and truecolor is enabled.',0), -25101 => array('Illegal numeric argument to SetLineStyle(): (%d)',1), -25102 => array('Illegal string argument to SetLineStyle(): %s',1), -25103 => array('Illegal argument to SetLineStyle %s',1), -25104 => array('Unknown line style: %s',1), -25105 => array('NULL data specified for a filled polygon. Check that your data is not NULL.',0), -25106 => array('Image::FillToBorder : Can not allocate more colors',0), -25107 => array('Can\'t write to file "%s". Check that the process running PHP has enough permission.',1), -25108 => array('Can\'t stream image. This is most likely due to a faulty PHP/GD setup. Try to recompile PHP and use the built-in GD library that comes with PHP.',0), -25109 => array('Your PHP (and GD-lib) installation does not appear to support any known graphic formats. You need to first make sure GD is compiled as a module to PHP. If you also want to use JPEG images you must get the JPEG library. Please see the PHP docs for details.',0), - -25110 => array('Your PHP installation does not support the chosen graphic format: %s',1), -25111 => array('Can\'t delete cached image %s. Permission problem?',1), -25112 => array('Cached imagefile (%s) has file date in the future.',1), -25113 => array('Can\'t delete cached image "%s". Permission problem?',1), -25114 => array('PHP has not enough permissions to write to the cache file "%s". Please make sure that the user running PHP has write permission for this file if you wan to use the cache system with JpGraph.',1), -25115 => array('Can\'t set permission for cached image "%s". Permission problem?',1), -25116 => array('Cant open file from cache "%s"',1), -25117 => array('Can\'t open cached image "%s" for reading.',1), -25118 => array('Can\'t create directory "%s". Make sure PHP has write permission to this directory.',1), -25119 => array('Can\'t set permissions for "%s". Permission problems?',1), - -25120 => array('Position for legend must be given as percentage in range 0-1',0), -25121 => array('Empty input data array specified for plot. Must have at least one data point.',0), -25122 => array('Stroke() must be implemented by concrete subclass to class Plot',0), -25123 => array('You can\'t use a text X-scale with specified X-coords. Use a "int" or "lin" scale instead.',0), -25124 => array('The input data array must have consecutive values from position 0 and forward. The given y-array starts with empty values (NULL)',0), -25125 => array('Illegal direction for static line',0), -25126 => array('Can\'t create truecolor image. Check that the GD2 library is properly setup with PHP.',0), -25127 => array('The library has been configured for automatic encoding conversion of Japanese fonts. This requires that PHP has the mb_convert_encoding() function. Your PHP installation lacks this function (PHP needs the "--enable-mbstring" when compiled).',0), -25128 => array('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.',0), -25129 => array('Anti-alias can not be used with dashed lines. Please disable anti-alias or use solid lines.',0), -25130 => array('Too small plot area. (%d x %d). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins.',2), - -25131 => array('StrokeBoxedText2() only supports TTF fonts and not built-in bitmap fonts.',0), -25132 => array('Undefined property %s.',1), -25133 => array('Use Graph::SetTheme() after Graph::SetScale().',0), - -/* -** jpgraph_led -*/ - -25500 => array('Multibyte strings must be enabled in the PHP installation in order to run the LED module so that the function mb_strlen() is available. See PHP documentation for more information.',0), - -/* -**--------------------------------------------------------------------------------------------- -** Pro-version strings -**--------------------------------------------------------------------------------------------- -*/ - -/* -** jpgraph_table -*/ - -27001 => array('GTextTable: Invalid argument to Set(). Array argument must be 2 dimensional',0), -27002 => array('GTextTable: Invalid argument to Set()',0), -27003 => array('GTextTable: Wrong number of arguments to GTextTable::SetColor()',0), -27004 => array('GTextTable: Specified cell range to be merged is not valid.',0), -27005 => array('GTextTable: Cannot merge already merged cells in the range: (%d,%d) to (%d,%d)',4), -27006 => array('GTextTable: Column argument = %d is outside specified table size.',1), -27007 => array('GTextTable: Row argument = %d is outside specified table size.',1), -27008 => array('GTextTable: Column and row size arrays must match the dimensions of the table',0), -27009 => array('GTextTable: Number of table columns or rows are 0. Make sure Init() or Set() is called.',0), -27010 => array('GTextTable: No alignment specified in call to SetAlign()',0), -27011 => array('GTextTable: Unknown alignment specified in SetAlign(). Horizontal=%s, Vertical=%s',2), -27012 => array('GTextTable: Internal error. Invalid alignment specified =%s',1), -27013 => array('GTextTable: Argument to FormatNumber() must be a string.',0), -27014 => array('GTextTable: Table is not initilaized with either a call to Set() or Init()',0), -27015 => array('GTextTable: Cell image constrain type must be TIMG_WIDTH or TIMG_HEIGHT',0), - -/* -** jpgraph_windrose -*/ - -22001 => array('Total percentage for all windrose legs in a windrose plot can not exceed 100%% !\n(Current max is: %d)',1), -22002 => array('Graph is too small to have a scale. Please make the graph larger.',0), -22004 => array('Label specification for windrose directions must have 16 values (one for each compass direction).',0), -22005 => array('Line style for radial lines must be on of ("solid","dotted","dashed","longdashed") ',0), -22006 => array('Illegal windrose type specified.',0), -22007 => array('To few values for the range legend.',0), -22008 => array('Internal error: Trying to plot free Windrose even though type is not a free windrose',0), -22009 => array('You have specified the same direction twice, once with an angle and once with a compass direction (%f degrees)',0), -22010 => array('Direction must either be a numeric value or one of the 16 compass directions',0), -22011 => array('Windrose index must be numeric or direction label. You have specified index=%d',1), -22012 => array('Windrose radial axis specification contains a direction which is not enabled.',0), -22013 => array('You have specified the look&feel for the same compass direction twice, once with text and once with index (Index=%d)',1), -22014 => array('Index for compass direction must be between 0 and 15.',0), -22015 => array('You have specified an undefined Windrose plot type.',0), -22016 => array('Windrose leg index must be numeric or direction label.',0), -22017 => array('Windrose data contains a direction which is not enabled. Please adjust what labels are displayed.',0), -22018 => array('You have specified data for the same compass direction twice, once with text and once with index (Index=%d)',1), -22019 => array('Index for direction must be between 0 and 15. You can\'t specify angles for a Regular Windplot, only index and compass directions.',0), -22020 => array('Windrose plot is too large to fit the specified Graph size. Please use WindrosePlot::SetSize() to make the plot smaller or increase the size of the Graph in the initial WindroseGraph() call.',0), -22021 => array('It is only possible to add Text, IconPlot or WindrosePlot to a Windrose Graph',0), -/* -** jpgraph_odometer -*/ - -13001 => array('Unknown needle style (%d).',1), -13002 => array('Value for odometer (%f) is outside specified scale [%f,%f]',3), - -/* -** jpgraph_barcode -*/ - -1001 => array('Unknown encoder specification: %s',1), -1002 => array('Data validation failed. Can\'t encode [%s] using encoding "%s"',2), -1003 => array('Internal encoding error. Trying to encode %s is not possible in Code 128',1), -1004 => array('Internal barcode error. Unknown UPC-E encoding type: %s',1), -1005 => array('Internal error. Can\'t encode character tuple (%s, %s) in Code-128 charset C',2), -1006 => array('Internal encoding error for CODE 128. Trying to encode control character in CHARSET != A',0), -1007 => array('Internal encoding error for CODE 128. Trying to encode DEL in CHARSET != B',0), -1008 => array('Internal encoding error for CODE 128. Trying to encode small letters in CHARSET != B',0), -1009 => array('Encoding using CODE 93 is not yet supported.',0), -1010 => array('Encoding using POSTNET is not yet supported.',0), -1011 => array('Non supported barcode backend for type %s',1), - -/* -** PDF417 -*/ -26000 => array('PDF417: The PDF417 module requires that the PHP installation must support the function bcmod(). This is normally enabled at compile time. See documentation for more information.',0), -26001 => array('PDF417: Number of Columns must be >= 1 and <= 30',0), -26002 => array('PDF417: Error level must be between 0 and 8',0), -26003 => array('PDF417: Invalid format for input data to encode with PDF417',0), -26004 => array('PDF417: Can\'t encode given data with error level %d and %d columns since it results in too many symbols or more than 90 rows.',2), -26005 => array('PDF417: Can\'t open file "%s" for writing',1), -26006 => array('PDF417: Internal error. Data files for PDF417 cluster %d is corrupted.',1), -26007 => array('PDF417: Internal error. GetPattern: Illegal Code Value = %d (row=%d)',2), -26008 => array('PDF417: Internal error. Mode not found in mode list!! mode=%d',1), -26009 => array('PDF417: Encode error: Illegal character. Can\'t encode character with ASCII code=%d',1), -26010 => array('PDF417: Internal error: No input data in decode.',0), -26011 => array('PDF417: Encoding error. Can\'t use numeric encoding on non-numeric data.',0), -26012 => array('PDF417: Internal error. No input data to decode for Binary compressor.',0), -26013 => array('PDF417: Internal error. Checksum error. Coefficient tables corrupted.',0), -26014 => array('PDF417: Internal error. No data to calculate codewords on.',0), -26015 => array('PDF417: Internal error. State transition table entry 0 is NULL. Entry 1 = (%s)',1), -26016 => array('PDF417: Internal error: Unrecognized state transition mode in decode.',0), - -/* -** jpgraph_contour -*/ - -28001 => array('Third argument to Contour must be an array of colors.',0), -28002 => array('Number of colors must equal the number of isobar lines specified',0), -28003 => array('ContourPlot Internal Error: isobarHCrossing: Coloumn index too large (%d)',1), -28004 => array('ContourPlot Internal Error: isobarHCrossing: Row index too large (%d)',1), -28005 => array('ContourPlot Internal Error: isobarVCrossing: Row index too large (%d)',1), -28006 => array('ContourPlot Internal Error: isobarVCrossing: Col index too large (%d)',1), -28007 => array('ContourPlot interpolation factor is too large (>5)',0), - -/* - * jpgraph_matrix and colormap -*/ -29201 => array('Min range value must be less or equal to max range value for colormaps',0), -29202 => array('The distance between min and max value is too small for numerical precision',0), -29203 => array('Number of color quantification level must be at least %d',1), -29204 => array('Number of colors (%d) is invalid for this colormap. It must be a number that can be written as: %d + k*%d',3), -29205 => array('Colormap specification out of range. Must be an integer in range [0,%d]',1), -29206 => array('Invalid object added to MatrixGraph',0), -29207 => array('Empty input data specified for MatrixPlot',0), -29208 => array('Unknown side specifiction for matrix labels "%s"',1), -29209 => array('CSIM Target matrix must be the same size as the data matrix (csim=%d x %d, data=%d x %d)',4), -29210 => array('CSIM Target for matrix labels does not match the number of labels (csim=%d, labels=%d)',2), - - -/* -* jpgraph_theme -*/ -30001 => array("Theme::%s() is not defined. \nPlease make %s(\$graph) function in your theme classs.",2), - -); - -?> diff --git a/#jpgraph/src/lang/prod.inc.php b/#jpgraph/src/lang/prod.inc.php deleted file mode 100644 index c34c2b3b..00000000 --- a/#jpgraph/src/lang/prod.inc.php +++ /dev/null @@ -1,386 +0,0 @@ -,) -$_jpg_messages = array( - -/* -** Headers already sent error. This is formatted as HTML different since this will be sent back directly as text -*/ -10 => array('
JpGraph Error: -HTTP headers have already been sent.
Caused by output from file %s at line %d.
Explanation:
HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it\'s image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).

Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.

For example it is a common mistake to leave a blank line before the opening "<?php".

',2), - - -11 => array(DEFAULT_ERROR_MESSAGE.'11',0), -12 => array(DEFAULT_ERROR_MESSAGE.'12',0), -13 => array(DEFAULT_ERROR_MESSAGE.'13',0), -2001 => array(DEFAULT_ERROR_MESSAGE.'2001',0), -2002 => array(DEFAULT_ERROR_MESSAGE.'2002',0), -2003 => array(DEFAULT_ERROR_MESSAGE.'2003',0), -2004 => array(DEFAULT_ERROR_MESSAGE.'2004',0), -2005 => array(DEFAULT_ERROR_MESSAGE.'2005',0), -2006 => array(DEFAULT_ERROR_MESSAGE.'2006',0), -2007 => array(DEFAULT_ERROR_MESSAGE.'2007',0), -2008 => array(DEFAULT_ERROR_MESSAGE.'2008',0), -2009 => array(DEFAULT_ERROR_MESSAGE.'2009',0), -2010 => array(DEFAULT_ERROR_MESSAGE.'2010',0), -2011 => array(DEFAULT_ERROR_MESSAGE.'2011',0), -2012 => array(DEFAULT_ERROR_MESSAGE.'2012',0), -2013 => array(DEFAULT_ERROR_MESSAGE.'2013',0), -2014 => array(DEFAULT_ERROR_MESSAGE.'2014',0), -3001 => array(DEFAULT_ERROR_MESSAGE.'3001',0), -4002 => array(DEFAULT_ERROR_MESSAGE.'4002',0), -5001 => array(DEFAULT_ERROR_MESSAGE.'5001',0), -5002 => array(DEFAULT_ERROR_MESSAGE.'5002',0), -5003 => array(DEFAULT_ERROR_MESSAGE.'5003',0), -5004 => array(DEFAULT_ERROR_MESSAGE.'5004',0), -6001 => array(DEFAULT_ERROR_MESSAGE.'6001',0), -6002 => array(DEFAULT_ERROR_MESSAGE.'6002',0), -6003 => array(DEFAULT_ERROR_MESSAGE.'6003',0), -6004 => array(DEFAULT_ERROR_MESSAGE.'6004',0), -6005 => array(DEFAULT_ERROR_MESSAGE.'6005',0), -6006 => array(DEFAULT_ERROR_MESSAGE.'6006',0), -6007 => array(DEFAULT_ERROR_MESSAGE.'6007',0), -6008 => array(DEFAULT_ERROR_MESSAGE.'6008',0), -6009 => array(DEFAULT_ERROR_MESSAGE.'6009',0), -6010 => array(DEFAULT_ERROR_MESSAGE.'6010',0), -6011 => array(DEFAULT_ERROR_MESSAGE.'6011',0), -6012 => array(DEFAULT_ERROR_MESSAGE.'6012',0), -6015 => array(DEFAULT_ERROR_MESSAGE.'6015',0), -6016 => array(DEFAULT_ERROR_MESSAGE.'6016',0), -6017 => array(DEFAULT_ERROR_MESSAGE.'6017',0), -6018 => array(DEFAULT_ERROR_MESSAGE.'6018',0), -6019 => array(DEFAULT_ERROR_MESSAGE.'6019',0), -6020 => array(DEFAULT_ERROR_MESSAGE.'6020',0), -6021 => array(DEFAULT_ERROR_MESSAGE.'6021',0), -6022 => array(DEFAULT_ERROR_MESSAGE.'6022',0), -6023 => array(DEFAULT_ERROR_MESSAGE.'6023',0), -6024 => array(DEFAULT_ERROR_MESSAGE.'6024',0), -6025 => array(DEFAULT_ERROR_MESSAGE.'6025',0), -6027 => array(DEFAULT_ERROR_MESSAGE.'6027',0), -6028 => array(DEFAULT_ERROR_MESSAGE.'6028',0), -6029 => array(DEFAULT_ERROR_MESSAGE.'6029',0), -6030 => array(DEFAULT_ERROR_MESSAGE.'6030',0), -6031 => array(DEFAULT_ERROR_MESSAGE.'6031',0), -6032 => array(DEFAULT_ERROR_MESSAGE.'6032',0), -6033 => array(DEFAULT_ERROR_MESSAGE.'6033',0), -7001 => array(DEFAULT_ERROR_MESSAGE.'7001',0), -8001 => array(DEFAULT_ERROR_MESSAGE.'8001',0), -8002 => array(DEFAULT_ERROR_MESSAGE.'8002',0), -8003 => array(DEFAULT_ERROR_MESSAGE.'8003',0), -8004 => array(DEFAULT_ERROR_MESSAGE.'8004',0), -9001 => array(DEFAULT_ERROR_MESSAGE.'9001',0), -10001 => array(DEFAULT_ERROR_MESSAGE.'10001',0), -10002 => array(DEFAULT_ERROR_MESSAGE.'10002',0), -10003 => array(DEFAULT_ERROR_MESSAGE.'10003',0), -11001 => array(DEFAULT_ERROR_MESSAGE.'11001',0), -11002 => array(DEFAULT_ERROR_MESSAGE.'11002',0), -11003 => array(DEFAULT_ERROR_MESSAGE.'11003',0), -11004 => array(DEFAULT_ERROR_MESSAGE.'11004',0), -11005 => array(DEFAULT_ERROR_MESSAGE.'11005',0), -12001 => array(DEFAULT_ERROR_MESSAGE.'12001',0), -12002 => array(DEFAULT_ERROR_MESSAGE.'12002',0), -12003 => array(DEFAULT_ERROR_MESSAGE.'12003',0), -12004 => array(DEFAULT_ERROR_MESSAGE.'12004',0), -12005 => array(DEFAULT_ERROR_MESSAGE.'12005',0), -12006 => array(DEFAULT_ERROR_MESSAGE.'12006',0), -12007 => array(DEFAULT_ERROR_MESSAGE.'12007',0), -12008 => array(DEFAULT_ERROR_MESSAGE.'12008',0), -12009 => array(DEFAULT_ERROR_MESSAGE.'12009',0), -12010 => array(DEFAULT_ERROR_MESSAGE.'12010',0), -12011 => array(DEFAULT_ERROR_MESSAGE.'12011',0), -12012 => array(DEFAULT_ERROR_MESSAGE.'12012',0), -14001 => array(DEFAULT_ERROR_MESSAGE.'14001',0), -14002 => array(DEFAULT_ERROR_MESSAGE.'14002',0), -14003 => array(DEFAULT_ERROR_MESSAGE.'14003',0), -14004 => array(DEFAULT_ERROR_MESSAGE.'14004',0), -14005 => array(DEFAULT_ERROR_MESSAGE.'14005',0), -14006 => array(DEFAULT_ERROR_MESSAGE.'14006',0), -14007 => array(DEFAULT_ERROR_MESSAGE.'14007',0), -15001 => array(DEFAULT_ERROR_MESSAGE.'15001',0), -15002 => array(DEFAULT_ERROR_MESSAGE.'15002',0), -15003 => array(DEFAULT_ERROR_MESSAGE.'15003',0), -15004 => array(DEFAULT_ERROR_MESSAGE.'15004',0), -15005 => array(DEFAULT_ERROR_MESSAGE.'15005',0), -15006 => array(DEFAULT_ERROR_MESSAGE.'15006',0), -15007 => array(DEFAULT_ERROR_MESSAGE.'15007',0), -15008 => array(DEFAULT_ERROR_MESSAGE.'15008',0), -15009 => array(DEFAULT_ERROR_MESSAGE.'15009',0), -15010 => array(DEFAULT_ERROR_MESSAGE.'15010',0), -15011 => array(DEFAULT_ERROR_MESSAGE.'15011',0), -15012 => array(DEFAULT_ERROR_MESSAGE.'15012',0), -16001 => array(DEFAULT_ERROR_MESSAGE.'16001',0), -16002 => array(DEFAULT_ERROR_MESSAGE.'16002',0), -16003 => array(DEFAULT_ERROR_MESSAGE.'16003',0), -16004 => array(DEFAULT_ERROR_MESSAGE.'16004',0), -17001 => array(DEFAULT_ERROR_MESSAGE.'17001',0), -17002 => array(DEFAULT_ERROR_MESSAGE.'17002',0), -17004 => array(DEFAULT_ERROR_MESSAGE.'17004',0), -18001 => array(DEFAULT_ERROR_MESSAGE.'18001',0), -18002 => array(DEFAULT_ERROR_MESSAGE.'18002',0), -18003 => array(DEFAULT_ERROR_MESSAGE.'18003',0), -18004 => array(DEFAULT_ERROR_MESSAGE.'18004',0), -18005 => array(DEFAULT_ERROR_MESSAGE.'18005',0), -18006 => array(DEFAULT_ERROR_MESSAGE.'18006',0), -18007 => array(DEFAULT_ERROR_MESSAGE.'18007',0), -18008 => array(DEFAULT_ERROR_MESSAGE.'18008',0), -19001 => array(DEFAULT_ERROR_MESSAGE.'19001',0), -19002 => array(DEFAULT_ERROR_MESSAGE.'19002',0), -19003 => array(DEFAULT_ERROR_MESSAGE.'19003',0), -20001 => array(DEFAULT_ERROR_MESSAGE.'20001',0), -20002 => array(DEFAULT_ERROR_MESSAGE.'20002',0), -20003 => array(DEFAULT_ERROR_MESSAGE.'20003',0), -21001 => array(DEFAULT_ERROR_MESSAGE.'21001',0), -23001 => array(DEFAULT_ERROR_MESSAGE.'23001',0), -23002 => array(DEFAULT_ERROR_MESSAGE.'23002',0), -23003 => array(DEFAULT_ERROR_MESSAGE.'23003',0), -24001 => array(DEFAULT_ERROR_MESSAGE.'24001',0), -24002 => array(DEFAULT_ERROR_MESSAGE.'24002',0), -24003 => array(DEFAULT_ERROR_MESSAGE.'24003',0), -24004 => array(DEFAULT_ERROR_MESSAGE.'24004',0), -25001 => array(DEFAULT_ERROR_MESSAGE.'25001',0), -25002 => array(DEFAULT_ERROR_MESSAGE.'25002',0), -25003 => array(DEFAULT_ERROR_MESSAGE.'25003',0), -25004 => array(DEFAULT_ERROR_MESSAGE.'25004',0), -25005 => array(DEFAULT_ERROR_MESSAGE.'25005',0), -25006 => array(DEFAULT_ERROR_MESSAGE.'25006',0), -25007 => array(DEFAULT_ERROR_MESSAGE.'25007',0), -25008 => array(DEFAULT_ERROR_MESSAGE.'25008',0), -25009 => array(DEFAULT_ERROR_MESSAGE.'25009',0), -25010 => array(DEFAULT_ERROR_MESSAGE.'25010',0), -25011 => array(DEFAULT_ERROR_MESSAGE.'25011',0), -25012 => array(DEFAULT_ERROR_MESSAGE.'25012',0), -25013 => array(DEFAULT_ERROR_MESSAGE.'25013',0), -25014 => array(DEFAULT_ERROR_MESSAGE.'25014',0), -25015 => array(DEFAULT_ERROR_MESSAGE.'25015',0), -25016 => array(DEFAULT_ERROR_MESSAGE.'25016',0), -25017 => array(DEFAULT_ERROR_MESSAGE.'25017',0), -25018 => array(DEFAULT_ERROR_MESSAGE.'25018',0), -25019 => array(DEFAULT_ERROR_MESSAGE.'25019',0), -25020 => array(DEFAULT_ERROR_MESSAGE.'25020',0), -25021 => array(DEFAULT_ERROR_MESSAGE.'25021',0), -25022 => array(DEFAULT_ERROR_MESSAGE.'25022',0), -25023 => array(DEFAULT_ERROR_MESSAGE.'25023',0), -25024 => array(DEFAULT_ERROR_MESSAGE.'25024',0), -25025 => array(DEFAULT_ERROR_MESSAGE.'25025',0), -25026 => array(DEFAULT_ERROR_MESSAGE.'25026',0), -25027 => array(DEFAULT_ERROR_MESSAGE.'25027',0), -25028 => array(DEFAULT_ERROR_MESSAGE.'25028',0), -25029 => array(DEFAULT_ERROR_MESSAGE.'25029',0), -25030 => array(DEFAULT_ERROR_MESSAGE.'25030',0), -25031 => array(DEFAULT_ERROR_MESSAGE.'25031',0), -25032 => array(DEFAULT_ERROR_MESSAGE.'25032',0), -25033 => array(DEFAULT_ERROR_MESSAGE.'25033',0), -25034 => array(DEFAULT_ERROR_MESSAGE.'25034',0), -25035 => array(DEFAULT_ERROR_MESSAGE.'25035',0), -25036 => array(DEFAULT_ERROR_MESSAGE.'25036',0), -25037 => array(DEFAULT_ERROR_MESSAGE.'25037',0), -25038 => array(DEFAULT_ERROR_MESSAGE.'25038',0), -25039 => array(DEFAULT_ERROR_MESSAGE.'25039',0), -25040 => array(DEFAULT_ERROR_MESSAGE.'25040',0), -25041 => array(DEFAULT_ERROR_MESSAGE.'25041',0), -25042 => array(DEFAULT_ERROR_MESSAGE.'25042',0), -25043 => array(DEFAULT_ERROR_MESSAGE.'25043',0), -25044 => array(DEFAULT_ERROR_MESSAGE.'25044',0), -25045 => array(DEFAULT_ERROR_MESSAGE.'25045',0), -25046 => array(DEFAULT_ERROR_MESSAGE.'25046',0), -25047 => array(DEFAULT_ERROR_MESSAGE.'25047',0), -25048 => array(DEFAULT_ERROR_MESSAGE.'25048',0), -25049 => array(DEFAULT_ERROR_MESSAGE.'25049',0), -25050 => array(DEFAULT_ERROR_MESSAGE.'25050',0), -25051 => array(DEFAULT_ERROR_MESSAGE.'25051',0), -25052 => array(DEFAULT_ERROR_MESSAGE.'25052',0), -25053 => array(DEFAULT_ERROR_MESSAGE.'25053',0), -25054 => array(DEFAULT_ERROR_MESSAGE.'25054',0), -25055 => array(DEFAULT_ERROR_MESSAGE.'25055',0), -25056 => array(DEFAULT_ERROR_MESSAGE.'25056',0), -25057 => array(DEFAULT_ERROR_MESSAGE.'25057',0), -25058 => array(DEFAULT_ERROR_MESSAGE.'25058',0), -25059 => array(DEFAULT_ERROR_MESSAGE.'25059',0), -25060 => array(DEFAULT_ERROR_MESSAGE.'25060',0), -25061 => array(DEFAULT_ERROR_MESSAGE.'25061',0), -25062 => array(DEFAULT_ERROR_MESSAGE.'25062',0), -25063 => array(DEFAULT_ERROR_MESSAGE.'25063',0), -25064 => array(DEFAULT_ERROR_MESSAGE.'25064',0), -25065 => array(DEFAULT_ERROR_MESSAGE.'25065',0), -25066 => array(DEFAULT_ERROR_MESSAGE.'25066',0), -25067 => array(DEFAULT_ERROR_MESSAGE.'25067',0), -25068 => array(DEFAULT_ERROR_MESSAGE.'25068',0), -25069 => array(DEFAULT_ERROR_MESSAGE.'25069',0), -25070 => array(DEFAULT_ERROR_MESSAGE.'25070',0), -25071 => array(DEFAULT_ERROR_MESSAGE.'25071',0), -25072 => array(DEFAULT_ERROR_MESSAGE.'25072',0), -25073 => array(DEFAULT_ERROR_MESSAGE.'25073',0), -25074 => array(DEFAULT_ERROR_MESSAGE.'25074',0), -25075 => array(DEFAULT_ERROR_MESSAGE.'25075',0), -25077 => array(DEFAULT_ERROR_MESSAGE.'25077',0), -25078 => array(DEFAULT_ERROR_MESSAGE.'25078',0), -25079 => array(DEFAULT_ERROR_MESSAGE.'25079',0), -25080 => array(DEFAULT_ERROR_MESSAGE.'25080',0), -25081 => array(DEFAULT_ERROR_MESSAGE.'25081',0), -25082 => array(DEFAULT_ERROR_MESSAGE.'25082',0), -25083 => array(DEFAULT_ERROR_MESSAGE.'25083',0), -25084 => array(DEFAULT_ERROR_MESSAGE.'25084',0), -25085 => array(DEFAULT_ERROR_MESSAGE.'25085',0), -25086 => array(DEFAULT_ERROR_MESSAGE.'25086',0), -25087 => array(DEFAULT_ERROR_MESSAGE.'25087',0), -25088 => array(DEFAULT_ERROR_MESSAGE.'25088',0), -25089 => array(DEFAULT_ERROR_MESSAGE.'25089',0), -25090 => array(DEFAULT_ERROR_MESSAGE.'25090',0), -25091 => array(DEFAULT_ERROR_MESSAGE.'25091',0), -25092 => array(DEFAULT_ERROR_MESSAGE.'25092',0), -25093 => array(DEFAULT_ERROR_MESSAGE.'25093',0), -25094 => array(DEFAULT_ERROR_MESSAGE.'25094',0), -25095 => array(DEFAULT_ERROR_MESSAGE.'25095',0), -25096 => array(DEFAULT_ERROR_MESSAGE.'25096',0), -25097 => array(DEFAULT_ERROR_MESSAGE.'25097',0), -25098 => array(DEFAULT_ERROR_MESSAGE.'25098',0), -25099 => array(DEFAULT_ERROR_MESSAGE.'25099',0), -25100 => array(DEFAULT_ERROR_MESSAGE.'25100',0), -25101 => array(DEFAULT_ERROR_MESSAGE.'25101',0), -25102 => array(DEFAULT_ERROR_MESSAGE.'25102',0), -25103 => array(DEFAULT_ERROR_MESSAGE.'25103',0), -25104 => array(DEFAULT_ERROR_MESSAGE.'25104',0), -25105 => array(DEFAULT_ERROR_MESSAGE.'25105',0), -25106 => array(DEFAULT_ERROR_MESSAGE.'25106',0), -25107 => array(DEFAULT_ERROR_MESSAGE.'25107',0), -25108 => array(DEFAULT_ERROR_MESSAGE.'25108',0), -25109 => array(DEFAULT_ERROR_MESSAGE.'25109',0), -25110 => array(DEFAULT_ERROR_MESSAGE.'25110',0), -25111 => array(DEFAULT_ERROR_MESSAGE.'25111',0), -25112 => array(DEFAULT_ERROR_MESSAGE.'25112',0), -25113 => array(DEFAULT_ERROR_MESSAGE.'25113',0), -25114 => array(DEFAULT_ERROR_MESSAGE.'25114',0), -25115 => array(DEFAULT_ERROR_MESSAGE.'25115',0), -25116 => array(DEFAULT_ERROR_MESSAGE.'25116',0), -25117 => array(DEFAULT_ERROR_MESSAGE.'25117',0), -25118 => array(DEFAULT_ERROR_MESSAGE.'25118',0), -25119 => array(DEFAULT_ERROR_MESSAGE.'25119',0), -25120 => array(DEFAULT_ERROR_MESSAGE.'25120',0), -25121 => array(DEFAULT_ERROR_MESSAGE.'25121',0), -25122 => array(DEFAULT_ERROR_MESSAGE.'25122',0), -25123 => array(DEFAULT_ERROR_MESSAGE.'25123',0), -25124 => array(DEFAULT_ERROR_MESSAGE.'25124',0), -25125 => array(DEFAULT_ERROR_MESSAGE.'25125',0), -25126 => array(DEFAULT_ERROR_MESSAGE.'25126',0), -25127 => array(DEFAULT_ERROR_MESSAGE.'25127',0), -25128 => array(DEFAULT_ERROR_MESSAGE.'25128',0), -25129 => array(DEFAULT_ERROR_MESSAGE.'25129',0), -25130 => array(DEFAULT_ERROR_MESSAGE.'25130',0), -25131 => array(DEFAULT_ERROR_MESSAGE.'25131',0), -25132 => array(DEFAULT_ERROR_MESSAGE.'25132',0), -25133 => array(DEFAULT_ERROR_MESSAGE.'25133',0), -25500 => array(DEFAULT_ERROR_MESSAGE.'25500',0), -24003 => array(DEFAULT_ERROR_MESSAGE.'24003',0), -24004 => array(DEFAULT_ERROR_MESSAGE.'24004',0), -24005 => array(DEFAULT_ERROR_MESSAGE.'24005',0), -24006 => array(DEFAULT_ERROR_MESSAGE.'24006',0), -24007 => array(DEFAULT_ERROR_MESSAGE.'24007',0), -24008 => array(DEFAULT_ERROR_MESSAGE.'24008',0), -24009 => array(DEFAULT_ERROR_MESSAGE.'24009',0), -24010 => array(DEFAULT_ERROR_MESSAGE.'24010',0), -24011 => array(DEFAULT_ERROR_MESSAGE.'24011',0), -24012 => array(DEFAULT_ERROR_MESSAGE.'24012',0), -24013 => array(DEFAULT_ERROR_MESSAGE.'24013',0), -24014 => array(DEFAULT_ERROR_MESSAGE.'24014',0), -24015 => array(DEFAULT_ERROR_MESSAGE.'24015',0), -22001 => array(DEFAULT_ERROR_MESSAGE.'22001',0), -22002 => array(DEFAULT_ERROR_MESSAGE.'22002',0), -22004 => array(DEFAULT_ERROR_MESSAGE.'22004',0), -22005 => array(DEFAULT_ERROR_MESSAGE.'22005',0), -22006 => array(DEFAULT_ERROR_MESSAGE.'22006',0), -22007 => array(DEFAULT_ERROR_MESSAGE.'22007',0), -22008 => array(DEFAULT_ERROR_MESSAGE.'22008',0), -22009 => array(DEFAULT_ERROR_MESSAGE.'22009',0), -22010 => array(DEFAULT_ERROR_MESSAGE.'22010',0), -22011 => array(DEFAULT_ERROR_MESSAGE.'22011',0), -22012 => array(DEFAULT_ERROR_MESSAGE.'22012',0), -22013 => array(DEFAULT_ERROR_MESSAGE.'22013',0), -22014 => array(DEFAULT_ERROR_MESSAGE.'22014',0), -22015 => array(DEFAULT_ERROR_MESSAGE.'22015',0), -22016 => array(DEFAULT_ERROR_MESSAGE.'22016',0), -22017 => array(DEFAULT_ERROR_MESSAGE.'22017',0), -22018 => array(DEFAULT_ERROR_MESSAGE.'22018',0), -22019 => array(DEFAULT_ERROR_MESSAGE.'22019',0), -22020 => array(DEFAULT_ERROR_MESSAGE.'22020',0), -13001 => array(DEFAULT_ERROR_MESSAGE.'13001',0), -13002 => array(DEFAULT_ERROR_MESSAGE.'13002',0), -1001 => array(DEFAULT_ERROR_MESSAGE.'1001',0), -1002 => array(DEFAULT_ERROR_MESSAGE.'1002',0), -1003 => array(DEFAULT_ERROR_MESSAGE.'1003',0), -1004 => array(DEFAULT_ERROR_MESSAGE.'1004',0), -1005 => array(DEFAULT_ERROR_MESSAGE.'1005',0), -1006 => array(DEFAULT_ERROR_MESSAGE.'1006',0), -1007 => array(DEFAULT_ERROR_MESSAGE.'1007',0), -1008 => array(DEFAULT_ERROR_MESSAGE.'1008',0), -1009 => array(DEFAULT_ERROR_MESSAGE.'1009',0), -1010 => array(DEFAULT_ERROR_MESSAGE.'1010',0), -1011 => array(DEFAULT_ERROR_MESSAGE.'1011',0), -26000 => array(DEFAULT_ERROR_MESSAGE.'26000',0), -26001 => array(DEFAULT_ERROR_MESSAGE.'26001',0), -26002 => array(DEFAULT_ERROR_MESSAGE.'26002',0), -26003 => array(DEFAULT_ERROR_MESSAGE.'26003',0), -26004 => array(DEFAULT_ERROR_MESSAGE.'26004',0), -26005 => array(DEFAULT_ERROR_MESSAGE.'26005',0), -26006 => array(DEFAULT_ERROR_MESSAGE.'26006',0), -26007 => array(DEFAULT_ERROR_MESSAGE.'26007',0), -26008 => array(DEFAULT_ERROR_MESSAGE.'26008',0), -26009 => array(DEFAULT_ERROR_MESSAGE.'26009',0), -26010 => array(DEFAULT_ERROR_MESSAGE.'26010',0), -26011 => array(DEFAULT_ERROR_MESSAGE.'26011',0), -26012 => array(DEFAULT_ERROR_MESSAGE.'26012',0), -26013 => array(DEFAULT_ERROR_MESSAGE.'26013',0), -26014 => array(DEFAULT_ERROR_MESSAGE.'26014',0), -26015 => array(DEFAULT_ERROR_MESSAGE.'26015',0), -26016 => array(DEFAULT_ERROR_MESSAGE.'26016',0), - -27001 => array(DEFAULT_ERROR_MESSAGE.'27001',0), -27002 => array(DEFAULT_ERROR_MESSAGE.'27002',0), -27003 => array(DEFAULT_ERROR_MESSAGE.'27003',0), -27004 => array(DEFAULT_ERROR_MESSAGE.'27004',0), -27005 => array(DEFAULT_ERROR_MESSAGE.'27005',0), -27006 => array(DEFAULT_ERROR_MESSAGE.'27006',0), -27007 => array(DEFAULT_ERROR_MESSAGE.'27007',0), -27008 => array(DEFAULT_ERROR_MESSAGE.'27008',0), -27009 => array(DEFAULT_ERROR_MESSAGE.'27009',0), -27010 => array(DEFAULT_ERROR_MESSAGE.'27010',0), -27011 => array(DEFAULT_ERROR_MESSAGE.'27011',0), -27012 => array(DEFAULT_ERROR_MESSAGE.'27012',0), -27013 => array(DEFAULT_ERROR_MESSAGE.'27013',0), -27014 => array(DEFAULT_ERROR_MESSAGE.'27014',0), -27015 => array(DEFAULT_ERROR_MESSAGE.'27015',0), - -28001 => array(DEFAULT_ERROR_MESSAGE.'28001',0), -28002 => array(DEFAULT_ERROR_MESSAGE.'28002',0), -28003 => array(DEFAULT_ERROR_MESSAGE.'28003',0), -28004 => array(DEFAULT_ERROR_MESSAGE.'28004',0), -28005 => array(DEFAULT_ERROR_MESSAGE.'28005',0), -28006 => array(DEFAULT_ERROR_MESSAGE.'28006',0), -28007 => array(DEFAULT_ERROR_MESSAGE.'28007',0), - -29201 => array(DEFAULT_ERROR_MESSAGE.'28001',0), -29202 => array(DEFAULT_ERROR_MESSAGE.'28002',0), -29203 => array(DEFAULT_ERROR_MESSAGE.'28003',0), -29204 => array(DEFAULT_ERROR_MESSAGE.'28004',0), -29205 => array(DEFAULT_ERROR_MESSAGE.'28005',0), -29206 => array(DEFAULT_ERROR_MESSAGE.'28006',0), -29207 => array(DEFAULT_ERROR_MESSAGE.'28007',0), -29208 => array(DEFAULT_ERROR_MESSAGE.'28008',0), -29209 => array(DEFAULT_ERROR_MESSAGE.'28009',0), -29210 => array(DEFAULT_ERROR_MESSAGE.'28010',0), - -); - -?> diff --git a/#jpgraph/src/themes/AquaTheme.class.php b/#jpgraph/src/themes/AquaTheme.class.php deleted file mode 100644 index 751b4202..00000000 --- a/#jpgraph/src/themes/AquaTheme.class.php +++ /dev/null @@ -1,202 +0,0 @@ -img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - */ - $graph->SetFrame(false); - $graph->SetMarginColor('white'); - $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); - - // legend - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetFillColor('white'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // xaxis - $graph->xaxis->title->SetColor($this->font_color); - $graph->xaxis->SetColor($this->axis_color, $this->font_color); - $graph->xaxis->SetTickSide(SIDE_BOTTOM); - $graph->xaxis->SetLabelMargin(10); - - // yaxis - $graph->yaxis->title->SetColor($this->font_color); - $graph->yaxis->SetColor($this->axis_color, $this->font_color); - $graph->yaxis->SetTickSide(SIDE_LEFT); - $graph->yaxis->SetLabelMargin(8); - $graph->yaxis->HideLine(); - $graph->yaxis->HideTicks(); - $graph->xaxis->SetTitleMargin(15); - - // grid - $graph->ygrid->SetColor($this->grid_color); - $graph->ygrid->SetLineStyle('dotted'); - - - // font - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - -// $graph->img->SetAntiAliasing(); - } - - - function SetupPieGraph($graph) { - - // graph - $graph->SetFrame(false); - - // legend - $graph->legend->SetFillColor('white'); - - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.80, 'center', 'top'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(4); - - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // title - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - - $graph->SetAntiAliasing(); - } - - - function PreStrokeApply($graph) { - if ($graph->legend->HasItems()) { - $img = $graph->img; - $height = $img->height; - $graph->SetMargin( - $img->raw_left_margin, - $img->raw_right_margin, - $img->raw_top_margin, - $height * 0.25 - ); - } - } - - function ApplyPlot($plot) { - - switch (get_class($plot)) - { - case 'GroupBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'AccBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'BarPlot': - { - $plot->Clear(); - - $color = $this->GetNextColor(); - $plot->SetColor($color); - $plot->SetFillColor($color); - //$plot->SetShadow(); - break; - } - - case 'LinePlot': - { - $plot->Clear(); - $plot->SetColor($this->GetNextColor()); - $plot->SetWeight(2); -// $plot->SetBarCenter(); - break; - } - - case 'PiePlot': - { - $plot->SetCenter(0.5, 0.45); - $plot->ShowBorder(false); - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - case 'PiePlot3D': - { - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - default: - { - } - } - } -} - - -?> diff --git a/#jpgraph/src/themes/GreenTheme.class.php b/#jpgraph/src/themes/GreenTheme.class.php deleted file mode 100644 index a61fbd83..00000000 --- a/#jpgraph/src/themes/GreenTheme.class.php +++ /dev/null @@ -1,178 +0,0 @@ -img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - */ - $graph->SetFrame(false); - $graph->SetMarginColor('white'); - $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); - - // legend - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetFillColor('white'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // xaxis - $graph->xaxis->title->SetColor($this->font_color); - $graph->xaxis->SetColor($this->axis_color, $this->font_color); - $graph->xaxis->SetTickSide(SIDE_BOTTOM); - $graph->xaxis->SetLabelMargin(10); - - // yaxis - $graph->yaxis->title->SetColor($this->font_color); - $graph->yaxis->SetColor($this->axis_color, $this->font_color); - $graph->yaxis->SetTickSide(SIDE_LEFT); - $graph->yaxis->SetLabelMargin(8); - $graph->yaxis->HideLine(); - $graph->yaxis->HideTicks(); - $graph->xaxis->SetTitleMargin(15); - - // grid - $graph->ygrid->SetColor($this->grid_color); - $graph->ygrid->SetLineStyle('dotted'); - - - // font - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - -// $graph->img->SetAntiAliasing(); - } - - - function SetupPieGraph($graph) { - - // graph - $graph->SetFrame(false); - - // legend - $graph->legend->SetFillColor('white'); - /* - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - */ - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // title - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - - $graph->SetAntiAliasing(); - } - - - function PreStrokeApply($graph) { - if ($graph->legend->HasItems()) { - $img = $graph->img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - } - } - - function ApplyPlot($plot) { - - switch (get_class($plot)) - { - case 'GroupBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'AccBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'BarPlot': - { - $plot->Clear(); - - $color = $this->GetNextColor(); - $plot->SetColor($color); - $plot->SetFillColor($color); - $plot->SetShadow('red', 3, 4, false); - break; - } - - case 'LinePlot': - { - $plot->Clear(); - - $plot->SetColor($this->GetNextColor().'@0.4'); - $plot->SetWeight(2); - break; - } - - case 'PiePlot': - { - $plot->ShowBorder(false); - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - case 'PiePlot3D': - { - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - default: - { - } - } - } -} - - -?> diff --git a/#jpgraph/src/themes/OceanTheme.class.php b/#jpgraph/src/themes/OceanTheme.class.php deleted file mode 100644 index b2750360..00000000 --- a/#jpgraph/src/themes/OceanTheme.class.php +++ /dev/null @@ -1,180 +0,0 @@ -img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - */ - $graph->SetFrame(false); - $graph->SetMarginColor('white'); - $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); - - // legend - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetFillColor('white'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // xaxis - $graph->xaxis->title->SetColor($this->font_color); - $graph->xaxis->SetColor($this->axis_color, $this->font_color); - $graph->xaxis->SetTickSide(SIDE_BOTTOM); - $graph->xaxis->SetLabelMargin(10); - - // yaxis - $graph->yaxis->title->SetColor($this->font_color); - $graph->yaxis->SetColor($this->axis_color, $this->font_color); - $graph->yaxis->SetTickSide(SIDE_LEFT); - $graph->yaxis->SetLabelMargin(8); - $graph->yaxis->HideLine(); - $graph->yaxis->HideTicks(); - $graph->xaxis->SetTitleMargin(15); - - // grid - $graph->ygrid->SetColor($this->grid_color); - $graph->ygrid->SetLineStyle('dotted'); - - - // font - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - -// $graph->img->SetAntiAliasing(); - } - - - function SetupPieGraph($graph) { - - // graph - $graph->SetFrame(false); - - // legend - $graph->legend->SetFillColor('white'); - /* - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - */ - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // title - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - - $graph->SetAntiAliasing(); - } - - - function PreStrokeApply($graph) { - if ($graph->legend->HasItems()) { - $img = $graph->img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - } - } - - function ApplyPlot($plot) { - - switch (get_class($plot)) - { - case 'GroupBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'AccBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'BarPlot': - { - $plot->Clear(); - - $color = $this->GetNextColor(); - $plot->SetColor($color); - $plot->SetFillColor($color); - $plot->SetShadow('red', 3, 4, false); - break; - } - - case 'LinePlot': - { - $plot->Clear(); - - $plot->SetColor($this->GetNextColor()); - $plot->SetWeight(2); - break; - } - - case 'PiePlot': - { - $plot->ShowBorder(false); - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - case 'PiePlot3D': - { - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - default: - { - } - } - } -} - - -?> diff --git a/#jpgraph/src/themes/OrangeTheme.class.php b/#jpgraph/src/themes/OrangeTheme.class.php deleted file mode 100644 index ea26dad8..00000000 --- a/#jpgraph/src/themes/OrangeTheme.class.php +++ /dev/null @@ -1,180 +0,0 @@ -img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - */ - $graph->SetFrame(false); - $graph->SetMarginColor('white'); - $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); - - // legend - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetFillColor('white'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // xaxis - $graph->xaxis->title->SetColor($this->font_color); - $graph->xaxis->SetColor($this->axis_color, $this->font_color); - $graph->xaxis->SetTickSide(SIDE_BOTTOM); - $graph->xaxis->SetLabelMargin(10); - - // yaxis - $graph->yaxis->title->SetColor($this->font_color); - $graph->yaxis->SetColor($this->axis_color, $this->font_color); - $graph->yaxis->SetTickSide(SIDE_LEFT); - $graph->yaxis->SetLabelMargin(8); - $graph->yaxis->HideLine(); - $graph->yaxis->HideTicks(); - $graph->xaxis->SetTitleMargin(15); - - // grid - $graph->ygrid->SetColor($this->grid_color); - $graph->ygrid->SetLineStyle('dotted'); - - - // font - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - -// $graph->img->SetAntiAliasing(); - } - - - function SetupPieGraph($graph) { - - // graph - $graph->SetFrame(false); - - // legend - $graph->legend->SetFillColor('white'); - /* - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - */ - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // title - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - - $graph->SetAntiAliasing(); - } - - - function PreStrokeApply($graph) { - if ($graph->legend->HasItems()) { - $img = $graph->img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - } - } - - function ApplyPlot($plot) { - - switch (get_class($plot)) - { - case 'GroupBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'AccBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'BarPlot': - { - $plot->Clear(); - - $color = $this->GetNextColor(); - $plot->SetColor($color); - $plot->SetFillColor($color); - $plot->SetShadow('red', 3, 4, false); - break; - } - - case 'LinePlot': - { - $plot->Clear(); - - $plot->SetColor($this->GetNextColor().'@0.4'); - $plot->SetWeight(2); - break; - } - - case 'PiePlot': - { - $plot->ShowBorder(false); - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - case 'PiePlot3D': - { - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - default: - { - } - } - } -} - - -?> diff --git a/#jpgraph/src/themes/PastelTheme.class.php b/#jpgraph/src/themes/PastelTheme.class.php deleted file mode 100644 index d3f1ddb6..00000000 --- a/#jpgraph/src/themes/PastelTheme.class.php +++ /dev/null @@ -1,175 +0,0 @@ -img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - */ - $graph->SetFrame(false); - $graph->SetMarginColor('white'); - $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); - - // legend - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetFillColor('white'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // xaxis - $graph->xaxis->title->SetColor($this->font_color); - $graph->xaxis->SetColor($this->axis_color, $this->font_color); - $graph->xaxis->SetTickSide(SIDE_BOTTOM); - $graph->xaxis->SetLabelMargin(10); - - // yaxis - $graph->yaxis->title->SetColor($this->font_color); - $graph->yaxis->SetColor($this->axis_color, $this->font_color); - $graph->yaxis->SetTickSide(SIDE_LEFT); - $graph->yaxis->SetLabelMargin(8); - $graph->yaxis->HideLine(); - $graph->yaxis->HideTicks(); - $graph->xaxis->SetTitleMargin(15); - - // grid - $graph->ygrid->SetColor($this->grid_color); - $graph->ygrid->SetLineStyle('dotted'); - - - // font - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - -// $graph->img->SetAntiAliasing(); - } - - - function SetupPieGraph($graph) { - - // graph - $graph->SetFrame(false); - - // legend - $graph->legend->SetFillColor('white'); - - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.80, 'center', 'top'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(4); - - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // title - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - - $graph->SetAntiAliasing(); - } - - - function PreStrokeApply($graph) { - if ($graph->legend->HasItems()) { - $img = $graph->img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - } - } - - function ApplyPlot($plot) { - - switch (get_class($plot)) - { - case 'GroupBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'AccBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'BarPlot': - { - $plot->Clear(); - - $color = $this->GetNextColor(); - $plot->SetColor($color); - $plot->SetFillColor($color); - $plot->SetShadow('red', 3, 4, false); - break; - } - - case 'LinePlot': - { - $plot->Clear(); - $plot->SetColor($this->GetNextColor().'@0.4'); - $plot->SetWeight(2); -// $plot->SetBarCenter(); - break; - } - - case 'PiePlot': - { - $plot->SetCenter(0.5, 0.45); - $plot->ShowBorder(false); - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - case 'PiePlot3D': - { - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - default: - { - } - } - } -} - - -?> diff --git a/#jpgraph/src/themes/RoseTheme.class.php b/#jpgraph/src/themes/RoseTheme.class.php deleted file mode 100644 index 5a146300..00000000 --- a/#jpgraph/src/themes/RoseTheme.class.php +++ /dev/null @@ -1,180 +0,0 @@ -img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - */ - $graph->SetFrame(false); - $graph->SetMarginColor('white'); - $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); - - // legend - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetFillColor('white'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // xaxis - $graph->xaxis->title->SetColor($this->font_color); - $graph->xaxis->SetColor($this->axis_color, $this->font_color); - $graph->xaxis->SetTickSide(SIDE_BOTTOM); - $graph->xaxis->SetLabelMargin(10); - - // yaxis - $graph->yaxis->title->SetColor($this->font_color); - $graph->yaxis->SetColor($this->axis_color, $this->font_color); - $graph->yaxis->SetTickSide(SIDE_LEFT); - $graph->yaxis->SetLabelMargin(8); - $graph->yaxis->HideLine(); - $graph->yaxis->HideTicks(); - $graph->xaxis->SetTitleMargin(15); - - // grid - $graph->ygrid->SetColor($this->grid_color); - $graph->ygrid->SetLineStyle('dotted'); - - - // font - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - -// $graph->img->SetAntiAliasing(); - } - - - function SetupPieGraph($graph) { - - // graph - $graph->SetFrame(false); - - // legend - $graph->legend->SetFillColor('white'); - /* - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - */ - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // title - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - - $graph->SetAntiAliasing(); - } - - - function PreStrokeApply($graph) { - if ($graph->legend->HasItems()) { - $img = $graph->img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - } - } - - function ApplyPlot($plot) { - - switch (get_class($plot)) - { - case 'GroupBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'AccBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'BarPlot': - { - $plot->Clear(); - - $color = $this->GetNextColor(); - $plot->SetColor($color); - $plot->SetFillColor($color); - $plot->SetShadow('red', 3, 4, false); - break; - } - - case 'LinePlot': - { - $plot->Clear(); - - $plot->SetColor($this->GetNextColor().'@0.4'); - $plot->SetWeight(2); - break; - } - - case 'PiePlot': - { - $plot->ShowBorder(false); - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - case 'PiePlot3D': - { - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - default: - { - } - } - } -} - - -?> diff --git a/#jpgraph/src/themes/SoftyTheme.class.php b/#jpgraph/src/themes/SoftyTheme.class.php deleted file mode 100644 index 222cf85a..00000000 --- a/#jpgraph/src/themes/SoftyTheme.class.php +++ /dev/null @@ -1,209 +0,0 @@ -SetFrame(false); - $graph->SetMarginColor('white'); - - // legend - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetFillColor('white'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // xaxis - $graph->xaxis->title->SetColor($this->font_color); - $graph->xaxis->SetColor($this->axis_color, $this->font_color); - $graph->xaxis->SetTickSide(SIDE_BOTTOM); - $graph->xaxis->SetLabelMargin(10); - - // yaxis - $graph->yaxis->title->SetColor($this->font_color); - $graph->yaxis->SetColor($this->axis_color, $this->font_color); - $graph->yaxis->SetTickSide(SIDE_LEFT); - $graph->yaxis->SetLabelMargin(8); - $graph->yaxis->HideLine(); - $graph->yaxis->HideTicks(); - $graph->xaxis->SetTitleMargin(15); - - // y2~ - if (isset($graph->y2axis)) { - $graph->y2axis->title->SetColor($this->font_color); - $graph->y2axis->SetColor($this->axis_color, $this->font_color); - $graph->y2axis->SetTickSide(SIDE_LEFT); - $graph->y2axis->SetLabelMargin(8); - $graph->y2axis->HideLine(); - $graph->y2axis->HideTicks(); - } - - // yn - if (isset($graph->y2axis)) { - foreach ($graph->ynaxis as $axis) { - $axis->title->SetColor($this->font_color); - $axis->SetColor($this->axis_color, $this->font_color); - $axis->SetTickSide(SIDE_LEFT); - $axis->SetLabelMargin(8); - $axis->HideLine(); - $axis->HideTicks(); - } - } - - // grid - $graph->ygrid->SetColor($this->grid_color); - $graph->ygrid->SetLineStyle('dotted'); - $graph->ygrid->SetFill(true, '#FFFFFF', $this->background_color); - $graph->xgrid->Show(); - $graph->xgrid->SetColor($this->grid_color); - $graph->xgrid->SetLineStyle('dotted'); - - - // font - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - -// $graph->img->SetAntiAliasing(); - } - - - function SetupPieGraph($graph) { - - // graph - $graph->SetFrame(false); - - // title - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - - $graph->SetAntiAliasing(); - } - - - function PreStrokeApply($graph) { - if ($graph->legend->HasItems()) { - $img = $graph->img; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $img->height * 0.25); -// $graph->SetMargin(200, $img->right_margin, $img->top_margin, $height * 0.25); - } - } - - function ApplyPlot($plot) { - - switch (get_class($plot)) - { - case 'BarPlot': - { - $plot->Clear(); - - $color = $this->GetNextColor(); - $plot->SetColor($color); - $plot->SetFillColor($color); - $plot->SetShadow('red', 3, 4, false); - $plot->value->SetAlign('center', 'center'); - break; - } - - case 'LinePlot': - { - $plot->Clear(); - - $plot->SetColor($this->GetNextColor()); - $plot->SetWeight(2); -// $plot->SetBarCenter(); - break; - } - - case 'PiePlot': - { - $plot->ShowBorder(false); - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - - case 'GroupBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'AccBarPlot': - { - $plot->value->SetAlign('center', 'center'); - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - $_plot->SetValuePos('center'); - } - break; - } - - case 'ScatterPlot': - { - break; - } - - - case 'PiePlot3D': - { - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - default: - { - } - } - } -} - - -?> diff --git a/#jpgraph/src/themes/UniversalTheme.class.php b/#jpgraph/src/themes/UniversalTheme.class.php deleted file mode 100644 index 44b57a6e..00000000 --- a/#jpgraph/src/themes/UniversalTheme.class.php +++ /dev/null @@ -1,188 +0,0 @@ -img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - */ - $graph->SetFrame(false); - $graph->SetMarginColor('white'); - $graph->SetBox(true, '#DADADA'); -// $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); - - // legend - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetFillColor('white'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // xaxis - $graph->xaxis->title->SetColor($this->font_color); - $graph->xaxis->SetColor($this->axis_color, $this->font_color); - $graph->xaxis->SetTickSide(SIDE_BOTTOM); - $graph->xaxis->SetLabelMargin(10); - $graph->xaxis->HideTicks(); - $graph->xaxis->SetTitleMargin(15); - //$graph->xaxis->SetLabelMargin(30); - - // yaxis - $graph->yaxis->title->SetColor($this->font_color); - $graph->yaxis->SetColor($this->axis_color, $this->font_color); - $graph->yaxis->SetTickSide(SIDE_LEFT); - $graph->yaxis->SetLabelMargin(8); -// $graph->yaxis->SetTickPositions(array(50, 100, 150)); -// $graph->yaxis->HideLine(); - $graph->yaxis->HideTicks(); - - // grid - $graph->ygrid->SetColor($this->grid_color); - $graph->ygrid->SetFill(true, '#FFFFFF', $this->background_color); - // $graph->ygrid->SetLineStyle('dotted'); - - - // font - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - - $graph->img->SetAntiAliasing(); - } - - - function SetupPieGraph($graph) { - - // graph - $graph->SetFrame(false); - - // legend - $graph->legend->SetFillColor('white'); - - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.80, 'center', 'top'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(4); - - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // title - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - - $graph->SetAntiAliasing(); - } - - - function PreStrokeApply($graph) { - if ($graph->legend->HasItems()) { - $img = $graph->img; - $height = $img->height; - $graph->SetMargin( - $img->raw_left_margin, - $img->raw_right_margin, - $img->raw_top_margin, - $height * 0.25 - ); - } - } - - function ApplyPlot($plot) { - - switch (get_class($plot)) - { - case 'GroupBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'AccBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'BarPlot': - { - $plot->Clear(); - - $color = $this->GetNextColor(); - $plot->SetColor($color); - $plot->SetFillColor($color); - $plot->SetShadow('red', 3, 4, false); - break; - } - - case 'LinePlot': - { - $plot->Clear(); - $plot->SetColor($this->GetNextColor().'@0.4'); - $plot->SetWeight(2); - break; - } - - case 'PiePlot': - { - $plot->SetCenter(0.5, 0.45); - $plot->ShowBorder(false); - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - case 'PiePlot3D': - { - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - default: - { - } - } - } -} - - -?> diff --git a/#jpgraph/src/themes/VividTheme.class.php b/#jpgraph/src/themes/VividTheme.class.php deleted file mode 100644 index 38a77091..00000000 --- a/#jpgraph/src/themes/VividTheme.class.php +++ /dev/null @@ -1,175 +0,0 @@ -img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - */ - $graph->SetFrame(false); - $graph->SetMarginColor('white'); - $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); - - // legend - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.85, 'center', 'top'); - $graph->legend->SetFillColor('white'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(3); - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // xaxis - $graph->xaxis->title->SetColor($this->font_color); - $graph->xaxis->SetColor($this->axis_color, $this->font_color); - $graph->xaxis->SetTickSide(SIDE_BOTTOM); - $graph->xaxis->SetLabelMargin(10); - - // yaxis - $graph->yaxis->title->SetColor($this->font_color); - $graph->yaxis->SetColor($this->axis_color, $this->font_color); - $graph->yaxis->SetTickSide(SIDE_LEFT); - $graph->yaxis->SetLabelMargin(8); - $graph->yaxis->HideLine(); - $graph->yaxis->HideTicks(); - $graph->xaxis->SetTitleMargin(15); - - // grid - $graph->ygrid->SetColor($this->grid_color); - $graph->ygrid->SetLineStyle('dotted'); - - - // font - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - -// $graph->img->SetAntiAliasing(); - } - - - function SetupPieGraph($graph) { - - // graph - $graph->SetFrame(false); - - // legend - $graph->legend->SetFillColor('white'); - - $graph->legend->SetFrameWeight(0); - $graph->legend->Pos(0.5, 0.80, 'center', 'top'); - $graph->legend->SetLayout(LEGEND_HOR); - $graph->legend->SetColumns(4); - - $graph->legend->SetShadow(false); - $graph->legend->SetMarkAbsSize(5); - - // title - $graph->title->SetColor($this->font_color); - $graph->subtitle->SetColor($this->font_color); - $graph->subsubtitle->SetColor($this->font_color); - - $graph->SetAntiAliasing(); - } - - - function PreStrokeApply($graph) { - if ($graph->legend->HasItems()) { - $img = $graph->img; - $height = $img->height; - $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); - } - } - - function ApplyPlot($plot) { - - switch (get_class($plot)) - { - case 'GroupBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'AccBarPlot': - { - foreach ($plot->plots as $_plot) { - $this->ApplyPlot($_plot); - } - break; - } - - case 'BarPlot': - { - $plot->Clear(); - - $color = $this->GetNextColor(); - $plot->SetColor($color); - $plot->SetFillColor($color); - $plot->SetShadow('red', 3, 4, false); - break; - } - - case 'LinePlot': - { - $plot->Clear(); - $plot->SetColor($this->GetNextColor().'@0.4'); - $plot->SetWeight(2); -// $plot->SetBarCenter(); - break; - } - - case 'PiePlot': - { - $plot->SetCenter(0.5, 0.45); - $plot->ShowBorder(false); - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - case 'PiePlot3D': - { - $plot->SetSliceColors($this->GetThemeColors()); - break; - } - - default: - { - } - } - } -} - - -?> diff --git a/#pma/CONTRIBUTING.md b/#pma/CONTRIBUTING.md deleted file mode 100644 index e13da812..00000000 --- a/#pma/CONTRIBUTING.md +++ /dev/null @@ -1,34 +0,0 @@ -# Contributing to phpMyAdmin - -As an open source project, phpMyAdmin welcomes contributions of many forms. - -## Bug reporting - -We appreciate your effort to improve phpMyAdmin by submitting a bug report. Before doing so, please check the following things: - -1. Check whether the bug you face **hasn't been already reported**. Duplicate reports takes us time, that we could be used to fix other bugs or make improvements. -2. Specify the phpMyAdmin, server, PHP, MySQL and browser information that may be helpful to fix the problem, especially exact **version numbers**. -3. If you got some error, please **describe what happened** and add error message. Reports like "I get error when I clicked on some link." are useless. -4. Provide easy steps to reproduce and if possible include your table structure (``SHOW CREATE TABLE `tbl_name```); if your problem implies specific data, attach a small export file for sample rows. -5. **Security problems** should not be reported here. See [our security page](https://www.phpmyadmin.net/security/). -Thanks for your help! - -Please report [bugs on GitHub][1]. - -[1]: https://github.com/phpmyadmin/phpmyadmin/issues/new - -## Patches submission - -Patches are welcome as [pull requests on GitHub][2]. Please include a -Signed-off-by tag. Note that by submitting patches with the Signed-off-by -tag, you are giving permission to license the patch as GPLv2-or-later. See -[the DCO file][3] for details. - -[2]: https://github.com/phpmyadmin/phpmyadmin/pulls -[3]: https://github.com/phpmyadmin/phpmyadmin/blob/master/DCO - -## More information - -You can find more information on our website: - -https://www.phpmyadmin.net/contribute/ diff --git a/#pma/ChangeLog b/#pma/ChangeLog deleted file mode 100644 index 29de1421..00000000 --- a/#pma/ChangeLog +++ /dev/null @@ -1,417 +0,0 @@ -phpMyAdmin - ChangeLog -====================== - -4.6.5.2 (2016-12-05) -- issue #12765 Fixed SQL export with newlines - -4.6.5.1 (2016-11-25) -- issue #12735 Incorrect parameters to escapeString in Node.php -- issue #12734 Fix PHP error when mbstring is not installed -- issue #12736 Don't force partition count to be specified when creating a new table - -4.6.5 (2016-11-24) -- issue Remove potentionally license problematic sRGB profile -- issue #12459 Display read only fields as read only when editing -- issue #12384 Fix expanding of navigation pane when clicking on database -- issue #12430 Impove partitioning support -- issue #12374 Reintroduced simplified PmaAbsoluteUri configuration directive -- issue Always use UTC time in HTTP headers -- issue #12479 Simplified validation of external links -- issue #12483 Fix browsing tables with built in transformations -- issue #12485 Do not show warning about short blowfish_secret if none is set -- issue #12251 Fixed random logouts due to wrong cookie path -- issue #12480 Fixed editing of ENUM/SET/DECIMAL fields structure -- issue #12497 Missing escaping of configuration used in SQL (hide_db and only_db) -- issue #12476 Add error checking in reading advisory rules file -- issue #12477 Add checking missing elements and confirming element types from json_decode -- issue #12251 Automatically save SQL query in browser local storage rather than in cookie -- issue #12292 Unable to edit transformations -- issue #12502 Remove unused paramenter when connecting to MySQLi -- issue #12303 Fix number formatting with different settings of precision in PHP -- issue #12405 Use single quotes in PHP code -- issue #12534 Option for the dropped column is not removed from 'after_field' select, after the column is dropped -- issue #12531 Properly detect DROP DATABASE queries -- issue #12470 Fix possible race condition in setting URL hash -- issue #11924 Remove caching of server information -- issue #11628 Proper parsing of INSERT ... ON DUPLICATE KEY queries -- issue #12545 Proper parsing of CREATE TABLE ... PARTITION queries -- issue #12473 Code can throw unhandled exception -- issue #12550 Do not try to keep alive session even after expiry -- issue #12512 Fixed rendering BBCode links in setup -- issue #12518 Fixed copy of table with generated columns -- issue #12221 Fixed export of table with generated columns -- issue #12320 Copying a user does not copy usergroup -- issue #12272 Adding a new row with default enum goes to no selection when you want to add more then 2 rows -- issue #12487 Drag and drop import prevents file dropping to blob column file selector on the insert tab -- issue #12554 Absence of scrolling makes it impossible to read longer text values in grid editing -- issue #12530 "Edit routine" crashes when the current user is not the definer, even if privileges are adequate -- issue #12300 Export selective tables by-default dumps Events also -- issue #12298 Fixed export of view definitions -- issue #12242 Edit routine detail dialog does not fill "Return length" field in mysql functions -- issue #12575 New index Confirm adds whitespace around the field name -- issue #12382 Bug in zoom search -- issue #12321 Assign LIMIT clause only to syntactically correct queries -- issue #12461 Can't Execute SQL With Sub-Query Due To "LIMIT 0,25" Inserted At Wrong Place -- issue #12511 Clarify documentation on ArbitraryServerRegexp -- issue #12508 Remove duplicate code in SQL escaping -- issue #12475 Cleanup code for getting table information -- issue #12579 phpMyAdmin's export of a Select statment without a FROM clause generates Wrong SQL -- issue #12316 Correct export of complex SELECT statements -- issue #12080 Fixed parsing of subselect queries -- issue #11740 Fixed handling DELETE ... USING queries -- issue #12100 Fixed handling of CASE operator -- issue #12455 Query history stores separate entry for every letter typed -- issue #12327 Create PHP code no longer works -- issue #12179 Fixed bookmarking of query with multiple statements -- issue #12419 Wrong description on GRANT OPTION -- issue #12615 Fixed regexp for matching browser versions -- issue #12569 Avoid showing import errors twice -- issue #12362 prefs_manage.php can leave an orphaned temporary file -- issue #12619 Unable to export csv when using union select -- issue #12625 Broken Edit links in query results of JOIN query -- issue #12634 Drop DB error in import if DB doesn't exist -- issue #12338 Designer reverts to first saved ER after EACH relation create or delete -- issue #12639 'Show trace' in Console generates JS error for functions in query's trace called without any arguments -- issue #12366 Fix user creation with certain MariaDB setups -- issue #12616 Refuse to work with mbstring.func_overload enabled -- issue #12472 Properly report connection without password in setup -- issue #12365 Fix records count for large tables -- issue #12533 Fix records count for complex queries -- issue #12454 Query history not updated in console until page refresh -- issue #12344 Fixed parsing of labels in loop -- issue #12228 Fixed parsing of BEGIN labels -- issue #12637 Fixed editing some timestamp values -- issue #12622 Fixed javascript error in designer -- issue #12334 Missing page indicator or VIEWs -- issue #12610 Export of tables with Timestamp/Datetime/Time columns defined with ON UPDATE clause with precision fails -- issue #12661 Error inserting into pma__history after timeout -- issue #12195 Row_format = fixed not visible -- issue #12665 Cannot add a foreign key - non-indexed fields not listed in InnoDB tables -- issue #12674 Allow for proper MySQL-allowed strings as identifiers -- issue #12651 Allow for partial dates on table insert page -- issue #12681 Fixed designer with tables using special chars -- issue #12652 Fixed visual query builder for foreign keys with more fields -- issue #12257 Improved search page performance -- issue #12322 Avoid selecting default function for foreign keys -- issue #12453 Fixed escaping of SQL parts in some corner cases -- issue #12542 Missing table name in account privileges editor -- issue #12691 Remove ksort call on empty array in PMA_getPlugins function -- issue #12443 Check parameter type before processing -- issue #12299 Avoid generating too long URLs in search -- issue #12361 Fix self SQL injection in table-specific privileges -- issue #12698 Add link to release notes and download on new version notification -- issue #12712 Error when trying to setup replication (fatal error in call to an old PMA_DBI_connect function) -- issue [security] Unsafe generation of $cfg['blowfish_secret'], see PMASA-2016-58 -- issue [security] phpMyAdmin's phpinfo functionality is removed, see PMASA-2016-59 -- issue [security] AllowRoot and allow/deny rule bypass with specially-crafted username, see PMASA-2016-60 -- issue [security] Username matching weaknesses with allow/deny rules, see PMASA-2016-61 -- issue [security] Possible to bypass logout timeout, see PMASA-2016-62 -- issue [security] Full path disclosure (FPD) weaknesses, see PMASA-2016-63 -- issue [security] Multiple XSS weaknesses, see PMASA-2016-64 -- issue [security] Multiple denial-of-service (DOS) vulnerabilities, see PMASA-2016-65 -- issue [security] Possible to bypass white-list protection for URL redirection, see PMASA-2016-66 -- issue [security] BBCode injection to login page, see PMASA-2016-67 -- issue [security] Denial-of-service (DOS) vulnerability in table partitioning, see PMASA-2016-68 -- issue [security] Multiple SQL injection vulnerabilities, see PMASA-2016-69 -- issue [security] Incorrect serialized string parsing, see PMASA-2016-70 -- issue [security] CSRF token not stripped from the URL, see PMASA-2016-71 - -4.6.4 (2016-08-16) -- issue [security] Weaknesses with cookie encryption, see PMASA-2016-29 -- issue [security] Improve session cookie code for openid.php and signon.php example files -- issue [security] Full path disclosure in openid.php and signon.php example files -- issue [security] Multiple XSS vulnerabilities, see PMASA-2016-30 -- issue [security] Multiple XSS vulnerabilities, see PMASA-2016-31 -- issue [security] Unsafe generation of BlowfishSecret (when not supplied by the user) -- issue [security] Referrer leak when phpinfo is enabled -- issue [security] PHP code injection, see PMASA-2016-32 -- issue [security] Full path disclosure, see PMASA-2016-33 -- issue [security] SQL injection attack, see PMASA-2016-34 -- issue [security] Local file exposure through LOAD DATA LOCAL INFILE, see PMASA-2016-35 -- issue [security] Local file exposure through symlinks with UploadDir, see PMASA-2016-36 -- issue [security] Path traversal with SaveDir and UploadDir, see PMASA-2016-37 -- issue [security] Multiple XSS vulnerabilities, see PMASA-2016-38 -- issue [security] SQL injection vulnerability as control user, see PMASA-2016-39 -- issue [security] SQL injection vulnerability, see PMASA-2016-40 -- issue [security] Denial-of-service attack through transformation feature, see PMASA-2016-41 -- issue [security] SQL injection vulnerability as control user, see PMASA-2016-42 -- issue [security] Verify data before unserializing, see PMASA-2016-43 -- issue [security] Use HTTPS for wiki links -- issue Remove Swekey support -- issue [security] SSRF in setup script, see PMASA-2016-44 -- issue [security] Denial-of-service attack with $cfg['AllowArbitraryServer'] = true and persistent connections, see PMASA-2016-45 -- issue [security] Improve SSL certificate handling -- issue [security] Fix full path disclosure in debugging code -- issue [security] Possible circumvention of IP-based allow/deny rules with IPv6 and proxy server, see PMASA-2016-47 -- issue [security] Detect if user is logged in, see PMASA-2016-48 -- issue [security] Bypass URL redirection protection, see PMASA-2016-49 -- issue [security] Referrer leak, see PMASA-2016-50 -- issue [security] Reflected File Download, see PMASA-2016-51 -- issue [security] ArbitraryServerRegexp bypass, see PMASA-2016-52 -- issue [security] Denial-of-service attack by entering long password, see PMASA-2016-53 -- issue [security] Remote code execution vulnerability when running as CGI, see PMASA-2016-054 -- issue [security] Administrators could trigger SQL injection attack against users -- issue [security] Denial-of-service attack when PHP uses dbase extension, see PMASA-2016-55 -- issue [security] Remove tode execution vulnerability when PHP uses dbase extension, see PMASA-2016-56 -- issue [security] Denial-of-service attack by using for loops, see PMASA-2016-46 -- issue Include X-Robots-Tag header in responses -- issue Enforce numeric field length when creating table -- issue Fixed invalid Content-Length in some HTTP responses -- issue #12394 Create view should require a view name -- issue #12391 Message with 'Change password successfully' displayed, but does not take effect -- issue Tighten control on PHP sessions and session cookies -- issue #12409 Re-enable overhead on server databases view -- issue #12414 Fixed rendering of Original theme -- issue #12413 Fixed deleting users in non English locales -- issue #12416 Fixed replication status output in Databases listing -- issue #12303 Avoid typecasting to float when not needed -- issue #12425 Duplicate message variable names in messages.inc.php -- issue #12399 Adding index to table shows wrong top navigation -- issue #12424 Fixed password change on MariaDB without auth plugin -- issue #12339 Do not error on unset server port -- issue #12422 Improvements to the original theme -- issue #12395 Do not try to load old transformation plugins -- issue #12423 Fixed replication status in database listing -- issue #12433 Copy table with prefix does not copy the indexes -- issue #12375 Search in database: Window content is not scrolling down when clicking first time on Browse link -- issue #12346 SQL Editor textareas can have their size increased from the top, distorting the page view - -4.6.3 (2016-06-23) -- issue #12249 Fixed cookie path on Windows -- issue #12279 Fixed error reporting on connect problems -- issue #12290 Fixed export of tables without explicitly set engine -- issue #12285 Designer JavaScript error: Show/Hide tables list -- issue #12293 Fix MySQL SSL connection with some PHP versions -- issue #12279 Fix MySQL connection error on version mismatch -- issue #12281 Keep user attributes (privileges, authentication mode, etc) when copying a user -- issue #12308 Fix division by zero in case of misconfigured MySQL server -- issue #12317 Fix editing server variables -- issue #12303 Fix table size calculation in some circumstances -- issue #12310 Fix listing routines for non privileged user -- issue Escape generated query in exporting a database -- issue Setup script doesn't use input type 'password' in all relevant locations -- issue [security] BBCode injection in setup script, see PMASA-2016-17 -- issue [security] Cookie attribute injection attack, see PMASA-2016-18 -- issue Redirect loop when directly calling url.php -- issue [security] SQL injection attack, see PMASA-2016-19 -- issue [security] XSS attack in Table Structure page, see PMASA-2016-20 -- issue [security] XSS attack in Server Privileges page, see PMASA-2016-21 -- issue [security] DOS attack vulnerability, see PMASA-2016-22 -- issue [security] Multiple full path disclosure vulnerabilities, see PMASA-2016-23 -- issue [security] Full path disclosure when running in debug mode -- issue [security] XSS attack with partition range and table structure, see PMASA-2016-25 -- issue [security] XSS attack when checking database privileges, see PMASA-2016-26 -- issue [security] XSS attack when MySQL server is using a specific payload log_bin directive, see PMASA-2016-26 -- issue [security] XSS vulnerabilities in Transformation feature, see PMASA-2016-26 - -4.6.2 (2016-05-25) -- issue [security] User SQL queries can be revealed through URL GET parameters, see PMASA-2016-14 -- issue [security] Self XSS vulneratbility, see PMASA-2016-16 -- issue #12225 Use https for documentation links -- issue #12234 Fix schema export with too many tables -- issue #12240 Avoid parsing non JSON responses as JSON -- issue #12244 Avoid using too log URLs when getting javascripts -- issue #12118 Fixed setting mixed case languages -- issue #12229 Avoid storing objects in session when debugging SQL -- issue #12249 Fix cookie path on IIS -- issue #11705 Fix occassional 200 errors on Windows -- issue #12219 Fix locking issues when importing SQL -- issue #12231 Avoid confusing warning when mysql extension is missing -- issue Improve handling of logout -- issue Safer handling of sessions during authentication -- issue #12209 Fix server selection on main page -- issue #12192 Avoid storing full error data in session -- issue #12082 Fixed export of ARCHIVE tables with keys -- issue #11565 Add session reload for config authentication -- issue #12229 Do not fail on errors stored in session -- issue #12248 Fix loading of APC based upload progress bar - -4.6.1 (2016-05-02) -- issue #12120 PMA_Util not found in insert_edit.lib.php -- issue #12118 Fixed activation of some languages -- issue #12121 Fixed error in 3NF step of normalization -- issue #12135 Fix offering JSON datatype in incompatible MySQL versions -- issue #12132 Can not open table with JSON field -- issue #12125 Cannot highlight a column if I scroll down from the top of the table -- issue #12154 Fixed possible PHP error in SQL parser -- issue #12029 Fixed SQL quoting in SQL export -- issue #12129 Improve performance of database structure page -- issue #12159 Fix PHP error if user did unpack new version over old one -- issue #12165 Fix parsing of expression 0 -- issue #12146 Document setup with Google Cloud SQL -- issue #12197 Fix parsing of queries with double \ -- issue #12202 Fixed setting of language from user configuration -- issue #12200 Fixed check for ndb version -- issue #12206 Fixed loading of configuration file -- issue #12204 Check if sessions are working and report failures -- issue #12211 non-clickable initial letter for users / and can't modify users with MySQL 5.7.12 -- issue #12215 Fixed config tab persistence errors -- issue #12217 Fixed javascript erros on user creation -- issue #12144 Fixed parsing of some AS clauses -- issue #12205 Fixed parsing of FULL OUTER JOIN queries -- issue #12171 Fixed editing of VIEW structure -- issue #12208 Avoid printing executed queries on import - -4.6.0.0 (2016-03-22) -+ issue #11456 Disabled storage engines -+ issue #11479 Allow setting routine wise privileges -- issue Hide Insert tab for non-updatable views -+ issue #11490 UI for defining partitioning in create table window -+ issue #11438 Support JSON data type -+ issue Editing partitions in table Structure -- issue Tracking does not make sense for information_schema -- issue #11550 Regression in Find and replace -+ issue #11619 TokuDB Tables Show Size as "unknown" -+ issue #11654 Use a slider for Internal relations -+ issue #11641 Ability to disable the navigationhiding Feature -- issue #11647 Restrict configuration NavigationTreeDbSeparator to strings -- issue #11667 Disable the tooltip in the navigation panel's filter box -+ issue Copy results to clipboard -+ issue #11504 Reactivate cut&paste possibility in print view -- issue #11702 Extraneous message after edit + grid-edit -- issue #11668 Table header is empty with browsing an empty table -+ issue #11701 Allow changing parameter order of routines -- issue #11708 Remove no password warning -+ issue #11711 Clarify the meaning of "Stand-in structure for view" in SQL export -- issue HTML line break shown after a MySQL connection error message -- issue #11728 CSV import skip row count after -- issue Fixed displaying of SQL query on table operations -- issue #6321 Display binary strings as text if they are valid UTF-8 -+ issue #11743 Display routine specific privileges -+ issue #11538 Copy multiple tables to database -+ issue Support Cloudflare Flexible SSL -- issue Handle empty TABLE_COMMENT -+ issue #11833 Drop support for old Internet Explorer versions -+ issue #11796 Use modals for displaying forms in db structure page -+ issue #11789 Show MySQL error messages in user language -+ issue Add 'ssl_verify' configuration directive for self-signed certificates with mysqlnd and PHP >= 5.6 -+ issue #11874 Show more used PHP extensions -- issue #11874 Report when version check and error reporting are disabled -- issue #11849 Fix PDF schema export -- issue #11412 Remove ForceSSL configuration directive -- issue Remove support for Mozilla Prism -- issue #11412 Remove PmaAbsoluteUri configuration directive -- issue #11914 Fix autoloading of phpseclib -- issue #11880 Fixed rendering of missing extension error -- issue #11923 Errors on Structure tab when user only has select access on certain columns -- issue #11972 Missing documentation for $cfg['Servers'][$i]['favorite'] and $cfg['NumFavoriteTables'] -- issue #11907 Avoid displaying UPDATE query twice -- issue #11850 Fixed CSV import -- issue Fix SQL syntax highlighting in database search page -- issue #12056 Fix error when we can not generate random string -- issue #12055 Fixed PHP syntax error in templates -- issue #12054 Fixed processing of queries with escaped quotes -- issue #12041 Fixed exporting tables with fields DEFAULT and COMMENT -- issue #12073 Hide edit and delete buttons when the results are not related to a table -- issue #12083 Fixed parsing of field definition -- issue #12081 Fixed rendering of table stats -- issue #11705 Fixed problems with PHP on Windows on table structure -- issue #12085 Like search strings being escaped incorrectly -- issue #12092 Rename exported databases/tables doesn't seem to work -- issue #12099 Undefined index: controllink -- issue #12094 PHP Fatal error: Call to undefined function __() -- issue #12098 Fix login after logout with http authentication -- issue #12074 Fixed possible invalid SQL export -- issue #12026 Fixed parsing of UNION SELECT with brackets -- issue #12109 Fixed parsing of CREATE TABLE [AS] SELECT -- issue #12105 Multi-server drap-and-drop import always fails -- issue #12116 Fulltext indexes are not copied when using copy database function - -4.5.5.1 (2016-02-29) -- issue #11971 CREATE UNIQUE INDEX index type is not recognized by parser. -- issue #11982 Row count wrong when grouping joined tables. -- issue #12012 Column definition with default value and comment in CREATE TABLE expoerted faulty. -- issue #12020 New statement but no delimiter and unexpected token with REPLACE. -- issue #12029 Fixed incorrect usage of SQL parser context in SQL export -- issue [security] XSS vulnerability in SQL parser, see PMASA-2016-10. -- issue [security] Multiple XSS vulnerabilities, see PMASA-2016-11. -- issue [security] Multiple XSS vulnerabilities, see PMASA-2016-12. -- issue [security] Vulnerability allowing man-in-the-middle attack on API call to GitHub, see PMASA-2016-13. -- issue #12048 Fixed inclusion of gettext library from SQL parser - -4.5.5.0 (2016-02-22) -- issue Undefined index: is_ajax_request -- issue #11855 Fix password change on MariaDB 10.1 and newer -- issue #11874 Validate version information before further processing it -- issue #11881 Full processlist lost on refresh -- issue #11834 Adjust privileges fails if database name contains underscores -- issue #11906 'Loading...' banner shows on login screen -- issue #11930 Fixed changing of table parameters, eg. AUTO_INCREMENT -- issue #11885 Call to undefined function SqlParser\ctype_alnum() -- issue #11879 4.5.3.1 - NOW() function not recognized by parser -- issue #11867 Gracefully handle the DESC statement -- issue #11843 Fractional timestamp causes corrupted SQL export -- issue #11836 Static analysis error for valid WHERE condition with IF keyword -- issue #11800 Syntax Verifier error using REGEXP in SQL statement -- issue #11799 Backslashes in comments are being interpreted as escape characters -- issue #11909 Can't insert row into table that contains generated column -- issue #11677 sql-parser and php-gettext collide. -- issue #11920 Can't disable backquotes in export -- issue #11911 Inserts via tbl_change.php in VARBINARY columns does not allow using HEX() and MD5() -- issue #11939 Correct content type for uploaded error reports -- issue #11940 Silent errors from checking local documentation -- issue #11944 Fixed error on servers with disabled php_uname -- issue #11946 Correctly store and report file upload errors -- issue #11948 Avoid javascript errors on invalid location hash -- issue #11950 Fix PHP warning on configuration errors -- issue #11951 Silent errors on checking for writable folders -- issue #11952 Silent warning on invalid file upload -- issue #11953 Do not fail getting filename with open_basedir limitations -- issue #11956 unrecognized keyword interval -- issue Field names and aliases are being correctly parsed now. -- issue #11959 Fix javascript error in setup -- issue #11964 Undefined index: TABLE_COMMENT in database structure page -- issue #11967 Fix PHP error on loading invalid XML or ODS file -- issue #11969 Missing confirmation while dropping a view in view_operations.php -- issue #11968 Fix export of index comments in SQL -- issue #11979 DECLARE not accepted as valid SQL - -4.5.4.1 (2016-01-29) -- issue #11892 Error with PMA 4.4.15.3 -- issue #11896 Remove hard dependency on phpseclib - -4.5.4.0 (2016-01-28) -- issue #11724 live data edit of big sets is not working -- issue Table list not saved in db QBE bookmarked search -- issue #11777 While 'changing a column', query fails with a syntax error after the 'CHARSET=' keyword -- issue #11783 Avoid syntax error in javascript messages on invalid PHP setting for max_input_vars -- issue #11784 Properly handle errors in upacking zip archive -- issue #11785 Set PHP's internal encoding to UTF-8 -- issue #11786 Fixed Kanji encoding in some specific cases -- issue #11787 Check whether iconv works before using it -- issue #11788 Avoid conversion of MySQL error messages -- issue #11792 Undefined index: parameters -- issue #11802 Undefined index: field_name_orig -- issue Undefined index: host -- issue #11810 'Add to central columns' (per column button) does nothing -- issue #11727 SQL duplicate entry error trying to INSERT in designer_settings table -- issue #11798 Fix handling of databases with dot in a name -- issue #11820 Fix hiding of page content behind menu -- issue #11780 FROM clause not generated after loading search bookmark -- issue #11826 Fix creating/editing VIEW with DEFINER containing special chars -- issue #11828 Do not invoke FLUSH PRIVILEGES when server in --skip-grant-tables -- issue #11804 Misleading message for configuration storage -- issue #11772 Table pagination does nothing when session expired -- issue #11840 Index comments not working properly -- issue #11791 Better handle local storage errors -- issue #11752 Improve detection of privileges for privilege adjusting -- issue #11854 Undefined property: stdClass::$releases at version check when disabled in config -- issue #11814 SQL comment and variable stripped from bookmark on save -- issue Gracefully handle errors in regex based javascript search -- issue [security] Multiple full path disclosure vulnerabilities, see PMASA-2016-1 -- issue [security] Unsafe generation of CSRF token, see PMASA-2016-2 -- issue [security] Multiple XSS vulnerabilities, see PMASA-2016-3 -- issue [security] Insecure password generation in JavaScript, see PMASA-2016-4 -- issue [security] Unsafe comparison of CSRF token, see PMASA-2016-5 -- issue [security] Multiple full path disclosure vulnerabilities, see PMASA-2016-6 -- issue [security] XSS vulnerability in normalization page, see PMASA-2016-7 -- issue [security] Full path disclosure vulnerability in SQL parser, see PMASA-2016-8 -- issue [security] XSS vulnerability in SQL editor, see PMASA-2016-9 - - --- Older ChangeLogs can be found on our project website --- - https://www.phpmyadmin.net/old-stuff/ChangeLogs/ - -# vim: et ts=4 sw=4 sts=4 -# vim: ft=changelog fenc=utf-8 -# vim: fde=getline(v\:lnum-1)=~'^\\s*$'&&getline(v\:lnum)=~'\\S'?'>1'\:1&&v\:lnum>4&&getline(v\:lnum)!~'^#' -# vim: fdn=1 fdm=expr diff --git a/#pma/DCO b/#pma/DCO deleted file mode 100644 index 49b75da9..00000000 --- a/#pma/DCO +++ /dev/null @@ -1,44 +0,0 @@ -If you would like to make a contribution to the phpMyAdmin Project, please -certify to the following: -*** -phpMyAdmin Developer's Certificate of Origin. Version 1.0 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I have the - right to submit it under the license of "GNU General Public License or - any later version" ("GPLv2-or-later"); or - -(b) The contribution is based upon previous work that, to the best of my - knowledge, is covered under an appropriate open source license and I have - the right under that license to submit that work with modifications, - whether created in whole or in part by me, under GPLv2-or-later; or - -(c) The contribution was provided directly to me by some other person who - certified (a) or (b) and I have not modified it. - -(d) I understand and agree that this project and the contribution are public - and that a record of the contribution (including all metadata and - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - phpMyAdmin's policies and the requirements of the GPLv2-or-later where - they are relevant. - -(e) I am granting this work to this project under the terms of the - GPLv2-or-later. - - https://www.gnu.org/licenses/gpl-2.0.html - -*** -*** -And please confirm your certification to the above by adding the following -line to your patch: - - Signed-off-by: Jane Developer - -using your real name (sorry, no pseudonyms or anonymous contributions). - -If you are a developer who is authorized to contribute to phpMyAdmin on -behalf of your employer, then please use your corporate email address in the -Signed-off-by tag. If not, then please use a personal email address. - diff --git a/#pma/LICENSE b/#pma/LICENSE deleted file mode 100644 index d159169d..00000000 --- a/#pma/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/#pma/README b/#pma/README deleted file mode 100644 index 0101eb89..00000000 --- a/#pma/README +++ /dev/null @@ -1,52 +0,0 @@ -phpMyAdmin - Readme -=================== - -Version 4.6.5.2 - -A web interface for MySQL and MariaDB. - -https://www.phpmyadmin.net/ - -Summary -------- - -phpMyAdmin is intended to handle the administration of MySQL over the web. -For a summary of features, list of requirements, and installation instructions, -please see the documentation in the ./doc/ folder or at https://docs.phpmyadmin.net/ - -Copyright ---------- - -Copyright © 1998 onwards -- the phpMyAdmin team - -Certain libraries are copyrighted by their respective authors; -see the full copyright list for details. - -For full copyright information, please see ./doc/copyright.rst - -License -------- - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License version 2, as published by the -Free Software Foundation. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Licensing of current contributions ----------------------------------- - -Beginning on 2013-12-01, new contributions to this codebase are all licensed -under terms compatible with GPLv2-or-later. phpMyAdmin is currently -transitioning older code to GPLv2-or-later, but work is not yet complete. - -Enjoy! ------- - -The phpMyAdmin team diff --git a/#pma/RELEASE-DATE-4.6.5.2 b/#pma/RELEASE-DATE-4.6.5.2 deleted file mode 100644 index ad07334a..00000000 --- a/#pma/RELEASE-DATE-4.6.5.2 +++ /dev/null @@ -1 +0,0 @@ -Mon Dec 5 22:35:53 UTC 2016 diff --git a/#pma/browse_foreigners.php b/#pma/browse_foreigners.php deleted file mode 100644 index 68a50a16..00000000 --- a/#pma/browse_foreigners.php +++ /dev/null @@ -1,61 +0,0 @@ -getFooter()->setMinimal(); -$header = $response->getHeader(); -$header->disableMenuAndConsole(); -$header->setBodyId('body_browse_foreigners'); - -/** - * Displays the frame - */ - -$cfgRelation = PMA_getRelationsParam(); -$foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : false); -$foreign_limit = PMA_getForeignLimit( - isset($_REQUEST['foreign_showAll']) ? $_REQUEST['foreign_showAll'] : null -); - -$foreignData = PMA_getForeignData( - $foreigners, $_REQUEST['field'], true, - isset($_REQUEST['foreign_filter']) - ? $_REQUEST['foreign_filter'] - : '', - isset($foreign_limit) ? $foreign_limit : null, - true // for getting value in $foreignData['the_total'] -); - -// HTML output -$html = PMA_getHtmlForRelationalFieldSelection( - $db, $table, $_REQUEST['field'], $foreignData, - isset($fieldkey) ? $fieldkey : null, - isset($data) ? $data : null -); - -$response->addHtml($html); diff --git a/#pma/build.xml b/#pma/build.xml deleted file mode 100644 index 53f88312..00000000 --- a/#pma/build.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/#pma/changelog.php b/#pma/changelog.php deleted file mode 100644 index c19bcf53..00000000 --- a/#pma/changelog.php +++ /dev/null @@ -1,162 +0,0 @@ -disable(); -$response->getHeader()->sendHttpHeaders(); - -$filename = CHANGELOG_FILE; - -/** - * Read changelog. - */ -// Check if the file is available, some distributions remove these. -if (@is_readable($filename)) { - - // Test if the if is in a compressed format - if (substr($filename, -3) == '.gz') { - ob_start(); - readgzfile($filename); - $changelog = ob_get_contents(); - ob_end_clean(); - } else { - $changelog = file_get_contents($filename); - } -} else { - printf( - __( - 'The %s file is not available on this system, please visit ' - . 'www.phpmyadmin.net for more information.' - ), - $filename - ); - exit; -} - -/** - * Whole changelog in variable. - */ -$changelog = htmlspecialchars($changelog); - -$tracker_url = 'https://sourceforge.net/support/tracker.php?aid=\\1'; -$tracker_url_bug = 'https://sourceforge.net/p/phpmyadmin/bugs/\\1/'; -$tracker_url_rfe = 'https://sourceforge.net/p/phpmyadmin/feature-requests/\\1/'; -$tracker_url_patch = 'https://sourceforge.net/p/phpmyadmin/patches/\\1/'; -$github_url = 'https://github.com/phpmyadmin/phpmyadmin/'; -$faq_url = 'https://docs.phpmyadmin.net/en/latest/faq.html'; - -$replaces = array( - '@(https?://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@' - => '\\1', - - // sourceforge users - '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*)@users.sourceforge.net>/i' - => '\\1 \\2', - '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i' - => 'thanks to \\1', - '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i' - => 'thanks to \\1', - - // mail address - '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*@.*)>/i' - => '\\1 \\2', - - // linking patches - '/patch\s*#?([0-9]{6,})/i' - => 'patch #\\1', - - // linking RFE - '/(?:rfe|feature)\s*#?([0-9]{6,})/i' - => 'RFE #\\1', - - // linking files - '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i' - => '\\1\\2', - - // FAQ entries - '/FAQ ([0-9]+)\.([0-9a-z]+)/i' - => 'FAQ \\1.\\2', - - // linking bugs - '/bug\s*#?([0-9]{6,})/i' - => 'bug #\\1', - - // all other 6+ digit numbers are treated as bugs - '/(? 'bug #\\1', - - // GitHub issues - '/issue\s*#?([0-9]{4,5}) /i' - => 'issue #\\1 ', - - // transitioned SF.net project bug/rfe/patch links - // by the time we reach 6-digit numbers, we can probably retire the above links - '/patch\s*#?([0-9]{4,5}) /i' - => 'patch #\\1 ', - '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i' - => 'RFE #\\1 ', - '/bug\s*#?([0-9]{4,5}) /i' - => 'bug #\\1 ', - '/(? 'bug #\\1 ', - - // CVE/CAN entries - '/((CAN|CVE)-[0-9]+-[0-9]+)/' - => '\\1', - - // PMASAentries - '/(PMASA-[0-9]+-[0-9]+)/' - => '\\1', - - // Highlight releases (with links) - '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/' - => '' - . '' - . '\\1.\\2.\\3.0 \\4', - '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/' - => '' - . '' - . '\\1.\\2.\\3.\\4 \\5', - - // Highlight releases (not linkable) - '/( ### )(.*)/' - => '\\1\\2', - -); - -header('Content-type: text/html; charset=utf-8'); -?> - - - - - - phpMyAdmin - ChangeLog - - - -

phpMyAdmin - ChangeLog

-'; -echo preg_replace(array_keys($replaces), $replaces, $changelog); -echo ''; -?> - - - diff --git a/#pma/chk_rel.php b/#pma/chk_rel.php deleted file mode 100644 index b2cd6301..00000000 --- a/#pma/chk_rel.php +++ /dev/null @@ -1,32 +0,0 @@ -addHTML( - PMA_getRelationsParamDiagnostic($cfgRelation) -); diff --git a/#pma/composer.json b/#pma/composer.json deleted file mode 100644 index 086b84e4..00000000 --- a/#pma/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "phpmyadmin/phpmyadmin", - "type": "application", - "description": "MySQL web administration tool", - "keywords": ["phpmyadmin","mysql","web"], - "homepage": "https://www.phpmyadmin.net/", - "license": "GPL-2.0+", - "authors": [ - { - "name": "The phpMyAdmin Team", - "email": "developers@phpmyadmin.net", - "homepage": "https://www.phpmyadmin.net/team/" - } - ], - "support": { - "forum": "https://www.phpmyadmin.net/support/", - "issues": "https://github.com/phpmyadmin/phpmyadmin/issues", - "wiki": "https://wiki.phpmyadmin.net/", - "docs": "https://docs.phpmyadmin.net/", - "source": "https://github.com/phpmyadmin/phpmyadmin" - }, - "non-feature-branches": ["RELEASE_.*"], - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "satooshi/php-coveralls": "~0.6", - "phpunit/phpunit": "~4.1", - "codacy/coverage": "dev-master", - "phpunit/phpunit-selenium": "~1.2", - "squizlabs/php_codesniffer": "2.*", - "phpmyadmin/coding-standard": ">=0.1.0" - }, - "repositories": [ - { - "type": "composer", - "url": "https://www.phpmyadmin.net" - } - ] -} diff --git a/#pma/config.inc.php b/#pma/config.inc.php deleted file mode 100644 index ecb3d44a..00000000 --- a/#pma/config.inc.php +++ /dev/null @@ -1,161 +0,0 @@ -. - * - * @package PhpMyAdmin - */ - -/** - * This is needed for cookie based authentication to encrypt password in - * cookie. Needs to be 32 chars long. - */ -$cfg['blowfish_secret'] = 'pmablowfishsecret!'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ - -/** - * Servers configuration - */ -$i = 0; - -/** - * First server - */ -$i++; -/* Authentication type */ -$cfg['Servers'][$i]['auth_type'] = 'config'; -/* Server parameters */ -$cfg['Servers'][$i]['host'] = 'localhost'; -$cfg['Servers'][$i]['user'] = 'lgadmin'; -$cfg['Servers'][$i]['password'] = '!S1ge1nA'; -$cfg['Servers'][$i]['only_db'] = 'leitgedanken'; -$cfg['Servers'][$i]['only_db'] = 'leitgedanken'; -$cfg['ThemeDefault'] = 'fallen'; -$cfg['Servers'][$i]['connect_type'] = 'tcp'; -$cfg['Servers'][$i]['compress'] = false; -$cfg['Servers'][$i]['AllowNoPassword'] = false; -$cfg['ActionLinksMode'] = 'icons'; - -/** - * phpMyAdmin configuration storage settings. - */ - -/* User used to manipulate with storage */ -// $cfg['Servers'][$i]['controlhost'] = ''; -// $cfg['Servers'][$i]['controlport'] = ''; -// $cfg['Servers'][$i]['controluser'] = 'pma'; -// $cfg['Servers'][$i]['controlpass'] = 'pmapass'; - -/* Storage database and tables */ -// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; -// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark'; -// $cfg['Servers'][$i]['relation'] = 'pma__relation'; -// $cfg['Servers'][$i]['table_info'] = 'pma__table_info'; -// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords'; -// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages'; -// $cfg['Servers'][$i]['column_info'] = 'pma__column_info'; -// $cfg['Servers'][$i]['history'] = 'pma__history'; -// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs'; -// $cfg['Servers'][$i]['tracking'] = 'pma__tracking'; -// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig'; -// $cfg['Servers'][$i]['recent'] = 'pma__recent'; -// $cfg['Servers'][$i]['favorite'] = 'pma__favorite'; -// $cfg['Servers'][$i]['users'] = 'pma__users'; -// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups'; -// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding'; -// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches'; -// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns'; -// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings'; -// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates'; - -/** - * End of servers configuration - */ - -/** - * Directories for saving/loading files from server - */ -$cfg['UploadDir'] = ''; -$cfg['SaveDir'] = ''; - -/** - * Whether to display icons or text or both icons and text in table row - * action segment. Value can be either of 'icons', 'text' or 'both'. - * default = 'both' - */ -//$cfg['RowActionType'] = 'icons'; - -/** - * Defines whether a user should be displayed a "show all (records)" - * button in browse mode or not. - * default = false - */ -//$cfg['ShowAll'] = true; - -/** - * Number of rows displayed when browsing a result set. If the result - * set contains more rows, "Previous" and "Next". - * Possible values: 25, 50, 100, 250, 500 - * default = 25 - */ -//$cfg['MaxRows'] = 50; - -/** - * Disallow editing of binary fields - * valid values are: - * false allow editing - * 'blob' allow editing except for BLOB fields - * 'noblob' disallow editing except for BLOB fields - * 'all' disallow editing - * default = 'blob' - */ -//$cfg['ProtectBinary'] = false; - -/** - * Default language to use, if not browser-defined or user-defined - * (you find all languages in the locale folder) - * uncomment the desired line: - * default = 'en' - */ -//$cfg['DefaultLang'] = 'en'; -//$cfg['DefaultLang'] = 'de'; - -/** - * How many columns should be used for table display of a database? - * (a value larger than 1 results in some information being hidden) - * default = 1 - */ -//$cfg['PropertiesNumColumns'] = 2; - -/** - * Set to true if you want DB-based query history.If false, this utilizes - * JS-routines to display query history (lost by window close) - * - * This requires configuration storage enabled, see above. - * default = false - */ -//$cfg['QueryHistoryDB'] = true; - -/** - * When using DB-based query history, how many entries should be kept? - * default = 25 - */ -//$cfg['QueryHistoryMax'] = 100; - -/** - * Whether or not to query the user before sending the error report to - * the phpMyAdmin team when a JavaScript error occurs - * - * Available options - * ('ask' | 'always' | 'never') - * default = 'ask' - */ -//$cfg['SendErrorReports'] = 'always'; - -/** - * You can find more configuration options in the documentation - * in the doc/ folder or at . - */ diff --git a/#pma/config.sample.inc.php b/#pma/config.sample.inc.php deleted file mode 100644 index 578ae841..00000000 --- a/#pma/config.sample.inc.php +++ /dev/null @@ -1,155 +0,0 @@ -. - * - * @package PhpMyAdmin - */ - -/** - * This is needed for cookie based authentication to encrypt password in - * cookie. Needs to be 32 chars long. - */ -$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ - -/** - * Servers configuration - */ -$i = 0; - -/** - * First server - */ -$i++; -/* Authentication type */ -$cfg['Servers'][$i]['auth_type'] = 'cookie'; -/* Server parameters */ -$cfg['Servers'][$i]['host'] = 'localhost'; -$cfg['Servers'][$i]['connect_type'] = 'tcp'; -$cfg['Servers'][$i]['compress'] = false; -$cfg['Servers'][$i]['AllowNoPassword'] = false; - -/** - * phpMyAdmin configuration storage settings. - */ - -/* User used to manipulate with storage */ -// $cfg['Servers'][$i]['controlhost'] = ''; -// $cfg['Servers'][$i]['controlport'] = ''; -// $cfg['Servers'][$i]['controluser'] = 'pma'; -// $cfg['Servers'][$i]['controlpass'] = 'pmapass'; - -/* Storage database and tables */ -// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; -// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark'; -// $cfg['Servers'][$i]['relation'] = 'pma__relation'; -// $cfg['Servers'][$i]['table_info'] = 'pma__table_info'; -// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords'; -// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages'; -// $cfg['Servers'][$i]['column_info'] = 'pma__column_info'; -// $cfg['Servers'][$i]['history'] = 'pma__history'; -// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs'; -// $cfg['Servers'][$i]['tracking'] = 'pma__tracking'; -// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig'; -// $cfg['Servers'][$i]['recent'] = 'pma__recent'; -// $cfg['Servers'][$i]['favorite'] = 'pma__favorite'; -// $cfg['Servers'][$i]['users'] = 'pma__users'; -// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups'; -// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding'; -// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches'; -// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns'; -// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings'; -// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates'; - -/** - * End of servers configuration - */ - -/** - * Directories for saving/loading files from server - */ -$cfg['UploadDir'] = ''; -$cfg['SaveDir'] = ''; - -/** - * Whether to display icons or text or both icons and text in table row - * action segment. Value can be either of 'icons', 'text' or 'both'. - * default = 'both' - */ -//$cfg['RowActionType'] = 'icons'; - -/** - * Defines whether a user should be displayed a "show all (records)" - * button in browse mode or not. - * default = false - */ -//$cfg['ShowAll'] = true; - -/** - * Number of rows displayed when browsing a result set. If the result - * set contains more rows, "Previous" and "Next". - * Possible values: 25, 50, 100, 250, 500 - * default = 25 - */ -//$cfg['MaxRows'] = 50; - -/** - * Disallow editing of binary fields - * valid values are: - * false allow editing - * 'blob' allow editing except for BLOB fields - * 'noblob' disallow editing except for BLOB fields - * 'all' disallow editing - * default = 'blob' - */ -//$cfg['ProtectBinary'] = false; - -/** - * Default language to use, if not browser-defined or user-defined - * (you find all languages in the locale folder) - * uncomment the desired line: - * default = 'en' - */ -//$cfg['DefaultLang'] = 'en'; -//$cfg['DefaultLang'] = 'de'; - -/** - * How many columns should be used for table display of a database? - * (a value larger than 1 results in some information being hidden) - * default = 1 - */ -//$cfg['PropertiesNumColumns'] = 2; - -/** - * Set to true if you want DB-based query history.If false, this utilizes - * JS-routines to display query history (lost by window close) - * - * This requires configuration storage enabled, see above. - * default = false - */ -//$cfg['QueryHistoryDB'] = true; - -/** - * When using DB-based query history, how many entries should be kept? - * default = 25 - */ -//$cfg['QueryHistoryMax'] = 100; - -/** - * Whether or not to query the user before sending the error report to - * the phpMyAdmin team when a JavaScript error occurs - * - * Available options - * ('ask' | 'always' | 'never') - * default = 'ask' - */ -//$cfg['SendErrorReports'] = 'always'; - -/** - * You can find more configuration options in the documentation - * in the doc/ folder or at . - */ diff --git a/#pma/db_central_columns.php b/#pma/db_central_columns.php deleted file mode 100644 index a1cd31ba..00000000 --- a/#pma/db_central_columns.php +++ /dev/null @@ -1,153 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('jquery/jquery.uitablefilter.js'); -$scripts->addFile('jquery/jquery.tablesorter.js'); -$scripts->addFile('db_central_columns.js'); -$cfgCentralColumns = PMA_centralColumnsGetParams(); -$pmadb = $cfgCentralColumns['db']; -$pmatable = $cfgCentralColumns['table']; -$max_rows = intval($GLOBALS['cfg']['MaxRows']); - -if (isset($_REQUEST['edit_central_columns_page'])) { - $selected_fld = $_REQUEST['selected_fld']; - $selected_db = $_REQUEST['db']; - $edit_central_column_page = PMA_getHTMLforEditingPage( - $selected_fld, $selected_db - ); - $response->addHTML($edit_central_column_page); - exit; -} -if (isset($_POST['multi_edit_central_column_save'])) { - $message = PMA_updateMultipleColumn(); - if (!is_bool($message)) { - $response->setRequestStatus(false); - $response->addJSON('message', $message); - } -} -if (isset($_POST['delete_save'])) { - $col_name = array(); - parse_str($_POST['col_name'], $col_name); - $tmp_msg = PMA_deleteColumnsFromList($col_name['selected_fld'], false); -} -if (isset($_REQUEST['total_rows']) && $_REQUEST['total_rows']) { - $total_rows = $_REQUEST['total_rows']; -} else { - $total_rows = PMA_getCentralColumnsCount($db); -} -if (PMA_isValid($_REQUEST['pos'], 'integer')) { - $pos = intval($_REQUEST['pos']); -} else { - $pos = 0; -} -$addNewColumn = PMA_getHTMLforAddNewColumn($db); -$response->addHTML($addNewColumn); -if ($total_rows <= 0) { - $response->addHTML( - '
' . __( - 'The central list of columns for the current database is empty.' - ) . '
' - ); - $columnAdd = PMA_getHTMLforAddCentralColumn($total_rows, $pos, $db); - $response->addHTML($columnAdd); - exit; -} -$table_navigation_html = PMA_getHTMLforTableNavigation($total_rows, $pos, $db); -$response->addHTML($table_navigation_html); -$columnAdd = PMA_getHTMLforAddCentralColumn($total_rows, $pos, $db); -$response->addHTML($columnAdd); -$deleteRowForm = '
' - . PMA_URL_getHiddenInputs( - $db - ) - . '' - . '' - . '
'; -$response->addHTML($deleteRowForm); -$table_struct = '
' - . '
' - . ''; -$response->addHTML($table_struct); -$tableheader = PMA_getCentralColumnsTableHeader( - 'column_heading', __('Click to sort.'), 2 -); -$response->addHTML($tableheader); -$result = PMA_getColumnsList($db, $pos, $max_rows); -$odd_row = true; -$row_num = 0; -foreach ($result as $row) { - $tableHtmlRow = PMA_getHTMLforCentralColumnsTableRow( - $row, $odd_row, $row_num, $db - ); - $response->addHTML($tableHtmlRow); - $odd_row = !$odd_row; - $row_num++; -} -$response->addHTML('
'); -$tablefooter = PMA_getCentralColumnsTableFooter($pmaThemeImage, $text_dir); -$response->addHTML($tablefooter); -$response->addHTML('
'); -$message = PMA\libraries\Message::success( - sprintf(__('Showing rows %1$s - %2$s.'), ($pos + 1), ($pos + count($result))) -); -if (isset($tmp_msg) && $tmp_msg !== true) { - $message = $tmp_msg; -} diff --git a/#pma/db_datadict.php b/#pma/db_datadict.php deleted file mode 100644 index d94bebf0..00000000 --- a/#pma/db_datadict.php +++ /dev/null @@ -1,214 +0,0 @@ -getHeader(); -$header->enablePrintView(); - -/** - * Gets the relations settings - */ -$cfgRelation = PMA_getRelationsParam(); - -require_once 'libraries/transformations.lib.php'; - -/** - * Check parameters - */ -PMA\libraries\Util::checkParameters(array('db')); - -/** - * Defines the url to return to in case of error in a sql statement - */ -$err_url = 'db_sql.php' . PMA_URL_getCommon(array('db' => $db)); - -if ($cfgRelation['commwork']) { - $comment = PMA_getDbComment($db); - - /** - * Displays DB comment - */ - if ($comment) { - echo '

' , __('Database comment') - , '
' , htmlspecialchars($comment) , '

'; - } // end if -} - -/** - * Selects the database and gets tables names - */ -$GLOBALS['dbi']->selectDb($db); -$tables = $GLOBALS['dbi']->getTables($db); - -$count = 0; -foreach ($tables as $table) { - $comments = PMA_getComments($db, $table); - - echo '
' , "\n"; - - echo '

' , htmlspecialchars($table) , '

' , "\n"; - - /** - * Gets table information - */ - $show_comment = $GLOBALS['dbi']->getTable($db, $table) - ->getStatusInfo('TABLE_COMMENT'); - - /** - * Gets table keys and retains them - */ - $GLOBALS['dbi']->selectDb($db); - $indexes = $GLOBALS['dbi']->getTableIndexes($db, $table); - list($primary, $pk_array, $indexes_info, $indexes_data) - = PMA\libraries\Util::processIndexData($indexes); - - /** - * Gets columns properties - */ - $columns = $GLOBALS['dbi']->getColumns($db, $table); - - // Check if we can use Relations - list($res_rel, $have_rel) = PMA_getRelationsAndStatus( - ! empty($cfgRelation['relation']), $db, $table - ); - - /** - * Displays the comments of the table if MySQL >= 3.23 - */ - if (!empty($show_comment)) { - echo __('Table comments:') , ' '; - echo htmlspecialchars($show_comment) , '

'; - } - - /** - * Displays the table structure - */ - - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - if ($have_rel) { - echo ' ' , "\n"; - } - echo ' ' , "\n"; - if ($cfgRelation['mimework']) { - echo ' ' , "\n"; - } - echo ''; - $odd_row = true; - foreach ($columns as $row) { - - if ($row['Null'] == '') { - $row['Null'] = 'NO'; - } - $extracted_columnspec - = PMA\libraries\Util::extractColumnSpec($row['Type']); - - // reformat mysql query output - // set or enum types: slashes single quotes inside options - - $type = htmlspecialchars($extracted_columnspec['print_type']); - $attribute = $extracted_columnspec['attribute']; - if (! isset($row['Default'])) { - if ($row['Null'] != 'NO') { - $row['Default'] = 'NULL'; - } - } else { - $row['Default'] = htmlspecialchars($row['Default']); - } - $column_name = $row['Field']; - - echo ''; - echo ''; - echo '' , $type , ''; - - echo ''; - echo ''; - - if ($have_rel) { - echo ' ' , "\n"; - } - echo ' ' , "\n"; - if ($cfgRelation['mimework']) { - $mime_map = PMA_getMIME($db, $table, true); - - echo ' ' , "\n"; - } - echo ''; - } // end foreach - $count++; - echo '
' , __('Column') , '' , __('Type') , '' , __('Null') , '' , __('Default') , '' , __('Links to') , '' , __('Comments') , 'MIME
'; - echo htmlspecialchars($column_name); - - if (isset($pk_array[$row['Field']])) { - echo ' (' , __('Primary') , ')'; - } - echo ''; - echo (($row['Null'] == 'NO') ? __('No') : __('Yes')); - echo ''; - if (isset($row['Default'])) { - echo $row['Default']; - } - echo ''; - if ($foreigner = PMA_searchColumnInForeigners($res_rel, $column_name)) { - echo htmlspecialchars( - $foreigner['foreign_table'] - . ' -> ' - . $foreigner['foreign_field'] - ); - } - echo ''; - if (isset($comments[$column_name])) { - echo htmlspecialchars($comments[$column_name]); - } - echo ''; - if (isset($mime_map[$column_name])) { - echo htmlspecialchars( - str_replace('_', '/', $mime_map[$column_name]['mimetype']) - ); - } - echo '
'; - // display indexes information - if (count(PMA\libraries\Index::getFromTable($table, $db)) > 0) { - echo PMA\libraries\Index::getHtmlForIndexes($table, $db, true); - } - echo '
'; -} //ends main while - -/** - * Displays the footer - */ -echo PMA\libraries\Util::getButton(); diff --git a/#pma/db_designer.php b/#pma/db_designer.php deleted file mode 100644 index 9720a097..00000000 --- a/#pma/db_designer.php +++ /dev/null @@ -1,190 +0,0 @@ -addHTML($html); - } - return; -} - -if (isset($_REQUEST['operation'])) { - - if ($_REQUEST['operation'] == 'deletePage') { - $success = PMA_deletePage($_REQUEST['selected_page']); - $response->setRequestStatus($success); - } elseif ($_REQUEST['operation'] == 'savePage') { - if ($_REQUEST['save_page'] == 'same') { - $page = $_REQUEST['selected_page']; - } else { // new - $page = PMA_createNewPage($_REQUEST['selected_value'], $GLOBALS['db']); - $response->addJSON('id', $page); - } - $success = PMA_saveTablePositions($page); - $response->setRequestStatus($success); - } elseif ($_REQUEST['operation'] == 'setDisplayField') { - PMA_saveDisplayField( - $_REQUEST['db'], $_REQUEST['table'], $_REQUEST['field'] - ); - $response->setRequestStatus(true); - } elseif ($_REQUEST['operation'] == 'addNewRelation') { - list($success, $message) = PMA_addNewRelation( - $_REQUEST['db'], - $_REQUEST['T1'], - $_REQUEST['F1'], - $_REQUEST['T2'], - $_REQUEST['F2'], - $_REQUEST['on_delete'], - $_REQUEST['on_update'] - ); - $response->setRequestStatus($success); - $response->addJSON('message', $message); - } elseif ($_REQUEST['operation'] == 'removeRelation') { - list($success, $message) = PMA_removeRelation( - $_REQUEST['T1'], - $_REQUEST['F1'], - $_REQUEST['T2'], - $_REQUEST['F2'] - ); - $response->setRequestStatus($success); - $response->addJSON('message', $message); - } elseif ($_REQUEST['operation'] == 'save_setting_value') { - $success = PMA_saveDesignerSetting($_REQUEST['index'], $_REQUEST['value']); - $response->setRequestStatus($success); - } - - return; -} - -require 'libraries/db_common.inc.php'; - -$script_display_field = PMA_getTablesInfo(); -$tab_column = PMA_getColumnsInfo(); -$script_tables = PMA_getScriptTabs(); -$tables_pk_or_unique_keys = PMA_getPKOrUniqueKeys(); -$tables_all_keys = PMA_getAllKeys(); -$classes_side_menu = PMA_returnClassNamesFromMenuButtons(); - -$display_page = -1; -$selected_page = null; - -if (isset($_REQUEST['query'])) { - $display_page = PMA_getDefaultPage($_REQUEST['db']); -} else { - if (! empty($_REQUEST['page'])) { - $display_page = $_REQUEST['page']; - } else { - $display_page = PMA_getLoadingPage($_REQUEST['db']); - } -} -if ($display_page != -1) { - $selected_page = PMA_getPageName($display_page); -} -$tab_pos = PMA_getTablePositions($display_page); -$script_contr = PMA_getScriptContr(); - -$params = array('lang' => $GLOBALS['lang']); -if (isset($_GET['db'])) { - $params['db'] = $_GET['db']; -} - -$response = PMA\libraries\Response::getInstance(); -$response->getFooter()->setMinimal(); -$header = $response->getHeader(); -$header->setBodyId('pmd_body'); - -$scripts = $header->getScripts(); -$scripts->addFile('jquery/jquery.fullscreen.js'); -$scripts->addFile('pmd/designer_db.js'); -$scripts->addFile('pmd/designer_objects.js'); -$scripts->addFile('pmd/designer_page.js'); -$scripts->addFile('pmd/history.js'); -$scripts->addFile('pmd/move.js'); -$scripts->addFile('pmd/init.js'); - -list( - $tables, - $num_tables, - $total_num_tables, - $sub_part, - $is_show_stats, - $db_is_system_schema, - $tooltip_truename, - $tooltip_aliasname, - $pos -) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); - -// Embed some data into HTML, later it will be read -// by pmd/init.js and converted to JS variables. -$response->addHTML( - PMA_getHtmlForJSFields( - $script_tables, $script_contr, $script_display_field, $display_page - ) -); -$response->addHTML( - PMA_getDesignerPageMenu( - isset($_REQUEST['query']), - $selected_page, - $classes_side_menu - ) -); - - - -$response->addHTML('
'); -$response->addHTML( - '
' -); - -$response->addHTML(PMA_getHTMLCanvas()); -$response->addHTML(PMA_getHTMLTableList($tab_pos, $display_page)); - -$response->addHTML( - PMA_getDatabaseTables( - $tab_pos, $display_page, $tab_column, - $tables_all_keys, $tables_pk_or_unique_keys - ) -); -$response->addHTML('
'); -$response->addHTML('
'); // end canvas_outer - -$response->addHTML('
'); - -$response->addHTML(PMA_getNewRelationPanel()); -$response->addHTML(PMA_getDeleteRelationPanel()); - -if (isset($_REQUEST['query'])) { - $response->addHTML(PMA_getOptionsPanel()); - $response->addHTML(PMA_getRenameToPanel()); - $response->addHTML(PMA_getHavingQueryPanel()); - $response->addHTML(PMA_getAggregateQueryPanel()); - $response->addHTML(PMA_getWhereQueryPanel()); - $response->addHTML(PMA_getQueryDetails()); -} - -$response->addHTML('
'); diff --git a/#pma/db_events.php b/#pma/db_events.php deleted file mode 100644 index 606b5d22..00000000 --- a/#pma/db_events.php +++ /dev/null @@ -1,23 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('export.js'); - -// $sub_part is used in PMA\libraries\Util::getDbInfo() to see if we are coming from -// db_export.php, in which case we don't obey $cfg['MaxTableList'] -$sub_part = '_export'; -require_once 'libraries/db_common.inc.php'; -$url_query .= '&goto=db_export.php'; - -list( - $tables, - $num_tables, - $total_num_tables, - $sub_part, - $is_show_stats, - $db_is_system_schema, - $tooltip_truename, - $tooltip_aliasname, - $pos -) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); - -/** - * Displays the form - */ -$export_page_title = __('View dump (schema) of database'); - -// exit if no tables in db found -if ($num_tables < 1) { - PMA\libraries\Message::error(__('No tables found in database.'))->display(); - exit; -} // end if - -$multi_values = '
'; -if (isset($_GET['structure_or_data_forced'])) { - $force_val = htmlspecialchars($_GET['structure_or_data_forced']); -} else { - $force_val = 0; -} -$multi_values .= ''; -$multi_values .= '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . ''; -$multi_values .= "\n"; - -// when called by libraries/mult_submits.inc.php -if (!empty($_POST['selected_tbl']) && empty($table_select)) { - $table_select = $_POST['selected_tbl']; -} - -// Check if the selected tables are defined in $_GET -// (from clicking Back button on export.php) -foreach (array('table_select', 'table_structure', 'table_data') as $one_key) { - if (isset($_GET[$one_key])) { - $_GET[$one_key] = urldecode($_GET[$one_key]); - $_GET[$one_key] = explode(",", $_GET[$one_key]); - } -} - -foreach ($tables as $each_table) { - if (isset($_GET['table_select']) && is_array($_GET['table_select'])) { - $is_checked = PMA_getCheckedClause( - $each_table['Name'], $_GET['table_select'] - ); - } elseif (isset($table_select)) { - $is_checked = PMA_getCheckedClause( - $each_table['Name'], $table_select - ); - } else { - $is_checked = ' checked="checked"'; - } - if (isset($_GET['table_structure']) && is_array($_GET['table_structure'])) { - $structure_checked = PMA_getCheckedClause( - $each_table['Name'], $_GET['table_structure'] - ); - } else { - $structure_checked = $is_checked; - } - if (isset($_GET['table_data']) && is_array($_GET['table_data'])) { - $data_checked = PMA_getCheckedClause( - $each_table['Name'], $_GET['table_data'] - ); - } else { - $data_checked = $is_checked; - } - $table_html = htmlspecialchars($each_table['Name']); - $multi_values .= ''; - $multi_values .= ''; - $multi_values .= ''; - $multi_values .= ''; - $multi_values .= ''; - $multi_values .= ''; -} // end for - -$multi_values .= "\n"; -$multi_values .= '
' . __('Tables') . '' . __('Structure') . '' . __('Data') . '
' . __('Select all') . '' - . '' - . '
' - . str_replace(' ', ' ', $table_html) . '' - . '' - . '
'; - -require_once 'libraries/display_export.lib.php'; -if (! isset($sql_query)) { - $sql_query = ''; -} -if (! isset($num_tables)) { - $num_tables = 0; -} -if (! isset($unlim_num_rows)) { - $unlim_num_rows = 0; -} -if (! isset($multi_values)) { - $multi_values = ''; -} -$response = Response::getInstance(); -$response->addHTML( - PMA_getExportDisplay( - 'database', $db, $table, $sql_query, $num_tables, - $unlim_num_rows, $multi_values - ) -); diff --git a/#pma/db_import.php b/#pma/db_import.php deleted file mode 100644 index 251a6b0c..00000000 --- a/#pma/db_import.php +++ /dev/null @@ -1,45 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('import.js'); - -/** - * Gets tables information and displays top links - */ -require 'libraries/db_common.inc.php'; - -list( - $tables, - $num_tables, - $total_num_tables, - $sub_part, - $is_show_stats, - $db_is_system_schema, - $tooltip_truename, - $tooltip_aliasname, - $pos -) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); - -require 'libraries/display_import.lib.php'; -$response = PMA\libraries\Response::getInstance(); -$response->addHTML( - PMA_getImportDisplay( - 'database', $db, $table, $max_upload_size - ) -); diff --git a/#pma/db_operations.php b/#pma/db_operations.php deleted file mode 100644 index 3dd0c0ce..00000000 --- a/#pma/db_operations.php +++ /dev/null @@ -1,315 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('db_operations.js'); - -$sql_query = ''; - -/** - * Rename/move or copy database - */ -if (mb_strlen($GLOBALS['db']) - && (! empty($_REQUEST['db_rename']) || ! empty($_REQUEST['db_copy'])) -) { - if (! empty($_REQUEST['db_rename'])) { - $move = true; - } else { - $move = false; - } - - if (! isset($_REQUEST['newname']) - || ! mb_strlen($_REQUEST['newname']) - ) { - $message = PMA\libraries\Message::error(__('The database name is empty!')); - } else { - $_error = false; - if ($move || ! empty($_REQUEST['create_database_before_copying'])) { - PMA_createDbBeforeCopy(); - } - - // here I don't use DELIMITER because it's not part of the - // language; I have to send each statement one by one - - // to avoid selecting alternatively the current and new db - // we would need to modify the CREATE definitions to qualify - // the db name - PMA_runProcedureAndFunctionDefinitions($GLOBALS['db']); - - // go back to current db, just in case - $GLOBALS['dbi']->selectDb($GLOBALS['db']); - - $tables_full = $GLOBALS['dbi']->getTablesFull($GLOBALS['db']); - - include_once "libraries/plugin_interface.lib.php"; - // remove all foreign key constraints, otherwise we can get errors - /* @var $export_sql_plugin ExportSql */ - $export_sql_plugin = PMA_getPlugin( - "export", - "sql", - 'libraries/plugins/export/', - array( - 'single_table' => isset($single_table), - 'export_type' => 'database' - ) - ); - - // create stand-in tables for views - $views = PMA_getViewsAndCreateSqlViewStandIn( - $tables_full, $export_sql_plugin, $GLOBALS['db'] - ); - - // copy tables - $sqlConstratints = PMA_copyTables( - $tables_full, $move, $GLOBALS['db'] - ); - - // handle the views - if (! $_error) { - PMA_handleTheViews($views, $move, $GLOBALS['db']); - } - unset($views); - - // now that all tables exist, create all the accumulated constraints - if (! $_error && count($sqlConstratints) > 0) { - PMA_createAllAccumulatedConstraints($sqlConstratints); - } - unset($sqlConstratints); - - if (PMA_MYSQL_INT_VERSION >= 50100) { - // here DELIMITER is not used because it's not part of the - // language; each statement is sent one by one - - PMA_runEventDefinitionsForDb($GLOBALS['db']); - } - - // go back to current db, just in case - $GLOBALS['dbi']->selectDb($GLOBALS['db']); - - // Duplicate the bookmarks for this db (done once for each db) - PMA_duplicateBookmarks($_error, $GLOBALS['db']); - - if (! $_error && $move) { - if (isset($_REQUEST['adjust_privileges']) - && ! empty($_REQUEST['adjust_privileges']) - ) { - PMA_AdjustPrivileges_moveDB($GLOBALS['db'], $_REQUEST['newname']); - } - - /** - * cleanup pmadb stuff for this db - */ - include_once 'libraries/relation_cleanup.lib.php'; - PMA_relationsCleanupDatabase($GLOBALS['db']); - - // if someday the RENAME DATABASE reappears, do not DROP - $local_query = 'DROP DATABASE ' - . PMA\libraries\Util::backquote($GLOBALS['db']) . ';'; - $sql_query .= "\n" . $local_query; - $GLOBALS['dbi']->query($local_query); - - $message = PMA\libraries\Message::success( - __('Database %1$s has been renamed to %2$s.') - ); - $message->addParam($GLOBALS['db']); - $message->addParam($_REQUEST['newname']); - } elseif (! $_error) { - if (isset($_REQUEST['adjust_privileges']) - && ! empty($_REQUEST['adjust_privileges']) - ) { - PMA_AdjustPrivileges_copyDB($GLOBALS['db'], $_REQUEST['newname']); - } - - $message = PMA\libraries\Message::success( - __('Database %1$s has been copied to %2$s.') - ); - $message->addParam($GLOBALS['db']); - $message->addParam($_REQUEST['newname']); - } else { - $message = PMA\libraries\Message::error(); - } - $reload = true; - - /* Change database to be used */ - if (! $_error && $move) { - $GLOBALS['db'] = $_REQUEST['newname']; - } elseif (! $_error) { - if (isset($_REQUEST['switch_to_new']) - && $_REQUEST['switch_to_new'] == 'true' - ) { - $GLOBALS['PMA_Config']->setCookie('pma_switch_to_new', 'true'); - $GLOBALS['db'] = $_REQUEST['newname']; - } else { - $GLOBALS['PMA_Config']->setCookie('pma_switch_to_new', ''); - } - } - } - - /** - * Database has been successfully renamed/moved. If in an Ajax request, - * generate the output with {@link PMA\libraries\Response} and exit - */ - if ($GLOBALS['is_ajax_request'] == true) { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus($message->isSuccess()); - $response->addJSON('message', $message); - $response->addJSON('newname', $_REQUEST['newname']); - $response->addJSON( - 'sql_query', - PMA\libraries\Util::getMessage(null, $sql_query) - ); - $response->addJSON('db', $GLOBALS['db']); - exit; - } -} - -/** - * Settings for relations stuff - */ - -$cfgRelation = PMA_getRelationsParam(); - -/** - * Check if comments were updated - * (must be done before displaying the menu tabs) - */ -if (isset($_REQUEST['comment'])) { - PMA_setDbComment($GLOBALS['db'], $_REQUEST['comment']); -} - -require 'libraries/db_common.inc.php'; -$url_query .= '&goto=db_operations.php'; - -// Gets the database structure -$sub_part = '_structure'; - -list( - $tables, - $num_tables, - $total_num_tables, - $sub_part, - $is_show_stats, - $db_is_system_schema, - $tooltip_truename, - $tooltip_aliasname, - $pos -) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); - -echo "\n"; - -if (isset($message)) { - echo PMA\libraries\Util::getMessage($message, $sql_query); - unset($message); -} - -$_REQUEST['db_collation'] = PMA_getDbCollation($GLOBALS['db']); -$is_information_schema = $GLOBALS['dbi']->isSystemSchema($GLOBALS['db']); - -$response->addHTML('
'); - -if (!$is_information_schema) { - if ($cfgRelation['commwork']) { - /** - * database comment - */ - $response->addHTML(PMA_getHtmlForDatabaseComment($GLOBALS['db'])); - } - - $response->addHTML('
'); - $response->addHTML(PMA_getHtmlForCreateTable($db)); - $response->addHTML('
'); - - /** - * rename database - */ - if ($GLOBALS['db'] != 'mysql') { - $response->addHTML(PMA_getHtmlForRenameDatabase($GLOBALS['db'])); - } - - // Drop link if allowed - // Don't even try to drop information_schema. - // You won't be able to. Believe me. You won't. - // Don't allow to easily drop mysql database, RFE #1327514. - if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) - && ! $db_is_system_schema - && $GLOBALS['db'] != 'mysql' - ) { - $response->addHTML(PMA_getHtmlForDropDatabaseLink($GLOBALS['db'])); - } - /** - * Copy database - */ - $response->addHTML(PMA_getHtmlForCopyDatabase($GLOBALS['db'])); - - /** - * Change database charset - */ - $response->addHTML(PMA_getHtmlForChangeDatabaseCharset($GLOBALS['db'], $table)); - - if (! $cfgRelation['allworks'] - && $cfg['PmaNoRelation_DisableWarning'] == false - ) { - $message = PMA\libraries\Message::notice( - __( - 'The phpMyAdmin configuration storage has been deactivated. ' . - '%sFind out why%s.' - ) - ); - $message->addParam( - '', - false - ); - $message->addParam('', false); - /* Show error if user has configured something, notice elsewhere */ - if (!empty($cfg['Servers'][$server]['pmadb'])) { - $message->isError(true); - } - } // end if -} // end if (!$is_information_schema) - -$response->addHTML('
'); - -// not sure about displaying the PDF dialog in case db is information_schema -if ($cfgRelation['pdfwork'] && $num_tables > 0) { - // We only show this if we find something in the new pdf_pages table - $test_query = ' - SELECT * - FROM ' . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['pdf_pages']) . ' - WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($GLOBALS['db']) - . '\''; - $test_rs = PMA_queryAsControlUser( - $test_query, - false, - PMA\libraries\DatabaseInterface::QUERY_STORE - ); -} // end if diff --git a/#pma/db_qbe.php b/#pma/db_qbe.php deleted file mode 100644 index c2baaf62..00000000 --- a/#pma/db_qbe.php +++ /dev/null @@ -1,153 +0,0 @@ -getHeader(); - $scripts = $header->getScripts(); - $scripts->addFile('db_qbe.js'); - - //Get saved search list. - $savedSearch = new SavedSearches($GLOBALS); - $savedSearch->setUsername($GLOBALS['cfg']['Server']['user']) - ->setDbname($_REQUEST['db']); - - if (!empty($_REQUEST['searchId'])) { - $savedSearch->setId($_REQUEST['searchId']); - } - - //Action field is sent. - if (isset($_REQUEST['action'])) { - $savedSearch->setSearchName($_REQUEST['searchName']); - if ('create' === $_REQUEST['action']) { - $saveResult = $savedSearch->setId(null) - ->setCriterias($_REQUEST) - ->save(); - } elseif ('update' === $_REQUEST['action']) { - $saveResult = $savedSearch->setCriterias($_REQUEST) - ->save(); - } elseif ('delete' === $_REQUEST['action']) { - $deleteResult = $savedSearch->delete(); - //After deletion, reset search. - $savedSearch = new SavedSearches($GLOBALS); - $savedSearch->setUsername($GLOBALS['cfg']['Server']['user']) - ->setDbname($_REQUEST['db']); - $_REQUEST = array(); - } elseif ('load' === $_REQUEST['action']) { - if (empty($_REQUEST['searchId'])) { - //when not loading a search, reset the object. - $savedSearch = new SavedSearches($GLOBALS); - $savedSearch->setUsername($GLOBALS['cfg']['Server']['user']) - ->setDbname($_REQUEST['db']); - $_REQUEST = array(); - } else { - $loadResult = $savedSearch->load(); - } - } - //Else, it's an "update query" - } - - $savedSearchList = $savedSearch->getList(); - $currentSearchId = $savedSearch->getId(); -} - -/** - * A query has been submitted -> (maybe) execute it - */ -$message_to_display = false; -if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) { - if (! preg_match('@^SELECT@i', $sql_query)) { - $message_to_display = true; - } else { - $goto = 'db_sql.php'; - PMA_executeQueryAndSendQueryResponse( - null, // analyzed_sql_results - false, // is_gotofile - $_REQUEST['db'], // db - null, // table - false, // find_real_end - null, // sql_query_for_bookmark - null, // extra_data - null, // message_to_show - null, // message - null, // sql_data - $goto, // goto - $pmaThemeImage, // pmaThemeImage - null, // disp_query - null, // disp_message - null, // query_type - $sql_query, // sql_query - null, // selectedTables - null // complete_query - ); - } -} - -$sub_part = '_qbe'; -require 'libraries/db_common.inc.php'; -$url_query .= '&goto=db_qbe.php'; -$url_params['goto'] = 'db_qbe.php'; - -list( - $tables, - $num_tables, - $total_num_tables, - $sub_part, - $is_show_stats, - $db_is_system_schema, - $tooltip_truename, - $tooltip_aliasname, - $pos -) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); - -if ($message_to_display) { - PMA\libraries\Message::error( - __('You have to choose at least one column to display!') - ) - ->display(); -} -unset($message_to_display); - -// create new qbe search instance -$db_qbe = new PMA\libraries\DbQbe($GLOBALS['db'], $savedSearchList, $savedSearch); - -$url = 'db_designer.php' . PMA_URL_getCommon( - array_merge( - $url_params, - array('query' => 1) - ) -); -$response->addHTML( - PMA\libraries\Message::notice( - sprintf( - __('Switch to %svisual builder%s'), - '', - '' - ) - ) -); - -/** - * Displays the Query by example form - */ -$response->addHTML($db_qbe->getSelectionForm()); diff --git a/#pma/db_routines.php b/#pma/db_routines.php deleted file mode 100644 index 5cfcf2fb..00000000 --- a/#pma/db_routines.php +++ /dev/null @@ -1,25 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('db_search.js'); -$scripts->addFile('sql.js'); -$scripts->addFile('makegrid.js'); -$scripts->addFile('jquery/jquery-ui-timepicker-addon.js'); - -require 'libraries/db_common.inc.php'; - -// If config variable $GLOBALS['cfg']['UseDbSearch'] is on false : exit. -if (! $GLOBALS['cfg']['UseDbSearch']) { - PMA\libraries\Util::mysqlDie( - __('Access denied!'), '', false, $err_url - ); -} // end if -$url_query .= '&goto=db_search.php'; -$url_params['goto'] = 'db_search.php'; - -// Create a database search instance -$db_search = new DbSearch($GLOBALS['db']); - -// Display top links if we are not in an Ajax request -if ($GLOBALS['is_ajax_request'] != true) { - list( - $tables, - $num_tables, - $total_num_tables, - $sub_part, - $is_show_stats, - $db_is_system_schema, - $tooltip_truename, - $tooltip_aliasname, - $pos - ) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); -} - -// Main search form has been submitted, get results -if (isset($_REQUEST['submit_search'])) { - $response->addHTML($db_search->getSearchResults()); -} else { - $response->addHTML('
'); -} - -// If we are in an Ajax request, we need to exit after displaying all the HTML -if ($GLOBALS['is_ajax_request'] == true && empty($_REQUEST['ajax_page_request'])) { - exit; -} - -// Display the search form -$response->addHTML( - '
' - . '
' -); -$response->addHTML($db_search->getSelectionForm()); -$response->addHTML($db_search->getResultDivs()); diff --git a/#pma/db_sql.php b/#pma/db_sql.php deleted file mode 100644 index c1daf093..00000000 --- a/#pma/db_sql.php +++ /dev/null @@ -1,47 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('makegrid.js'); -$scripts->addFile('jquery/jquery.uitablefilter.js'); -$scripts->addFile('sql.js'); - -require 'libraries/db_common.inc.php'; -require_once 'libraries/sql_query_form.lib.php'; - -// After a syntax error, we return to this script -// with the typed query in the textarea. -$goto = 'db_sql.php'; -$back = 'db_sql.php'; - -/** - * Query box, bookmark, insert data from textfile - */ -$response->addHTML( - PMA_getHtmlForSqlQueryForm( - true, false, - isset($_REQUEST['delimiter']) - ? htmlspecialchars($_REQUEST['delimiter']) - : ';' - ) -); diff --git a/#pma/db_sql_autocomplete.php b/#pma/db_sql_autocomplete.php deleted file mode 100644 index b760e232..00000000 --- a/#pma/db_sql_autocomplete.php +++ /dev/null @@ -1,26 +0,0 @@ -getTables($db); - foreach ($tableNames as $tableName) { - $sql_autocomplete[$tableName] = $GLOBALS['dbi']->getColumns( - $db, $tableName - ); - } - } -} else { - $sql_autocomplete = true; -} -$response = PMA\libraries\Response::getInstance(); -$response->addJSON("tables", json_encode($sql_autocomplete)); diff --git a/#pma/db_sql_format.php b/#pma/db_sql_format.php deleted file mode 100644 index c89ace5f..00000000 --- a/#pma/db_sql_format.php +++ /dev/null @@ -1,20 +0,0 @@ -addJSON("sql", $query); diff --git a/#pma/db_structure.php b/#pma/db_structure.php deleted file mode 100644 index 4bdb9ccb..00000000 --- a/#pma/db_structure.php +++ /dev/null @@ -1,38 +0,0 @@ -factory('PMA\libraries\controllers\database\DatabaseStructureController'); -$container->alias( - 'DatabaseStructureController', - 'PMA\libraries\controllers\database\DatabaseStructureController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/* Define dependencies for the concerned controller */ -$dependency_definitions = array( - 'db' => $db, - 'url_query' => &$GLOBALS['url_query'], -); - -/** @var DatabaseStructureController $controller */ -$controller = $container->get( - 'DatabaseStructureController', - $dependency_definitions -); -$controller->indexAction(); diff --git a/#pma/db_tracking.php b/#pma/db_tracking.php deleted file mode 100644 index c8f78379..00000000 --- a/#pma/db_tracking.php +++ /dev/null @@ -1,150 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('jquery/jquery.tablesorter.js'); -$scripts->addFile('db_tracking.js'); - -/** - * If we are not in an Ajax request, then do the common work and show the links etc. - */ -require 'libraries/db_common.inc.php'; -$url_query .= '&goto=tbl_tracking.php&back=db_tracking.php'; - -// Get the database structure -$sub_part = '_structure'; - -list( - $tables, - $num_tables, - $total_num_tables, - $sub_part, - $is_show_stats, - $db_is_system_schema, - $tooltip_truename, - $tooltip_aliasname, - $pos -) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); - -// Work to do? -// (here, do not use $_REQUEST['db] as it can be crafted) -if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) { - - Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']); - PMA\libraries\Message::success( - __('Tracking data deleted successfully.') - )->display(); - -} elseif (isset($_REQUEST['submit_create_version'])) { - - PMA_createTrackingForMultipleTables($_REQUEST['selected']); - PMA\libraries\Message::success( - sprintf( - __( - 'Version %1$s was created for selected tables,' - . ' tracking is active for them.' - ), - htmlspecialchars($_REQUEST['version']) - ) - )->display(); - -} elseif (isset($_REQUEST['submit_mult'])) { - - if (! empty($_REQUEST['selected_tbl'])) { - if ($_REQUEST['submit_mult'] == 'delete_tracking') { - - foreach ($_REQUEST['selected_tbl'] as $table) { - Tracker::deleteTracking($GLOBALS['db'], $table); - } - PMA\libraries\Message::success( - __('Tracking data deleted successfully.') - )->display(); - - } elseif ($_REQUEST['submit_mult'] == 'track') { - - echo PMA_getHtmlForDataDefinitionAndManipulationStatements( - 'db_tracking.php' . $url_query, - 0, - $GLOBALS['db'], - $_REQUEST['selected_tbl'] - ); - exit; - } - } else { - PMA\libraries\Message::notice( - __('No tables selected.') - )->display(); - } -} - -// Get tracked data about the database -$data = Tracker::getTrackedData($_REQUEST['db'], '', '1'); - -// No tables present and no log exist -if ($num_tables == 0 && count($data['ddlog']) == 0) { - echo '

' , __('No tables found in database.') , '

' , "\n"; - - if (empty($db_is_system_schema)) { - echo PMA_getHtmlForCreateTable($db); - } - exit; -} - -// --------------------------------------------------------------------------- -$cfgRelation = PMA_getRelationsParam(); - -// Prepare statement to get HEAD version -$all_tables_query = ' SELECT table_name, MAX(version) as version FROM ' . - PMA\libraries\Util::backquote($cfgRelation['db']) . '.' . - PMA\libraries\Util::backquote($cfgRelation['tracking']) . - ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['db']) . - '\' ' . - ' GROUP BY table_name' . - ' ORDER BY table_name ASC'; - -$all_tables_result = PMA_queryAsControlUser($all_tables_query); - -// If a HEAD version exists -if (is_object($all_tables_result) - && $GLOBALS['dbi']->numRows($all_tables_result) > 0 -) { - PMA_displayTrackedTables( - $GLOBALS['db'], $all_tables_result, $url_query, $pmaThemeImage, - $text_dir, $cfgRelation - ); -} - -$untracked_tables = PMA_getUntrackedTables($GLOBALS['db']); - -// If untracked tables exist -if (count($untracked_tables) > 0) { - PMA_displayUntrackedTables( - $GLOBALS['db'], $untracked_tables, $url_query, $pmaThemeImage, $text_dir - ); -} -// If available print out database log -if (count($data['ddlog']) > 0) { - $log = ''; - foreach ($data['ddlog'] as $entry) { - $log .= '# ' . $entry['date'] . ' ' . $entry['username'] . "\n" - . $entry['statement'] . "\n"; - } - echo PMA\libraries\Util::getMessage(__('Database Log'), $log); -} diff --git a/#pma/db_triggers.php b/#pma/db_triggers.php deleted file mode 100644 index a415fb43..00000000 --- a/#pma/db_triggers.php +++ /dev/null @@ -1,23 +0,0 @@ -/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/doctrees - -rm -rf $(BUILDDIR)/html - -rm -rf $(BUILDDIR)/dirhtml - -rm -rf $(BUILDDIR)/singlehtml - -rm -rf $(BUILDDIR)/pickle - -rm -rf $(BUILDDIR)/json - -rm -rf $(BUILDDIR)/htmlhelp - -rm -rf $(BUILDDIR)/qthelp - -rm -rf $(BUILDDIR)/devhelp - -rm -rf $(BUILDDIR)/epub - -rm -rf $(BUILDDIR)/latex - -rm -rf $(BUILDDIR)/text - -rm -rf $(BUILDDIR)/man - -rm -rf $(BUILDDIR)/texinfo - -rm -rf $(BUILDDIR)/info - -rm -rf $(BUILDDIR)/gettext - -rm -rf $(BUILDDIR)/changes - -rm -rf $(BUILDDIR)/linkcheck - -rm -rf $(BUILDDIR)/doctest - -rm -rf $(BUILDDIR)/xml - -rm -rf $(BUILDDIR)/pseudoxml - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/phpMyAdmin.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/phpMyAdmin.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/phpMyAdmin" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/phpMyAdmin" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/#pma/doc/_ext/configext.py b/#pma/doc/_ext/configext.py deleted file mode 100644 index 021b4505..00000000 --- a/#pma/doc/_ext/configext.py +++ /dev/null @@ -1,188 +0,0 @@ -from sphinx.domains import Domain, ObjType -from sphinx.roles import XRefRole -from sphinx.domains.std import GenericObject, StandardDomain -from sphinx.directives import ObjectDescription -from sphinx.util.nodes import clean_astext, make_refnode -from sphinx.util import ws_re -from sphinx import addnodes -from sphinx.util.docfields import Field -from docutils import nodes - -def get_id_from_cfg(text): - ''' - Formats anchor ID from config option. - ''' - if text[:6] == '$cfg[\'': - text = text[6:] - if text[-2:] == '\']': - text = text[:-2] - text = text.replace('[$i]', '') - parts = text.split("']['") - return parts - - -class ConfigOption(ObjectDescription): - indextemplate = 'configuration option; %s' - parse_node = None - - has_arguments = True - - doc_field_types = [ - Field('default', label='Default value', has_arg=False, - names=('default', )), - Field('type', label='Type', has_arg=False, - names=('type',)), - ] - - - def handle_signature(self, sig, signode): - signode.clear() - signode += addnodes.desc_name(sig, sig) - # normalize whitespace like XRefRole does - name = ws_re.sub('', sig) - return name - - def add_target_and_index(self, name, sig, signode): - targetparts = get_id_from_cfg(name) - targetname = 'cfg_%s' % '_'.join(targetparts) - signode['ids'].append(targetname) - self.state.document.note_explicit_target(signode) - indextype = 'single' - - # Generic index entries - indexentry = self.indextemplate % (name,) - self.indexnode['entries'].append((indextype, indexentry, - targetname, targetname)) - self.indexnode['entries'].append((indextype, name, - targetname, targetname)) - - # Server section - if targetparts[0] == 'Servers' and len(targetparts) > 1: - indexname = ', '.join(targetparts[1:]) - self.indexnode['entries'].append((indextype, 'server configuration; %s' % indexname, - targetname, targetname)) - self.indexnode['entries'].append((indextype, indexname, - targetname, targetname)) - else: - indexname = ', '.join(targetparts) - self.indexnode['entries'].append((indextype, indexname, - targetname, targetname)) - - self.env.domaindata['config']['objects'][self.objtype, name] = \ - self.env.docname, targetname - - -class ConfigSectionXRefRole(XRefRole): - """ - Cross-referencing role for configuration sections (adds an index entry). - """ - - def result_nodes(self, document, env, node, is_ref): - if not is_ref: - return [node], [] - varname = node['reftarget'] - tgtid = 'index-%s' % env.new_serialno('index') - indexnode = addnodes.index() - indexnode['entries'] = [ - ('single', varname, tgtid, varname), - ('single', 'configuration section; %s' % varname, tgtid, varname) - ] - targetnode = nodes.target('', '', ids=[tgtid]) - document.note_explicit_target(targetnode) - return [indexnode, targetnode, node], [] - -class ConfigSection(ObjectDescription): - indextemplate = 'configuration section; %s' - parse_node = None - - def handle_signature(self, sig, signode): - if self.parse_node: - name = self.parse_node(self.env, sig, signode) - else: - signode.clear() - signode += addnodes.desc_name(sig, sig) - # normalize whitespace like XRefRole does - name = ws_re.sub('', sig) - return name - - def add_target_and_index(self, name, sig, signode): - targetname = '%s-%s' % (self.objtype, name) - signode['ids'].append(targetname) - self.state.document.note_explicit_target(signode) - if self.indextemplate: - colon = self.indextemplate.find(':') - if colon != -1: - indextype = self.indextemplate[:colon].strip() - indexentry = self.indextemplate[colon+1:].strip() % (name,) - else: - indextype = 'single' - indexentry = self.indextemplate % (name,) - self.indexnode['entries'].append((indextype, indexentry, - targetname, targetname)) - self.env.domaindata['config']['objects'][self.objtype, name] = \ - self.env.docname, targetname - - -class ConfigOptionXRefRole(XRefRole): - """ - Cross-referencing role for configuration options (adds an index entry). - """ - - def result_nodes(self, document, env, node, is_ref): - if not is_ref: - return [node], [] - varname = node['reftarget'] - tgtid = 'index-%s' % env.new_serialno('index') - indexnode = addnodes.index() - indexnode['entries'] = [ - ('single', varname, tgtid, varname), - ('single', 'configuration option; %s' % varname, tgtid, varname) - ] - targetnode = nodes.target('', '', ids=[tgtid]) - document.note_explicit_target(targetnode) - return [indexnode, targetnode, node], [] - - -class ConfigFileDomain(Domain): - name = 'config' - label = 'Config' - - object_types = { - 'option': ObjType('config option', 'option'), - 'section': ObjType('config section', 'section'), - } - directives = { - 'option': ConfigOption, - 'section': ConfigSection, - } - roles = { - 'option': ConfigOptionXRefRole(), - 'section': ConfigSectionXRefRole(), - } - - initial_data = { - 'objects': {}, # (type, name) -> docname, labelid - } - - def clear_doc(self, docname): - for key, (fn, _) in self.data['objects'].items(): - if fn == docname: - del self.data['objects'][key] - - def resolve_xref(self, env, fromdocname, builder, - typ, target, node, contnode): - docname, labelid = self.data['objects'].get((typ, target), ('', '')) - if not docname: - return None - else: - return make_refnode(builder, fromdocname, docname, - labelid, contnode) - - def get_objects(self): - for (type, name), info in self.data['objects'].items(): - yield (name, name, type, info[0], info[1], - self.object_types[type].attrs['searchprio']) - -def setup(app): - app.add_domain(ConfigFileDomain) - diff --git a/#pma/doc/conf.py b/#pma/doc/conf.py deleted file mode 100644 index a6eb890e..00000000 --- a/#pma/doc/conf.py +++ /dev/null @@ -1,304 +0,0 @@ -# -*- coding: utf-8 -*- -# -# phpMyAdmin documentation build configuration file, created by -# sphinx-quickstart on Wed Sep 26 14:04:48 2012. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext"))) - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = ['configext'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'phpMyAdmin' -copyright = u'2012 - 2016, The phpMyAdmin devel team' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '4.6.5.2' -# The full version, including alpha/beta/rc tags. -release = version - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ['_build', 'html', 'doctrees'] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -#html_static_path = ['_static'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -#html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'phpMyAdmindoc' - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ('index', 'phpMyAdmin.tex', u'phpMyAdmin Documentation', - u'The phpMyAdmin devel team', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'phpmyadmin', u'phpMyAdmin Documentation', - [u'The phpMyAdmin devel team'], 1) -] - -# If true, show URL addresses after external links. -#man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ('index', 'phpMyAdmin', u'phpMyAdmin Documentation', - u'The phpMyAdmin devel team', 'phpMyAdmin', 'One line description of project.', - 'Miscellaneous'), -] - -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - - -# -- Options for Epub output --------------------------------------------------- - -# Bibliographic Dublin Core info. -epub_title = u'phpMyAdmin' -epub_author = u'The phpMyAdmin devel team' -epub_publisher = u'The phpMyAdmin devel team' -epub_copyright = copyright - -# The language of the text. It defaults to the language option -# or en if the language is not set. -#epub_language = '' - -# The scheme of the identifier. Typical schemes are ISBN or URL. -#epub_scheme = '' - -# The unique identifier of the text. This can be a ISBN number -# or the project homepage. -#epub_identifier = '' - -# A unique identification for the text. -#epub_uid = '' - -# A tuple containing the cover image and cover page html template filenames. -#epub_cover = () - -# HTML files that should be inserted before the pages created by sphinx. -# The format is a list of tuples containing the path and title. -#epub_pre_files = [] - -# HTML files shat should be inserted after the pages created by sphinx. -# The format is a list of tuples containing the path and title. -#epub_post_files = [] - -# A list of files that should not be packed into the epub file. -#epub_exclude_files = [] - -# The depth of the table of contents in toc.ncx. -#epub_tocdepth = 3 - -# Allow duplicate toc entries. -#epub_tocdup = True - -# Highlight PHP without starting `_). - - A good test is to browse a table, edit a row and save it. There should be - an error message if phpMyAdmin is having trouble auto–detecting the correct - value. If you get an error that this must be set or if the autodetect code - fails to detect your path, please post a bug report on our bug tracker so - we can improve the code. - - .. seealso:: :ref:`faq1_40`, :ref:`faq2_5`, :ref:`faq4_7`, :ref:`faq5_16` - -.. config:option:: $cfg['PmaNoRelation_DisableWarning'] - - :type: boolean - :default: false - - Starting with version 2.3.0 phpMyAdmin offers a lot of features to - work with master / foreign – tables (see :config:option:`$cfg['Servers'][$i]['pmadb']`). - - If you tried to set this - up and it does not work for you, have a look on the :guilabel:`Structure` page - of one database where you would like to use it. You will find a link - that will analyze why those features have been disabled. - - If you do not want to use those features set this variable to ``true`` to - stop this message from appearing. - -.. config:option:: $cfg['SuhosinDisableWarning'] - - :type: boolean - :default: false - - A warning is displayed on the main page if Suhosin is detected. - - You can set this parameter to ``true`` to stop this message from appearing. - -.. config:option:: $cfg['LoginCookieValidityDisableWarning'] - - :type: boolean - :default: false - - A warning is displayed on the main page if the PHP parameter - session.gc_maxlifetime is lower than cookie validity configured in phpMyAdmin. - - You can set this parameter to ``true`` to stop this message from appearing. - -.. config:option:: $cfg['ServerLibraryDifference_DisableWarning'] - - :type: boolean - :default: false - - A warning is displayed on the main page if there is a difference - between the MySQL library and server version. - - You can set this parameter to ``true`` to stop this message from appearing. - -.. config:option:: $cfg['ReservedWordDisableWarning'] - - :type: boolean - :default: false - - This warning is displayed on the Structure page of a table if one or more - column names match with words which are MySQL reserved. - - If you want to turn off this warning, you can set it to ``true`` and - warning will no longer be displayed. - -.. config:option:: $cfg['TranslationWarningThreshold'] - - :type: integer - :default: 80 - - Show warning about incomplete translations on certain threshold. - -.. config:option:: $cfg['SendErrorReports'] - - :type: string - :default: ``'ask'`` - - Sets the default behavior for JavaScript error reporting. - - Whenever an error is detected in the JavaScript execution, an error report - may be sent to the phpMyAdmin team if the user agrees. - - The default setting of ``'ask'`` will ask the user everytime there is a new - error report. However you can set this parameter to ``'always'`` to send error - reports without asking for confirmation or you can set it to ``'never'`` to - never send error reports. - - This directive is available both in the configuration file and in users - preferences. If the person in charge of a multi-user installation prefers - to disable this feature for all users, a value of ``'never'`` should be - set, and the :config:option:`$cfg['UserprefsDisallow']` directive should - contain ``'SendErrorReports'`` in one of its array values. - -.. config:option:: $cfg['ConsoleEnterExecutes'] - - :type: boolean - :default: false - - Setting this to ``true`` allows the user to execute queries by pressing Enter - instead of Ctrl+Enter. A new line can be inserted by pressing Shift + Enter. - - The behaviour of the console can be temporarily changed using console's - settings interface. - -.. config:option:: $cfg['AllowThirdPartyFraming'] - - :type: boolean - :default: false - - Setting this to ``true`` allows phpMyAdmin to be included inside a frame, - and is a potential security hole allowing cross-frame scripting attacks or - clickjacking. - -Server connection settings --------------------------- - -.. config:option:: $cfg['Servers'] - - :type: array - :default: one server array with settings listed below - - Since version 1.4.2, phpMyAdmin supports the administration of multiple - MySQL servers. Therefore, a :config:option:`$cfg['Servers']`-array has been - added which contains the login information for the different servers. The - first :config:option:`$cfg['Servers'][$i]['host']` contains the hostname of - the first server, the second :config:option:`$cfg['Servers'][$i]['host']` - the hostname of the second server, etc. In - :file:`libraries/config.default.php`, there is only one section for server - definition, however you can put as many as you need in - :file:`config.inc.php`, copy that block or needed parts (you don't have to - define all settings, just those you need to change). - - .. note:: - - The :config:option:`$cfg['Servers']` array starts with - $cfg['Servers'][1]. Do not use $cfg['Servers'][0]. If you want more - than one server, just copy following section (including $i - incrementation) serveral times. There is no need to define full server - array, just define values you need to change. - - -.. config:option:: $cfg['Servers'][$i]['host'] - - :type: string - :default: ``'localhost'`` - - The hostname or :term:`IP` address of your $i-th MySQL-server. E.g. - ``localhost``. - - Possible values are: - - * hostname, e.g., ``'localhost'`` or ``'mydb.example.org'`` - * IP address, e.g., ``'127.0.0.1'`` or ``'192.168.10.1'`` - * dot - ``'.'``, i.e., use named pipes on windows systems - * empty - ``''``, disables this server - - .. note:: - - phpMyAdmin supports connecting to MySQL servers reachable via IPv6 only. - To connect to an IPv6 MySQL server, enter its IPv6 address in this field. - -.. config:option:: $cfg['Servers'][$i]['port'] - - :type: string - :default: ``''`` - - The port-number of your $i-th MySQL-server. Default is 3306 (leave - blank). - - .. note:: - - If you use ``localhost`` as the hostname, MySQL ignores this port number - and connects with the socket, so if you want to connect to a port - different from the default port, use ``127.0.0.1`` or the real hostname - in :config:option:`$cfg['Servers'][$i]['host']`. - -.. config:option:: $cfg['Servers'][$i]['socket'] - - :type: string - :default: ``''`` - - The path to the socket to use. Leave blank for default. To determine - the correct socket, check your MySQL configuration or, using the - :command:`mysql` command–line client, issue the ``status`` command. Among the - resulting information displayed will be the socket used. - -.. config:option:: $cfg['Servers'][$i]['ssl'] - - :type: boolean - :default: false - - Whether to enable SSL for the connection between phpMyAdmin and the MySQL server. - - When using the ``'mysql'`` extension, - none of the remaining ``'ssl...'`` configuration options apply. - - We strongly recommend the ``'mysqli'`` extension when using this option. - - .. seealso:: :ref:`example-google-ssl` - -.. config:option:: $cfg['Servers'][$i]['ssl_key'] - - :type: string - :default: NULL - - Path to the key file when using SSL for connecting to the MySQL server. - - For example: - - .. code-block:: php - - $cfg['Servers'][$i]['ssl_key'] = '/etc/mysql/server-key.pem'; - - .. seealso:: :ref:`example-google-ssl` - -.. config:option:: $cfg['Servers'][$i]['ssl_cert'] - - :type: string - :default: NULL - - Path to the cert file when using SSL for connecting to the MySQL server. - - .. seealso:: :ref:`example-google-ssl` - -.. config:option:: $cfg['Servers'][$i]['ssl_ca'] - - :type: string - :default: NULL - - Path to the CA file when using SSL for connecting to the MySQL server. - - .. seealso:: :ref:`example-google-ssl` - -.. config:option:: $cfg['Servers'][$i]['ssl_ca_path'] - - :type: string - :default: NULL - - Directory containing trusted SSL CA certificates in PEM format. - -.. config:option:: $cfg['Servers'][$i]['ssl_ciphers'] - - :type: string - :default: NULL - - List of allowable ciphers for SSL connections to the MySQL server. - -.. config:option:: $cfg['Servers'][$i]['ssl_verify'] - - :type: boolean - :default: true - - .. versionadded:: 4.6.0 - - This is supported since phpMyAdmin 4.6.0. - - If your PHP install uses the MySQL Native Driver (mysqlnd), your - MySQL server is 5.6 or later, and your SSL certificate is self-signed, - there is a chance your SSL connection will fail due to validation. - Setting this to ``false`` will disable the validation check. - - Since PHP 5.6.0 it also verifies whether server name matches CN of it's - certificate. There is currently no way to disable just this check without - disabling complete SSL verification. - - .. note:: - - This flag only works with PHP 5.6.16 or later. - - .. seealso:: :ref:`example-google-ssl` - -.. config:option:: $cfg['Servers'][$i]['connect_type'] - - :type: string - :default: ``'tcp'`` - - What type connection to use with the MySQL server. Your options are - ``'socket'`` and ``'tcp'``. It defaults to tcp as that is nearly guaranteed - to be available on all MySQL servers, while sockets are not supported on - some platforms. To use the socket mode, your MySQL server must be on the - same machine as the Web server. - -.. config:option:: $cfg['Servers'][$i]['compress'] - - :type: boolean - :default: false - - Whether to use a compressed protocol for the MySQL server connection - or not (experimental). - -.. _controlhost: -.. config:option:: $cfg['Servers'][$i]['controlhost'] - - :type: string - :default: ``''`` - - Permits to use an alternate host to hold the configuration storage - data. - -.. _controlport: -.. config:option:: $cfg['Servers'][$i]['controlport'] - - :type: string - :default: ``''`` - - Permits to use an alternate port to connect to the host that - holds the configuration storage. - -.. _controluser: -.. config:option:: $cfg['Servers'][$i]['controluser'] - - :type: string - :default: ``''`` - -.. config:option:: $cfg['Servers'][$i]['controlpass'] - - :type: string - :default: ``''`` - - This special account is used for 2 distinct purposes: to make possible all - relational features (see :config:option:`$cfg['Servers'][$i]['pmadb']`). - - .. versionchanged:: 2.2.5 - those were called ``stduser`` and ``stdpass`` - - .. seealso:: :ref:`setup`, :ref:`authentication_modes`, :ref:`linked-tables` - -.. config:option:: $cfg['Servers'][$i]['auth_type'] - - :type: string - :default: ``'cookie'`` - - Whether config or cookie or :term:`HTTP` or signon authentication should be - used for this server. - - * 'config' authentication (``$auth_type = 'config'``) is the plain old - way: username and password are stored in :file:`config.inc.php`. - * 'cookie' authentication mode (``$auth_type = 'cookie'``) allows you to - log in as any valid MySQL user with the help of cookies. - * 'http' authentication allows you to log in as any - valid MySQL user via HTTP-Auth. - * 'signon' authentication mode (``$auth_type = 'signon'``) allows you to - log in from prepared PHP session data or using supplied PHP script. - - .. seealso:: :ref:`authentication_modes` - -.. _servers_auth_http_realm: -.. config:option:: $cfg['Servers'][$i]['auth_http_realm'] - - :type: string - :default: ``''`` - - When using auth\_type = ``http``, this field allows to define a custom - :term:`HTTP` Basic Auth Realm which will be displayed to the user. If not - explicitly specified in your configuration, a string combined of - "phpMyAdmin " and either :config:option:`$cfg['Servers'][$i]['verbose']` or - :config:option:`$cfg['Servers'][$i]['host']` will be used. - -.. _servers_user: -.. config:option:: $cfg['Servers'][$i]['user'] - - :type: string - :default: ``'root'`` - -.. config:option:: $cfg['Servers'][$i]['password'] - - :type: string - :default: ``''`` - - When using :config:option:`$cfg['Servers'][$i]['auth_type']` set to - 'config', this is the user/password-pair which phpMyAdmin will use to - connect to the MySQL server. This user/password pair is not needed when - :term:`HTTP` or cookie authentication is used - and should be empty. - -.. _servers_nopassword: -.. config:option:: $cfg['Servers'][$i]['nopassword'] - - :type: boolean - :default: false - - Allow attempt to log in without password when a login with password - fails. This can be used together with http authentication, when - authentication is done some other way and phpMyAdmin gets user name - from auth and uses empty password for connecting to MySQL. Password - login is still tried first, but as fallback, no password method is - tried. - -.. _servers_only_db: -.. config:option:: $cfg['Servers'][$i]['only_db'] - - :type: string or array - :default: ``''`` - - If set to a (an array of) database name(s), only this (these) - database(s) will be shown to the user. Since phpMyAdmin 2.2.1, - this/these database(s) name(s) may contain MySQL wildcards characters - ("\_" and "%"): if you want to use literal instances of these - characters, escape them (I.E. use ``'my\_db'`` and not ``'my_db'``). - - This setting is an efficient way to lower the server load since the - latter does not need to send MySQL requests to build the available - database list. But **it does not replace the privileges rules of the - MySQL database server**. If set, it just means only these databases - will be displayed but **not that all other databases can't be used.** - - An example of using more that one database: - - .. code-block:: php - - $cfg['Servers'][$i]['only_db'] = array('db1', 'db2'); - - .. versionchanged:: 4.0.0 - Previous versions permitted to specify the display order of - the database names via this directive. - -.. config:option:: $cfg['Servers'][$i]['hide_db'] - - :type: string - :default: ``''`` - - Regular expression for hiding some databases from unprivileged users. - This only hides them from listing, but a user is still able to access - them (using, for example, the SQL query area). To limit access, use - the MySQL privilege system. For example, to hide all databases - starting with the letter "a", use - - .. code-block:: php - - $cfg['Servers'][$i]['hide_db'] = '^a'; - - and to hide both "db1" and "db2" use - - .. code-block:: php - - $cfg['Servers'][$i]['hide_db'] = '^(db1|db2)$'; - - More information on regular expressions can be found in the `PCRE - pattern syntax - `_ portion - of the PHP reference manual. - -.. config:option:: $cfg['Servers'][$i]['verbose'] - - :type: string - :default: ``''`` - - Only useful when using phpMyAdmin with multiple server entries. If - set, this string will be displayed instead of the hostname in the - pull-down menu on the main page. This can be useful if you want to - show only certain databases on your system, for example. For HTTP - auth, all non-US-ASCII characters will be stripped. - -.. config:option:: $cfg['Servers'][$i]['pmadb'] - - :type: string - :default: ``''`` - - The name of the database containing the phpMyAdmin configuration - storage. - - See the :ref:`linked-tables` section in this document to see the benefits of - this feature, and for a quick way of creating this database and the needed - tables. - - If you are the only user of this phpMyAdmin installation, you can use your - current database to store those special tables; in this case, just put your - current database name in :config:option:`$cfg['Servers'][$i]['pmadb']`. For a - multi-user installation, set this parameter to the name of your central - database containing the phpMyAdmin configuration storage. - -.. _bookmark: -.. config:option:: $cfg['Servers'][$i]['bookmarktable'] - - :type: string or false - :default: ``''`` - - Since release 2.2.0 phpMyAdmin allows users to bookmark queries. This - can be useful for queries you often run. To allow the usage of this - functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * enter the table name in :config:option:`$cfg['Servers'][$i]['bookmarktable']` - - This feature can be disabled by setting the configuration to ``false``. - -.. _relation: -.. config:option:: $cfg['Servers'][$i]['relation'] - - :type: string or false - :default: ``''`` - - Since release 2.2.4 you can describe, in a special 'relation' table, - which column is a key in another table (a foreign key). phpMyAdmin - currently uses this to: - - * make clickable, when you browse the master table, the data values that - point to the foreign table; - * display in an optional tool-tip the "display column" when browsing the - master table, if you move the mouse to a column containing a foreign - key (use also the 'table\_info' table); (see :ref:`faqdisplay`) - * in edit/insert mode, display a drop-down list of possible foreign keys - (key value and "display column" are shown) (see :ref:`faq6_21`) - * display links on the table properties page, to check referential - integrity (display missing foreign keys) for each described key; - * in query-by-example, create automatic joins (see :ref:`faq6_6`) - * enable you to get a :term:`PDF` schema of - your database (also uses the table\_coords table). - - The keys can be numeric or character. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the relation table name in :config:option:`$cfg['Servers'][$i]['relation']` - * now as normal user open phpMyAdmin and for each one of your tables - where you want to use this feature, click :guilabel:`Structure/Relation view/` - and choose foreign columns. - - This feature can be disabled by setting the configuration to ``false``. - - .. note:: - - In the current version, ``master_db`` must be the same as ``foreign_db``. - Those columns have been put in future development of the cross-db - relations. - -.. _table_info: -.. config:option:: $cfg['Servers'][$i]['table_info'] - - :type: string or false - :default: ``''`` - - Since release 2.3.0 you can describe, in a special 'table\_info' - table, which column is to be displayed as a tool-tip when moving the - cursor over the corresponding key. This configuration variable will - hold the name of this special table. To allow the usage of this - functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['table\_info']` (e.g. - ``pma__table_info``) - * then for each table where you want to use this feature, click - "Structure/Relation view/Choose column to display" to choose the - column. - - This feature can be disabled by setting the configuration to ``false``. - - .. seealso:: :ref:`faqdisplay` - -.. _table_coords: -.. config:option:: $cfg['Servers'][$i]['table_coords'] - - :type: string or false - :default: ``''`` - -.. config:option:: $cfg['Servers'][$i]['pdf_pages'] - - :type: string or false - :default: ``''`` - - Since release 2.3.0 you can have phpMyAdmin create :term:`PDF` pages - showing the relations between your tables. Further, the designer interface - permits visually managing the relations. To do this it needs two tables - "pdf\_pages" (storing information about the available :term:`PDF` pages) - and "table\_coords" (storing coordinates where each table will be placed on - a :term:`PDF` schema output). You must be using the "relation" feature. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the correct table names in - :config:option:`$cfg['Servers'][$i]['table\_coords']` and - :config:option:`$cfg['Servers'][$i]['pdf\_pages']` - - This feature can be disabled by setting either of the configurations to ``false``. - - .. seealso:: :ref:`faqpdf`. - -.. _col_com: -.. config:option:: $cfg['Servers'][$i]['column_info'] - - :type: string or false - :default: ``''`` - - This part requires a content update! Since release 2.3.0 you can - store comments to describe each column for each table. These will then - be shown on the "printview". - - Starting with release 2.5.0, comments are consequently used on the table - property pages and table browse view, showing up as tool-tips above the - column name (properties page) or embedded within the header of table in - browse view. They can also be shown in a table dump. Please see the - relevant configuration directives later on. - - Also new in release 2.5.0 is a MIME- transformation system which is also - based on the following table structure. See :ref:`transformations` for - further information. To use the MIME- transformation system, your - column\_info table has to have the three new columns 'mimetype', - 'transformation', 'transformation\_options'. - - Starting with release 4.3.0, a new input-oriented transformation system - has been introduced. Also, backward compatibility code used in the old - transformations system was removed. As a result, an update to column\_info - table is necessary for previous transformations and the new input-oriented - transformation system to work. phpMyAdmin will upgrade it automatically - for you by analyzing your current column\_info table structure. - However, if something goes wrong with the auto-upgrade then you can - use the SQL script found in ``./sql/upgrade_column_info_4_3_0+.sql`` - to upgrade it manually. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['column\_info']` (e.g. - ``pma__column_info``) - * to update your PRE-2.5.0 Column\_comments table use this: and - remember that the Variable in :file:`config.inc.php` has been renamed from - :config:option:`$cfg['Servers'][$i]['column\_comments']` to - :config:option:`$cfg['Servers'][$i]['column\_info']` - - .. code-block:: mysql - - ALTER TABLE `pma__column_comments` - ADD `mimetype` VARCHAR( 255 ) NOT NULL, - ADD `transformation` VARCHAR( 255 ) NOT NULL, - ADD `transformation_options` VARCHAR( 255 ) NOT NULL; - * to update your PRE-4.3.0 Column\_info table manually use this - ``./sql/upgrade_column_info_4_3_0+.sql`` SQL script. - - This feature can be disabled by setting the configuration to ``false``. - - .. note:: - - For auto-upgrade functionality to work, your - ``$cfg['Servers'][$i]['controluser']`` must have ALTER privilege on - ``phpmyadmin`` database. See the `MySQL documentation for GRANT - `_ on how to - ``GRANT`` privileges to a user. - -.. _history: -.. config:option:: $cfg['Servers'][$i]['history'] - - :type: string or false - :default: ``''`` - - Since release 2.5.0 you can store your :term:`SQL` history, which means all - queries you entered manually into the phpMyAdmin interface. If you don't - want to use a table-based history, you can use the JavaScript-based - history. - - Using that, all your history items are deleted when closing the window. - Using :config:option:`$cfg['QueryHistoryMax']` you can specify an amount of - history items you want to have on hold. On every login, this list gets cut - to the maximum amount. - - The query history is only available if JavaScript is enabled in - your browser. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['history']` (e.g. - ``pma__history``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _recent: -.. config:option:: $cfg['Servers'][$i]['recent'] - - :type: string or false - :default: ``''`` - - Since release 3.5.0 you can show recently used tables in the - navigation panel. It helps you to jump across table directly, without - the need to select the database, and then select the table. Using - :config:option:`$cfg['NumRecentTables']` you can configure the maximum number - of recent tables shown. When you select a table from the list, it will jump to - the page specified in :config:option:`$cfg['NavigationTreeDefaultTabTable']`. - - Without configuring the storage, you can still access the recently used tables, - but it will disappear after you logout. - - To allow the usage of this functionality persistently: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['recent']` (e.g. - ``pma__recent``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _favorite: -.. config:option:: $cfg['Servers'][$i]['favorite'] - - :type: string or false - :default: ``''`` - - Since release 4.2.0 you can show a list of selected tables in the - navigation panel. It helps you to jump to the table directly, without - the need to select the database, and then select the table. When you - select a table from the list, it will jump to the page specified in - :config:option:`$cfg['NavigationTreeDefaultTabTable']`. - - You can add tables to this list or remove tables from it in database - structure page by clicking on the star icons next to table names. Using - :config:option:`$cfg['NumFavoriteTables']` you can configure the maximum - number of favorite tables shown. - - Without configuring the storage, you can still access the favorite tables, - but it will disappear after you logout. - - To allow the usage of this functionality persistently: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['favorite']` (e.g. - ``pma__favorite``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _table_uiprefs: -.. config:option:: $cfg['Servers'][$i]['table_uiprefs'] - - :type: string or false - :default: ``''`` - - Since release 3.5.0 phpMyAdmin can be configured to remember several - things (sorted column :config:option:`$cfg['RememberSorting']`, column order, - and column visibility from a database table) for browsing tables. Without - configuring the storage, these features still can be used, but the values will - disappear after you logout. - - To allow the usage of these functionality persistently: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['table\_uiprefs']` (e.g. - ``pma__table_uiprefs``) - - This feature can be disabled by setting the configuration to ``false``. - -.. config:option:: $cfg['Servers'][$i]['users'] - - :type: string or false - :default: ``''`` - -.. config:option:: $cfg['Servers'][$i]['usergroups'] - - :type: string or false - :default: ``''`` - - Since release 4.1.0 you can create different user groups with menu items - attached to them. Users can be assigned to these groups and the logged in - user would only see menu items configured to the usergroup he is assigned to. - To do this it needs two tables "usergroups" (storing allowed menu items for each - user group) and "users" (storing users and their assignments to user groups). - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the correct table names in - :config:option:`$cfg['Servers'][$i]['users']` (e.g. ``pma__users``) and - :config:option:`$cfg['Servers'][$i]['usergroups']` (e.g. ``pma__usergroups``) - - This feature can be disabled by setting either of the configurations to ``false``. - - .. seealso:: :ref:`configurablemenus` - -.. _navigationhiding: -.. config:option:: $cfg['Servers'][$i]['navigationhiding'] - - :type: string or false - :default: ``''`` - - Since release 4.1.0 you can hide/show items in the navigation tree. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['navigationhiding']` (e.g. - ``pma__navigationhiding``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _central_columns: -.. config:option:: $cfg['Servers'][$i]['central_columns'] - - :type: string or false - :default: ``''`` - - Since release 4.3.0 you can have a central list of columns per database. - You can add/remove columns to the list as per your requirement. These columns - in the central list will be available to use while you create a new column for - a table or create a table itself. You can select a column from central list - while creating a new column, it will save you from writing the same column definition - over again or from writing different names for similar column. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['central_columns']` (e.g. - ``pma__central_columns``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _designer_settings: -.. config:option:: $cfg['Servers'][$i]['designer_settings'] - - :type: string or false - :default: ``''`` - - Since release 4.5.0 your designer settings can be remembered. - Your choice regarding 'Angular/Direct Links', 'Snap to Grid', 'Toggle Relation Lines', - 'Small/Big All', 'Move Menu' and 'Pin Text' can be remembered persistently. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['designer_settings']` (e.g. - ``pma__designer_settings``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _savedsearches: -.. config:option:: $cfg['Servers'][$i]['savedsearches'] - - :type: string or false - :default: ``''`` - - Since release 4.2.0 you can save and load query-by-example searches from the Database > Query panel. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['savedsearches']` (e.g. - ``pma__savedsearches``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _export_templates: -.. config:option:: $cfg['Servers'][$i]['export_templates'] - - :type: string or false - :default: ``''`` - - Since release 4.5.0 you can save and load export templates. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['export_templates']` (e.g. - ``pma__export_templates``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _tracking: -.. config:option:: $cfg['Servers'][$i]['tracking'] - - :type: string or false - :default: ``''`` - - Since release 3.3.x a tracking mechanism is available. It helps you to - track every :term:`SQL` command which is - executed by phpMyAdmin. The mechanism supports logging of data - manipulation and data definition statements. After enabling it you can - create versions of tables. - - The creation of a version has two effects: - - * phpMyAdmin saves a snapshot of the table, including structure and - indexes. - * phpMyAdmin logs all commands which change the structure and/or data of - the table and links these commands with the version number. - - Of course you can view the tracked changes. On the :guilabel:`Tracking` - page a complete report is available for every version. For the report you - can use filters, for example you can get a list of statements within a date - range. When you want to filter usernames you can enter \* for all names or - you enter a list of names separated by ','. In addition you can export the - (filtered) report to a file or to a temporary database. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['tracking']` (e.g. - ``pma__tracking``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _tracking2: -.. config:option:: $cfg['Servers'][$i]['tracking_version_auto_create'] - - :type: boolean - :default: false - - Whether the tracking mechanism creates versions for tables and views - automatically. - - If this is set to true and you create a table or view with - - * CREATE TABLE ... - * CREATE VIEW ... - - and no version exists for it, the mechanism will create a version for - you automatically. - -.. _tracking3: -.. config:option:: $cfg['Servers'][$i]['tracking_default_statements'] - - :type: string - :default: ``'CREATE TABLE,ALTER TABLE,DROP TABLE,RENAME TABLE,CREATE INDEX,DROP INDEX,INSERT,UPDATE,DELETE,TRUNCATE,REPLACE,CREATE VIEW,ALTER VIEW,DROP VIEW,CREATE DATABASE,ALTER DATABASE,DROP DATABASE'`` - - Defines the list of statements the auto-creation uses for new - versions. - -.. _tracking4: -.. config:option:: $cfg['Servers'][$i]['tracking_add_drop_view'] - - :type: boolean - :default: true - - Whether a DROP VIEW IF EXISTS statement will be added as first line to - the log when creating a view. - -.. _tracking5: -.. config:option:: $cfg['Servers'][$i]['tracking_add_drop_table'] - - :type: boolean - :default: true - - Whether a DROP TABLE IF EXISTS statement will be added as first line - to the log when creating a table. - -.. _tracking6: -.. config:option:: $cfg['Servers'][$i]['tracking_add_drop_database'] - - :type: boolean - :default: true - - Whether a DROP DATABASE IF EXISTS statement will be added as first - line to the log when creating a database. - -.. _userconfig: -.. config:option:: $cfg['Servers'][$i]['userconfig'] - - :type: string or false - :default: ``''`` - - Since release 3.4.x phpMyAdmin allows users to set most preferences by - themselves and store them in the database. - - If you don't allow for storing preferences in - :config:option:`$cfg['Servers'][$i]['pmadb']`, users can still personalize - phpMyAdmin, but settings will be saved in browser's local storage, or, it - is is unavailable, until the end of session. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['userconfig']` - - This feature can be disabled by setting the configuration to ``false``. - -.. config:option:: $cfg['Servers'][$i]['MaxTableUiprefs'] - - :type: integer - :default: 100 - - Maximum number of rows saved in - :config:option:`$cfg['Servers'][$i]['table_uiprefs']` table. - - When tables are dropped or renamed, - :config:option:`$cfg['Servers'][$i]['table_uiprefs']` may contain invalid data - (referring to tables which no longer exist). We only keep this number of newest - rows in :config:option:`$cfg['Servers'][$i]['table_uiprefs']` and automatically - delete older rows. - -.. config:option:: $cfg['Servers'][$i]['SessionTimeZone'] - - :type: string - :default: ``''`` - - Sets the time zone used by phpMyAdmin. Leave blank to use the time zone of your - database server. Possible values are explained at - https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html - - This is useful when your database server uses a time zone which is different from the - time zone you want to use in phpMyAdmin. - -.. config:option:: $cfg['Servers'][$i]['AllowRoot'] - - :type: boolean - :default: true - - Whether to allow root access. This is just a shortcut for the - :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` below. - -.. config:option:: $cfg['Servers'][$i]['AllowNoPassword'] - - :type: boolean - :default: false - - Whether to allow logins without a password. The default value of - ``false`` for this parameter prevents unintended access to a MySQL - server with was left with an empty password for root or on which an - anonymous (blank) user is defined. - -.. _servers_allowdeny_order: -.. config:option:: $cfg['Servers'][$i]['AllowDeny']['order'] - - :type: string - :default: ``''`` - - If your rule order is empty, then :term:`IP` - authorization is disabled. - - If your rule order is set to - ``'deny,allow'`` then the system applies all deny rules followed by - allow rules. Access is allowed by default. Any client which does not - match a Deny command or does match an Allow command will be allowed - access to the server. - - If your rule order is set to ``'allow,deny'`` - then the system applies all allow rules followed by deny rules. Access - is denied by default. Any client which does not match an Allow - directive or does match a Deny directive will be denied access to the - server. - - If your rule order is set to ``'explicit'``, authorization is - performed in a similar fashion to rule order 'deny,allow', with the - added restriction that your host/username combination **must** be - listed in the *allow* rules, and not listed in the *deny* rules. This - is the **most** secure means of using Allow/Deny rules, and was - available in Apache by specifying allow and deny rules without setting - any order. - - Please also see :config:option:`$cfg['TrustedProxies']` for - detecting IP address behind proxies. - -.. _servers_allowdeny_rules: -.. config:option:: $cfg['Servers'][$i]['AllowDeny']['rules'] - - :type: array of strings - :default: array() - - The general format for the rules is as such: - - .. code-block:: none - - <'allow' | 'deny'> [from] - - If you wish to match all users, it is possible to use a ``'%'`` as a - wildcard in the *username* field. - - There are a few shortcuts you can - use in the *ipmask* field as well (please note that those containing - SERVER\_ADDRESS might not be available on all webservers): - - .. code-block:: none - - - 'all' -> 0.0.0.0/0 - 'localhost' -> 127.0.0.1/8 - 'localnetA' -> SERVER_ADDRESS/8 - 'localnetB' -> SERVER_ADDRESS/16 - 'localnetC' -> SERVER_ADDRESS/24 - - Having an empty rule list is equivalent to either using ``'allow % - from all'`` if your rule order is set to ``'deny,allow'`` or ``'deny % - from all'`` if your rule order is set to ``'allow,deny'`` or - ``'explicit'``. - - For the :term:`IP address` matching - system, the following work: - - * ``xxx.xxx.xxx.xxx`` (an exact :term:`IP address`) - * ``xxx.xxx.xxx.[yyy-zzz]`` (an :term:`IP address` range) - * ``xxx.xxx.xxx.xxx/nn`` (CIDR, Classless Inter-Domain Routing type :term:`IP` addresses) - - But the following does not work: - - * ``xxx.xxx.xxx.xx[yyy-zzz]`` (partial :term:`IP` address range) - - For :term:`IPv6` addresses, the following work: - - * ``xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx`` (an exact :term:`IPv6` address) - * ``xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:[yyyy-zzzz]`` (an :term:`IPv6` address range) - * ``xxxx:xxxx:xxxx:xxxx/nn`` (CIDR, Classless Inter-Domain Routing type :term:`IPv6` addresses) - - But the following does not work: - - * ``xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xx[yyy-zzz]`` (partial :term:`IPv6` address range) - -.. config:option:: $cfg['Servers'][$i]['DisableIS'] - - :type: boolean - :default: false - - Disable using ``INFORMATION_SCHEMA`` to retrieve information (use - ``SHOW`` commands instead), because of speed issues when many - databases are present. Currently used in some parts of the code, more - to come. - -.. config:option:: $cfg['Servers'][$i]['SignonScript'] - - :type: string - :default: ``''`` - - Name of PHP script to be sourced and executed to obtain login - credentials. This is alternative approach to session based single - signon. The script has to provide a function called - ``get_login_credentials`` which returns list of username and - password, accepting single parameter of existing username (can be - empty). See :file:`examples/signon-script.php` for an example: - - .. literalinclude:: ../examples/signon-script.php - :language: php - - .. seealso:: :ref:`auth_signon` - -.. config:option:: $cfg['Servers'][$i]['SignonSession'] - - :type: string - :default: ``''`` - - Name of session which will be used for signon authentication method. - You should use something different than ``phpMyAdmin``, because this - is session which phpMyAdmin uses internally. Takes effect only if - :config:option:`$cfg['Servers'][$i]['SignonScript']` is not configured. - - .. seealso:: :ref:`auth_signon` - -.. config:option:: $cfg['Servers'][$i]['SignonURL'] - - :type: string - :default: ``''`` - - :term:`URL` where user will be redirected - to log in for signon authentication method. Should be absolute - including protocol. - - .. seealso:: :ref:`auth_signon` - -.. config:option:: $cfg['Servers'][$i]['LogoutURL'] - - :type: string - :default: ``''`` - - :term:`URL` where user will be redirected - after logout (doesn't affect config authentication method). Should be - absolute including protocol. - -Generic settings ----------------- - -.. config:option:: $cfg['ServerDefault'] - - :type: integer - :default: 1 - - If you have more than one server configured, you can set - :config:option:`$cfg['ServerDefault']` to any one of them to autoconnect to that - server when phpMyAdmin is started, or set it to 0 to be given a list - of servers without logging in. - - If you have only one server configured, - :config:option:`$cfg['ServerDefault']` MUST be set to that server. - -.. config:option:: $cfg['VersionCheck'] - - :type: boolean - :default: true - - Enables check for latest versions using JavaScript on the main phpMyAdmin - page or by directly accessing :file:`version_check.php`. - - .. note:: - - This setting can be adjusted by your vendor. - -.. config:option:: $cfg['ProxyUrl'] - - :type: string - :default: "" - - The url of the proxy to be used when phpmyadmin needs to access the outside - internet such as when retrieving the latest version info or submitting error - reports. You need this if the server where phpMyAdmin is installed does not - have direct access to the internet. - The format is: "hostname:portnumber" - -.. config:option:: $cfg['ProxyUser'] - - :type: string - :default: "" - - The username for authenticating with the proxy. By default, no - authentication is performed. If a username is supplied, Basic - Authentication will be performed. No other types of authentication - are currently supported. - -.. config:option:: $cfg['ProxyPass'] - - :type: string - :default: "" - - The password for authenticating with the proxy. - -.. config:option:: $cfg['MaxDbList'] - - :type: integer - :default: 100 - - The maximum number of database names to be displayed in the main panel's - database list. - -.. config:option:: $cfg['MaxTableList'] - - :type: integer - :default: 250 - - The maximum number of table names to be displayed in the main panel's - list (except on the Export page). - -.. config:option:: $cfg['ShowHint'] - - :type: boolean - :default: true - - Whether or not to show hints (for example, hints when hovering over - table headers). - -.. config:option:: $cfg['MaxCharactersInDisplayedSQL'] - - :type: integer - :default: 1000 - - The maximum number of characters when a :term:`SQL` query is displayed. The - default limit of 1000 should be correct to avoid the display of tons of - hexadecimal codes that represent BLOBs, but some users have real - :term:`SQL` queries that are longer than 1000 characters. Also, if a - query's length exceeds this limit, this query is not saved in the history. - -.. config:option:: $cfg['PersistentConnections'] - - :type: boolean - :default: false - - Whether `persistent connections `_ should be used or not. Works with - following extensions: - - * mysql (`mysql\_pconnect `_), - * mysqli (requires PHP 5.3.0 or newer, `more information - `_). - -.. config:option:: $cfg['ForceSSL'] - - :type: boolean - :default: false - - .. deprecated:: 4.6.0 - - This setting is no longer available since phpMyAdmin 4.6.0. Please - adjust your webserver instead. - - Whether to force using https while accessing phpMyAdmin. In a reverse - proxy setup, setting this to ``true`` is not supported. - - .. note:: - - In some setups (like separate SSL proxy or load balancer) you might - have to set :config:option:`$cfg['PmaAbsoluteUri']` for correct - redirection. - -.. config:option:: $cfg['ExecTimeLimit'] - - :type: integer [number of seconds] - :default: 300 - - Set the number of seconds a script is allowed to run. If seconds is - set to zero, no time limit is imposed. This setting is used while - importing/exporting dump files but has - no effect when PHP is running in safe mode. - -.. config:option:: $cfg['SessionSavePath'] - - :type: string - :default: ``''`` - - Path for storing session data (`session\_save\_path PHP parameter - `_). - -.. config:option:: $cfg['MemoryLimit'] - - :type: string [number of bytes] - :default: ``'-1'`` - - Set the number of bytes a script is allowed to allocate. If set to - ``'-1'``, no limit is imposed. If set to ``'0'``, no change of the - memory limit is attempted and the :file:`php.ini` ``memory_limit`` is - used. - - This setting is used while importing/exporting dump files - so you definitely don't want to put here a too low - value. It has no effect when PHP is running in safe mode. - - You can also use any string as in :file:`php.ini`, eg. '16M'. Ensure you - don't omit the suffix (16 means 16 bytes!) - -.. config:option:: $cfg['SkipLockedTables'] - - :type: boolean - :default: false - - Mark used tables and make it possible to show databases with locked - tables (since MySQL 3.23.30). - -.. config:option:: $cfg['ShowSQL'] - - :type: boolean - :default: true - - Defines whether :term:`SQL` queries - generated by phpMyAdmin should be displayed or not. - -.. config:option:: $cfg['RetainQueryBox'] - - :type: boolean - :default: false - - Defines whether the :term:`SQL` query box - should be kept displayed after its submission. - -.. config:option:: $cfg['CodemirrorEnable'] - - :type: boolean - :default: true - - Defines whether to use a Javascript code editor for SQL query boxes. - CodeMirror provides syntax highlighting and line numbers. However, - middle-clicking for pasting the clipboard contents in some Linux - distributions (such as Ubuntu) is not supported by all browsers. - -.. config:option:: $cfg['DefaultForeignKeyChecks'] - - :type: string - :default: ``'default'`` - - Default value of the checkbox for foreign key checks, to disable/enable - foreign key checks for certain queries. The possible values are ``'default'``, - ``'enable'`` or ``'disable'``. If set to ``'default'``, the value of the - MySQL variable ``FOREIGN_KEY_CHECKS`` is used. - -.. config:option:: $cfg['AllowUserDropDatabase'] - - :type: boolean - :default: false - - .. warning:: - - This is not a security measure as there will be always ways to - circumvent this. If you want to prohibit users from dropping databases, - revoke their corresponding DROP privilege. - - Defines whether normal users (non-administrator) are allowed to delete - their own database or not. If set as false, the link :guilabel:`Drop - Database` will not be shown, and even a ``DROP DATABASE mydatabase`` will - be rejected. Quite practical for :term:`ISP` 's with many customers. - - This limitation of :term:`SQL` queries is not as strict as when using MySQL - privileges. This is due to nature of :term:`SQL` queries which might be - quite complicated. So this choice should be viewed as help to avoid - accidental dropping rather than strict privilege limitation. - -.. config:option:: $cfg['Confirm'] - - :type: boolean - :default: true - - Whether a warning ("Are your really sure...") should be displayed when - you're about to lose data. - -.. config:option:: $cfg['UseDbSearch'] - - :type: boolean - :default: true - - Define whether the "search string inside database" is enabled or not. - -.. config:option:: $cfg['IgnoreMultiSubmitErrors'] - - :type: boolean - :default: false - - Define whether phpMyAdmin will continue executing a multi-query - statement if one of the queries fails. Default is to abort execution. - -Cookie authentication options ------------------------------ - -.. config:option:: $cfg['blowfish_secret'] - - :type: string - :default: ``''`` - - The "cookie" auth\_type uses AES algorithm to encrypt the password. If you - are using the "cookie" auth\_type, enter here a random passphrase of your - choice. It will be used internally by the AES algorithm: you won’t be - prompted for this passphrase. - - The secret should be 32 characters long. Using shorter will lead to weaker security - of encrypted cookies, using longer will cause no harm. - - .. note:: - - The configuration is called blowfish_secret for historical reasons as - Blowfish algorithm was originally used to do the encryption. - - .. versionchanged:: 3.1.0 - Since version 3.1.0 phpMyAdmin can generate this on the fly, but it - makes a bit weaker security as this generated secret is stored in - session and furthermore it makes impossible to recall user name from - cookie. - -.. config:option:: $cfg['LoginCookieRecall'] - - :type: boolean - :default: true - - Define whether the previous login should be recalled or not in cookie - authentication mode. - - This is automatically disabled if you do not have - configured :config:option:`$cfg['blowfish_secret']`. - -.. config:option:: $cfg['LoginCookieValidity'] - - :type: integer [number of seconds] - :default: 1440 - - Define how long a login cookie is valid. Please note that php - configuration option `session.gc\_maxlifetime - `_ might limit session validity and if the session is lost, - the login cookie is also invalidated. So it is a good idea to set - ``session.gc_maxlifetime`` at least to the same value of - :config:option:`$cfg['LoginCookieValidity']`. - -.. config:option:: $cfg['LoginCookieStore'] - - :type: integer [number of seconds] - :default: 0 - - Define how long login cookie should be stored in browser. Default 0 - means that it will be kept for existing session. This is recommended - for not trusted environments. - -.. config:option:: $cfg['LoginCookieDeleteAll'] - - :type: boolean - :default: true - - If enabled (default), logout deletes cookies for all servers, - otherwise only for current one. Setting this to false makes it easy to - forget to log out from other server, when you are using more of them. - -.. _AllowArbitraryServer: -.. config:option:: $cfg['AllowArbitraryServer'] - - :type: boolean - :default: false - - If enabled, allows you to log in to arbitrary servers using cookie - authentication. - - .. note:: - - Please use this carefully, as this may allow users access to MySQL servers - behind the firewall where your :term:`HTTP` server is placed. - See also :config:option:`$cfg['ArbitraryServerRegexp']`. - -.. config:option:: $cfg['ArbitraryServerRegexp'] - - :type: string - :default: ``''`` - - Restricts the MySQL servers to which the user can log in when - :config:option:`$cfg['AllowArbitraryServer']` is enabled by - matching the :term:`IP` or the hostname of the MySQL server - to the given regular expression. The regular expression must be enclosed - with a delimiter character. - - It is recommended to include start and end symbols in the regullar - expression, so that you can avoid partial matches on the string. - - **Examples:** - - .. code-block:: php - - // Allow connection to three listed servers: - $cfg['ArbitraryServerRegexp'] = '/^(server|another|yetdifferent)$/'; - - // Allow connection to range of IP addresses: - $cfg['ArbitraryServerRegexp'] = '@^192\.168\.0\.[0-9]{1,}$@'; - - // Allow connection to server name ending with -mysql: - $cfg['ArbitraryServerRegexp'] = '@^[^:]\-mysql$@'; - - .. note:: - - The whole server name is matched, it can include port as well. Due to - way MySQL is permissive in connection parameters, it is possible to use - connection strings as ```server:3306-mysql```. This can be used to - bypass regullar expression by the suffix, while connecting to another - server. - -.. config:option:: $cfg['CaptchaLoginPublicKey'] - - :type: string - :default: ``''`` - - The public key for the reCaptcha service that can be obtained from - https://www.google.com/recaptcha. - - reCaptcha will be then used in :ref:`cookie`. - -.. config:option:: $cfg['CaptchaLoginPrivateKey'] - - :type: string - :default: ``''`` - - The private key for the reCaptcha service that can be obtain from - https://www.google.com/recaptcha. - - reCaptcha will be then used in :ref:`cookie`. - -Navigation panel setup ----------------------- - -.. config:option:: $cfg['ShowDatabasesNavigationAsTree'] - - :type: boolean - :default: true - - In the navigation panel, replaces the database tree with a selector - -.. config:option:: $cfg['FirstLevelNavigationItems'] - - :type: integer - :default: 100 - - The number of first level databases that can be displayed on each page - of navigation tree. - -.. config:option:: $cfg['MaxNavigationItems'] - - :type: integer - :default: 50 - - The number of items (tables, columns, indexes) that can be displayed on each - page of the navigation tree. - -.. config:option:: $cfg['NavigationTreeEnableGrouping'] - - :type: boolean - :default: true - - Defines whether to group the databases based on a common prefix - in their name :config:option:`$cfg['NavigationTreeDbSeparator']`. - -.. config:option:: $cfg['NavigationTreeDbSeparator'] - - :type: string - :default: ``'_'`` - - The string used to separate the parts of the database name when - showing them in a tree. - -.. config:option:: $cfg['NavigationTreeTableSeparator'] - - :type: string or array - :default: ``'__'`` - - Defines a string to be used to nest table spaces. This means if you have - tables like ``first__second__third`` this will be shown as a three-level - hierarchy like: first > second > third. If set to false or empty, the - feature is disabled. NOTE: You should not use this separator at the - beginning or end of a table name or multiple times after another without - any other characters in between. - -.. config:option:: $cfg['NavigationTreeTableLevel'] - - :type: integer - :default: 1 - - Defines how many sublevels should be displayed when splitting up - tables by the above separator. - -.. config:option:: $cfg['NumRecentTables'] - - :type: integer - :default: 10 - - The maximum number of recently used tables shown in the navigation - panel. Set this to 0 (zero) to disable the listing of recent tables. - -.. config:option:: $cfg['NumFavoriteTables'] - - :type: integer - :default: 10 - - The maximum number of favorite tables shown in the navigation - panel. Set this to 0 (zero) to disable the listing of favorite tables. - -.. config:option:: $cfg['ZeroConf'] - - :type: boolean - :default: true - - Enables Zero Configuration mode in which the user will be offered a choice to - create phpMyAdmin configuration storage in the current database - or use the existing one, if already present. - - This setting has no effect if the phpMyAdmin configuration storage database - is properly created and the related configuration directives (such as - :config:option:`$cfg['Servers'][$i]['pmadb']` and so on) are configured. - -.. config:option:: $cfg['NavigationLinkWithMainPanel'] - - :type: boolean - :default: true - - Defines whether or not to link with main panel by highlighting - the current database or table. - -.. config:option:: $cfg['NavigationDisplayLogo'] - - :type: boolean - :default: true - - Defines whether or not to display the phpMyAdmin logo at the top of - the navigation panel. - -.. config:option:: $cfg['NavigationLogoLink'] - - :type: string - :default: ``'index.php'`` - - Enter :term:`URL` where logo in the navigation panel will point to. - For use especially with self made theme which changes this. - For external URLs, you should include URL scheme as well. - -.. config:option:: $cfg['NavigationLogoLinkWindow'] - - :type: string - :default: ``'main'`` - - Whether to open the linked page in the main window (``main``) or in a - new one (``new``). Note: use ``new`` if you are linking to - ``phpmyadmin.net``. - -.. config:option:: $cfg['NavigationTreeDisplayItemFilterMinimum'] - - :type: integer - :default: 30 - - Defines the minimum number of items (tables, views, routines and - events) to display a JavaScript filter box above the list of items in - the navigation tree. - - To disable the filter completely some high number can be used (e.g. 9999) - -.. config:option:: $cfg['NavigationTreeDisplayDbFilterMinimum'] - - :type: integer - :default: 30 - - Defines the minimum number of databases to display a JavaScript filter - box above the list of databases in the navigation tree. - - To disable the filter completely some high number can be used - (e.g. 9999) - -.. config:option:: $cfg['NavigationDisplayServers'] - - :type: boolean - :default: true - - Defines whether or not to display a server choice at the top of the - navigation panel. - -.. config:option:: $cfg['DisplayServersList'] - - :type: boolean - :default: false - - Defines whether to display this server choice as links instead of in a - drop-down. - -.. config:option:: $cfg['NavigationTreeDefaultTabTable'] - - :type: string - :default: ``'structure'`` - - Defines the tab displayed by default when clicking the small icon next - to each table name in the navigation panel. The possible values are the - localized equivalent of: - - * ``structure`` - * ``sql`` - * ``search`` - * ``insert`` - * ``browse`` - -.. config:option:: $cfg['NavigationTreeDefaultTabTable2'] - - :type: string - :default: null - - Defines the tab displayed by default when clicking the second small icon next - to each table name in the navigation panel. The possible values are the - localized equivalent of: - - * ``(empty)`` - * ``structure`` - * ``sql`` - * ``search`` - * ``insert`` - * ``browse`` - -.. config:option:: $cfg['NavigationTreeEnableExpansion'] - - :type: boolean - :default: false - - Whether to offer the possibility of tree expansion in the navigation panel. - -.. config:option:: $cfg['NavigationTreeShowTables'] - - :type: boolean - :default: true - - Whether to show tables under database in the navigation panel. - -.. config:option:: $cfg['NavigationTreeShowViews'] - - :type: boolean - :default: true - - Whether to show views under database in the navigation panel. - -.. config:option:: $cfg['NavigationTreeShowFunctions'] - - :type: boolean - :default: true - - Whether to show functions under database in the navigation panel. - -.. config:option:: $cfg['NavigationTreeShowProcedures'] - - :type: boolean - :default: true - - Whether to show procedures under database in the navigation panel. - -.. config:option:: $cfg['NavigationTreeShowEvents'] - - :type: boolean - :default: true - - Whether to show events under database in the navigation panel. - - -Main panel ----------- - -.. config:option:: $cfg['ShowStats'] - - :type: boolean - :default: true - - Defines whether or not to display space usage and statistics about - databases and tables. Note that statistics requires at least MySQL - 3.23.3 and that, at this date, MySQL doesn't return such information - for Berkeley DB tables. - -.. config:option:: $cfg['ShowServerInfo'] - - :type: boolean - :default: true - - Defines whether to display detailed server information on main page. - You can additionally hide more information by using - :config:option:`$cfg['Servers'][$i]['verbose']`. - -.. config:option:: $cfg['ShowChgPassword'] - - :type: boolean - :default: true - -.. config:option:: $cfg['ShowCreateDb'] - - :type: boolean - :default: true - - Defines whether to display the - :guilabel:`Change password` links and form for creating database or not at - the starting main (right) frame. This setting does not check MySQL commands - entered directly. - - Also note that enabling the :guilabel:`Change password` link has no effect - with config authentication mode: because of the hard coded password value - in the configuration file, end users can't be allowed to change their - passwords. - -.. config:option:: $cfg['ShowGitRevision'] - - :type: boolean - :default: true - - Defines whether to display informations about the current Git revision (if - applicable) on the main panel. - -.. config:option:: $cfg['MysqlMinVersion'] - - :type: array - - Defines the minimum supported MySQL version. The default is chosen - by the phpMyAdmin team; however this directive was asked by a developer - of the Plesk control panel to ease integration with older MySQL servers - (where most of the phpMyAdmin features work). - -Database structure ------------------- - -.. config:option:: $cfg['ShowDbStructureCreation'] - - :type: boolean - :default: false - - Defines whether the database structure page (tables list) has a - "Creation" column that displays when each table was created. - -.. config:option:: $cfg['ShowDbStructureLastUpdate'] - - :type: boolean - :default: false - - Defines whether the database structure page (tables list) has a "Last - update" column that displays when each table was last updated. - -.. config:option:: $cfg['ShowDbStructureLastCheck'] - - :type: boolean - :default: false - - Defines whether the database structure page (tables list) has a "Last - check" column that displays when each table was last checked. - -.. config:option:: $cfg['HideStructureActions'] - - :type: boolean - :default: true - - Defines whether the table structure actions are hidden under a "More" - drop-down. - -Browse mode ------------ - -.. config:option:: $cfg['TableNavigationLinksMode'] - - :type: string - :default: ``'icons'`` - - Defines whether the table navigation links contain ``'icons'``, ``'text'`` - or ``'both'``. - -.. config:option:: $cfg['ActionLinksMode'] - - :type: string - :default: ``'both'`` - - If set to ``icons``, will display icons instead of text for db and table - properties links (like :guilabel:`Browse`, :guilabel:`Select`, - :guilabel:`Insert`, ...). Can be set to ``'both'`` - if you want icons AND text. When set to ``text``, will only show text. - -.. config:option:: $cfg['RowActionType'] - - :type: string - :default: ``'both'`` - - Whether to display icons or text or both icons and text in table row action - segment. Value can be either of ``'icons'``, ``'text'`` or ``'both'``. - -.. config:option:: $cfg['ShowAll'] - - :type: boolean - :default: false - - Defines whether a user should be displayed a "Show all" button in browse - mode or not in all cases. By default it is shown only on small tables (less - than 500 rows) to avoid performance issues while getting too many rows. - -.. config:option:: $cfg['MaxRows'] - - :type: integer - :default: 25 - - Number of rows displayed when browsing a result set and no LIMIT - clause is used. If the result set contains more rows, "Previous" and - "Next" links will be shown. Possible values: 25,50,100,250,500. - -.. config:option:: $cfg['Order'] - - :type: string - :default: ``'SMART'`` - - Defines whether columns are displayed in ascending (``ASC``) order, in - descending (``DESC``) order or in a "smart" (``SMART``) order - I.E. - descending order for columns of type TIME, DATE, DATETIME and - TIMESTAMP, ascending order else- by default. - -.. config:option:: $cfg['GridEditing'] - - :type: string - :default: ``'double-click'`` - - Defines which action (``double-click`` or ``click``) triggers grid - editing. Can be deactivated with the ``disabled`` value. - -.. config:option:: $cfg['RelationalDisplay'] - - :type: string - :default: ``'K'`` - - Defines the initial behavior for Options > Relational. ``K``, which - is the default, displays the key while ``D`` shows the display column. - -.. config:option:: $cfg['SaveCellsAtOnce'] - - :type: boolean - :default: false - - Defines whether or not to save all edited cells at once for grid - editing. - -Editing mode ------------- - -.. config:option:: $cfg['ProtectBinary'] - - :type: boolean or string - :default: ``'blob'`` - - Defines whether ``BLOB`` or ``BINARY`` columns are protected from - editing when browsing a table's content. Valid values are: - - * ``false`` to allow editing of all columns; - * ``'blob'`` to allow editing of all columns except ``BLOBS``; - * ``'noblob'`` to disallow editing of all columns except ``BLOBS`` (the - opposite of ``'blob'``); - * ``'all'`` to disallow editing of all ``BINARY`` or ``BLOB`` columns. - -.. config:option:: $cfg['ShowFunctionFields'] - - :type: boolean - :default: true - - Defines whether or not MySQL functions fields should be initially - displayed in edit/insert mode. Since version 2.10, the user can toggle - this setting from the interface. - -.. config:option:: $cfg['ShowFieldTypesInDataEditView'] - - :type: boolean - :default: true - - Defines whether or not type fields should be initially displayed in - edit/insert mode. The user can toggle this setting from the interface. - -.. config:option:: $cfg['InsertRows'] - - :type: integer - :default: 2 - - Defines the maximum number of concurrent entries for the Insert page. - -.. config:option:: $cfg['ForeignKeyMaxLimit'] - - :type: integer - :default: 100 - - If there are fewer items than this in the set of foreign keys, then a - drop-down box of foreign keys is presented, in the style described by - the :config:option:`$cfg['ForeignKeyDropdownOrder']` setting. - -.. config:option:: $cfg['ForeignKeyDropdownOrder'] - - :type: array - :default: array('content-id', 'id-content') - - For the foreign key drop-down fields, there are several methods of - display, offering both the key and value data. The contents of the - array should be one or both of the following strings: ``content-id``, - ``id-content``. - -Export and import settings --------------------------- - -.. config:option:: $cfg['ZipDump'] - - :type: boolean - :default: true - -.. config:option:: $cfg['GZipDump'] - - :type: boolean - :default: true - -.. config:option:: $cfg['BZipDump'] - - :type: boolean - :default: true - - Defines whether to allow the use of zip/GZip/BZip2 compression when - creating a dump file - -.. config:option:: $cfg['CompressOnFly'] - - :type: boolean - :default: true - - Defines whether to allow on the fly compression for GZip/BZip2 - compressed exports. This doesn't affect smaller dumps and allows users - to create larger dumps that won't otherwise fit in memory due to php - memory limit. Produced files contain more GZip/BZip2 headers, but all - normal programs handle this correctly. - -.. config:option:: $cfg['Export'] - - :type: array - :default: array(...) - - In this array are defined default parameters for export, names of - items are similar to texts seen on export page, so you can easily - identify what they mean. - -.. config:option:: $cfg['Export']['method'] - - :type: string - :default: ``'quick'`` - - Defines how the export form is displayed when it loads. Valid values - are: - - * ``quick`` to display the minimum number of options to configure - * ``custom`` to display every available option to configure - * ``custom-no-form`` same as ``custom`` but does not display the option - of using quick export - - - -.. config:option:: $cfg['Import'] - - :type: array - :default: array(...) - - In this array are defined default parameters for import, names of - items are similar to texts seen on import page, so you can easily - identify what they mean. - - -Tabs display settings ---------------------- - -.. config:option:: $cfg['TabsMode'] - - :type: string - :default: ``'both'`` - - Defines whether the menu tabs contain ``'icons'``, ``'text'`` or ``'both'``. - -.. config:option:: $cfg['PropertiesNumColumns'] - - :type: integer - :default: 1 - - How many columns will be utilized to display the tables on the database - property view? When setting this to a value larger than 1, the type of the - database will be omitted for more display space. - -.. config:option:: $cfg['DefaultTabServer'] - - :type: string - :default: ``'welcome'`` - - Defines the tab displayed by default on server view. The possible values - are the localized equivalent of: - - * ``welcome`` (recommended for multi-user setups) - * ``databases``, - * ``status`` - * ``variables`` - * ``privileges`` - -.. config:option:: $cfg['DefaultTabDatabase'] - - :type: string - :default: ``'structure'`` - - Defines the tab displayed by default on database view. The possible values - are the localized equivalent of: - - * ``structure`` - * ``sql`` - * ``search`` - * ``operations`` - -.. config:option:: $cfg['DefaultTabTable'] - - :type: string - :default: ``'browse'`` - - Defines the tab displayed by default on table view. The possible values - are the localized equivalent of: - - * ``structure`` - * ``sql`` - * ``search`` - * ``insert`` - * ``browse`` - -PDF Options ------------ - -.. config:option:: $cfg['PDFPageSizes'] - - :type: array - :default: ``array('A3', 'A4', 'A5', 'letter', 'legal')`` - - Array of possible paper sizes for creating PDF pages. - - You should never need to change this. - -.. config:option:: $cfg['PDFDefaultPageSize'] - - :type: string - :default: ``'A4'`` - - Default page size to use when creating PDF pages. Valid values are any - listed in :config:option:`$cfg['PDFPageSizes']`. - -Languages ---------- - -.. config:option:: $cfg['DefaultLang'] - - :type: string - :default: ``'en'`` - - Defines the default language to use, if not browser-defined or user- - defined. The corresponding language file needs to be in - locale/*code*/LC\_MESSAGES/phpmyadmin.mo. - -.. config:option:: $cfg['DefaultConnectionCollation'] - - :type: string - :default: ``'utf8_general_ci'`` - - Defines the default connection collation to use, if not user-defined. - See the `MySQL documentation for charsets - `_ - for list of possible values. - -.. config:option:: $cfg['Lang'] - - :type: string - :default: not set - - Force language to use. The corresponding language file needs to be in - locale/*code*/LC\_MESSAGES/phpmyadmin.mo. - -.. config:option:: $cfg['FilterLanguages'] - - :type: string - :default: ``''`` - - Limit list of available languages to those matching the given regular - expression. For example if you want only Czech and English, you should - set filter to ``'^(cs|en)'``. - -.. config:option:: $cfg['RecodingEngine'] - - :type: string - :default: ``'auto'`` - - You can select here which functions will be used for character set - conversion. Possible values are: - - * auto - automatically use available one (first is tested iconv, then - recode) - * iconv - use iconv or libiconv functions - * recode - use recode\_string function - * mb - use mbstring extension - * none - disable encoding conversion - - Enabled charset conversion activates a pull-down menu in the Export - and Import pages, to choose the character set when exporting a file. - The default value in this menu comes from - :config:option:`$cfg['Export']['charset']` and :config:option:`$cfg['Import']['charset']`. - -.. config:option:: $cfg['IconvExtraParams'] - - :type: string - :default: ``'//TRANSLIT'`` - - Specify some parameters for iconv used in charset conversion. See - `iconv documentation `_ for details. By default - ``//TRANSLIT`` is used, so that invalid characters will be - transliterated. - -.. config:option:: $cfg['AvailableCharsets'] - - :type: array - :default: array(...) - - Available character sets for MySQL conversion. You can add your own - (any of supported by recode/iconv) or remove these which you don't - use. Character sets will be shown in same order as here listed, so if - you frequently use some of these move them to the top. - -Web server settings -------------------- - -.. config:option:: $cfg['OBGzip'] - - :type: string/boolean - :default: ``'auto'`` - - Defines whether to use GZip output buffering for increased speed in - :term:`HTTP` transfers. Set to - true/false for enabling/disabling. When set to 'auto' (string), - phpMyAdmin tries to enable output buffering and will automatically - disable it if your browser has some problems with buffering. IE6 with - a certain patch is known to cause data corruption when having enabled - buffering. - -.. config:option:: $cfg['TrustedProxies'] - - :type: array - :default: array() - - Lists proxies and HTTP headers which are trusted for - :config:option:`$cfg['Servers'][$i]['AllowDeny']['order']`. This list is by - default empty, you need to fill in some trusted proxy servers if you - want to use rules for IP addresses behind proxy. - - The following example specifies that phpMyAdmin should trust a - HTTP\_X\_FORWARDED\_FOR (``X -Forwarded-For``) header coming from the proxy - 1.2.3.4: - - .. code-block:: php - - $cfg['TrustedProxies'] = array('1.2.3.4' => 'HTTP_X_FORWARDED_FOR'); - - The :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` directive uses the - client's IP address as usual. - -.. config:option:: $cfg['GD2Available'] - - :type: string - :default: ``'auto'`` - - Specifies whether GD >= 2 is available. If yes it can be used for MIME - transformations. Possible values are: - - * auto - automatically detect - * yes - GD 2 functions can be used - * no - GD 2 function cannot be used - -.. config:option:: $cfg['CheckConfigurationPermissions'] - - :type: boolean - :default: true - - We normally check the permissions on the configuration file to ensure - it's not world writable. However, phpMyAdmin could be installed on a - NTFS filesystem mounted on a non-Windows server, in which case the - permissions seems wrong but in fact cannot be detected. In this case a - sysadmin would set this parameter to ``false``. - -.. config:option:: $cfg['LinkLengthLimit'] - - :type: integer - :default: 1000 - - Limit for length of :term:`URL` in links. When length would be above this - limit, it is replaced by form with button. This is required as some web - servers (:term:`IIS`) have problems with long :term:`URL` . - -.. config:option:: $cfg['CSPAllow'] - - :type: string - :default: ``''`` - - Additional string to include in allowed script and image sources in Content - Security Policy header. - - This can be useful when you want to include some external JavaScript files - in :file:`config.footer.inc.php` or :file:`config.header.inc.php`, which - would be normally not allowed by Content Security Policy. - - To allow some sites, just list them within the string: - - .. code-block:: php - - $cfg['CSPAllow'] = 'example.com example.net'; - - .. versionadded:: 4.0.4 - -.. config:option:: $cfg['DisableMultiTableMaintenance'] - - :type: boolean - :default: false - - In the database Structure page, it's possible to mark some tables then - choose an operation like optimizing for many tables. This can slow - down a server; therefore, setting this to ``true`` prevents this kind - of multiple maintenance operation. - -Theme settings --------------- - - Please directly modify :file:`themes/themename/layout.inc.php`, although - your changes will be overwritten with the next update. - -Design customization --------------------- - -.. config:option:: $cfg['NavigationTreePointerEnable'] - - :type: boolean - :default: true - - When set to true, hovering over an item in the navigation panel causes that item to be marked - (the background is highlighted). - -.. config:option:: $cfg['BrowsePointerEnable'] - - :type: boolean - :default: true - - When set to true, hovering over a row in the Browse page causes that row to be marked (the background - is highlighted). - -.. config:option:: $cfg['BrowseMarkerEnable'] - - :type: boolean - :default: true - - When set to true, a data row is marked (the background is highlighted) when the row is selected - with the checkbox. - -.. config:option:: $cfg['LimitChars'] - - :type: integer - :default: 50 - - Maximum number of characters shown in any non-numeric field on browse - view. Can be turned off by a toggle button on the browse page. - -.. config:option:: $cfg['RowActionLinks'] - - :type: string - :default: ``'left'`` - - Defines the place where table row links (Edit, Copy, Delete) would be - put when tables contents are displayed (you may have them displayed at - the left side, right side, both sides or nowhere). - -.. config:option:: $cfg['RowActionLinksWithoutUnique'] - - :type: boolean - :default: false - - Defines whether to show row links (Edit, Copy, Delete) and checkboxes - for multiple row operations even when the selection does not have a unique key. - Using row actions in the absence of a unique key may result in different/more - rows being affected since there is no guaranteed way to select the exact row(s). - -.. config:option:: $cfg['RememberSorting'] - - :type: boolean - :default: true - - If enabled, remember the sorting of each table when browsing them. - -.. config:option:: $cfg['TablePrimaryKeyOrder'] - - :type: string - :default: ``'NONE'`` - - This defines the default sort order for the tables, having a primary key, - when there is no sort order defines externally. - Acceptable values : ['NONE', 'ASC', 'DESC'] - -.. config:option:: $cfg['ShowBrowseComments'] - - :type: boolean - :default: true - -.. config:option:: $cfg['ShowPropertyComments'] - - :type: boolean - :default: true - - By setting the corresponding variable to ``true`` you can enable the - display of column comments in Browse or Property display. In browse - mode, the comments are shown inside the header. In property mode, - comments are displayed using a CSS-formatted dashed-line below the - name of the column. The comment is shown as a tool-tip for that - column. - -Text fields ------------ - -.. config:option:: $cfg['CharEditing'] - - :type: string - :default: ``'input'`` - - Defines which type of editing controls should be used for CHAR and - VARCHAR columns. Applies to data editing and also to the default values - in structure editing. Possible values are: - - * input - this allows to limit size of text to size of columns in MySQL, - but has problems with newlines in columns - * textarea - no problems with newlines in columns, but also no length - limitations - -.. config:option:: $cfg['MinSizeForInputField'] - - :type: integer - :default: 4 - - Defines the minimum size for input fields generated for CHAR and - VARCHAR columns. - -.. config:option:: $cfg['MaxSizeForInputField'] - - :type: integer - :default: 60 - - Defines the maximum size for input fields generated for CHAR and - VARCHAR columns. - -.. config:option:: $cfg['TextareaCols'] - - :type: integer - :default: 40 - -.. config:option:: $cfg['TextareaRows'] - - :type: integer - :default: 15 - -.. config:option:: $cfg['CharTextareaCols'] - - :type: integer - :default: 40 - -.. config:option:: $cfg['CharTextareaRows'] - - :type: integer - :default: 2 - - Number of columns and rows for the textareas. This value will be - emphasized (\*2) for :term:`SQL` query - textareas and (\*1.25) for :term:`SQL` - textareas inside the query window. - - The Char\* values are used for CHAR - and VARCHAR editing (if configured via :config:option:`$cfg['CharEditing']`). - -.. config:option:: $cfg['LongtextDoubleTextarea'] - - :type: boolean - :default: true - - Defines whether textarea for LONGTEXT columns should have double size. - -.. config:option:: $cfg['TextareaAutoSelect'] - - :type: boolean - :default: false - - Defines if the whole textarea of the query box will be selected on - click. - -.. config:option:: $cfg['EnableAutocompleteForTablesAndColumns'] - - :type: boolean - :default: true - - Whether to enable autocomplete for table and column names in any - SQL query box. - - -SQL query box settings ----------------------- - -.. config:option:: $cfg['SQLQuery']['Edit'] - - :type: boolean - :default: true - - Whether to display an edit link to change a query in any SQL Query - box. - -.. config:option:: $cfg['SQLQuery']['Explain'] - - :type: boolean - :default: true - - Whether to display a link to explain a SELECT query in any SQL Query - box. - -.. config:option:: $cfg['SQLQuery']['ShowAsPHP'] - - :type: boolean - :default: true - - Whether to display a link to wrap a query in PHP code in any SQL Query - box. - -.. config:option:: $cfg['SQLQuery']['Refresh'] - - :type: boolean - :default: true - - Whether to display a link to refresh a query in any SQL Query box. - -.. _web-dirs: - -Web server upload/save/import directories ------------------------------------------ - -If PHP is running in safe mode, all directories must be owned by the same user -as the owner of the phpMyAdmin scripts. - -If the directory where phpMyAdmin is installed is subject to an -``open_basedir`` restriction, you need to create a temporary directory in some -directory accessible by the PHP interpreter. - -For security reasons, all directories should be outside the tree published by -webserver. If you cannot avoid having this directory published by webserver, -limit access to it either by web server configuration (for example using -.htaccess or web.config files) or place at least an empty :file:`index.html` -file there, so that directory listing is not possible. However as long as the -directory is accessible by web server, an attacker can guess filenames to download -the files. - -.. config:option:: $cfg['UploadDir'] - - :type: string - :default: ``''`` - - The name of the directory where :term:`SQL` files have been uploaded by - other means than phpMyAdmin (for example, ftp). Those files are available - under a drop-down box when you click the database or table name, then the - Import tab. - - If - you want different directory for each user, %u will be replaced with - username. - - Please note that the file names must have the suffix ".sql" - (or ".sql.bz2" or ".sql.gz" if support for compressed formats is - enabled). - - This feature is useful when your file is too big to be - uploaded via :term:`HTTP`, or when file - uploads are disabled in PHP. - - .. warning:: - - Please see top of this chapter (:ref:`web-dirs`) for instructions how - to setup this directory and how to make its usage secure. - - .. seealso:: - - See :ref:`faq1_16` for alternatives. - -.. config:option:: $cfg['SaveDir'] - - :type: string - :default: ``''`` - - The name of the directory where dumps can be saved. - - If you want different directory for each user, %u will be replaced with - username. - - Please note that the directory must exist and has to be writable for - the user running webserver. - - .. warning:: - - Please see top of this chapter (:ref:`web-dirs`) for instructions how - to setup this directory and how to make its usage secure. - -.. config:option:: $cfg['TempDir'] - - :type: string - :default: ``''`` - - The name of the directory where temporary files can be stored. - - This is needed for importing ESRI Shapefiles, see :ref:`faq6_30` and to - work around limitations of ``open_basedir`` for uploaded files, see - :ref:`faq1_11`. - - This directory should have as strict permissions as possible as the only - user required to access this directory is the one who runs the webserver. - If you have root privileges, simply make this user owner of this directory - and make it accessible only by it: - - .. code-block:: sh - - chown www-data:www-data tmp - chmod 700 tmp - - If you cannot change owner of the directory, you can achieve a similar - setup using :term:`ACL`: - - .. code-block:: sh - - chmod 700 tmp - setfacl -m "g:www-data:rwx" tmp - setfacl -d -m "g:www-data:rwx" tmp - - If neither of above works for you, you can still make the directory - :command:`chmod 777`, but it might impose risk of other users on system - reading and writing data in this directory. - - .. warning:: - - Please see top of this chapter (:ref:`web-dirs`) for instructions how - to setup this directory and how to make its usage secure. - -Various display setting ------------------------ - -.. config:option:: $cfg['RepeatCells'] - - :type: integer - :default: 100 - - Repeat the headers every X cells, or 0 to deactivate. - -.. config:option:: $cfg['QueryHistoryDB'] - - :type: boolean - :default: false - -.. config:option:: $cfg['QueryHistoryMax'] - - :type: integer - :default: 25 - - If :config:option:`$cfg['QueryHistoryDB']` is set to ``true``, all your - Queries are logged to a table, which has to be created by you (see - :config:option:`$cfg['Servers'][$i]['history']`). If set to false, all your - queries will be appended to the form, but only as long as your window is - opened they remain saved. - - When using the JavaScript based query window, it will always get updated - when you click on a new table/db to browse and will focus if you click on - :guilabel:`Edit SQL` after using a query. You can suppress updating the - query window by checking the box :guilabel:`Do not overwrite this query - from outside the window` below the query textarea. Then you can browse - tables/databases in the background without losing the contents of the - textarea, so this is especially useful when composing a query with tables - you first have to look in. The checkbox will get automatically checked - whenever you change the contents of the textarea. Please uncheck the button - whenever you definitely want the query window to get updated even though - you have made alterations. - - If :config:option:`$cfg['QueryHistoryDB']` is set to ``true`` you can - specify the amount of saved history items using - :config:option:`$cfg['QueryHistoryMax']`. - -.. config:option:: $cfg['BrowseMIME'] - - :type: boolean - :default: true - - Enable :ref:`transformations`. - -.. config:option:: $cfg['MaxExactCount'] - - :type: integer - :default: 500000 - - For InnoDB tables, determines for how large tables phpMyAdmin should - get the exact row count using ``SELECT COUNT``. If the approximate row - count as returned by ``SHOW TABLE STATUS`` is smaller than this value, - ``SELECT COUNT`` will be used, otherwise the approximate count will be - used. - -.. config:option:: $cfg['MaxExactCountViews'] - - :type: integer - :default: 0 - - For VIEWs, since obtaining the exact count could have an impact on - performance, this value is the maximum to be displayed, using a - ``SELECT COUNT ... LIMIT``. Setting this to 0 bypasses any row - counting. - -.. config:option:: $cfg['NaturalOrder'] - - :type: boolean - :default: true - - Sorts database and table names according to natural order (for - example, t1, t2, t10). Currently implemented in the navigation panel - and in Database view, for the table list. - -.. config:option:: $cfg['InitialSlidersState'] - - :type: string - :default: ``'closed'`` - - If set to ``'closed'``, the visual sliders are initially in a closed - state. A value of ``'open'`` does the reverse. To completely disable - all visual sliders, use ``'disabled'``. - -.. config:option:: $cfg['UserprefsDisallow'] - - :type: array - :default: array() - - Contains names of configuration options (keys in ``$cfg`` array) that - users can't set through user preferences. For possible values, refer - to :file:`libraries/config/user_preferences.forms.php`. - -.. config:option:: $cfg['UserprefsDeveloperTab'] - - :type: boolean - :default: false - - Activates in the user preferences a tab containing options for - developers of phpMyAdmin. - -Page titles ------------ - -.. config:option:: $cfg['TitleTable'] - - :type: string - :default: ``'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@'`` - -.. config:option:: $cfg['TitleDatabase'] - - :type: string - :default: ``'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ | @PHPMYADMIN@'`` - -.. config:option:: $cfg['TitleServer'] - - :type: string - :default: ``'@HTTP_HOST@ / @VSERVER@ | @PHPMYADMIN@'`` - -.. config:option:: $cfg['TitleDefault'] - - :type: string - :default: ``'@HTTP_HOST@ | @PHPMYADMIN@'`` - - Allows you to specify window's title bar. You can use :ref:`faq6_27`. - -Theme manager settings ----------------------- - -.. config:option:: $cfg['ThemePath'] - - :type: string - :default: ``'./themes'`` - - If theme manager is active, use this as the path of the subdirectory - containing all the themes. - -.. config:option:: $cfg['ThemeManager'] - - :type: boolean - :default: true - - Enables user-selectable themes. See :ref:`faqthemes`. - -.. config:option:: $cfg['ThemeDefault'] - - :type: string - :default: ``'pmahomme'`` - - The default theme (a subdirectory under :config:option:`$cfg['ThemePath']`). - -.. config:option:: $cfg['ThemePerServer'] - - :type: boolean - :default: false - - Whether to allow different theme for each server. - -Default queries ---------------- - -.. config:option:: $cfg['DefaultQueryTable'] - - :type: string - :default: ``'SELECT * FROM @TABLE@ WHERE 1'`` - -.. config:option:: $cfg['DefaultQueryDatabase'] - - :type: string - :default: ``''`` - - Default queries that will be displayed in query boxes when user didn't - specify any. You can use standard :ref:`faq6_27`. - - -MySQL settings --------------- - -.. config:option:: $cfg['DefaultFunctions'] - - :type: array - :default: array(...) - - Functions selected by default when inserting/changing row, Functions - are defined for meta types as (FUNC\_NUMBER, FUNC\_DATE, FUNC\_CHAR, - FUNC\_SPATIAL, FUNC\_UUID) and for ``first_timestamp``, which is used - for first timestamp column in table. - - -Developer ---------- - -.. warning:: - - These settings might have huge effect on performance or security. - -.. config:option:: $cfg['DBG'] - - :type: array - :default: array(...) - -.. config:option:: $cfg['DBG']['sql'] - - :type: boolean - :default: false - - Enable logging queries and execution times to be - displayed in the console's Debug SQL tab. - -.. config:option:: $cfg['DBG']['demo'] - - :type: boolean - :default: false - - Enable to let server present itself as demo server. - This is used for . - - -Examples --------- - -See following configuration snippets for usual setups of phpMyAdmin. - -.. _example-google-ssl: - -Google Cloud SQL with SSL -+++++++++++++++++++++++++ - -To connect to Google Could SQL, you currently need to disable certificate -verification. This is caused by the certficate being issued for CN matching -your instance name, but you connect to an IP address and PHP tries to match -these two. With verfication you end up with error message like:: - - Peer certificate CN=`api-project-851612429544:pmatest' did not match expected CN=`8.8.8.8' - -.. warning:: - - With disabled verification your traffic is encrypted, but you're open to - man in the middle attacks. - -To connect phpMyAdmin to Google Cloud SQL using SSL download the client and -server certificates and tell phpMyAdmin to use them: - -.. code-block:: php - - // IP address of your instance - $cfg['Servers'][2]['host'] = '8.8.8.8'; - // Use SSL for connection - $cfg['Servers'][$i]['ssl'] = true; - // Client secret key - $cfg['Servers'][$i]['ssl_key'] = '../client-key.pem'; - // Client certificate - $cfg['Servers'][$i]['ssl_cert'] = '../client-cert.pem'; - // Server certification authority - $cfg['Servers'][$i]['ssl_ca'] = '../server-ca.pem'; - // Disable SSL verification (see above note) - $cfg['Servers'][$i]['ssl_verify'] = false; - -.. seealso:: - - :config:option:`$cfg['Servers'][$i]['ssl']`, - :config:option:`$cfg['Servers'][$i]['ssl_key']`, - :config:option:`$cfg['Servers'][$i]['ssl_cert']`, - :config:option:`$cfg['Servers'][$i]['ssl_ca']`, - :config:option:`$cfg['Servers'][$i]['ssl_verify']` diff --git a/#pma/doc/copyright.rst b/#pma/doc/copyright.rst deleted file mode 100644 index 28f42e6d..00000000 --- a/#pma/doc/copyright.rst +++ /dev/null @@ -1,49 +0,0 @@ -.. _copyright: - -Copyright -========= - -.. code-block:: none - - Copyright (C) 1998-2000 Tobias Ratschiller - Copyright (C) 2001-2014 Marc Delisle - Olivier Müller - Robin Johnson - Alexander M. Turek - Michal Čihař - Garvin Hicking - Michael Keck - Sebastian Mendel - [check credits for more details] - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License version 2, as -published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Third party licenses -++++++++++++++++++++ - -phpMyAdmin includes several third party libraries which come under their -respective licenses. - -jQuery's license, which is where we got the files under js/jquery/ is -(MIT|GPL), a copy of each license is available in this repository (GPL -is available as LICENSE, MIT as js/jquery/MIT-LICENSE.txt). - -TCPDF which is located under libraries/tcpdf is released under GPL -version 3 and the license is available as libraries/tcpdf/LICENSE.TXT. - -DejaVu fonts which are located under libraries/tcpdf/fonts/ and their -license is documented in -libraries/tcpdf/fonts/dejavu-fonts-ttf-2.33/LICENSE. - -PHP-gettext which is located under libraries/php-gettext/ is released -under GPL version 2 license which is available in the LICENSE file. diff --git a/#pma/doc/credits.rst b/#pma/doc/credits.rst deleted file mode 100644 index fed0fd6e..00000000 --- a/#pma/doc/credits.rst +++ /dev/null @@ -1,1111 +0,0 @@ -.. _credits: - -Credits -======= - - -Credits, in chronological order -+++++++++++++++++++++++++++++++ - -* Tobias Ratschiller - - * creator of the phpmyadmin project - - * maintainer from 1998 to summer 2000 - -* Marc Delisle - - * multi-language version in December 1998 - - * various fixes and improvements - - * :term:`SQL` analyser (most of it) - - * current project maintainer - - * maintains content on our website - -* Olivier Müller - - * started SourceForge phpMyAdmin project in March 2001 - - * sync'ed different existing CVS trees with new features and bugfixes - - * multi-language improvements, dynamic language selection - - * many bugfixes and improvements - -* Loïc Chapeaux - - * rewrote and optimized JavaScript, DHTML and DOM stuff - - * rewrote the scripts so they fit the :term:`PEAR` coding standards and - generate XHTML1.0 and CSS2 compliant codes - - * improved the language detection system - - * many bugfixes and improvements - -* Robin Johnson - - * database maintenance controls - - * table type code - - * Host authentication :term:`IP` Allow/Deny - - * DB-based configuration (Not completed) - - * :term:`SQL` parser and pretty-printer - - * :term:`SQL` validator - - * many bugfixes and improvements - -* Armel Fauveau - - * bookmarks feature - - * multiple dump feature - - * gzip dump feature - - * zip dump feature - -* Geert Lund - - * various fixes - - * moderator of the phpMyAdmin former users forum at phpwizard.net - -* Korakot Chaovavanich - - * "insert as new row" feature - -* Pete Kelly - - * rewrote and fix dump code - - * bugfixes - -* Steve Alberty - - * rewrote dump code for PHP4 - - * mySQL table statistics - - * bugfixes - -* Benjamin Gandon - - * main author of the version 2.1.0.1 - - * bugfixes - -* Alexander M. Turek - - * MySQL 4.0 / 4.1 / 5.0 compatibility - - * abstract database interface (PMA\_DBI) with MySQLi support - - * privileges administration - - * :term:`XML` exports - - * various features and fixes - - * German language file updates - -* Mike Beck - - * automatic joins in QBE - - * links column in printview - - * Relation view - -* Michal Čihař - - * enhanced index creation/display feature - - * feature to use a different charset for HTML than for MySQL - - * improvements of export feature - - * various features and fixes - - * Czech language file updates - - * created current website for phpMyAdmin - -* Christophe Gesché from the "MySQL Form Generator for PHPMyAdmin" - (https://sourceforge.net/projects/phpmysqlformgen/) - - * suggested the patch for multiple table printviews - -* Garvin Hicking - - * built the patch for vertical display of table rows - - * built the Javascript based Query window + :term:`SQL` history - - * Improvement of column/db comments - - * (MIME)-Transformations for columns - - * Use custom alias names for Databases in left frame - - * hierarchical/nested table display - - * :term:`PDF`-scratchboard for WYSIWYG- - distribution of :term:`PDF` relations - - * new icon sets - - * vertical display of column properties page - - * some bugfixes, features, support, German language additions - -* Yukihiro Kawada - - * japanese kanji encoding conversion feature - -* Piotr Roszatycki and Dan Wilson - - * the Cookie authentication mode - -* Axel Sander - - * table relation-links feature - -* Maxime Delorme - - * :term:`PDF` schema output, thanks also to - Olivier Plathey for the "FPDF" library (see ), Steven - Wittens for the "UFPDF" library and - Nicola Asuni for the "TCPDF" library (see ). - -* Olof Edlund - - * :term:`SQL` validator server - -* Ivan R. Lanin - - * phpMyAdmin logo (until June 2004) - -* Mike Cochrane - - * blowfish library from the Horde project (withdrawn in release 4.0) - -* Marcel Tschopp - - * mysqli support - - * many bugfixes and improvements - -* Nicola Asuni (Tecnick.com) - - * TCPDF library () - -* Michael Keck - - * redesign for 2.6.0 - - * phpMyAdmin sailboat logo (June 2004) - -* Mathias Landhäußer - - * Representation at conferences - -* Sebastian Mendel - - * interface improvements - - * various bugfixes - -* Ivan A Kirillov - - * new relations Designer - -* Raj Kissu Rajandran (Google Summer of Code 2008) - - * BLOBstreaming support (withdrawn in release 4.0) - -* Piotr Przybylski (Google Summer of Code 2008, 2010 and 2011) - - * improved setup script - - * user preferences - - * Drizzle support - -* Derek Schaefer (Google Summer of Code 2009) - - * Improved the import system - -* Alexander Rutkowski (Google Summer of Code 2009) - - * Tracking mechanism - -* Zahra Naeem (Google Summer of Code 2009) - - * Synchronization feature (removed in release 4.0) - -* Tomáš Srnka (Google Summer of Code 2009) - - * Replication support - -* Muhammad Adnan (Google Summer of Code 2010) - - * Relation schema export to multiple formats - -* Lori Lee (Google Summer of Code 2010) - - * User interface improvements - - * ENUM/SET editor - - * Simplified interface for export/import - -* Ninad Pundalik (Google Summer of Code 2010) - - * AJAXifying the interface - -* Martynas Mickevičius (Google Summer of Code 2010) - - * Charts - -* Barrie Leslie - - * BLOBstreaming support with PBMS PHP extension (withdrawn in release - 4.0) - -* Ankit Gupta (Google Summer of Code 2010) - - * Visual query builder - -* Madhura Jayaratne (Google Summer of Code 2011) - - * OpenGIS support - -* Ammar Yasir (Google Summer of Code 2011) - - * Zoom search - -* Aris Feryanto (Google Summer of Code 2011) - - * Browse-mode improvements - -* Thilanka Kaushalya (Google Summer of Code 2011) - - * AJAXification - -* Tyron Madlener (Google Summer of Code 2011) - - * Query statistics and charts for the status page - -* Zarubin Stas (Google Summer of Code 2011) - - * Automated testing - -* Rouslan Placella (Google Summer of Code 2011 and 2012) - - * Improved support for Stored Routines, Triggers and Events - - * Italian translation updates - - * Removal of frames, new navigation - -* Dieter Adriaenssens - - * Various bugfixes - - * Dutch translation updates - -* Alex Marin (Google Summer of Code 2012) - - * New plugins and properties system - -* Thilina Buddika Abeyrathna (Google Summer of Code 2012) - - * Refactoring - -* Atul Pratap Singh (Google Summer of Code 2012) - - * Refactoring - -* Chanaka Indrajith (Google Summer of Code 2012) - - * Refactoring - -* Yasitha Pandithawatta (Google Summer of Code 2012) - - * Automated testing - -* Jim Wigginton (phpseclib.sourceforge.net) - - * phpseclib - -* Bin Zu (Google Summer of Code 2013) - - * Refactoring - -* Supun Nakandala (Google Summer of Code 2013) - - * Refactoring - -* Mohamed Ashraf (Google Summer of Code 2013) - - * AJAX error reporting - -* Adam Kang (Google Summer of Code 2013) - - * Automated testing - -* Ayush Chaudhary (Google Summer of Code 2013) - - * Automated testing - -* Kasun Chathuranga (Google Summer of Code 2013) - - * Interface improvements - -* Hugues Peccatte - - * Load/save query by example (database search bookmarks) - -* Smita Kumari (Google Summer of Code 2014) - - * Central list of columns - - * Improve table structure (normalization) - -* Ashutosh Dhundhara (Google Summer of Code 2014) - - * Interface improvements - -* Dhananjay Nakrani (Google Summer of Code 2014) - - * PHP error reporting - -* Edward Cheng (Google Summer of Code 2014) - - * SQL Query Console - -* Kankanamge Bimal Yashodha (Google Summer of Code 2014) - - * Refactoring: Designer/schema integration - -* Chirayu Chiripal (Google Summer of Code 2014) - - * Custom field handlers (Input based MIME transformations) - - * Export with table/column name changes - -* Dan Ungureanu (Google Summer of Code 2015) - - * New parser and analyzer - -* Nisarg Jhaveri (Google Summer of Code 2015) - - * Page-related settings - - * SQL debugging integration to the Console - - * Other UI improvements - -* Deven Bansod (Google Summer of Code 2015) - - * Print view using CSS - - * Other UI improvements and new features - -And also to the following people who have contributed minor changes, -enhancements, bugfixes or support for a new language since version -2.1.0: - -Bora Alioglu, Ricardo ?, Sven-Erik Andersen, Alessandro Astarita, -Péter Bakondy, Borges Botelho, Olivier Bussier, Neil Darlow, Mats -Engstrom, Ian Davidson, Laurent Dhima, Kristof Hamann, Thomas Kläger, -Lubos Klokner, Martin Marconcini, Girish Nair, David Nordenberg, -Andreas Pauley, Bernard M. Piller, Laurent Haas, "Sakamoto", Yuval -Sarna, www.securereality.com.au, Alexis Soulard, Alvar Soome, Siu Sun, -Peter Svec, Michael Tacelosky, Rachim Tamsjadi, Kositer Uros, Luís V., -Martijn W. van der Lee, Algis Vainauskas, Daniel Villanueva, Vinay, -Ignacio Vazquez-Abrams, Chee Wai, Jakub Wilk, Thomas Michael -Winningham, Vilius Zigmantas, "Manuzhai". - - -Translators -+++++++++++ - -Following people have contributed to translation of phpMyAdmin: - - - -* Albanian - - * Arben Çokaj - - -* Arabic - - * Ahmed Saleh Abd El-Raouf Ismae - * Ahmed Saad - * hassan mokhtari - - -* Armenian - - * Andrey Aleksanyants - - -* Azerbaijani - - * Mircəlal <01youknowme\_at\_gmail.com> - * Huseyn - * Sevdimali İsa - * Jafar - - -* Belarusian - - * Viktar Palstsiuk - - -* Bulgarian - - * Boyan Kehayov - * Valter Georgiev - * Valentin Mladenov - * P - * krasimir - - -* Catalan - - * josep constanti - * Xavier Navarro - - -* Chinese (China) - - * Vincent Lau <3092849\_at\_qq.com> - * Zheng Dan - * disorderman - * Rex Lee - * - * popcorner - * Yizhou Qiang - * zz - * Terry Weng - * whh - - -* Chinese (Taiwan) - - * Albert Song - * Chien Wei Lin - * LNDDYL - * Peter Dave Hello - - -* Colognian - - * Purodha - - -* Czech - - * Aleš Hakl - * Dalibor Straka - * Martin Vidner - * Ondra Šimeček - * Jan Palider - * Petr Kateřiňák - - -* Danish - - * Aputsiaĸ Niels Janussen - * Dennis Jakobsen - * Jonas - * Claus Svalekjaer - - -* Dutch - - * A. Voogt - * dingo thirteen - * Robin van der Vliet - * Dieter Adriaenssens - * Niko Strijbol - - -* English (United Kingdom) - - * Dries Verschuere - * Francisco Rocha - * Marc Delisle - * Marek Tomaštík - - -* Esperanto - - * Eliovir - * Robin van der Vliet - - -* Estonian - - * Kristjan Räts - - -* Finnish - - * Juha - * Lari Oesch - - -* French - - * Marc Delisle - - -* Frisian - - * Robin van der Vliet - - -* Galician - - * Xosé Calvo - - -* German - - * Julian Ladisch - * Jan Erik Zassenhaus - * Lasse Goericke - * Matthias Bluthardt - * Michael Koch - * Ann + J.M. - * - * Phillip Rohmberger - * Hauke Henningsen - - -* Greek - - * Παναγιώτης Παπάζογλου - - -* Hebrew - - * Moshe Harush - * Yaron Shahrabani - * Eyal Visoker - - -* Hindi - - * Atul Pratap Singh - * Yogeshwar - * Deven Bansod - * Kushagra Pandey - * Nisarg Jhaveri - * Roohan Kazi - * Yugal Pantola - - -* Hungarian - - * Akos Eros - * Dániel Tóth - * Szász Attila - * Balázs Úr - - -* Indonesian - - * Deky Arifianto - * Andika Triwidada - * Dadan Setia - * Dadan Setia - * Yohanes Edwin - * Fadhiil Rachman - * Benny - * Tommy Surbakti - * Zufar Fathi Suhardi - - -* Interlingua - - * Giovanni Sora - - -* Italian - - * Francesco Saverio Giacobazzi - * Marco Pozzato - * Stefano Martinelli - - -* Japanese - - * k725 - * Hiroshi Chiyokawa - * Masahiko HISAKAWA - * worldwideskier - - -* Kannada - - * Robin van der Vliet - * Shameem Ahmed A Mulla - - -* Korean - - * Bumsoo Kim - * Kyeong Su Shin - * Dongyoung Kim - * Myung-han Yu - * JongDeok - * Yong Kim - * 이경준 - * Seongki Shin - * Yoon Bum-Jong - * Koo Youngmin - - -* Kurdish Sorani - - * Alan Hilal - * Aso Naderi - * muhammad - * Zrng Abdulla - - -* Latvian - - * Latvian TV - * Edgars Neimanis - * Ukko - - -* Limburgish - - * Robin van der Vliet - - -* Lithuanian - - * Vytautas Motuzas - - -* Malay - - * Amir Hamzah - * diprofinfiniti - - -* Nepali - - * Nabin Ghimire - - -* Norwegian Bokmål - - * Børge Holm-Wennberg - * Tor Stokkan - * Espen Frøyshov - * Kurt Eilertsen - * Christoffer Haugom - * Sebastian - * Tomas - - -* Persian - - * ashkan shirian - * HM - - -* Polish - - * Andrzej - * Przemo - * Krystian Biesaga - * Maciej Gryniuk - * Michał VonFlynee - - -* Portuguese - - * Alexandre Badalo - * João Rodrigues - * Pedro Ribeiro - * Sandro Amaral - - -* Portuguese (Brazil) - - * Alex Rohleder - * bruno mendax - * Danilo GUia - * Douglas Rafael Morais Kollar - * Douglas Eccker - * Ed Jr - * Guilherme Souza Silva - * Guilherme Seibt - * Helder Santana - * Junior Zancan - * Luis - * Marcos Algeri - * Marc Delisle - * Renato Rodrigues de Lima Júnio - * Thiago Casotti - * Victor Laureano - * Vinícius Araújo - * Washington Bruno Rodrigues Cav - * Yan Gabriel - - -* Punjabi - - * Robin van der Vliet - - -* Romanian - - * Alex - * Costel Cocerhan - * Ion Adrian-Ionut - * Raul Molnar - * Deleted User - * Stefan Murariu - - -* Russian - - * Andrey Aleksanyants - * - * Robin van der Vliet - * Хомутов Иван Сергеевич - * Alexey Rubinov - * Олег Карпов - * Egorov Artyom - - -* Serbian - - * Smart Kid - - -* Sinhala - - * Madhura Jayaratne - - -* Slovak - - * Martin Lacina - * Patrik Kollmann - * Jozef Pistej - - -* Slovenian - - * Domen - - -* Spanish - - * Luis García Sevillano - * Franco - * Luis Ruiz - * Macofe - * Matías Bellone - * Rodrigo A. - * FAMMA TV NOTICIAS MEDIOS DE CO - * Ronnie Simon - - -* Swedish - - * Anders Jonsson - - -* Tamil - - * கணேஷ் குமார் - * Achchuthan Yogarajah - * Rifthy Ahmed - - -* Thai - - * - * Somthanat W. - - -* Turkish - - * Burak Yavuz - - -* Ukrainian - - * Сергій Педько - * Igor - * Vitaliy Perekupka - - -* Vietnamese - - * Bao Phan - * Xuan Hung - * Bao trinh minh - - -* West Flemish - - * Robin van der Vliet - -Documentation translators -+++++++++++++++++++++++++ - -Following people have contributed to translation of phpMyAdmin documentation: - -* Albanian - - * Arben Çokaj - - -* Arabic - - * Ahmed El Azzabi - * Omar Essam - - -* Armenian - - * Andrey Aleksanyants - - -* Azerbaijani - - * Mircəlal <01youknowme\_at\_gmail.com> - * Sevdimali İsa - - -* Catalan - - * josep constanti - * Joan Montané - * Xavier Navarro - - -* Chinese (China) - - * Vincent Lau <3092849\_at\_qq.com> - * 罗攀登 <6375lpd\_at\_gmail.com> - * disorderman - * ITXiaoPang - * tunnel213 - * Terry Weng - * whh - - -* Chinese (Taiwan) - - * Chien Wei Lin - * Peter Dave Hello - - -* Czech - - * Aleš Hakl - * Michal Čihař - * Jan Palider - * Petr Kateřiňák - - -* Danish - - * Aputsiaĸ Niels Janussen - * Claus Svalekjaer - - -* Dutch - - * A. Voogt - * dingo thirteen - * Dries Verschuere - * Robin van der Vliet - * Stefan Koolen - * Ray Borggreve - * Dieter Adriaenssens - * Tom Hofman - - -* Estonian - - * Kristjan Räts - - -* Finnish - - * Juha - - -* French - - * Cédric Corazza - * Étienne Gilli - * Marc Delisle - * Donavan_Martin - - -* Frisian - - * Robin van der Vliet - - -* Galician - - * Xosé Calvo - - -* German - - * Daniel - * JH M - * Lasse Goericke - * Michael Koch - * Ann + J.M. - * Niemand Jedermann - * Phillip Rohmberger - * Hauke Henningsen - - -* Greek - - * Παναγιώτης Παπάζογλου - - -* Hungarian - - * Balázs Úr - - -* Italian - - * Francesco Saverio Giacobazzi - * Marco Pozzato - * Stefano Martinelli - * TWS - - -* Japanese - - * Eshin Kunishima - * Hiroshi Chiyokawa - - -* Lithuanian - - * Jur Kis - * Dovydas - - -* Norwegian Bokmål - - * Tor Stokkan - * Kurt Eilertsen - - -* Portuguese (Brazil) - - * Alexandre Moretti - * Douglas Rafael Morais Kollar - * Guilherme Seibt - * Helder Santana - * Michal Čihař - * Michel Souza - * Danilo Azevedo - * Thiago Casotti - * Vinícius Araújo - * Yan Gabriel - - -* Slovak - - * Martin Lacina - * Michal Čihař - * Jozef Pistej - - -* Slovenian - - * Domen - - -* Spanish - - * Luis García Sevillano - * Franco - * Matías Bellone - * Ronnie Simon - - -* Turkish - - * Burak Yavuz - -Original Credits of Version 2.1.0 -+++++++++++++++++++++++++++++++++ - -This work is based on Peter Kuppelwieser's MySQL-Webadmin. It was his -idea to create a web-based interface to MySQL using PHP3. Although I -have not used any of his source-code, there are some concepts I've -borrowed from him. phpMyAdmin was created because Peter told me he -wasn't going to further develop his (great) tool. - -Thanks go to - -* Amalesh Kempf who contributed the - code for the check when dropping a table or database. He also - suggested that you should be able to specify the primary key on - tbl\_create.php3. To version 1.1.1 he contributed the ldi\_\*.php3-set - (Import text-files) as well as a bug-report. Plus many smaller - improvements. -* Jan Legenhausen : He made many of the changes that - were introduced in 1.3.0 (including quite significant ones like the - authentication). For 1.4.1 he enhanced the table-dump feature. Plus - bug-fixes and help. -* Marc Delisle made phpMyAdmin - language-independent by outsourcing the strings to a separate file. He - also contributed the French translation. -* Alexandr Bravo who contributed - tbl\_select.php3, a feature to display only some columns from a table. -* Chris Jackson added support for MySQL functions - in tbl\_change.php3. He also added the "Query by Example" feature in - 2.0. -* Dave Walton added support for multiple - servers and is a regular contributor for bug-fixes. -* Gabriel Ash contributed the random access - features for 2.0.6. - -The following people have contributed minor changes, enhancements, -bugfixes or support for a new language: - -Jim Kraai, Jordi Bruguera, Miquel Obrador, Geert Lund, Thomas -Kleemann, Alexander Leidinger, Kiko Albiol, Daniel C. Chao, Pavel -Piankov, Sascha Kettler, Joe Pruett, Renato Lins, Mark Kronsbein, -Jannis Hermanns, G. Wieggers. - -And thanks to everyone else who sent me email with suggestions, bug- -reports and or just some feedback. - diff --git a/#pma/doc/developers.rst b/#pma/doc/developers.rst deleted file mode 100644 index 2b2f5868..00000000 --- a/#pma/doc/developers.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. _developers: - -Developers Information -====================== - -phpMyAdmin is Open Source, so you're invited to contribute to it. Many -great features have been written by other people and you too can help -to make phpMyAdmin a useful tool. - -You can check out all the possibilities to contribute in the -`contribute section on our website -`_. diff --git a/#pma/doc/doctrees/config.doctree b/#pma/doc/doctrees/config.doctree deleted file mode 100644 index ea4020d0..00000000 Binary files a/#pma/doc/doctrees/config.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/copyright.doctree b/#pma/doc/doctrees/copyright.doctree deleted file mode 100644 index cc03a3e0..00000000 Binary files a/#pma/doc/doctrees/copyright.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/credits.doctree b/#pma/doc/doctrees/credits.doctree deleted file mode 100644 index df4fca8e..00000000 Binary files a/#pma/doc/doctrees/credits.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/developers.doctree b/#pma/doc/doctrees/developers.doctree deleted file mode 100644 index 03c5c299..00000000 Binary files a/#pma/doc/doctrees/developers.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/environment.pickle b/#pma/doc/doctrees/environment.pickle deleted file mode 100644 index 71c33ee3..00000000 Binary files a/#pma/doc/doctrees/environment.pickle and /dev/null differ diff --git a/#pma/doc/doctrees/faq.doctree b/#pma/doc/doctrees/faq.doctree deleted file mode 100644 index 7d013c8c..00000000 Binary files a/#pma/doc/doctrees/faq.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/glossary.doctree b/#pma/doc/doctrees/glossary.doctree deleted file mode 100644 index 51369210..00000000 Binary files a/#pma/doc/doctrees/glossary.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/import_export.doctree b/#pma/doc/doctrees/import_export.doctree deleted file mode 100644 index 1ef97361..00000000 Binary files a/#pma/doc/doctrees/import_export.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/index.doctree b/#pma/doc/doctrees/index.doctree deleted file mode 100644 index 00734491..00000000 Binary files a/#pma/doc/doctrees/index.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/intro.doctree b/#pma/doc/doctrees/intro.doctree deleted file mode 100644 index 5ac503de..00000000 Binary files a/#pma/doc/doctrees/intro.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/other.doctree b/#pma/doc/doctrees/other.doctree deleted file mode 100644 index 9045c633..00000000 Binary files a/#pma/doc/doctrees/other.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/privileges.doctree b/#pma/doc/doctrees/privileges.doctree deleted file mode 100644 index 01bc7119..00000000 Binary files a/#pma/doc/doctrees/privileges.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/require.doctree b/#pma/doc/doctrees/require.doctree deleted file mode 100644 index 776585d8..00000000 Binary files a/#pma/doc/doctrees/require.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/setup.doctree b/#pma/doc/doctrees/setup.doctree deleted file mode 100644 index 699d1ddc..00000000 Binary files a/#pma/doc/doctrees/setup.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/transformations.doctree b/#pma/doc/doctrees/transformations.doctree deleted file mode 100644 index b929a981..00000000 Binary files a/#pma/doc/doctrees/transformations.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/user.doctree b/#pma/doc/doctrees/user.doctree deleted file mode 100644 index b3dd3256..00000000 Binary files a/#pma/doc/doctrees/user.doctree and /dev/null differ diff --git a/#pma/doc/doctrees/vendors.doctree b/#pma/doc/doctrees/vendors.doctree deleted file mode 100644 index bdbeae39..00000000 Binary files a/#pma/doc/doctrees/vendors.doctree and /dev/null differ diff --git a/#pma/doc/faq.rst b/#pma/doc/faq.rst deleted file mode 100644 index 8acf8440..00000000 --- a/#pma/doc/faq.rst +++ /dev/null @@ -1,2220 +0,0 @@ -.. _faq: - -FAQ - Frequently Asked Questions -================================ - -Please have a look at our `Link section -`_ on the official -phpMyAdmin homepage for in-depth coverage of phpMyAdmin's features and -or interface. - -.. _faqserver: - -Server -++++++ - -.. _faq1_1: - -1.1 My server is crashing each time a specific action is required or phpMyAdmin sends a blank page or a page full of cryptic characters to my browser, what can I do? ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -Try to set the :config:option:`$cfg['OBGzip']` directive to ``false`` in your -:file:`config.inc.php` file and the ``zlib.output_compression`` directive to -``Off`` in your php configuration file. - -.. _faq1_2: - -1.2 My Apache server crashes when using phpMyAdmin. ---------------------------------------------------- - -You should first try the latest versions of Apache (and possibly MySQL). If -your server keeps crashing, please ask for help in the various Apache support -groups. - -.. seealso:: :ref:`faq1_1` - -.. _faq1_3: - -1.3 (withdrawn). ----------------- - -.. _faq1_4: - -1.4 Using phpMyAdmin on IIS, I'm displayed the error message: "The specified CGI application misbehaved by not returning a complete set of HTTP headers ...". -------------------------------------------------------------------------------------------------------------------------------------------------------------- - -You just forgot to read the *install.txt* file from the PHP -distribution. Have a look at the last message in this `PHP bug report #12061 -`_ from the official PHP bug -database. - -.. _faq1_5: - -1.5 Using phpMyAdmin on IIS, I'm facing crashes and/or many error messages with the HTTP. ------------------------------------------------------------------------------------------ - -This is a known problem with the PHP :term:`ISAPI` filter: it's not so stable. -Please use instead the cookie authentication mode. - -.. _faq1_6: - -1.6 I can't use phpMyAdmin on PWS: nothing is displayed! --------------------------------------------------------- - -This seems to be a PWS bug. Filippo Simoncini found a workaround (at -this time there is no better fix): remove or comment the ``DOCTYPE`` -declarations (2 lines) from the scripts :file:`libraries/Header.class.php` -and :file:`index.php`. - -.. _faq1_7: - -1.7 How can I GZip a dump or a CSV export? It does not seem to work. --------------------------------------------------------------------- - -This feature is based on the ``gzencode()`` -PHP function to be more independent of the platform (Unix/Windows, -Safe Mode or not, and so on). So, you must have Zlib support -(``--with-zlib``). - -.. _faq1_8: - -1.8 I cannot insert a text file in a table, and I get an error about safe mode being in effect. ------------------------------------------------------------------------------------------------ - -Your uploaded file is saved by PHP in the "upload dir", as defined in -:file:`php.ini` by the variable ``upload_tmp_dir`` (usually the system -default is */tmp*). We recommend the following setup for Apache -servers running in safe mode, to enable uploads of files while being -reasonably secure: - -* create a separate directory for uploads: :command:`mkdir /tmp/php` -* give ownership to the Apache server's user.group: :command:`chown - apache.apache /tmp/php` -* give proper permission: :command:`chmod 600 /tmp/php` -* put ``upload_tmp_dir = /tmp/php`` in :file:`php.ini` -* restart Apache - -.. _faq1_9: - -1.9 (withdrawn). ----------------- - -.. _faq1_10: - -1.10 I'm having troubles when uploading files with phpMyAdmin running on a secure server. My browser is Internet Explorer and I'm using the Apache server. ----------------------------------------------------------------------------------------------------------------------------------------------------------- - -As suggested by "Rob M" in the phpWizard forum, add this line to your -*httpd.conf*: - -.. code-block:: apache - - SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown - -It seems to clear up many problems between Internet Explorer and SSL. - -.. _faq1_11: - -1.11 I get an 'open\_basedir restriction' while uploading a file from the query box. ------------------------------------------------------------------------------------- - -Since version 2.2.4, phpMyAdmin supports servers with open\_basedir -restrictions. However you need to create temporary directory and configure it -as :config:option:`$cfg['TempDir']`. The uploaded files will be moved there, -and after execution of your :term:`SQL` commands, removed. - -.. _faq1_12: - -1.12 I have lost my MySQL root password, what can I do? -------------------------------------------------------- - -The MySQL manual explains how to `reset the permissions -`_. - -.. _faq1_13: - -1.13 (withdrawn). ------------------ - -.. _faq1_14: - -1.14 (withdrawn). ------------------ - -.. _faq1_15: - -1.15 I have problems with *mysql.user* column names. ----------------------------------------------------- - -In previous MySQL versions, the ``User`` and ``Password``columns were -named ``user`` and ``password``. Please modify your column names to -align with current standards. - -.. _faq1_16: - -1.16 I cannot upload big dump files (memory, HTTP or timeout problems). ------------------------------------------------------------------------ - -Starting with version 2.7.0, the import engine has been re–written and -these problems should not occur. If possible, upgrade your phpMyAdmin -to the latest version to take advantage of the new import features. - -The first things to check (or ask your host provider to check) are the -values of ``upload_max_filesize``, ``memory_limit`` and -``post_max_size`` in the :file:`php.ini` configuration file. All of these -three settings limit the maximum size of data that can be submitted -and handled by PHP. One user also said that ``post_max_size`` and -``memory_limit`` need to be larger than ``upload_max_filesize``. -There exist several workarounds if your upload is too big or your -hosting provider is unwilling to change the settings: - -* Look at the :config:option:`$cfg['UploadDir']` feature. This allows one to upload a file to the server - via scp, ftp, or your favorite file transfer method. PhpMyAdmin is - then able to import the files from the temporary directory. More - information is available in the :ref:`config` of this document. -* Using a utility (such as `BigDump - `_) to split the files before - uploading. We cannot support this or any third party applications, but - are aware of users having success with it. -* If you have shell (command line) access, use MySQL to import the files - directly. You can do this by issuing the "source" command from within - MySQL: - - .. code-block:: mysql - - source filename.sql; - -.. _faq1_17: - -1.17 Which Database versions does phpMyAdmin support? ------------------------------------------------------ - -For `MySQL `_, versions 5.5 and newer are supported. -For older MySQL versions, our `Downloads `_ page offers older phpMyAdmin versions -(which may have become unsupported). - -For `MariaDB `_, versions 5.5 and newer are supported. - -.. _faq1_17a: - -1.17a I cannot connect to the MySQL server. It always returns the error message, "Client does not support authentication protocol requested by server; consider upgrading MySQL client" ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -You tried to access MySQL with an old MySQL client library. The -version of your MySQL client library can be checked in your phpinfo() -output. In general, it should have at least the same minor version as -your server - as mentioned in :ref:`faq1_17`. This problem is -generally caused by using MySQL version 4.1 or newer. MySQL changed -the authentication hash and your PHP is trying to use the old method. -The proper solution is to use the `mysqli extension -`_ with the proper client library to match -your MySQL installation. More -information (and several workarounds) are located in the `MySQL -Documentation `_. - -.. _faq1_18: - -1.18 (withdrawn). ------------------ - -.. _faq1_19: - -1.19 I can't run the "display relations" feature because the script seems not to know the font face I'm using! --------------------------------------------------------------------------------------------------------------- - -The :term:`TCPDF` library we're using for this feature requires some special -files to use font faces. Please refers to the `TCPDF manual -`_ to build these files. - -.. _faqmysql: - -1.20 I receive an error about missing mysqli and mysql extensions. ------------------------------------------------------------------- - -To connect to a MySQL server, PHP needs a set of MySQL functions -called "MySQL extension". This extension may be part of the PHP -distribution (compiled-in), otherwise it needs to be loaded -dynamically. Its name is probably *mysqli.so* or *php\_mysqli.dll*. -phpMyAdmin tried to load the extension but failed. Usually, the -problem is solved by installing a software package called "PHP-MySQL" -or something similar. - -There are currently two interfaces PHP provides as MySQL extensions - ``mysql`` -and ``mysqli``. The ``mysqli`` is tried first, because it's the best one. - -.. _faq1_21: - -1.21 I am running the CGI version of PHP under Unix, and I cannot log in using cookie auth. -------------------------------------------------------------------------------------------- - -In :file:`php.ini`, set ``mysql.max_links`` higher than 1. - -.. _faq1_22: - -1.22 I don't see the "Location of text file" field, so I cannot upload. ------------------------------------------------------------------------ - -This is most likely because in :file:`php.ini`, your ``file_uploads`` -parameter is not set to "on". - -.. _faq1_23: - -1.23 I'm running MySQL on a Win32 machine. Each time I create a new table the table and column names are changed to lowercase! ------------------------------------------------------------------------------------------------------------------------------- - -This happens because the MySQL directive ``lower_case_table_names`` -defaults to 1 (``ON``) in the Win32 version of MySQL. You can change -this behavior by simply changing the directive to 0 (``OFF``): Just -edit your ``my.ini`` file that should be located in your Windows -directory and add the following line to the group [mysqld]: - -.. code-block:: ini - - set-variable = lower_case_table_names=0 - -Next, save the file and restart the MySQL service. You can always -check the value of this directive using the query - -.. code-block:: mysql - - SHOW VARIABLES LIKE 'lower_case_table_names'; - -.. _faq1_24: - -1.24 (withdrawn). ------------------ - -.. _faq1_25: - -1.25 I am running Apache with mod\_gzip-1.3.26.1a on Windows XP, and I get problems, such as undefined variables when I run a SQL query. ----------------------------------------------------------------------------------------------------------------------------------------- - -A tip from Jose Fandos: put a comment on the following two lines in -httpd.conf, like this: - -.. code-block:: apache - - - # mod_gzip_item_include file \.php$ - # mod_gzip_item_include mime "application/x-httpd-php.*" - -as this version of mod\_gzip on Apache (Windows) has problems handling -PHP scripts. Of course you have to restart Apache. - -.. _faq1_26: - -1.26 I just installed phpMyAdmin in my document root of IIS but I get the error "No input file specified" when trying to run phpMyAdmin. ----------------------------------------------------------------------------------------------------------------------------------------- - -This is a permission problem. Right-click on the phpmyadmin folder and -choose properties. Under the tab Security, click on "Add" and select -the user "IUSR\_machine" from the list. Now set his permissions and it -should work. - -.. _faq1_27: - -1.27 I get empty page when I want to view huge page (eg. db\_structure.php with plenty of tables). --------------------------------------------------------------------------------------------------- - -This was caused by a `PHP bug `_ that occur when -GZIP output buffering is enabled. If you turn off it (by -:config:option:`$cfg['OBGzip']` in :file:`config.inc.php`), it should work. -This bug will has been fixed in PHP 5.0.0. - -.. _faq1_28: - -1.28 My MySQL server sometimes refuses queries and returns the message 'Errorcode: 13'. What does this mean? ------------------------------------------------------------------------------------------------------------- - -This can happen due to a MySQL bug when having database / table names -with upper case characters although ``lower_case_table_names`` is -set to 1. To fix this, turn off this directive, convert all database -and table names to lower case and turn it on again. Alternatively, -there's a bug-fix available starting with MySQL 3.23.56 / -4.0.11-gamma. - -.. _faq1_29: - -1.29 When I create a table or modify a column, I get an error and the columns are duplicated. ---------------------------------------------------------------------------------------------- - -It is possible to configure Apache in such a way that PHP has problems -interpreting .php files. - -The problems occur when two different (and conflicting) set of -directives are used: - -.. code-block:: apache - - - SetOutputFilter PHP - SetInputFilter PHP - -and - -.. code-block:: apache - - AddType application/x-httpd-php .php - -In the case we saw, one set of directives was in -``/etc/httpd/conf/httpd.conf``, while the other set was in -``/etc/httpd/conf/addon-modules/php.conf``. The recommended way is -with ``AddType``, so just comment out the first set of lines and -restart Apache: - -.. code-block:: apache - - - #SetOutputFilter PHP - #SetInputFilter PHP - -.. _faq1_30: - -1.30 I get the error "navigation.php: Missing hash". ----------------------------------------------------- - -This problem is known to happen when the server is running Turck -MMCache but upgrading MMCache to version 2.3.21 solves the problem. - -.. _faq1_31: - -1.31 Does phpMyAdmin support PHP 5? ------------------------------------ - -Yes. - -Since release 4.5, phpMyAdmin supports only PHP 5.5 and newer. Since release 4.1 phpMyAdmin supports only PHP 5.3 and newer. For PHP 5.2 you can use 4.0.x releases. - -.. _faq1_32: - -1.32 Can I use HTTP authentication with IIS? --------------------------------------------- - -Yes. This procedure was tested with phpMyAdmin 2.6.1, PHP 4.3.9 in -:term:`ISAPI` mode under :term:`IIS` 5.1. - -#. In your :file:`php.ini` file, set ``cgi.rfc2616_headers = 0`` -#. In ``Web Site Properties -> File/Directory Security -> Anonymous - Access`` dialog box, check the ``Anonymous access`` checkbox and - uncheck any other checkboxes (i.e. uncheck ``Basic authentication``, - ``Integrated Windows authentication``, and ``Digest`` if it's - enabled.) Click ``OK``. -#. In ``Custom Errors``, select the range of ``401;1`` through ``401;5`` - and click the ``Set to Default`` button. - -.. seealso:: :rfc:`2616` - -.. _faq1_33: - -1.33 (withdrawn). ------------------ - -.. _faq1_34: - -1.34 Can I access directly to database or table pages? ------------------------------------------------------- - -Yes. Out of the box, you can use :term:`URL` like -https://example.com/phpMyAdmin/index.php?server=X&db=database&table=table&target=script. -For ``server`` you use the server number -which refers to the order of the server paragraph in -:file:`config.inc.php`. Table and script parts are optional. If you want -https://example.com/phpMyAdmin/database[/table][/script] :term:`URL`, you need to do some configuration. Following -lines apply only for `Apache `_ web server. -First make sure, that you have enabled some features within global -configuration. You need ``Options SymLinksIfOwnerMatch`` and ``AllowOverride -FileInfo`` enabled for directory where phpMyAdmin is installed and you -need mod\_rewrite to be enabled. Then you just need to create -following :term:`.htaccess` file in root folder of phpMyAdmin installation (don't -forget to change directory name inside of it): - -.. code-block:: apache - - - RewriteEngine On - RewriteBase /path_to_phpMyAdmin - RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&table=$2&target=$3 [R] - RewriteRule ^([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&target=$2 [R] - RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index.php?db=$1&table=$2 [R] - RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R] - -.. _faq1_35: - -1.35 Can I use HTTP authentication with Apache CGI? ---------------------------------------------------- - -Yes. However you need to pass authentication variable to :term:`CGI` using -following rewrite rule: - -.. code-block:: apache - - - RewriteEngine On - RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L] - -.. _faq1_36: - -1.36 I get an error "500 Internal Server Error". ------------------------------------------------- - -There can be many explanations to this and a look at your server's -error log file might give a clue. - -.. _faq1_37: - -1.37 I run phpMyAdmin on cluster of different machines and password encryption in cookie auth doesn't work. ------------------------------------------------------------------------------------------------------------ - -If your cluster consist of different architectures, PHP code used for -encryption/decryption won't work correct. This is caused by use of -pack/unpack functions in code. Only solution is to use mcrypt -extension which works fine in this case. - -.. _faq1_38: - -1.38 Can I use phpMyAdmin on a server on which Suhosin is enabled? ------------------------------------------------------------------- - -Yes but the default configuration values of Suhosin are known to cause -problems with some operations, for example editing a table with many -columns and no primary key or with textual primary key. - -Suhosin configuration might lead to malfunction in some cases and it -can not be fully avoided as phpMyAdmin is kind of application which -needs to transfer big amounts of columns in single HTTP request, what -is something what Suhosin tries to prevent. Generally all -``suhosin.request.*``, ``suhosin.post.*`` and ``suhosin.get.*`` -directives can have negative effect on phpMyAdmin usability. You can -always find in your error logs which limit did cause dropping of -variable, so you can diagnose the problem and adjust matching -configuration variable. - -The default values for most Suhosin configuration options will work in -most scenarios, however you might want to adjust at least following -parameters: - -* `suhosin.request.max\_vars `_ should - be increased (eg. 2048) -* `suhosin.post.max\_vars `_ should be - increased (eg. 2048) -* `suhosin.request.max\_array\_index\_length `_ - should be increased (eg. 256) -* `suhosin.post.max\_array\_index\_length `_ - should be increased (eg. 256) -* `suhosin.request.max\_totalname\_length `_ - should be increased (eg. 8192) -* `suhosin.post.max\_totalname\_length `_ should be - increased (eg. 8192) -* `suhosin.get.max\_value\_length `_ - should be increased (eg. 1024) -* `suhosin.sql.bailout\_on\_error `_ - needs to be disabled (the default) -* `suhosin.log.\* `_ should not - include :term:`SQL`, otherwise you get big - slowdown - -You can also disable the warning using the :config:option:`$cfg['SuhosinDisableWarning']`. - -.. _faq1_39: - -1.39 When I try to connect via https, I can log in, but then my connection is redirected back to http. What can cause this behavior? ------------------------------------------------------------------------------------------------------------------------------------- - -Be sure that you have enabled ``SSLOptions`` and ``StdEnvVars`` in -your Apache configuration. - -.. seealso:: - -.. _faq1_40: - -1.40 When accessing phpMyAdmin via an Apache reverse proxy, cookie login does not work. ---------------------------------------------------------------------------------------- - -To be able to use cookie auth Apache must know that it has to rewrite -the set-cookie headers. Example from the Apache 2.2 documentation: - -.. code-block:: apache - - - ProxyPass /mirror/foo/ http://backend.example.com/ - ProxyPassReverse /mirror/foo/ http://backend.example.com/ - ProxyPassReverseCookieDomain backend.example.com public.example.com - ProxyPassReverseCookiePath / /mirror/foo/ - -Note: if the backend url looks like https://example.com/~user/phpmyadmin, the -tilde (~) must be url encoded as %7E in the ProxyPassReverse\* lines. -This is not specific to phpmyadmin, it's just the behavior of Apache. - -.. code-block:: apache - - - ProxyPass /mirror/foo/ http://backend.example.com/~user/phpmyadmin - ProxyPassReverse /mirror/foo/ http://backend.example.com/%7Euser/phpmyadmin - ProxyPassReverseCookiePath /%7Euser/phpmyadmin /mirror/foo - -.. seealso:: , :config:option:`$cfg['PmaAbsoluteUri']` - -.. _faq1_41: - -1.41 When I view a database and ask to see its privileges, I get an error about an unknown column. --------------------------------------------------------------------------------------------------- - -The MySQL server's privilege tables are not up to date, you need to -run the :command:`mysql_upgrade` command on the server. - -.. _faq1_42: - -1.42 How can I prevent robots from accessing phpMyAdmin? --------------------------------------------------------- - -You can add various rules to :term:`.htaccess` to filter access based on user agent -field. This is quite easy to circumvent, but could prevent at least -some robots accessing your installation. - -.. code-block:: apache - - - RewriteEngine on - - # Allow only GET and POST verbs - RewriteCond %{REQUEST_METHOD} !^(GET|POST)$ [NC,OR] - - # Ban Typical Vulnerability Scanners and others - # Kick out Script Kiddies - RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR] - RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|curl|wget|python|nikto|wkito|pikto|scan|acunetix).* [NC,OR] - RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner).* [NC,OR] - - # Ban Search Engines, Crawlers to your administrative panel - # No reasons to access from bots - # Ultimately Better than the useless robots.txt - # Did google respect robots.txt? - # Try google: intitle:phpMyAdmin intext:"Welcome to phpMyAdmin *.*.*" intext:"Log in" -wiki -forum -forums -questions intext:"Cookies must be enabled" - RewriteCond %{HTTP_USER_AGENT} ^.*(AdsBot-Google|ia_archiver|Scooter|Ask.Jeeves|Baiduspider|Exabot|FAST.Enterprise.Crawler|FAST-WebCrawler|www\.neomo\.de|Gigabot|Mediapartners-Google|Google.Desktop|Feedfetcher-Google|Googlebot|heise-IT-Markt-Crawler|heritrix|ibm.com\cs/crawler|ICCrawler|ichiro|MJ12bot|MetagerBot|msnbot-NewsBlogs|msnbot|msnbot-media|NG-Search|lucene.apache.org|NutchCVS|OmniExplorer_Bot|online.link.validator|psbot0|Seekbot|Sensis.Web.Crawler|SEO.search.Crawler|Seoma.\[SEO.Crawler\]|SEOsearch|Snappy|www.urltrends.com|www.tkl.iis.u-tokyo.ac.jp/~crawler|SynooBot|crawleradmin.t-info@telekom.de|TurnitinBot|voyager|W3.SiteSearch.Crawler|W3C-checklink|W3C_Validator|www.WISEnutbot.com|yacybot|Yahoo-MMCrawler|Yahoo\!.DE.Slurp|Yahoo\!.Slurp|YahooSeeker).* [NC] - RewriteRule .* - [F] - -.. _faq1_43: - -1.43 Why can't I display the structure of my table containing hundreds of columns? ----------------------------------------------------------------------------------- - -Because your PHP's ``memory_limit`` is too low; adjust it in :file:`php.ini`. - -.. _faq1:44: - -1.44 How can I reduce the installed size of phpMyAdmin on disk? ---------------------------------------------------------------- - -Some users have requested to be able to reduce the size of the phpMyAdmin installation. -This is not recommended and could lead to confusion over missing features, but can be done. -A list of files and corresponding functionality which degrade gracefully when removed include: - -* :file:`./libraries/tcpdf` folder (exporting to PDF) -* :file:`./locale/` folder, or unused subfolders (interface translations) -* Any unused themes in :file:`./themes/` -* :file:`./js/jquery/src/` (included for licensing reasons) -* :file:`./js/line_counts.php` -* :file:`./doc/` (documentation) -* :file:`./setup/` (setup script) -* :file:`./examples/` -* :file:`./sql/` (SQL scripts to configure advanced functionality) - -.. _faqconfig: - -Configuration -+++++++++++++ - -.. _faq2_1: - -2.1 The error message "Warning: Cannot add header information - headers already sent by ..." is displayed, what's the problem? ------------------------------------------------------------------------------------------------------------------------------- - -Edit your :file:`config.inc.php` file and ensure there is nothing (I.E. no -blank lines, no spaces, no characters...) neither before the ```` tag at the end. We also got a report -from a user under :term:`IIS`, that used a zipped distribution kit: the file -:file:`libraries/Config.class.php` contained an end-of-line character (hex 0A) -at the end; removing this character cleared his errors. - -.. _faq2_2: - -2.2 phpMyAdmin can't connect to MySQL. What's wrong? ----------------------------------------------------- - -Either there is an error with your PHP setup or your username/password -is wrong. Try to make a small script which uses mysql\_connect and see -if it works. If it doesn't, it may be you haven't even compiled MySQL -support into PHP. - -.. _faq2_3: - -2.3 The error message "Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) ..." is displayed. What can I do? ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -For RedHat users, Harald Legner suggests this on the mailing list: - -On my RedHat-Box the socket of MySQL is */var/lib/mysql/mysql.sock*. -In your :file:`php.ini` you will find a line - -.. code-block:: ini - - mysql.default_socket = /tmp/mysql.sock - -change it to - -.. code-block:: ini - - mysql.default_socket = /var/lib/mysql/mysql.sock - -Then restart apache and it will work. - -Here is a fix suggested by Brad Ummer: - -* First, you need to determine what socket is being used by MySQL. To do - this, telnet to your server and go to the MySQL bin directory. In this - directory there should be a file named *mysqladmin*. Type - ``./mysqladmin variables``, and this should give you a bunch of info - about your MySQL server, including the socket (*/tmp/mysql.sock*, for - example). -* Then, you need to tell PHP to use this socket. To do this in - phpMyAdmin, you need to complete the socket information in the - :file:`config.inc.php`. For example: - :config:option:`$cfg['Servers'][$i]['socket']` Please also make sure that - the permissions of this file allow to be readable by your webserver (i.e. - '0755'). - -Have also a look at the `corresponding section of the MySQL -documentation `_. - -.. _faq2_4: - -2.4 Nothing is displayed by my browser when I try to run phpMyAdmin, what can I do? ------------------------------------------------------------------------------------ - -Try to set the :config:option:`$cfg['OBGzip']` directive to ``false`` in the phpMyAdmin configuration -file. It helps sometime. Also have a look at your PHP version number: -if it contains "b" or "alpha" it means you're running a testing -version of PHP. That's not a so good idea, please upgrade to a plain -revision. - -.. _faq2_5: - -2.5 Each time I want to insert or change a row or drop a database or a table, an error 404 (page not found) is displayed or, with HTTP or cookie authentication, I'm asked to log in again. What's wrong? ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -Check your webserver setup if it correctly fills in either PHP_SELF or REQUEST_URI variables. - -If you are running phpMyAdmin behind reverse proxy, please set the -:config:option:`$cfg['PmaAbsoluteUri']` directive in the phpMyAdmin -configuration file to match your setup. - -.. _faq2_6: - -2.6 I get an "Access denied for user: 'root@localhost' (Using password: YES)"-error when trying to access a MySQL-Server on a host which is port-forwarded for my localhost. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -When you are using a port on your localhost, which you redirect via -port-forwarding to another host, MySQL is not resolving the localhost -as expected. Erik Wasser explains: The solution is: if your host is -"localhost" MySQL (the command line tool :command:`mysql` as well) always -tries to use the socket connection for speeding up things. And that -doesn't work in this configuration with port forwarding. If you enter -"127.0.0.1" as hostname, everything is right and MySQL uses the -:term:`TCP` connection. - -.. _faqthemes: - -2.7 Using and creating themes ------------------------------ - -Themes are configured with :config:option:`$cfg['ThemePath']`, -:config:option:`$cfg['ThemeManager']` and :config:option:`$cfg['ThemeDefault']`. -Under :config:option:`$cfg['ThemePath']`, you should not delete the -directory ``pmahomme`` or its underlying structure, because this is the -system theme used by phpMyAdmin. ``pmahomme`` contains all images and -styles, for backwards compatibility and for all themes that would not -include images or css-files. If :config:option:`$cfg['ThemeManager']` -is enabled, you can select your favorite theme on the main page. Your selected -theme will be stored in a cookie. - -To create a theme: - -* make a new subdirectory (for example "your\_theme\_name") under :config:option:`$cfg['ThemePath']` (by - default ``themes``) -* copy the files and directories from ``pmahomme`` to "your\_theme\_name" -* edit the css-files in "your\_theme\_name/css" -* put your new images in "your\_theme\_name/img" -* edit :file:`layout.inc.php` in "your\_theme\_name" -* edit :file:`info.inc.php` in "your\_theme\_name" to contain your chosen - theme name, that will be visible in user interface -* make a new screenshot of your theme and save it under - "your\_theme\_name/screen.png" - -In theme directory there is file :file:`info.inc.php` which contains theme -verbose name, theme generation and theme version. These versions and -generations are enumerated from 1 and do not have any direct -dependence on phpMyAdmin version. Themes within same generation should -be backwards compatible - theme with version 2 should work in -phpMyAdmin requiring version 1. Themes with different generation are -incompatible. - -If you do not want to use your own symbols and buttons, remove the -directory "img" in "your\_theme\_name". phpMyAdmin will use the -default icons and buttons (from the system-theme ``pmahomme``). - -.. _faqmissingparameters: - -2.8 I get "Missing parameters" errors, what can I do? ------------------------------------------------------ - -Here are a few points to check: - -* In :file:`config.inc.php`, try to leave the :config:option:`$cfg['PmaAbsoluteUri']` directive empty. See also - :ref:`faq4_7`. -* Maybe you have a broken PHP installation or you need to upgrade your - Zend Optimizer. See . -* If you are using Hardened PHP with the ini directive - ``varfilter.max_request_variables`` set to the default (200) or - another low value, you could get this error if your table has a high - number of columns. Adjust this setting accordingly. (Thanks to Klaus - Dorninger for the hint). -* In the :file:`php.ini` directive ``arg_separator.input``, a value of ";" - will cause this error. Replace it with "&;". -* If you are using `Hardened-PHP `_, you - might want to increase `request limits `_. -* The directory specified in the :file:`php.ini` directive - ``session.save_path`` does not exist or is read-only. - -.. _faq2_9: - -2.9 Seeing an upload progress bar ---------------------------------- - -To be able to see a progress bar during your uploads, your server must -have the `APC `_ extension, the -`uploadprogress `_ one, or -you must be running PHP 5.4.0 or higher. Moreover, the JSON extension -has to be enabled in your PHP. - -If using APC, you must set ``apc.rfc1867`` to ``on`` in your :file:`php.ini`. - -If using PHP 5.4.0 or higher, you must set -``session.upload_progress.enabled`` to ``1`` in your :file:`php.ini`. However, -starting from phpMyAdmin version 4.0.4, session-based upload progress has -been temporarily deactivated due to its problematic behavior. - -.. seealso:: :rfc:`1867` - -.. _faqlimitations: - -Known limitations -+++++++++++++++++ - -.. _login_bug: - -3.1 When using HTTP authentication, a user who logged out can not log in again in with the same nick. ------------------------------------------------------------------------------------------------------ - -This is related to the authentication mechanism (protocol) used by -phpMyAdmin. To bypass this problem: just close all the opened browser -windows and then go back to phpMyAdmin. You should be able to log in -again. - -.. _faq3_2: - -3.2 When dumping a large table in compressed mode, I get a memory limit error or a time limit error. ----------------------------------------------------------------------------------------------------- - -Compressed dumps are built in memory and because of this are limited -to php's memory limit. For GZip/BZip2 exports this can be overcome -since 2.5.4 using :config:option:`$cfg['CompressOnFly']` (enabled by default). -Zip exports can not be handled this way, so if you need Zip files for larger -dump, you have to use another way. - -.. _faq3_3: - -3.3 With InnoDB tables, I lose foreign key relationships when I rename a table or a column. -------------------------------------------------------------------------------------------- - -This is an InnoDB bug, see . - -.. _faq3_4: - -3.4 I am unable to import dumps I created with the mysqldump tool bundled with the MySQL server distribution. -------------------------------------------------------------------------------------------------------------- - -The problem is that older versions of ``mysqldump`` created invalid -comments like this: - -.. code-block:: mysql - - - -- MySQL dump 8.22 - -- - -- Host: localhost Database: database - --------------------------------------------------------- - -- Server version 3.23.54 - -The invalid part of the code is the horizontal line made of dashes -that appears once in every dump created with mysqldump. If you want to -run your dump you have to turn it into valid MySQL. This means, you -have to add a whitespace after the first two dashes of the line or add -a # before it: ``-- -------------------------------------------------------`` or -``#---------------------------------------------------------`` - -.. _faq3_5: - -3.5 When using nested folders, multiple hierarchies are displayed in a wrong manner. ------------------------------------------------------------------------------------- - -Please note that you should not use the separating string multiple -times without any characters between them, or at the beginning/end of -your table name. If you have to, think about using another -TableSeparator or disabling that feature. - -.. seealso:: :config:option:`$cfg['NavigationTreeTableSeparator']` - -.. _faq3_6: - -3.6 (withdrawn). ------------------ - -.. _faq3_7: - -3.7 I have table with many (100+) columns and when I try to browse table I get series of errors like "Warning: unable to parse url". How can this be fixed? ------------------------------------------------------------------------------------------------------------------------------------------------------------ - -Your table neither have a primary key nor an unique one, so we must -use a long expression to identify this row. This causes problems to -parse\_url function. The workaround is to create a primary or unique -key. - -.. _faq3_8: - -3.8 I cannot use (clickable) HTML-forms in columns where I put a MIME-Transformation onto! ------------------------------------------------------------------------------------------- - -Due to a surrounding form-container (for multi-row delete checkboxes), -no nested forms can be put inside the table where phpMyAdmin displays -the results. You can, however, use any form inside of a table if keep -the parent form-container with the target to tbl\_row\_delete.php and -just put your own input-elements inside. If you use a custom submit -input field, the form will submit itself to the displaying page again, -where you can validate the $HTTP\_POST\_VARS in a transformation. For -a tutorial on how to effectively use transformations, see our `Link -section `_ on the -official phpMyAdmin-homepage. - -.. _faq3_9: - -3.9 I get error messages when using "--sql\_mode=ANSI" for the MySQL server. ----------------------------------------------------------------------------- - -When MySQL is running in ANSI-compatibility mode, there are some major -differences in how :term:`SQL` is structured (see -). Most important of all, the -quote-character (") is interpreted as an identifier quote character and not as -a string quote character, which makes many internal phpMyAdmin operations into -invalid :term:`SQL` statements. There is no -workaround to this behaviour. News to this item will be posted in `Bug report -#1013 `_. - -.. _faq3_10: - -3.10 Homonyms and no primary key: When the results of a SELECT display more that one column with the same value (for example ``SELECT lastname from employees where firstname like 'A%'`` and two "Smith" values are displayed), if I click Edit I cannot be sure that I am editing the intended row. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - -Please make sure that your table has a primary key, so that phpMyAdmin -can use it for the Edit and Delete links. - -.. _faq3_11: - -3.11 The number of rows for InnoDB tables is not correct. ---------------------------------------------------------- - -phpMyAdmin uses a quick method to get the row count, and this method only -returns an approximate count in the case of InnoDB tables. See -:config:option:`$cfg['MaxExactCount']` for a way to modify those results, but -this could have a serious impact on performance. -However, one can easily replace the approximate row count with exact count by -simply clicking on the approximate count. This can also be done for all tables -at once by clicking on the rows sum displayed at the bottom. - -.. _faq3_12: - -3.12 (withdrawn). ------------------ - -.. _faq3_13: - -3.13 I get an error when entering ``USE`` followed by a db name containing an hyphen. -------------------------------------------------------------------------------------- - -The tests I have made with MySQL 5.1.49 shows that the API does not -accept this syntax for the USE command. - -.. _faq3_14: - -3.14 I am not able to browse a table when I don't have the right to SELECT one of the columns. ----------------------------------------------------------------------------------------------- - -This has been a known limitation of phpMyAdmin since the beginning and -it's not likely to be solved in the future. - -.. _faq3_15: - -3.15 (withdrawn). ------------------ - -.. _faq3_16: - -3.16 (withdrawn). ------------------ - -.. _faq3_17: - -3.17 (withdrawn). ------------------ - -.. _faq3_18: - -3.18 When I import a CSV file that contains multiple tables, they are lumped together into a single table. ----------------------------------------------------------------------------------------------------------- - -There is no reliable way to differentiate tables in :term:`CSV` format. For the -time being, you will have to break apart :term:`CSV` files containing multiple -tables. - -.. _faq3_19: - -3.19 When I import a file and have phpMyAdmin determine the appropriate data structure it only uses int, decimal, and varchar types. ------------------------------------------------------------------------------------------------------------------------------------- - -Currently, the import type-detection system can only assign these -MySQL types to columns. In future, more will likely be added but for -the time being you will have to edit the structure to your liking -post-import. Also, you should note the fact that phpMyAdmin will use -the size of the largest item in any given column as the column size -for the appropriate type. If you know you will be adding larger items -to that column then you should manually adjust the column sizes -accordingly. This is done for the sake of efficiency. - -.. _faq3_20: - -3.20 After upgrading, some bookmarks are gone or their content cannot be shown. -------------------------------------------------------------------------------- - -At some point, the character set used to store bookmark content has changed. -It's better to recreate your bookmark from the newer phpMyAdmin version. - -.. _faqmultiuser: - -ISPs, multi-user installations -++++++++++++++++++++++++++++++ - -.. _faq4_1: - -4.1 I'm an ISP. Can I setup one central copy of phpMyAdmin or do I need to install it for each customer? --------------------------------------------------------------------------------------------------------- - -Since version 2.0.3, you can setup a central copy of phpMyAdmin for all your -users. The development of this feature was kindly sponsored by NetCologne GmbH. -This requires a properly setup MySQL user management and phpMyAdmin -:term:`HTTP` or cookie authentication. - -.. seealso:: :ref:`authentication_modes` - -.. _faq4_2: - -4.2 What's the preferred way of making phpMyAdmin secure against evil access? ------------------------------------------------------------------------------ - -This depends on your system. If you're running a server which cannot be -accessed by other people, it's sufficient to use the directory protection -bundled with your webserver (with Apache you can use :term:`.htaccess` files, -for example). If other people have telnet access to your server, you should use -phpMyAdmin's :term:`HTTP` or cookie authentication features. - -Suggestions: - -* Your :file:`config.inc.php` file should be ``chmod 660``. -* All your phpMyAdmin files should be chown -R phpmy.apache, where phpmy - is a user whose password is only known to you, and apache is the group - under which Apache runs. -* Follow security recommendations for PHP and your webserver. - -.. _faq4_3: - -4.3 I get errors about not being able to include a file in */lang* or in */libraries*. --------------------------------------------------------------------------------------- - -Check :file:`php.ini`, or ask your sysadmin to check it. The -``include_path`` must contain "." somewhere in it, and -``open_basedir``, if used, must contain "." and "./lang" to allow -normal operation of phpMyAdmin. - -.. _faq4_4: - -4.4 phpMyAdmin always gives "Access denied" when using HTTP authentication. ---------------------------------------------------------------------------- - -This could happen for several reasons: - -* :config:option:`$cfg['Servers'][$i]['controluser']` and/or :config:option:`$cfg['Servers'][$i]['controlpass']` are wrong. -* The username/password you specify in the login dialog are invalid. -* You have already setup a security mechanism for the phpMyAdmin- - directory, eg. a :term:`.htaccess` file. This would interfere with phpMyAdmin's - authentication, so remove it. - -.. _faq4_5: - -4.5 Is it possible to let users create their own databases? ------------------------------------------------------------ - -Starting with 2.2.5, in the user management page, you can enter a -wildcard database name for a user (for example "joe%"), and put the -privileges you want. For example, adding ``SELECT, INSERT, UPDATE, -DELETE, CREATE, DROP, INDEX, ALTER`` would let a user create/manage -his/her database(s). - -.. _faq4_6: - -4.6 How can I use the Host-based authentication additions? ----------------------------------------------------------- - -If you have existing rules from an old :term:`.htaccess` file, you can take them and -add a username between the ``'deny'``/``'allow'`` and ``'from'`` -strings. Using the username wildcard of ``'%'`` would be a major -benefit here if your installation is suited to using it. Then you can -just add those updated lines into the -:config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` array. - -If you want a pre-made sample, you can try this fragment. It stops the -'root' user from logging in from any networks other than the private -network :term:`IP` blocks. - -.. code-block:: php - - - //block root from logging in except from the private networks - $cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow'; - $cfg['Servers'][$i]['AllowDeny']['rules'] = array( - 'deny root from all', - 'allow root from localhost', - 'allow root from 10.0.0.0/8', - 'allow root from 192.168.0.0/16', - 'allow root from 172.16.0.0/12', - ); - -.. _faq4_7: - -4.7 Authentication window is displayed more than once, why? ------------------------------------------------------------ - -This happens if you are using a :term:`URL` to start phpMyAdmin which is -different than the one set in your :config:option:`$cfg['PmaAbsoluteUri']`. For -example, a missing "www", or entering with an :term:`IP` address while a domain -name is defined in the config file. - -.. _faq4_8: - -4.8 Which parameters can I use in the URL that starts phpMyAdmin? ------------------------------------------------------------------ - -When starting phpMyAdmin, you can use the ``db``, ``pma_username``, -``pma_password`` and ``server`` parameters. This last one can contain -either the numeric host index (from ``$i`` of the configuration file) -or one of the host names present in the configuration file. Using -``pma_username`` and ``pma_password`` has been tested along with the -usage of 'cookie' ``auth_type``. - -.. _faqbrowsers: - -Browsers or client OS -+++++++++++++++++++++ - -.. _faq5_1: - -5.1 I get an out of memory error, and my controls are non-functional, when trying to create a table with more than 14 columns. ------------------------------------------------------------------------------------------------------------------------------- - -We could reproduce this problem only under Win98/98SE. Testing under -WinNT4 or Win2K, we could easily create more than 60 columns. A -workaround is to create a smaller number of columns, then come back to -your table properties and add the other columns. - -.. _faq5_2: - -5.2 With Xitami 2.5b4, phpMyAdmin won't process form fields. ------------------------------------------------------------- - -This is not a phpMyAdmin problem but a Xitami known bug: you'll face -it with each script/website that use forms. Upgrade or downgrade your -Xitami server. - -.. _faq5_3: - -5.3 I have problems dumping tables with Konqueror (phpMyAdmin 2.2.2). ---------------------------------------------------------------------- - -With Konqueror 2.1.1: plain dumps, zip and GZip dumps work ok, except -that the proposed file name for the dump is always 'tbl\_dump.php'. -Bzip2 dumps don't seem to work. With Konqueror 2.2.1: plain dumps -work; zip dumps are placed into the user's temporary directory, so -they must be moved before closing Konqueror, or else they disappear. -GZip dumps give an error message. Testing needs to be done for -Konqueror 2.2.2. - -.. _faq5_4: - -5.4 I can't use the cookie authentication mode because Internet Explorer never stores the cookies. --------------------------------------------------------------------------------------------------- - -MS Internet Explorer seems to be really buggy about cookies, at least -till version 6. - -.. _faq5_5: - -5.5 In Internet Explorer 5.0, I get JavaScript errors when browsing my rows. ----------------------------------------------------------------------------- - -Upgrade to at least Internet Explorer 5.5 SP2. - -.. _faq5_6: - -5.6 In Internet Explorer 5.0, 5.5 or 6.0, I get an error (like "Page not found") when trying to modify a row in a table with many columns, or with a text column. ------------------------------------------------------------------------------------------------------------------------------------------------------------------ - -Your table neither have a primary key nor an unique one, so we must use a long -:term:`URL` to identify this row. There is a limit on the length of the -:term:`URL` in those browsers, and this not happen in Netscape, for example. -The workaround is to create a primary or unique key, or use another browser. - -.. _faq5_7: - -5.7 I refresh (reload) my browser, and come back to the welcome page. ---------------------------------------------------------------------- - -Some browsers support right-clicking into the frame you want to -refresh, just do this in the right frame. - -.. _faq5_8: - -5.8 With Mozilla 0.9.7 I have problems sending a query modified in the query box. ---------------------------------------------------------------------------------- - -Looks like a Mozilla bug: 0.9.6 was OK. We will keep an eye on future -Mozilla versions. - -.. _faq5_9: - -5.9 With Mozilla 0.9.? to 1.0 and Netscape 7.0-PR1 I can't type a whitespace in the SQL-Query edit area: the page scrolls down. -------------------------------------------------------------------------------------------------------------------------------- - -This is a Mozilla bug (see bug #26882 at `BugZilla -`_). - -.. _faq5_10: - -5.10 With Netscape 4.75 I get empty rows between each row of data in a CSV exported file. ------------------------------------------------------------------------------------------ - -This is a known Netscape 4.75 bug: it adds some line feeds when -exporting data in octet-stream mode. Since we can't detect the -specific Netscape version, we cannot workaround this bug. - -.. _faq5_11: - -5.11 Extended-ASCII characters like German umlauts are displayed wrong. ------------------------------------------------------------------------ - -Please ensure that you have set your browser's character set to the -one of the language file you have selected on phpMyAdmin's start page. -Alternatively, you can try the auto detection mode that is supported -by the recent versions of the most browsers. - -.. _faq5_12: - -5.12 Mac OS X Safari browser changes special characters to "?". ---------------------------------------------------------------- - -This issue has been reported by a :term:`Mac OS X` user, who adds that Chimera, -Netscape and Mozilla do not have this problem. - -.. _faq5_13: - -5.13 With Internet Explorer 5.5 or 6, and HTTP authentication type, I cannot manage two servers: I log in to the first one, then the other one, but if I switch back to the first, I have to log in on each operation. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -This is a bug in Internet Explorer, other browsers do not behave this -way. - -.. _faq5_14: - -5.14 Using Opera6, I can manage to get to the authentication, but nothing happens after that, only a blank screen. ------------------------------------------------------------------------------------------------------------------- - -Please upgrade to Opera7 at least. - -.. _faq5_15: - -5.15 I have display problems with Safari. ------------------------------------------ - -Please upgrade to at least version 1.2.3. - -.. _faq5_16: - -5.16 With Internet Explorer, I get "Access is denied" Javascript errors. Or I cannot make phpMyAdmin work under Windows. ------------------------------------------------------------------------------------------------------------------------- - -Please check the following points: - -* Maybe you have defined your :config:option:`$cfg['PmaAbsoluteUri']` setting in - :file:`config.inc.php` to an :term:`IP` address and you are starting phpMyAdmin - with a :term:`URL` containing a domain name, or the reverse situation. -* Security settings in IE and/or Microsoft Security Center are too high, - thus blocking scripts execution. -* The Windows Firewall is blocking Apache and MySQL. You must allow - :term:`HTTP` ports (80 or 443) and MySQL - port (usually 3306) in the "in" and "out" directions. - -.. _faq5_17: - -5.17 With Firefox, I cannot delete rows of data or drop a database. -------------------------------------------------------------------- - -Many users have confirmed that the Tabbrowser Extensions plugin they -installed in their Firefox is causing the problem. - -.. _faq5_18: - -5.18 With Konqueror 4.2.x an invalid ``LIMIT`` clause is generated when I browse a table. ------------------------------------------------------------------------------------------ - -This happens only when both of these conditions are met: using the -``http`` authentication mode and ``register_globals`` being set to -``On`` on the server. It seems to be a browser-specific problem; -meanwhile use the ``cookie`` authentication mode. - -.. _faq5_19: - -5.19 I get JavaScript errors in my browser. -------------------------------------------- - -Issues have been reported with some combinations of browser -extensions. To troubleshoot, disable all extensions then clear your -browser cache to see if the problem goes away. - -.. _faqusing: - -Using phpMyAdmin -++++++++++++++++ - -.. _faq6_1: - -6.1 I can't insert new rows into a table / I can't create a table - MySQL brings up a SQL error. ------------------------------------------------------------------------------------------------- - -Examine the :term:`SQL` error with care. -Often the problem is caused by specifying a wrong column-type. Common -errors include: - -* Using ``VARCHAR`` without a size argument -* Using ``TEXT`` or ``BLOB`` with a size argument - -Also, look at the syntax chapter in the MySQL manual to confirm that -your syntax is correct. - -.. _faq6_2: - -6.2 When I create a table, I set an index for two columns and phpMyAdmin generates only one index with those two columns. -------------------------------------------------------------------------------------------------------------------------- - -This is the way to create a multi-columns index. If you want two -indexes, create the first one when creating the table, save, then -display the table properties and click the Index link to create the -other index. - -.. _faq6_3: - -6.3 How can I insert a null value into my table? ------------------------------------------------- - -Since version 2.2.3, you have a checkbox for each column that can be -null. Before 2.2.3, you had to enter "null", without the quotes, as -the column's value. Since version 2.5.5, you have to use the checkbox -to get a real NULL value, so if you enter "NULL" this means you want a -literal NULL in the column, and not a NULL value (this works in PHP4). - -.. _faq6_4: - -6.4 How can I backup my database or table? ------------------------------------------- - -Click on a database or table name in the navigation panel, the properties will -be displayed. Then on the menu, click "Export", you can dump the structure, the -data, or both. This will generate standard :term:`SQL` statements that can be -used to recreate your database/table. You will need to choose "Save as file", -so that phpMyAdmin can transmit the resulting dump to your station. Depending -on your PHP configuration, you will see options to compress the dump. See also -the :config:option:`$cfg['ExecTimeLimit']` configuration variable. For -additional help on this subject, look for the word "dump" in this document. - -.. _faq6_5: - -6.5 How can I restore (upload) my database or table using a dump? How can I run a ".sql" file? ----------------------------------------------------------------------------------------------- - -Click on a database name in the navigation panel, the properties will -be displayed. Select "Import" from the list of tabs in the right–hand -frame (or ":term:`SQL`" if your phpMyAdmin -version is previous to 2.7.0). In the "Location of the text file" -section, type in the path to your dump filename, or use the Browse -button. Then click Go. With version 2.7.0, the import engine has been -re–written, if possible it is suggested that you upgrade to take -advantage of the new features. For additional help on this subject, -look for the word "upload" in this document. - -Note: For errors while importing of dumps exported from older MySQL versions to newer MySQL versions, -please check :ref:`faq6_41`. - -.. _faq6_6: - -6.6 How can I use the relation table in Query-by-example? ---------------------------------------------------------- - -Here is an example with the tables persons, towns and countries, all -located in the database "mydb". If you don't have a ``pma__relation`` -table, create it as explained in the configuration section. Then -create the example tables: - -.. code-block:: mysql - - - CREATE TABLE REL_countries ( - country_code char(1) NOT NULL default '', - description varchar(10) NOT NULL default '', - PRIMARY KEY (country_code) - ) TYPE=MyISAM; - - INSERT INTO REL_countries VALUES ('C', 'Canada'); - - CREATE TABLE REL_persons ( - id tinyint(4) NOT NULL auto_increment, - person_name varchar(32) NOT NULL default '', - town_code varchar(5) default '0', - country_code char(1) NOT NULL default '', - PRIMARY KEY (id) - ) TYPE=MyISAM; - - INSERT INTO REL_persons VALUES (11, 'Marc', 'S', ''); - INSERT INTO REL_persons VALUES (15, 'Paul', 'S', 'C'); - - CREATE TABLE REL_towns ( - town_code varchar(5) NOT NULL default '0', - description varchar(30) NOT NULL default '', - PRIMARY KEY (town_code) - ) TYPE=MyISAM; - - INSERT INTO REL_towns VALUES ('S', 'Sherbrooke'); - INSERT INTO REL_towns VALUES ('M', 'Montréal'); - -To setup appropriate links and display information: - -* on table "REL\_persons" click Structure, then Relation view -* for "town\_code", choose from dropdowns, "mydb", "REL\_towns", "code" - for foreign database, table and column respectively -* for "country\_code", choose from dropdowns, "mydb", "REL\_countries", - "country\_code" for foreign database, table and column respectively -* on table "REL\_towns" click Structure, then Relation view -* in "Choose column to display", choose "description" -* repeat the two previous steps for table "REL\_countries" - -Then test like this: - -* Click on your db name in the navigation panel -* Choose "Query" -* Use tables: persons, towns, countries -* Click "Update query" -* In the columns row, choose persons.person\_name and click the "Show" - tickbox -* Do the same for towns.description and countries.descriptions in the - other 2 columns -* Click "Update query" and you will see in the query box that the - correct joins have been generated -* Click "Submit query" - -.. _faqdisplay: - -6.7 How can I use the "display column" feature? ------------------------------------------------ - -Starting from the previous example, create the ``pma__table_info`` as -explained in the configuration section, then browse your persons -table, and move the mouse over a town code or country code. See also -:ref:`faq6_21` for an additional feature that "display column" -enables: drop-down list of possible values. - -.. _faqpdf: - -6.8 How can I produce a PDF schema of my database? --------------------------------------------------- - -First the configuration variables "relation", "table\_coords" and -"pdf\_pages" have to be filled in. Then you need to think about your -schema layout. Which tables will go on which pages? - -* Select your database in the navigation panel. -* Choose "Operations" in the navigation bar at the top. -* Choose "Edit :term:`PDF` Pages" near the - bottom of the page. -* Enter a name for the first :term:`PDF` page - and click Go. If you like, you can use the "automatic layout," which - will put all your linked tables onto the new page. -* Select the name of the new page (making sure the Edit radio button is - selected) and click Go. -* Select a table from the list, enter its coordinates and click Save. - Coordinates are relative; your diagram will be automatically scaled to - fit the page. When initially placing tables on the page, just pick any - coordinates -- say, 50x50. After clicking Save, you can then use the - :ref:`wysiwyg` to position the element correctly. -* When you'd like to look at your :term:`PDF`, first be sure to click the Save - button beneath the list of tables and coordinates, to save any changes you - made there. Then scroll all the way down, select the :term:`PDF` options you - want, and click Go. -* Internet Explorer for Windows may suggest an incorrect filename when - you try to save a generated :term:`PDF`. - When saving a generated :term:`PDF`, be - sure that the filename ends in ".pdf", for example "schema.pdf". - Browsers on other operating systems, and other browsers on Windows, do - not have this problem. - -.. _faq6_9: - -6.9 phpMyAdmin is changing the type of one of my columns! ---------------------------------------------------------- - -No, it's MySQL that is doing `silent column type changing -`_. - -.. _underscore: - -6.10 When creating a privilege, what happens with underscores in the database name? ------------------------------------------------------------------------------------ - -If you do not put a backslash before the underscore, this is a -wildcard grant, and the underscore means "any character". So, if the -database name is "john\_db", the user would get rights to john1db, -john2db ... If you put a backslash before the underscore, it means -that the database name will have a real underscore. - -.. _faq6_11: - -6.11 What is the curious symbol ø in the statistics pages? ----------------------------------------------------------- - -It means "average". - -.. _faqexport: - -6.12 I want to understand some Export options. ----------------------------------------------- - -**Structure:** - -* "Add DROP TABLE" will add a line telling MySQL to `drop the table - `_, if it already - exists during the import. It does NOT drop the table after your - export, it only affects the import file. -* "If Not Exists" will only create the table if it doesn't exist. - Otherwise, you may get an error if the table name exists but has a - different structure. -* "Add AUTO\_INCREMENT value" ensures that AUTO\_INCREMENT value (if - any) will be included in backup. -* "Enclose table and column names with backquotes" ensures that column - and table names formed with special characters are protected. -* "Add into comments" includes column comments, relations, and MIME - types set in the pmadb in the dump as :term:`SQL` comments - (*/\* xxx \*/*). - -**Data:** - -* "Complete inserts" adds the column names on every INSERT command, for - better documentation (but resulting file is bigger). -* "Extended inserts" provides a shorter dump file by using only once the - INSERT verb and the table name. -* "Delayed inserts" are best explained in the `MySQL manual - INSERT DELAYED Syntax - `_. -* "Ignore inserts" treats errors as a warning instead. Again, more info - is provided in the `MySQL manual - INSERT Syntax - `_, but basically with - this selected, invalid values are adjusted and inserted rather than - causing the entire statement to fail. - -.. _faq6_13: - -6.13 I would like to create a database with a dot in its name. --------------------------------------------------------------- - -This is a bad idea, because in MySQL the syntax "database.table" is -the normal way to reference a database and table name. Worse, MySQL -will usually let you create a database with a dot, but then you cannot -work with it, nor delete it. - -.. _faqsqlvalidator: - -6.14 (withdrawn). ------------------ - -.. _faq6_15: - -6.15 I want to add a BLOB column and put an index on it, but MySQL says "BLOB column '...' used in key specification without a key length". -------------------------------------------------------------------------------------------------------------------------------------------- - -The right way to do this, is to create the column without any indexes, -then display the table structure and use the "Create an index" dialog. -On this page, you will be able to choose your BLOB column, and set a -size to the index, which is the condition to create an index on a BLOB -column. - -.. _faq6_16: - -6.16 How can I simply move in page with plenty editing fields? --------------------------------------------------------------- - -You can use :kbd:`Ctrl+arrows` (:kbd:`Option+Arrows` in Safari) for moving on -most pages with many editing fields (table structure changes, row editing, -etc.). - -.. _faq6_17: - -6.17 Transformations: I can't enter my own mimetype! WTF is this feature then useful for? ------------------------------------------------------------------------------------------ - -Slow down :). Defining mimetypes is of no use, if you can't put -transformations on them. Otherwise you could just put a comment on the -column. Because entering your own mimetype will cause serious syntax -checking issues and validation, this introduces a high-risk false- -user-input situation. Instead you have to initialize mimetypes using -functions or empty mimetype definitions. - -Plus, you have a whole overview of available mimetypes. Who knows all those -mimetypes by heart so he/she can enter it at will? - -.. _faqbookmark: - -6.18 Bookmarks: Where can I store bookmarks? Why can't I see any bookmarks below the query box? What are these variables for? ------------------------------------------------------------------------------------------------------------------------------ - -Any query you have executed can be stored as a bookmark on the page -where the results are displayed. You will find a button labeled -'Bookmark this query' just at the end of the page. As soon as you have -stored a bookmark, it is related to the database you run the query on. -You can now access a bookmark dropdown on each page, the query box -appears on for that database. - -You can also have, inside the query, placeholders for variables. -This is done by inserting into the query SQL comments between ``/*`` and -``*/``. Inside the comments, the special strings ``[VARIABLE{variable-number}]`` is used. -Be aware that the whole query minus the SQL comments must be -valid by itself, otherwise you won't be able to store it as a bookmark. - -When you execute the bookmark, everything typed into the *Variables* -input boxes on the query box page will replace the strings ``/*[VARIABLE{variable-number}]*/`` in -your stored query. - -Also remember, that everything else inside the ``/*[VARIABLE{variable-number}]*/`` string for -your query will remain the way it is, but will be stripped of the ``/**/`` -chars. So you can use: - -.. code-block:: mysql - - /*, [VARIABLE1] AS myname */ - -which will be expanded to - -.. code-block:: mysql - - , VARIABLE1 as myname - -in your query, where VARIABLE1 is the string you entered in the Variable 1 input box. - -A more complex example. Say you have stored -this query: - -.. code-block:: mysql - - SELECT Name, Address FROM addresses WHERE 1 /* AND Name LIKE '%[VARIABLE1]%' */ - -Say, you now enter "phpMyAdmin" as the variable for the stored query, the full -query will be: - -.. code-block:: mysql - - SELECT Name, Address FROM addresses WHERE 1 AND Name LIKE '%phpMyAdmin%' - -**NOTE THE ABSENCE OF SPACES** inside the ``/**/`` construct. Any spaces -inserted there will be later also inserted as spaces in your query and may lead -to unexpected results especially when using the variable expansion inside of a -"LIKE ''" expression. - -.. _faq6_19: - -6.19 How can I create simple LATEX document to include exported table? ----------------------------------------------------------------------- - -You can simply include table in your LATEX documents, -minimal sample document should look like following one (assuming you -have table exported in file :file:`table.tex`): - -.. code-block:: latex - - - \documentclass{article} % or any class you want - \usepackage{longtable} % for displaying table - \begin{document} % start of document - \include{table} % including exported table - \end{document} % end of document - -.. _faq6_20: - -6.20 I see a lot of databases which are not mine, and cannot access them. -------------------------------------------------------------------------- - -You have one of these global privileges: CREATE TEMPORARY TABLES, SHOW -DATABASES, LOCK TABLES. Those privileges also enable users to see all the -database names. So if your users do not need those privileges, you can remove -them and their databases list will shorten. - -.. seealso:: - -.. _faq6_21: - -6.21 In edit/insert mode, how can I see a list of possible values for a column, based on some foreign table? ------------------------------------------------------------------------------------------------------------- - -You have to setup appropriate links between the tables, and also setup -the "display column" in the foreign table. See :ref:`faq6_6` for an -example. Then, if there are 100 values or less in the foreign table, a -drop-down list of values will be available. You will see two lists of -values, the first list containing the key and the display column, the -second list containing the display column and the key. The reason for -this is to be able to type the first letter of either the key or the -display column. For 100 values or more, a distinct window will appear, -to browse foreign key values and choose one. To change the default -limit of 100, see :config:option:`$cfg['ForeignKeyMaxLimit']`. - - -.. _faq6_22: - -6.22 Bookmarks: Can I execute a default bookmark automatically when entering Browse mode for a table? ------------------------------------------------------------------------------------------------------ - -Yes. If a bookmark has the same label as a table name and it's not a -public bookmark, it will be executed. - -.. _faq6_23: - -6.23 Export: I heard phpMyAdmin can export Microsoft Excel files? ------------------------------------------------------------------ - -You can use :term:`CSV` for Microsoft Excel, -which works out of the box. - -.. versionchanged:: 3.4.5 - Since phpMyAdmin 3.4.5 support for direct export to Microsoft Excel version - 97 and newer was dropped. - -.. _faq6_24: - -6.24 Now that phpMyAdmin supports native MySQL 4.1.x column comments, what happens to my column comments stored in pmadb? -------------------------------------------------------------------------------------------------------------------------- - -Automatic migration of a table's pmadb-style column comments to the -native ones is done whenever you enter Structure page for this table. - -.. _faq6_25: - -6.25 (withdrawn). ------------------ - -.. _faq6_26: - -6.26 How can I select a range of rows? --------------------------------------- - -Click the first row of the range, hold the shift key and click the -last row of the range. This works everywhere you see rows, for example -in Browse mode or on the Structure page. - -.. _faq6_27: - -6.27 What format strings can I use? ------------------------------------ - -In all places where phpMyAdmin accepts format strings, you can use -``@VARIABLE@`` expansion and `strftime `_ -format strings. The expanded variables depend on a context (for -example, if you haven't chosen a table, you can not get the table -name), but the following variables can be used: - -``@HTTP_HOST@`` - HTTP host that runs phpMyAdmin -``@SERVER@`` - MySQL server name -``@VERBOSE@`` - Verbose MySQL server name as defined in :config:option:`$cfg['Servers'][$i]['verbose']` -``@VSERVER@`` - Verbose MySQL server name if set, otherwise normal -``@DATABASE@`` - Currently opened database -``@TABLE@`` - Currently opened table -``@COLUMNS@`` - Columns of the currently opened table -``@PHPMYADMIN@`` - phpMyAdmin with version - -.. _wysiwyg: - -6.28 How can I easily edit relational schema for export? --------------------------------------------------------- - -By clicking on the button 'toggle scratchboard' on the page where you -edit x/y coordinates of those elements you can activate a scratchboard -where all your elements are placed. By clicking on an element, you can -move them around in the pre-defined area and the x/y coordinates will -get updated dynamically. Likewise, when entering a new position -directly into the input field, the new position in the scratchboard -changes after your cursor leaves the input field. - -You have to click on the 'OK'-button below the tables to save the new -positions. If you want to place a new element, first add it to the -table of elements and then you can drag the new element around. - -By changing the paper size and the orientation you can change the size -of the scratchboard as well. You can do so by just changing the -dropdown field below, and the scratchboard will resize automatically, -without interfering with the current placement of the elements. - -If ever an element gets out of range you can either enlarge the paper -size or click on the 'reset' button to place all elements below each -other. - -.. _faq6_29: - -6.29 Why can't I get a chart from my query result table? --------------------------------------------------------- - -Not every table can be put to the chart. Only tables with one, two or -three columns can be visualised as a chart. Moreover the table must be -in a special format for chart script to understand it. Currently -supported formats can be found in the `wiki `_. - -.. _faq6_30: - -6.30 Import: How can I import ESRI Shapefiles? ----------------------------------------------- - -An ESRI Shapefile is actually a set of several files, where .shp file -contains geometry data and .dbf file contains data related to those -geometry data. To read data from .dbf file you need to have PHP -compiled with the dBase extension (--enable-dbase). Otherwise only -geometry data will be imported. - -To upload these set of files you can use either of the following -methods: - -Configure upload directory with :config:option:`$cfg['UploadDir']`, upload both .shp and .dbf files with -the same filename and chose the .shp file from the import page. - -Create a Zip archive with .shp and .dbf files and import it. For this -to work, you need to set :config:option:`$cfg['TempDir']` to a place where the web server user can -write (for example ``'./tmp'``). - -To create the temporary directory on a UNIX-based system, you can do: - -.. code-block:: sh - - cd phpMyAdmin - mkdir tmp - chmod o+rwx tmp - -.. _faq6_31: - -6.31 How do I create a relation in designer? --------------------------------------------- - -To select relation, click: The display column is shown in pink. To -set/unset a column as the display column, click the "Choose column to -display" icon, then click on the appropriate column name. - -.. _faq6_32: - -6.32 How can I use the zoom search feature? -------------------------------------------- - -The Zoom search feature is an alternative to table search feature. It allows -you to explore a table by representing its data in a scatter plot. You can -locate this feature by selecting a table and clicking the :guilabel:`Search` -tab. One of the sub-tabs in the :guilabel:`Table Search` page is -:guilabel:`Zoom Search`. - -Consider the table REL\_persons in :ref:`faq6_6` for -an example. To use zoom search, two columns need to be selected, for -example, id and town\_code. The id values will be represented on one -axis and town\_code values on the other axis. Each row will be -represented as a point in a scatter plot based on its id and -town\_code. You can include two additional search criteria apart from -the two fields to display. - -You can choose which field should be -displayed as label for each point. If a display column has been set -for the table (see :ref:`faqdisplay`), it is taken as the label unless -you specify otherwise. You can also select the maximum number of rows -you want to be displayed in the plot by specifing it in the 'Max rows -to plot' field. Once you have decided over your criteria, click 'Go' -to display the plot. - -After the plot is generated, you can use the -mousewheel to zoom in and out of the plot. In addition, panning -feature is enabled to navigate through the plot. You can zoom-in to a -certain level of detail and use panning to locate your area of -interest. Clicking on a point opens a dialogue box, displaying field -values of the data row represented by the point. You can edit the -values if required and click on submit to issue an update query. Basic -instructions on how to use can be viewed by clicking the 'How to use?' -link located just above the plot. - -.. _faq6_33: - -6.33 When browsing a table, how can I copy a column name? ---------------------------------------------------------- - -Selecting the name of the column within the browse table header cell -for copying is difficult, as the columns support reordering by -dragging the header cells as well as sorting by clicking on the linked -column name. To copy a column name, double-click on the empty area -next to the column name, when the tooltip tells you to do so. This -will show you an input box with the column name. You may right-click -the column name within this input box to copy it to your clipboard. - -.. _faq6_34: - -6.34 How can I use the Favorite Tables feature? ---------------------------------------------------------- - -Favorite Tables feature is very much similar to Recent Tables feature. -It allows you to add a shortcut for the frequently used tables of any -database in the navigation panel . You can easily navigate to any table -in the list by simply choosing it from the list. These tables are stored -in your browser's local storage if you have not configured your -`phpMyAdmin Configuration Storage`. Otherwise these entries are stored in -`phpMyAdmin Configuration Storage`. - -IMPORTANT: In absence of `phpMyAdmin Configuration Storage`, your Favorite -tables may be different in different browsers based on your different -selections in them. - -To add a table to Favorite list simply click on the `Gray` star in front -of a table name in the list of tables of a Database and wait until it -turns to `Yellow`. -To remove a table from list, simply click on the `Yellow` star and -wait until it turns `Gray` again. - -Using :config:option:`$cfg['NumFavoriteTables']` in your :file:`config.inc.php` -file, you can define the maximum number of favorite tables shown in the -navigation panel. Its default value is `10`. - -.. _faq6_35: - -6.35 How can I use the Range search feature? ---------------------------------------------------------- - -With the help of range search feature, one can specify a range of values for -particular column(s) while performing search operation on a table from the `Search` -tab. - -To use this feature simply click on the `BETWEEN` or `NOT BETWEEN` operators -from the operator select list in front of the column name. On choosing one of the -above options, a dialog box will show up asking for the `Minimum` and `Maximum` -value for that column. Only the specified range of values will be included -in case of `BETWEEN` and excluded in case of `NOT BETWEEN` from the final results. - -Note: The Range search feature will work only `Numeric` and `Date` data type columns. - -.. _faq6_36: - -6.36 What is Central columns and How can I use this feature? ------------------------------------------------------------- - -As the name suggests, the Central columns feature enables to maintain a central list of -columns per database to avoid similar name for the same data element and bring consistency -of data type for the same data element. You can use the central list of columns to -add an element to any table structure in that database which will save from writing -similar column name and column definition. - -To add a column to central list, go to table structure page, check the columns you want -to include and then simply click on "Add to central columns". If you want to add all -unique columns from more than one table from a database then go to database structure page, -check the tables you want to include and then select "Add columns to central list". - -To remove a column from central list, go to Table structure page, check the columns you want -to remove and then simply click on "Remove from central columns". If you want to remove all -columns from more than one tables from a database then go to database structure page, -check the tables you want to include and then select "Remove columns from central list". - -To view and manage the central list, select the database you want to manage central columns -for then from the top menu click on "Central columns". You will be taken to a page where -you will have options to edit, delete or add new columns to central list. - -.. _faq6_37: - -6.37 How can I use Improve Table structure feature? ---------------------------------------------------------- - -Improve table structure feature helps to bring the table structure upto -Third Normal Form. A wizard is presented to user which asks questions about the -elements during the various steps for normalization and a new structure is proposed -accordingly to bring the table into the First/Second/Third Normal form. -On startup of the wizard, user gets to select upto what normal form they want to -normalize the table structure. - -Here is an example table which you can use to test all of the three First, Second and -Third Normal Form. - -.. code-block:: mysql - - CREATE TABLE `VetOffice` ( - `petName` varchar(64) NOT NULL, - `petBreed` varchar(64) NOT NULL, - `petType` varchar(64) NOT NULL, - `petDOB` date NOT NULL, - `ownerLastName` varchar(64) NOT NULL, - `ownerFirstName` varchar(64) NOT NULL, - `ownerPhone1` int(12) NOT NULL, - `ownerPhone2` int(12) NOT NULL, - `ownerEmail` varchar(64) NOT NULL, - ); - -The above table is not in First normal Form as no primary key exists. Primary key -is supposed to be (`petName`,`ownerLastName`,`ownerFirstName`) . If the primary key -is chosen as suggested the resultant table won't be in Second as well as Third Normal -form as the following dependencies exists. - -.. code-block:: mysql - - (OwnerLastName, OwnerFirstName) -> OwnerEmail - (OwnerLastName, OwnerFirstName) -> OwnerPhone - PetBreed -> PetType - -Which says, OwnerEmail depends on OwnerLastName and OwnerFirstName. -OwnerPhone depends on OwnerLastName and OwnerFirstName. -PetType depends on PetBreed. - -.. _faq6_38: - -6.38 How can I reassign auto-incremented values? ------------------------------------------------- - -Some users prefer their AUTO_INCREMENT values to be consecutive; this is not -always the case after row deletion. - -Here are the steps to accomplish this. These are manual steps because they -involve a manual verification at one point. - -* Ensure that you have exclusive access to the table to rearrange - -* On your primary key column (i.e. id), remove the AUTO_INCREMENT setting - -* Delete your primary key in Structure > indexes - -* Create a new column future_id as primary key, AUTO_INCREMENT - -* Browse your table and verify that the new increments correspond to what - you're expecting - -* Drop your old id column - -* Rename the future_id column to id - -* Move the new id column via Structure > Move columns - -.. _faq6_39: - -6.39 What is the "Adjust privileges" option when renaming, copying, or moving a database, table, column, or procedure? ----------------------------------------------------------------------------------------------------------------------- - -When renaming/copying/moving a database/table/column/procedure, -MySQL does not adjust the original privileges relating to these objects -on its own. By selecting this option, phpMyAdmin will adjust the privilege -table so that users have the same privileges on the new items. - -For example: A user 'bob'@'localhost' has a 'SELECT' privilege on a -column named 'id'. Now, if this column is renamed to 'id_new', MySQL, -on its own, would **not** adjust the column privileges to the new column name. -phpMyAdmin can make this adjustment for you automatically. - -Notes: - -* While adjusting privileges for a database, the privileges of all - database-related elements (tables, columns and procedures) are also adjusted - to the database's new name. - -* Similarly, while adjusting privileges for a table, the privileges of all - the columns inside the new table are also adjusted. - -* While adjusting privileges, the user performing the operation **must** have the following - privileges: - - * SELECT, INSERT, UPDATE, DELETE privileges on following tables: - `mysql`.`db`, `mysql`.`columns_priv`, `mysql`.`tables_priv`, `mysql`.`procs_priv` - * FLUSH privilege (GLOBAL) - -Thus, if you want to replicate the database/table/column/procedure as it is -while renaming/copying/moving these objects, make sure you have checked this option. - -.. _faq6_40: - -6.40 I see "Bind parameters" checkbox in the "SQL" page. How do I write parameterized SQL queries? --------------------------------------------------------------------------------------------------- - -From version 4.5, phpMyAdmin allows users to execute parameterized queries in the "SQL" page. -Parameters should be prefixed with a colon(:) and when the "Bind parameters" checkbox is checked -these parameters will be identified and input fields for these parameters will be presented. -Values entered in these field will be substituted in the query before being executed. - -.. _faq6_41: - -6.41 I get import errors while importing the dumps exported from older MySQL versions (pre-5.7.6) into newer MySQL versions (5.7.7+), but they work fine when imported back on same older versions ? --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -If you get errors like *#1031 - Table storage engine for 'table_name' doesn't have this option* -while importing the dumps exported from pre-5.7.7 MySQL servers into new MySQL server versions 5.7.7+, -it might be because ROW_FORMAT=FIXED is not supported with InnoDB tables. Moreover, the value of -`innodb_strict_mode `_ would define if this would be reported as a warning or as an error. - -Since MySQL version 5.7.9, the default value for `innodb_strict_mode` is `ON` and thus would generate -an error when such a CREATE TABLE or ALTER TABLE statement is encountered. - -There are two ways of preventing such errors while importing: - -* Change the value of `innodb_strict_mode` to `OFF` before starting the import and turn it `ON` after - the import is successfully completed. -* This can be achieved in two ways: - - * Go to 'Variables' page and edit the value of `innodb_strict_mode` - * Run the query : `SET GLOBAL `innodb_strict_mode` = '[value]'` - -After the import is done, it is suggested that the value of `innodb_strict_mode` should be reset to the -original value. - -.. _faqproject: - -phpMyAdmin project -++++++++++++++++++ - -.. _faq7_1: - -7.1 I have found a bug. How do I inform developers? ---------------------------------------------------- - -Our issues tracker is located at . - -.. _faq7_2: - -7.2 I want to translate the messages to a new language or upgrade an existing language, where do I start? ---------------------------------------------------------------------------------------------------------- - -Translations are very welcome and all you need to have are the -language skills. The easiest way is to use our `online translation -service `_. You can check -out all the possibilities to translate in the `translate section on -our website `_. - -.. _faq7_3: - -7.3 I would like to help out with the development of phpMyAdmin. How should I proceed? --------------------------------------------------------------------------------------- - -We welcome every contribution to the development of phpMyAdmin. You -can check out all the possibilities to contribute in the `contribute -section on our website -`_. - -.. seealso:: :ref:`developers` - -.. _faqsecurity: - -Security -++++++++ - -.. _faq8_1: - -8.1 Where can I get information about the security alerts issued for phpMyAdmin? --------------------------------------------------------------------------------- - -Please refer to . - -.. _faq8_2: - -8.2 How can I protect phpMyAdmin against brute force attacks? -------------------------------------------------------------- - -If you use Apache web server, phpMyAdmin exports information about -authentication to the Apache environment and it can be used in Apache -logs. Currently there are two variables available: - - -``userID`` - User name of currently active user (he does not have to be logged in). -``userStatus`` - Status of currently active user, one of ``ok`` (user is logged in), - ``mysql-denied`` (MySQL denied user login), ``allow-denied`` (user denied - by allow/deny rules), ``root-denied`` (root is denied in configuration), - ``empty-denied`` (empty password is denied). - -``LogFormat`` directive for Apache can look like following: - -.. code-block:: apache - - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{userID}n %{userStatus}n" pma_combined - -You can then use any log analyzing tools to detect possible break-in -attempts. - -.. _faq8_3: - -8.3 Why are there path disclosures when directly loading certain files? ------------------------------------------------------------------------ - -This is a server configuration problem. Never enable ``display_errors`` on a production site. - -.. _faqsynchronization: - -Synchronization -+++++++++++++++ - -.. _faq9_1: - -9.1 (withdrawn). ----------------- - -.. _faq9_2: - -9.2 (withdrawn). ----------------- - diff --git a/#pma/doc/glossary.rst b/#pma/doc/glossary.rst deleted file mode 100644 index 763e58e1..00000000 --- a/#pma/doc/glossary.rst +++ /dev/null @@ -1,401 +0,0 @@ -.. _glossary: - -Glossary -======== - -From Wikipedia, the free encyclopedia - -.. glossary:: - - .htaccess - the default name of Apache's directory-level configuration file. - - .. seealso:: - - ACL - Access Contol List - - Blowfish - a keyed, symmetric block cipher, designed in 1993 by Bruce Schneier. - - .. seealso:: - - Browser - a software application that enables a user to display and interact with text, images, and other information typically located on a web page at a website on the World Wide Web. - - .. seealso:: - - bzip2 - a free software/open source data compression algorithm and program developed by Julian Seward. - - .. seealso:: - - CGI - Common Gateway Interface is an important World Wide Web technology that - enables a client web browser to request data from a program executed on - the Web server. - - .. seealso:: - - Changelog - a log or record of changes made to a project. - - .. seealso:: - - Client - a computer system that accesses a (remote) service on another computer by some kind of network. - - .. seealso:: - - column - a set of data values of a particular simple type, one for each row of the table. - - .. seealso:: - - Cookie - a packet of information sent by a server to a World Wide Web browser and then sent back by the browser each time it accesses that server. - - .. seealso:: - - CSV - Comma- separated values - - .. seealso:: - - DB - look at :term:`database` - - database - an organized collection of data. - - .. seealso:: - - Engine - look at :term:`storage engines` - - extension - a PHP module that extends PHP with additional functionality. - - .. seealso:: - - FAQ - Frequently Asked Questions is a list of commonly asked question and there - answers. - - .. seealso:: - - Field - one part of divided data/columns. - - .. seealso:: - - foreign key - a column or group of columns in a database row that point to a key column - or group of columns forming a key of another database row in some - (usually different) table. - - .. seealso:: - - FPDF - the free :term:`PDF` library - - .. seealso:: - - GD - Graphics Library by Thomas Boutell and others for dynamically manipulating images. - - .. seealso:: - - GD2 - look at :term:`gd` - - gzip - gzip is short for GNU zip, a GNU free software file compression program. - - .. seealso:: - - host - any machine connected to a computer network, a node that has a hostname. - - .. seealso:: - - hostname - the unique name by which a network attached device is known on a network. - - .. seealso:: - - HTTP - HyperText Transfer Protocol is the primary method used to transfer or - convey information on the World Wide Web. - - .. seealso:: - - https - a :term:`HTTP`-connection with additional security measures. - - .. seealso:: - - IEC - International Electrotechnical Commission - - IIS - Internet Information Services is a set of Internet-based services for - servers using Microsoft Windows. - - .. seealso:: - - Index - a feature that allows quick access to the rows in a table. - - .. seealso:: - - IP - Internet Protocol is a data-oriented protocol used by source and - destination hosts for communicating data across a packet-switched - internetwork. - - .. seealso:: - - IP Address - a unique number that devices use in order to identify and communicate with each other on a network utilizing the Internet Protocol standard. - - .. seealso:: - - IPv6 - IPv6 (Internet Protocol version 6) is the latest revision of the - Internet Protocol (:term:`IP`), designed to deal with the - long-anticipated problem of its precedessor IPv4 running out of addresses. - - .. seealso:: - - ISAPI - Internet Server Application Programming Interface is the API of Internet Information Services (IIS). - - .. seealso:: - - ISP - Internet service provider is a business or organization that offers users - access to the Internet and related services. - - .. seealso:: - - ISO - International Standards Organisation - - JPEG - a most commonly used standard method of lossy compression for photographic images. - - .. seealso:: - - JPG - look at :term:`jpeg` - - Key - look at :term:`index` - - LATEX - a document preparation system for the TEX typesetting program. - - .. seealso:: - - Mac - Apple Macintosh is line of personal computers is designed, developed, manufactured, and marketed by Apple Computer. - - .. seealso:: - - Mac OS X - the operating system which is included with all currently shipping Apple Macintosh computers in the consumer and professional markets. - - .. seealso:: - - MCrypt - a cryptographic library. - - .. seealso:: - - mcrypt - the MCrypt PHP extension. - - .. seealso:: - - MIME - Multipurpose Internet Mail Extensions is - an Internet Standard for the format of e-mail. - - .. seealso:: - - module - some sort of extension for the Apache Webserver. - - .. seealso:: - - mod_proxy_fcgi - an Apache module implmenting a Fast CGI interface; PHP can be run as a CGI module, FastCGI, or - directly as an Apache module. - - MySQL - a multithreaded, multi-user, SQL (Structured Query Language) Database Management System (DBMS). - - .. seealso:: - - mysqli - the improved MySQL client PHP extension. - - .. seealso:: - - mysql - the MySQL client PHP extension. - - .. seealso:: - - OpenDocument - open standard for office documents. - - .. seealso:: - - OS X - look at :term:`Mac OS X`. - - .. seealso:: - - PDF - Portable Document Format is a file format developed by Adobe Systems for - representing two dimensional documents in a device independent and - resolution independent format. - - .. seealso:: - - PEAR - the PHP Extension and Application Repository. - - .. seealso:: - - PCRE - Perl Compatible Regular Expressions is the perl-compatible regular - expression functions for PHP - - .. seealso:: - - PHP - short for "PHP: Hypertext Preprocessor", is an open-source, reflective - programming language used mainly for developing server-side applications - and dynamic web content, and more recently, a broader range of software - applications. - - .. seealso:: - - port - a connection through which data is sent and received. - - .. seealso:: - - RFC - Request for Comments (RFC) documents are a series of memoranda - encompassing new research, innovations, and methodologies applicable to - Internet technologies. - - .. seealso:: - - RFC 1952 - GZIP file format specification version 4.3 - - .. seealso:: :rfc:`1952` - - Row (record, tuple) - represents a single, implicitly structured data item in a table. - - .. seealso:: - - Server - a computer system that provides services to other computing systems over a network. - - .. seealso:: - - Storage Engines - handlers for different table types - - .. seealso:: - - socket - a form of inter-process communication. - - .. seealso:: - - SSL - Secure Sockets Layer is a cryptographic protocol which provides secure - communication on the Internet. - - .. seealso:: - - Stored procedure - a subroutine available to applications accessing a relational database system - - .. seealso:: - - SQL - Structured Query Language - - .. seealso:: - - table - a set of data elements (cells) that is organized, defined and stored as - horizontal rows and vertical columns where each item can be uniquely - identified by a label or key or by it?s position in relation to other - items. - - .. seealso:: - - tar - a type of archive file format: the Tape ARchive format. - - .. seealso:: - - TCP - Transmission Control Protocol is one of the core protocols of the - Internet protocol suite. - - .. seealso:: - - TCPDF - Rewrite of :term:`UFPDF` with various improvements. - - .. seealso:: - - trigger - a procedural code that is automatically executed in response to certain events on a particular table or view in a database - - .. seealso:: - - UFPDF - Unicode/UTF-8 extension for :term:`FPDF` - - URL - Uniform Resource Locator is a sequence of characters, conforming to a - standardized format, that is used for referring to resources, such as - documents and images on the Internet, by their location. - - .. seealso:: - - Webserver - A computer (program) that is responsible for accepting HTTP requests from clients and serving them Web pages. - - .. seealso:: - - XML - Extensible Markup Language is a W3C-recommended general- purpose markup - language for creating special-purpose markup languages, capable of - describing many different kinds of data. - - .. seealso:: - - ZIP - a popular data compression and archival format. - - .. seealso:: - - zlib - an open-source, cross- platform data compression library by Jean-loup Gailly and Mark Adler. - - .. seealso:: - - diff --git a/#pma/doc/html/.buildinfo b/#pma/doc/html/.buildinfo deleted file mode 100644 index 2e5d87fc..00000000 --- a/#pma/doc/html/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 8141c5d2d73fe5923f589f1cf37a51a1 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/#pma/doc/html/_images/usergroups.png b/#pma/doc/html/_images/usergroups.png deleted file mode 100644 index bd8efdcc..00000000 Binary files a/#pma/doc/html/_images/usergroups.png and /dev/null differ diff --git a/#pma/doc/html/_sources/config.txt b/#pma/doc/html/_sources/config.txt deleted file mode 100644 index 36c1b974..00000000 --- a/#pma/doc/html/_sources/config.txt +++ /dev/null @@ -1,2979 +0,0 @@ -.. index:: config.inc.php - -.. _config: - -Configuration -============= - -Almost all configurable data is placed in :file:`config.inc.php`. If this file -does not exist, please refer to the :ref:`setup` section to create one. This -file only needs to contain the parameters you want to change from their -corresponding default value in :file:`libraries/config.default.php`. - -If a directive is missing from your file, you can just add another line with -the file. This file is for over-writing the defaults; if you wish to use the -default value there's no need to add a line here. - -The parameters which relate to design (like colors) are placed in -:file:`themes/themename/layout.inc.php`. You might also want to create -:file:`config.footer.inc.php` and :file:`config.header.inc.php` files to add -your site specific code to be included on start and end of each page. - -.. note:: - - Some distributions (eg. Debian or Ubuntu) store :file:`config.inc.php` in - ``/etc/phpmyadmin`` instead of within phpMyAdmin sources. - -.. warning:: - - :term:`Mac` users should note that if you are on a version before - :term:`Mac OS X`, PHP does not seem to - like :term:`Mac` end of lines character (``\r``). So - ensure you choose the option that allows to use the \*nix end of line - character (``\n``) in your text editor before saving a script you have - modified. - -Basic settings --------------- - -.. config:option:: $cfg['PmaAbsoluteUri'] - - :type: string - :default: ``''`` - - .. versionchanged:: 4.6.5 - - This setting was not available in phpMyAdmin 4.6.0 - 4.6.4. - - Sets here the complete :term:`URL` (with full path) to your phpMyAdmin - installation's directory. E.g. - ``https://www.example.net/path_to_your_phpMyAdmin_directory/``. Note also - that the :term:`URL` on most of web servers are case–sensitive. Don’t - forget the trailing slash at the end. - - Starting with version 2.3.0, it is advisable to try leaving this blank. In - most cases phpMyAdmin automatically detects the proper setting. Users of - port forwarding will need to set :config:option:`$cfg['PmaAbsoluteUri']` - (`more info `_). - - A good test is to browse a table, edit a row and save it. There should be - an error message if phpMyAdmin is having trouble auto–detecting the correct - value. If you get an error that this must be set or if the autodetect code - fails to detect your path, please post a bug report on our bug tracker so - we can improve the code. - - .. seealso:: :ref:`faq1_40`, :ref:`faq2_5`, :ref:`faq4_7`, :ref:`faq5_16` - -.. config:option:: $cfg['PmaNoRelation_DisableWarning'] - - :type: boolean - :default: false - - Starting with version 2.3.0 phpMyAdmin offers a lot of features to - work with master / foreign – tables (see :config:option:`$cfg['Servers'][$i]['pmadb']`). - - If you tried to set this - up and it does not work for you, have a look on the :guilabel:`Structure` page - of one database where you would like to use it. You will find a link - that will analyze why those features have been disabled. - - If you do not want to use those features set this variable to ``true`` to - stop this message from appearing. - -.. config:option:: $cfg['SuhosinDisableWarning'] - - :type: boolean - :default: false - - A warning is displayed on the main page if Suhosin is detected. - - You can set this parameter to ``true`` to stop this message from appearing. - -.. config:option:: $cfg['LoginCookieValidityDisableWarning'] - - :type: boolean - :default: false - - A warning is displayed on the main page if the PHP parameter - session.gc_maxlifetime is lower than cookie validity configured in phpMyAdmin. - - You can set this parameter to ``true`` to stop this message from appearing. - -.. config:option:: $cfg['ServerLibraryDifference_DisableWarning'] - - :type: boolean - :default: false - - A warning is displayed on the main page if there is a difference - between the MySQL library and server version. - - You can set this parameter to ``true`` to stop this message from appearing. - -.. config:option:: $cfg['ReservedWordDisableWarning'] - - :type: boolean - :default: false - - This warning is displayed on the Structure page of a table if one or more - column names match with words which are MySQL reserved. - - If you want to turn off this warning, you can set it to ``true`` and - warning will no longer be displayed. - -.. config:option:: $cfg['TranslationWarningThreshold'] - - :type: integer - :default: 80 - - Show warning about incomplete translations on certain threshold. - -.. config:option:: $cfg['SendErrorReports'] - - :type: string - :default: ``'ask'`` - - Sets the default behavior for JavaScript error reporting. - - Whenever an error is detected in the JavaScript execution, an error report - may be sent to the phpMyAdmin team if the user agrees. - - The default setting of ``'ask'`` will ask the user everytime there is a new - error report. However you can set this parameter to ``'always'`` to send error - reports without asking for confirmation or you can set it to ``'never'`` to - never send error reports. - - This directive is available both in the configuration file and in users - preferences. If the person in charge of a multi-user installation prefers - to disable this feature for all users, a value of ``'never'`` should be - set, and the :config:option:`$cfg['UserprefsDisallow']` directive should - contain ``'SendErrorReports'`` in one of its array values. - -.. config:option:: $cfg['ConsoleEnterExecutes'] - - :type: boolean - :default: false - - Setting this to ``true`` allows the user to execute queries by pressing Enter - instead of Ctrl+Enter. A new line can be inserted by pressing Shift + Enter. - - The behaviour of the console can be temporarily changed using console's - settings interface. - -.. config:option:: $cfg['AllowThirdPartyFraming'] - - :type: boolean - :default: false - - Setting this to ``true`` allows phpMyAdmin to be included inside a frame, - and is a potential security hole allowing cross-frame scripting attacks or - clickjacking. - -Server connection settings --------------------------- - -.. config:option:: $cfg['Servers'] - - :type: array - :default: one server array with settings listed below - - Since version 1.4.2, phpMyAdmin supports the administration of multiple - MySQL servers. Therefore, a :config:option:`$cfg['Servers']`-array has been - added which contains the login information for the different servers. The - first :config:option:`$cfg['Servers'][$i]['host']` contains the hostname of - the first server, the second :config:option:`$cfg['Servers'][$i]['host']` - the hostname of the second server, etc. In - :file:`libraries/config.default.php`, there is only one section for server - definition, however you can put as many as you need in - :file:`config.inc.php`, copy that block or needed parts (you don't have to - define all settings, just those you need to change). - - .. note:: - - The :config:option:`$cfg['Servers']` array starts with - $cfg['Servers'][1]. Do not use $cfg['Servers'][0]. If you want more - than one server, just copy following section (including $i - incrementation) serveral times. There is no need to define full server - array, just define values you need to change. - - -.. config:option:: $cfg['Servers'][$i]['host'] - - :type: string - :default: ``'localhost'`` - - The hostname or :term:`IP` address of your $i-th MySQL-server. E.g. - ``localhost``. - - Possible values are: - - * hostname, e.g., ``'localhost'`` or ``'mydb.example.org'`` - * IP address, e.g., ``'127.0.0.1'`` or ``'192.168.10.1'`` - * dot - ``'.'``, i.e., use named pipes on windows systems - * empty - ``''``, disables this server - - .. note:: - - phpMyAdmin supports connecting to MySQL servers reachable via IPv6 only. - To connect to an IPv6 MySQL server, enter its IPv6 address in this field. - -.. config:option:: $cfg['Servers'][$i]['port'] - - :type: string - :default: ``''`` - - The port-number of your $i-th MySQL-server. Default is 3306 (leave - blank). - - .. note:: - - If you use ``localhost`` as the hostname, MySQL ignores this port number - and connects with the socket, so if you want to connect to a port - different from the default port, use ``127.0.0.1`` or the real hostname - in :config:option:`$cfg['Servers'][$i]['host']`. - -.. config:option:: $cfg['Servers'][$i]['socket'] - - :type: string - :default: ``''`` - - The path to the socket to use. Leave blank for default. To determine - the correct socket, check your MySQL configuration or, using the - :command:`mysql` command–line client, issue the ``status`` command. Among the - resulting information displayed will be the socket used. - -.. config:option:: $cfg['Servers'][$i]['ssl'] - - :type: boolean - :default: false - - Whether to enable SSL for the connection between phpMyAdmin and the MySQL server. - - When using the ``'mysql'`` extension, - none of the remaining ``'ssl...'`` configuration options apply. - - We strongly recommend the ``'mysqli'`` extension when using this option. - - .. seealso:: :ref:`example-google-ssl` - -.. config:option:: $cfg['Servers'][$i]['ssl_key'] - - :type: string - :default: NULL - - Path to the key file when using SSL for connecting to the MySQL server. - - For example: - - .. code-block:: php - - $cfg['Servers'][$i]['ssl_key'] = '/etc/mysql/server-key.pem'; - - .. seealso:: :ref:`example-google-ssl` - -.. config:option:: $cfg['Servers'][$i]['ssl_cert'] - - :type: string - :default: NULL - - Path to the cert file when using SSL for connecting to the MySQL server. - - .. seealso:: :ref:`example-google-ssl` - -.. config:option:: $cfg['Servers'][$i]['ssl_ca'] - - :type: string - :default: NULL - - Path to the CA file when using SSL for connecting to the MySQL server. - - .. seealso:: :ref:`example-google-ssl` - -.. config:option:: $cfg['Servers'][$i]['ssl_ca_path'] - - :type: string - :default: NULL - - Directory containing trusted SSL CA certificates in PEM format. - -.. config:option:: $cfg['Servers'][$i]['ssl_ciphers'] - - :type: string - :default: NULL - - List of allowable ciphers for SSL connections to the MySQL server. - -.. config:option:: $cfg['Servers'][$i]['ssl_verify'] - - :type: boolean - :default: true - - .. versionadded:: 4.6.0 - - This is supported since phpMyAdmin 4.6.0. - - If your PHP install uses the MySQL Native Driver (mysqlnd), your - MySQL server is 5.6 or later, and your SSL certificate is self-signed, - there is a chance your SSL connection will fail due to validation. - Setting this to ``false`` will disable the validation check. - - Since PHP 5.6.0 it also verifies whether server name matches CN of it's - certificate. There is currently no way to disable just this check without - disabling complete SSL verification. - - .. note:: - - This flag only works with PHP 5.6.16 or later. - - .. seealso:: :ref:`example-google-ssl` - -.. config:option:: $cfg['Servers'][$i]['connect_type'] - - :type: string - :default: ``'tcp'`` - - What type connection to use with the MySQL server. Your options are - ``'socket'`` and ``'tcp'``. It defaults to tcp as that is nearly guaranteed - to be available on all MySQL servers, while sockets are not supported on - some platforms. To use the socket mode, your MySQL server must be on the - same machine as the Web server. - -.. config:option:: $cfg['Servers'][$i]['compress'] - - :type: boolean - :default: false - - Whether to use a compressed protocol for the MySQL server connection - or not (experimental). - -.. _controlhost: -.. config:option:: $cfg['Servers'][$i]['controlhost'] - - :type: string - :default: ``''`` - - Permits to use an alternate host to hold the configuration storage - data. - -.. _controlport: -.. config:option:: $cfg['Servers'][$i]['controlport'] - - :type: string - :default: ``''`` - - Permits to use an alternate port to connect to the host that - holds the configuration storage. - -.. _controluser: -.. config:option:: $cfg['Servers'][$i]['controluser'] - - :type: string - :default: ``''`` - -.. config:option:: $cfg['Servers'][$i]['controlpass'] - - :type: string - :default: ``''`` - - This special account is used for 2 distinct purposes: to make possible all - relational features (see :config:option:`$cfg['Servers'][$i]['pmadb']`). - - .. versionchanged:: 2.2.5 - those were called ``stduser`` and ``stdpass`` - - .. seealso:: :ref:`setup`, :ref:`authentication_modes`, :ref:`linked-tables` - -.. config:option:: $cfg['Servers'][$i]['auth_type'] - - :type: string - :default: ``'cookie'`` - - Whether config or cookie or :term:`HTTP` or signon authentication should be - used for this server. - - * 'config' authentication (``$auth_type = 'config'``) is the plain old - way: username and password are stored in :file:`config.inc.php`. - * 'cookie' authentication mode (``$auth_type = 'cookie'``) allows you to - log in as any valid MySQL user with the help of cookies. - * 'http' authentication allows you to log in as any - valid MySQL user via HTTP-Auth. - * 'signon' authentication mode (``$auth_type = 'signon'``) allows you to - log in from prepared PHP session data or using supplied PHP script. - - .. seealso:: :ref:`authentication_modes` - -.. _servers_auth_http_realm: -.. config:option:: $cfg['Servers'][$i]['auth_http_realm'] - - :type: string - :default: ``''`` - - When using auth\_type = ``http``, this field allows to define a custom - :term:`HTTP` Basic Auth Realm which will be displayed to the user. If not - explicitly specified in your configuration, a string combined of - "phpMyAdmin " and either :config:option:`$cfg['Servers'][$i]['verbose']` or - :config:option:`$cfg['Servers'][$i]['host']` will be used. - -.. _servers_user: -.. config:option:: $cfg['Servers'][$i]['user'] - - :type: string - :default: ``'root'`` - -.. config:option:: $cfg['Servers'][$i]['password'] - - :type: string - :default: ``''`` - - When using :config:option:`$cfg['Servers'][$i]['auth_type']` set to - 'config', this is the user/password-pair which phpMyAdmin will use to - connect to the MySQL server. This user/password pair is not needed when - :term:`HTTP` or cookie authentication is used - and should be empty. - -.. _servers_nopassword: -.. config:option:: $cfg['Servers'][$i]['nopassword'] - - :type: boolean - :default: false - - Allow attempt to log in without password when a login with password - fails. This can be used together with http authentication, when - authentication is done some other way and phpMyAdmin gets user name - from auth and uses empty password for connecting to MySQL. Password - login is still tried first, but as fallback, no password method is - tried. - -.. _servers_only_db: -.. config:option:: $cfg['Servers'][$i]['only_db'] - - :type: string or array - :default: ``''`` - - If set to a (an array of) database name(s), only this (these) - database(s) will be shown to the user. Since phpMyAdmin 2.2.1, - this/these database(s) name(s) may contain MySQL wildcards characters - ("\_" and "%"): if you want to use literal instances of these - characters, escape them (I.E. use ``'my\_db'`` and not ``'my_db'``). - - This setting is an efficient way to lower the server load since the - latter does not need to send MySQL requests to build the available - database list. But **it does not replace the privileges rules of the - MySQL database server**. If set, it just means only these databases - will be displayed but **not that all other databases can't be used.** - - An example of using more that one database: - - .. code-block:: php - - $cfg['Servers'][$i]['only_db'] = array('db1', 'db2'); - - .. versionchanged:: 4.0.0 - Previous versions permitted to specify the display order of - the database names via this directive. - -.. config:option:: $cfg['Servers'][$i]['hide_db'] - - :type: string - :default: ``''`` - - Regular expression for hiding some databases from unprivileged users. - This only hides them from listing, but a user is still able to access - them (using, for example, the SQL query area). To limit access, use - the MySQL privilege system. For example, to hide all databases - starting with the letter "a", use - - .. code-block:: php - - $cfg['Servers'][$i]['hide_db'] = '^a'; - - and to hide both "db1" and "db2" use - - .. code-block:: php - - $cfg['Servers'][$i]['hide_db'] = '^(db1|db2)$'; - - More information on regular expressions can be found in the `PCRE - pattern syntax - `_ portion - of the PHP reference manual. - -.. config:option:: $cfg['Servers'][$i]['verbose'] - - :type: string - :default: ``''`` - - Only useful when using phpMyAdmin with multiple server entries. If - set, this string will be displayed instead of the hostname in the - pull-down menu on the main page. This can be useful if you want to - show only certain databases on your system, for example. For HTTP - auth, all non-US-ASCII characters will be stripped. - -.. config:option:: $cfg['Servers'][$i]['pmadb'] - - :type: string - :default: ``''`` - - The name of the database containing the phpMyAdmin configuration - storage. - - See the :ref:`linked-tables` section in this document to see the benefits of - this feature, and for a quick way of creating this database and the needed - tables. - - If you are the only user of this phpMyAdmin installation, you can use your - current database to store those special tables; in this case, just put your - current database name in :config:option:`$cfg['Servers'][$i]['pmadb']`. For a - multi-user installation, set this parameter to the name of your central - database containing the phpMyAdmin configuration storage. - -.. _bookmark: -.. config:option:: $cfg['Servers'][$i]['bookmarktable'] - - :type: string or false - :default: ``''`` - - Since release 2.2.0 phpMyAdmin allows users to bookmark queries. This - can be useful for queries you often run. To allow the usage of this - functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * enter the table name in :config:option:`$cfg['Servers'][$i]['bookmarktable']` - - This feature can be disabled by setting the configuration to ``false``. - -.. _relation: -.. config:option:: $cfg['Servers'][$i]['relation'] - - :type: string or false - :default: ``''`` - - Since release 2.2.4 you can describe, in a special 'relation' table, - which column is a key in another table (a foreign key). phpMyAdmin - currently uses this to: - - * make clickable, when you browse the master table, the data values that - point to the foreign table; - * display in an optional tool-tip the "display column" when browsing the - master table, if you move the mouse to a column containing a foreign - key (use also the 'table\_info' table); (see :ref:`faqdisplay`) - * in edit/insert mode, display a drop-down list of possible foreign keys - (key value and "display column" are shown) (see :ref:`faq6_21`) - * display links on the table properties page, to check referential - integrity (display missing foreign keys) for each described key; - * in query-by-example, create automatic joins (see :ref:`faq6_6`) - * enable you to get a :term:`PDF` schema of - your database (also uses the table\_coords table). - - The keys can be numeric or character. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the relation table name in :config:option:`$cfg['Servers'][$i]['relation']` - * now as normal user open phpMyAdmin and for each one of your tables - where you want to use this feature, click :guilabel:`Structure/Relation view/` - and choose foreign columns. - - This feature can be disabled by setting the configuration to ``false``. - - .. note:: - - In the current version, ``master_db`` must be the same as ``foreign_db``. - Those columns have been put in future development of the cross-db - relations. - -.. _table_info: -.. config:option:: $cfg['Servers'][$i]['table_info'] - - :type: string or false - :default: ``''`` - - Since release 2.3.0 you can describe, in a special 'table\_info' - table, which column is to be displayed as a tool-tip when moving the - cursor over the corresponding key. This configuration variable will - hold the name of this special table. To allow the usage of this - functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['table\_info']` (e.g. - ``pma__table_info``) - * then for each table where you want to use this feature, click - "Structure/Relation view/Choose column to display" to choose the - column. - - This feature can be disabled by setting the configuration to ``false``. - - .. seealso:: :ref:`faqdisplay` - -.. _table_coords: -.. config:option:: $cfg['Servers'][$i]['table_coords'] - - :type: string or false - :default: ``''`` - -.. config:option:: $cfg['Servers'][$i]['pdf_pages'] - - :type: string or false - :default: ``''`` - - Since release 2.3.0 you can have phpMyAdmin create :term:`PDF` pages - showing the relations between your tables. Further, the designer interface - permits visually managing the relations. To do this it needs two tables - "pdf\_pages" (storing information about the available :term:`PDF` pages) - and "table\_coords" (storing coordinates where each table will be placed on - a :term:`PDF` schema output). You must be using the "relation" feature. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the correct table names in - :config:option:`$cfg['Servers'][$i]['table\_coords']` and - :config:option:`$cfg['Servers'][$i]['pdf\_pages']` - - This feature can be disabled by setting either of the configurations to ``false``. - - .. seealso:: :ref:`faqpdf`. - -.. _col_com: -.. config:option:: $cfg['Servers'][$i]['column_info'] - - :type: string or false - :default: ``''`` - - This part requires a content update! Since release 2.3.0 you can - store comments to describe each column for each table. These will then - be shown on the "printview". - - Starting with release 2.5.0, comments are consequently used on the table - property pages and table browse view, showing up as tool-tips above the - column name (properties page) or embedded within the header of table in - browse view. They can also be shown in a table dump. Please see the - relevant configuration directives later on. - - Also new in release 2.5.0 is a MIME- transformation system which is also - based on the following table structure. See :ref:`transformations` for - further information. To use the MIME- transformation system, your - column\_info table has to have the three new columns 'mimetype', - 'transformation', 'transformation\_options'. - - Starting with release 4.3.0, a new input-oriented transformation system - has been introduced. Also, backward compatibility code used in the old - transformations system was removed. As a result, an update to column\_info - table is necessary for previous transformations and the new input-oriented - transformation system to work. phpMyAdmin will upgrade it automatically - for you by analyzing your current column\_info table structure. - However, if something goes wrong with the auto-upgrade then you can - use the SQL script found in ``./sql/upgrade_column_info_4_3_0+.sql`` - to upgrade it manually. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['column\_info']` (e.g. - ``pma__column_info``) - * to update your PRE-2.5.0 Column\_comments table use this: and - remember that the Variable in :file:`config.inc.php` has been renamed from - :config:option:`$cfg['Servers'][$i]['column\_comments']` to - :config:option:`$cfg['Servers'][$i]['column\_info']` - - .. code-block:: mysql - - ALTER TABLE `pma__column_comments` - ADD `mimetype` VARCHAR( 255 ) NOT NULL, - ADD `transformation` VARCHAR( 255 ) NOT NULL, - ADD `transformation_options` VARCHAR( 255 ) NOT NULL; - * to update your PRE-4.3.0 Column\_info table manually use this - ``./sql/upgrade_column_info_4_3_0+.sql`` SQL script. - - This feature can be disabled by setting the configuration to ``false``. - - .. note:: - - For auto-upgrade functionality to work, your - ``$cfg['Servers'][$i]['controluser']`` must have ALTER privilege on - ``phpmyadmin`` database. See the `MySQL documentation for GRANT - `_ on how to - ``GRANT`` privileges to a user. - -.. _history: -.. config:option:: $cfg['Servers'][$i]['history'] - - :type: string or false - :default: ``''`` - - Since release 2.5.0 you can store your :term:`SQL` history, which means all - queries you entered manually into the phpMyAdmin interface. If you don't - want to use a table-based history, you can use the JavaScript-based - history. - - Using that, all your history items are deleted when closing the window. - Using :config:option:`$cfg['QueryHistoryMax']` you can specify an amount of - history items you want to have on hold. On every login, this list gets cut - to the maximum amount. - - The query history is only available if JavaScript is enabled in - your browser. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['history']` (e.g. - ``pma__history``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _recent: -.. config:option:: $cfg['Servers'][$i]['recent'] - - :type: string or false - :default: ``''`` - - Since release 3.5.0 you can show recently used tables in the - navigation panel. It helps you to jump across table directly, without - the need to select the database, and then select the table. Using - :config:option:`$cfg['NumRecentTables']` you can configure the maximum number - of recent tables shown. When you select a table from the list, it will jump to - the page specified in :config:option:`$cfg['NavigationTreeDefaultTabTable']`. - - Without configuring the storage, you can still access the recently used tables, - but it will disappear after you logout. - - To allow the usage of this functionality persistently: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['recent']` (e.g. - ``pma__recent``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _favorite: -.. config:option:: $cfg['Servers'][$i]['favorite'] - - :type: string or false - :default: ``''`` - - Since release 4.2.0 you can show a list of selected tables in the - navigation panel. It helps you to jump to the table directly, without - the need to select the database, and then select the table. When you - select a table from the list, it will jump to the page specified in - :config:option:`$cfg['NavigationTreeDefaultTabTable']`. - - You can add tables to this list or remove tables from it in database - structure page by clicking on the star icons next to table names. Using - :config:option:`$cfg['NumFavoriteTables']` you can configure the maximum - number of favorite tables shown. - - Without configuring the storage, you can still access the favorite tables, - but it will disappear after you logout. - - To allow the usage of this functionality persistently: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['favorite']` (e.g. - ``pma__favorite``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _table_uiprefs: -.. config:option:: $cfg['Servers'][$i]['table_uiprefs'] - - :type: string or false - :default: ``''`` - - Since release 3.5.0 phpMyAdmin can be configured to remember several - things (sorted column :config:option:`$cfg['RememberSorting']`, column order, - and column visibility from a database table) for browsing tables. Without - configuring the storage, these features still can be used, but the values will - disappear after you logout. - - To allow the usage of these functionality persistently: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['table\_uiprefs']` (e.g. - ``pma__table_uiprefs``) - - This feature can be disabled by setting the configuration to ``false``. - -.. config:option:: $cfg['Servers'][$i]['users'] - - :type: string or false - :default: ``''`` - -.. config:option:: $cfg['Servers'][$i]['usergroups'] - - :type: string or false - :default: ``''`` - - Since release 4.1.0 you can create different user groups with menu items - attached to them. Users can be assigned to these groups and the logged in - user would only see menu items configured to the usergroup he is assigned to. - To do this it needs two tables "usergroups" (storing allowed menu items for each - user group) and "users" (storing users and their assignments to user groups). - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the correct table names in - :config:option:`$cfg['Servers'][$i]['users']` (e.g. ``pma__users``) and - :config:option:`$cfg['Servers'][$i]['usergroups']` (e.g. ``pma__usergroups``) - - This feature can be disabled by setting either of the configurations to ``false``. - - .. seealso:: :ref:`configurablemenus` - -.. _navigationhiding: -.. config:option:: $cfg['Servers'][$i]['navigationhiding'] - - :type: string or false - :default: ``''`` - - Since release 4.1.0 you can hide/show items in the navigation tree. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['navigationhiding']` (e.g. - ``pma__navigationhiding``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _central_columns: -.. config:option:: $cfg['Servers'][$i]['central_columns'] - - :type: string or false - :default: ``''`` - - Since release 4.3.0 you can have a central list of columns per database. - You can add/remove columns to the list as per your requirement. These columns - in the central list will be available to use while you create a new column for - a table or create a table itself. You can select a column from central list - while creating a new column, it will save you from writing the same column definition - over again or from writing different names for similar column. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['central_columns']` (e.g. - ``pma__central_columns``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _designer_settings: -.. config:option:: $cfg['Servers'][$i]['designer_settings'] - - :type: string or false - :default: ``''`` - - Since release 4.5.0 your designer settings can be remembered. - Your choice regarding 'Angular/Direct Links', 'Snap to Grid', 'Toggle Relation Lines', - 'Small/Big All', 'Move Menu' and 'Pin Text' can be remembered persistently. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['designer_settings']` (e.g. - ``pma__designer_settings``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _savedsearches: -.. config:option:: $cfg['Servers'][$i]['savedsearches'] - - :type: string or false - :default: ``''`` - - Since release 4.2.0 you can save and load query-by-example searches from the Database > Query panel. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['savedsearches']` (e.g. - ``pma__savedsearches``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _export_templates: -.. config:option:: $cfg['Servers'][$i]['export_templates'] - - :type: string or false - :default: ``''`` - - Since release 4.5.0 you can save and load export templates. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['export_templates']` (e.g. - ``pma__export_templates``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _tracking: -.. config:option:: $cfg['Servers'][$i]['tracking'] - - :type: string or false - :default: ``''`` - - Since release 3.3.x a tracking mechanism is available. It helps you to - track every :term:`SQL` command which is - executed by phpMyAdmin. The mechanism supports logging of data - manipulation and data definition statements. After enabling it you can - create versions of tables. - - The creation of a version has two effects: - - * phpMyAdmin saves a snapshot of the table, including structure and - indexes. - * phpMyAdmin logs all commands which change the structure and/or data of - the table and links these commands with the version number. - - Of course you can view the tracked changes. On the :guilabel:`Tracking` - page a complete report is available for every version. For the report you - can use filters, for example you can get a list of statements within a date - range. When you want to filter usernames you can enter \* for all names or - you enter a list of names separated by ','. In addition you can export the - (filtered) report to a file or to a temporary database. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['tracking']` (e.g. - ``pma__tracking``) - - This feature can be disabled by setting the configuration to ``false``. - -.. _tracking2: -.. config:option:: $cfg['Servers'][$i]['tracking_version_auto_create'] - - :type: boolean - :default: false - - Whether the tracking mechanism creates versions for tables and views - automatically. - - If this is set to true and you create a table or view with - - * CREATE TABLE ... - * CREATE VIEW ... - - and no version exists for it, the mechanism will create a version for - you automatically. - -.. _tracking3: -.. config:option:: $cfg['Servers'][$i]['tracking_default_statements'] - - :type: string - :default: ``'CREATE TABLE,ALTER TABLE,DROP TABLE,RENAME TABLE,CREATE INDEX,DROP INDEX,INSERT,UPDATE,DELETE,TRUNCATE,REPLACE,CREATE VIEW,ALTER VIEW,DROP VIEW,CREATE DATABASE,ALTER DATABASE,DROP DATABASE'`` - - Defines the list of statements the auto-creation uses for new - versions. - -.. _tracking4: -.. config:option:: $cfg['Servers'][$i]['tracking_add_drop_view'] - - :type: boolean - :default: true - - Whether a DROP VIEW IF EXISTS statement will be added as first line to - the log when creating a view. - -.. _tracking5: -.. config:option:: $cfg['Servers'][$i]['tracking_add_drop_table'] - - :type: boolean - :default: true - - Whether a DROP TABLE IF EXISTS statement will be added as first line - to the log when creating a table. - -.. _tracking6: -.. config:option:: $cfg['Servers'][$i]['tracking_add_drop_database'] - - :type: boolean - :default: true - - Whether a DROP DATABASE IF EXISTS statement will be added as first - line to the log when creating a database. - -.. _userconfig: -.. config:option:: $cfg['Servers'][$i]['userconfig'] - - :type: string or false - :default: ``''`` - - Since release 3.4.x phpMyAdmin allows users to set most preferences by - themselves and store them in the database. - - If you don't allow for storing preferences in - :config:option:`$cfg['Servers'][$i]['pmadb']`, users can still personalize - phpMyAdmin, but settings will be saved in browser's local storage, or, it - is is unavailable, until the end of session. - - To allow the usage of this functionality: - - * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage - * put the table name in :config:option:`$cfg['Servers'][$i]['userconfig']` - - This feature can be disabled by setting the configuration to ``false``. - -.. config:option:: $cfg['Servers'][$i]['MaxTableUiprefs'] - - :type: integer - :default: 100 - - Maximum number of rows saved in - :config:option:`$cfg['Servers'][$i]['table_uiprefs']` table. - - When tables are dropped or renamed, - :config:option:`$cfg['Servers'][$i]['table_uiprefs']` may contain invalid data - (referring to tables which no longer exist). We only keep this number of newest - rows in :config:option:`$cfg['Servers'][$i]['table_uiprefs']` and automatically - delete older rows. - -.. config:option:: $cfg['Servers'][$i]['SessionTimeZone'] - - :type: string - :default: ``''`` - - Sets the time zone used by phpMyAdmin. Leave blank to use the time zone of your - database server. Possible values are explained at - https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html - - This is useful when your database server uses a time zone which is different from the - time zone you want to use in phpMyAdmin. - -.. config:option:: $cfg['Servers'][$i]['AllowRoot'] - - :type: boolean - :default: true - - Whether to allow root access. This is just a shortcut for the - :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` below. - -.. config:option:: $cfg['Servers'][$i]['AllowNoPassword'] - - :type: boolean - :default: false - - Whether to allow logins without a password. The default value of - ``false`` for this parameter prevents unintended access to a MySQL - server with was left with an empty password for root or on which an - anonymous (blank) user is defined. - -.. _servers_allowdeny_order: -.. config:option:: $cfg['Servers'][$i]['AllowDeny']['order'] - - :type: string - :default: ``''`` - - If your rule order is empty, then :term:`IP` - authorization is disabled. - - If your rule order is set to - ``'deny,allow'`` then the system applies all deny rules followed by - allow rules. Access is allowed by default. Any client which does not - match a Deny command or does match an Allow command will be allowed - access to the server. - - If your rule order is set to ``'allow,deny'`` - then the system applies all allow rules followed by deny rules. Access - is denied by default. Any client which does not match an Allow - directive or does match a Deny directive will be denied access to the - server. - - If your rule order is set to ``'explicit'``, authorization is - performed in a similar fashion to rule order 'deny,allow', with the - added restriction that your host/username combination **must** be - listed in the *allow* rules, and not listed in the *deny* rules. This - is the **most** secure means of using Allow/Deny rules, and was - available in Apache by specifying allow and deny rules without setting - any order. - - Please also see :config:option:`$cfg['TrustedProxies']` for - detecting IP address behind proxies. - -.. _servers_allowdeny_rules: -.. config:option:: $cfg['Servers'][$i]['AllowDeny']['rules'] - - :type: array of strings - :default: array() - - The general format for the rules is as such: - - .. code-block:: none - - <'allow' | 'deny'> [from] - - If you wish to match all users, it is possible to use a ``'%'`` as a - wildcard in the *username* field. - - There are a few shortcuts you can - use in the *ipmask* field as well (please note that those containing - SERVER\_ADDRESS might not be available on all webservers): - - .. code-block:: none - - - 'all' -> 0.0.0.0/0 - 'localhost' -> 127.0.0.1/8 - 'localnetA' -> SERVER_ADDRESS/8 - 'localnetB' -> SERVER_ADDRESS/16 - 'localnetC' -> SERVER_ADDRESS/24 - - Having an empty rule list is equivalent to either using ``'allow % - from all'`` if your rule order is set to ``'deny,allow'`` or ``'deny % - from all'`` if your rule order is set to ``'allow,deny'`` or - ``'explicit'``. - - For the :term:`IP address` matching - system, the following work: - - * ``xxx.xxx.xxx.xxx`` (an exact :term:`IP address`) - * ``xxx.xxx.xxx.[yyy-zzz]`` (an :term:`IP address` range) - * ``xxx.xxx.xxx.xxx/nn`` (CIDR, Classless Inter-Domain Routing type :term:`IP` addresses) - - But the following does not work: - - * ``xxx.xxx.xxx.xx[yyy-zzz]`` (partial :term:`IP` address range) - - For :term:`IPv6` addresses, the following work: - - * ``xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx`` (an exact :term:`IPv6` address) - * ``xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:[yyyy-zzzz]`` (an :term:`IPv6` address range) - * ``xxxx:xxxx:xxxx:xxxx/nn`` (CIDR, Classless Inter-Domain Routing type :term:`IPv6` addresses) - - But the following does not work: - - * ``xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xx[yyy-zzz]`` (partial :term:`IPv6` address range) - -.. config:option:: $cfg['Servers'][$i]['DisableIS'] - - :type: boolean - :default: false - - Disable using ``INFORMATION_SCHEMA`` to retrieve information (use - ``SHOW`` commands instead), because of speed issues when many - databases are present. Currently used in some parts of the code, more - to come. - -.. config:option:: $cfg['Servers'][$i]['SignonScript'] - - :type: string - :default: ``''`` - - Name of PHP script to be sourced and executed to obtain login - credentials. This is alternative approach to session based single - signon. The script has to provide a function called - ``get_login_credentials`` which returns list of username and - password, accepting single parameter of existing username (can be - empty). See :file:`examples/signon-script.php` for an example: - - .. literalinclude:: ../examples/signon-script.php - :language: php - - .. seealso:: :ref:`auth_signon` - -.. config:option:: $cfg['Servers'][$i]['SignonSession'] - - :type: string - :default: ``''`` - - Name of session which will be used for signon authentication method. - You should use something different than ``phpMyAdmin``, because this - is session which phpMyAdmin uses internally. Takes effect only if - :config:option:`$cfg['Servers'][$i]['SignonScript']` is not configured. - - .. seealso:: :ref:`auth_signon` - -.. config:option:: $cfg['Servers'][$i]['SignonURL'] - - :type: string - :default: ``''`` - - :term:`URL` where user will be redirected - to log in for signon authentication method. Should be absolute - including protocol. - - .. seealso:: :ref:`auth_signon` - -.. config:option:: $cfg['Servers'][$i]['LogoutURL'] - - :type: string - :default: ``''`` - - :term:`URL` where user will be redirected - after logout (doesn't affect config authentication method). Should be - absolute including protocol. - -Generic settings ----------------- - -.. config:option:: $cfg['ServerDefault'] - - :type: integer - :default: 1 - - If you have more than one server configured, you can set - :config:option:`$cfg['ServerDefault']` to any one of them to autoconnect to that - server when phpMyAdmin is started, or set it to 0 to be given a list - of servers without logging in. - - If you have only one server configured, - :config:option:`$cfg['ServerDefault']` MUST be set to that server. - -.. config:option:: $cfg['VersionCheck'] - - :type: boolean - :default: true - - Enables check for latest versions using JavaScript on the main phpMyAdmin - page or by directly accessing :file:`version_check.php`. - - .. note:: - - This setting can be adjusted by your vendor. - -.. config:option:: $cfg['ProxyUrl'] - - :type: string - :default: "" - - The url of the proxy to be used when phpmyadmin needs to access the outside - internet such as when retrieving the latest version info or submitting error - reports. You need this if the server where phpMyAdmin is installed does not - have direct access to the internet. - The format is: "hostname:portnumber" - -.. config:option:: $cfg['ProxyUser'] - - :type: string - :default: "" - - The username for authenticating with the proxy. By default, no - authentication is performed. If a username is supplied, Basic - Authentication will be performed. No other types of authentication - are currently supported. - -.. config:option:: $cfg['ProxyPass'] - - :type: string - :default: "" - - The password for authenticating with the proxy. - -.. config:option:: $cfg['MaxDbList'] - - :type: integer - :default: 100 - - The maximum number of database names to be displayed in the main panel's - database list. - -.. config:option:: $cfg['MaxTableList'] - - :type: integer - :default: 250 - - The maximum number of table names to be displayed in the main panel's - list (except on the Export page). - -.. config:option:: $cfg['ShowHint'] - - :type: boolean - :default: true - - Whether or not to show hints (for example, hints when hovering over - table headers). - -.. config:option:: $cfg['MaxCharactersInDisplayedSQL'] - - :type: integer - :default: 1000 - - The maximum number of characters when a :term:`SQL` query is displayed. The - default limit of 1000 should be correct to avoid the display of tons of - hexadecimal codes that represent BLOBs, but some users have real - :term:`SQL` queries that are longer than 1000 characters. Also, if a - query's length exceeds this limit, this query is not saved in the history. - -.. config:option:: $cfg['PersistentConnections'] - - :type: boolean - :default: false - - Whether `persistent connections `_ should be used or not. Works with - following extensions: - - * mysql (`mysql\_pconnect `_), - * mysqli (requires PHP 5.3.0 or newer, `more information - `_). - -.. config:option:: $cfg['ForceSSL'] - - :type: boolean - :default: false - - .. deprecated:: 4.6.0 - - This setting is no longer available since phpMyAdmin 4.6.0. Please - adjust your webserver instead. - - Whether to force using https while accessing phpMyAdmin. In a reverse - proxy setup, setting this to ``true`` is not supported. - - .. note:: - - In some setups (like separate SSL proxy or load balancer) you might - have to set :config:option:`$cfg['PmaAbsoluteUri']` for correct - redirection. - -.. config:option:: $cfg['ExecTimeLimit'] - - :type: integer [number of seconds] - :default: 300 - - Set the number of seconds a script is allowed to run. If seconds is - set to zero, no time limit is imposed. This setting is used while - importing/exporting dump files but has - no effect when PHP is running in safe mode. - -.. config:option:: $cfg['SessionSavePath'] - - :type: string - :default: ``''`` - - Path for storing session data (`session\_save\_path PHP parameter - `_). - -.. config:option:: $cfg['MemoryLimit'] - - :type: string [number of bytes] - :default: ``'-1'`` - - Set the number of bytes a script is allowed to allocate. If set to - ``'-1'``, no limit is imposed. If set to ``'0'``, no change of the - memory limit is attempted and the :file:`php.ini` ``memory_limit`` is - used. - - This setting is used while importing/exporting dump files - so you definitely don't want to put here a too low - value. It has no effect when PHP is running in safe mode. - - You can also use any string as in :file:`php.ini`, eg. '16M'. Ensure you - don't omit the suffix (16 means 16 bytes!) - -.. config:option:: $cfg['SkipLockedTables'] - - :type: boolean - :default: false - - Mark used tables and make it possible to show databases with locked - tables (since MySQL 3.23.30). - -.. config:option:: $cfg['ShowSQL'] - - :type: boolean - :default: true - - Defines whether :term:`SQL` queries - generated by phpMyAdmin should be displayed or not. - -.. config:option:: $cfg['RetainQueryBox'] - - :type: boolean - :default: false - - Defines whether the :term:`SQL` query box - should be kept displayed after its submission. - -.. config:option:: $cfg['CodemirrorEnable'] - - :type: boolean - :default: true - - Defines whether to use a Javascript code editor for SQL query boxes. - CodeMirror provides syntax highlighting and line numbers. However, - middle-clicking for pasting the clipboard contents in some Linux - distributions (such as Ubuntu) is not supported by all browsers. - -.. config:option:: $cfg['DefaultForeignKeyChecks'] - - :type: string - :default: ``'default'`` - - Default value of the checkbox for foreign key checks, to disable/enable - foreign key checks for certain queries. The possible values are ``'default'``, - ``'enable'`` or ``'disable'``. If set to ``'default'``, the value of the - MySQL variable ``FOREIGN_KEY_CHECKS`` is used. - -.. config:option:: $cfg['AllowUserDropDatabase'] - - :type: boolean - :default: false - - .. warning:: - - This is not a security measure as there will be always ways to - circumvent this. If you want to prohibit users from dropping databases, - revoke their corresponding DROP privilege. - - Defines whether normal users (non-administrator) are allowed to delete - their own database or not. If set as false, the link :guilabel:`Drop - Database` will not be shown, and even a ``DROP DATABASE mydatabase`` will - be rejected. Quite practical for :term:`ISP` 's with many customers. - - This limitation of :term:`SQL` queries is not as strict as when using MySQL - privileges. This is due to nature of :term:`SQL` queries which might be - quite complicated. So this choice should be viewed as help to avoid - accidental dropping rather than strict privilege limitation. - -.. config:option:: $cfg['Confirm'] - - :type: boolean - :default: true - - Whether a warning ("Are your really sure...") should be displayed when - you're about to lose data. - -.. config:option:: $cfg['UseDbSearch'] - - :type: boolean - :default: true - - Define whether the "search string inside database" is enabled or not. - -.. config:option:: $cfg['IgnoreMultiSubmitErrors'] - - :type: boolean - :default: false - - Define whether phpMyAdmin will continue executing a multi-query - statement if one of the queries fails. Default is to abort execution. - -Cookie authentication options ------------------------------ - -.. config:option:: $cfg['blowfish_secret'] - - :type: string - :default: ``''`` - - The "cookie" auth\_type uses AES algorithm to encrypt the password. If you - are using the "cookie" auth\_type, enter here a random passphrase of your - choice. It will be used internally by the AES algorithm: you won’t be - prompted for this passphrase. - - The secret should be 32 characters long. Using shorter will lead to weaker security - of encrypted cookies, using longer will cause no harm. - - .. note:: - - The configuration is called blowfish_secret for historical reasons as - Blowfish algorithm was originally used to do the encryption. - - .. versionchanged:: 3.1.0 - Since version 3.1.0 phpMyAdmin can generate this on the fly, but it - makes a bit weaker security as this generated secret is stored in - session and furthermore it makes impossible to recall user name from - cookie. - -.. config:option:: $cfg['LoginCookieRecall'] - - :type: boolean - :default: true - - Define whether the previous login should be recalled or not in cookie - authentication mode. - - This is automatically disabled if you do not have - configured :config:option:`$cfg['blowfish_secret']`. - -.. config:option:: $cfg['LoginCookieValidity'] - - :type: integer [number of seconds] - :default: 1440 - - Define how long a login cookie is valid. Please note that php - configuration option `session.gc\_maxlifetime - `_ might limit session validity and if the session is lost, - the login cookie is also invalidated. So it is a good idea to set - ``session.gc_maxlifetime`` at least to the same value of - :config:option:`$cfg['LoginCookieValidity']`. - -.. config:option:: $cfg['LoginCookieStore'] - - :type: integer [number of seconds] - :default: 0 - - Define how long login cookie should be stored in browser. Default 0 - means that it will be kept for existing session. This is recommended - for not trusted environments. - -.. config:option:: $cfg['LoginCookieDeleteAll'] - - :type: boolean - :default: true - - If enabled (default), logout deletes cookies for all servers, - otherwise only for current one. Setting this to false makes it easy to - forget to log out from other server, when you are using more of them. - -.. _AllowArbitraryServer: -.. config:option:: $cfg['AllowArbitraryServer'] - - :type: boolean - :default: false - - If enabled, allows you to log in to arbitrary servers using cookie - authentication. - - .. note:: - - Please use this carefully, as this may allow users access to MySQL servers - behind the firewall where your :term:`HTTP` server is placed. - See also :config:option:`$cfg['ArbitraryServerRegexp']`. - -.. config:option:: $cfg['ArbitraryServerRegexp'] - - :type: string - :default: ``''`` - - Restricts the MySQL servers to which the user can log in when - :config:option:`$cfg['AllowArbitraryServer']` is enabled by - matching the :term:`IP` or the hostname of the MySQL server - to the given regular expression. The regular expression must be enclosed - with a delimiter character. - - It is recommended to include start and end symbols in the regullar - expression, so that you can avoid partial matches on the string. - - **Examples:** - - .. code-block:: php - - // Allow connection to three listed servers: - $cfg['ArbitraryServerRegexp'] = '/^(server|another|yetdifferent)$/'; - - // Allow connection to range of IP addresses: - $cfg['ArbitraryServerRegexp'] = '@^192\.168\.0\.[0-9]{1,}$@'; - - // Allow connection to server name ending with -mysql: - $cfg['ArbitraryServerRegexp'] = '@^[^:]\-mysql$@'; - - .. note:: - - The whole server name is matched, it can include port as well. Due to - way MySQL is permissive in connection parameters, it is possible to use - connection strings as ```server:3306-mysql```. This can be used to - bypass regullar expression by the suffix, while connecting to another - server. - -.. config:option:: $cfg['CaptchaLoginPublicKey'] - - :type: string - :default: ``''`` - - The public key for the reCaptcha service that can be obtained from - https://www.google.com/recaptcha. - - reCaptcha will be then used in :ref:`cookie`. - -.. config:option:: $cfg['CaptchaLoginPrivateKey'] - - :type: string - :default: ``''`` - - The private key for the reCaptcha service that can be obtain from - https://www.google.com/recaptcha. - - reCaptcha will be then used in :ref:`cookie`. - -Navigation panel setup ----------------------- - -.. config:option:: $cfg['ShowDatabasesNavigationAsTree'] - - :type: boolean - :default: true - - In the navigation panel, replaces the database tree with a selector - -.. config:option:: $cfg['FirstLevelNavigationItems'] - - :type: integer - :default: 100 - - The number of first level databases that can be displayed on each page - of navigation tree. - -.. config:option:: $cfg['MaxNavigationItems'] - - :type: integer - :default: 50 - - The number of items (tables, columns, indexes) that can be displayed on each - page of the navigation tree. - -.. config:option:: $cfg['NavigationTreeEnableGrouping'] - - :type: boolean - :default: true - - Defines whether to group the databases based on a common prefix - in their name :config:option:`$cfg['NavigationTreeDbSeparator']`. - -.. config:option:: $cfg['NavigationTreeDbSeparator'] - - :type: string - :default: ``'_'`` - - The string used to separate the parts of the database name when - showing them in a tree. - -.. config:option:: $cfg['NavigationTreeTableSeparator'] - - :type: string or array - :default: ``'__'`` - - Defines a string to be used to nest table spaces. This means if you have - tables like ``first__second__third`` this will be shown as a three-level - hierarchy like: first > second > third. If set to false or empty, the - feature is disabled. NOTE: You should not use this separator at the - beginning or end of a table name or multiple times after another without - any other characters in between. - -.. config:option:: $cfg['NavigationTreeTableLevel'] - - :type: integer - :default: 1 - - Defines how many sublevels should be displayed when splitting up - tables by the above separator. - -.. config:option:: $cfg['NumRecentTables'] - - :type: integer - :default: 10 - - The maximum number of recently used tables shown in the navigation - panel. Set this to 0 (zero) to disable the listing of recent tables. - -.. config:option:: $cfg['NumFavoriteTables'] - - :type: integer - :default: 10 - - The maximum number of favorite tables shown in the navigation - panel. Set this to 0 (zero) to disable the listing of favorite tables. - -.. config:option:: $cfg['ZeroConf'] - - :type: boolean - :default: true - - Enables Zero Configuration mode in which the user will be offered a choice to - create phpMyAdmin configuration storage in the current database - or use the existing one, if already present. - - This setting has no effect if the phpMyAdmin configuration storage database - is properly created and the related configuration directives (such as - :config:option:`$cfg['Servers'][$i]['pmadb']` and so on) are configured. - -.. config:option:: $cfg['NavigationLinkWithMainPanel'] - - :type: boolean - :default: true - - Defines whether or not to link with main panel by highlighting - the current database or table. - -.. config:option:: $cfg['NavigationDisplayLogo'] - - :type: boolean - :default: true - - Defines whether or not to display the phpMyAdmin logo at the top of - the navigation panel. - -.. config:option:: $cfg['NavigationLogoLink'] - - :type: string - :default: ``'index.php'`` - - Enter :term:`URL` where logo in the navigation panel will point to. - For use especially with self made theme which changes this. - For external URLs, you should include URL scheme as well. - -.. config:option:: $cfg['NavigationLogoLinkWindow'] - - :type: string - :default: ``'main'`` - - Whether to open the linked page in the main window (``main``) or in a - new one (``new``). Note: use ``new`` if you are linking to - ``phpmyadmin.net``. - -.. config:option:: $cfg['NavigationTreeDisplayItemFilterMinimum'] - - :type: integer - :default: 30 - - Defines the minimum number of items (tables, views, routines and - events) to display a JavaScript filter box above the list of items in - the navigation tree. - - To disable the filter completely some high number can be used (e.g. 9999) - -.. config:option:: $cfg['NavigationTreeDisplayDbFilterMinimum'] - - :type: integer - :default: 30 - - Defines the minimum number of databases to display a JavaScript filter - box above the list of databases in the navigation tree. - - To disable the filter completely some high number can be used - (e.g. 9999) - -.. config:option:: $cfg['NavigationDisplayServers'] - - :type: boolean - :default: true - - Defines whether or not to display a server choice at the top of the - navigation panel. - -.. config:option:: $cfg['DisplayServersList'] - - :type: boolean - :default: false - - Defines whether to display this server choice as links instead of in a - drop-down. - -.. config:option:: $cfg['NavigationTreeDefaultTabTable'] - - :type: string - :default: ``'structure'`` - - Defines the tab displayed by default when clicking the small icon next - to each table name in the navigation panel. The possible values are the - localized equivalent of: - - * ``structure`` - * ``sql`` - * ``search`` - * ``insert`` - * ``browse`` - -.. config:option:: $cfg['NavigationTreeDefaultTabTable2'] - - :type: string - :default: null - - Defines the tab displayed by default when clicking the second small icon next - to each table name in the navigation panel. The possible values are the - localized equivalent of: - - * ``(empty)`` - * ``structure`` - * ``sql`` - * ``search`` - * ``insert`` - * ``browse`` - -.. config:option:: $cfg['NavigationTreeEnableExpansion'] - - :type: boolean - :default: false - - Whether to offer the possibility of tree expansion in the navigation panel. - -.. config:option:: $cfg['NavigationTreeShowTables'] - - :type: boolean - :default: true - - Whether to show tables under database in the navigation panel. - -.. config:option:: $cfg['NavigationTreeShowViews'] - - :type: boolean - :default: true - - Whether to show views under database in the navigation panel. - -.. config:option:: $cfg['NavigationTreeShowFunctions'] - - :type: boolean - :default: true - - Whether to show functions under database in the navigation panel. - -.. config:option:: $cfg['NavigationTreeShowProcedures'] - - :type: boolean - :default: true - - Whether to show procedures under database in the navigation panel. - -.. config:option:: $cfg['NavigationTreeShowEvents'] - - :type: boolean - :default: true - - Whether to show events under database in the navigation panel. - - -Main panel ----------- - -.. config:option:: $cfg['ShowStats'] - - :type: boolean - :default: true - - Defines whether or not to display space usage and statistics about - databases and tables. Note that statistics requires at least MySQL - 3.23.3 and that, at this date, MySQL doesn't return such information - for Berkeley DB tables. - -.. config:option:: $cfg['ShowServerInfo'] - - :type: boolean - :default: true - - Defines whether to display detailed server information on main page. - You can additionally hide more information by using - :config:option:`$cfg['Servers'][$i]['verbose']`. - -.. config:option:: $cfg['ShowChgPassword'] - - :type: boolean - :default: true - -.. config:option:: $cfg['ShowCreateDb'] - - :type: boolean - :default: true - - Defines whether to display the - :guilabel:`Change password` links and form for creating database or not at - the starting main (right) frame. This setting does not check MySQL commands - entered directly. - - Also note that enabling the :guilabel:`Change password` link has no effect - with config authentication mode: because of the hard coded password value - in the configuration file, end users can't be allowed to change their - passwords. - -.. config:option:: $cfg['ShowGitRevision'] - - :type: boolean - :default: true - - Defines whether to display informations about the current Git revision (if - applicable) on the main panel. - -.. config:option:: $cfg['MysqlMinVersion'] - - :type: array - - Defines the minimum supported MySQL version. The default is chosen - by the phpMyAdmin team; however this directive was asked by a developer - of the Plesk control panel to ease integration with older MySQL servers - (where most of the phpMyAdmin features work). - -Database structure ------------------- - -.. config:option:: $cfg['ShowDbStructureCreation'] - - :type: boolean - :default: false - - Defines whether the database structure page (tables list) has a - "Creation" column that displays when each table was created. - -.. config:option:: $cfg['ShowDbStructureLastUpdate'] - - :type: boolean - :default: false - - Defines whether the database structure page (tables list) has a "Last - update" column that displays when each table was last updated. - -.. config:option:: $cfg['ShowDbStructureLastCheck'] - - :type: boolean - :default: false - - Defines whether the database structure page (tables list) has a "Last - check" column that displays when each table was last checked. - -.. config:option:: $cfg['HideStructureActions'] - - :type: boolean - :default: true - - Defines whether the table structure actions are hidden under a "More" - drop-down. - -Browse mode ------------ - -.. config:option:: $cfg['TableNavigationLinksMode'] - - :type: string - :default: ``'icons'`` - - Defines whether the table navigation links contain ``'icons'``, ``'text'`` - or ``'both'``. - -.. config:option:: $cfg['ActionLinksMode'] - - :type: string - :default: ``'both'`` - - If set to ``icons``, will display icons instead of text for db and table - properties links (like :guilabel:`Browse`, :guilabel:`Select`, - :guilabel:`Insert`, ...). Can be set to ``'both'`` - if you want icons AND text. When set to ``text``, will only show text. - -.. config:option:: $cfg['RowActionType'] - - :type: string - :default: ``'both'`` - - Whether to display icons or text or both icons and text in table row action - segment. Value can be either of ``'icons'``, ``'text'`` or ``'both'``. - -.. config:option:: $cfg['ShowAll'] - - :type: boolean - :default: false - - Defines whether a user should be displayed a "Show all" button in browse - mode or not in all cases. By default it is shown only on small tables (less - than 500 rows) to avoid performance issues while getting too many rows. - -.. config:option:: $cfg['MaxRows'] - - :type: integer - :default: 25 - - Number of rows displayed when browsing a result set and no LIMIT - clause is used. If the result set contains more rows, "Previous" and - "Next" links will be shown. Possible values: 25,50,100,250,500. - -.. config:option:: $cfg['Order'] - - :type: string - :default: ``'SMART'`` - - Defines whether columns are displayed in ascending (``ASC``) order, in - descending (``DESC``) order or in a "smart" (``SMART``) order - I.E. - descending order for columns of type TIME, DATE, DATETIME and - TIMESTAMP, ascending order else- by default. - -.. config:option:: $cfg['GridEditing'] - - :type: string - :default: ``'double-click'`` - - Defines which action (``double-click`` or ``click``) triggers grid - editing. Can be deactivated with the ``disabled`` value. - -.. config:option:: $cfg['RelationalDisplay'] - - :type: string - :default: ``'K'`` - - Defines the initial behavior for Options > Relational. ``K``, which - is the default, displays the key while ``D`` shows the display column. - -.. config:option:: $cfg['SaveCellsAtOnce'] - - :type: boolean - :default: false - - Defines whether or not to save all edited cells at once for grid - editing. - -Editing mode ------------- - -.. config:option:: $cfg['ProtectBinary'] - - :type: boolean or string - :default: ``'blob'`` - - Defines whether ``BLOB`` or ``BINARY`` columns are protected from - editing when browsing a table's content. Valid values are: - - * ``false`` to allow editing of all columns; - * ``'blob'`` to allow editing of all columns except ``BLOBS``; - * ``'noblob'`` to disallow editing of all columns except ``BLOBS`` (the - opposite of ``'blob'``); - * ``'all'`` to disallow editing of all ``BINARY`` or ``BLOB`` columns. - -.. config:option:: $cfg['ShowFunctionFields'] - - :type: boolean - :default: true - - Defines whether or not MySQL functions fields should be initially - displayed in edit/insert mode. Since version 2.10, the user can toggle - this setting from the interface. - -.. config:option:: $cfg['ShowFieldTypesInDataEditView'] - - :type: boolean - :default: true - - Defines whether or not type fields should be initially displayed in - edit/insert mode. The user can toggle this setting from the interface. - -.. config:option:: $cfg['InsertRows'] - - :type: integer - :default: 2 - - Defines the maximum number of concurrent entries for the Insert page. - -.. config:option:: $cfg['ForeignKeyMaxLimit'] - - :type: integer - :default: 100 - - If there are fewer items than this in the set of foreign keys, then a - drop-down box of foreign keys is presented, in the style described by - the :config:option:`$cfg['ForeignKeyDropdownOrder']` setting. - -.. config:option:: $cfg['ForeignKeyDropdownOrder'] - - :type: array - :default: array('content-id', 'id-content') - - For the foreign key drop-down fields, there are several methods of - display, offering both the key and value data. The contents of the - array should be one or both of the following strings: ``content-id``, - ``id-content``. - -Export and import settings --------------------------- - -.. config:option:: $cfg['ZipDump'] - - :type: boolean - :default: true - -.. config:option:: $cfg['GZipDump'] - - :type: boolean - :default: true - -.. config:option:: $cfg['BZipDump'] - - :type: boolean - :default: true - - Defines whether to allow the use of zip/GZip/BZip2 compression when - creating a dump file - -.. config:option:: $cfg['CompressOnFly'] - - :type: boolean - :default: true - - Defines whether to allow on the fly compression for GZip/BZip2 - compressed exports. This doesn't affect smaller dumps and allows users - to create larger dumps that won't otherwise fit in memory due to php - memory limit. Produced files contain more GZip/BZip2 headers, but all - normal programs handle this correctly. - -.. config:option:: $cfg['Export'] - - :type: array - :default: array(...) - - In this array are defined default parameters for export, names of - items are similar to texts seen on export page, so you can easily - identify what they mean. - -.. config:option:: $cfg['Export']['method'] - - :type: string - :default: ``'quick'`` - - Defines how the export form is displayed when it loads. Valid values - are: - - * ``quick`` to display the minimum number of options to configure - * ``custom`` to display every available option to configure - * ``custom-no-form`` same as ``custom`` but does not display the option - of using quick export - - - -.. config:option:: $cfg['Import'] - - :type: array - :default: array(...) - - In this array are defined default parameters for import, names of - items are similar to texts seen on import page, so you can easily - identify what they mean. - - -Tabs display settings ---------------------- - -.. config:option:: $cfg['TabsMode'] - - :type: string - :default: ``'both'`` - - Defines whether the menu tabs contain ``'icons'``, ``'text'`` or ``'both'``. - -.. config:option:: $cfg['PropertiesNumColumns'] - - :type: integer - :default: 1 - - How many columns will be utilized to display the tables on the database - property view? When setting this to a value larger than 1, the type of the - database will be omitted for more display space. - -.. config:option:: $cfg['DefaultTabServer'] - - :type: string - :default: ``'welcome'`` - - Defines the tab displayed by default on server view. The possible values - are the localized equivalent of: - - * ``welcome`` (recommended for multi-user setups) - * ``databases``, - * ``status`` - * ``variables`` - * ``privileges`` - -.. config:option:: $cfg['DefaultTabDatabase'] - - :type: string - :default: ``'structure'`` - - Defines the tab displayed by default on database view. The possible values - are the localized equivalent of: - - * ``structure`` - * ``sql`` - * ``search`` - * ``operations`` - -.. config:option:: $cfg['DefaultTabTable'] - - :type: string - :default: ``'browse'`` - - Defines the tab displayed by default on table view. The possible values - are the localized equivalent of: - - * ``structure`` - * ``sql`` - * ``search`` - * ``insert`` - * ``browse`` - -PDF Options ------------ - -.. config:option:: $cfg['PDFPageSizes'] - - :type: array - :default: ``array('A3', 'A4', 'A5', 'letter', 'legal')`` - - Array of possible paper sizes for creating PDF pages. - - You should never need to change this. - -.. config:option:: $cfg['PDFDefaultPageSize'] - - :type: string - :default: ``'A4'`` - - Default page size to use when creating PDF pages. Valid values are any - listed in :config:option:`$cfg['PDFPageSizes']`. - -Languages ---------- - -.. config:option:: $cfg['DefaultLang'] - - :type: string - :default: ``'en'`` - - Defines the default language to use, if not browser-defined or user- - defined. The corresponding language file needs to be in - locale/*code*/LC\_MESSAGES/phpmyadmin.mo. - -.. config:option:: $cfg['DefaultConnectionCollation'] - - :type: string - :default: ``'utf8_general_ci'`` - - Defines the default connection collation to use, if not user-defined. - See the `MySQL documentation for charsets - `_ - for list of possible values. - -.. config:option:: $cfg['Lang'] - - :type: string - :default: not set - - Force language to use. The corresponding language file needs to be in - locale/*code*/LC\_MESSAGES/phpmyadmin.mo. - -.. config:option:: $cfg['FilterLanguages'] - - :type: string - :default: ``''`` - - Limit list of available languages to those matching the given regular - expression. For example if you want only Czech and English, you should - set filter to ``'^(cs|en)'``. - -.. config:option:: $cfg['RecodingEngine'] - - :type: string - :default: ``'auto'`` - - You can select here which functions will be used for character set - conversion. Possible values are: - - * auto - automatically use available one (first is tested iconv, then - recode) - * iconv - use iconv or libiconv functions - * recode - use recode\_string function - * mb - use mbstring extension - * none - disable encoding conversion - - Enabled charset conversion activates a pull-down menu in the Export - and Import pages, to choose the character set when exporting a file. - The default value in this menu comes from - :config:option:`$cfg['Export']['charset']` and :config:option:`$cfg['Import']['charset']`. - -.. config:option:: $cfg['IconvExtraParams'] - - :type: string - :default: ``'//TRANSLIT'`` - - Specify some parameters for iconv used in charset conversion. See - `iconv documentation `_ for details. By default - ``//TRANSLIT`` is used, so that invalid characters will be - transliterated. - -.. config:option:: $cfg['AvailableCharsets'] - - :type: array - :default: array(...) - - Available character sets for MySQL conversion. You can add your own - (any of supported by recode/iconv) or remove these which you don't - use. Character sets will be shown in same order as here listed, so if - you frequently use some of these move them to the top. - -Web server settings -------------------- - -.. config:option:: $cfg['OBGzip'] - - :type: string/boolean - :default: ``'auto'`` - - Defines whether to use GZip output buffering for increased speed in - :term:`HTTP` transfers. Set to - true/false for enabling/disabling. When set to 'auto' (string), - phpMyAdmin tries to enable output buffering and will automatically - disable it if your browser has some problems with buffering. IE6 with - a certain patch is known to cause data corruption when having enabled - buffering. - -.. config:option:: $cfg['TrustedProxies'] - - :type: array - :default: array() - - Lists proxies and HTTP headers which are trusted for - :config:option:`$cfg['Servers'][$i]['AllowDeny']['order']`. This list is by - default empty, you need to fill in some trusted proxy servers if you - want to use rules for IP addresses behind proxy. - - The following example specifies that phpMyAdmin should trust a - HTTP\_X\_FORWARDED\_FOR (``X -Forwarded-For``) header coming from the proxy - 1.2.3.4: - - .. code-block:: php - - $cfg['TrustedProxies'] = array('1.2.3.4' => 'HTTP_X_FORWARDED_FOR'); - - The :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` directive uses the - client's IP address as usual. - -.. config:option:: $cfg['GD2Available'] - - :type: string - :default: ``'auto'`` - - Specifies whether GD >= 2 is available. If yes it can be used for MIME - transformations. Possible values are: - - * auto - automatically detect - * yes - GD 2 functions can be used - * no - GD 2 function cannot be used - -.. config:option:: $cfg['CheckConfigurationPermissions'] - - :type: boolean - :default: true - - We normally check the permissions on the configuration file to ensure - it's not world writable. However, phpMyAdmin could be installed on a - NTFS filesystem mounted on a non-Windows server, in which case the - permissions seems wrong but in fact cannot be detected. In this case a - sysadmin would set this parameter to ``false``. - -.. config:option:: $cfg['LinkLengthLimit'] - - :type: integer - :default: 1000 - - Limit for length of :term:`URL` in links. When length would be above this - limit, it is replaced by form with button. This is required as some web - servers (:term:`IIS`) have problems with long :term:`URL` . - -.. config:option:: $cfg['CSPAllow'] - - :type: string - :default: ``''`` - - Additional string to include in allowed script and image sources in Content - Security Policy header. - - This can be useful when you want to include some external JavaScript files - in :file:`config.footer.inc.php` or :file:`config.header.inc.php`, which - would be normally not allowed by Content Security Policy. - - To allow some sites, just list them within the string: - - .. code-block:: php - - $cfg['CSPAllow'] = 'example.com example.net'; - - .. versionadded:: 4.0.4 - -.. config:option:: $cfg['DisableMultiTableMaintenance'] - - :type: boolean - :default: false - - In the database Structure page, it's possible to mark some tables then - choose an operation like optimizing for many tables. This can slow - down a server; therefore, setting this to ``true`` prevents this kind - of multiple maintenance operation. - -Theme settings --------------- - - Please directly modify :file:`themes/themename/layout.inc.php`, although - your changes will be overwritten with the next update. - -Design customization --------------------- - -.. config:option:: $cfg['NavigationTreePointerEnable'] - - :type: boolean - :default: true - - When set to true, hovering over an item in the navigation panel causes that item to be marked - (the background is highlighted). - -.. config:option:: $cfg['BrowsePointerEnable'] - - :type: boolean - :default: true - - When set to true, hovering over a row in the Browse page causes that row to be marked (the background - is highlighted). - -.. config:option:: $cfg['BrowseMarkerEnable'] - - :type: boolean - :default: true - - When set to true, a data row is marked (the background is highlighted) when the row is selected - with the checkbox. - -.. config:option:: $cfg['LimitChars'] - - :type: integer - :default: 50 - - Maximum number of characters shown in any non-numeric field on browse - view. Can be turned off by a toggle button on the browse page. - -.. config:option:: $cfg['RowActionLinks'] - - :type: string - :default: ``'left'`` - - Defines the place where table row links (Edit, Copy, Delete) would be - put when tables contents are displayed (you may have them displayed at - the left side, right side, both sides or nowhere). - -.. config:option:: $cfg['RowActionLinksWithoutUnique'] - - :type: boolean - :default: false - - Defines whether to show row links (Edit, Copy, Delete) and checkboxes - for multiple row operations even when the selection does not have a unique key. - Using row actions in the absence of a unique key may result in different/more - rows being affected since there is no guaranteed way to select the exact row(s). - -.. config:option:: $cfg['RememberSorting'] - - :type: boolean - :default: true - - If enabled, remember the sorting of each table when browsing them. - -.. config:option:: $cfg['TablePrimaryKeyOrder'] - - :type: string - :default: ``'NONE'`` - - This defines the default sort order for the tables, having a primary key, - when there is no sort order defines externally. - Acceptable values : ['NONE', 'ASC', 'DESC'] - -.. config:option:: $cfg['ShowBrowseComments'] - - :type: boolean - :default: true - -.. config:option:: $cfg['ShowPropertyComments'] - - :type: boolean - :default: true - - By setting the corresponding variable to ``true`` you can enable the - display of column comments in Browse or Property display. In browse - mode, the comments are shown inside the header. In property mode, - comments are displayed using a CSS-formatted dashed-line below the - name of the column. The comment is shown as a tool-tip for that - column. - -Text fields ------------ - -.. config:option:: $cfg['CharEditing'] - - :type: string - :default: ``'input'`` - - Defines which type of editing controls should be used for CHAR and - VARCHAR columns. Applies to data editing and also to the default values - in structure editing. Possible values are: - - * input - this allows to limit size of text to size of columns in MySQL, - but has problems with newlines in columns - * textarea - no problems with newlines in columns, but also no length - limitations - -.. config:option:: $cfg['MinSizeForInputField'] - - :type: integer - :default: 4 - - Defines the minimum size for input fields generated for CHAR and - VARCHAR columns. - -.. config:option:: $cfg['MaxSizeForInputField'] - - :type: integer - :default: 60 - - Defines the maximum size for input fields generated for CHAR and - VARCHAR columns. - -.. config:option:: $cfg['TextareaCols'] - - :type: integer - :default: 40 - -.. config:option:: $cfg['TextareaRows'] - - :type: integer - :default: 15 - -.. config:option:: $cfg['CharTextareaCols'] - - :type: integer - :default: 40 - -.. config:option:: $cfg['CharTextareaRows'] - - :type: integer - :default: 2 - - Number of columns and rows for the textareas. This value will be - emphasized (\*2) for :term:`SQL` query - textareas and (\*1.25) for :term:`SQL` - textareas inside the query window. - - The Char\* values are used for CHAR - and VARCHAR editing (if configured via :config:option:`$cfg['CharEditing']`). - -.. config:option:: $cfg['LongtextDoubleTextarea'] - - :type: boolean - :default: true - - Defines whether textarea for LONGTEXT columns should have double size. - -.. config:option:: $cfg['TextareaAutoSelect'] - - :type: boolean - :default: false - - Defines if the whole textarea of the query box will be selected on - click. - -.. config:option:: $cfg['EnableAutocompleteForTablesAndColumns'] - - :type: boolean - :default: true - - Whether to enable autocomplete for table and column names in any - SQL query box. - - -SQL query box settings ----------------------- - -.. config:option:: $cfg['SQLQuery']['Edit'] - - :type: boolean - :default: true - - Whether to display an edit link to change a query in any SQL Query - box. - -.. config:option:: $cfg['SQLQuery']['Explain'] - - :type: boolean - :default: true - - Whether to display a link to explain a SELECT query in any SQL Query - box. - -.. config:option:: $cfg['SQLQuery']['ShowAsPHP'] - - :type: boolean - :default: true - - Whether to display a link to wrap a query in PHP code in any SQL Query - box. - -.. config:option:: $cfg['SQLQuery']['Refresh'] - - :type: boolean - :default: true - - Whether to display a link to refresh a query in any SQL Query box. - -.. _web-dirs: - -Web server upload/save/import directories ------------------------------------------ - -If PHP is running in safe mode, all directories must be owned by the same user -as the owner of the phpMyAdmin scripts. - -If the directory where phpMyAdmin is installed is subject to an -``open_basedir`` restriction, you need to create a temporary directory in some -directory accessible by the PHP interpreter. - -For security reasons, all directories should be outside the tree published by -webserver. If you cannot avoid having this directory published by webserver, -limit access to it either by web server configuration (for example using -.htaccess or web.config files) or place at least an empty :file:`index.html` -file there, so that directory listing is not possible. However as long as the -directory is accessible by web server, an attacker can guess filenames to download -the files. - -.. config:option:: $cfg['UploadDir'] - - :type: string - :default: ``''`` - - The name of the directory where :term:`SQL` files have been uploaded by - other means than phpMyAdmin (for example, ftp). Those files are available - under a drop-down box when you click the database or table name, then the - Import tab. - - If - you want different directory for each user, %u will be replaced with - username. - - Please note that the file names must have the suffix ".sql" - (or ".sql.bz2" or ".sql.gz" if support for compressed formats is - enabled). - - This feature is useful when your file is too big to be - uploaded via :term:`HTTP`, or when file - uploads are disabled in PHP. - - .. warning:: - - Please see top of this chapter (:ref:`web-dirs`) for instructions how - to setup this directory and how to make its usage secure. - - .. seealso:: - - See :ref:`faq1_16` for alternatives. - -.. config:option:: $cfg['SaveDir'] - - :type: string - :default: ``''`` - - The name of the directory where dumps can be saved. - - If you want different directory for each user, %u will be replaced with - username. - - Please note that the directory must exist and has to be writable for - the user running webserver. - - .. warning:: - - Please see top of this chapter (:ref:`web-dirs`) for instructions how - to setup this directory and how to make its usage secure. - -.. config:option:: $cfg['TempDir'] - - :type: string - :default: ``''`` - - The name of the directory where temporary files can be stored. - - This is needed for importing ESRI Shapefiles, see :ref:`faq6_30` and to - work around limitations of ``open_basedir`` for uploaded files, see - :ref:`faq1_11`. - - This directory should have as strict permissions as possible as the only - user required to access this directory is the one who runs the webserver. - If you have root privileges, simply make this user owner of this directory - and make it accessible only by it: - - .. code-block:: sh - - chown www-data:www-data tmp - chmod 700 tmp - - If you cannot change owner of the directory, you can achieve a similar - setup using :term:`ACL`: - - .. code-block:: sh - - chmod 700 tmp - setfacl -m "g:www-data:rwx" tmp - setfacl -d -m "g:www-data:rwx" tmp - - If neither of above works for you, you can still make the directory - :command:`chmod 777`, but it might impose risk of other users on system - reading and writing data in this directory. - - .. warning:: - - Please see top of this chapter (:ref:`web-dirs`) for instructions how - to setup this directory and how to make its usage secure. - -Various display setting ------------------------ - -.. config:option:: $cfg['RepeatCells'] - - :type: integer - :default: 100 - - Repeat the headers every X cells, or 0 to deactivate. - -.. config:option:: $cfg['QueryHistoryDB'] - - :type: boolean - :default: false - -.. config:option:: $cfg['QueryHistoryMax'] - - :type: integer - :default: 25 - - If :config:option:`$cfg['QueryHistoryDB']` is set to ``true``, all your - Queries are logged to a table, which has to be created by you (see - :config:option:`$cfg['Servers'][$i]['history']`). If set to false, all your - queries will be appended to the form, but only as long as your window is - opened they remain saved. - - When using the JavaScript based query window, it will always get updated - when you click on a new table/db to browse and will focus if you click on - :guilabel:`Edit SQL` after using a query. You can suppress updating the - query window by checking the box :guilabel:`Do not overwrite this query - from outside the window` below the query textarea. Then you can browse - tables/databases in the background without losing the contents of the - textarea, so this is especially useful when composing a query with tables - you first have to look in. The checkbox will get automatically checked - whenever you change the contents of the textarea. Please uncheck the button - whenever you definitely want the query window to get updated even though - you have made alterations. - - If :config:option:`$cfg['QueryHistoryDB']` is set to ``true`` you can - specify the amount of saved history items using - :config:option:`$cfg['QueryHistoryMax']`. - -.. config:option:: $cfg['BrowseMIME'] - - :type: boolean - :default: true - - Enable :ref:`transformations`. - -.. config:option:: $cfg['MaxExactCount'] - - :type: integer - :default: 500000 - - For InnoDB tables, determines for how large tables phpMyAdmin should - get the exact row count using ``SELECT COUNT``. If the approximate row - count as returned by ``SHOW TABLE STATUS`` is smaller than this value, - ``SELECT COUNT`` will be used, otherwise the approximate count will be - used. - -.. config:option:: $cfg['MaxExactCountViews'] - - :type: integer - :default: 0 - - For VIEWs, since obtaining the exact count could have an impact on - performance, this value is the maximum to be displayed, using a - ``SELECT COUNT ... LIMIT``. Setting this to 0 bypasses any row - counting. - -.. config:option:: $cfg['NaturalOrder'] - - :type: boolean - :default: true - - Sorts database and table names according to natural order (for - example, t1, t2, t10). Currently implemented in the navigation panel - and in Database view, for the table list. - -.. config:option:: $cfg['InitialSlidersState'] - - :type: string - :default: ``'closed'`` - - If set to ``'closed'``, the visual sliders are initially in a closed - state. A value of ``'open'`` does the reverse. To completely disable - all visual sliders, use ``'disabled'``. - -.. config:option:: $cfg['UserprefsDisallow'] - - :type: array - :default: array() - - Contains names of configuration options (keys in ``$cfg`` array) that - users can't set through user preferences. For possible values, refer - to :file:`libraries/config/user_preferences.forms.php`. - -.. config:option:: $cfg['UserprefsDeveloperTab'] - - :type: boolean - :default: false - - Activates in the user preferences a tab containing options for - developers of phpMyAdmin. - -Page titles ------------ - -.. config:option:: $cfg['TitleTable'] - - :type: string - :default: ``'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@'`` - -.. config:option:: $cfg['TitleDatabase'] - - :type: string - :default: ``'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ | @PHPMYADMIN@'`` - -.. config:option:: $cfg['TitleServer'] - - :type: string - :default: ``'@HTTP_HOST@ / @VSERVER@ | @PHPMYADMIN@'`` - -.. config:option:: $cfg['TitleDefault'] - - :type: string - :default: ``'@HTTP_HOST@ | @PHPMYADMIN@'`` - - Allows you to specify window's title bar. You can use :ref:`faq6_27`. - -Theme manager settings ----------------------- - -.. config:option:: $cfg['ThemePath'] - - :type: string - :default: ``'./themes'`` - - If theme manager is active, use this as the path of the subdirectory - containing all the themes. - -.. config:option:: $cfg['ThemeManager'] - - :type: boolean - :default: true - - Enables user-selectable themes. See :ref:`faqthemes`. - -.. config:option:: $cfg['ThemeDefault'] - - :type: string - :default: ``'pmahomme'`` - - The default theme (a subdirectory under :config:option:`$cfg['ThemePath']`). - -.. config:option:: $cfg['ThemePerServer'] - - :type: boolean - :default: false - - Whether to allow different theme for each server. - -Default queries ---------------- - -.. config:option:: $cfg['DefaultQueryTable'] - - :type: string - :default: ``'SELECT * FROM @TABLE@ WHERE 1'`` - -.. config:option:: $cfg['DefaultQueryDatabase'] - - :type: string - :default: ``''`` - - Default queries that will be displayed in query boxes when user didn't - specify any. You can use standard :ref:`faq6_27`. - - -MySQL settings --------------- - -.. config:option:: $cfg['DefaultFunctions'] - - :type: array - :default: array(...) - - Functions selected by default when inserting/changing row, Functions - are defined for meta types as (FUNC\_NUMBER, FUNC\_DATE, FUNC\_CHAR, - FUNC\_SPATIAL, FUNC\_UUID) and for ``first_timestamp``, which is used - for first timestamp column in table. - - -Developer ---------- - -.. warning:: - - These settings might have huge effect on performance or security. - -.. config:option:: $cfg['DBG'] - - :type: array - :default: array(...) - -.. config:option:: $cfg['DBG']['sql'] - - :type: boolean - :default: false - - Enable logging queries and execution times to be - displayed in the console's Debug SQL tab. - -.. config:option:: $cfg['DBG']['demo'] - - :type: boolean - :default: false - - Enable to let server present itself as demo server. - This is used for . - - -Examples --------- - -See following configuration snippets for usual setups of phpMyAdmin. - -.. _example-google-ssl: - -Google Cloud SQL with SSL -+++++++++++++++++++++++++ - -To connect to Google Could SQL, you currently need to disable certificate -verification. This is caused by the certficate being issued for CN matching -your instance name, but you connect to an IP address and PHP tries to match -these two. With verfication you end up with error message like:: - - Peer certificate CN=`api-project-851612429544:pmatest' did not match expected CN=`8.8.8.8' - -.. warning:: - - With disabled verification your traffic is encrypted, but you're open to - man in the middle attacks. - -To connect phpMyAdmin to Google Cloud SQL using SSL download the client and -server certificates and tell phpMyAdmin to use them: - -.. code-block:: php - - // IP address of your instance - $cfg['Servers'][2]['host'] = '8.8.8.8'; - // Use SSL for connection - $cfg['Servers'][$i]['ssl'] = true; - // Client secret key - $cfg['Servers'][$i]['ssl_key'] = '../client-key.pem'; - // Client certificate - $cfg['Servers'][$i]['ssl_cert'] = '../client-cert.pem'; - // Server certification authority - $cfg['Servers'][$i]['ssl_ca'] = '../server-ca.pem'; - // Disable SSL verification (see above note) - $cfg['Servers'][$i]['ssl_verify'] = false; - -.. seealso:: - - :config:option:`$cfg['Servers'][$i]['ssl']`, - :config:option:`$cfg['Servers'][$i]['ssl_key']`, - :config:option:`$cfg['Servers'][$i]['ssl_cert']`, - :config:option:`$cfg['Servers'][$i]['ssl_ca']`, - :config:option:`$cfg['Servers'][$i]['ssl_verify']` diff --git a/#pma/doc/html/_sources/copyright.txt b/#pma/doc/html/_sources/copyright.txt deleted file mode 100644 index 28f42e6d..00000000 --- a/#pma/doc/html/_sources/copyright.txt +++ /dev/null @@ -1,49 +0,0 @@ -.. _copyright: - -Copyright -========= - -.. code-block:: none - - Copyright (C) 1998-2000 Tobias Ratschiller - Copyright (C) 2001-2014 Marc Delisle - Olivier Müller - Robin Johnson - Alexander M. Turek - Michal Čihař - Garvin Hicking - Michael Keck - Sebastian Mendel - [check credits for more details] - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License version 2, as -published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Third party licenses -++++++++++++++++++++ - -phpMyAdmin includes several third party libraries which come under their -respective licenses. - -jQuery's license, which is where we got the files under js/jquery/ is -(MIT|GPL), a copy of each license is available in this repository (GPL -is available as LICENSE, MIT as js/jquery/MIT-LICENSE.txt). - -TCPDF which is located under libraries/tcpdf is released under GPL -version 3 and the license is available as libraries/tcpdf/LICENSE.TXT. - -DejaVu fonts which are located under libraries/tcpdf/fonts/ and their -license is documented in -libraries/tcpdf/fonts/dejavu-fonts-ttf-2.33/LICENSE. - -PHP-gettext which is located under libraries/php-gettext/ is released -under GPL version 2 license which is available in the LICENSE file. diff --git a/#pma/doc/html/_sources/credits.txt b/#pma/doc/html/_sources/credits.txt deleted file mode 100644 index fed0fd6e..00000000 --- a/#pma/doc/html/_sources/credits.txt +++ /dev/null @@ -1,1111 +0,0 @@ -.. _credits: - -Credits -======= - - -Credits, in chronological order -+++++++++++++++++++++++++++++++ - -* Tobias Ratschiller - - * creator of the phpmyadmin project - - * maintainer from 1998 to summer 2000 - -* Marc Delisle - - * multi-language version in December 1998 - - * various fixes and improvements - - * :term:`SQL` analyser (most of it) - - * current project maintainer - - * maintains content on our website - -* Olivier Müller - - * started SourceForge phpMyAdmin project in March 2001 - - * sync'ed different existing CVS trees with new features and bugfixes - - * multi-language improvements, dynamic language selection - - * many bugfixes and improvements - -* Loïc Chapeaux - - * rewrote and optimized JavaScript, DHTML and DOM stuff - - * rewrote the scripts so they fit the :term:`PEAR` coding standards and - generate XHTML1.0 and CSS2 compliant codes - - * improved the language detection system - - * many bugfixes and improvements - -* Robin Johnson - - * database maintenance controls - - * table type code - - * Host authentication :term:`IP` Allow/Deny - - * DB-based configuration (Not completed) - - * :term:`SQL` parser and pretty-printer - - * :term:`SQL` validator - - * many bugfixes and improvements - -* Armel Fauveau - - * bookmarks feature - - * multiple dump feature - - * gzip dump feature - - * zip dump feature - -* Geert Lund - - * various fixes - - * moderator of the phpMyAdmin former users forum at phpwizard.net - -* Korakot Chaovavanich - - * "insert as new row" feature - -* Pete Kelly - - * rewrote and fix dump code - - * bugfixes - -* Steve Alberty - - * rewrote dump code for PHP4 - - * mySQL table statistics - - * bugfixes - -* Benjamin Gandon - - * main author of the version 2.1.0.1 - - * bugfixes - -* Alexander M. Turek - - * MySQL 4.0 / 4.1 / 5.0 compatibility - - * abstract database interface (PMA\_DBI) with MySQLi support - - * privileges administration - - * :term:`XML` exports - - * various features and fixes - - * German language file updates - -* Mike Beck - - * automatic joins in QBE - - * links column in printview - - * Relation view - -* Michal Čihař - - * enhanced index creation/display feature - - * feature to use a different charset for HTML than for MySQL - - * improvements of export feature - - * various features and fixes - - * Czech language file updates - - * created current website for phpMyAdmin - -* Christophe Gesché from the "MySQL Form Generator for PHPMyAdmin" - (https://sourceforge.net/projects/phpmysqlformgen/) - - * suggested the patch for multiple table printviews - -* Garvin Hicking - - * built the patch for vertical display of table rows - - * built the Javascript based Query window + :term:`SQL` history - - * Improvement of column/db comments - - * (MIME)-Transformations for columns - - * Use custom alias names for Databases in left frame - - * hierarchical/nested table display - - * :term:`PDF`-scratchboard for WYSIWYG- - distribution of :term:`PDF` relations - - * new icon sets - - * vertical display of column properties page - - * some bugfixes, features, support, German language additions - -* Yukihiro Kawada - - * japanese kanji encoding conversion feature - -* Piotr Roszatycki and Dan Wilson - - * the Cookie authentication mode - -* Axel Sander - - * table relation-links feature - -* Maxime Delorme - - * :term:`PDF` schema output, thanks also to - Olivier Plathey for the "FPDF" library (see ), Steven - Wittens for the "UFPDF" library and - Nicola Asuni for the "TCPDF" library (see ). - -* Olof Edlund - - * :term:`SQL` validator server - -* Ivan R. Lanin - - * phpMyAdmin logo (until June 2004) - -* Mike Cochrane - - * blowfish library from the Horde project (withdrawn in release 4.0) - -* Marcel Tschopp - - * mysqli support - - * many bugfixes and improvements - -* Nicola Asuni (Tecnick.com) - - * TCPDF library () - -* Michael Keck - - * redesign for 2.6.0 - - * phpMyAdmin sailboat logo (June 2004) - -* Mathias Landhäußer - - * Representation at conferences - -* Sebastian Mendel - - * interface improvements - - * various bugfixes - -* Ivan A Kirillov - - * new relations Designer - -* Raj Kissu Rajandran (Google Summer of Code 2008) - - * BLOBstreaming support (withdrawn in release 4.0) - -* Piotr Przybylski (Google Summer of Code 2008, 2010 and 2011) - - * improved setup script - - * user preferences - - * Drizzle support - -* Derek Schaefer (Google Summer of Code 2009) - - * Improved the import system - -* Alexander Rutkowski (Google Summer of Code 2009) - - * Tracking mechanism - -* Zahra Naeem (Google Summer of Code 2009) - - * Synchronization feature (removed in release 4.0) - -* Tomáš Srnka (Google Summer of Code 2009) - - * Replication support - -* Muhammad Adnan (Google Summer of Code 2010) - - * Relation schema export to multiple formats - -* Lori Lee (Google Summer of Code 2010) - - * User interface improvements - - * ENUM/SET editor - - * Simplified interface for export/import - -* Ninad Pundalik (Google Summer of Code 2010) - - * AJAXifying the interface - -* Martynas Mickevičius (Google Summer of Code 2010) - - * Charts - -* Barrie Leslie - - * BLOBstreaming support with PBMS PHP extension (withdrawn in release - 4.0) - -* Ankit Gupta (Google Summer of Code 2010) - - * Visual query builder - -* Madhura Jayaratne (Google Summer of Code 2011) - - * OpenGIS support - -* Ammar Yasir (Google Summer of Code 2011) - - * Zoom search - -* Aris Feryanto (Google Summer of Code 2011) - - * Browse-mode improvements - -* Thilanka Kaushalya (Google Summer of Code 2011) - - * AJAXification - -* Tyron Madlener (Google Summer of Code 2011) - - * Query statistics and charts for the status page - -* Zarubin Stas (Google Summer of Code 2011) - - * Automated testing - -* Rouslan Placella (Google Summer of Code 2011 and 2012) - - * Improved support for Stored Routines, Triggers and Events - - * Italian translation updates - - * Removal of frames, new navigation - -* Dieter Adriaenssens - - * Various bugfixes - - * Dutch translation updates - -* Alex Marin (Google Summer of Code 2012) - - * New plugins and properties system - -* Thilina Buddika Abeyrathna (Google Summer of Code 2012) - - * Refactoring - -* Atul Pratap Singh (Google Summer of Code 2012) - - * Refactoring - -* Chanaka Indrajith (Google Summer of Code 2012) - - * Refactoring - -* Yasitha Pandithawatta (Google Summer of Code 2012) - - * Automated testing - -* Jim Wigginton (phpseclib.sourceforge.net) - - * phpseclib - -* Bin Zu (Google Summer of Code 2013) - - * Refactoring - -* Supun Nakandala (Google Summer of Code 2013) - - * Refactoring - -* Mohamed Ashraf (Google Summer of Code 2013) - - * AJAX error reporting - -* Adam Kang (Google Summer of Code 2013) - - * Automated testing - -* Ayush Chaudhary (Google Summer of Code 2013) - - * Automated testing - -* Kasun Chathuranga (Google Summer of Code 2013) - - * Interface improvements - -* Hugues Peccatte - - * Load/save query by example (database search bookmarks) - -* Smita Kumari (Google Summer of Code 2014) - - * Central list of columns - - * Improve table structure (normalization) - -* Ashutosh Dhundhara (Google Summer of Code 2014) - - * Interface improvements - -* Dhananjay Nakrani (Google Summer of Code 2014) - - * PHP error reporting - -* Edward Cheng (Google Summer of Code 2014) - - * SQL Query Console - -* Kankanamge Bimal Yashodha (Google Summer of Code 2014) - - * Refactoring: Designer/schema integration - -* Chirayu Chiripal (Google Summer of Code 2014) - - * Custom field handlers (Input based MIME transformations) - - * Export with table/column name changes - -* Dan Ungureanu (Google Summer of Code 2015) - - * New parser and analyzer - -* Nisarg Jhaveri (Google Summer of Code 2015) - - * Page-related settings - - * SQL debugging integration to the Console - - * Other UI improvements - -* Deven Bansod (Google Summer of Code 2015) - - * Print view using CSS - - * Other UI improvements and new features - -And also to the following people who have contributed minor changes, -enhancements, bugfixes or support for a new language since version -2.1.0: - -Bora Alioglu, Ricardo ?, Sven-Erik Andersen, Alessandro Astarita, -Péter Bakondy, Borges Botelho, Olivier Bussier, Neil Darlow, Mats -Engstrom, Ian Davidson, Laurent Dhima, Kristof Hamann, Thomas Kläger, -Lubos Klokner, Martin Marconcini, Girish Nair, David Nordenberg, -Andreas Pauley, Bernard M. Piller, Laurent Haas, "Sakamoto", Yuval -Sarna, www.securereality.com.au, Alexis Soulard, Alvar Soome, Siu Sun, -Peter Svec, Michael Tacelosky, Rachim Tamsjadi, Kositer Uros, Luís V., -Martijn W. van der Lee, Algis Vainauskas, Daniel Villanueva, Vinay, -Ignacio Vazquez-Abrams, Chee Wai, Jakub Wilk, Thomas Michael -Winningham, Vilius Zigmantas, "Manuzhai". - - -Translators -+++++++++++ - -Following people have contributed to translation of phpMyAdmin: - - - -* Albanian - - * Arben Çokaj - - -* Arabic - - * Ahmed Saleh Abd El-Raouf Ismae - * Ahmed Saad - * hassan mokhtari - - -* Armenian - - * Andrey Aleksanyants - - -* Azerbaijani - - * Mircəlal <01youknowme\_at\_gmail.com> - * Huseyn - * Sevdimali İsa - * Jafar - - -* Belarusian - - * Viktar Palstsiuk - - -* Bulgarian - - * Boyan Kehayov - * Valter Georgiev - * Valentin Mladenov - * P - * krasimir - - -* Catalan - - * josep constanti - * Xavier Navarro - - -* Chinese (China) - - * Vincent Lau <3092849\_at\_qq.com> - * Zheng Dan - * disorderman - * Rex Lee - * - * popcorner - * Yizhou Qiang - * zz - * Terry Weng - * whh - - -* Chinese (Taiwan) - - * Albert Song - * Chien Wei Lin - * LNDDYL - * Peter Dave Hello - - -* Colognian - - * Purodha - - -* Czech - - * Aleš Hakl - * Dalibor Straka - * Martin Vidner - * Ondra Šimeček - * Jan Palider - * Petr Kateřiňák - - -* Danish - - * Aputsiaĸ Niels Janussen - * Dennis Jakobsen - * Jonas - * Claus Svalekjaer - - -* Dutch - - * A. Voogt - * dingo thirteen - * Robin van der Vliet - * Dieter Adriaenssens - * Niko Strijbol - - -* English (United Kingdom) - - * Dries Verschuere - * Francisco Rocha - * Marc Delisle - * Marek Tomaštík - - -* Esperanto - - * Eliovir - * Robin van der Vliet - - -* Estonian - - * Kristjan Räts - - -* Finnish - - * Juha - * Lari Oesch - - -* French - - * Marc Delisle - - -* Frisian - - * Robin van der Vliet - - -* Galician - - * Xosé Calvo - - -* German - - * Julian Ladisch - * Jan Erik Zassenhaus - * Lasse Goericke - * Matthias Bluthardt - * Michael Koch - * Ann + J.M. - * - * Phillip Rohmberger - * Hauke Henningsen - - -* Greek - - * Παναγιώτης Παπάζογλου - - -* Hebrew - - * Moshe Harush - * Yaron Shahrabani - * Eyal Visoker - - -* Hindi - - * Atul Pratap Singh - * Yogeshwar - * Deven Bansod - * Kushagra Pandey - * Nisarg Jhaveri - * Roohan Kazi - * Yugal Pantola - - -* Hungarian - - * Akos Eros - * Dániel Tóth - * Szász Attila - * Balázs Úr - - -* Indonesian - - * Deky Arifianto - * Andika Triwidada - * Dadan Setia - * Dadan Setia - * Yohanes Edwin - * Fadhiil Rachman - * Benny - * Tommy Surbakti - * Zufar Fathi Suhardi - - -* Interlingua - - * Giovanni Sora - - -* Italian - - * Francesco Saverio Giacobazzi - * Marco Pozzato - * Stefano Martinelli - - -* Japanese - - * k725 - * Hiroshi Chiyokawa - * Masahiko HISAKAWA - * worldwideskier - - -* Kannada - - * Robin van der Vliet - * Shameem Ahmed A Mulla - - -* Korean - - * Bumsoo Kim - * Kyeong Su Shin - * Dongyoung Kim - * Myung-han Yu - * JongDeok - * Yong Kim - * 이경준 - * Seongki Shin - * Yoon Bum-Jong - * Koo Youngmin - - -* Kurdish Sorani - - * Alan Hilal - * Aso Naderi - * muhammad - * Zrng Abdulla - - -* Latvian - - * Latvian TV - * Edgars Neimanis - * Ukko - - -* Limburgish - - * Robin van der Vliet - - -* Lithuanian - - * Vytautas Motuzas - - -* Malay - - * Amir Hamzah - * diprofinfiniti - - -* Nepali - - * Nabin Ghimire - - -* Norwegian Bokmål - - * Børge Holm-Wennberg - * Tor Stokkan - * Espen Frøyshov - * Kurt Eilertsen - * Christoffer Haugom - * Sebastian - * Tomas - - -* Persian - - * ashkan shirian - * HM - - -* Polish - - * Andrzej - * Przemo - * Krystian Biesaga - * Maciej Gryniuk - * Michał VonFlynee - - -* Portuguese - - * Alexandre Badalo - * João Rodrigues - * Pedro Ribeiro - * Sandro Amaral - - -* Portuguese (Brazil) - - * Alex Rohleder - * bruno mendax - * Danilo GUia - * Douglas Rafael Morais Kollar - * Douglas Eccker - * Ed Jr - * Guilherme Souza Silva - * Guilherme Seibt - * Helder Santana - * Junior Zancan - * Luis - * Marcos Algeri - * Marc Delisle - * Renato Rodrigues de Lima Júnio - * Thiago Casotti - * Victor Laureano - * Vinícius Araújo - * Washington Bruno Rodrigues Cav - * Yan Gabriel - - -* Punjabi - - * Robin van der Vliet - - -* Romanian - - * Alex - * Costel Cocerhan - * Ion Adrian-Ionut - * Raul Molnar - * Deleted User - * Stefan Murariu - - -* Russian - - * Andrey Aleksanyants - * - * Robin van der Vliet - * Хомутов Иван Сергеевич - * Alexey Rubinov - * Олег Карпов - * Egorov Artyom - - -* Serbian - - * Smart Kid - - -* Sinhala - - * Madhura Jayaratne - - -* Slovak - - * Martin Lacina - * Patrik Kollmann - * Jozef Pistej - - -* Slovenian - - * Domen - - -* Spanish - - * Luis García Sevillano - * Franco - * Luis Ruiz - * Macofe - * Matías Bellone - * Rodrigo A. - * FAMMA TV NOTICIAS MEDIOS DE CO - * Ronnie Simon - - -* Swedish - - * Anders Jonsson - - -* Tamil - - * கணேஷ் குமார் - * Achchuthan Yogarajah - * Rifthy Ahmed - - -* Thai - - * - * Somthanat W. - - -* Turkish - - * Burak Yavuz - - -* Ukrainian - - * Сергій Педько - * Igor - * Vitaliy Perekupka - - -* Vietnamese - - * Bao Phan - * Xuan Hung - * Bao trinh minh - - -* West Flemish - - * Robin van der Vliet - -Documentation translators -+++++++++++++++++++++++++ - -Following people have contributed to translation of phpMyAdmin documentation: - -* Albanian - - * Arben Çokaj - - -* Arabic - - * Ahmed El Azzabi - * Omar Essam - - -* Armenian - - * Andrey Aleksanyants - - -* Azerbaijani - - * Mircəlal <01youknowme\_at\_gmail.com> - * Sevdimali İsa - - -* Catalan - - * josep constanti - * Joan Montané - * Xavier Navarro - - -* Chinese (China) - - * Vincent Lau <3092849\_at\_qq.com> - * 罗攀登 <6375lpd\_at\_gmail.com> - * disorderman - * ITXiaoPang - * tunnel213 - * Terry Weng - * whh - - -* Chinese (Taiwan) - - * Chien Wei Lin - * Peter Dave Hello - - -* Czech - - * Aleš Hakl - * Michal Čihař - * Jan Palider - * Petr Kateřiňák - - -* Danish - - * Aputsiaĸ Niels Janussen - * Claus Svalekjaer - - -* Dutch - - * A. Voogt - * dingo thirteen - * Dries Verschuere - * Robin van der Vliet - * Stefan Koolen - * Ray Borggreve - * Dieter Adriaenssens - * Tom Hofman - - -* Estonian - - * Kristjan Räts - - -* Finnish - - * Juha - - -* French - - * Cédric Corazza - * Étienne Gilli - * Marc Delisle - * Donavan_Martin - - -* Frisian - - * Robin van der Vliet - - -* Galician - - * Xosé Calvo - - -* German - - * Daniel - * JH M - * Lasse Goericke - * Michael Koch - * Ann + J.M. - * Niemand Jedermann - * Phillip Rohmberger - * Hauke Henningsen - - -* Greek - - * Παναγιώτης Παπάζογλου - - -* Hungarian - - * Balázs Úr - - -* Italian - - * Francesco Saverio Giacobazzi - * Marco Pozzato - * Stefano Martinelli - * TWS - - -* Japanese - - * Eshin Kunishima - * Hiroshi Chiyokawa - - -* Lithuanian - - * Jur Kis - * Dovydas - - -* Norwegian Bokmål - - * Tor Stokkan - * Kurt Eilertsen - - -* Portuguese (Brazil) - - * Alexandre Moretti - * Douglas Rafael Morais Kollar - * Guilherme Seibt - * Helder Santana - * Michal Čihař - * Michel Souza - * Danilo Azevedo - * Thiago Casotti - * Vinícius Araújo - * Yan Gabriel - - -* Slovak - - * Martin Lacina - * Michal Čihař - * Jozef Pistej - - -* Slovenian - - * Domen - - -* Spanish - - * Luis García Sevillano - * Franco - * Matías Bellone - * Ronnie Simon - - -* Turkish - - * Burak Yavuz - -Original Credits of Version 2.1.0 -+++++++++++++++++++++++++++++++++ - -This work is based on Peter Kuppelwieser's MySQL-Webadmin. It was his -idea to create a web-based interface to MySQL using PHP3. Although I -have not used any of his source-code, there are some concepts I've -borrowed from him. phpMyAdmin was created because Peter told me he -wasn't going to further develop his (great) tool. - -Thanks go to - -* Amalesh Kempf who contributed the - code for the check when dropping a table or database. He also - suggested that you should be able to specify the primary key on - tbl\_create.php3. To version 1.1.1 he contributed the ldi\_\*.php3-set - (Import text-files) as well as a bug-report. Plus many smaller - improvements. -* Jan Legenhausen : He made many of the changes that - were introduced in 1.3.0 (including quite significant ones like the - authentication). For 1.4.1 he enhanced the table-dump feature. Plus - bug-fixes and help. -* Marc Delisle made phpMyAdmin - language-independent by outsourcing the strings to a separate file. He - also contributed the French translation. -* Alexandr Bravo who contributed - tbl\_select.php3, a feature to display only some columns from a table. -* Chris Jackson added support for MySQL functions - in tbl\_change.php3. He also added the "Query by Example" feature in - 2.0. -* Dave Walton added support for multiple - servers and is a regular contributor for bug-fixes. -* Gabriel Ash contributed the random access - features for 2.0.6. - -The following people have contributed minor changes, enhancements, -bugfixes or support for a new language: - -Jim Kraai, Jordi Bruguera, Miquel Obrador, Geert Lund, Thomas -Kleemann, Alexander Leidinger, Kiko Albiol, Daniel C. Chao, Pavel -Piankov, Sascha Kettler, Joe Pruett, Renato Lins, Mark Kronsbein, -Jannis Hermanns, G. Wieggers. - -And thanks to everyone else who sent me email with suggestions, bug- -reports and or just some feedback. - diff --git a/#pma/doc/html/_sources/developers.txt b/#pma/doc/html/_sources/developers.txt deleted file mode 100644 index 2b2f5868..00000000 --- a/#pma/doc/html/_sources/developers.txt +++ /dev/null @@ -1,12 +0,0 @@ -.. _developers: - -Developers Information -====================== - -phpMyAdmin is Open Source, so you're invited to contribute to it. Many -great features have been written by other people and you too can help -to make phpMyAdmin a useful tool. - -You can check out all the possibilities to contribute in the -`contribute section on our website -`_. diff --git a/#pma/doc/html/_sources/faq.txt b/#pma/doc/html/_sources/faq.txt deleted file mode 100644 index 8acf8440..00000000 --- a/#pma/doc/html/_sources/faq.txt +++ /dev/null @@ -1,2220 +0,0 @@ -.. _faq: - -FAQ - Frequently Asked Questions -================================ - -Please have a look at our `Link section -`_ on the official -phpMyAdmin homepage for in-depth coverage of phpMyAdmin's features and -or interface. - -.. _faqserver: - -Server -++++++ - -.. _faq1_1: - -1.1 My server is crashing each time a specific action is required or phpMyAdmin sends a blank page or a page full of cryptic characters to my browser, what can I do? ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -Try to set the :config:option:`$cfg['OBGzip']` directive to ``false`` in your -:file:`config.inc.php` file and the ``zlib.output_compression`` directive to -``Off`` in your php configuration file. - -.. _faq1_2: - -1.2 My Apache server crashes when using phpMyAdmin. ---------------------------------------------------- - -You should first try the latest versions of Apache (and possibly MySQL). If -your server keeps crashing, please ask for help in the various Apache support -groups. - -.. seealso:: :ref:`faq1_1` - -.. _faq1_3: - -1.3 (withdrawn). ----------------- - -.. _faq1_4: - -1.4 Using phpMyAdmin on IIS, I'm displayed the error message: "The specified CGI application misbehaved by not returning a complete set of HTTP headers ...". -------------------------------------------------------------------------------------------------------------------------------------------------------------- - -You just forgot to read the *install.txt* file from the PHP -distribution. Have a look at the last message in this `PHP bug report #12061 -`_ from the official PHP bug -database. - -.. _faq1_5: - -1.5 Using phpMyAdmin on IIS, I'm facing crashes and/or many error messages with the HTTP. ------------------------------------------------------------------------------------------ - -This is a known problem with the PHP :term:`ISAPI` filter: it's not so stable. -Please use instead the cookie authentication mode. - -.. _faq1_6: - -1.6 I can't use phpMyAdmin on PWS: nothing is displayed! --------------------------------------------------------- - -This seems to be a PWS bug. Filippo Simoncini found a workaround (at -this time there is no better fix): remove or comment the ``DOCTYPE`` -declarations (2 lines) from the scripts :file:`libraries/Header.class.php` -and :file:`index.php`. - -.. _faq1_7: - -1.7 How can I GZip a dump or a CSV export? It does not seem to work. --------------------------------------------------------------------- - -This feature is based on the ``gzencode()`` -PHP function to be more independent of the platform (Unix/Windows, -Safe Mode or not, and so on). So, you must have Zlib support -(``--with-zlib``). - -.. _faq1_8: - -1.8 I cannot insert a text file in a table, and I get an error about safe mode being in effect. ------------------------------------------------------------------------------------------------ - -Your uploaded file is saved by PHP in the "upload dir", as defined in -:file:`php.ini` by the variable ``upload_tmp_dir`` (usually the system -default is */tmp*). We recommend the following setup for Apache -servers running in safe mode, to enable uploads of files while being -reasonably secure: - -* create a separate directory for uploads: :command:`mkdir /tmp/php` -* give ownership to the Apache server's user.group: :command:`chown - apache.apache /tmp/php` -* give proper permission: :command:`chmod 600 /tmp/php` -* put ``upload_tmp_dir = /tmp/php`` in :file:`php.ini` -* restart Apache - -.. _faq1_9: - -1.9 (withdrawn). ----------------- - -.. _faq1_10: - -1.10 I'm having troubles when uploading files with phpMyAdmin running on a secure server. My browser is Internet Explorer and I'm using the Apache server. ----------------------------------------------------------------------------------------------------------------------------------------------------------- - -As suggested by "Rob M" in the phpWizard forum, add this line to your -*httpd.conf*: - -.. code-block:: apache - - SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown - -It seems to clear up many problems between Internet Explorer and SSL. - -.. _faq1_11: - -1.11 I get an 'open\_basedir restriction' while uploading a file from the query box. ------------------------------------------------------------------------------------- - -Since version 2.2.4, phpMyAdmin supports servers with open\_basedir -restrictions. However you need to create temporary directory and configure it -as :config:option:`$cfg['TempDir']`. The uploaded files will be moved there, -and after execution of your :term:`SQL` commands, removed. - -.. _faq1_12: - -1.12 I have lost my MySQL root password, what can I do? -------------------------------------------------------- - -The MySQL manual explains how to `reset the permissions -`_. - -.. _faq1_13: - -1.13 (withdrawn). ------------------ - -.. _faq1_14: - -1.14 (withdrawn). ------------------ - -.. _faq1_15: - -1.15 I have problems with *mysql.user* column names. ----------------------------------------------------- - -In previous MySQL versions, the ``User`` and ``Password``columns were -named ``user`` and ``password``. Please modify your column names to -align with current standards. - -.. _faq1_16: - -1.16 I cannot upload big dump files (memory, HTTP or timeout problems). ------------------------------------------------------------------------ - -Starting with version 2.7.0, the import engine has been re–written and -these problems should not occur. If possible, upgrade your phpMyAdmin -to the latest version to take advantage of the new import features. - -The first things to check (or ask your host provider to check) are the -values of ``upload_max_filesize``, ``memory_limit`` and -``post_max_size`` in the :file:`php.ini` configuration file. All of these -three settings limit the maximum size of data that can be submitted -and handled by PHP. One user also said that ``post_max_size`` and -``memory_limit`` need to be larger than ``upload_max_filesize``. -There exist several workarounds if your upload is too big or your -hosting provider is unwilling to change the settings: - -* Look at the :config:option:`$cfg['UploadDir']` feature. This allows one to upload a file to the server - via scp, ftp, or your favorite file transfer method. PhpMyAdmin is - then able to import the files from the temporary directory. More - information is available in the :ref:`config` of this document. -* Using a utility (such as `BigDump - `_) to split the files before - uploading. We cannot support this or any third party applications, but - are aware of users having success with it. -* If you have shell (command line) access, use MySQL to import the files - directly. You can do this by issuing the "source" command from within - MySQL: - - .. code-block:: mysql - - source filename.sql; - -.. _faq1_17: - -1.17 Which Database versions does phpMyAdmin support? ------------------------------------------------------ - -For `MySQL `_, versions 5.5 and newer are supported. -For older MySQL versions, our `Downloads `_ page offers older phpMyAdmin versions -(which may have become unsupported). - -For `MariaDB `_, versions 5.5 and newer are supported. - -.. _faq1_17a: - -1.17a I cannot connect to the MySQL server. It always returns the error message, "Client does not support authentication protocol requested by server; consider upgrading MySQL client" ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -You tried to access MySQL with an old MySQL client library. The -version of your MySQL client library can be checked in your phpinfo() -output. In general, it should have at least the same minor version as -your server - as mentioned in :ref:`faq1_17`. This problem is -generally caused by using MySQL version 4.1 or newer. MySQL changed -the authentication hash and your PHP is trying to use the old method. -The proper solution is to use the `mysqli extension -`_ with the proper client library to match -your MySQL installation. More -information (and several workarounds) are located in the `MySQL -Documentation `_. - -.. _faq1_18: - -1.18 (withdrawn). ------------------ - -.. _faq1_19: - -1.19 I can't run the "display relations" feature because the script seems not to know the font face I'm using! --------------------------------------------------------------------------------------------------------------- - -The :term:`TCPDF` library we're using for this feature requires some special -files to use font faces. Please refers to the `TCPDF manual -`_ to build these files. - -.. _faqmysql: - -1.20 I receive an error about missing mysqli and mysql extensions. ------------------------------------------------------------------- - -To connect to a MySQL server, PHP needs a set of MySQL functions -called "MySQL extension". This extension may be part of the PHP -distribution (compiled-in), otherwise it needs to be loaded -dynamically. Its name is probably *mysqli.so* or *php\_mysqli.dll*. -phpMyAdmin tried to load the extension but failed. Usually, the -problem is solved by installing a software package called "PHP-MySQL" -or something similar. - -There are currently two interfaces PHP provides as MySQL extensions - ``mysql`` -and ``mysqli``. The ``mysqli`` is tried first, because it's the best one. - -.. _faq1_21: - -1.21 I am running the CGI version of PHP under Unix, and I cannot log in using cookie auth. -------------------------------------------------------------------------------------------- - -In :file:`php.ini`, set ``mysql.max_links`` higher than 1. - -.. _faq1_22: - -1.22 I don't see the "Location of text file" field, so I cannot upload. ------------------------------------------------------------------------ - -This is most likely because in :file:`php.ini`, your ``file_uploads`` -parameter is not set to "on". - -.. _faq1_23: - -1.23 I'm running MySQL on a Win32 machine. Each time I create a new table the table and column names are changed to lowercase! ------------------------------------------------------------------------------------------------------------------------------- - -This happens because the MySQL directive ``lower_case_table_names`` -defaults to 1 (``ON``) in the Win32 version of MySQL. You can change -this behavior by simply changing the directive to 0 (``OFF``): Just -edit your ``my.ini`` file that should be located in your Windows -directory and add the following line to the group [mysqld]: - -.. code-block:: ini - - set-variable = lower_case_table_names=0 - -Next, save the file and restart the MySQL service. You can always -check the value of this directive using the query - -.. code-block:: mysql - - SHOW VARIABLES LIKE 'lower_case_table_names'; - -.. _faq1_24: - -1.24 (withdrawn). ------------------ - -.. _faq1_25: - -1.25 I am running Apache with mod\_gzip-1.3.26.1a on Windows XP, and I get problems, such as undefined variables when I run a SQL query. ----------------------------------------------------------------------------------------------------------------------------------------- - -A tip from Jose Fandos: put a comment on the following two lines in -httpd.conf, like this: - -.. code-block:: apache - - - # mod_gzip_item_include file \.php$ - # mod_gzip_item_include mime "application/x-httpd-php.*" - -as this version of mod\_gzip on Apache (Windows) has problems handling -PHP scripts. Of course you have to restart Apache. - -.. _faq1_26: - -1.26 I just installed phpMyAdmin in my document root of IIS but I get the error "No input file specified" when trying to run phpMyAdmin. ----------------------------------------------------------------------------------------------------------------------------------------- - -This is a permission problem. Right-click on the phpmyadmin folder and -choose properties. Under the tab Security, click on "Add" and select -the user "IUSR\_machine" from the list. Now set his permissions and it -should work. - -.. _faq1_27: - -1.27 I get empty page when I want to view huge page (eg. db\_structure.php with plenty of tables). --------------------------------------------------------------------------------------------------- - -This was caused by a `PHP bug `_ that occur when -GZIP output buffering is enabled. If you turn off it (by -:config:option:`$cfg['OBGzip']` in :file:`config.inc.php`), it should work. -This bug will has been fixed in PHP 5.0.0. - -.. _faq1_28: - -1.28 My MySQL server sometimes refuses queries and returns the message 'Errorcode: 13'. What does this mean? ------------------------------------------------------------------------------------------------------------- - -This can happen due to a MySQL bug when having database / table names -with upper case characters although ``lower_case_table_names`` is -set to 1. To fix this, turn off this directive, convert all database -and table names to lower case and turn it on again. Alternatively, -there's a bug-fix available starting with MySQL 3.23.56 / -4.0.11-gamma. - -.. _faq1_29: - -1.29 When I create a table or modify a column, I get an error and the columns are duplicated. ---------------------------------------------------------------------------------------------- - -It is possible to configure Apache in such a way that PHP has problems -interpreting .php files. - -The problems occur when two different (and conflicting) set of -directives are used: - -.. code-block:: apache - - - SetOutputFilter PHP - SetInputFilter PHP - -and - -.. code-block:: apache - - AddType application/x-httpd-php .php - -In the case we saw, one set of directives was in -``/etc/httpd/conf/httpd.conf``, while the other set was in -``/etc/httpd/conf/addon-modules/php.conf``. The recommended way is -with ``AddType``, so just comment out the first set of lines and -restart Apache: - -.. code-block:: apache - - - #SetOutputFilter PHP - #SetInputFilter PHP - -.. _faq1_30: - -1.30 I get the error "navigation.php: Missing hash". ----------------------------------------------------- - -This problem is known to happen when the server is running Turck -MMCache but upgrading MMCache to version 2.3.21 solves the problem. - -.. _faq1_31: - -1.31 Does phpMyAdmin support PHP 5? ------------------------------------ - -Yes. - -Since release 4.5, phpMyAdmin supports only PHP 5.5 and newer. Since release 4.1 phpMyAdmin supports only PHP 5.3 and newer. For PHP 5.2 you can use 4.0.x releases. - -.. _faq1_32: - -1.32 Can I use HTTP authentication with IIS? --------------------------------------------- - -Yes. This procedure was tested with phpMyAdmin 2.6.1, PHP 4.3.9 in -:term:`ISAPI` mode under :term:`IIS` 5.1. - -#. In your :file:`php.ini` file, set ``cgi.rfc2616_headers = 0`` -#. In ``Web Site Properties -> File/Directory Security -> Anonymous - Access`` dialog box, check the ``Anonymous access`` checkbox and - uncheck any other checkboxes (i.e. uncheck ``Basic authentication``, - ``Integrated Windows authentication``, and ``Digest`` if it's - enabled.) Click ``OK``. -#. In ``Custom Errors``, select the range of ``401;1`` through ``401;5`` - and click the ``Set to Default`` button. - -.. seealso:: :rfc:`2616` - -.. _faq1_33: - -1.33 (withdrawn). ------------------ - -.. _faq1_34: - -1.34 Can I access directly to database or table pages? ------------------------------------------------------- - -Yes. Out of the box, you can use :term:`URL` like -https://example.com/phpMyAdmin/index.php?server=X&db=database&table=table&target=script. -For ``server`` you use the server number -which refers to the order of the server paragraph in -:file:`config.inc.php`. Table and script parts are optional. If you want -https://example.com/phpMyAdmin/database[/table][/script] :term:`URL`, you need to do some configuration. Following -lines apply only for `Apache `_ web server. -First make sure, that you have enabled some features within global -configuration. You need ``Options SymLinksIfOwnerMatch`` and ``AllowOverride -FileInfo`` enabled for directory where phpMyAdmin is installed and you -need mod\_rewrite to be enabled. Then you just need to create -following :term:`.htaccess` file in root folder of phpMyAdmin installation (don't -forget to change directory name inside of it): - -.. code-block:: apache - - - RewriteEngine On - RewriteBase /path_to_phpMyAdmin - RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&table=$2&target=$3 [R] - RewriteRule ^([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&target=$2 [R] - RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index.php?db=$1&table=$2 [R] - RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R] - -.. _faq1_35: - -1.35 Can I use HTTP authentication with Apache CGI? ---------------------------------------------------- - -Yes. However you need to pass authentication variable to :term:`CGI` using -following rewrite rule: - -.. code-block:: apache - - - RewriteEngine On - RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L] - -.. _faq1_36: - -1.36 I get an error "500 Internal Server Error". ------------------------------------------------- - -There can be many explanations to this and a look at your server's -error log file might give a clue. - -.. _faq1_37: - -1.37 I run phpMyAdmin on cluster of different machines and password encryption in cookie auth doesn't work. ------------------------------------------------------------------------------------------------------------ - -If your cluster consist of different architectures, PHP code used for -encryption/decryption won't work correct. This is caused by use of -pack/unpack functions in code. Only solution is to use mcrypt -extension which works fine in this case. - -.. _faq1_38: - -1.38 Can I use phpMyAdmin on a server on which Suhosin is enabled? ------------------------------------------------------------------- - -Yes but the default configuration values of Suhosin are known to cause -problems with some operations, for example editing a table with many -columns and no primary key or with textual primary key. - -Suhosin configuration might lead to malfunction in some cases and it -can not be fully avoided as phpMyAdmin is kind of application which -needs to transfer big amounts of columns in single HTTP request, what -is something what Suhosin tries to prevent. Generally all -``suhosin.request.*``, ``suhosin.post.*`` and ``suhosin.get.*`` -directives can have negative effect on phpMyAdmin usability. You can -always find in your error logs which limit did cause dropping of -variable, so you can diagnose the problem and adjust matching -configuration variable. - -The default values for most Suhosin configuration options will work in -most scenarios, however you might want to adjust at least following -parameters: - -* `suhosin.request.max\_vars `_ should - be increased (eg. 2048) -* `suhosin.post.max\_vars `_ should be - increased (eg. 2048) -* `suhosin.request.max\_array\_index\_length `_ - should be increased (eg. 256) -* `suhosin.post.max\_array\_index\_length `_ - should be increased (eg. 256) -* `suhosin.request.max\_totalname\_length `_ - should be increased (eg. 8192) -* `suhosin.post.max\_totalname\_length `_ should be - increased (eg. 8192) -* `suhosin.get.max\_value\_length `_ - should be increased (eg. 1024) -* `suhosin.sql.bailout\_on\_error `_ - needs to be disabled (the default) -* `suhosin.log.\* `_ should not - include :term:`SQL`, otherwise you get big - slowdown - -You can also disable the warning using the :config:option:`$cfg['SuhosinDisableWarning']`. - -.. _faq1_39: - -1.39 When I try to connect via https, I can log in, but then my connection is redirected back to http. What can cause this behavior? ------------------------------------------------------------------------------------------------------------------------------------- - -Be sure that you have enabled ``SSLOptions`` and ``StdEnvVars`` in -your Apache configuration. - -.. seealso:: - -.. _faq1_40: - -1.40 When accessing phpMyAdmin via an Apache reverse proxy, cookie login does not work. ---------------------------------------------------------------------------------------- - -To be able to use cookie auth Apache must know that it has to rewrite -the set-cookie headers. Example from the Apache 2.2 documentation: - -.. code-block:: apache - - - ProxyPass /mirror/foo/ http://backend.example.com/ - ProxyPassReverse /mirror/foo/ http://backend.example.com/ - ProxyPassReverseCookieDomain backend.example.com public.example.com - ProxyPassReverseCookiePath / /mirror/foo/ - -Note: if the backend url looks like https://example.com/~user/phpmyadmin, the -tilde (~) must be url encoded as %7E in the ProxyPassReverse\* lines. -This is not specific to phpmyadmin, it's just the behavior of Apache. - -.. code-block:: apache - - - ProxyPass /mirror/foo/ http://backend.example.com/~user/phpmyadmin - ProxyPassReverse /mirror/foo/ http://backend.example.com/%7Euser/phpmyadmin - ProxyPassReverseCookiePath /%7Euser/phpmyadmin /mirror/foo - -.. seealso:: , :config:option:`$cfg['PmaAbsoluteUri']` - -.. _faq1_41: - -1.41 When I view a database and ask to see its privileges, I get an error about an unknown column. --------------------------------------------------------------------------------------------------- - -The MySQL server's privilege tables are not up to date, you need to -run the :command:`mysql_upgrade` command on the server. - -.. _faq1_42: - -1.42 How can I prevent robots from accessing phpMyAdmin? --------------------------------------------------------- - -You can add various rules to :term:`.htaccess` to filter access based on user agent -field. This is quite easy to circumvent, but could prevent at least -some robots accessing your installation. - -.. code-block:: apache - - - RewriteEngine on - - # Allow only GET and POST verbs - RewriteCond %{REQUEST_METHOD} !^(GET|POST)$ [NC,OR] - - # Ban Typical Vulnerability Scanners and others - # Kick out Script Kiddies - RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR] - RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|curl|wget|python|nikto|wkito|pikto|scan|acunetix).* [NC,OR] - RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner).* [NC,OR] - - # Ban Search Engines, Crawlers to your administrative panel - # No reasons to access from bots - # Ultimately Better than the useless robots.txt - # Did google respect robots.txt? - # Try google: intitle:phpMyAdmin intext:"Welcome to phpMyAdmin *.*.*" intext:"Log in" -wiki -forum -forums -questions intext:"Cookies must be enabled" - RewriteCond %{HTTP_USER_AGENT} ^.*(AdsBot-Google|ia_archiver|Scooter|Ask.Jeeves|Baiduspider|Exabot|FAST.Enterprise.Crawler|FAST-WebCrawler|www\.neomo\.de|Gigabot|Mediapartners-Google|Google.Desktop|Feedfetcher-Google|Googlebot|heise-IT-Markt-Crawler|heritrix|ibm.com\cs/crawler|ICCrawler|ichiro|MJ12bot|MetagerBot|msnbot-NewsBlogs|msnbot|msnbot-media|NG-Search|lucene.apache.org|NutchCVS|OmniExplorer_Bot|online.link.validator|psbot0|Seekbot|Sensis.Web.Crawler|SEO.search.Crawler|Seoma.\[SEO.Crawler\]|SEOsearch|Snappy|www.urltrends.com|www.tkl.iis.u-tokyo.ac.jp/~crawler|SynooBot|crawleradmin.t-info@telekom.de|TurnitinBot|voyager|W3.SiteSearch.Crawler|W3C-checklink|W3C_Validator|www.WISEnutbot.com|yacybot|Yahoo-MMCrawler|Yahoo\!.DE.Slurp|Yahoo\!.Slurp|YahooSeeker).* [NC] - RewriteRule .* - [F] - -.. _faq1_43: - -1.43 Why can't I display the structure of my table containing hundreds of columns? ----------------------------------------------------------------------------------- - -Because your PHP's ``memory_limit`` is too low; adjust it in :file:`php.ini`. - -.. _faq1:44: - -1.44 How can I reduce the installed size of phpMyAdmin on disk? ---------------------------------------------------------------- - -Some users have requested to be able to reduce the size of the phpMyAdmin installation. -This is not recommended and could lead to confusion over missing features, but can be done. -A list of files and corresponding functionality which degrade gracefully when removed include: - -* :file:`./libraries/tcpdf` folder (exporting to PDF) -* :file:`./locale/` folder, or unused subfolders (interface translations) -* Any unused themes in :file:`./themes/` -* :file:`./js/jquery/src/` (included for licensing reasons) -* :file:`./js/line_counts.php` -* :file:`./doc/` (documentation) -* :file:`./setup/` (setup script) -* :file:`./examples/` -* :file:`./sql/` (SQL scripts to configure advanced functionality) - -.. _faqconfig: - -Configuration -+++++++++++++ - -.. _faq2_1: - -2.1 The error message "Warning: Cannot add header information - headers already sent by ..." is displayed, what's the problem? ------------------------------------------------------------------------------------------------------------------------------- - -Edit your :file:`config.inc.php` file and ensure there is nothing (I.E. no -blank lines, no spaces, no characters...) neither before the ```` tag at the end. We also got a report -from a user under :term:`IIS`, that used a zipped distribution kit: the file -:file:`libraries/Config.class.php` contained an end-of-line character (hex 0A) -at the end; removing this character cleared his errors. - -.. _faq2_2: - -2.2 phpMyAdmin can't connect to MySQL. What's wrong? ----------------------------------------------------- - -Either there is an error with your PHP setup or your username/password -is wrong. Try to make a small script which uses mysql\_connect and see -if it works. If it doesn't, it may be you haven't even compiled MySQL -support into PHP. - -.. _faq2_3: - -2.3 The error message "Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) ..." is displayed. What can I do? ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -For RedHat users, Harald Legner suggests this on the mailing list: - -On my RedHat-Box the socket of MySQL is */var/lib/mysql/mysql.sock*. -In your :file:`php.ini` you will find a line - -.. code-block:: ini - - mysql.default_socket = /tmp/mysql.sock - -change it to - -.. code-block:: ini - - mysql.default_socket = /var/lib/mysql/mysql.sock - -Then restart apache and it will work. - -Here is a fix suggested by Brad Ummer: - -* First, you need to determine what socket is being used by MySQL. To do - this, telnet to your server and go to the MySQL bin directory. In this - directory there should be a file named *mysqladmin*. Type - ``./mysqladmin variables``, and this should give you a bunch of info - about your MySQL server, including the socket (*/tmp/mysql.sock*, for - example). -* Then, you need to tell PHP to use this socket. To do this in - phpMyAdmin, you need to complete the socket information in the - :file:`config.inc.php`. For example: - :config:option:`$cfg['Servers'][$i]['socket']` Please also make sure that - the permissions of this file allow to be readable by your webserver (i.e. - '0755'). - -Have also a look at the `corresponding section of the MySQL -documentation `_. - -.. _faq2_4: - -2.4 Nothing is displayed by my browser when I try to run phpMyAdmin, what can I do? ------------------------------------------------------------------------------------ - -Try to set the :config:option:`$cfg['OBGzip']` directive to ``false`` in the phpMyAdmin configuration -file. It helps sometime. Also have a look at your PHP version number: -if it contains "b" or "alpha" it means you're running a testing -version of PHP. That's not a so good idea, please upgrade to a plain -revision. - -.. _faq2_5: - -2.5 Each time I want to insert or change a row or drop a database or a table, an error 404 (page not found) is displayed or, with HTTP or cookie authentication, I'm asked to log in again. What's wrong? ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -Check your webserver setup if it correctly fills in either PHP_SELF or REQUEST_URI variables. - -If you are running phpMyAdmin behind reverse proxy, please set the -:config:option:`$cfg['PmaAbsoluteUri']` directive in the phpMyAdmin -configuration file to match your setup. - -.. _faq2_6: - -2.6 I get an "Access denied for user: 'root@localhost' (Using password: YES)"-error when trying to access a MySQL-Server on a host which is port-forwarded for my localhost. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -When you are using a port on your localhost, which you redirect via -port-forwarding to another host, MySQL is not resolving the localhost -as expected. Erik Wasser explains: The solution is: if your host is -"localhost" MySQL (the command line tool :command:`mysql` as well) always -tries to use the socket connection for speeding up things. And that -doesn't work in this configuration with port forwarding. If you enter -"127.0.0.1" as hostname, everything is right and MySQL uses the -:term:`TCP` connection. - -.. _faqthemes: - -2.7 Using and creating themes ------------------------------ - -Themes are configured with :config:option:`$cfg['ThemePath']`, -:config:option:`$cfg['ThemeManager']` and :config:option:`$cfg['ThemeDefault']`. -Under :config:option:`$cfg['ThemePath']`, you should not delete the -directory ``pmahomme`` or its underlying structure, because this is the -system theme used by phpMyAdmin. ``pmahomme`` contains all images and -styles, for backwards compatibility and for all themes that would not -include images or css-files. If :config:option:`$cfg['ThemeManager']` -is enabled, you can select your favorite theme on the main page. Your selected -theme will be stored in a cookie. - -To create a theme: - -* make a new subdirectory (for example "your\_theme\_name") under :config:option:`$cfg['ThemePath']` (by - default ``themes``) -* copy the files and directories from ``pmahomme`` to "your\_theme\_name" -* edit the css-files in "your\_theme\_name/css" -* put your new images in "your\_theme\_name/img" -* edit :file:`layout.inc.php` in "your\_theme\_name" -* edit :file:`info.inc.php` in "your\_theme\_name" to contain your chosen - theme name, that will be visible in user interface -* make a new screenshot of your theme and save it under - "your\_theme\_name/screen.png" - -In theme directory there is file :file:`info.inc.php` which contains theme -verbose name, theme generation and theme version. These versions and -generations are enumerated from 1 and do not have any direct -dependence on phpMyAdmin version. Themes within same generation should -be backwards compatible - theme with version 2 should work in -phpMyAdmin requiring version 1. Themes with different generation are -incompatible. - -If you do not want to use your own symbols and buttons, remove the -directory "img" in "your\_theme\_name". phpMyAdmin will use the -default icons and buttons (from the system-theme ``pmahomme``). - -.. _faqmissingparameters: - -2.8 I get "Missing parameters" errors, what can I do? ------------------------------------------------------ - -Here are a few points to check: - -* In :file:`config.inc.php`, try to leave the :config:option:`$cfg['PmaAbsoluteUri']` directive empty. See also - :ref:`faq4_7`. -* Maybe you have a broken PHP installation or you need to upgrade your - Zend Optimizer. See . -* If you are using Hardened PHP with the ini directive - ``varfilter.max_request_variables`` set to the default (200) or - another low value, you could get this error if your table has a high - number of columns. Adjust this setting accordingly. (Thanks to Klaus - Dorninger for the hint). -* In the :file:`php.ini` directive ``arg_separator.input``, a value of ";" - will cause this error. Replace it with "&;". -* If you are using `Hardened-PHP `_, you - might want to increase `request limits `_. -* The directory specified in the :file:`php.ini` directive - ``session.save_path`` does not exist or is read-only. - -.. _faq2_9: - -2.9 Seeing an upload progress bar ---------------------------------- - -To be able to see a progress bar during your uploads, your server must -have the `APC `_ extension, the -`uploadprogress `_ one, or -you must be running PHP 5.4.0 or higher. Moreover, the JSON extension -has to be enabled in your PHP. - -If using APC, you must set ``apc.rfc1867`` to ``on`` in your :file:`php.ini`. - -If using PHP 5.4.0 or higher, you must set -``session.upload_progress.enabled`` to ``1`` in your :file:`php.ini`. However, -starting from phpMyAdmin version 4.0.4, session-based upload progress has -been temporarily deactivated due to its problematic behavior. - -.. seealso:: :rfc:`1867` - -.. _faqlimitations: - -Known limitations -+++++++++++++++++ - -.. _login_bug: - -3.1 When using HTTP authentication, a user who logged out can not log in again in with the same nick. ------------------------------------------------------------------------------------------------------ - -This is related to the authentication mechanism (protocol) used by -phpMyAdmin. To bypass this problem: just close all the opened browser -windows and then go back to phpMyAdmin. You should be able to log in -again. - -.. _faq3_2: - -3.2 When dumping a large table in compressed mode, I get a memory limit error or a time limit error. ----------------------------------------------------------------------------------------------------- - -Compressed dumps are built in memory and because of this are limited -to php's memory limit. For GZip/BZip2 exports this can be overcome -since 2.5.4 using :config:option:`$cfg['CompressOnFly']` (enabled by default). -Zip exports can not be handled this way, so if you need Zip files for larger -dump, you have to use another way. - -.. _faq3_3: - -3.3 With InnoDB tables, I lose foreign key relationships when I rename a table or a column. -------------------------------------------------------------------------------------------- - -This is an InnoDB bug, see . - -.. _faq3_4: - -3.4 I am unable to import dumps I created with the mysqldump tool bundled with the MySQL server distribution. -------------------------------------------------------------------------------------------------------------- - -The problem is that older versions of ``mysqldump`` created invalid -comments like this: - -.. code-block:: mysql - - - -- MySQL dump 8.22 - -- - -- Host: localhost Database: database - --------------------------------------------------------- - -- Server version 3.23.54 - -The invalid part of the code is the horizontal line made of dashes -that appears once in every dump created with mysqldump. If you want to -run your dump you have to turn it into valid MySQL. This means, you -have to add a whitespace after the first two dashes of the line or add -a # before it: ``-- -------------------------------------------------------`` or -``#---------------------------------------------------------`` - -.. _faq3_5: - -3.5 When using nested folders, multiple hierarchies are displayed in a wrong manner. ------------------------------------------------------------------------------------- - -Please note that you should not use the separating string multiple -times without any characters between them, or at the beginning/end of -your table name. If you have to, think about using another -TableSeparator or disabling that feature. - -.. seealso:: :config:option:`$cfg['NavigationTreeTableSeparator']` - -.. _faq3_6: - -3.6 (withdrawn). ------------------ - -.. _faq3_7: - -3.7 I have table with many (100+) columns and when I try to browse table I get series of errors like "Warning: unable to parse url". How can this be fixed? ------------------------------------------------------------------------------------------------------------------------------------------------------------ - -Your table neither have a primary key nor an unique one, so we must -use a long expression to identify this row. This causes problems to -parse\_url function. The workaround is to create a primary or unique -key. - -.. _faq3_8: - -3.8 I cannot use (clickable) HTML-forms in columns where I put a MIME-Transformation onto! ------------------------------------------------------------------------------------------- - -Due to a surrounding form-container (for multi-row delete checkboxes), -no nested forms can be put inside the table where phpMyAdmin displays -the results. You can, however, use any form inside of a table if keep -the parent form-container with the target to tbl\_row\_delete.php and -just put your own input-elements inside. If you use a custom submit -input field, the form will submit itself to the displaying page again, -where you can validate the $HTTP\_POST\_VARS in a transformation. For -a tutorial on how to effectively use transformations, see our `Link -section `_ on the -official phpMyAdmin-homepage. - -.. _faq3_9: - -3.9 I get error messages when using "--sql\_mode=ANSI" for the MySQL server. ----------------------------------------------------------------------------- - -When MySQL is running in ANSI-compatibility mode, there are some major -differences in how :term:`SQL` is structured (see -). Most important of all, the -quote-character (") is interpreted as an identifier quote character and not as -a string quote character, which makes many internal phpMyAdmin operations into -invalid :term:`SQL` statements. There is no -workaround to this behaviour. News to this item will be posted in `Bug report -#1013 `_. - -.. _faq3_10: - -3.10 Homonyms and no primary key: When the results of a SELECT display more that one column with the same value (for example ``SELECT lastname from employees where firstname like 'A%'`` and two "Smith" values are displayed), if I click Edit I cannot be sure that I am editing the intended row. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - -Please make sure that your table has a primary key, so that phpMyAdmin -can use it for the Edit and Delete links. - -.. _faq3_11: - -3.11 The number of rows for InnoDB tables is not correct. ---------------------------------------------------------- - -phpMyAdmin uses a quick method to get the row count, and this method only -returns an approximate count in the case of InnoDB tables. See -:config:option:`$cfg['MaxExactCount']` for a way to modify those results, but -this could have a serious impact on performance. -However, one can easily replace the approximate row count with exact count by -simply clicking on the approximate count. This can also be done for all tables -at once by clicking on the rows sum displayed at the bottom. - -.. _faq3_12: - -3.12 (withdrawn). ------------------ - -.. _faq3_13: - -3.13 I get an error when entering ``USE`` followed by a db name containing an hyphen. -------------------------------------------------------------------------------------- - -The tests I have made with MySQL 5.1.49 shows that the API does not -accept this syntax for the USE command. - -.. _faq3_14: - -3.14 I am not able to browse a table when I don't have the right to SELECT one of the columns. ----------------------------------------------------------------------------------------------- - -This has been a known limitation of phpMyAdmin since the beginning and -it's not likely to be solved in the future. - -.. _faq3_15: - -3.15 (withdrawn). ------------------ - -.. _faq3_16: - -3.16 (withdrawn). ------------------ - -.. _faq3_17: - -3.17 (withdrawn). ------------------ - -.. _faq3_18: - -3.18 When I import a CSV file that contains multiple tables, they are lumped together into a single table. ----------------------------------------------------------------------------------------------------------- - -There is no reliable way to differentiate tables in :term:`CSV` format. For the -time being, you will have to break apart :term:`CSV` files containing multiple -tables. - -.. _faq3_19: - -3.19 When I import a file and have phpMyAdmin determine the appropriate data structure it only uses int, decimal, and varchar types. ------------------------------------------------------------------------------------------------------------------------------------- - -Currently, the import type-detection system can only assign these -MySQL types to columns. In future, more will likely be added but for -the time being you will have to edit the structure to your liking -post-import. Also, you should note the fact that phpMyAdmin will use -the size of the largest item in any given column as the column size -for the appropriate type. If you know you will be adding larger items -to that column then you should manually adjust the column sizes -accordingly. This is done for the sake of efficiency. - -.. _faq3_20: - -3.20 After upgrading, some bookmarks are gone or their content cannot be shown. -------------------------------------------------------------------------------- - -At some point, the character set used to store bookmark content has changed. -It's better to recreate your bookmark from the newer phpMyAdmin version. - -.. _faqmultiuser: - -ISPs, multi-user installations -++++++++++++++++++++++++++++++ - -.. _faq4_1: - -4.1 I'm an ISP. Can I setup one central copy of phpMyAdmin or do I need to install it for each customer? --------------------------------------------------------------------------------------------------------- - -Since version 2.0.3, you can setup a central copy of phpMyAdmin for all your -users. The development of this feature was kindly sponsored by NetCologne GmbH. -This requires a properly setup MySQL user management and phpMyAdmin -:term:`HTTP` or cookie authentication. - -.. seealso:: :ref:`authentication_modes` - -.. _faq4_2: - -4.2 What's the preferred way of making phpMyAdmin secure against evil access? ------------------------------------------------------------------------------ - -This depends on your system. If you're running a server which cannot be -accessed by other people, it's sufficient to use the directory protection -bundled with your webserver (with Apache you can use :term:`.htaccess` files, -for example). If other people have telnet access to your server, you should use -phpMyAdmin's :term:`HTTP` or cookie authentication features. - -Suggestions: - -* Your :file:`config.inc.php` file should be ``chmod 660``. -* All your phpMyAdmin files should be chown -R phpmy.apache, where phpmy - is a user whose password is only known to you, and apache is the group - under which Apache runs. -* Follow security recommendations for PHP and your webserver. - -.. _faq4_3: - -4.3 I get errors about not being able to include a file in */lang* or in */libraries*. --------------------------------------------------------------------------------------- - -Check :file:`php.ini`, or ask your sysadmin to check it. The -``include_path`` must contain "." somewhere in it, and -``open_basedir``, if used, must contain "." and "./lang" to allow -normal operation of phpMyAdmin. - -.. _faq4_4: - -4.4 phpMyAdmin always gives "Access denied" when using HTTP authentication. ---------------------------------------------------------------------------- - -This could happen for several reasons: - -* :config:option:`$cfg['Servers'][$i]['controluser']` and/or :config:option:`$cfg['Servers'][$i]['controlpass']` are wrong. -* The username/password you specify in the login dialog are invalid. -* You have already setup a security mechanism for the phpMyAdmin- - directory, eg. a :term:`.htaccess` file. This would interfere with phpMyAdmin's - authentication, so remove it. - -.. _faq4_5: - -4.5 Is it possible to let users create their own databases? ------------------------------------------------------------ - -Starting with 2.2.5, in the user management page, you can enter a -wildcard database name for a user (for example "joe%"), and put the -privileges you want. For example, adding ``SELECT, INSERT, UPDATE, -DELETE, CREATE, DROP, INDEX, ALTER`` would let a user create/manage -his/her database(s). - -.. _faq4_6: - -4.6 How can I use the Host-based authentication additions? ----------------------------------------------------------- - -If you have existing rules from an old :term:`.htaccess` file, you can take them and -add a username between the ``'deny'``/``'allow'`` and ``'from'`` -strings. Using the username wildcard of ``'%'`` would be a major -benefit here if your installation is suited to using it. Then you can -just add those updated lines into the -:config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` array. - -If you want a pre-made sample, you can try this fragment. It stops the -'root' user from logging in from any networks other than the private -network :term:`IP` blocks. - -.. code-block:: php - - - //block root from logging in except from the private networks - $cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow'; - $cfg['Servers'][$i]['AllowDeny']['rules'] = array( - 'deny root from all', - 'allow root from localhost', - 'allow root from 10.0.0.0/8', - 'allow root from 192.168.0.0/16', - 'allow root from 172.16.0.0/12', - ); - -.. _faq4_7: - -4.7 Authentication window is displayed more than once, why? ------------------------------------------------------------ - -This happens if you are using a :term:`URL` to start phpMyAdmin which is -different than the one set in your :config:option:`$cfg['PmaAbsoluteUri']`. For -example, a missing "www", or entering with an :term:`IP` address while a domain -name is defined in the config file. - -.. _faq4_8: - -4.8 Which parameters can I use in the URL that starts phpMyAdmin? ------------------------------------------------------------------ - -When starting phpMyAdmin, you can use the ``db``, ``pma_username``, -``pma_password`` and ``server`` parameters. This last one can contain -either the numeric host index (from ``$i`` of the configuration file) -or one of the host names present in the configuration file. Using -``pma_username`` and ``pma_password`` has been tested along with the -usage of 'cookie' ``auth_type``. - -.. _faqbrowsers: - -Browsers or client OS -+++++++++++++++++++++ - -.. _faq5_1: - -5.1 I get an out of memory error, and my controls are non-functional, when trying to create a table with more than 14 columns. ------------------------------------------------------------------------------------------------------------------------------- - -We could reproduce this problem only under Win98/98SE. Testing under -WinNT4 or Win2K, we could easily create more than 60 columns. A -workaround is to create a smaller number of columns, then come back to -your table properties and add the other columns. - -.. _faq5_2: - -5.2 With Xitami 2.5b4, phpMyAdmin won't process form fields. ------------------------------------------------------------- - -This is not a phpMyAdmin problem but a Xitami known bug: you'll face -it with each script/website that use forms. Upgrade or downgrade your -Xitami server. - -.. _faq5_3: - -5.3 I have problems dumping tables with Konqueror (phpMyAdmin 2.2.2). ---------------------------------------------------------------------- - -With Konqueror 2.1.1: plain dumps, zip and GZip dumps work ok, except -that the proposed file name for the dump is always 'tbl\_dump.php'. -Bzip2 dumps don't seem to work. With Konqueror 2.2.1: plain dumps -work; zip dumps are placed into the user's temporary directory, so -they must be moved before closing Konqueror, or else they disappear. -GZip dumps give an error message. Testing needs to be done for -Konqueror 2.2.2. - -.. _faq5_4: - -5.4 I can't use the cookie authentication mode because Internet Explorer never stores the cookies. --------------------------------------------------------------------------------------------------- - -MS Internet Explorer seems to be really buggy about cookies, at least -till version 6. - -.. _faq5_5: - -5.5 In Internet Explorer 5.0, I get JavaScript errors when browsing my rows. ----------------------------------------------------------------------------- - -Upgrade to at least Internet Explorer 5.5 SP2. - -.. _faq5_6: - -5.6 In Internet Explorer 5.0, 5.5 or 6.0, I get an error (like "Page not found") when trying to modify a row in a table with many columns, or with a text column. ------------------------------------------------------------------------------------------------------------------------------------------------------------------ - -Your table neither have a primary key nor an unique one, so we must use a long -:term:`URL` to identify this row. There is a limit on the length of the -:term:`URL` in those browsers, and this not happen in Netscape, for example. -The workaround is to create a primary or unique key, or use another browser. - -.. _faq5_7: - -5.7 I refresh (reload) my browser, and come back to the welcome page. ---------------------------------------------------------------------- - -Some browsers support right-clicking into the frame you want to -refresh, just do this in the right frame. - -.. _faq5_8: - -5.8 With Mozilla 0.9.7 I have problems sending a query modified in the query box. ---------------------------------------------------------------------------------- - -Looks like a Mozilla bug: 0.9.6 was OK. We will keep an eye on future -Mozilla versions. - -.. _faq5_9: - -5.9 With Mozilla 0.9.? to 1.0 and Netscape 7.0-PR1 I can't type a whitespace in the SQL-Query edit area: the page scrolls down. -------------------------------------------------------------------------------------------------------------------------------- - -This is a Mozilla bug (see bug #26882 at `BugZilla -`_). - -.. _faq5_10: - -5.10 With Netscape 4.75 I get empty rows between each row of data in a CSV exported file. ------------------------------------------------------------------------------------------ - -This is a known Netscape 4.75 bug: it adds some line feeds when -exporting data in octet-stream mode. Since we can't detect the -specific Netscape version, we cannot workaround this bug. - -.. _faq5_11: - -5.11 Extended-ASCII characters like German umlauts are displayed wrong. ------------------------------------------------------------------------ - -Please ensure that you have set your browser's character set to the -one of the language file you have selected on phpMyAdmin's start page. -Alternatively, you can try the auto detection mode that is supported -by the recent versions of the most browsers. - -.. _faq5_12: - -5.12 Mac OS X Safari browser changes special characters to "?". ---------------------------------------------------------------- - -This issue has been reported by a :term:`Mac OS X` user, who adds that Chimera, -Netscape and Mozilla do not have this problem. - -.. _faq5_13: - -5.13 With Internet Explorer 5.5 or 6, and HTTP authentication type, I cannot manage two servers: I log in to the first one, then the other one, but if I switch back to the first, I have to log in on each operation. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -This is a bug in Internet Explorer, other browsers do not behave this -way. - -.. _faq5_14: - -5.14 Using Opera6, I can manage to get to the authentication, but nothing happens after that, only a blank screen. ------------------------------------------------------------------------------------------------------------------- - -Please upgrade to Opera7 at least. - -.. _faq5_15: - -5.15 I have display problems with Safari. ------------------------------------------ - -Please upgrade to at least version 1.2.3. - -.. _faq5_16: - -5.16 With Internet Explorer, I get "Access is denied" Javascript errors. Or I cannot make phpMyAdmin work under Windows. ------------------------------------------------------------------------------------------------------------------------- - -Please check the following points: - -* Maybe you have defined your :config:option:`$cfg['PmaAbsoluteUri']` setting in - :file:`config.inc.php` to an :term:`IP` address and you are starting phpMyAdmin - with a :term:`URL` containing a domain name, or the reverse situation. -* Security settings in IE and/or Microsoft Security Center are too high, - thus blocking scripts execution. -* The Windows Firewall is blocking Apache and MySQL. You must allow - :term:`HTTP` ports (80 or 443) and MySQL - port (usually 3306) in the "in" and "out" directions. - -.. _faq5_17: - -5.17 With Firefox, I cannot delete rows of data or drop a database. -------------------------------------------------------------------- - -Many users have confirmed that the Tabbrowser Extensions plugin they -installed in their Firefox is causing the problem. - -.. _faq5_18: - -5.18 With Konqueror 4.2.x an invalid ``LIMIT`` clause is generated when I browse a table. ------------------------------------------------------------------------------------------ - -This happens only when both of these conditions are met: using the -``http`` authentication mode and ``register_globals`` being set to -``On`` on the server. It seems to be a browser-specific problem; -meanwhile use the ``cookie`` authentication mode. - -.. _faq5_19: - -5.19 I get JavaScript errors in my browser. -------------------------------------------- - -Issues have been reported with some combinations of browser -extensions. To troubleshoot, disable all extensions then clear your -browser cache to see if the problem goes away. - -.. _faqusing: - -Using phpMyAdmin -++++++++++++++++ - -.. _faq6_1: - -6.1 I can't insert new rows into a table / I can't create a table - MySQL brings up a SQL error. ------------------------------------------------------------------------------------------------- - -Examine the :term:`SQL` error with care. -Often the problem is caused by specifying a wrong column-type. Common -errors include: - -* Using ``VARCHAR`` without a size argument -* Using ``TEXT`` or ``BLOB`` with a size argument - -Also, look at the syntax chapter in the MySQL manual to confirm that -your syntax is correct. - -.. _faq6_2: - -6.2 When I create a table, I set an index for two columns and phpMyAdmin generates only one index with those two columns. -------------------------------------------------------------------------------------------------------------------------- - -This is the way to create a multi-columns index. If you want two -indexes, create the first one when creating the table, save, then -display the table properties and click the Index link to create the -other index. - -.. _faq6_3: - -6.3 How can I insert a null value into my table? ------------------------------------------------- - -Since version 2.2.3, you have a checkbox for each column that can be -null. Before 2.2.3, you had to enter "null", without the quotes, as -the column's value. Since version 2.5.5, you have to use the checkbox -to get a real NULL value, so if you enter "NULL" this means you want a -literal NULL in the column, and not a NULL value (this works in PHP4). - -.. _faq6_4: - -6.4 How can I backup my database or table? ------------------------------------------- - -Click on a database or table name in the navigation panel, the properties will -be displayed. Then on the menu, click "Export", you can dump the structure, the -data, or both. This will generate standard :term:`SQL` statements that can be -used to recreate your database/table. You will need to choose "Save as file", -so that phpMyAdmin can transmit the resulting dump to your station. Depending -on your PHP configuration, you will see options to compress the dump. See also -the :config:option:`$cfg['ExecTimeLimit']` configuration variable. For -additional help on this subject, look for the word "dump" in this document. - -.. _faq6_5: - -6.5 How can I restore (upload) my database or table using a dump? How can I run a ".sql" file? ----------------------------------------------------------------------------------------------- - -Click on a database name in the navigation panel, the properties will -be displayed. Select "Import" from the list of tabs in the right–hand -frame (or ":term:`SQL`" if your phpMyAdmin -version is previous to 2.7.0). In the "Location of the text file" -section, type in the path to your dump filename, or use the Browse -button. Then click Go. With version 2.7.0, the import engine has been -re–written, if possible it is suggested that you upgrade to take -advantage of the new features. For additional help on this subject, -look for the word "upload" in this document. - -Note: For errors while importing of dumps exported from older MySQL versions to newer MySQL versions, -please check :ref:`faq6_41`. - -.. _faq6_6: - -6.6 How can I use the relation table in Query-by-example? ---------------------------------------------------------- - -Here is an example with the tables persons, towns and countries, all -located in the database "mydb". If you don't have a ``pma__relation`` -table, create it as explained in the configuration section. Then -create the example tables: - -.. code-block:: mysql - - - CREATE TABLE REL_countries ( - country_code char(1) NOT NULL default '', - description varchar(10) NOT NULL default '', - PRIMARY KEY (country_code) - ) TYPE=MyISAM; - - INSERT INTO REL_countries VALUES ('C', 'Canada'); - - CREATE TABLE REL_persons ( - id tinyint(4) NOT NULL auto_increment, - person_name varchar(32) NOT NULL default '', - town_code varchar(5) default '0', - country_code char(1) NOT NULL default '', - PRIMARY KEY (id) - ) TYPE=MyISAM; - - INSERT INTO REL_persons VALUES (11, 'Marc', 'S', ''); - INSERT INTO REL_persons VALUES (15, 'Paul', 'S', 'C'); - - CREATE TABLE REL_towns ( - town_code varchar(5) NOT NULL default '0', - description varchar(30) NOT NULL default '', - PRIMARY KEY (town_code) - ) TYPE=MyISAM; - - INSERT INTO REL_towns VALUES ('S', 'Sherbrooke'); - INSERT INTO REL_towns VALUES ('M', 'Montréal'); - -To setup appropriate links and display information: - -* on table "REL\_persons" click Structure, then Relation view -* for "town\_code", choose from dropdowns, "mydb", "REL\_towns", "code" - for foreign database, table and column respectively -* for "country\_code", choose from dropdowns, "mydb", "REL\_countries", - "country\_code" for foreign database, table and column respectively -* on table "REL\_towns" click Structure, then Relation view -* in "Choose column to display", choose "description" -* repeat the two previous steps for table "REL\_countries" - -Then test like this: - -* Click on your db name in the navigation panel -* Choose "Query" -* Use tables: persons, towns, countries -* Click "Update query" -* In the columns row, choose persons.person\_name and click the "Show" - tickbox -* Do the same for towns.description and countries.descriptions in the - other 2 columns -* Click "Update query" and you will see in the query box that the - correct joins have been generated -* Click "Submit query" - -.. _faqdisplay: - -6.7 How can I use the "display column" feature? ------------------------------------------------ - -Starting from the previous example, create the ``pma__table_info`` as -explained in the configuration section, then browse your persons -table, and move the mouse over a town code or country code. See also -:ref:`faq6_21` for an additional feature that "display column" -enables: drop-down list of possible values. - -.. _faqpdf: - -6.8 How can I produce a PDF schema of my database? --------------------------------------------------- - -First the configuration variables "relation", "table\_coords" and -"pdf\_pages" have to be filled in. Then you need to think about your -schema layout. Which tables will go on which pages? - -* Select your database in the navigation panel. -* Choose "Operations" in the navigation bar at the top. -* Choose "Edit :term:`PDF` Pages" near the - bottom of the page. -* Enter a name for the first :term:`PDF` page - and click Go. If you like, you can use the "automatic layout," which - will put all your linked tables onto the new page. -* Select the name of the new page (making sure the Edit radio button is - selected) and click Go. -* Select a table from the list, enter its coordinates and click Save. - Coordinates are relative; your diagram will be automatically scaled to - fit the page. When initially placing tables on the page, just pick any - coordinates -- say, 50x50. After clicking Save, you can then use the - :ref:`wysiwyg` to position the element correctly. -* When you'd like to look at your :term:`PDF`, first be sure to click the Save - button beneath the list of tables and coordinates, to save any changes you - made there. Then scroll all the way down, select the :term:`PDF` options you - want, and click Go. -* Internet Explorer for Windows may suggest an incorrect filename when - you try to save a generated :term:`PDF`. - When saving a generated :term:`PDF`, be - sure that the filename ends in ".pdf", for example "schema.pdf". - Browsers on other operating systems, and other browsers on Windows, do - not have this problem. - -.. _faq6_9: - -6.9 phpMyAdmin is changing the type of one of my columns! ---------------------------------------------------------- - -No, it's MySQL that is doing `silent column type changing -`_. - -.. _underscore: - -6.10 When creating a privilege, what happens with underscores in the database name? ------------------------------------------------------------------------------------ - -If you do not put a backslash before the underscore, this is a -wildcard grant, and the underscore means "any character". So, if the -database name is "john\_db", the user would get rights to john1db, -john2db ... If you put a backslash before the underscore, it means -that the database name will have a real underscore. - -.. _faq6_11: - -6.11 What is the curious symbol ø in the statistics pages? ----------------------------------------------------------- - -It means "average". - -.. _faqexport: - -6.12 I want to understand some Export options. ----------------------------------------------- - -**Structure:** - -* "Add DROP TABLE" will add a line telling MySQL to `drop the table - `_, if it already - exists during the import. It does NOT drop the table after your - export, it only affects the import file. -* "If Not Exists" will only create the table if it doesn't exist. - Otherwise, you may get an error if the table name exists but has a - different structure. -* "Add AUTO\_INCREMENT value" ensures that AUTO\_INCREMENT value (if - any) will be included in backup. -* "Enclose table and column names with backquotes" ensures that column - and table names formed with special characters are protected. -* "Add into comments" includes column comments, relations, and MIME - types set in the pmadb in the dump as :term:`SQL` comments - (*/\* xxx \*/*). - -**Data:** - -* "Complete inserts" adds the column names on every INSERT command, for - better documentation (but resulting file is bigger). -* "Extended inserts" provides a shorter dump file by using only once the - INSERT verb and the table name. -* "Delayed inserts" are best explained in the `MySQL manual - INSERT DELAYED Syntax - `_. -* "Ignore inserts" treats errors as a warning instead. Again, more info - is provided in the `MySQL manual - INSERT Syntax - `_, but basically with - this selected, invalid values are adjusted and inserted rather than - causing the entire statement to fail. - -.. _faq6_13: - -6.13 I would like to create a database with a dot in its name. --------------------------------------------------------------- - -This is a bad idea, because in MySQL the syntax "database.table" is -the normal way to reference a database and table name. Worse, MySQL -will usually let you create a database with a dot, but then you cannot -work with it, nor delete it. - -.. _faqsqlvalidator: - -6.14 (withdrawn). ------------------ - -.. _faq6_15: - -6.15 I want to add a BLOB column and put an index on it, but MySQL says "BLOB column '...' used in key specification without a key length". -------------------------------------------------------------------------------------------------------------------------------------------- - -The right way to do this, is to create the column without any indexes, -then display the table structure and use the "Create an index" dialog. -On this page, you will be able to choose your BLOB column, and set a -size to the index, which is the condition to create an index on a BLOB -column. - -.. _faq6_16: - -6.16 How can I simply move in page with plenty editing fields? --------------------------------------------------------------- - -You can use :kbd:`Ctrl+arrows` (:kbd:`Option+Arrows` in Safari) for moving on -most pages with many editing fields (table structure changes, row editing, -etc.). - -.. _faq6_17: - -6.17 Transformations: I can't enter my own mimetype! WTF is this feature then useful for? ------------------------------------------------------------------------------------------ - -Slow down :). Defining mimetypes is of no use, if you can't put -transformations on them. Otherwise you could just put a comment on the -column. Because entering your own mimetype will cause serious syntax -checking issues and validation, this introduces a high-risk false- -user-input situation. Instead you have to initialize mimetypes using -functions or empty mimetype definitions. - -Plus, you have a whole overview of available mimetypes. Who knows all those -mimetypes by heart so he/she can enter it at will? - -.. _faqbookmark: - -6.18 Bookmarks: Where can I store bookmarks? Why can't I see any bookmarks below the query box? What are these variables for? ------------------------------------------------------------------------------------------------------------------------------ - -Any query you have executed can be stored as a bookmark on the page -where the results are displayed. You will find a button labeled -'Bookmark this query' just at the end of the page. As soon as you have -stored a bookmark, it is related to the database you run the query on. -You can now access a bookmark dropdown on each page, the query box -appears on for that database. - -You can also have, inside the query, placeholders for variables. -This is done by inserting into the query SQL comments between ``/*`` and -``*/``. Inside the comments, the special strings ``[VARIABLE{variable-number}]`` is used. -Be aware that the whole query minus the SQL comments must be -valid by itself, otherwise you won't be able to store it as a bookmark. - -When you execute the bookmark, everything typed into the *Variables* -input boxes on the query box page will replace the strings ``/*[VARIABLE{variable-number}]*/`` in -your stored query. - -Also remember, that everything else inside the ``/*[VARIABLE{variable-number}]*/`` string for -your query will remain the way it is, but will be stripped of the ``/**/`` -chars. So you can use: - -.. code-block:: mysql - - /*, [VARIABLE1] AS myname */ - -which will be expanded to - -.. code-block:: mysql - - , VARIABLE1 as myname - -in your query, where VARIABLE1 is the string you entered in the Variable 1 input box. - -A more complex example. Say you have stored -this query: - -.. code-block:: mysql - - SELECT Name, Address FROM addresses WHERE 1 /* AND Name LIKE '%[VARIABLE1]%' */ - -Say, you now enter "phpMyAdmin" as the variable for the stored query, the full -query will be: - -.. code-block:: mysql - - SELECT Name, Address FROM addresses WHERE 1 AND Name LIKE '%phpMyAdmin%' - -**NOTE THE ABSENCE OF SPACES** inside the ``/**/`` construct. Any spaces -inserted there will be later also inserted as spaces in your query and may lead -to unexpected results especially when using the variable expansion inside of a -"LIKE ''" expression. - -.. _faq6_19: - -6.19 How can I create simple LATEX document to include exported table? ----------------------------------------------------------------------- - -You can simply include table in your LATEX documents, -minimal sample document should look like following one (assuming you -have table exported in file :file:`table.tex`): - -.. code-block:: latex - - - \documentclass{article} % or any class you want - \usepackage{longtable} % for displaying table - \begin{document} % start of document - \include{table} % including exported table - \end{document} % end of document - -.. _faq6_20: - -6.20 I see a lot of databases which are not mine, and cannot access them. -------------------------------------------------------------------------- - -You have one of these global privileges: CREATE TEMPORARY TABLES, SHOW -DATABASES, LOCK TABLES. Those privileges also enable users to see all the -database names. So if your users do not need those privileges, you can remove -them and their databases list will shorten. - -.. seealso:: - -.. _faq6_21: - -6.21 In edit/insert mode, how can I see a list of possible values for a column, based on some foreign table? ------------------------------------------------------------------------------------------------------------- - -You have to setup appropriate links between the tables, and also setup -the "display column" in the foreign table. See :ref:`faq6_6` for an -example. Then, if there are 100 values or less in the foreign table, a -drop-down list of values will be available. You will see two lists of -values, the first list containing the key and the display column, the -second list containing the display column and the key. The reason for -this is to be able to type the first letter of either the key or the -display column. For 100 values or more, a distinct window will appear, -to browse foreign key values and choose one. To change the default -limit of 100, see :config:option:`$cfg['ForeignKeyMaxLimit']`. - - -.. _faq6_22: - -6.22 Bookmarks: Can I execute a default bookmark automatically when entering Browse mode for a table? ------------------------------------------------------------------------------------------------------ - -Yes. If a bookmark has the same label as a table name and it's not a -public bookmark, it will be executed. - -.. _faq6_23: - -6.23 Export: I heard phpMyAdmin can export Microsoft Excel files? ------------------------------------------------------------------ - -You can use :term:`CSV` for Microsoft Excel, -which works out of the box. - -.. versionchanged:: 3.4.5 - Since phpMyAdmin 3.4.5 support for direct export to Microsoft Excel version - 97 and newer was dropped. - -.. _faq6_24: - -6.24 Now that phpMyAdmin supports native MySQL 4.1.x column comments, what happens to my column comments stored in pmadb? -------------------------------------------------------------------------------------------------------------------------- - -Automatic migration of a table's pmadb-style column comments to the -native ones is done whenever you enter Structure page for this table. - -.. _faq6_25: - -6.25 (withdrawn). ------------------ - -.. _faq6_26: - -6.26 How can I select a range of rows? --------------------------------------- - -Click the first row of the range, hold the shift key and click the -last row of the range. This works everywhere you see rows, for example -in Browse mode or on the Structure page. - -.. _faq6_27: - -6.27 What format strings can I use? ------------------------------------ - -In all places where phpMyAdmin accepts format strings, you can use -``@VARIABLE@`` expansion and `strftime `_ -format strings. The expanded variables depend on a context (for -example, if you haven't chosen a table, you can not get the table -name), but the following variables can be used: - -``@HTTP_HOST@`` - HTTP host that runs phpMyAdmin -``@SERVER@`` - MySQL server name -``@VERBOSE@`` - Verbose MySQL server name as defined in :config:option:`$cfg['Servers'][$i]['verbose']` -``@VSERVER@`` - Verbose MySQL server name if set, otherwise normal -``@DATABASE@`` - Currently opened database -``@TABLE@`` - Currently opened table -``@COLUMNS@`` - Columns of the currently opened table -``@PHPMYADMIN@`` - phpMyAdmin with version - -.. _wysiwyg: - -6.28 How can I easily edit relational schema for export? --------------------------------------------------------- - -By clicking on the button 'toggle scratchboard' on the page where you -edit x/y coordinates of those elements you can activate a scratchboard -where all your elements are placed. By clicking on an element, you can -move them around in the pre-defined area and the x/y coordinates will -get updated dynamically. Likewise, when entering a new position -directly into the input field, the new position in the scratchboard -changes after your cursor leaves the input field. - -You have to click on the 'OK'-button below the tables to save the new -positions. If you want to place a new element, first add it to the -table of elements and then you can drag the new element around. - -By changing the paper size and the orientation you can change the size -of the scratchboard as well. You can do so by just changing the -dropdown field below, and the scratchboard will resize automatically, -without interfering with the current placement of the elements. - -If ever an element gets out of range you can either enlarge the paper -size or click on the 'reset' button to place all elements below each -other. - -.. _faq6_29: - -6.29 Why can't I get a chart from my query result table? --------------------------------------------------------- - -Not every table can be put to the chart. Only tables with one, two or -three columns can be visualised as a chart. Moreover the table must be -in a special format for chart script to understand it. Currently -supported formats can be found in the `wiki `_. - -.. _faq6_30: - -6.30 Import: How can I import ESRI Shapefiles? ----------------------------------------------- - -An ESRI Shapefile is actually a set of several files, where .shp file -contains geometry data and .dbf file contains data related to those -geometry data. To read data from .dbf file you need to have PHP -compiled with the dBase extension (--enable-dbase). Otherwise only -geometry data will be imported. - -To upload these set of files you can use either of the following -methods: - -Configure upload directory with :config:option:`$cfg['UploadDir']`, upload both .shp and .dbf files with -the same filename and chose the .shp file from the import page. - -Create a Zip archive with .shp and .dbf files and import it. For this -to work, you need to set :config:option:`$cfg['TempDir']` to a place where the web server user can -write (for example ``'./tmp'``). - -To create the temporary directory on a UNIX-based system, you can do: - -.. code-block:: sh - - cd phpMyAdmin - mkdir tmp - chmod o+rwx tmp - -.. _faq6_31: - -6.31 How do I create a relation in designer? --------------------------------------------- - -To select relation, click: The display column is shown in pink. To -set/unset a column as the display column, click the "Choose column to -display" icon, then click on the appropriate column name. - -.. _faq6_32: - -6.32 How can I use the zoom search feature? -------------------------------------------- - -The Zoom search feature is an alternative to table search feature. It allows -you to explore a table by representing its data in a scatter plot. You can -locate this feature by selecting a table and clicking the :guilabel:`Search` -tab. One of the sub-tabs in the :guilabel:`Table Search` page is -:guilabel:`Zoom Search`. - -Consider the table REL\_persons in :ref:`faq6_6` for -an example. To use zoom search, two columns need to be selected, for -example, id and town\_code. The id values will be represented on one -axis and town\_code values on the other axis. Each row will be -represented as a point in a scatter plot based on its id and -town\_code. You can include two additional search criteria apart from -the two fields to display. - -You can choose which field should be -displayed as label for each point. If a display column has been set -for the table (see :ref:`faqdisplay`), it is taken as the label unless -you specify otherwise. You can also select the maximum number of rows -you want to be displayed in the plot by specifing it in the 'Max rows -to plot' field. Once you have decided over your criteria, click 'Go' -to display the plot. - -After the plot is generated, you can use the -mousewheel to zoom in and out of the plot. In addition, panning -feature is enabled to navigate through the plot. You can zoom-in to a -certain level of detail and use panning to locate your area of -interest. Clicking on a point opens a dialogue box, displaying field -values of the data row represented by the point. You can edit the -values if required and click on submit to issue an update query. Basic -instructions on how to use can be viewed by clicking the 'How to use?' -link located just above the plot. - -.. _faq6_33: - -6.33 When browsing a table, how can I copy a column name? ---------------------------------------------------------- - -Selecting the name of the column within the browse table header cell -for copying is difficult, as the columns support reordering by -dragging the header cells as well as sorting by clicking on the linked -column name. To copy a column name, double-click on the empty area -next to the column name, when the tooltip tells you to do so. This -will show you an input box with the column name. You may right-click -the column name within this input box to copy it to your clipboard. - -.. _faq6_34: - -6.34 How can I use the Favorite Tables feature? ---------------------------------------------------------- - -Favorite Tables feature is very much similar to Recent Tables feature. -It allows you to add a shortcut for the frequently used tables of any -database in the navigation panel . You can easily navigate to any table -in the list by simply choosing it from the list. These tables are stored -in your browser's local storage if you have not configured your -`phpMyAdmin Configuration Storage`. Otherwise these entries are stored in -`phpMyAdmin Configuration Storage`. - -IMPORTANT: In absence of `phpMyAdmin Configuration Storage`, your Favorite -tables may be different in different browsers based on your different -selections in them. - -To add a table to Favorite list simply click on the `Gray` star in front -of a table name in the list of tables of a Database and wait until it -turns to `Yellow`. -To remove a table from list, simply click on the `Yellow` star and -wait until it turns `Gray` again. - -Using :config:option:`$cfg['NumFavoriteTables']` in your :file:`config.inc.php` -file, you can define the maximum number of favorite tables shown in the -navigation panel. Its default value is `10`. - -.. _faq6_35: - -6.35 How can I use the Range search feature? ---------------------------------------------------------- - -With the help of range search feature, one can specify a range of values for -particular column(s) while performing search operation on a table from the `Search` -tab. - -To use this feature simply click on the `BETWEEN` or `NOT BETWEEN` operators -from the operator select list in front of the column name. On choosing one of the -above options, a dialog box will show up asking for the `Minimum` and `Maximum` -value for that column. Only the specified range of values will be included -in case of `BETWEEN` and excluded in case of `NOT BETWEEN` from the final results. - -Note: The Range search feature will work only `Numeric` and `Date` data type columns. - -.. _faq6_36: - -6.36 What is Central columns and How can I use this feature? ------------------------------------------------------------- - -As the name suggests, the Central columns feature enables to maintain a central list of -columns per database to avoid similar name for the same data element and bring consistency -of data type for the same data element. You can use the central list of columns to -add an element to any table structure in that database which will save from writing -similar column name and column definition. - -To add a column to central list, go to table structure page, check the columns you want -to include and then simply click on "Add to central columns". If you want to add all -unique columns from more than one table from a database then go to database structure page, -check the tables you want to include and then select "Add columns to central list". - -To remove a column from central list, go to Table structure page, check the columns you want -to remove and then simply click on "Remove from central columns". If you want to remove all -columns from more than one tables from a database then go to database structure page, -check the tables you want to include and then select "Remove columns from central list". - -To view and manage the central list, select the database you want to manage central columns -for then from the top menu click on "Central columns". You will be taken to a page where -you will have options to edit, delete or add new columns to central list. - -.. _faq6_37: - -6.37 How can I use Improve Table structure feature? ---------------------------------------------------------- - -Improve table structure feature helps to bring the table structure upto -Third Normal Form. A wizard is presented to user which asks questions about the -elements during the various steps for normalization and a new structure is proposed -accordingly to bring the table into the First/Second/Third Normal form. -On startup of the wizard, user gets to select upto what normal form they want to -normalize the table structure. - -Here is an example table which you can use to test all of the three First, Second and -Third Normal Form. - -.. code-block:: mysql - - CREATE TABLE `VetOffice` ( - `petName` varchar(64) NOT NULL, - `petBreed` varchar(64) NOT NULL, - `petType` varchar(64) NOT NULL, - `petDOB` date NOT NULL, - `ownerLastName` varchar(64) NOT NULL, - `ownerFirstName` varchar(64) NOT NULL, - `ownerPhone1` int(12) NOT NULL, - `ownerPhone2` int(12) NOT NULL, - `ownerEmail` varchar(64) NOT NULL, - ); - -The above table is not in First normal Form as no primary key exists. Primary key -is supposed to be (`petName`,`ownerLastName`,`ownerFirstName`) . If the primary key -is chosen as suggested the resultant table won't be in Second as well as Third Normal -form as the following dependencies exists. - -.. code-block:: mysql - - (OwnerLastName, OwnerFirstName) -> OwnerEmail - (OwnerLastName, OwnerFirstName) -> OwnerPhone - PetBreed -> PetType - -Which says, OwnerEmail depends on OwnerLastName and OwnerFirstName. -OwnerPhone depends on OwnerLastName and OwnerFirstName. -PetType depends on PetBreed. - -.. _faq6_38: - -6.38 How can I reassign auto-incremented values? ------------------------------------------------- - -Some users prefer their AUTO_INCREMENT values to be consecutive; this is not -always the case after row deletion. - -Here are the steps to accomplish this. These are manual steps because they -involve a manual verification at one point. - -* Ensure that you have exclusive access to the table to rearrange - -* On your primary key column (i.e. id), remove the AUTO_INCREMENT setting - -* Delete your primary key in Structure > indexes - -* Create a new column future_id as primary key, AUTO_INCREMENT - -* Browse your table and verify that the new increments correspond to what - you're expecting - -* Drop your old id column - -* Rename the future_id column to id - -* Move the new id column via Structure > Move columns - -.. _faq6_39: - -6.39 What is the "Adjust privileges" option when renaming, copying, or moving a database, table, column, or procedure? ----------------------------------------------------------------------------------------------------------------------- - -When renaming/copying/moving a database/table/column/procedure, -MySQL does not adjust the original privileges relating to these objects -on its own. By selecting this option, phpMyAdmin will adjust the privilege -table so that users have the same privileges on the new items. - -For example: A user 'bob'@'localhost' has a 'SELECT' privilege on a -column named 'id'. Now, if this column is renamed to 'id_new', MySQL, -on its own, would **not** adjust the column privileges to the new column name. -phpMyAdmin can make this adjustment for you automatically. - -Notes: - -* While adjusting privileges for a database, the privileges of all - database-related elements (tables, columns and procedures) are also adjusted - to the database's new name. - -* Similarly, while adjusting privileges for a table, the privileges of all - the columns inside the new table are also adjusted. - -* While adjusting privileges, the user performing the operation **must** have the following - privileges: - - * SELECT, INSERT, UPDATE, DELETE privileges on following tables: - `mysql`.`db`, `mysql`.`columns_priv`, `mysql`.`tables_priv`, `mysql`.`procs_priv` - * FLUSH privilege (GLOBAL) - -Thus, if you want to replicate the database/table/column/procedure as it is -while renaming/copying/moving these objects, make sure you have checked this option. - -.. _faq6_40: - -6.40 I see "Bind parameters" checkbox in the "SQL" page. How do I write parameterized SQL queries? --------------------------------------------------------------------------------------------------- - -From version 4.5, phpMyAdmin allows users to execute parameterized queries in the "SQL" page. -Parameters should be prefixed with a colon(:) and when the "Bind parameters" checkbox is checked -these parameters will be identified and input fields for these parameters will be presented. -Values entered in these field will be substituted in the query before being executed. - -.. _faq6_41: - -6.41 I get import errors while importing the dumps exported from older MySQL versions (pre-5.7.6) into newer MySQL versions (5.7.7+), but they work fine when imported back on same older versions ? --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -If you get errors like *#1031 - Table storage engine for 'table_name' doesn't have this option* -while importing the dumps exported from pre-5.7.7 MySQL servers into new MySQL server versions 5.7.7+, -it might be because ROW_FORMAT=FIXED is not supported with InnoDB tables. Moreover, the value of -`innodb_strict_mode `_ would define if this would be reported as a warning or as an error. - -Since MySQL version 5.7.9, the default value for `innodb_strict_mode` is `ON` and thus would generate -an error when such a CREATE TABLE or ALTER TABLE statement is encountered. - -There are two ways of preventing such errors while importing: - -* Change the value of `innodb_strict_mode` to `OFF` before starting the import and turn it `ON` after - the import is successfully completed. -* This can be achieved in two ways: - - * Go to 'Variables' page and edit the value of `innodb_strict_mode` - * Run the query : `SET GLOBAL `innodb_strict_mode` = '[value]'` - -After the import is done, it is suggested that the value of `innodb_strict_mode` should be reset to the -original value. - -.. _faqproject: - -phpMyAdmin project -++++++++++++++++++ - -.. _faq7_1: - -7.1 I have found a bug. How do I inform developers? ---------------------------------------------------- - -Our issues tracker is located at . - -.. _faq7_2: - -7.2 I want to translate the messages to a new language or upgrade an existing language, where do I start? ---------------------------------------------------------------------------------------------------------- - -Translations are very welcome and all you need to have are the -language skills. The easiest way is to use our `online translation -service `_. You can check -out all the possibilities to translate in the `translate section on -our website `_. - -.. _faq7_3: - -7.3 I would like to help out with the development of phpMyAdmin. How should I proceed? --------------------------------------------------------------------------------------- - -We welcome every contribution to the development of phpMyAdmin. You -can check out all the possibilities to contribute in the `contribute -section on our website -`_. - -.. seealso:: :ref:`developers` - -.. _faqsecurity: - -Security -++++++++ - -.. _faq8_1: - -8.1 Where can I get information about the security alerts issued for phpMyAdmin? --------------------------------------------------------------------------------- - -Please refer to . - -.. _faq8_2: - -8.2 How can I protect phpMyAdmin against brute force attacks? -------------------------------------------------------------- - -If you use Apache web server, phpMyAdmin exports information about -authentication to the Apache environment and it can be used in Apache -logs. Currently there are two variables available: - - -``userID`` - User name of currently active user (he does not have to be logged in). -``userStatus`` - Status of currently active user, one of ``ok`` (user is logged in), - ``mysql-denied`` (MySQL denied user login), ``allow-denied`` (user denied - by allow/deny rules), ``root-denied`` (root is denied in configuration), - ``empty-denied`` (empty password is denied). - -``LogFormat`` directive for Apache can look like following: - -.. code-block:: apache - - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{userID}n %{userStatus}n" pma_combined - -You can then use any log analyzing tools to detect possible break-in -attempts. - -.. _faq8_3: - -8.3 Why are there path disclosures when directly loading certain files? ------------------------------------------------------------------------ - -This is a server configuration problem. Never enable ``display_errors`` on a production site. - -.. _faqsynchronization: - -Synchronization -+++++++++++++++ - -.. _faq9_1: - -9.1 (withdrawn). ----------------- - -.. _faq9_2: - -9.2 (withdrawn). ----------------- - diff --git a/#pma/doc/html/_sources/glossary.txt b/#pma/doc/html/_sources/glossary.txt deleted file mode 100644 index 763e58e1..00000000 --- a/#pma/doc/html/_sources/glossary.txt +++ /dev/null @@ -1,401 +0,0 @@ -.. _glossary: - -Glossary -======== - -From Wikipedia, the free encyclopedia - -.. glossary:: - - .htaccess - the default name of Apache's directory-level configuration file. - - .. seealso:: - - ACL - Access Contol List - - Blowfish - a keyed, symmetric block cipher, designed in 1993 by Bruce Schneier. - - .. seealso:: - - Browser - a software application that enables a user to display and interact with text, images, and other information typically located on a web page at a website on the World Wide Web. - - .. seealso:: - - bzip2 - a free software/open source data compression algorithm and program developed by Julian Seward. - - .. seealso:: - - CGI - Common Gateway Interface is an important World Wide Web technology that - enables a client web browser to request data from a program executed on - the Web server. - - .. seealso:: - - Changelog - a log or record of changes made to a project. - - .. seealso:: - - Client - a computer system that accesses a (remote) service on another computer by some kind of network. - - .. seealso:: - - column - a set of data values of a particular simple type, one for each row of the table. - - .. seealso:: - - Cookie - a packet of information sent by a server to a World Wide Web browser and then sent back by the browser each time it accesses that server. - - .. seealso:: - - CSV - Comma- separated values - - .. seealso:: - - DB - look at :term:`database` - - database - an organized collection of data. - - .. seealso:: - - Engine - look at :term:`storage engines` - - extension - a PHP module that extends PHP with additional functionality. - - .. seealso:: - - FAQ - Frequently Asked Questions is a list of commonly asked question and there - answers. - - .. seealso:: - - Field - one part of divided data/columns. - - .. seealso:: - - foreign key - a column or group of columns in a database row that point to a key column - or group of columns forming a key of another database row in some - (usually different) table. - - .. seealso:: - - FPDF - the free :term:`PDF` library - - .. seealso:: - - GD - Graphics Library by Thomas Boutell and others for dynamically manipulating images. - - .. seealso:: - - GD2 - look at :term:`gd` - - gzip - gzip is short for GNU zip, a GNU free software file compression program. - - .. seealso:: - - host - any machine connected to a computer network, a node that has a hostname. - - .. seealso:: - - hostname - the unique name by which a network attached device is known on a network. - - .. seealso:: - - HTTP - HyperText Transfer Protocol is the primary method used to transfer or - convey information on the World Wide Web. - - .. seealso:: - - https - a :term:`HTTP`-connection with additional security measures. - - .. seealso:: - - IEC - International Electrotechnical Commission - - IIS - Internet Information Services is a set of Internet-based services for - servers using Microsoft Windows. - - .. seealso:: - - Index - a feature that allows quick access to the rows in a table. - - .. seealso:: - - IP - Internet Protocol is a data-oriented protocol used by source and - destination hosts for communicating data across a packet-switched - internetwork. - - .. seealso:: - - IP Address - a unique number that devices use in order to identify and communicate with each other on a network utilizing the Internet Protocol standard. - - .. seealso:: - - IPv6 - IPv6 (Internet Protocol version 6) is the latest revision of the - Internet Protocol (:term:`IP`), designed to deal with the - long-anticipated problem of its precedessor IPv4 running out of addresses. - - .. seealso:: - - ISAPI - Internet Server Application Programming Interface is the API of Internet Information Services (IIS). - - .. seealso:: - - ISP - Internet service provider is a business or organization that offers users - access to the Internet and related services. - - .. seealso:: - - ISO - International Standards Organisation - - JPEG - a most commonly used standard method of lossy compression for photographic images. - - .. seealso:: - - JPG - look at :term:`jpeg` - - Key - look at :term:`index` - - LATEX - a document preparation system for the TEX typesetting program. - - .. seealso:: - - Mac - Apple Macintosh is line of personal computers is designed, developed, manufactured, and marketed by Apple Computer. - - .. seealso:: - - Mac OS X - the operating system which is included with all currently shipping Apple Macintosh computers in the consumer and professional markets. - - .. seealso:: - - MCrypt - a cryptographic library. - - .. seealso:: - - mcrypt - the MCrypt PHP extension. - - .. seealso:: - - MIME - Multipurpose Internet Mail Extensions is - an Internet Standard for the format of e-mail. - - .. seealso:: - - module - some sort of extension for the Apache Webserver. - - .. seealso:: - - mod_proxy_fcgi - an Apache module implmenting a Fast CGI interface; PHP can be run as a CGI module, FastCGI, or - directly as an Apache module. - - MySQL - a multithreaded, multi-user, SQL (Structured Query Language) Database Management System (DBMS). - - .. seealso:: - - mysqli - the improved MySQL client PHP extension. - - .. seealso:: - - mysql - the MySQL client PHP extension. - - .. seealso:: - - OpenDocument - open standard for office documents. - - .. seealso:: - - OS X - look at :term:`Mac OS X`. - - .. seealso:: - - PDF - Portable Document Format is a file format developed by Adobe Systems for - representing two dimensional documents in a device independent and - resolution independent format. - - .. seealso:: - - PEAR - the PHP Extension and Application Repository. - - .. seealso:: - - PCRE - Perl Compatible Regular Expressions is the perl-compatible regular - expression functions for PHP - - .. seealso:: - - PHP - short for "PHP: Hypertext Preprocessor", is an open-source, reflective - programming language used mainly for developing server-side applications - and dynamic web content, and more recently, a broader range of software - applications. - - .. seealso:: - - port - a connection through which data is sent and received. - - .. seealso:: - - RFC - Request for Comments (RFC) documents are a series of memoranda - encompassing new research, innovations, and methodologies applicable to - Internet technologies. - - .. seealso:: - - RFC 1952 - GZIP file format specification version 4.3 - - .. seealso:: :rfc:`1952` - - Row (record, tuple) - represents a single, implicitly structured data item in a table. - - .. seealso:: - - Server - a computer system that provides services to other computing systems over a network. - - .. seealso:: - - Storage Engines - handlers for different table types - - .. seealso:: - - socket - a form of inter-process communication. - - .. seealso:: - - SSL - Secure Sockets Layer is a cryptographic protocol which provides secure - communication on the Internet. - - .. seealso:: - - Stored procedure - a subroutine available to applications accessing a relational database system - - .. seealso:: - - SQL - Structured Query Language - - .. seealso:: - - table - a set of data elements (cells) that is organized, defined and stored as - horizontal rows and vertical columns where each item can be uniquely - identified by a label or key or by it?s position in relation to other - items. - - .. seealso:: - - tar - a type of archive file format: the Tape ARchive format. - - .. seealso:: - - TCP - Transmission Control Protocol is one of the core protocols of the - Internet protocol suite. - - .. seealso:: - - TCPDF - Rewrite of :term:`UFPDF` with various improvements. - - .. seealso:: - - trigger - a procedural code that is automatically executed in response to certain events on a particular table or view in a database - - .. seealso:: - - UFPDF - Unicode/UTF-8 extension for :term:`FPDF` - - URL - Uniform Resource Locator is a sequence of characters, conforming to a - standardized format, that is used for referring to resources, such as - documents and images on the Internet, by their location. - - .. seealso:: - - Webserver - A computer (program) that is responsible for accepting HTTP requests from clients and serving them Web pages. - - .. seealso:: - - XML - Extensible Markup Language is a W3C-recommended general- purpose markup - language for creating special-purpose markup languages, capable of - describing many different kinds of data. - - .. seealso:: - - ZIP - a popular data compression and archival format. - - .. seealso:: - - zlib - an open-source, cross- platform data compression library by Jean-loup Gailly and Mark Adler. - - .. seealso:: - - diff --git a/#pma/doc/html/_sources/import_export.txt b/#pma/doc/html/_sources/import_export.txt deleted file mode 100644 index 5921cd5c..00000000 --- a/#pma/doc/html/_sources/import_export.txt +++ /dev/null @@ -1,27 +0,0 @@ -Import and export -================= - -In addition to the standard Import and Export tab, you can also import an SQL file directly by dragging and dropping -it from your local file manager to the phpMyAdmin interface in your web browser. - -Open Document Spreadsheet -------------------------- - -When importing an ODS speadsheet, the spreadsheet must be named in a specific way in order to make the -import as simple as possible. - -Table name -~~~~~~~~~~ - -During import, phpMyAdmin uses the sheet name as the table name; you should rename the -sheet in your spreadsheet program in order to match your existing table name (or the table you wish to create, -though this is less of a concern since you could quickly rename the new table from the Operations tab). - -Column names -~~~~~~~~~~~~ - -You should also make the first row of your spreadsheet a header with the names of the columns (this can be -accomplished by inserting a new row at the top of your spreadsheet). When on the Import screen, select the -checkbox for "The first line of the file contains the table column names;" this way your newly imported -data will go to the proper columns. - diff --git a/#pma/doc/html/_sources/index.txt b/#pma/doc/html/_sources/index.txt deleted file mode 100644 index 917ddf81..00000000 --- a/#pma/doc/html/_sources/index.txt +++ /dev/null @@ -1,32 +0,0 @@ -.. phpMyAdmin documentation master file, created by - sphinx-quickstart on Wed Sep 26 14:04:48 2012. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to phpMyAdmin's documentation! -====================================== - -Contents: - -.. toctree:: - :maxdepth: 2 - - intro - require - setup - config - user - faq - developers - vendors - copyright - credits - glossary - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`search` -* :ref:`glossary` diff --git a/#pma/doc/html/_sources/intro.txt b/#pma/doc/html/_sources/intro.txt deleted file mode 100644 index b8c348df..00000000 --- a/#pma/doc/html/_sources/intro.txt +++ /dev/null @@ -1,68 +0,0 @@ -.. _intro: - -Introduction -============ - -phpMyAdmin can manage a whole MySQL server (needs a super-user) as -well as a single database. To accomplish the latter you'll need a -properly set up MySQL user who can read/write only the desired -database. It's up to you to look up the appropriate part in the MySQL -manual. - - -Supported features ------------------- - -Currently phpMyAdmin can: - -* browse and drop databases, tables, views, columns and indexes -* display multiple results sets through stored procedures or queries -* create, copy, drop, rename and alter databases, tables, columns and - indexes -* maintenance server, databases and tables, with proposals on server - configuration -* execute, edit and bookmark any :term:`SQL`-statement, even batch-queries -* load text files into tables -* create [#f1]_ and read dumps of tables -* export [#f1]_ data to various formats: :term:`CSV`, :term:`XML`, :term:`PDF`, - :term:`ISO`/:term:`IEC` 26300 - :term:`OpenDocument` Text and Spreadsheet, Microsoft - Word 2000, and LATEX formats -* import data and :term:`MySQL` structures from :term:`OpenDocument` spreadsheets, as - well as :term:`XML`, :term:`CSV`, and :term:`SQL` files -* administer multiple servers -* manage MySQL users and privileges -* check referential integrity in MyISAM tables -* using Query-by-example (QBE), create complex queries automatically - connecting required tables -* create :term:`PDF` graphics of your - database layout -* search globally in a database or a subset of it -* transform stored data into any format using a set of predefined - functions, like displaying BLOB-data as image or download-link -* track changes on databases, tables and views -* support InnoDB tables and foreign keys -* support mysqli, the improved MySQL extension see :ref:`faq1_17` -* create, edit, call, export and drop stored procedures and functions -* create, edit, export and drop events and triggers -* communicate in `80 different languages - `_ - - -A word about users ------------------- - -Many people have difficulty understanding the concept of user -management with regards to phpMyAdmin. When a user logs in to -phpMyAdmin, that username and password are passed directly to MySQL. -phpMyAdmin does no account management on its own (other than allowing -one to manipulate the MySQL user account information); all users must -be valid MySQL users. - -.. rubric:: Footnotes - -.. [#f1] - - phpMyAdmin can compress (:term:`Zip`, :term:`GZip` or :term:`RFC 1952` - formats) dumps and :term:`CSV` exports if you use PHP with - :term:`Zlib` support (``--with-zlib``). - Proper support may also need changes in :file:`php.ini`. diff --git a/#pma/doc/html/_sources/other.txt b/#pma/doc/html/_sources/other.txt deleted file mode 100644 index 61e83acc..00000000 --- a/#pma/doc/html/_sources/other.txt +++ /dev/null @@ -1,18 +0,0 @@ -Other sources of information -============================ - -Printed Book ------------- - -The definitive guide to using phpMyAdmin is the book Mastering phpMyAdmin for -Effective MySQL Management by Marc Delisle. You can get information on that -book and other officially endorsed `books at the phpMyAdmin site`_. - -.. _books at the phpMyAdmin site: https://www.phpmyadmin.net/docs/ - -Tutorials ---------- - -Third party tutorials and articles are listed on our `wiki page`_. - -.. _wiki page: https://wiki.phpmyadmin.net/pma/Articles diff --git a/#pma/doc/html/_sources/privileges.txt b/#pma/doc/html/_sources/privileges.txt deleted file mode 100644 index 6a7b8c37..00000000 --- a/#pma/doc/html/_sources/privileges.txt +++ /dev/null @@ -1,74 +0,0 @@ -User management -=============== - -User management is the process of controlling which users are allowed to -connect to the MySQL server and what permissions they have on each database. -phpMyAdmin does not handle user management, rather it passes the username and -password on to MySQL, which then determines whether a user is permitted to -perform a particular action. Within phpMyAdmin, administrators have full -control over creating users, viewing and editing privileges for existing users, -and removing users. - -Within phpMyAdmin, user management is controlled via the :guilabel:`Users` link -from the main page. Users can be created, edited, and removed. - -Creating a new user -------------------- - -To create a new user, click the :guilabel:`Add a new user` link near the bottom -of the :guilabel:`Users` page (you must be a "superuser", e.g., user "root"). -Use the textboxes and drop-downs to configure the user to your particular -needs. You can then select whether to create a database for that user and grant -specific global privileges. Once you've created the user (by clicking Go), you -can define that user's permissions on a specific database (don't grant global -privileges in that case). In general, users do not need any global privileges -(other than USAGE), only permissions for their specific database. - -Editing an existing user ------------------------- - -To edit an existing user, simply click the pencil icon to the right of that -user in the :guilabel:`Users` page. You can then edit their global- and -database-specific privileges, change their password, or even copy those -privileges to a new user. - -Deleting a user ---------------- - -From the :guilabel:`Users` page, check the checkbox for the user you wish to -remove, select whether or not to also remove any databases of the same name (if -they exist), and click Go. - -Assigning privileges to user for a specific database ----------------------------------------------------- - -Users are assigned to databases by editing the user record (from the -:guilabel:`Users` link on the home page) not from within the :guilabel:`Users` -link under the table. If you are creating a user specifically for a given table -you will have to create the user first (with no global privileges) and then go -back and edit that user to add the table and privileges for the individual -table. - -.. _configurablemenus: - -Configurable menus and user groups ----------------------------------- - -By enabling :config:option:`$cfg['Servers'][$i]['usergroups']` and -:config:option:`$cfg['Servers'][$i]['usergroups']` you can customize what users -will see in the phpMyAdmin navigation. - -.. warning:: - - This feature only limits what a user sees, he is still able to use all the - functions. So this can not be considered as a security limitation. Should - you want to limit what users can do, use MySQL privileges to achieve that. - -With this feature enabled, the :guilabel:`User accounts` management interface gains -a second tab for managing :guilabel:`User groups`, where you can define what each -group will view (see image below) and you can then assign each user to one of -these groups. Users will be presented with a simplified user interface, which might be -useful for inexperienced users who could be overwhelmed by all the features -phpMyAdmin provides. - -.. image:: images/usergroups.png diff --git a/#pma/doc/html/_sources/require.txt b/#pma/doc/html/_sources/require.txt deleted file mode 100644 index 4e3c7ec7..00000000 --- a/#pma/doc/html/_sources/require.txt +++ /dev/null @@ -1,59 +0,0 @@ -.. _require: - -Requirements -============ - -Web server ----------- - -Since phpMyAdmin's interface is based entirely in your browser, you'll need a -web server (such as Apache, nginx, :term:`IIS`) to install phpMyAdmin's files into. - -PHP ---- - -* You need PHP 5.5.0 or newer, with ``session`` support, the Standard PHP Library - (SPL) extension, JSON support, and the ``mbstring`` extension. - -* To support uploading of ZIP files, you need the PHP ``zip`` extension. - -* You need GD2 support in PHP to display inline thumbnails of JPEGs - ("image/jpeg: inline") with their original aspect ratio. - -* When using the cookie authentication (the default), the `openssl - `_ extension is strongly suggested. - -* To support upload progress bars, see :ref:`faq2_9`. - -* To support XML and Open Document Spreadsheet importing, you need the - `libxml `_ extension. - -* To support reCAPTCHA on the login page, you need the - `openssl `_ extension. - -* To support displaying phpMyAdmin's latest version, you need to enable - ``allow_url_open`` in your :file:`php.ini` or to have the - `curl `_ extension. - -* Performance suggestion: install the ``ctype`` extension. - -.. seealso:: :ref:`faq1_31`, :ref:`authentication_modes` - -Database --------- - -phpMyAdmin supports MySQL-compatible databases. - -* MySQL 5.5 or newer -* MariaDB 5.5 or newer - -.. seealso:: :ref:`faq1_17` - -Web browser ------------ - -To access phpMyAdmin you need a web browser with cookies and JavaScript -enabled. - -You need browser which is supported by jQuery 2.0, see -. diff --git a/#pma/doc/html/_sources/setup.txt b/#pma/doc/html/_sources/setup.txt deleted file mode 100644 index 0d812542..00000000 --- a/#pma/doc/html/_sources/setup.txt +++ /dev/null @@ -1,819 +0,0 @@ -.. _setup: - -Installation -============ - -phpMyAdmin does not apply any special security methods to the MySQL -database server. It is still the system administrator's job to grant -permissions on the MySQL databases properly. phpMyAdmin's :guilabel:`Users` -page can be used for this. - -.. warning:: - - :term:`Mac` users should note that if you are on a version before - :term:`Mac OS X`, StuffIt unstuffs with :term:`Mac` formats. So you'll have - to resave as in BBEdit to Unix style ALL phpMyAdmin scripts before - uploading them to your server, as PHP seems not to like :term:`Mac`-style - end of lines character ("``\r``"). - -Linux distributions -+++++++++++++++++++ - -phpMyAdmin is included in most Linux distributions. It is recommended to use -distribution packages when possible - they usually provide integration to your -distribution and you will automatically get security updates from your distribution. - - -Debian ------- - -Debian's package repositories include a phpMyAdmin package, but be aware that -the configuration file is maintained in ``/etc/phpmyadmin`` and may differ in -some ways from the official phpMyAdmin documentation. - -OpenSUSE --------- - -OpenSUSE already comes with phpMyAdmin package, just install packages from -the `openSUSE Build Service `_. - -Ubuntu ------- - -Ubuntu ships phpMyAdmin package, however if you want to use recent version, you -can use packages from -`PPA for Michal Čihař `_. - -Gentoo ------- - -Gentoo ships the phpMyAdmin package, both in a near stock configuration as well -as in a ``webapp-config`` configuration. Use ``emerge dev-db/phpmyadmin`` to -install. - -Mandriva --------- - -Mandriva ships the phpMyAdmin package in their ``contrib`` branch and can be -installed via the usual Control Center. - -Fedora ------- - -Fedora ships the phpMyAdmin package, but be aware that the configuration file -is maintained in ``/etc/phpMyAdmin/`` and may differ in some ways from the -official phpMyAdmin documentation. - -Red Hat Enterprise Linux ------------------------- - -Red Hat Enterprise Linux itself and thus derivatives like CentOS don't -ship phpMyAdmin, but the Fedora-driven repository -`Extra Packages for Enterprise Linux (EPEL) `_ -is doing so, if it's -`enabled `_. -But be aware that the configuration file is maintained in -``/etc/phpMyAdmin/`` and may differ in some ways from the -official phpMyAdmin documentation. - - -Installing on Windows -+++++++++++++++++++++ - -The easiest way to get phpMyAdmin on Windows is using third party products -which include phpMyAdmin together with a database and web server such as -`XAMPP `_. - -You can find more of such options at `Wikipedia `_. - - -Installing using Composer -+++++++++++++++++++++++++ - -You can install phpMyAdmin using `Composer `_, -however it's currently not available in the default -`Packagist `_ repository due to its technical -limitations. - -The installation is possible by adding our own repository -: - -.. code-block:: sh - - composer create-project phpmyadmin/phpmyadmin --repository-url=https://www.phpmyadmin.net/packages.json --no-dev - -Installing using Docker -+++++++++++++++++++++++ - -phpMyAdmin comes with a Docker image, which you can easily deploy. You can -download it using: - -.. code-block:: sh - - docker pull phpmyadmin/phpmyadmin - -The phpMyAdmin server will be executed on port 80. It supports several ways of -configuring the link to the database server, which you can manage using -environment variables: - -.. envvar:: PMA_ARBITRARY - - Allows you to enter database server hostname on login form (see - :config:option:`$cfg['AllowArbitraryServer']`). - -.. envvar:: PMA_HOST - - Host name or IP address of the database server to use. - -.. envvar:: PMA_HOSTS - - Comma separated host names or IP addresses of the database servers to use. - -.. envvar:: PMA_USER - - User name to use for :ref:`auth_config`. - -.. envvar:: PMA_PASSWORD - - Password to use for :ref:`auth_config`. - -.. envvar:: PMA_PORT - - Port of the databse server to use. - -.. envvar:: PMA_ABSOLUTE_URI - - The fully-qualified path (``https://pma.example.net/``) where the reverse - proxy makes phpMyAdmin available. - -By default, :ref:`cookie` is used, but if :envvar:`PMA_USER` and -:envvar:`PMA_PASSWORD` are set, it is switched to :ref:`auth_config`. - -.. note:: - - The credentials you need to login are stored in the MySQL server, in case - of Docker image there are various ways to set it (for example - :envvar:`MYSQL_ROOT_PASSWORD` when starting MySQL container). Please check - documentation for `MariaDB container `_ - or `MySQL container `_. - -Additionally configuration can be tweaked by :file:`/www/config.user.inc.php`. If -this file exists, it will be loaded after configuration generated from above -environment variables, so you can override any configuration variable. This -configuraiton can be added as a volume when invoking docker using -`-v /some/local/directory/config.user.inc.php:/www/config.user.inc.php` parameters. - -.. seealso:: - - See :ref:`config` for detailed description of configuration options. - -Docker Volumes --------------- - -You can use following volumes to customise image behavior: - -:file:`/www/config.user.inc.php` - - Can be used for additional settings, see previous chapter for more details. - -:file:`/sessions/` - - Directory where PHP sessions are stored. You might want to share this - for example when uswing :ref:`auth_signon`. - -Docker Examples ---------------- - -To connect phpMyAdmin to given server use: - -.. code-block:: sh - - docker run --name myadmin -d -e PMA_HOST=dbhost -p 8080:80 phpmyadmin/phpmyadmin - -To connect phpMyAdmin to more servers use: - -.. code-block:: sh - - docker run --name myadmin -d -e PMA_HOSTS=dbhost1,dbhost2,dbhost3 -p 8080:80 phpmyadmin/phpmyadmin - -To use arbitrary server option: - -.. code-block:: sh - - docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 -e PMA_ARBITRARY=1 phpmyadmin/phpmyadmin - -You can also link the database container using Docker: - -.. code-block:: sh - - docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 phpmyadmin/phpmyadmin - -Running with additional configration: - -.. code-block:: sh - - docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/config.user.inc.php:/config.user.inc.php phpmyadmin/phpmyadmin - -Using docker-compose --------------------- - -Alternatively you can also use docker-compose with the docker-compose.yml from -. This will run phpMyAdmin with -arbitrary server - allowing you to specify MySQL/MariaDB server on login page. - -.. code-block:: sh - - docker-compose up -d - -.. _quick_install: - -Quick Install -+++++++++++++ - -#. Choose an appropriate distribution kit from the phpmyadmin.net - Downloads page. Some kits contain only the English messages, others - contain all languages. We'll assume you chose a kit whose name - looks like ``phpMyAdmin-x.x.x -all-languages.tar.gz``. -#. Ensure you have downloaded a genuine archive, see :ref:`verify`. -#. Untar or unzip the distribution (be sure to unzip the subdirectories): - ``tar -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz`` in your - webserver's document root. If you don't have direct access to your - document root, put the files in a directory on your local machine, - and, after step 4, transfer the directory on your web server using, - for example, ftp. -#. Ensure that all the scripts have the appropriate owner (if PHP is - running in safe mode, having some scripts with an owner different from - the owner of other scripts will be a problem). See :ref:`faq4_2` and - :ref:`faq1_26` for suggestions. -#. Now you must configure your installation. There are two methods that - can be used. Traditionally, users have hand-edited a copy of - :file:`config.inc.php`, but now a wizard-style setup script is provided - for those who prefer a graphical installation. Creating a - :file:`config.inc.php` is still a quick way to get started and needed for - some advanced features. - - -Manually creating the file --------------------------- - -To manually create the file, simply use your text editor to create the -file :file:`config.inc.php` (you can copy :file:`config.sample.inc.php` to get -a minimal configuration file) in the main (top-level) phpMyAdmin -directory (the one that contains :file:`index.php`). phpMyAdmin first -loads :file:`libraries/config.default.php` and then overrides those values -with anything found in :file:`config.inc.php`. If the default value is -okay for a particular setting, there is no need to include it in -:file:`config.inc.php`. You'll probably need only a few directives to get going; a -simple configuration may look like this: - -.. code-block:: xml+php - - - - -Or, if you prefer to not be prompted every time you log in: - -.. code-block:: xml+php - - - - -For a full explanation of possible configuration values, see the -:ref:`config` of this document. - -.. index:: Setup script - -.. _setup_script: - -Using Setup script ------------------- - -Instead of manually editing :file:`config.inc.php`, you can use phpMyAdmin's -setup feature. First you must manually create a folder ``config`` -in the phpMyAdmin directory. This is a security measure. On a -Linux/Unix system you can use the following commands: - -.. code-block:: sh - - - cd phpMyAdmin - mkdir config # create directory for saving - chmod o+rw config # give it world writable permissions - -And to edit an existing configuration, copy it over first: - -.. code-block:: sh - - - cp config.inc.php config/ # copy current configuration for editing - chmod o+w config/config.inc.php # give it world writable permissions - -.. note:: - - Debian and Ubuntu have simplified this setup and all you need to do is to - execute :program:`/usr/sbin/pma-configure`. - -On other platforms, simply create the folder and ensure that your web -server has read and write access to it. :ref:`faq1_26` can help with -this. - -Next, open your browser and visit the location where you installed phpMyAdmin, with the ``/setup`` suffix. If you have an existing configuration, -use the ``Load`` button to bring its content inside the setup panel. -Note that **changes are not saved to disk until you explicitly choose ``Save``** -from the *Configuration* area of the screen. Normally the script saves the new -:file:`config.inc.php` to the ``config/`` directory, but if the webserver does -not have the proper permissions you may see the error "Cannot load or -save configuration." Ensure that the ``config/`` directory exists and -has the proper permissions - or use the ``Download`` link to save the -config file locally and upload it (via FTP or some similar means) to the -proper location. - -Once the file has been saved, it must be moved out of the ``config/`` -directory and the permissions must be reset, again as a security -measure: - -.. code-block:: sh - - - mv config/config.inc.php . # move file to current directory - chmod o-rw config.inc.php # remove world read and write permissions - rm -rf config # remove not needed directory - -.. note:: - - Debian and Ubuntu have simplified this setup and all you need to do is to - execute :program:`/usr/sbin/pma-secure`. - -Now the file is ready to be used. You can choose to review or edit the -file with your favorite editor, if you prefer to set some advanced -options which the setup script does not provide. - -#. If you are using the ``auth_type`` "config", it is suggested that you - protect the phpMyAdmin installation directory because using config - does not require a user to enter a password to access the phpMyAdmin - installation. Use of an alternate authentication method is - recommended, for example with HTTP–AUTH in a :term:`.htaccess` file or switch to using - ``auth_type`` cookie or http. See the :ref:`faqmultiuser` - for additional information, especially :ref:`faq4_4`. -#. Open the `main phpMyAdmin directory `_ in your browser. - phpMyAdmin should now display a welcome screen and your databases, or - a login dialog if using :term:`HTTP` or - cookie authentication mode. -#. You should deny access to the ``./libraries`` and ``./setup/lib`` - subfolders in your webserver configuration. - Such configuration prevents from possible - path exposure and cross side scripting vulnerabilities that might - happen to be found in that code. For the Apache webserver, this is - often accomplished with a :term:`.htaccess` file in those directories. -#. It is generally a good idea to protect a public phpMyAdmin installation - against access by robots as they usually can not do anything good - there. You can do this using ``robots.txt`` file in root of your - webserver or limit access by web server configuration, see - :ref:`faq1_42`. - - -.. _verify: - -Verifying phpMyAdmin releases -+++++++++++++++++++++++++++++ - -Since July 2015 all phpMyAdmin releases are cryptographically signed by the -releasing developer, who through January 2016 was Marc Delisle. His key id is -0xFEFC65D181AF644A, his PGP fingerprint is: - -.. code-block:: console - - 436F F188 4B1A 0C3F DCBF 0D79 FEFC 65D1 81AF 644A - -and you can get more identification information from . - -Beginning in January 2016, the release manager is Isaac Bennetch. His key id is -0xCE752F178259BD92, and his PGP fingerprint is: - -.. code-block:: console - - 3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92 - -and you can get more identification information from . - -Some additional downloads (for example themes) might be signed by Michal Čihař. His key id is -0x9C27B31342B7511D, and his PGP fingerprint is: - -.. code-block:: console - - 63CB 1DF1 EF12 CF2A C0EE 5A32 9C27 B313 42B7 511D - -and you can get more identification information from . - -You should verify that the signature matches -the archive you have downloaded. This way you can be sure that you are using -the same code that was released. - -Each archive is accompanied with ``.asc`` files which contains the PGP signature -for it. Once you have both of them in the same folder, you can verify the signature: - -.. code-block:: console - - $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc - gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92 - gpg: Can't check signature: public key not found - -As you can see gpg complains that it does not know the public key. At this -point you should do one of the following steps: - -* Download the keyring from `our download server `_, then import it with: - -.. code-block:: console - - $ gpg --import phpmyadmin.keyring - -* Download and import the key from one of the key servers: - -.. code-block:: console - - $ gpg --keyserver hkp://pgp.mit.edu --recv-keys 3D06A59ECE730EB71B511C17CE752F178259BD92 - gpg: requesting key 8259BD92 from hkp server pgp.mit.edu - gpg: key 8259BD92: public key "Isaac Bennetch " imported - gpg: no ultimately trusted keys found - gpg: Total number processed: 1 - gpg: imported: 1 (RSA: 1) - -This will improve the situation a bit - at this point you can verify that the -signature from the given key is correct but you still can not trust the name used -in the key: - -.. code-block:: console - - $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc - gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92 - gpg: Good signature from "Isaac Bennetch " - gpg: aka "Isaac Bennetch " - gpg: WARNING: This key is not certified with a trusted signature! - gpg: There is no indication that the signature belongs to the owner. - Primary key fingerprint: 3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92 - -The problem here is that anybody could issue the key with this name. You need to -ensure that the key is actually owned by the mentioned person. The GNU Privacy -Handbook covers this topic in the chapter `Validating other keys on your public -keyring`_. The most reliable method is to meet the developer in person and -exchange key fingerprints, however you can also rely on the web of trust. This way -you can trust the key transitively though signatures of others, who have met -the developer in person. For example you can see how `Isaac's key links to -Linus's key`_. - -Once the key is trusted, the warning will not occur: - -.. code-block:: console - - $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc - gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92 - gpg: Good signature from "Isaac Bennetch " [full] - -Should the signature be invalid (the archive has been changed), you would get a -clear error regardless of the fact that the key is trusted or not: - -.. code-block:: console - - $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc - gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92 - gpg: BAD signature from "Isaac Bennetch " [unknown] - -.. _Validating other keys on your public keyring: https://www.gnupg.org/gph/en/manual.html#AEN335 - -.. _Isaac's key links to Linus's key: https://pgp.cs.uu.nl/mk_path.cgi?FROM=ABAF11C65A2970B130ABE3C479BE3E4300411886&TO=3D06A59ECE730EB71B511C17CE752F178259BD92 - - -.. index:: - single: Configuration storage - single: phpMyAdmin configuration storage - single: pmadb - -.. _linked-tables: - -phpMyAdmin configuration storage -++++++++++++++++++++++++++++++++ - -For a whole set of additional features (bookmarks, comments, :term:`SQL`-history, -tracking mechanism, :term:`PDF`-generation, column contents transformation, -etc.) you need to create a set of special tables. Those tables can be located -in your own database, or in a central database for a multi-user installation -(this database would then be accessed by the controluser, so no other user -should have rights to it). - -Zero configuration ------------------- - -In many cases, this database structure can be automatically created and -configured. This is called “Zero Configuration” mode and can be particularly -useful in shared hosting situations. “Zeroconf” mode is on by default, to -disable set :config:option:`$cfg['ZeroConf']` to false. - -The following three scenarios are covered by the Zero Configuration mode: - -* When entering a database where the configuration storage tables are not - present, phpMyAdmin offers to create them from the Operations tab. -* When entering a database where the tables do already exist, the software - automatically detects this and begins using them. This is the most common - situation; after the tables are initially created automatically they are - continually used without disturbing the user; this is also most useful on - shared hosting where the user is not able to edit :file:`config.inc.php` and - usually the user only has access to one database. -* When having access to multiple databases, if the user first enters the - database containing the configuration storage tables then switches to - another database, - phpMyAdmin continues to use the tables from the first database; the user is - not prompted to create more tables in the new database. - - -Manual configuration --------------------- - -Please look at your ``./sql/`` directory, where you should find a -file called *create\_tables.sql*. (If you are using a Windows server, -pay special attention to :ref:`faq1_23`). - -If you already had this infrastructure and: - -* upgraded to MySQL 4.1.2 or newer, please use - :file:`sql/upgrade_tables_mysql_4_1_2+.sql`. -* upgraded to phpMyAdmin 4.3.0 or newer from 2.5.0 or newer (<= 4.2.x), - please use :file:`sql/upgrade_column_info_4_3_0+.sql`. - -and then create new tables by importing :file:`sql/create_tables.sql`. - -You can use your phpMyAdmin to create the tables for you. Please be -aware that you may need special (administrator) privileges to create -the database and tables, and that the script may need some tuning, -depending on the database name. - -After having imported the :file:`sql/create_tables.sql` file, you -should specify the table names in your :file:`config.inc.php` file. The -directives used for that can be found in the :ref:`config`. - -You will also need to have a controluser -(:config:option:`$cfg['Servers'][$i]['controluser']` and -:config:option:`$cfg['Servers'][$i]['controlpass']` settings) -with the proper rights to those tables. For example you can create it -using following statement: - -.. code-block:: mysql - - GRANT SELECT, INSERT, UPDATE, DELETE ON .* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass'; - -.. _upgrading: - -Upgrading from an older version -+++++++++++++++++++++++++++++++ - -.. warning:: - - **Never** extract the new version over an existing installation of - phpMyAdmin, always first remove the old files keeping just the - configuration. - - This way you will not leave old no longer working code in the directory, - which can have severe security implications or can cause various breakages. - - -Simply copy :file:`config.inc.php` from your previous installation into -the newly unpacked one. Configuration files from old versions may -require some tweaking as some options have been changed or removed. -For compatibility with PHP 5.3 and later, remove a -``set_magic_quotes_runtime(0);`` statement that you might find near -the end of your configuration file. - -You should **not** copy :file:`libraries/config.default.php` over -:file:`config.inc.php` because the default configuration file is version- -specific. - -If you have upgraded your MySQL server from a version previous to 4.1.2 to -version 5.x or newer and if you use the phpMyAdmin configuration storage, you -should run the :term:`SQL` script found in -:file:`sql/upgrade_tables_mysql_4_1_2+.sql`. - -If you have upgraded your phpMyAdmin to 4.3.0 or newer from 2.5.0 or -newer (<= 4.2.x) and if you use the phpMyAdmin configuration storage, you -should run the :term:`SQL` script found in -:file:`sql/upgrade_column_info_4_3_0+.sql`. - -Do not forget to clear the browser cache and to empty the old session by -logging out and logging in again. - -.. index:: Authentication mode - -.. _authentication_modes: - -Using authentication modes -++++++++++++++++++++++++++ - -:term:`HTTP` and cookie authentication modes are recommended in a **multi-user -environment** where you want to give users access to their own database and -don't want them to play around with others. Nevertheless be aware that MS -Internet Explorer seems to be really buggy about cookies, at least till version -6. Even in a **single-user environment**, you might prefer to use :term:`HTTP` -or cookie mode so that your user/password pair are not in clear in the -configuration file. - -:term:`HTTP` and cookie authentication -modes are more secure: the MySQL login information does not need to be -set in the phpMyAdmin configuration file (except possibly for the -:config:option:`$cfg['Servers'][$i]['controluser']`). -However, keep in mind that the password travels in plain text, unless -you are using the HTTPS protocol. In cookie mode, the password is -stored, encrypted with the AES algorithm, in a temporary cookie. - -Then each of the *true* users should be granted a set of privileges -on a set of particular databases. Normally you shouldn't give global -privileges to an ordinary user, unless you understand the impact of those -privileges (for example, you are creating a superuser). -For example, to grant the user *real_user* with all privileges on -the database *user_base*: - -.. code-block:: mysql - - GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password'; - - -What the user may now do is controlled entirely by the MySQL user management -system. With HTTP or cookie authentication mode, you don't need to fill the -user/password fields inside the :config:option:`$cfg['Servers']`. - -.. index:: pair: HTTP; Authentication mode - -HTTP authentication mode ------------------------- - -* Uses :term:`HTTP` Basic authentication - method and allows you to log in as any valid MySQL user. -* Is supported with most PHP configurations. For :term:`IIS` (:term:`ISAPI`) - support using :term:`CGI` PHP see :ref:`faq1_32`, for using with Apache - :term:`CGI` see :ref:`faq1_35`. -* When PHP is running under Apache's :term:`mod_proxy_fcgi` (e.g. with PHP-FPM), - ``Authorization`` headers are not passed to the underlying FCGI application, - such that your credentials will not reach the application. In this case, you can - add the following configuration directive: - - .. code-block:: apache - - SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 - -* See also :ref:`faq4_4` about not using the :term:`.htaccess` mechanism along with - ':term:`HTTP`' authentication mode. - -.. index:: pair: Cookie; Authentication mode - -.. _cookie: - -Cookie authentication mode --------------------------- - -* Username and password are stored in cookies during the session and password - is deleted when it ends. -* With this mode, the user can truly log out of phpMyAdmin and log - back in with the same username. -* If you want to allow users to enter any hostname to connect (rather than only - servers that are configured in :file:`config.inc.php`), - see the :config:option:`$cfg['AllowArbitraryServer']` directive. -* As mentioned in the :ref:`require` section, having the ``mcrypt`` extension will - speed up access considerably, but is not required. - -.. index:: pair: Signon; Authentication mode - -.. _auth_signon: - -Signon authentication mode --------------------------- - -* This mode is a convenient way of using credentials from another - application to authenticate to phpMyAdmin to implement single signon - solution. -* The other application has to store login information into session - data (see :config:option:`$cfg['Servers'][$i]['SignonSession']`) or you - need to implement script to return the credentials (see - :config:option:`$cfg['Servers'][$i]['SignonScript']`). -* When no credentials are available, the user is being redirected to - :config:option:`$cfg['Servers'][$i]['SignonURL']`, where you should handle - the login process. - -The very basic example of saving credentials in a session is available as -:file:`examples/signon.php`: - -.. literalinclude:: ../examples/signon.php - :language: php - -Alternatively you can also use this way to integrate with OpenID as shown -in :file:`examples/openid.php`: - -.. literalinclude:: ../examples/openid.php - :language: php - -If you intend to pass the credentials using some other means than, you have to -implement wrapper in PHP to get that data and set it to -:config:option:`$cfg['Servers'][$i]['SignonScript']`. There is very minimal example -in :file:`examples/signon-script.php`: - -.. literalinclude:: ../examples/signon-script.php - :language: php - -.. seealso:: - :config:option:`$cfg['Servers'][$i]['auth_type']`, - :config:option:`$cfg['Servers'][$i]['SignonSession']`, - :config:option:`$cfg['Servers'][$i]['SignonScript']`, - :config:option:`$cfg['Servers'][$i]['SignonURL']` - - -.. index:: pair: Config; Authentication mode - -.. _auth_config: - -Config authentication mode --------------------------- - -* This mode is sometimes the less secure one because it requires you to fill the - :config:option:`$cfg['Servers'][$i]['user']` and - :config:option:`$cfg['Servers'][$i]['password']` - fields (and as a result, anyone who can read your :file:`config.inc.php` - can discover your username and password). -* In the :ref:`faqmultiuser` section, there is an entry explaining how - to protect your configuration file. -* For additional security in this mode, you may wish to consider the - Host authentication :config:option:`$cfg['Servers'][$i]['AllowDeny']['order']` - and :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` configuration directives. -* Unlike cookie and http, does not require a user to log in when first - loading the phpMyAdmin site. This is by design but could allow any - user to access your installation. Use of some restriction method is - suggested, perhaps a :term:`.htaccess` file with the HTTP-AUTH directive or disallowing - incoming HTTP requests at one’s router or firewall will suffice (both - of which are beyond the scope of this manual but easily searchable - with Google). - - -Securing your phpMyAdmin installation -+++++++++++++++++++++++++++++++++++++ - -The phpMyAdmin team tries hard to make the application secure, however there -are always ways to make your installation more secure: - -* Serve phpMyAdmin on HTTPS only. Preferably, you should use HSTS as well, so that - you're protected from protocol downgrade attacks. -* Remove the ``test`` directory from phpMyAdmin, unless you are developing and need test suite. -* Remove the ``setup`` directory from phpMyAdmin, you will probably not - use it after the initial setup. -* Properly choose an authentication method - :ref:`cookie` - is probably the best choice for shared hosting. -* In case you don't want all MySQL users to be able to access - phpMyAdmin, you can use :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` to limit them. -* Consider hiding phpMyAdmin behind an authentication proxy, so that - users need to authenticate prior to providing MySQL credentials - to phpMyAdmin. You can achieve this by configuring your web server to request - HTTP authentication. For example in Apache this can be done with: - - .. code-block:: apache - - AuthType Basic - AuthName "Restricted Access" - AuthUserFile /usr/share/phpmyadmin/passwd - Require valid-user - - Once you have changed the configuration, you need to create a list of users which - can authenticate. This can be done using the :program:`htpasswd` utility: - - .. code-block:: sh - - htpasswd -c /usr/share/phpmyadmin/passwd username - -* If you are afraid of automated attacks, enabling Captcha by - :config:option:`$cfg['CaptchaLoginPublicKey']` and - :config:option:`$cfg['CaptchaLoginPrivateKey']` might be an option. - -Known issues -++++++++++++ - -Users with column-specific privileges are unable to "Browse" ------------------------------------------------------------- - -If a user has only column-specific privileges on some (but not all) columns in a table, "Browse" -will fail with an error message. - -As a workaround, a bookmarked query with the same name as the table can be created, this will -run when using the "Browse" link instead. `Issue 11922 `_. - -Trouble logging back in after logging out using 'http' authentication ----------------------------------------------------------------------- - -When using the 'http' ``auth_type``, it can be impossible to log back in (when the logout comes -manually or after a period of inactivity). `Issue 11898 `_. diff --git a/#pma/doc/html/_sources/transformations.txt b/#pma/doc/html/_sources/transformations.txt deleted file mode 100644 index 7b5f1a00..00000000 --- a/#pma/doc/html/_sources/transformations.txt +++ /dev/null @@ -1,138 +0,0 @@ -.. _transformations: - -Transformations -=============== - -.. _transformationsintro: - -Introduction -++++++++++++ - -To enable transformations, you have to setup the ``column_info`` -table and the proper directives. Please see the :ref:`config` on how to do so. - -You can apply different transformations to the contents of each -column. The transformation will take the content of each column and -transform it with certain rules defined in the selected -transformation. - -Say you have a column 'filename' which contains a filename. Normally -you would see in phpMyAdmin only this filename. Using transformations -you can transform that filename into a HTML link, so you can click -inside of the phpMyAdmin structure on the column's link and will see -the file displayed in a new browser window. Using transformation -options you can also specify strings to append/prepend to a string or -the format you want the output stored in. - -For a general overview of all available transformations and their -options, you can consult your *//transformation\_overview.php* installation. - -For a tutorial on how to effectively use transformations, see our -`Link section `_ on the -official phpMyAdmin homepage. - -.. _transformationshowto: - -Usage -+++++ - -Go to your *tbl\_structure.php* page (i.e. reached through clicking on -the 'Structure' link for a table). There click on "Change" (or change -icon) and there you will see three new fields at the end of the line. -They are called 'MIME-type', 'Browser transformation' and -'Transformation options'. - -* The field 'MIME-type' is a drop-down field. Select the MIME-type that - corresponds to the column's contents. Please note that transformations - are inactive as long as no MIME-type is selected. -* The field 'Browser transformation' is a drop-down field. You can - choose from a hopefully growing amount of pre-defined transformations. - See below for information on how to build your own transformation. - There are global transformations and mimetype-bound transformations. - Global transformations can be used for any mimetype. They will take - the mimetype, if necessary, into regard. Mimetype-bound - transformations usually only operate on a certain mimetype. There are - transformations which operate on the main mimetype (like 'image'), - which will most likely take the subtype into regard, and those who - only operate on a specific subtype (like 'image/jpeg'). You can use - transformations on mimetypes for which the function was not defined - for. There is no security check for you selected the right - transformation, so take care of what the output will be like. -* The field 'Transformation options' is a free-type textfield. You have - to enter transform-function specific options here. Usually the - transforms can operate with default options, but it is generally a - good idea to look up the overview to see which options are necessary. - Much like the ENUM/SET-Fields, you have to split up several options - using the format 'a','b','c',...(NOTE THE MISSING BLANKS). This is - because internally the options will be parsed as an array, leaving the - first value the first element in the array, and so forth. If you want - to specify a MIME character set you can define it in the - transformation\_options. You have to put that outside of the pre- - defined options of the specific mime-transform, as the last value of - the set. Use the format "'; charset=XXX'". If you use a transform, for - which you can specify 2 options and you want to append a character - set, enter "'first parameter','second parameter','charset=us-ascii'". - You can, however use the defaults for the parameters: "'','','charset - =us-ascii'". - -.. _transformationsfiles: - -File structure -++++++++++++++ - -All specific transformations for mimetypes are defined through class -files in the directory 'libraries/plugins/transformations/'. Each of -them extends a certain transformation abstract class declared in -libraries/plugins/transformations/abstract. - -They are stored in files to ease up customization and easy adding of -new transformations. - -Because the user cannot enter own mimetypes, it is kept sure that -transformations always work. It makes no sense to apply a -transformation to a mimetype the transform-function doesn't know to -handle. - -There is a file called '*transformations.lib.php*' that provides some -basic functions which can be included by any other transform function. - -The file name convention is ``[Mimetype]_[Subtype]_[Transformation -Name].class.php``, while the abtract class that it extends has the -name ``[Transformation Name]TransformationsPlugin``. All of the -methods that have to be implemented by a transformations plug-in are: - -#. getMIMEType() and getMIMESubtype() in the main class; -#. getName(), getInfo() and applyTransformation() in the abstract class - it extends. - -The getMIMEType(), getMIMESubtype() and getName() methods return the -name of the MIME type, MIME Subtype and transformation accordingly. -getInfo() returns the transformation's description and possible -options it may receive and applyTransformation() is the method that -does the actual work of the transformation plug-in. - -Please see the libraries/plugins/transformations/TEMPLATE and -libraries/plugins/transformations/TEMPLATE\_ABSTRACT files for adding -your own transformation plug-in. You can also generate a new -transformation plug-in (with or without the abstract transformation -class), by using -:file:`scripts/transformations_generator_plugin.sh` or -:file:`scripts/transformations_generator_main_class.sh`. - -The applyTransformation() method always gets passed three variables: - -#. **$buffer** - Contains the text inside of the column. This is the - text, you want to transform. -#. **$options** - Contains any user-passed options to a transform - function as an array. -#. **$meta** - Contains an object with information about your column. The - data is drawn from the output of the `mysql\_fetch\_field() - `_ function. This means, all - object properties described on the `manual page - `_ are available in this - variable and can be used to transform a column accordingly to - unsigned/zerofill/not\_null/... properties. The $meta->mimetype - variable contains the original MIME-type of the column (i.e. - 'text/plain', 'image/jpeg' etc.) - diff --git a/#pma/doc/html/_sources/user.txt b/#pma/doc/html/_sources/user.txt deleted file mode 100644 index 06a3c9c4..00000000 --- a/#pma/doc/html/_sources/user.txt +++ /dev/null @@ -1,10 +0,0 @@ -User Guide -========== - -.. toctree:: - :maxdepth: 2 - - transformations - privileges - other - import_export diff --git a/#pma/doc/html/_sources/vendors.txt b/#pma/doc/html/_sources/vendors.txt deleted file mode 100644 index e24f23c6..00000000 --- a/#pma/doc/html/_sources/vendors.txt +++ /dev/null @@ -1,35 +0,0 @@ -Distributing and packaging phpMyAdmin -===================================== - -This document is intended to give advices to people who want to -redistribute phpMyAdmin inside other software package such as Linux -distribution or some all in one package including web server and MySQL -server. - -Generally you can customize some basic aspects (paths to some files and -behavior) in :file:`libraries/vendor_config.php`. - -For example if you want setup script to generate config file in var, change -``SETUP_CONFIG_FILE`` to :file:`/var/lib/phpmyadmin/config.inc.php` and you -will also probably want to skip directory writable check, so set -``SETUP_DIR_WRITABLE`` to false. - -External libraries ------------------- - -phpMyAdmin includes several external libraries, you might want to -replace them with system ones if they are available, but please note -that you should test whether version you provide is compatible with the -one we ship. - -Currently known list of external libraries: - -js/jquery - jQuery js framework and various jQuery based libraries. - -libraries/php-gettext - php-gettext library -libraries/tcpdf - tcpdf library, stripped down of not needed files -libraries/phpseclib - portions of phpseclib library diff --git a/#pma/doc/html/_static/ajax-loader.gif b/#pma/doc/html/_static/ajax-loader.gif deleted file mode 100644 index 61faf8ca..00000000 Binary files a/#pma/doc/html/_static/ajax-loader.gif and /dev/null differ diff --git a/#pma/doc/html/_static/basic.css b/#pma/doc/html/_static/basic.css deleted file mode 100644 index 2b513f0c..00000000 --- a/#pma/doc/html/_static/basic.css +++ /dev/null @@ -1,604 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -div.code-block-caption { - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; -} - -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/#pma/doc/html/_static/classic.css b/#pma/doc/html/_static/classic.css deleted file mode 100644 index d98894b3..00000000 --- a/#pma/doc/html/_static/classic.css +++ /dev/null @@ -1,261 +0,0 @@ -/* - * default.css_t - * ~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- default theme. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: sans-serif; - font-size: 100%; - background-color: #11303d; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - background-color: #1c4e63; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { - background-color: #ffffff; - color: #000000; - padding: 0 20px 30px 20px; -} - -div.footer { - color: #ffffff; - width: 100%; - padding: 9px 0 9px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - color: #ffffff; - text-decoration: underline; -} - -div.related { - background-color: #133f52; - line-height: 30px; - color: #ffffff; -} - -div.related a { - color: #ffffff; -} - -div.sphinxsidebar { -} - -div.sphinxsidebar h3 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.4em; - font-weight: normal; - margin: 0; - padding: 0; -} - -div.sphinxsidebar h3 a { - color: #ffffff; -} - -div.sphinxsidebar h4 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.3em; - font-weight: normal; - margin: 5px 0 0 0; - padding: 0; -} - -div.sphinxsidebar p { - color: #ffffff; -} - -div.sphinxsidebar p.topless { - margin: 5px 10px 10px 10px; -} - -div.sphinxsidebar ul { - margin: 10px; - padding: 0; - color: #ffffff; -} - -div.sphinxsidebar a { - color: #98dbcc; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - - - -/* -- hyperlink styles ------------------------------------------------------ */ - -a { - color: #355f7c; - text-decoration: none; -} - -a:visited { - color: #355f7c; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - - - -/* -- body styles ----------------------------------------------------------- */ - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Trebuchet MS', sans-serif; - background-color: #f2f2f2; - font-weight: normal; - color: #20435c; - border-bottom: 1px solid #ccc; - margin: 20px -20px 10px -20px; - padding: 3px 0 3px 10px; -} - -div.body h1 { margin-top: 0; font-size: 200%; } -div.body h2 { font-size: 160%; } -div.body h3 { font-size: 140%; } -div.body h4 { font-size: 120%; } -div.body h5 { font-size: 110%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: white; -} - -div.body p, div.body dd, div.body li, div.body blockquote { - text-align: justify; - line-height: 130%; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.admonition p { - margin-bottom: 5px; -} - -div.admonition pre { - margin-bottom: 5px; -} - -div.admonition ul, div.admonition ol { - margin-bottom: 5px; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre { - padding: 5px; - background-color: #eeffcc; - color: #333333; - line-height: 120%; - border: 1px solid #ac9; - border-left: none; - border-right: none; -} - -code { - background-color: #ecf0f3; - padding: 0 1px 0 1px; - font-size: 0.95em; -} - -th { - background-color: #ede; -} - -.warning code { - background: #efc2c2; -} - -.note code { - background: #d6d6d6; -} - -.viewcode-back { - font-family: sans-serif; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} - -div.code-block-caption { - color: #efefef; - background-color: #1c4e63; -} \ No newline at end of file diff --git a/#pma/doc/html/_static/comment-bright.png b/#pma/doc/html/_static/comment-bright.png deleted file mode 100644 index 551517b8..00000000 Binary files a/#pma/doc/html/_static/comment-bright.png and /dev/null differ diff --git a/#pma/doc/html/_static/comment-close.png b/#pma/doc/html/_static/comment-close.png deleted file mode 100644 index 09b54be4..00000000 Binary files a/#pma/doc/html/_static/comment-close.png and /dev/null differ diff --git a/#pma/doc/html/_static/comment.png b/#pma/doc/html/_static/comment.png deleted file mode 100644 index 92feb52b..00000000 Binary files a/#pma/doc/html/_static/comment.png and /dev/null differ diff --git a/#pma/doc/html/_static/default.css b/#pma/doc/html/_static/default.css deleted file mode 100644 index 81b93636..00000000 --- a/#pma/doc/html/_static/default.css +++ /dev/null @@ -1 +0,0 @@ -@import url("classic.css"); diff --git a/#pma/doc/html/_static/doctools.js b/#pma/doc/html/_static/doctools.js deleted file mode 100644 index 81634956..00000000 --- a/#pma/doc/html/_static/doctools.js +++ /dev/null @@ -1,287 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - }, - - initOnKeyListeners: function() { - $(document).keyup(function(event) { - var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; - } - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; - } - } - } - }); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); \ No newline at end of file diff --git a/#pma/doc/html/_static/down-pressed.png b/#pma/doc/html/_static/down-pressed.png deleted file mode 100644 index 7c30d004..00000000 Binary files a/#pma/doc/html/_static/down-pressed.png and /dev/null differ diff --git a/#pma/doc/html/_static/down.png b/#pma/doc/html/_static/down.png deleted file mode 100644 index f48098a4..00000000 Binary files a/#pma/doc/html/_static/down.png and /dev/null differ diff --git a/#pma/doc/html/_static/file.png b/#pma/doc/html/_static/file.png deleted file mode 100644 index 254c60bf..00000000 Binary files a/#pma/doc/html/_static/file.png and /dev/null differ diff --git a/#pma/doc/html/_static/jquery.js b/#pma/doc/html/_static/jquery.js deleted file mode 100644 index e03e1484..00000000 --- a/#pma/doc/html/_static/jquery.js +++ /dev/null @@ -1,10351 +0,0 @@ -/*! - * jQuery JavaScript Library v1.11.3 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2015-11-11T21:12Z - */ - -(function( global, factory ) { - - if ( typeof module === "object" && typeof module.exports === "object" ) { - // For CommonJS and CommonJS-like environments where a proper window is present, - // execute the factory and get jQuery - // For environments that do not inherently posses a window with a document - // (such as Node.js), expose a jQuery-making factory as module.exports - // This accentuates the need for the creation of a real window - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Can't do this because several apps including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -// - -var deletedIds = []; - -var slice = deletedIds.slice; - -var concat = deletedIds.concat; - -var push = deletedIds.push; - -var indexOf = deletedIds.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var support = {}; - - - -var - version = "1.11.3", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android<4.1, IE<9 - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num != null ? - - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - - // Return all the elements in a clean array - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: deletedIds.sort, - splice: deletedIds.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - /* jshint eqeqeq: false */ - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - // parseFloat NaNs numeric-cast false positives (null|true|false|"") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - // adding 1 corrects loss of precision from parseFloat (#15100) - return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - isPlainObject: function( obj ) { - var key; - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Support: IE<9 - // Handle iteration over inherited properties before own properties. - if ( support.ownLast ) { - for ( key in obj ) { - return hasOwn.call( obj, key ); - } - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Support: Android<4.1, IE<9 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( indexOf ) { - return indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - while ( j < len ) { - first[ i++ ] = second[ j++ ]; - } - - // Support: IE<9 - // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) - if ( len !== len ) { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var args, proxy, tmp; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: function() { - return +( new Date() ); - }, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - - // Support: iOS 8.2 (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = "length" in obj && obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.2.0-pre - * http://sizzlejs.com/ - * - * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-12-16 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // General-purpose constants - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf as it's faster than native - // http://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + characterEncoding + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - nodeType = context.nodeType; - - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - if ( !seed && documentIsHTML ) { - - // Try to shortcut find operations when possible (e.g., not under DocumentFragment) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType !== 1 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, parent, - doc = node ? node.ownerDocument || node : preferredDoc; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - parent = doc.defaultView; - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer - if ( parent.addEventListener ) { - parent.addEventListener( "unload", unloadHandler, false ); - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", unloadHandler ); - } - } - - /* Support tests - ---------------------------------------------------------------------- */ - documentIsHTML = !isXML( doc ); - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - docElem.appendChild( div ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( div.querySelectorAll("[msallowcapture^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ - if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push("~="); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibing-combinator selector` fails - if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push(".#.+[+~]"); - } - }); - - assert(function( div ) { - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch (e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - // Don't keep the element (issue #299) - input[0] = null; - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context !== document && context; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is no seed and only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; - }); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); -}; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - ret = [], - self = this, - len = self.length; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -}); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - init = jQuery.fn.init = function( selector, context ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : - // Execute immediately if ready is not present - selector( jQuery ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -jQuery.fn.extend({ - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - matched.push( cur ); - break; - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.unique( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - ret = jQuery.unique( ret ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - } - - return this.pushStack( ret ); - }; -}); -var rnotwhite = (/\S+/g); - - - -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( values === progressValues ) { - deferred.notifyWith( contexts, values ); - - } else if ( !(--remaining) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); - - -// The deferred used on DOM ready -var readyList; - -jQuery.fn.ready = function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; -}; - -jQuery.extend({ - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); - } - } -}); - -/** - * Clean-up method for dom ready events - */ -function detach() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } -} - -/** - * The ready event handler and self cleanup method - */ -function completed() { - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { - detach(); - jQuery.ready(); - } -} - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - - -var strundefined = typeof undefined; - - - -// Support: IE<9 -// Iteration over object's inherited properties before its own -var i; -for ( i in jQuery( support ) ) { - break; -} -support.ownLast = i !== "0"; - -// Note: most support tests are defined in their respective modules. -// false until the test is run -support.inlineBlockNeedsLayout = false; - -// Execute ASAP in case we need to set body.style.zoom -jQuery(function() { - // Minified: var a,b,c,d - var val, div, body, container; - - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { - // Return for frameset docs that don't have a body - return; - } - - // Setup - div = document.createElement( "div" ); - container = document.createElement( "div" ); - container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; - body.appendChild( container ).appendChild( div ); - - if ( typeof div.style.zoom !== strundefined ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; - - support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; - if ( val ) { - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); -}); - - - - -(function() { - var div = document.createElement( "div" ); - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( elem ) { - var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], - nodeType = +elem.nodeType || 1; - - // Do not set data on non-element DOM nodes because it will not be cleared (#8335). - return nodeType !== 1 && nodeType !== 9 ? - false : - - // Nodes accept data unless otherwise specified; rejection can be conditional - !noData || noData !== true && elem.getAttribute("classid") === noData; -}; - - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - -function internalData( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var ret, thisCache, - internalKey = jQuery.expando, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - // Avoid exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( typeof name === "string" ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - i = name.length; - while ( i-- ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - /* jshint eqeqeq: false */ - } else if ( support.deleteExpando || cache != cache.window ) { - /* jshint eqeqeq: true */ - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // The following elements (space-suffixed to avoid Object.prototype collisions) - // throw uncatchable exceptions if you attempt to set expando properties - noData: { - "applet ": true, - "embed ": true, - // ...but Flash objects (which have this classid) *can* handle expandos - "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var i, name, data, - elem = this[0], - attrs = elem && elem.attributes; - - // Special expections of .data basically thwart jQuery.access, - // so implement the relevant behavior ourselves - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE11+ - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return arguments.length > 1 ? - - // Sets one value - this.each(function() { - jQuery.data( this, key, value ); - }) : - - // Gets one value - // Try to fetch any internally stored data first - elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - - -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHidden = function( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); - }; - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; -}; -var rcheckableType = (/^(?:checkbox|radio)$/i); - - - -(function() { - // Minified: var a,b,c - var input = document.createElement( "input" ), - div = document.createElement( "div" ), - fragment = document.createDocumentFragment(); - - // Setup - div.innerHTML = "
a"; - - // IE strips leading whitespace when .innerHTML is used - support.leadingWhitespace = div.firstChild.nodeType === 3; - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - support.tbody = !div.getElementsByTagName( "tbody" ).length; - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - support.html5Clone = - document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - input.type = "checkbox"; - input.checked = true; - fragment.appendChild( input ); - support.appendChecked = input.checked; - - // Make sure textarea (and checkbox) defaultValue is properly cloned - // Support: IE6-IE11+ - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // #11217 - WebKit loses check when the name is after the checked attribute - fragment.appendChild( div ); - div.innerHTML = ""; - - // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 - // old WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - support.noCloneEvent = true; - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } -})(); - - -(function() { - var i, eventName, - div = document.createElement( "div" ); - - // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) - for ( i in { submit: true, change: true, focusin: true }) { - eventName = "on" + i; - - if ( !(support[ i + "Bubbles" ] = eventName in window) ) { - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) - div.setAttribute( eventName, "t" ); - support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, ret, handleObj, matched, j, - handlerQueue = [], - args = slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var sel, handleObj, matches, i, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - /* jshint eqeqeq: false */ - for ( ; cur != this; cur = cur.parentNode || this ) { - /* jshint eqeqeq: true */ - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === strundefined ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - // Support: IE < 9, Android < 4.0 - src.returnValue === false ? - returnTrue : - returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && e.stopImmediatePropagation ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - jQuery._removeData( doc, fix ); - } else { - jQuery._data( doc, fix, attaches ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - col: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -// Support: IE<8 -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!support.noCloneEvent || !support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
" && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - deletedIds.push( id ); - } - } - } - } - } -}); - -jQuery.fn.extend({ - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map(function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var arg = arguments[ 0 ]; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; - - jQuery.cleanData( getAll( this ) ); - - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, self.html() ); - } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[i], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - - -var iframe, - elemdisplay = {}; - -/** - * Retrieve the actual display of a element - * @param {String} name nodeName of the element - * @param {Object} doc Document object - */ -// Called only from within defaultDisplay -function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? - - // Use of this method is a temporary fix (more like optmization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); - - // We don't have any data stored on the element, - // so use "detach" method as fast way to get rid of the element - elem.detach(); - - return display; -} - -/** - * Try to determine the default display value of an element - * @param {String} nodeName - */ -function defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - - // Use the already-created iframe if possible - iframe = (iframe || jQuery( " - - - - -
- -
- - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- -
-
hi there
-
-
-
-
-
-
-
- -
-
-
- - -
- - -
- - -
C
-
-
- -
-
    -
  1. Rice
  2. -
  3. Beans
  4. -
  5. Blinis
  6. -
  7. Tofu
  8. -
- -
I'm hungry. I should...
- ...Eat lots of food... | - ...Eat a little food... | - ...Eat no food... - ...Eat a burger... - ...Eat some funyuns... - ...Eat some funyuns... -
- -
- - -
- -
- 1 - 2 - - - - - - - - -
​ - - -
- - diff --git a/#pma/js/jquery/src/jquery/sizzle/test/jquery.js b/#pma/js/jquery/src/jquery/sizzle/test/jquery.js deleted file mode 100644 index 86a33051..00000000 --- a/#pma/js/jquery/src/jquery/sizzle/test/jquery.js +++ /dev/null @@ -1,9597 +0,0 @@ -/*! - * jQuery JavaScript Library v1.9.1 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2013-2-4 - */ -(function( window, undefined ) { - -// Can't do this because several apps including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -//"use strict"; -var - // The deferred used on DOM ready - readyList, - - // A central reference to the root jQuery(document) - rootjQuery, - - // Support: IE<9 - // For `typeof node.method` instead of `node.method !== undefined` - core_strundefined = typeof undefined, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - location = window.location, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // [[Class]] -> type pairs - class2type = {}, - - // List of deleted data cache ids, so we can reuse them - core_deletedIds = [], - - core_version = "1.9.1", - - // Save a reference to some core methods - core_concat = core_deletedIds.concat, - core_push = core_deletedIds.push, - core_slice = core_deletedIds.slice, - core_indexOf = core_deletedIds.indexOf, - core_toString = class2type.toString, - core_hasOwn = class2type.hasOwnProperty, - core_trim = core_version.trim, - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Used for matching numbers - core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, - - // Used for splitting on whitespace - core_rnotwhite = /\S+/g, - - // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, - rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }, - - // The ready event handler - completed = function( event ) { - - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { - detach(); - jQuery.ready(); - } - }, - // Clean-up method for dom ready events - detach = function() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: core_version, - - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return core_slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; - }, - - slice: function() { - return this.pushStack( core_slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: core_push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger("ready").off("ready"); - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - return !isNaN( parseFloat(obj) ) && isFinite( obj ); - }, - - type: function( obj ) { - if ( obj == null ) { - return String( obj ); - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ core_toString.call(obj) ] || "object" : - typeof obj; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !core_hasOwn.call(obj, "constructor") && - !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || core_hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw new Error( msg ); - }, - - // data: string of html - // context (optional): If specified, the fragment will be created in this context, defaults to document - // keepScripts (optional): If true, will include scripts passed in the html string - parseHTML: function( data, context, keepScripts ) { - if ( !data || typeof data !== "string" ) { - return null; - } - if ( typeof context === "boolean" ) { - keepScripts = context; - context = false; - } - context = context || document; - - var parsed = rsingleTag.exec( data ), - scripts = !keepScripts && []; - - // Single tag - if ( parsed ) { - return [ context.createElement( parsed[1] ) ]; - } - - parsed = jQuery.buildFragment( [ data ], context, scripts ); - if ( scripts ) { - jQuery( scripts ).remove(); - } - return jQuery.merge( [], parsed.childNodes ); - }, - - parseJSON: function( data ) { - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - if ( data === null ) { - return data; - } - - if ( typeof data === "string" ) { - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - if ( data ) { - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - } - } - } - - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - var xml, tmp; - if ( !data || typeof data !== "string" ) { - return null; - } - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Use native String.trim function wherever possible - trim: core_trim && !core_trim.call("\uFEFF\xA0") ? - function( text ) { - return text == null ? - "" : - core_trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - core_push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( core_indexOf ) { - return core_indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var l = second.length, - i = first.length, - j = 0; - - if ( typeof l === "number" ) { - for ( ; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var retVal, - ret = [], - i = 0, - length = elems.length; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return core_concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var args, proxy, tmp; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = core_slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - // Multifunctional method to get and set values of a collection - // The value/s can optionally be executed if it's a function - access: function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; - }, - - now: function() { - return ( new Date() ).getTime(); - } -}); - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || type !== "function" && - ( length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj ); -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( list && ( !fired || stack ) ) { - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var action = tuple[ 0 ], - fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = core_slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; - if( values === progressValues ) { - deferred.notifyWith( contexts, values ); - } else if ( !( --remaining ) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); -jQuery.support = (function() { - - var support, all, a, - input, select, fragment, - opt, eventName, isSupported, i, - div = document.createElement("div"); - - // Setup - div.setAttribute( "className", "t" ); - div.innerHTML = "
a"; - - // Support tests won't run in some limited or non-browser environments - all = div.getElementsByTagName("*"); - a = div.getElementsByTagName("a")[ 0 ]; - if ( !all || !a || !all.length ) { - return {}; - } - - // First batch of tests - select = document.createElement("select"); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName("input")[ 0 ]; - - a.style.cssText = "top:1px;float:left;opacity:.5"; - support = { - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: div.firstChild.nodeType === 3, - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: a.getAttribute("href") === "/a", - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.5/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) - checkOn: !!input.value, - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Tests for enctype support on a form (#6743) - enctype: !!document.createElement("form").enctype, - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", - - // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode - boxModel: document.compatMode === "CSS1Compat", - - // Will be defined later - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true, - boxSizingReliable: true, - pixelPosition: false - }; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Support: IE<9 - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - // Check if we can trust getAttribute("value") - input = document.createElement("input"); - input.setAttribute( "value", "" ); - support.input = input.getAttribute( "value" ) === ""; - - // Check if an input maintains its value after becoming a radio - input.value = "t"; - input.setAttribute( "type", "radio" ); - support.radioValue = input.value === "t"; - - // #11217 - WebKit loses check when the name is after the checked attribute - input.setAttribute( "checked", "t" ); - input.setAttribute( "name", "t" ); - - fragment = document.createDocumentFragment(); - fragment.appendChild( input ); - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php - for ( i in { submit: true, change: true, focusin: true }) { - div.setAttribute( eventName = "on" + i, "t" ); - - support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; - } - - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - // Run tests that need a body at doc ready - jQuery(function() { - var container, marginDiv, tds, - divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - container = document.createElement("div"); - container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; - - body.appendChild( container ).appendChild( div ); - - // Support: IE8 - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - div.innerHTML = "
t
"; - tds = div.getElementsByTagName("td"); - tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Support: IE8 - // Check if empty table cells still have offsetWidth/Height - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - // Check box-sizing and margin behavior - div.innerHTML = ""; - div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; - support.boxSizing = ( div.offsetWidth === 4 ); - support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); - - // Use window.getComputedStyle because jsdom on node.js will break without it. - if ( window.getComputedStyle ) { - support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; - support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. (#3333) - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - marginDiv = div.appendChild( document.createElement("div") ); - marginDiv.style.cssText = div.style.cssText = divReset; - marginDiv.style.marginRight = marginDiv.style.width = "0"; - div.style.width = "1px"; - - support.reliableMarginRight = - !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); - } - - if ( typeof div.style.zoom !== core_strundefined ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.innerHTML = ""; - div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); - - // Support: IE6 - // Check if elements with layout shrink-wrap their children - div.style.display = "block"; - div.innerHTML = "
"; - div.firstChild.style.width = "5px"; - support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); - - if ( support.inlineBlockNeedsLayout ) { - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); - - // Null elements to avoid leaks in IE - container = div = tds = marginDiv = null; - }); - - // Null elements to avoid leaks in IE - all = select = fragment = opt = a = input = null; - - return support; -})(); - -var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, - rmultiDash = /([A-Z])/g; - -function internalData( elem, name, data, pvt /* Internal Use Only */ ){ - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, ret, - internalKey = jQuery.expando, - getByName = typeof name === "string", - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // Avoids exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( getByName ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var i, l, thisCache, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - for ( i = 0, l = name.length; i < l; i++ ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - } else if ( jQuery.support.deleteExpando || cache != cache.window ) { - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - // Do not set data on non-element because it will not be cleared (#8335). - if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { - return false; - } - - var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; - - // nodes accept data unless otherwise specified; rejection can be conditional - return !noData || noData !== true && elem.getAttribute("classid") === noData; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var attrs, name, - elem = this[0], - i = 0, - data = null; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - attrs = elem.attributes; - for ( ; i < attrs.length; i++ ) { - name = attrs[i].name; - - if ( !name.indexOf( "data-" ) ) { - name = jQuery.camelCase( name.slice(5) ); - - dataAttr( elem, name, data[ name ] ); - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return jQuery.access( this, function( value ) { - - if ( value === undefined ) { - // Try to fetch any internally stored data first - return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; - } - - this.each(function() { - jQuery.data( this, key, value ); - }); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - hooks.cur = fn; - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var nodeHook, boolHook, - rclass = /[\t\r\n]/g, - rreturn = /\r/g, - rfocusable = /^(?:input|select|textarea|button|object)$/i, - rclickable = /^(?:a|area)$/i, - rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, - ruseDefault = /^(?:checked|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - getSetInput = jQuery.support.input; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classes, elem, cur, clazz, j, - i = 0, - len = this.length, - proceed = typeof value === "string" && value; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call( this, j, this.className ) ); - }); - } - - if ( proceed ) { - // The disjunction here is for better compressibility (see removeClass) - classes = ( value || "" ).match( core_rnotwhite ) || []; - - for ( ; i < len; i++ ) { - elem = this[ i ]; - cur = elem.nodeType === 1 && ( elem.className ? - ( " " + elem.className + " " ).replace( rclass, " " ) : - " " - ); - - if ( cur ) { - j = 0; - while ( (clazz = classes[j++]) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - elem.className = jQuery.trim( cur ); - - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, clazz, j, - i = 0, - len = this.length, - proceed = arguments.length === 0 || typeof value === "string" && value; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call( this, j, this.className ) ); - }); - } - if ( proceed ) { - classes = ( value || "" ).match( core_rnotwhite ) || []; - - for ( ; i < len; i++ ) { - elem = this[ i ]; - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( elem.className ? - ( " " + elem.className + " " ).replace( rclass, " " ) : - "" - ); - - if ( cur ) { - j = 0; - while ( (clazz = classes[j++]) ) { - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - elem.className = value ? jQuery.trim( cur ) : ""; - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.match( core_rnotwhite ) || []; - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space separated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - // Toggle whole class name - } else if ( type === core_strundefined || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // If the element has a class name or if we're passed "false", - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var ret, hooks, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var val, - self = jQuery(this); - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, option, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one" || index < 0, - values = one ? null : [], - max = one ? index + 1 : options.length, - i = index < 0 ? - max : - one ? index : 0; - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // oldIE doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - // Don't return options that are disabled or in a disabled optgroup - ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && - ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attr: function( elem, name, value ) { - var hooks, notxml, ret, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === core_strundefined ) { - return jQuery.prop( elem, name, value ); - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( notxml ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - - } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, value + "" ); - return value; - } - - } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - // In IE9+, Flash objects don't have .getAttribute (#12945) - // Support: IE9+ - if ( typeof elem.getAttribute !== core_strundefined ) { - ret = elem.getAttribute( name ); - } - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var name, propName, - i = 0, - attrNames = value && value.match( core_rnotwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( (name = attrNames[i++]) ) { - propName = jQuery.propFix[ name ] || name; - - // Boolean attributes get special treatment (#10870) - if ( rboolean.test( name ) ) { - // Set corresponding property to false for boolean attributes - // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8 - if ( !getSetAttribute && ruseDefault.test( name ) ) { - elem[ jQuery.camelCase( "default-" + name ) ] = - elem[ propName ] = false; - } else { - elem[ propName ] = false; - } - - // See #9699 for explanation of this approach (setting first, then removal) - } else { - jQuery.attr( elem, name, "" ); - } - - elem.removeAttribute( getSetAttribute ? name : propName ); - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to default in case type is set after value during creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return ( elem[ name ] = value ); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabindex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - } - } -}); - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - var - // Use .prop to determine if this attribute is understood as boolean - prop = jQuery.prop( elem, name ), - - // Fetch it accordingly - attr = typeof prop === "boolean" && elem.getAttribute( name ), - detail = typeof prop === "boolean" ? - - getSetInput && getSetAttribute ? - attr != null : - // oldIE fabricates an empty string for missing boolean attributes - // and conflates checked/selected into attroperties - ruseDefault.test( name ) ? - elem[ jQuery.camelCase( "default-" + name ) ] : - !!attr : - - // fetch an attribute node for properties not recognized as boolean - elem.getAttributeNode( name ); - - return detail && detail.value !== false ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { - // IE<8 needs the *property* name - elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); - - // Use defaultChecked and defaultSelected for oldIE - } else { - elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; - } - - return name; - } -}; - -// fix oldIE value attroperty -if ( !getSetInput || !getSetAttribute ) { - jQuery.attrHooks.value = { - get: function( elem, name ) { - var ret = elem.getAttributeNode( name ); - return jQuery.nodeName( elem, "input" ) ? - - // Ignore the value *property* by using defaultValue - elem.defaultValue : - - ret && ret.specified ? ret.value : undefined; - }, - set: function( elem, value, name ) { - if ( jQuery.nodeName( elem, "input" ) ) { - // Does not return so that setAttribute is also used - elem.defaultValue = value; - } else { - // Use nodeHook if defined (#1954); otherwise setAttribute is fine - return nodeHook && nodeHook.set( elem, value, name ); - } - } - }; -} - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret = elem.getAttributeNode( name ); - return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ? - ret.value : - undefined; - }, - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - elem.setAttributeNode( - (ret = elem.ownerDocument.createAttribute( name )) - ); - } - - ret.value = value += ""; - - // Break association with cloned elements by also using setAttribute (#9646) - return name === "value" || value === elem.getAttribute( name ) ? - value : - undefined; - } - }; - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - get: nodeHook.get, - set: function( elem, value, name ) { - nodeHook.set( elem, value === "" ? false : value, name ); - } - }; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); -} - - -// Some attributes require a special call on IE -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret == null ? undefined : ret; - } - }); - }); - - // href/src property should get the full normalized URL (#10299/#12915) - jQuery.each([ "href", "src" ], function( i, name ) { - jQuery.propHooks[ name ] = { - get: function( elem ) { - return elem.getAttribute( name, 4 ); - } - }; - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Note: IE uppercases css property names, but if we were to .toLowerCase() - // .cssText, that would destroy case senstitivity in URL's, like in "background" - return elem.style.cssText || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = value + "" ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }); -} - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }); -}); -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = ( types || "" ).match( core_rnotwhite ) || [""]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( core_rnotwhite ) || [""]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = core_hasOwn.call( event, "type" ) ? event.type : event, - namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - event.isTrigger = true; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { - event.preventDefault(); - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, ret, handleObj, matched, j, - handlerQueue = [], - args = core_slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var sel, handleObj, matches, i, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - for ( ; cur != this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - } - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== document.activeElement && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === document.activeElement && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - - beforeunload: { - postDispatch: function( event ) { - - // Even when returnValue equals to undefined Firefox will still show alert - if ( event.result !== undefined ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === core_strundefined ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); -/*! - * Sizzle CSS Selector Engine - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license - * http://sizzlejs.com/ - */ -(function( window, undefined ) { - -var i, - cachedruns, - Expr, - getText, - isXML, - compile, - hasDuplicate, - outermostContext, - - // Local document vars - setDocument, - document, - docElem, - documentIsXML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - sortOrder, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - support = {}, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Array methods - arr = [], - pop = arr.pop, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors - operators = "([*^$|!~]?=)", - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + - "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", - - // Prefer arguments quoted, - // then not containing pseudos/brackets, - // then attribute selectors/non-parenthetical expressions, - // then anything else - // These preferences are here to reduce the number of selectors - // needing tokenize in the PSEUDO preFilter - pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rsibling = /[\x20\t\r\n\f]*[+~]/, - - rnative = /^[^{]+\{\s*\[native code/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rescape = /'|\\/g, - rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, - funescape = function( _, escaped ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - return high !== high ? - escaped : - // BMP codepoint - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Use a stripped-down slice if we can't use a native one -try { - slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType; -} catch ( e ) { - slice = function( i ) { - var elem, - results = []; - while ( (elem = this[i++]) ) { - results.push( elem ); - } - return results; - }; -} - -/** - * For feature detection - * @param {Function} fn The function to test for native support - */ -function isNative( fn ) { - return rnative.test( fn + "" ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var cache, - keys = []; - - return (cache = function( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key += " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key ] = value); - }); -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return fn( div ); - } catch (e) { - return false; - } finally { - // release memory in IE - div = null; - } -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( !documentIsXML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) { - push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); - return results; - } - } - - // QSA path - if ( support.qsa && !rbuggyQSA.test(selector) ) { - old = true; - nid = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && context.parentNode || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, slice.call( newContext.querySelectorAll( - newSelector - ), 0 ) ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Detect xml - * @param {Element|Object} elem An element or a document - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var doc = node ? node.ownerDocument || node : preferredDoc; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsXML = isXML( doc ); - - // Check if getElementsByTagName("*") returns only elements - support.tagNameNoComments = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if attributes should be retrieved by attribute nodes - support.attributes = assert(function( div ) { - div.innerHTML = ""; - var type = typeof div.lastChild.getAttribute("multiple"); - // IE8 returns a string for some attributes even when not present - return type !== "boolean" && type !== "string"; - }); - - // Check if getElementsByClassName can be trusted - support.getByClassName = assert(function( div ) { - // Opera can't find a second classname (in 9.6) - div.innerHTML = ""; - if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { - return false; - } - - // Safari 3.2 caches class attributes and doesn't catch changes - div.lastChild.className = "e"; - return div.getElementsByClassName("e").length === 2; - }); - - // Check if getElementById returns elements by name - // Check if getElementsByName privileges form controls or returns elements by ID - support.getByName = assert(function( div ) { - // Inject content - div.id = expando + 0; - div.innerHTML = "
"; - docElem.insertBefore( div, docElem.firstChild ); - - // Test - var pass = doc.getElementsByName && - // buggy browsers will return fewer than the correct 2 - doc.getElementsByName( expando ).length === 2 + - // buggy browsers will return more than the correct 0 - doc.getElementsByName( expando + 0 ).length; - support.getIdNotName = !doc.getElementById( expando ); - - // Cleanup - docElem.removeChild( div ); - - return pass; - }); - - // IE6/7 return modified attributes - Expr.attrHandle = assert(function( div ) { - div.innerHTML = ""; - return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && - div.firstChild.getAttribute("href") === "#"; - }) ? - {} : - { - "href": function( elem ) { - return elem.getAttribute( "href", 2 ); - }, - "type": function( elem ) { - return elem.getAttribute("type"); - } - }; - - // ID find and filter - if ( support.getIdNotName ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && !documentIsXML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && !documentIsXML ) { - var m = context.getElementById( id ); - - return m ? - m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? - [m] : - undefined : - []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.tagNameNoComments ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Name - Expr.find["NAME"] = support.getByName && function( tag, context ) { - if ( typeof context.getElementsByName !== strundefined ) { - return context.getElementsByName( name ); - } - }; - - // Class - Expr.find["CLASS"] = support.getByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) { - return context.getElementsByClassName( className ); - } - }; - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21), - // no need to also add to buggyMatches since matches checks buggyQSA - // A support test would require too much code (would include document ready) - rbuggyQSA = [ ":focus" ]; - - if ( (support.qsa = isNative(doc.querySelectorAll)) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explictly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // IE8 - Some boolean attributes are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - - // Opera 10-12/IE8 - ^= $= *= and empty values - // Should not select anything - div.innerHTML = ""; - if ( div.querySelectorAll("[i^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || - docElem.mozMatchesSelector || - docElem.webkitMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = new RegExp( rbuggyMatches.join("|") ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - // Document order sorting - sortOrder = docElem.compareDocumentPosition ? - function( a, b ) { - var compare; - - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) { - if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) { - if ( a === doc || contains( preferredDoc, a ) ) { - return -1; - } - if ( b === doc || contains( preferredDoc, b ) ) { - return 1; - } - return 0; - } - return compare & 4 ? -1 : 1; - } - - return a.compareDocumentPosition ? -1 : 1; - } : - function( a, b ) { - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Parentless nodes are either documents or disconnected - } else if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - // Always assume the presence of duplicates if sort doesn't - // pass them to our comparison function (as in Google Chrome). - hasDuplicate = false; - [0, 0].sort( sortOrder ); - support.detectDuplicates = hasDuplicate; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - // rbuggyQSA always contains :focus, so no need for an existence check - if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [elem] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - var val; - - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - if ( !documentIsXML ) { - name = name.toLowerCase(); - } - if ( (val = Expr.attrHandle[ name ]) ) { - return val( elem ); - } - if ( documentIsXML || support.attributes ) { - return elem.getAttribute( name ); - } - return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? - name : - val && val.specified ? val.value : null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -// Document sorting and removing duplicates -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - i = 1, - j = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( ; (elem = results[i]); i++ ) { - if ( elem === results[ i - 1 ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - return results; -}; - -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -// Returns a function to use in pseudos for input types -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -// Returns a function to use in pseudos for buttons -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -// Returns a function to use in pseudos for positionals -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - for ( ; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (see #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[5] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[4] ) { - match[2] = match[4]; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeName ) { - if ( nodeName === "*" ) { - return function() { return true; }; - } - - nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifider - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsXML ? - elem.getAttribute("xml:lang") || elem.getAttribute("lang") : - elem.lang) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), - // not comment, processing instructions, or others - // Thanks to Diego Perini for the nodeName shortcut - // Greater than "@" means alpha characters (specifically not starting with "#" or "?") - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -function tokenize( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( tokens = [] ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push( { - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -} - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var data, cache, outerCache, - dirkey = dirruns + " " + doneName; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { - if ( (data = cache[1]) === true || data === cachedruns ) { - return data === true; - } - } else { - cache = outerCache[ dir ] = [ dirkey ]; - cache[1] = matcher( elem, context, xml ) || cachedruns; - if ( cache[1] === true ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - // A counter to specify which element is currently being matched - var matcherCachedRuns = 0, - bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, expandContext ) { - var elem, j, matcher, - setMatched = [], - matchedCount = 0, - i = "0", - unmatched = seed && [], - outermost = expandContext != null, - contextBackup = outermostContext, - // We must always have either seed elements or context - elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); - - if ( outermost ) { - outermostContext = context !== document && context; - cachedruns = matcherCachedRuns; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - for ( ; (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - cachedruns = ++matcherCachedRuns; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !group ) { - group = tokenize( selector ); - } - i = group.length; - while ( i-- ) { - cached = matcherFromTokens( group[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - } - return cached; -}; - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function select( selector, context, results, seed ) { - var i, tokens, token, type, find, - match = tokenize( selector ); - - if ( !seed ) { - // Try to minimize operations if there is only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - context.nodeType === 9 && !documentIsXML && - Expr.relative[ tokens[1].type ] ) { - - context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; - if ( !context ) { - return results; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && context.parentNode || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, slice.call( seed, 0 ) ); - return results; - } - - break; - } - } - } - } - } - - // Compile and execute a filtering function - // Provide `match` to avoid retokenization if we modified the selector above - compile( selector, match )( - seed, - context, - documentIsXML, - results, - rsibling.test( selector ) - ); - return results; -} - -// Deprecated -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Easy API for creating new setFilters -function setFilters() {} -Expr.filters = setFilters.prototype = Expr.pseudos; -Expr.setFilters = new setFilters(); - -// Initialize with the default document -setDocument(); - -// Override sizzle attribute retrieval -Sizzle.attr = jQuery.attr; -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})( window ); -var runtil = /Until$/, - rparentsprev = /^(?:parents|prev(?:Until|All))/, - isSimple = /^.[^:#\[\.,]*$/, - rneedsContext = jQuery.expr.match.needsContext, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var i, ret, self, - len = this.length; - - if ( typeof selector !== "string" ) { - self = this; - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - ret = []; - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, this[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = ( this.selector ? this.selector + " " : "" ) + selector; - return ret; - }, - - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false) ); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true) ); - }, - - is: function( selector ) { - return !!selector && ( - typeof selector === "string" ? - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - rneedsContext.test( selector ) ? - jQuery( selector, this.context ).index( this[0] ) >= 0 : - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - ret = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - cur = this[i]; - - while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - } - cur = cur.parentNode; - } - } - - return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( jQuery.unique(all) ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -jQuery.fn.andSelf = jQuery.fn.addBack; - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( this.length > 1 && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem ) { - return ( elem === qualifier ) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; - }); -} -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - col: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -jQuery.fn.extend({ - text: function( value ) { - return jQuery.access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - wrapAll: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapAll( html.call(this, i) ); - }); - } - - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); - - if ( this[0].parentNode ) { - wrap.insertBefore( this[0] ); - } - - wrap.map(function() { - var elem = this; - - while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { - elem = elem.firstChild; - } - - return elem; - }).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapInner( html.call(this, i) ); - }); - } - - return this.each(function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - }); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each(function(i) { - jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); - }); - }, - - unwrap: function() { - return this.parent().each(function() { - if ( !jQuery.nodeName( this, "body" ) ) { - jQuery( this ).replaceWith( this.childNodes ); - } - }).end(); - }, - - append: function() { - return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.insertBefore( elem, this.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, false, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, false, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - // keepData is for internal use only--do not document - remove: function( selector, keepData ) { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) { - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function () { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return jQuery.access( this, function( value ) { - var elem = this[0] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function( value ) { - var isFunc = jQuery.isFunction( value ); - - // Make sure that the elements are removed from the DOM before they are inserted - // this can help fix replacing a parent with child elements - if ( !isFunc && typeof value !== "string" ) { - value = jQuery( value ).not( this ).detach(); - } - - return this.domManip( [ value ], true, function( elem ) { - var next = this.nextSibling, - parent = this.parentNode; - - if ( parent ) { - jQuery( this ).remove(); - parent.insertBefore( elem, next ); - } - }); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, table, callback ) { - - // Flatten any nested arrays - args = core_concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, table ? self.html() : undefined ); - } - self.domManip( args, table, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - table = table && jQuery.nodeName( first, "tr" ); - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( - table && jQuery.nodeName( this[i], "table" ) ? - findOrAppend( this[i], "tbody" ) : - this[i], - node, - i - ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Hope ajax is available... - jQuery.ajax({ - url: node.src, - type: "GET", - dataType: "script", - async: false, - global: false, - "throws": true - }); - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -function findOrAppend( elem, tag ) { - return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - var attr = elem.getAttributeNode("type"); - elem.type = ( attr && attr.specified ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - core_push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( manipulation_rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !jQuery.support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
" && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !jQuery.support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = jQuery.support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== core_strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - core_deletedIds.push( id ); - } - } - } - } - } -}); -var iframe, getStyles, curCSS, - ralpha = /alpha\([^)]*\)/i, - ropacity = /opacity\s*=\s*([^)]*)/, - rposition = /^(top|right|bottom|left)$/, - // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" - // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rmargin = /^margin/, - rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), - rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), - rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), - elemdisplay = { BODY: "block" }, - - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: 0, - fontWeight: 400 - }, - - cssExpand = [ "Top", "Right", "Bottom", "Left" ], - cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; - -// return a css property mapped to a potentially vendor prefixed property -function vendorPropName( style, name ) { - - // shortcut for names that are not vendor prefixed - if ( name in style ) { - return name; - } - - // check for vendor prefixed names - var capName = name.charAt(0).toUpperCase() + name.slice(1), - origName = name, - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in style ) { - return name; - } - } - - return origName; -} - -function isHidden( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); -} - -function showHide( elements, show ) { - var display, elem, hidden, - values = [], - index = 0, - length = elements.length; - - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - values[ index ] = jQuery._data( elem, "olddisplay" ); - display = elem.style.display; - if ( show ) { - // Reset the inline display of this element to learn if it is - // being hidden by cascaded rules or not - if ( !values[ index ] && display === "none" ) { - elem.style.display = ""; - } - - // Set elements which have been overridden with display: none - // in a stylesheet to whatever the default browser style is - // for such an element - if ( elem.style.display === "" && isHidden( elem ) ) { - values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); - } - } else { - - if ( !values[ index ] ) { - hidden = isHidden( elem ); - - if ( display && display !== "none" || !hidden ) { - jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); - } - } - } - } - - // Set the display of most of the elements in a second loop - // to avoid the constant reflow - for ( index = 0; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - if ( !show || elem.style.display === "none" || elem.style.display === "" ) { - elem.style.display = show ? values[ index ] || "" : "none"; - } - } - - return elements; -} - -jQuery.fn.extend({ - css: function( name, value ) { - return jQuery.access( this, function( elem, name, value ) { - var len, styles, - map = {}, - i = 0; - - if ( jQuery.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - }, - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - var bool = typeof state === "boolean"; - - return this.each(function() { - if ( bool ? state : isHidden( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - }); - } -}); - -jQuery.extend({ - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Exclude the following css properties to add px - cssNumber: { - "columnCount": true, - "fillOpacity": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - // normalize float css property - "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - style = elem.style; - - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // convert relative number strings (+= or -=) to relative numbers. #7345 - if ( type === "string" && (ret = rrelNum.exec( value )) ) { - value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); - // Fixes bug #9237 - type = "number"; - } - - // Make sure that NaN and null values aren't set. See: #7116 - if ( value == null || type === "number" && isNaN( value ) ) { - return; - } - - // If a number was passed in, add 'px' to the (except for certain CSS properties) - if ( type === "number" && !jQuery.cssNumber[ origName ] ) { - value += "px"; - } - - // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, - // but it would mean to define eight (for every problematic property) identical functions - if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { - - // Wrapped to prevent IE from throwing errors when 'invalid' values are provided - // Fixes bug #5509 - try { - style[ name ] = value; - } catch(e) {} - } - - } else { - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var num, val, hooks, - origName = jQuery.camelCase( name ); - - // Make sure that we're working with the right name - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - //convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Return, converting to number if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; - } - return val; - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations - swap: function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; - } -}); - -// NOTE: we've included the "window" in window.getComputedStyle -// because jsdom on node.js will break without it. -if ( window.getComputedStyle ) { - getStyles = function( elem ) { - return window.getComputedStyle( elem, null ); - }; - - curCSS = function( elem, name, _computed ) { - var width, minWidth, maxWidth, - computed = _computed || getStyles( elem ), - - // getPropertyValue is only needed for .css('filter') in IE9, see #12537 - ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, - style = elem.style; - - if ( computed ) { - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right - // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels - // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values - if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret; - }; -} else if ( document.documentElement.currentStyle ) { - getStyles = function( elem ) { - return elem.currentStyle; - }; - - curCSS = function( elem, name, _computed ) { - var left, rs, rsLeft, - computed = _computed || getStyles( elem ), - ret = computed ? computed[ name ] : undefined, - style = elem.style; - - // Avoid setting ret to empty string here - // so we don't default to auto - if ( ret == null && style && style[ name ] ) { - ret = style[ name ]; - } - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - // but not position css attributes, as those are proportional to the parent element instead - // and we can't measure the parent instead because it might trigger a "stacking dolls" problem - if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { - - // Remember the original values - left = style.left; - rs = elem.runtimeStyle; - rsLeft = rs && rs.left; - - // Put in the new values to get a computed value out - if ( rsLeft ) { - rs.left = elem.currentStyle.left; - } - style.left = name === "fontSize" ? "1em" : ret; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - if ( rsLeft ) { - rs.left = rsLeft; - } - } - - return ret === "" ? "auto" : ret; - }; -} - -function setPositiveNumber( elem, value, subtract ) { - var matches = rnumsplit.exec( value ); - return matches ? - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { - var i = extra === ( isBorderBox ? "border" : "content" ) ? - // If we already have the right measurement, avoid augmentation - 4 : - // Otherwise initialize for horizontal or vertical properties - name === "width" ? 1 : 0, - - val = 0; - - for ( ; i < 4; i += 2 ) { - // both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); - } - - if ( isBorderBox ) { - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // at this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } else { - // at this point, extra isn't content, so add padding - val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // at this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with offset property, which is equivalent to the border-box value - var valueIsBorderBox = true, - val = name === "width" ? elem.offsetWidth : elem.offsetHeight, - styles = getStyles( elem ), - isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // some non-html elements return undefined for offsetWidth, so check for null/undefined - // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 - // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 - if ( val <= 0 || val == null ) { - // Fall back to computed then uncomputed css if necessary - val = curCSS( elem, name, styles ); - if ( val < 0 || val == null ) { - val = elem.style[ name ]; - } - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test(val) ) { - return val; - } - - // we need the check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - } - - // use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles - ) - ) + "px"; -} - -// Try to determine the default display value of an element -function css_defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - // Use the already-created iframe if possible - iframe = ( iframe || - jQuery("')); - var d = $iframe[0].contentWindow.document; - d.open(); - d.close(); - mew = d; - - $iframe.load(function () { - var json; - - // Try loading config - try { - var data = $('body', $('iframe#monitorConfigUpload')[0].contentWindow.document).html(); - // Chrome wraps around '
' to any text content -.-
-                    json = $.parseJSON(data.substring(data.indexOf("{"), data.lastIndexOf("}") + 1));
-                } catch (err) {
-                    alert(PMA_messages.strFailedParsingConfig);
-                    $('#emptyDialog').dialog('close');
-                    return;
-                }
-
-                // Basic check, is this a monitor config json?
-                if (!json || ! json.monitorCharts || ! json.monitorCharts) {
-                    alert(PMA_messages.strFailedParsingConfig);
-                    $('#emptyDialog').dialog('close');
-                    return;
-                }
-
-                // If json ok, try applying config
-                try {
-                    window.localStorage.monitorCharts = JSON.stringify(json.monitorCharts);
-                    window.localStorage.monitorSettings = JSON.stringify(json.monitorSettings);
-                    rebuildGrid();
-                } catch (err) {
-                    alert(PMA_messages.strFailedBuildingGrid);
-                    // If an exception is thrown, load default again
-                    if (isStorageSupported('localStorage')) {
-                        window.localStorage.removeItem('monitorCharts');
-                        window.localStorage.removeItem('monitorSettings');
-                    }
-                    rebuildGrid();
-                }
-
-                $('#emptyDialog').dialog('close');
-            });
-
-            $("body", d).append($form = $('#emptyDialog').find('form'));
-            $form.submit();
-            $('#emptyDialog').append('');
-        };
-
-        dlgBtns[PMA_messages.strCancel] = function () {
-            $(this).dialog('close');
-        };
-
-
-        $('#emptyDialog').dialog({
-            width: 'auto',
-            height: 'auto',
-            buttons: dlgBtns
-        });
-    });
-
-    $('a[href="#clearMonitorConfig"]').click(function (event) {
-        event.preventDefault();
-        if (isStorageSupported('localStorage')) {
-            window.localStorage.removeItem('monitorCharts');
-            window.localStorage.removeItem('monitorSettings');
-            window.localStorage.removeItem('monitorVersion');
-        }
-        $(this).hide();
-        rebuildGrid();
-    });
-
-    $('a[href="#pauseCharts"]').click(function (event) {
-        event.preventDefault();
-        runtime.redrawCharts = ! runtime.redrawCharts;
-        if (! runtime.redrawCharts) {
-            $(this).html(PMA_getImage('play.png') + PMA_messages.strResumeMonitor);
-        } else {
-            $(this).html(PMA_getImage('pause.png') + PMA_messages.strPauseMonitor);
-            if (! runtime.charts) {
-                initGrid();
-                $('a[href="#settingsPopup"]').show();
-            }
-        }
-        return false;
-    });
-
-    $('a[href="#monitorInstructionsDialog"]').click(function (event) {
-        event.preventDefault();
-
-        var $dialog = $('#monitorInstructionsDialog');
-
-        $dialog.dialog({
-            width: 595,
-            height: 'auto'
-        }).find('img.ajaxIcon').show();
-
-        var loadLogVars = function (getvars) {
-            var vars = { ajax_request: true, logging_vars: true };
-            if (getvars) {
-                $.extend(vars, getvars);
-            }
-
-            $.get('server_status_monitor.php' + PMA_commonParams.get('common_query'), vars,
-                function (data) {
-                    var logVars;
-                    if (typeof data !== 'undefined' && data.success === true) {
-                        logVars = data.message;
-                    } else {
-                        return serverResponseError();
-                    }
-                    var icon = PMA_getImage('s_success.png'), msg = '', str = '';
-
-                    if (logVars.general_log == 'ON') {
-                        if (logVars.slow_query_log == 'ON') {
-                            msg = PMA_messages.strBothLogOn;
-                        } else {
-                            msg = PMA_messages.strGenLogOn;
-                        }
-                    }
-
-                    if (msg.length === 0 && logVars.slow_query_log == 'ON') {
-                        msg = PMA_messages.strSlowLogOn;
-                    }
-
-                    if (msg.length === 0) {
-                        icon = PMA_getImage('s_error.png');
-                        msg = PMA_messages.strBothLogOff;
-                    }
-
-                    str = '' + PMA_messages.strCurrentSettings + '
'; - str += icon + msg + '
'; - - if (logVars.log_output != 'TABLE') { - str += PMA_getImage('s_error.png') + ' ' + PMA_messages.strLogOutNotTable + '
'; - } else { - str += PMA_getImage('s_success.png') + ' ' + PMA_messages.strLogOutIsTable + '
'; - } - - if (logVars.slow_query_log == 'ON') { - if (logVars.long_query_time > 2) { - str += PMA_getImage('s_attention.png') + ' '; - str += PMA_sprintf(PMA_messages.strSmallerLongQueryTimeAdvice, logVars.long_query_time); - str += '
'; - } - - if (logVars.long_query_time < 2) { - str += PMA_getImage('s_success.png') + ' '; - str += PMA_sprintf(PMA_messages.strLongQueryTimeSet, logVars.long_query_time); - str += '
'; - } - } - - str += '
'; - - if (is_superuser) { - str += '

' + PMA_messages.strChangeSettings + ''; - str += '
'; - str += PMA_messages.strSettingsAppliedGlobal + '
'; - - var varValue = 'TABLE'; - if (logVars.log_output == 'TABLE') { - varValue = 'FILE'; - } - - str += '- '; - str += PMA_sprintf(PMA_messages.strSetLogOutput, varValue); - str += '
'; - - if (logVars.general_log != 'ON') { - str += '- '; - str += PMA_sprintf(PMA_messages.strEnableVar, 'general_log'); - str += '
'; - } else { - str += '- '; - str += PMA_sprintf(PMA_messages.strDisableVar, 'general_log'); - str += '
'; - } - - if (logVars.slow_query_log != 'ON') { - str += '- '; - str += PMA_sprintf(PMA_messages.strEnableVar, 'slow_query_log'); - str += '
'; - } else { - str += '- '; - str += PMA_sprintf(PMA_messages.strDisableVar, 'slow_query_log'); - str += '
'; - } - - varValue = 5; - if (logVars.long_query_time > 2) { - varValue = 1; - } - - str += '- '; - str += PMA_sprintf(PMA_messages.setSetLongQueryTime, varValue); - str += '
'; - - } else { - str += PMA_messages.strNoSuperUser + '
'; - } - - str += '
'; - - $dialog.find('div.monitorUse').toggle( - logVars.log_output == 'TABLE' && (logVars.slow_query_log == 'ON' || logVars.general_log == 'ON') - ); - - $dialog.find('div.ajaxContent').html(str); - $dialog.find('img.ajaxIcon').hide(); - $dialog.find('a.set').click(function () { - var nameValue = $(this).attr('href').split('-'); - loadLogVars({ varName: nameValue[0].substr(1), varValue: nameValue[1]}); - $dialog.find('img.ajaxIcon').show(); - }); - } - ); - }; - - - loadLogVars(); - - return false; - }); - - $('input[name="chartType"]').change(function () { - $('#chartVariableSettings').toggle(this.checked && this.value == 'variable'); - var title = $('input[name="chartTitle"]').val(); - if (title == PMA_messages.strChartTitle || - title == $('label[for="' + $('input[name="chartTitle"]').data('lastRadio') + '"]').text() - ) { - $('input[name="chartTitle"]') - .data('lastRadio', $(this).attr('id')) - .val($('label[for="' + $(this).attr('id') + '"]').text()); - } - - }); - - $('input[name="useDivisor"]').change(function () { - $('span.divisorInput').toggle(this.checked); - }); - - $('input[name="useUnit"]').change(function () { - $('span.unitInput').toggle(this.checked); - }); - - $('select[name="varChartList"]').change(function () { - if (this.selectedIndex !== 0) { - $('#variableInput').val(this.value); - } - }); - - $('a[href="#kibDivisor"]').click(function (event) { - event.preventDefault(); - $('input[name="valueDivisor"]').val(1024); - $('input[name="valueUnit"]').val(PMA_messages.strKiB); - $('span.unitInput').toggle(true); - $('input[name="useUnit"]').prop('checked', true); - return false; - }); - - $('a[href="#mibDivisor"]').click(function (event) { - event.preventDefault(); - $('input[name="valueDivisor"]').val(1024 * 1024); - $('input[name="valueUnit"]').val(PMA_messages.strMiB); - $('span.unitInput').toggle(true); - $('input[name="useUnit"]').prop('checked', true); - return false; - }); - - $('a[href="#submitClearSeries"]').click(function (event) { - event.preventDefault(); - $('#seriesPreview').html('' + PMA_messages.strNone + ''); - newChart = null; - $('#clearSeriesLink').hide(); - }); - - $('a[href="#submitAddSeries"]').click(function (event) { - event.preventDefault(); - if ($('#variableInput').val() === "") { - return false; - } - - if (newChart === null) { - $('#seriesPreview').html(''); - - newChart = { - title: $('input[name="chartTitle"]').val(), - nodes: [], - series: [], - maxYLabel: 0 - }; - } - - var serie = { - dataPoints: [{ type: 'statusvar', name: $('#variableInput').val() }], - display: $('input[name="differentialValue"]').prop('checked') ? 'differential' : '' - }; - - if (serie.dataPoints[0].name == 'Processes') { - serie.dataPoints[0].type = 'proc'; - } - - if ($('input[name="useDivisor"]').prop('checked')) { - serie.valueDivisor = parseInt($('input[name="valueDivisor"]').val(), 10); - } - - if ($('input[name="useUnit"]').prop('checked')) { - serie.unit = $('input[name="valueUnit"]').val(); - } - - var str = serie.display == 'differential' ? ', ' + PMA_messages.strDifferential : ''; - str += serie.valueDivisor ? (', ' + PMA_sprintf(PMA_messages.strDividedBy, serie.valueDivisor)) : ''; - str += serie.unit ? (', ' + PMA_messages.strUnit + ': ' + serie.unit) : ''; - - var newSeries = { - label: $('#variableInput').val().replace(/_/g, " ") - }; - newChart.series.push(newSeries); - $('#seriesPreview').append('- ' + escapeHtml(newSeries.label + str) + '
'); - newChart.nodes.push(serie); - $('#variableInput').val(''); - $('input[name="differentialValue"]').prop('checked', true); - $('input[name="useDivisor"]').prop('checked', false); - $('input[name="useUnit"]').prop('checked', false); - $('input[name="useDivisor"]').trigger('change'); - $('input[name="useUnit"]').trigger('change'); - $('select[name="varChartList"]').get(0).selectedIndex = 0; - - $('#clearSeriesLink').show(); - - return false; - }); - - $("#variableInput").autocomplete({ - source: variableNames - }); - - /* Initializes the monitor, called only once */ - function initGrid() { - - var i; - - /* Apply default values & config */ - if (isStorageSupported('localStorage')) { - if (typeof window.localStorage.monitorCharts !== 'undefined') { - runtime.charts = $.parseJSON(window.localStorage.monitorCharts); - } - if (typeof window.localStorage.monitorSettings !== 'undefined') { - monitorSettings = $.parseJSON(window.localStorage.monitorSettings); - } - - $('a[href="#clearMonitorConfig"]').toggle(runtime.charts !== null); - - if (runtime.charts !== null - && typeof window.localStorage.monitorVersion !== 'undefined' - && monitorProtocolVersion != window.localStorage.monitorVersion - ) { - $('#emptyDialog').dialog({title: PMA_messages.strIncompatibleMonitorConfig}); - $('#emptyDialog').html(PMA_messages.strIncompatibleMonitorConfigDescription); - - var dlgBtns = {}; - dlgBtns[PMA_messages.strClose] = function () { $(this).dialog('close'); }; - - $('#emptyDialog').dialog({ - width: 400, - buttons: dlgBtns - }); - } - } - - if (runtime.charts === null) { - runtime.charts = defaultChartGrid; - } - if (monitorSettings === null) { - monitorSettings = defaultMonitorSettings; - } - - $('select[name="gridChartRefresh"]').val(monitorSettings.gridRefresh / 1000); - $('select[name="chartColumns"]').val(monitorSettings.columns); - - if (monitorSettings.gridMaxPoints == 'auto') { - runtime.gridMaxPoints = Math.round((monitorSettings.chartSize.width - 40) / 12); - } else { - runtime.gridMaxPoints = monitorSettings.gridMaxPoints; - } - - runtime.xmin = new Date().getTime() - server_time_diff - runtime.gridMaxPoints * monitorSettings.gridRefresh; - runtime.xmax = new Date().getTime() - server_time_diff + monitorSettings.gridRefresh; - - /* Calculate how much spacing there is between each chart */ - $('#chartGrid').html('
'); - chartSpacing = { - width: $('#chartGrid').find('td:nth-child(2)').offset().left - - $('#chartGrid').find('td:nth-child(1)').offset().left, - height: $('#chartGrid').find('tr:nth-child(2) td:nth-child(2)').offset().top - - $('#chartGrid').find('tr:nth-child(1) td:nth-child(1)').offset().top - }; - $('#chartGrid').html(''); - - /* Add all charts - in correct order */ - var keys = []; - $.each(runtime.charts, function (key, value) { - keys.push(key); - }); - keys.sort(); - for (i = 0; i < keys.length; i++) { - addChart(runtime.charts[keys[i]], true); - } - - /* Fill in missing cells */ - var numCharts = $('#chartGrid').find('.monitorChart').length; - var numMissingCells = (monitorSettings.columns - numCharts % monitorSettings.columns) % monitorSettings.columns; - for (i = 0; i < numMissingCells; i++) { - $('#chartGrid').find('tr:last').append(''); - } - - // Empty cells should keep their size so you can drop onto them - calculateChartSize(); - $('#chartGrid').find('tr td').css('width', chartSize.width + 'px'); - - buildRequiredDataList(); - refreshChartGrid(); - } - - /* Calls destroyGrid() and initGrid(), but before doing so it saves the chart - * data from each chart and restores it after the monitor is initialized again */ - function rebuildGrid() { - var oldData = null; - if (runtime.charts) { - oldData = {}; - $.each(runtime.charts, function (key, chartObj) { - for (var i = 0, l = chartObj.nodes.length; i < l; i++) { - oldData[chartObj.nodes[i].dataPoint] = []; - for (var j = 0, ll = chartObj.chart.series[i].data.length; j < ll; j++) { - oldData[chartObj.nodes[i].dataPoint].push([chartObj.chart.series[i].data[j].x, chartObj.chart.series[i].data[j].y]); - } - } - }); - } - - destroyGrid(); - initGrid(); - } - - /* Calculactes the dynamic chart size that depends on the column width */ - function calculateChartSize() { - var panelWidth; - if ($("body").height() > $(window).height()) { // has vertical scroll bar - panelWidth = $('#logTable').innerWidth(); - } else { - panelWidth = $('#logTable').innerWidth() - 10; // leave some space for vertical scroll bar - } - - var wdt = (panelWidth - monitorSettings.columns * chartSpacing.width) / monitorSettings.columns; - chartSize = { - width: Math.floor(wdt), - height: Math.floor(0.75 * wdt) - }; - } - - /* Adds a chart to the chart grid */ - function addChart(chartObj, initialize) { - - var i; - var settings = { - title: escapeHtml(chartObj.title), - grid: { - drawBorder: false, - shadow: false, - background: 'rgba(0,0,0,0)' - }, - axes: { - xaxis: { - renderer: $.jqplot.DateAxisRenderer, - tickOptions: { - formatString: '%H:%M:%S', - showGridline: false - }, - min: runtime.xmin, - max: runtime.xmax - }, - yaxis: { - min: 0, - max: 100, - tickInterval: 20 - } - }, - seriesDefaults: { - rendererOptions: { - smooth: true - }, - showLine: true, - lineWidth: 2, - markerOptions: { - size: 6 - } - }, - highlighter: { - show: true - } - }; - - if (settings.title === PMA_messages.strSystemCPUUsage || - settings.title === PMA_messages.strQueryCacheEfficiency - ) { - settings.axes.yaxis.tickOptions = { - formatString: "%d %%" - }; - } else if (settings.title === PMA_messages.strSystemMemory || - settings.title === PMA_messages.strSystemSwap - ) { - settings.stackSeries = true; - settings.axes.yaxis.tickOptions = { - formatter: $.jqplot.byteFormatter(2) // MiB - }; - } else if (settings.title === PMA_messages.strTraffic) { - settings.axes.yaxis.tickOptions = { - formatter: $.jqplot.byteFormatter(1) // KiB - }; - } else if (settings.title === PMA_messages.strQuestions || - settings.title === PMA_messages.strConnections - ) { - settings.axes.yaxis.tickOptions = { - formatter: function (format, val) { - if (Math.abs(val) >= 1000000) { - return $.jqplot.sprintf("%.3g M", val / 1000000); - } else if (Math.abs(val) >= 1000) { - return $.jqplot.sprintf("%.3g k", val / 1000); - } else { - return $.jqplot.sprintf("%d", val); - } - } - }; - } - - settings.series = chartObj.series; - - if ($('#' + 'gridchart' + runtime.chartAI).length === 0) { - var numCharts = $('#chartGrid').find('.monitorChart').length; - - if (numCharts === 0 || (numCharts % monitorSettings.columns === 0)) { - $('#chartGrid').append(''); - } - - if (!chartSize) { - calculateChartSize(); - } - $('#chartGrid').find('tr:last').append( - '' - ); - } - - // Set series' data as [0,0], smooth lines won't plot with data array having null values. - // also chart won't plot initially with no data and data comes on refreshChartGrid() - var series = []; - for (i in chartObj.series) { - series.push([[0, 0]]); - } - - var tempTooltipContentEditor = function (str, seriesIndex, pointIndex, plot) { - var j; - // TODO: move style to theme CSS - var tooltipHtml = '
'; - // x value i.e. time - var timeValue = str.split(",")[0]; - var seriesValue; - tooltipHtml += 'Time: ' + timeValue; - tooltipHtml += ''; - // Add y values to the tooltip per series - for (j in plot.series) { - // get y value if present - if (plot.series[j].data.length > pointIndex) { - seriesValue = plot.series[j].data[pointIndex][1]; - } else { - return; - } - var seriesLabel = plot.series[j].label; - var seriesColor = plot.series[j].color; - // format y value - if (plot.series[0]._yaxis.tickOptions.formatter) { - // using formatter function - seriesValue = plot.series[0]._yaxis.tickOptions.formatter('%s', seriesValue); - } else if (plot.series[0]._yaxis.tickOptions.formatString) { - // using format string - seriesValue = PMA_sprintf(plot.series[0]._yaxis.tickOptions.formatString, seriesValue); - } - tooltipHtml += '
' + - seriesLabel + ': ' + seriesValue + ''; - } - tooltipHtml += '
'; - return tooltipHtml; - }; - - // set Tooltip for each series - for (i in settings.series) { - settings.series[i].highlighter = { - show: true, - tooltipContentEditor: tempTooltipContentEditor - }; - } - - chartObj.chart = $.jqplot('gridchart' + runtime.chartAI, series, settings); - // remove [0,0] after plotting - for (i in chartObj.chart.series) { - chartObj.chart.series[i].data.shift(); - } - - var $legend = $('
').css('padding', '0.5em'); - for (i in chartObj.chart.series) { - $legend.append( - $('
').append( - $('
').css({ - width: '1em', - height: '1em', - background: chartObj.chart.seriesColors[i] - }).addClass('floatleft') - ).append( - $('
').text( - chartObj.chart.series[i].label - ).addClass('floatleft') - ).append( - $('
') - ).addClass('floatleft') - ); - } - $('#gridchart' + runtime.chartAI) - .parent() - .append($legend); - - if (initialize !== true) { - runtime.charts['c' + runtime.chartAI] = chartObj; - buildRequiredDataList(); - } - - // time span selection - $('#gridchart' + runtime.chartAI).bind('jqplotMouseDown', function (ev, gridpos, datapos, neighbor, plot) { - drawTimeSpan = true; - selectionTimeDiff.push(datapos.xaxis); - if ($('#selection_box').length) { - $('#selection_box').remove(); - } - var selectionBox = $('
'); - $(document.body).append(selectionBox); - selectionStartX = ev.pageX; - selectionStartY = ev.pageY; - selectionBox - .attr({id: 'selection_box'}) - .css({ - top: selectionStartY - gridpos.y, - left: selectionStartX - }) - .fadeIn(); - }); - - $('#gridchart' + runtime.chartAI).bind('jqplotMouseUp', function (ev, gridpos, datapos, neighbor, plot) { - if (! drawTimeSpan || editMode) { - return; - } - - selectionTimeDiff.push(datapos.xaxis); - - if (selectionTimeDiff[1] <= selectionTimeDiff[0]) { - selectionTimeDiff = []; - return; - } - //get date from timestamp - var min = new Date(Math.ceil(selectionTimeDiff[0])); - var max = new Date(Math.ceil(selectionTimeDiff[1])); - PMA_getLogAnalyseDialog(min, max); - selectionTimeDiff = []; - drawTimeSpan = false; - }); - - $('#gridchart' + runtime.chartAI).bind('jqplotMouseMove', function (ev, gridpos, datapos, neighbor, plot) { - if (! drawTimeSpan || editMode) { - return; - } - if (selectionStartX !== undefined) { - $('#selection_box') - .css({ - width: Math.ceil(ev.pageX - selectionStartX) - }) - .fadeIn(); - } - }); - - $('#gridchart' + runtime.chartAI).bind('jqplotMouseLeave', function (ev, gridpos, datapos, neighbor, plot) { - drawTimeSpan = false; - }); - - $(document.body).mouseup(function () { - if ($('#selection_box').length) { - $('#selection_box').remove(); - } - }); - - // Edit, Print icon only in edit mode - $('#chartGrid').find('div svg').find('*[zIndex=20], *[zIndex=21], *[zIndex=19]').toggle(editMode); - - runtime.chartAI++; - } - - function PMA_getLogAnalyseDialog(min, max) { - var $logAnalyseDialog = $('#logAnalyseDialog'); - var $dateStart = $logAnalyseDialog.find('input[name="dateStart"]'); - var $dateEnd = $logAnalyseDialog.find('input[name="dateEnd"]'); - $dateStart.prop("readonly", true); - $dateEnd.prop("readonly", true); - - var dlgBtns = { }; - - dlgBtns[PMA_messages.strFromSlowLog] = function () { - loadLog('slow', min, max); - $(this).dialog("close"); - }; - - dlgBtns[PMA_messages.strFromGeneralLog] = function () { - loadLog('general', min, max); - $(this).dialog("close"); - }; - - $logAnalyseDialog.dialog({ - width: 'auto', - height: 'auto', - buttons: dlgBtns - }); - - PMA_addDatepicker($dateStart, 'datetime', { - showMillisec: false, - showMicrosec: false, - timeFormat: 'HH:mm:ss' - }); - PMA_addDatepicker($dateEnd, 'datetime', { - showMillisec: false, - showMicrosec: false, - timeFormat: 'HH:mm:ss' - }); - $dateStart.datepicker('setDate', min); - $dateEnd.datepicker('setDate', max); - } - - function loadLog(type, min, max) { - var dateStart = Date.parse($('#logAnalyseDialog').find('input[name="dateStart"]').datepicker('getDate')) || min; - var dateEnd = Date.parse($('#logAnalyseDialog').find('input[name="dateEnd"]').datepicker('getDate')) || max; - - loadLogStatistics({ - src: type, - start: dateStart, - end: dateEnd, - removeVariables: $('#removeVariables').prop('checked'), - limitTypes: $('#limitTypes').prop('checked') - }); - } - - /* Called in regular intervals, this function updates the values of each chart in the grid */ - function refreshChartGrid() { - /* Send to server */ - runtime.refreshRequest = $.post('server_status_monitor.php' + PMA_commonParams.get('common_query'), { - ajax_request: true, - chart_data: 1, - type: 'chartgrid', - requiredData: JSON.stringify(runtime.dataList) - }, function (data) { - var chartData; - if (typeof data !== 'undefined' && data.success === true) { - chartData = data.message; - } else { - return serverResponseError(); - } - var value, i = 0; - var diff; - var total; - - /* Update values in each graph */ - $.each(runtime.charts, function (orderKey, elem) { - var key = elem.chartID; - // If newly added chart, we have no data for it yet - if (! chartData[key]) { - return; - } - // Draw all series - total = 0; - for (var j = 0; j < elem.nodes.length; j++) { - // Update x-axis - if (i === 0 && j === 0) { - if (oldChartData === null) { - diff = chartData.x - runtime.xmax; - } else { - diff = parseInt(chartData.x - oldChartData.x, 10); - } - - runtime.xmin += diff; - runtime.xmax += diff; - } - - //elem.chart.xAxis[0].setExtremes(runtime.xmin, runtime.xmax, false); - /* Calculate y value */ - - // If transform function given, use it - if (elem.nodes[j].transformFn) { - value = chartValueTransform( - elem.nodes[j].transformFn, - chartData[key][j], - // Check if first iteration (oldChartData==null), or if newly added chart oldChartData[key]==null - ( - oldChartData === null || - oldChartData[key] === null || - oldChartData[key] === undefined ? null : oldChartData[key][j] - ) - ); - - // Otherwise use original value and apply differential and divisor if given, - // in this case we have only one data point per series - located at chartData[key][j][0] - } else { - value = parseFloat(chartData[key][j][0].value); - - if (elem.nodes[j].display == 'differential') { - if (oldChartData === null || - oldChartData[key] === null || - oldChartData[key] === undefined - ) { - continue; - } - value -= oldChartData[key][j][0].value; - } - - if (elem.nodes[j].valueDivisor) { - value = value / elem.nodes[j].valueDivisor; - } - } - - // Set y value, if defined - if (value !== undefined) { - elem.chart.series[j].data.push([chartData.x, value]); - if (value > elem.maxYLabel) { - elem.maxYLabel = value; - } else if (elem.maxYLabel === 0) { - elem.maxYLabel = 0.5; - } - // free old data point values and update maxYLabel - if (elem.chart.series[j].data.length > runtime.gridMaxPoints && - elem.chart.series[j].data[0][0] < runtime.xmin - ) { - // check if the next freeable point is highest - if (elem.maxYLabel <= elem.chart.series[j].data[0][1]) { - elem.chart.series[j].data.splice(0, elem.chart.series[j].data.length - runtime.gridMaxPoints); - elem.maxYLabel = getMaxYLabel(elem.chart.series[j].data); - } else { - elem.chart.series[j].data.splice(0, elem.chart.series[j].data.length - runtime.gridMaxPoints); - } - } - if (elem.title === PMA_messages.strSystemMemory || - elem.title === PMA_messages.strSystemSwap - ) { - total += value; - } - } - } - - // update chart options - // keep ticks number/positioning consistent while refreshrate changes - var tickInterval = (runtime.xmax - runtime.xmin) / 5; - elem.chart.axes.xaxis.ticks = [(runtime.xmax - tickInterval * 4), - (runtime.xmax - tickInterval * 3), (runtime.xmax - tickInterval * 2), - (runtime.xmax - tickInterval), runtime.xmax]; - - if (elem.title !== PMA_messages.strSystemCPUUsage && - elem.title !== PMA_messages.strQueryCacheEfficiency && - elem.title !== PMA_messages.strSystemMemory && - elem.title !== PMA_messages.strSystemSwap - ) { - elem.chart.axes.yaxis.max = Math.ceil(elem.maxYLabel * 1.1); - elem.chart.axes.yaxis.tickInterval = Math.ceil(elem.maxYLabel * 1.1 / 5); - } else if (elem.title === PMA_messages.strSystemMemory || - elem.title === PMA_messages.strSystemSwap - ) { - elem.chart.axes.yaxis.max = Math.ceil(total * 1.1 / 100) * 100; - elem.chart.axes.yaxis.tickInterval = Math.ceil(total * 1.1 / 5); - } - i++; - - if (runtime.redrawCharts) { - elem.chart.replot(); - } - }); - - oldChartData = chartData; - - runtime.refreshTimeout = setTimeout(refreshChartGrid, monitorSettings.gridRefresh); - }); - } - - /* Function to get highest plotted point's y label, to scale the chart, - * TODO: make jqplot's autoscale:true work here - */ - function getMaxYLabel(dataValues) { - var maxY = dataValues[0][1]; - $.each(dataValues, function (k, v) { - maxY = (v[1] > maxY) ? v[1] : maxY; - }); - return maxY; - } - - /* Function that supplies special value transform functions for chart values */ - function chartValueTransform(name, cur, prev) { - switch (name) { - case 'cpu-linux': - if (prev === null) { - return undefined; - } - // cur and prev are datapoint arrays, but containing - // only 1 element for cpu-linux - cur = cur[0]; - prev = prev[0]; - - var diff_total = cur.busy + cur.idle - (prev.busy + prev.idle); - var diff_idle = cur.idle - prev.idle; - return 100 * (diff_total - diff_idle) / diff_total; - - // Query cache efficiency (%) - case 'qce': - if (prev === null) { - return undefined; - } - // cur[0].value is Qcache_hits, cur[1].value is Com_select - var diffQHits = cur[0].value - prev[0].value; - // No NaN please :-) - if (cur[1].value - prev[1].value === 0) { - return 0; - } - - return diffQHits / (cur[1].value - prev[1].value + diffQHits) * 100; - - // Query cache usage (%) - case 'qcu': - if (cur[1].value === 0) { - return 0; - } - // cur[0].value is Qcache_free_memory, cur[1].value is query_cache_size - return 100 - cur[0].value / cur[1].value * 100; - - } - return undefined; - } - - /* Build list of nodes that need to be retrieved from server. - * It creates something like a stripped down version of the runtime.charts object. - */ - function buildRequiredDataList() { - runtime.dataList = {}; - // Store an own id, because the property name is subject of reordering, - // thus destroying our mapping with runtime.charts <=> runtime.dataList - var chartID = 0; - $.each(runtime.charts, function (key, chart) { - runtime.dataList[chartID] = []; - for (var i = 0, l = chart.nodes.length; i < l; i++) { - runtime.dataList[chartID][i] = chart.nodes[i].dataPoints; - } - runtime.charts[key].chartID = chartID; - chartID++; - }); - } - - /* Loads the log table data, generates the table and handles the filters */ - function loadLogStatistics(opts) { - var tableStr = ''; - var logRequest = null; - - if (! opts.removeVariables) { - opts.removeVariables = false; - } - if (! opts.limitTypes) { - opts.limitTypes = false; - } - - $('#emptyDialog').dialog({title: PMA_messages.strAnalysingLogsTitle}); - $('#emptyDialog').html(PMA_messages.strAnalysingLogs + - ' '); - var dlgBtns = {}; - - dlgBtns[PMA_messages.strCancelRequest] = function () { - if (logRequest !== null) { - logRequest.abort(); - } - - $(this).dialog("close"); - }; - - $('#emptyDialog').dialog({ - width: 'auto', - height: 'auto', - buttons: dlgBtns - }); - - - logRequest = $.get('server_status_monitor.php' + PMA_commonParams.get('common_query'), - { ajax_request: true, - log_data: 1, - type: opts.src, - time_start: Math.round(opts.start / 1000), - time_end: Math.round(opts.end / 1000), - removeVariables: opts.removeVariables, - limitTypes: opts.limitTypes - }, - function (data) { - var logData; - var dlgBtns = {}; - if (typeof data !== 'undefined' && data.success === true) { - logData = data.message; - } else { - return serverResponseError(); - } - - if (logData.rows.length === 0) { - $('#emptyDialog').dialog({title: PMA_messages.strNoDataFoundTitle}); - $('#emptyDialog').html('

' + PMA_messages.strNoDataFound + '

'); - - dlgBtns[PMA_messages.strClose] = function () { - $(this).dialog("close"); - }; - - $('#emptyDialog').dialog("option", "buttons", dlgBtns); - return; - } - - runtime.logDataCols = buildLogTable(logData, opts.removeVariables); - - /* Show some stats in the dialog */ - $('#emptyDialog').dialog({title: PMA_messages.strLoadingLogs}); - $('#emptyDialog').html('

' + PMA_messages.strLogDataLoaded + '

'); - $.each(logData.sum, function (key, value) { - key = key.charAt(0).toUpperCase() + key.slice(1).toLowerCase(); - if (key == 'Total') { - key = '' + key + ''; - } - $('#emptyDialog').append(key + ': ' + value + '
'); - }); - - /* Add filter options if more than a bunch of rows there to filter */ - if (logData.numRows > 12) { - $('#logTable').prepend( - '
' + - ' ' + PMA_messages.strFiltersForLogTable + '' + - '
' + - ' ' + - ' ' + - '
' + - ((logData.numRows > 250) ? '
' : '') + - '
' + - ' ' + - ' ' + - ' ' - ); - - $('#noWHEREData').change(function () { - filterQueries(true); - }); - - if (logData.numRows > 250) { - $('#startFilterQueryText').click(filterQueries); - } else { - $('#filterQueryText').keyup(filterQueries); - } - - } - - dlgBtns[PMA_messages.strJumpToTable] = function () { - $(this).dialog("close"); - $(document).scrollTop($('#logTable').offset().top); - }; - - $('#emptyDialog').dialog("option", "buttons", dlgBtns); - } - ); - - /* Handles the actions performed when the user uses any of the - * log table filters which are the filter by name and grouping - * with ignoring data in WHERE clauses - * - * @param boolean Should be true when the users enabled or disabled - * to group queries ignoring data in WHERE clauses - */ - function filterQueries(varFilterChange) { - var odd_row = false, cell, textFilter; - var val = $('#filterQueryText').val(); - - if (val.length === 0) { - textFilter = null; - } else { - try { - textFilter = new RegExp(val, 'i'); - $('#filterQueryText').removeClass('error'); - } catch(e) { - if (e instanceof SyntaxError) { - $('#filterQueryText').addClass('error'); - textFilter = null; - } - } - } - - var rowSum = 0, totalSum = 0, i = 0, q; - var noVars = $('#noWHEREData').prop('checked'); - var equalsFilter = /([^=]+)=(\d+|((\'|"|).*?[^\\])\4((\s+)|$))/gi; - var functionFilter = /([a-z0-9_]+)\(.+?\)/gi; - var filteredQueries = {}, filteredQueriesLines = {}; - var hide = false, rowData; - var queryColumnName = runtime.logDataCols[runtime.logDataCols.length - 2]; - var sumColumnName = runtime.logDataCols[runtime.logDataCols.length - 1]; - var isSlowLog = opts.src == 'slow'; - var columnSums = {}; - - // For the slow log we have to count many columns (query_time, lock_time, rows_examined, rows_sent, etc.) - var countRow = function (query, row) { - var cells = row.match(/
'); - } - } - - /* Turns a timespan (12:12:12) into a number */ - function timeToSec(timeStr) { - var time = timeStr.split(':'); - return (parseInt(time[0], 10) * 3600) + (parseInt(time[1], 10) * 60) + parseInt(time[2], 10); - } - - /* Turns a number into a timespan (100 into 00:01:40) */ - function secToTime(timeInt) { - var hours = Math.floor(timeInt / 3600); - timeInt -= hours * 3600; - var minutes = Math.floor(timeInt / 60); - timeInt -= minutes * 60; - - if (hours < 10) { - hours = '0' + hours; - } - if (minutes < 10) { - minutes = '0' + minutes; - } - if (timeInt < 10) { - timeInt = '0' + timeInt; - } - - return hours + ':' + minutes + ':' + timeInt; - } - - /* Constructs the log table out of the retrieved server data */ - function buildLogTable(data, groupInserts) { - var rows = data.rows; - var cols = []; - var $table = $('
' + - '
' + - '
(.*?)<\/td>/gi); - if (!columnSums[query]) { - columnSums[query] = [0, 0, 0, 0]; - } - - // lock_time and query_time and displayed in timespan format - columnSums[query][0] += timeToSec(cells[2].replace(/(|<\/td>)/gi, '')); - columnSums[query][1] += timeToSec(cells[3].replace(/(|<\/td>)/gi, '')); - // rows_examind and rows_sent are just numbers - columnSums[query][2] += parseInt(cells[4].replace(/(|<\/td>)/gi, ''), 10); - columnSums[query][3] += parseInt(cells[5].replace(/(|<\/td>)/gi, ''), 10); - }; - - // We just assume the sql text is always in the second last column, and that the total count is right of it - $('#logTable').find('table tbody tr td:nth-child(' + (runtime.logDataCols.length - 1) + ')').each(function () { - var $t = $(this); - // If query is a SELECT and user enabled or disabled to group - // queries ignoring data in where statements, we - // need to re-calculate the sums of each row - if (varFilterChange && $t.html().match(/^SELECT/i)) { - if (noVars) { - // Group on => Sum up identical columns, and hide all but 1 - - q = $t.text().replace(equalsFilter, '$1=...$6').trim(); - q = q.replace(functionFilter, ' $1(...)'); - - // Js does not specify a limit on property name length, - // so we can abuse it as index :-) - if (filteredQueries[q]) { - filteredQueries[q] += parseInt($t.next().text(), 10); - totalSum += parseInt($t.next().text(), 10); - hide = true; - } else { - filteredQueries[q] = parseInt($t.next().text(), 10); - filteredQueriesLines[q] = i; - $t.text(q); - } - if (isSlowLog) { - countRow(q, $t.parent().html()); - } - - } else { - // Group off: Restore original columns - - rowData = $t.parent().data('query'); - // Restore SQL text - $t.text(rowData[queryColumnName]); - // Restore total count - $t.next().text(rowData[sumColumnName]); - // Restore slow log columns - if (isSlowLog) { - $t.parent().children('td:nth-child(3)').text(rowData.query_time); - $t.parent().children('td:nth-child(4)').text(rowData.lock_time); - $t.parent().children('td:nth-child(5)').text(rowData.rows_sent); - $t.parent().children('td:nth-child(6)').text(rowData.rows_examined); - } - } - } - - // If not required to be hidden, do we need - // to hide because of a not matching text filter? - if (! hide && (textFilter !== null && ! textFilter.exec($t.text()))) { - hide = true; - } - - // Now display or hide this column - if (hide) { - $t.parent().css('display', 'none'); - } else { - totalSum += parseInt($t.next().text(), 10); - rowSum++; - - odd_row = ! odd_row; - $t.parent().css('display', ''); - if (odd_row) { - $t.parent().addClass('odd'); - $t.parent().removeClass('even'); - } else { - $t.parent().addClass('even'); - $t.parent().removeClass('odd'); - } - } - - hide = false; - i++; - }); - - // We finished summarizing counts => Update count values of all grouped entries - if (varFilterChange) { - if (noVars) { - var numCol, row, $table = $('#logTable').find('table tbody'); - $.each(filteredQueriesLines, function (key, value) { - if (filteredQueries[key] <= 1) { - return; - } - - row = $table.children('tr:nth-child(' + (value + 1) + ')'); - numCol = row.children(':nth-child(' + (runtime.logDataCols.length) + ')'); - numCol.text(filteredQueries[key]); - - if (isSlowLog) { - row.children('td:nth-child(3)').text(secToTime(columnSums[key][0])); - row.children('td:nth-child(4)').text(secToTime(columnSums[key][1])); - row.children('td:nth-child(5)').text(columnSums[key][2]); - row.children('td:nth-child(6)').text(columnSums[key][3]); - } - }); - } - - $('#logTable').find('table').trigger("update"); - setTimeout(function () { - $('#logTable').find('table').trigger('sorton', [[[runtime.logDataCols.length - 1, 1]]]); - }, 0); - } - - // Display some stats at the bottom of the table - $('#logTable').find('table tfoot tr') - .html('' + - PMA_messages.strSumRows + ' ' + rowSum + '' + - PMA_messages.strTotal + '' + totalSum + '
'); - var $tBody, $tRow, $tCell; - - $('#logTable').html($table); - - var tempPushKey = function (key, value) { - cols.push(key); - }; - - var formatValue = function (name, value) { - if (name == 'user_host') { - return value.replace(/(\[.*?\])+/g, ''); - } - return escapeHtml(value); - }; - - for (var i = 0, l = rows.length; i < l; i++) { - if (i === 0) { - $.each(rows[0], tempPushKey); - $table.append('' + - '' + cols.join('') + '' + - '' - ); - - $table.append($tBody = $('')); - } - - $tBody.append($tRow = $('')); - var cl = ''; - for (var j = 0, ll = cols.length; j < ll; j++) { - // Assuming the query column is the second last - if (j == cols.length - 2 && rows[i][cols[j]].match(/^SELECT/i)) { - $tRow.append($tCell = $('' + formatValue(cols[j], rows[i][cols[j]]) + '')); - $tCell.click(openQueryAnalyzer); - } else { - $tRow.append('' + formatValue(cols[j], rows[i][cols[j]]) + ''); - } - - $tRow.data('query', rows[i]); - } - } - - $table.append('' + - '' + PMA_messages.strSumRows + - ' ' + data.numRows + '' + PMA_messages.strTotal + - '' + data.sum.TOTAL + ''); - - // Append a tooltip to the count column, if there exist one - if ($('#logTable').find('tr:first th:last').text().indexOf("#") > -1) { - $('#logTable').find('tr:first th:last').append(' ' + PMA_getImage('b_help.png', '', {'class': 'qroupedQueryInfoIcon'})); - - var tooltipContent = PMA_messages.strCountColumnExplanation; - if (groupInserts) { - tooltipContent += '

' + PMA_messages.strMoreCountColumnExplanation + '

'; - } - - PMA_tooltip( - $('img.qroupedQueryInfoIcon'), - 'img', - tooltipContent - ); - } - - $('#logTable').find('table').tablesorter({ - sortList: [[cols.length - 1, 1]], - widgets: ['fast-zebra'] - }); - - $('#logTable').find('table thead th') - .append('
'); - - return cols; - } - - /* Opens the query analyzer dialog */ - function openQueryAnalyzer() { - var rowData = $(this).parent().data('query'); - var query = rowData.argument || rowData.sql_text; - - if (codemirror_editor) { - //TODO: somehow PMA_SQLPrettyPrint messes up the query, needs be fixed - //query = PMA_SQLPrettyPrint(query); - codemirror_editor.setValue(query); - // Codemirror is bugged, it doesn't refresh properly sometimes. - // Following lines seem to fix that - setTimeout(function () { - codemirror_editor.refresh(); - }, 50); - } - else { - $('#sqlquery').val(query); - } - - var profilingChart = null; - var dlgBtns = {}; - - dlgBtns[PMA_messages.strAnalyzeQuery] = function () { - loadQueryAnalysis(rowData); - }; - dlgBtns[PMA_messages.strClose] = function () { - $(this).dialog('close'); - }; - - $('#queryAnalyzerDialog').dialog({ - width: 'auto', - height: 'auto', - resizable: false, - buttons: dlgBtns, - close: function () { - if (profilingChart !== null) { - profilingChart.destroy(); - } - $('#queryAnalyzerDialog').find('div.placeHolder').html(''); - if (codemirror_editor) { - codemirror_editor.setValue(''); - } else { - $('#sqlquery').val(''); - } - } - }); - } - - /* Loads and displays the analyzed query data */ - function loadQueryAnalysis(rowData) { - var db = rowData.db || ''; - - $('#queryAnalyzerDialog').find('div.placeHolder').html( - PMA_messages.strAnalyzing + ' '); - - $.post('server_status_monitor.php' + PMA_commonParams.get('common_query'), { - ajax_request: true, - query_analyzer: true, - query: codemirror_editor ? codemirror_editor.getValue() : $('#sqlquery').val(), - database: db - }, function (data) { - var i, l; - if (typeof data !== 'undefined' && data.success === true) { - data = data.message; - } - if (data.error) { - if (data.error.indexOf('1146') != -1 || data.error.indexOf('1046') != -1) { - data.error = PMA_messages.strServerLogError; - } - $('#queryAnalyzerDialog').find('div.placeHolder').html('
' + data.error + '
'); - return; - } - var totalTime = 0; - // Float sux, I'll use table :( - $('#queryAnalyzerDialog').find('div.placeHolder') - .html('
'); - - var explain = '' + PMA_messages.strExplainOutput + ' ' + $('#explain_docu').html(); - if (data.explain.length > 1) { - explain += ' ('; - for (i = 0; i < data.explain.length; i++) { - if (i > 0) { - explain += ', '; - } - explain += '' + i + ''; - } - explain += ')'; - } - explain += '

'; - - var tempExplain = function (key, value) { - value = (value === null) ? 'null' : escapeHtml(value); - - if (key == 'type' && value.toLowerCase() == 'all') { - value = '' + value + ''; - } - if (key == 'Extra') { - value = value.replace(/(using (temporary|filesort))/gi, '$1'); - } - explain += key + ': ' + value + '
'; - }; - - for (i = 0, l = data.explain.length; i < l; i++) { - explain += '
0 ? 'style="display:none;"' : '') + '>'; - $.each(data.explain[i], tempExplain); - explain += '
'; - } - - explain += '

' + PMA_messages.strAffectedRows + ' ' + data.affectedRows; - - $('#queryAnalyzerDialog').find('div.placeHolder td.explain').append(explain); - - $('#queryAnalyzerDialog').find('div.placeHolder a[href*="#showExplain"]').click(function () { - var id = $(this).attr('href').split('-')[1]; - $(this).parent().find('div[class*="explain"]').hide(); - $(this).parent().find('div[class*="explain-' + id + '"]').show(); - }); - - if (data.profiling) { - var chartData = []; - var numberTable = ''; - var duration; - var otherTime = 0; - - for (i = 0, l = data.profiling.length; i < l; i++) { - duration = parseFloat(data.profiling[i].duration); - - totalTime += duration; - - numberTable += ''; - } - - // Only put those values in the pie which are > 2% - for (i = 0, l = data.profiling.length; i < l; i++) { - duration = parseFloat(data.profiling[i].duration); - - if (duration / totalTime > 0.02) { - chartData.push([PMA_prettyProfilingNum(duration, 2) + ' ' + data.profiling[i].state, duration]); - } else { - otherTime += duration; - } - } - - if (otherTime > 0) { - chartData.push([PMA_prettyProfilingNum(otherTime, 2) + ' ' + PMA_messages.strOther, otherTime]); - } - - numberTable += ''; - numberTable += '
' + PMA_messages.strStatus + '' + PMA_messages.strTime + '
' + data.profiling[i].state + ' ' + PMA_prettyProfilingNum(duration, 2) + '
' + PMA_messages.strTotalTime + '' + PMA_prettyProfilingNum(totalTime, 2) + '
'; - - $('#queryAnalyzerDialog').find('div.placeHolder td.chart').append( - '' + PMA_messages.strProfilingResults + ' ' + $('#profiling_docu').html() + ' ' + - '(' + PMA_messages.strTable + ', ' + PMA_messages.strChart + ')
' + - numberTable + '

'); - - $('#queryAnalyzerDialog').find('div.placeHolder a[href="#showNums"]').click(function () { - $('#queryAnalyzerDialog').find('#queryProfiling').hide(); - $('#queryAnalyzerDialog').find('table.queryNums').show(); - return false; - }); - - $('#queryAnalyzerDialog').find('div.placeHolder a[href="#showChart"]').click(function () { - $('#queryAnalyzerDialog').find('#queryProfiling').show(); - $('#queryAnalyzerDialog').find('table.queryNums').hide(); - return false; - }); - - profilingChart = PMA_createProfilingChart( - 'queryProfiling', - chartData - ); - - //$('#queryProfiling').resizable(); - } - }); - } - - /* Saves the monitor to localstorage */ - function saveMonitor() { - var gridCopy = {}; - - $.each(runtime.charts, function (key, elem) { - gridCopy[key] = {}; - gridCopy[key].nodes = elem.nodes; - gridCopy[key].settings = elem.settings; - gridCopy[key].title = elem.title; - gridCopy[key].series = elem.series; - gridCopy[key].maxYLabel = elem.maxYLabel; - }); - - if (isStorageSupported('localStorage')) { - window.localStorage.monitorCharts = JSON.stringify(gridCopy); - window.localStorage.monitorSettings = JSON.stringify(monitorSettings); - window.localStorage.monitorVersion = monitorProtocolVersion; - } - - $('a[href="#clearMonitorConfig"]').show(); - } -}); - -// Run the monitor once loaded -AJAX.registerOnload('server_status_monitor.js', function () { - $('a[href="#pauseCharts"]').trigger('click'); -}); - -function serverResponseError() { - var btns = {}; - btns[PMA_messages.strReloadPage] = function () { - window.location.reload(); - }; - $('#emptyDialog').dialog({title: PMA_messages.strRefreshFailed}); - $('#emptyDialog').html( - PMA_getImage('s_attention.png') + - PMA_messages.strInvalidResponseExplanation - ); - $('#emptyDialog').dialog({ buttons: btns }); -} - -/* Destroys all monitor related resources */ -function destroyGrid() { - if (runtime.charts) { - $.each(runtime.charts, function (key, value) { - try { - value.chart.destroy(); - } catch (err) {} - }); - } - - try { - runtime.refreshRequest.abort(); - } catch (err) {} - try { - clearTimeout(runtime.refreshTimeout); - } catch (err) {} - $('#chartGrid').html(''); - runtime.charts = null; - runtime.chartAI = 0; - monitorSettings = null; //TODO:this not global variable -} diff --git a/#pma/js/server_status_processes.js b/#pma/js/server_status_processes.js deleted file mode 100644 index 87b14f02..00000000 --- a/#pma/js/server_status_processes.js +++ /dev/null @@ -1,188 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * Server Status Processes - * - * @package PhpMyAdmin - */ - -// object to store process list state information -var processList = { - - // denotes whether auto refresh is on or off - autoRefresh: false, - // stores the GET request which refresh process list - refreshRequest: null, - // stores the timeout id returned by setTimeout - refreshTimeout: null, - // the refresh interval in seconds - refreshInterval: null, - // the refresh URL (required to save last used option) - // i.e. full or sorting url - refreshUrl: null, - - /** - * Handles killing of a process - * - * @return void - */ - init: function() { - processList.setRefreshLabel(); - if (processList.refreshUrl === null) { - processList.refreshUrl = 'server_status_processes.php' + - PMA_commonParams.get('common_query'); - } - if (processList.refreshInterval === null) { - processList.refreshInterval = $('#id_refreshRate').val(); - } else { - $('#id_refreshRate').val(processList.refreshInterval); - } - }, - - /** - * Handles killing of a process - * - * @param object the event object - * - * @return void - */ - killProcessHandler: function(event) { - event.preventDefault(); - var url = $(this).attr('href'); - // Get row element of the process to be killed. - var $tr = $(this).closest('tr'); - $.getJSON(url, function(data) { - // Check if process was killed or not. - if (data.hasOwnProperty('success') && data.success) { - // remove the row of killed process. - $tr.remove(); - // As we just removed a row, reapply odd-even classes - // to keep table stripes consistent - var $tableProcessListTr = $('#tableprocesslist').find('> tbody > tr'); - $tableProcessListTr.filter(':even').removeClass('odd').addClass('even'); - $tableProcessListTr.filter(':odd').removeClass('even').addClass('odd'); - // Show process killed message - PMA_ajaxShowMessage(data.message, false); - } else { - // Show process error message - PMA_ajaxShowMessage(data.error, false); - } - }); - }, - - /** - * Handles Auto Refreshing - * - * @param object the event object - * - * @return void - */ - refresh: function(event) { - // abort any previous pending requests - // this is necessary, it may go into - // multiple loops causing unnecessary - // requests even after leaving the page. - processList.abortRefresh(); - // if auto refresh is enabled - if (processList.autoRefresh) { - var interval = parseInt(processList.refreshInterval, 10) * 1000; - var urlParams = processList.getUrlParams(); - processList.refreshRequest = $.get(processList.refreshUrl, - urlParams, - function(data) { - if (data.hasOwnProperty('success') && data.success) { - $newTable = $(data.message); - $('#tableprocesslist').html($newTable.html()); - PMA_highlightSQL($('#tableprocesslist')); - } - processList.refreshTimeout = setTimeout( - processList.refresh, - interval - ); - }); - } - }, - - /** - * Stop current request and clears timeout - * - * @return void - */ - abortRefresh: function() { - if (processList.refreshRequest !== null) { - processList.refreshRequest.abort(); - processList.refreshRequest = null; - } - clearTimeout(processList.refreshTimeout); - }, - - /** - * Set label of refresh button - * change between play & pause - * - * @return void - */ - setRefreshLabel: function() { - var img = 'play.png'; - var label = PMA_messages.strStartRefresh; - if (processList.autoRefresh) { - img = 'pause.png'; - label = PMA_messages.strStopRefresh; - processList.refresh(); - } - $('a#toggleRefresh').html(PMA_getImage(img) + escapeHtml(label)); - }, - - /** - * Return the Url Parameters - * for autorefresh request, - * includes showExecuting if the filter is checked - * - * @return urlParams - url parameters with autoRefresh request - */ - getUrlParams: function() { - var urlParams = { 'ajax_request': true, 'refresh': true }; - if ($('#showExecuting').is(":checked")) { - urlParams.showExecuting = true; - return urlParams; - } - return urlParams; - } -}; - -AJAX.registerOnload('server_status_processes.js', function() { - - processList.init(); - // Bind event handler for kill_process - $('#tableprocesslist').on( - 'click', - 'a.kill_process', - processList.killProcessHandler - ); - // Bind event handler for toggling refresh of process list - $('a#toggleRefresh').on('click', function(event) { - event.preventDefault(); - processList.autoRefresh = !processList.autoRefresh; - processList.setRefreshLabel(); - }); - // Bind event handler for change in refresh rate - $('#id_refreshRate').on('change', function(event) { - processList.refreshInterval = $(this).val(); - processList.refresh(); - }); - // Bind event handler for table header links - $('#tableprocesslist').on('click', 'thead a', function() { - processList.refreshUrl = $(this).attr('href'); - }); -}); - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('server_status_processes.js', function() { - $('#tableprocesslist').off('click', 'a.kill_process'); - $('a#toggleRefresh').off('click'); - $('#id_refreshRate').off('change'); - $('#tableprocesslist').off('click', 'thead a'); - // stop refreshing further - processList.abortRefresh(); -}); diff --git a/#pma/js/server_status_queries.js b/#pma/js/server_status_queries.js deleted file mode 100644 index a4a4e005..00000000 --- a/#pma/js/server_status_queries.js +++ /dev/null @@ -1,34 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - */ - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('server_status_queries.js', function () { - var queryPieChart = $('#serverstatusquerieschart').data('queryPieChart'); - if (queryPieChart) { - queryPieChart.destroy(); - } -}); - -AJAX.registerOnload('server_status_queries.js', function () { - // Build query statistics chart - var cdata = []; - try { - $.each(jQuery.parseJSON($('#serverstatusquerieschart_data').text()), function (key, value) { - cdata.push([key, parseInt(value, 10)]); - }); - $('#serverstatusquerieschart').data( - 'queryPieChart', - PMA_createProfilingChart( - 'serverstatusquerieschart', - cdata - ) - ); - } catch (exception) { - // Could not load chart, no big deal... - } - - initTableSorter('statustabs_queries'); -}); diff --git a/#pma/js/server_status_sorter.js b/#pma/js/server_status_sorter.js deleted file mode 100644 index b0891c16..00000000 --- a/#pma/js/server_status_sorter.js +++ /dev/null @@ -1,83 +0,0 @@ -// TODO: tablesorter shouldn't sort already sorted columns -function initTableSorter(tabid) { - var $table, opts; - switch (tabid) { - case 'statustabs_queries': - $table = $('#serverstatusqueriesdetails'); - opts = { - sortList: [[3, 1]], - widgets: ['fast-zebra'], - headers: { - 1: { sorter: 'fancyNumber' }, - 2: { sorter: 'fancyNumber' } - } - }; - break; - } - $table.tablesorter(opts); - $table.find('tr:first th') - .append('
'); -} - -$(function () { - $.tablesorter.addParser({ - id: "fancyNumber", - is: function (s) { - return (/^[0-9]?[0-9,\.]*\s?(k|M|G|T|%)?$/).test(s); - }, - format: function (s) { - var num = jQuery.tablesorter.formatFloat( - s.replace(PMA_messages.strThousandsSeparator, '') - .replace(PMA_messages.strDecimalSeparator, '.') - ); - - var factor = 1; - switch (s.charAt(s.length - 1)) { - case '%': - factor = -2; - break; - // Todo: Complete this list (as well as in the regexp a few lines up) - case 'k': - factor = 3; - break; - case 'M': - factor = 6; - break; - case 'G': - factor = 9; - break; - case 'T': - factor = 12; - break; - } - - return num * Math.pow(10, factor); - }, - type: "numeric" - }); - - $.tablesorter.addParser({ - id: "withinSpanNumber", - is: function (s) { - return (/(.*)?<\/span>/); - return (res && res.length >= 3) ? res[2] : 0; - }, - type: "numeric" - }); - - // faster zebra widget: no row visibility check, faster css class switching, no cssChildRow check - $.tablesorter.addWidget({ - id: "fast-zebra", - format: function (table) { - $("tr:even", table.tBodies[0]) - .removeClass(table.config.widgetZebra.css[0]) - .addClass(table.config.widgetZebra.css[1]); - $("tr:odd", table.tBodies[0]) - .removeClass(table.config.widgetZebra.css[1]) - .addClass(table.config.widgetZebra.css[0]); - } - }); -}); diff --git a/#pma/js/server_status_variables.js b/#pma/js/server_status_variables.js deleted file mode 100644 index 47956f84..00000000 --- a/#pma/js/server_status_variables.js +++ /dev/null @@ -1,111 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * - * - * @package PhpMyAdmin - */ - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('server_status_variables.js', function () { - $('#filterAlert').unbind('change'); - $('#filterText').unbind('keyup'); - $('#filterCategory').unbind('change'); - $('#dontFormat').unbind('change'); -}); - -AJAX.registerOnload('server_status_variables.js', function () { - - // Filters for status variables - var textFilter = null; - var alertFilter = $('#filterAlert').prop('checked'); - var categoryFilter = $('#filterCategory').find(':selected').val(); - var odd_row = false; - var text = ''; // Holds filter text - - /* 3 Filtering functions */ - $('#filterAlert').change(function () { - alertFilter = this.checked; - filterVariables(); - }); - - $('#filterCategory').change(function () { - categoryFilter = $(this).val(); - filterVariables(); - }); - - $('#dontFormat').change(function () { - // Hiding the table while changing values speeds up the process a lot - $('#serverstatusvariables').hide(); - $('#serverstatusvariables').find('td.value span.original').toggle(this.checked); - $('#serverstatusvariables').find('td.value span.formatted').toggle(! this.checked); - $('#serverstatusvariables').show(); - }).trigger('change'); - - $('#filterText').keyup(function (e) { - var word = $(this).val().replace(/_/g, ' '); - if (word.length === 0) { - textFilter = null; - } else { - try { - textFilter = new RegExp("(^| )" + word, 'i'); - $(this).removeClass('error'); - } catch(e) { - if (e instanceof SyntaxError) { - $(this).addClass('error'); - textFilter = null; - } - } - } - text = word; - filterVariables(); - }).trigger('keyup'); - - /* Filters the status variables by name/category/alert in the variables tab */ - function filterVariables() { - var useful_links = 0; - var section = text; - - if (categoryFilter.length > 0) { - section = categoryFilter; - } - - if (section.length > 1) { - $('#linkSuggestions').find('span').each(function () { - if ($(this).attr('class').indexOf('status_' + section) != -1) { - useful_links++; - $(this).css('display', ''); - } else { - $(this).css('display', 'none'); - } - }); - } - - if (useful_links > 0) { - $('#linkSuggestions').css('display', ''); - } else { - $('#linkSuggestions').css('display', 'none'); - } - - odd_row = false; - $('#serverstatusvariables').find('th.name').each(function () { - if ((textFilter === null || textFilter.exec($(this).text())) && - (! alertFilter || $(this).next().find('span.attention').length > 0) && - (categoryFilter.length === 0 || $(this).parent().hasClass('s_' + categoryFilter)) - ) { - odd_row = ! odd_row; - $(this).parent().css('display', ''); - if (odd_row) { - $(this).parent().addClass('odd'); - $(this).parent().removeClass('even'); - } else { - $(this).parent().addClass('even'); - $(this).parent().removeClass('odd'); - } - } else { - $(this).parent().css('display', 'none'); - } - }); - } -}); diff --git a/#pma/js/server_user_groups.js b/#pma/js/server_user_groups.js deleted file mode 100644 index 6cd2813a..00000000 --- a/#pma/js/server_user_groups.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('server_user_groups.js', function () { - $(document).off('click', "a.deleteUserGroup.ajax"); -}); - -/** - * Bind event handlers - */ -AJAX.registerOnload('server_user_groups.js', function () { - - // update the checkall checkbox on Edit user group page - $(checkboxes_sel).trigger("change"); - - $(document).on('click', "a.deleteUserGroup.ajax", function (event) { - event.preventDefault(); - var $link = $(this); - var groupName = $link.parents('tr').find('td:first').text(); - var buttonOptions = {}; - buttonOptions[PMA_messages.strGo] = function () { - $(this).dialog("close"); - $link.removeClass('ajax').trigger('click'); - }; - buttonOptions[PMA_messages.strClose] = function () { - $(this).dialog("close"); - }; - $('
') - .attr('id', 'confirmUserGroupDeleteDialog') - .append(PMA_sprintf(PMA_messages.strDropUserGroupWarning, escapeHtml(groupName))) - .dialog({ - width: 300, - minWidth: 200, - modal: true, - buttons: buttonOptions, - title: PMA_messages.strConfirm, - close: function () { - $(this).remove(); - } - }); - }); -}); diff --git a/#pma/js/server_variables.js b/#pma/js/server_variables.js deleted file mode 100644 index 404e6f26..00000000 --- a/#pma/js/server_variables.js +++ /dev/null @@ -1,160 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('server_variables.js', function () { - $('#filterText').unbind('keyup'); - $(document).off('click', 'a.editLink'); - $('#serverVariables').find('.var-name').find('a img').remove(); -}); - -AJAX.registerOnload('server_variables.js', function () { - var $editLink = $('a.editLink'); - var $saveLink = $('a.saveLink'); - var $cancelLink = $('a.cancelLink'); - var $filterField = $('#filterText'); - - - $('#serverVariables').find('.var-name').find('a').append( - $('#docImage').clone().show() - ); - - /* Launches the variable editor */ - $(document).on('click', 'a.editLink', function (event) { - event.preventDefault(); - editVariable(this); - }); - - /* Event handler for variables filter */ - $filterField.keyup(function () { - var textFilter = null, val = $(this).val(); - if (val.length !== 0) { - try { - textFilter = new RegExp("(^| )" + val.replace(/_/g, ' '), 'i'); - $(this).removeClass('error'); - } catch(e) { - if (e instanceof SyntaxError) { - $(this).addClass('error'); - textFilter = null; - } - } - } - filterVariables(textFilter); - }); - - /* Trigger filtering of the list based on incoming variable name */ - if ($filterField.val()) { - $filterField.trigger('keyup').select(); - } - - /* Filters the rows by the user given regexp */ - function filterVariables(textFilter) { - var mark_next = false, $row, odd_row = false; - $('#serverVariables').find('.var-row').not('.var-header').each(function () { - $row = $(this); - if (mark_next || textFilter === null || - textFilter.exec($row.find('.var-name').text()) - ) { - // If current global value is different from session value - // (has class diffSession), then display that one too - mark_next = $row.hasClass('diffSession') && ! mark_next; - - odd_row = ! odd_row; - $row.css('display', ''); - if (odd_row) { - $row.addClass('odd').removeClass('even'); - } else { - $row.addClass('even').removeClass('odd'); - } - } else { - $row.css('display', 'none'); - } - }); - } - - /* Allows the user to edit a server variable */ - function editVariable(link) { - var $link = $(link); - var $cell = $link.parent(); - var $valueCell = $link.parents('.var-row').find('.var-value'); - var varName = $link.data('variable'); - var $mySaveLink = $saveLink.clone().show(); - var $myCancelLink = $cancelLink.clone().show(); - var $msgbox = PMA_ajaxShowMessage(); - var $myEditLink = $cell.find('a.editLink'); - - $cell.addClass('edit'); // variable is being edited - $myEditLink.remove(); // remove edit link - - $mySaveLink.click(function () { - var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); - $.post($(this).attr('href'), { - ajax_request: true, - type: 'setval', - varName: varName, - varValue: $valueCell.find('input').val() - }, function (data) { - if (data.success) { - $valueCell - .html(data.variable) - .data('content', data.variable); - PMA_ajaxRemoveMessage($msgbox); - } else { - if (data.error == '') { - PMA_ajaxShowMessage(PMA_messages.strRequestFailed, false); - } else { - PMA_ajaxShowMessage(data.error, false); - } - $valueCell.html($valueCell.data('content')); - } - $cell.removeClass('edit').html($myEditLink); - }); - return false; - }); - - $myCancelLink.click(function () { - $valueCell.html($valueCell.data('content')); - $cell.removeClass('edit').html($myEditLink); - return false; - }); - - $.get($mySaveLink.attr('href'), { - ajax_request: true, - type: 'getval', - varName: varName - }, function (data) { - if (typeof data !== 'undefined' && data.success === true) { - var $links = $('
') - .append($myCancelLink) - .append('   ') - .append($mySaveLink); - var $editor = $('
', {'class': 'serverVariableEditor'}) - .append( - $('
').append( - $('', {type: 'text'}).val(data.message) - ) - ); - // Save and replace content - $cell - .html($links); - $valueCell - .data('content', $valueCell.html()) - .html($editor) - .find('input') - .focus() - .keydown(function (event) { // Keyboard shortcuts - if (event.keyCode === 13) { // Enter key - $mySaveLink.trigger('click'); - } else if (event.keyCode === 27) { // Escape key - $myCancelLink.trigger('click'); - } - }); - PMA_ajaxRemoveMessage($msgbox); - } else { - $cell.removeClass('edit').html($myEditLink); - PMA_ajaxShowMessage(data.error); - } - }); - } -}); diff --git a/#pma/js/sprintf.js b/#pma/js/sprintf.js deleted file mode 100644 index 56291d51..00000000 --- a/#pma/js/sprintf.js +++ /dev/null @@ -1,211 +0,0 @@ -function sprintf() { -/* - * Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) - * and Contributors (http://phpjs.org/authors) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do - * so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. -*/ - // discuss at: http://phpjs.org/functions/sprintf/ - // original by: Ash Searle (http://hexmen.com/blog/) - // improved by: Michael White (http://getsprink.com) - // improved by: Jack - // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) - // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) - // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) - // improved by: Dj - // improved by: Allidylls - // input by: Paulo Freitas - // input by: Brett Zamir (http://brett-zamir.me) - // example 1: sprintf("%01.2f", 123.1); - // returns 1: 123.10 - // example 2: sprintf("[%10s]", 'monkey'); - // returns 2: '[ monkey]' - // example 3: sprintf("[%'#10s]", 'monkey'); - // returns 3: '[####monkey]' - // example 4: sprintf("%d", 123456789012345); - // returns 4: '123456789012345' - // example 5: sprintf('%-03s', 'E'); - // returns 5: 'E00' - - var regex = /%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g; - var a = arguments; - var i = 0; - var format = a[i++]; - - // pad() - var pad = function (str, len, chr, leftJustify) { - if (!chr) { - chr = ' '; - } - var padding = (str.length >= len) ? '' : new Array(1 + len - str.length >>> 0) - .join(chr); - return leftJustify ? str + padding : padding + str; - }; - - // justify() - var justify = function (value, prefix, leftJustify, minWidth, zeroPad, customPadChar) { - var diff = minWidth - value.length; - if (diff > 0) { - if (leftJustify || !zeroPad) { - value = pad(value, minWidth, customPadChar, leftJustify); - } else { - value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length); - } - } - return value; - }; - - // formatBaseX() - var formatBaseX = function (value, base, prefix, leftJustify, minWidth, precision, zeroPad) { - // Note: casts negative numbers to positive ones - var number = value >>> 0; - prefix = prefix && number && { - '2': '0b', - '8': '0', - '16': '0x' - }[base] || ''; - value = prefix + pad(number.toString(base), precision || 0, '0', false); - return justify(value, prefix, leftJustify, minWidth, zeroPad); - }; - - // formatString() - var formatString = function (value, leftJustify, minWidth, precision, zeroPad, customPadChar) { - if (precision != null) { - value = value.slice(0, precision); - } - return justify(value, '', leftJustify, minWidth, zeroPad, customPadChar); - }; - - // doFormat() - var doFormat = function (substring, valueIndex, flags, minWidth, _, precision, type) { - var number, prefix, method, textTransform, value; - - if (substring === '%%') { - return '%'; - } - - // parse flags - var leftJustify = false; - var positivePrefix = ''; - var zeroPad = false; - var prefixBaseX = false; - var customPadChar = ' '; - var flagsl = flags.length; - for (var j = 0; flags && j < flagsl; j++) { - switch (flags.charAt(j)) { - case ' ': - positivePrefix = ' '; - break; - case '+': - positivePrefix = '+'; - break; - case '-': - leftJustify = true; - break; - case "'": - customPadChar = flags.charAt(j + 1); - break; - case '0': - zeroPad = true; - customPadChar = '0'; - break; - case '#': - prefixBaseX = true; - break; - } - } - - // parameters may be null, undefined, empty-string or real valued - // we want to ignore null, undefined and empty-string values - if (!minWidth) { - minWidth = 0; - } else if (minWidth === '*') { - minWidth = +a[i++]; - } else if (minWidth.charAt(0) == '*') { - minWidth = +a[minWidth.slice(1, -1)]; - } else { - minWidth = +minWidth; - } - - // Note: undocumented perl feature: - if (minWidth < 0) { - minWidth = -minWidth; - leftJustify = true; - } - - if (!isFinite(minWidth)) { - throw new Error('sprintf: (minimum-)width must be finite'); - } - - if (!precision) { - precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type === 'd') ? 0 : undefined; - } else if (precision === '*') { - precision = +a[i++]; - } else if (precision.charAt(0) == '*') { - precision = +a[precision.slice(1, -1)]; - } else { - precision = +precision; - } - - // grab value using valueIndex if required? - value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++]; - - switch (type) { - case 's': - return formatString(String(value), leftJustify, minWidth, precision, zeroPad, customPadChar); - case 'c': - return formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, zeroPad); - case 'b': - return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, precision, zeroPad); - case 'o': - return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, precision, zeroPad); - case 'x': - return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad); - case 'X': - return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad) - .toUpperCase(); - case 'u': - return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, precision, zeroPad); - case 'i': - case 'd': - number = +value || 0; - // Plain Math.round doesn't just truncate - number = Math.round(number - number % 1); - prefix = number < 0 ? '-' : positivePrefix; - value = prefix + pad(String(Math.abs(number)), precision, '0', false); - return justify(value, prefix, leftJustify, minWidth, zeroPad); - case 'e': - case 'E': - case 'f': // Should handle locales (as per setlocale) - case 'F': - case 'g': - case 'G': - number = +value; - prefix = number < 0 ? '-' : positivePrefix; - method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(type.toLowerCase())]; - textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(type) % 2]; - value = prefix + Math.abs(number)[method](precision); - return justify(value, prefix, leftJustify, minWidth, zeroPad)[textTransform](); - default: - return substring; - } - }; - - return format.replace(regex, doFormat); -} diff --git a/#pma/js/sql.js b/#pma/js/sql.js deleted file mode 100644 index c379420d..00000000 --- a/#pma/js/sql.js +++ /dev/null @@ -1,916 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * @fileoverview functions used wherever an sql query form is used - * - * @requires jQuery - * @requires js/functions.js - * - */ - -var $data_a; -var prevScrollX = 0; - -/** - * decode a string URL_encoded - * - * @param string str - * @return string the URL-decoded string - */ -function PMA_urldecode(str) -{ - if (typeof str !== 'undefined') { - return decodeURIComponent(str.replace(/\+/g, '%20')); - } -} - -/** - * endecode a string URL_decoded - * - * @param string str - * @return string the URL-encoded string - */ -function PMA_urlencode(str) -{ - if (typeof str !== 'undefined') { - return encodeURIComponent(str).replace(/\%20/g, '+'); - } -} - -/** - * Saves SQL query in local storage or cooie - * - * @param string SQL query - * @return void - */ -function PMA_autosaveSQL(query) -{ - if (query) { - if (isStorageSupported('localStorage')) { - window.localStorage.auto_saved_sql = query; - } else { - $.cookie('auto_saved_sql', query); - } - } -} - -/** - * Get the field name for the current field. Required to construct the query - * for grid editing - * - * @param $table_results enclosing results table - * @param $this_field jQuery object that points to the current field's tr - */ -function getFieldName($table_results, $this_field) -{ - - var this_field_index = $this_field.index(); - // ltr or rtl direction does not impact how the DOM was generated - // check if the action column in the left exist - var left_action_exist = !$table_results.find('th:first').hasClass('draggable'); - // number of column span for checkbox and Actions - var left_action_skip = left_action_exist ? $table_results.find('th:first').attr('colspan') - 1 : 0; - - // If this column was sorted, the text of the a element contains something - // like 1 that is useful to indicate the order in case - // of a sort on multiple columns; however, we dont want this as part - // of the column name so we strip it ( .clone() to .end() ) - var field_name = $table_results - .find('thead') - .find('th:eq(' + (this_field_index - left_action_skip) + ') a') - .clone() // clone the element - .children() // select all the children - .remove() // remove all of them - .end() // go back to the selected element - .text(); // grab the text - // happens when just one row (headings contain no a) - if (field_name === '') { - var $heading = $table_results.find('thead').find('th:eq(' + (this_field_index - left_action_skip) + ')').children('span'); - // may contain column comment enclosed in a span - detach it temporarily to read the column name - var $tempColComment = $heading.children().detach(); - field_name = $heading.text(); - // re-attach the column comment - $heading.append($tempColComment); - } - - field_name = $.trim(field_name); - - return field_name; -} - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('sql.js', function () { - $(document).off('click', 'a.delete_row.ajax'); - $(document).off('submit', '.bookmarkQueryForm'); - $('input#bkm_label').unbind('keyup'); - $(document).off('makegrid', ".sqlqueryresults"); - $(document).off('stickycolumns', ".sqlqueryresults"); - $("#togglequerybox").unbind('click'); - $(document).off('click', "#button_submit_query"); - $(document).off('change', '#id_bookmark'); - $("input[name=bookmark_variable]").unbind("keypress"); - $(document).off('submit', "#sqlqueryform.ajax"); - $(document).off('click', "input[name=navig].ajax"); - $(document).off('submit', "form[name='displayOptionsForm'].ajax"); - $(document).off('mouseenter', 'th.column_heading.pointer'); - $(document).off('mouseleave', 'th.column_heading.pointer'); - $(document).off('click', 'th.column_heading.marker'); - $(window).unbind('scroll'); - $(document).off("keyup", ".filter_rows"); - $(document).off('click', "#printView"); - if (codemirror_editor) { - codemirror_editor.off('change'); - } else { - $('#sqlquery').off('input propertychange'); - } - $('body').off('click', '.navigation .showAllRows'); - $('body').off('click','a.browse_foreign'); - $('body').off('click', '#simulate_dml'); - $('body').off('keyup', '#sqlqueryform'); - $('body').off('click', 'form[name="resultsForm"].ajax button[name="submit_mult"], form[name="resultsForm"].ajax input[name="submit_mult"]'); -}); - -/** - * @description

Ajax scripts for sql and browse pages

- * - * Actions ajaxified here: - *
    - *
  • Retrieve results of an SQL query
  • - *
  • Paginate the results table
  • - *
  • Sort the results table
  • - *
  • Change table according to display options
  • - *
  • Grid editing of data
  • - *
  • Saving a bookmark
  • - *
- * - * @name document.ready - * @memberOf jQuery - */ -AJAX.registerOnload('sql.js', function () { - - $(function () { - if (codemirror_editor) { - codemirror_editor.on('change', function () { - PMA_autosaveSQL(codemirror_editor.getValue()); - }); - } else { - $('#sqlquery').on('input propertychange', function () { - PMA_autosaveSQL($('#sqlquery').val()); - }); - } - }); - - // Delete row from SQL results - $(document).on('click', 'a.delete_row.ajax', function (e) { - e.preventDefault(); - var question = PMA_sprintf(PMA_messages.strDoYouReally, escapeHtml($(this).closest('td').find('div').text())); - var $link = $(this); - $link.PMA_confirm(question, $link.attr('href'), function (url) { - $msgbox = PMA_ajaxShowMessage(); - if ($link.hasClass('formLinkSubmit')) { - submitFormLink($link); - } else { - $.post(url, {'ajax_request': true, 'is_js_confirmed': true}, function (data) { - if (data.success) { - PMA_ajaxShowMessage(data.message); - $link.closest('tr').remove(); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }); - } - }); - }); - - // Ajaxification for 'Bookmark this SQL query' - $(document).on('submit', '.bookmarkQueryForm', function (e) { - e.preventDefault(); - PMA_ajaxShowMessage(); - $.post($(this).attr('action'), 'ajax_request=1&' + $(this).serialize(), function (data) { - if (data.success) { - PMA_ajaxShowMessage(data.message); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }); - }); - - /* Hides the bookmarkoptions checkboxes when the bookmark label is empty */ - $('input#bkm_label').keyup(function () { - $('input#id_bkm_all_users, input#id_bkm_replace') - .parent() - .toggle($(this).val().length > 0); - }).trigger('keyup'); - - /** - * Attach Event Handler for 'Copy to clipbpard - */ - $(document).on('click', "#copyToClipBoard", function (event) { - event.preventDefault(); - - // Print the page - copyToClipboard(); - }); //end of Copy to Clipboard action - - /** - * Attach Event Handler for 'Print' link - */ - $(document).on('click', "#printView", function (event) { - event.preventDefault(); - - // Take to preview mode - printPreview(); - }); //end of 'Print' action - - /** - * Attach the {@link makegrid} function to a custom event, which will be - * triggered manually everytime the table of results is reloaded - * @memberOf jQuery - */ - $(document).on('makegrid', ".sqlqueryresults", function () { - $('.table_results').each(function () { - PMA_makegrid(this); - }); - }); - - /* - * Attach a custom event for sticky column headings which will be - * triggered manually everytime the table of results is reloaded - * @memberOf jQuery - */ - $(document).on('stickycolumns', ".sqlqueryresults", function () { - $(".sticky_columns").remove(); - $(".table_results").each(function () { - var $table_results = $(this); - //add sticky columns div - var $stick_columns = initStickyColumns($table_results); - rearrangeStickyColumns($stick_columns, $table_results); - //adjust sticky columns on scroll - $(window).bind('scroll', function() { - handleStickyColumns($stick_columns, $table_results); - }); - }); - }); - - /** - * Append the "Show/Hide query box" message to the query input form - * - * @memberOf jQuery - * @name appendToggleSpan - */ - // do not add this link more than once - if (! $('#sqlqueryform').find('a').is('#togglequerybox')) { - $('') - .html(PMA_messages.strHideQueryBox) - .appendTo("#sqlqueryform") - // initially hidden because at this point, nothing else - // appears under the link - .hide(); - - // Attach the toggling of the query box visibility to a click - $("#togglequerybox").bind('click', function () { - var $link = $(this); - $link.siblings().slideToggle("fast"); - if ($link.text() == PMA_messages.strHideQueryBox) { - $link.text(PMA_messages.strShowQueryBox); - // cheap trick to add a spacer between the menu tabs - // and "Show query box"; feel free to improve! - $('#togglequerybox_spacer').remove(); - $link.before('
'); - } else { - $link.text(PMA_messages.strHideQueryBox); - } - // avoid default click action - return false; - }); - } - - - /** - * Event handler for sqlqueryform.ajax button_submit_query - * - * @memberOf jQuery - */ - $(document).on('click', "#button_submit_query", function (event) { - $(".success,.error").hide(); - //hide already existing error or success message - var $form = $(this).closest("form"); - // the Go button related to query submission was clicked, - // instead of the one related to Bookmarks, so empty the - // id_bookmark selector to avoid misinterpretation in - // import.php about what needs to be done - $form.find("select[name=id_bookmark]").val(""); - // let normal event propagation happen - }); - - /** - * Event handler to show appropiate number of variable boxes - * based on the bookmarked query - */ - $(document).on('change', '#id_bookmark', function (event) { - - var varCount = $(this).find('option:selected').data('varcount'); - if (typeof varCount == 'undefined') { - varCount = 0; - } - - var $varDiv = $('#bookmark_variables'); - $varDiv.empty(); - for (var i = 1; i <= varCount; i++) { - $varDiv.append($('')); - $varDiv.append($('')); - } - - if (varCount == 0) { - $varDiv.parent('.formelement').hide(); - } else { - $varDiv.parent('.formelement').show(); - } - }); - - /** - * Event handler for hitting enter on sqlqueryform bookmark_variable - * (the Variable textfield in Bookmarked SQL query section) - * - * @memberOf jQuery - */ - $("input[name=bookmark_variable]").bind("keypress", function (event) { - // force the 'Enter Key' to implicitly click the #button_submit_bookmark - var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode)); - if (keycode == 13) { // keycode for enter key - // When you press enter in the sqlqueryform, which - // has 2 submit buttons, the default is to run the - // #button_submit_query, because of the tabindex - // attribute. - // This submits #button_submit_bookmark instead, - // because when you are in the Bookmarked SQL query - // section and hit enter, you expect it to do the - // same action as the Go button in that section. - $("#button_submit_bookmark").click(); - return false; - } else { - return true; - } - }); - - /** - * Ajax Event handler for 'SQL Query Submit' - * - * @see PMA_ajaxShowMessage() - * @memberOf jQuery - * @name sqlqueryform_submit - */ - $(document).on('submit', "#sqlqueryform.ajax", function (event) { - event.preventDefault(); - - var $form = $(this); - if (codemirror_editor) { - $form[0].elements.sql_query.value = codemirror_editor.getValue(); - } - if (! checkSqlQuery($form[0])) { - return false; - } - - // remove any div containing a previous error message - $('div.error').remove(); - - var $msgbox = PMA_ajaxShowMessage(); - var $sqlqueryresultsouter = $('#sqlqueryresultsouter'); - - PMA_prepareForAjaxRequest($form); - - $.post($form.attr('action'), $form.serialize() + '&ajax_page_request=true', function (data) { - if (typeof data !== 'undefined' && data.success === true) { - // success happens if the query returns rows or not - - // show a message that stays on screen - if (typeof data.action_bookmark != 'undefined') { - // view only - if ('1' == data.action_bookmark) { - $('#sqlquery').text(data.sql_query); - // send to codemirror if possible - setQuery(data.sql_query); - } - // delete - if ('2' == data.action_bookmark) { - $("#id_bookmark option[value='" + data.id_bookmark + "']").remove(); - // if there are no bookmarked queries now (only the empty option), - // remove the bookmark section - if ($('#id_bookmark option').length == 1) { - $('#fieldsetBookmarkOptions').hide(); - $('#fieldsetBookmarkOptionsFooter').hide(); - } - } - } - $sqlqueryresultsouter - .show() - .html(data.message); - PMA_highlightSQL($sqlqueryresultsouter); - - if (data._menu) { - if (history && history.pushState) { - history.replaceState({ - menu : data._menu - }, - null - ); - AJAX.handleMenu.replace(data._menu); - } else { - PMA_MicroHistory.menus.replace(data._menu); - PMA_MicroHistory.menus.add(data._menuHash, data._menu); - } - } else if (data._menuHash) { - if (! (history && history.pushState)) { - PMA_MicroHistory.menus.replace(PMA_MicroHistory.menus.get(data._menuHash)); - } - } - - if (data._params) { - PMA_commonParams.setAll(data._params); - } - - if (typeof data.ajax_reload != 'undefined') { - if (data.ajax_reload.reload) { - if (data.ajax_reload.table_name) { - PMA_commonParams.set('table', data.ajax_reload.table_name); - PMA_commonActions.refreshMain(); - } else { - PMA_reloadNavigation(); - } - } - } else if (typeof data.reload != 'undefined') { - // this happens if a USE or DROP command was typed - PMA_commonActions.setDb(data.db); - var url; - if (data.db) { - if (data.table) { - url = 'table_sql.php'; - } else { - url = 'db_sql.php'; - } - } else { - url = 'server_sql.php'; - } - PMA_commonActions.refreshMain(url, function () { - $('#sqlqueryresultsouter') - .show() - .html(data.message); - PMA_highlightSQL($('#sqlqueryresultsouter')); - }); - } - - $('.sqlqueryresults').trigger('makegrid').trigger('stickycolumns'); - $('#togglequerybox').show(); - PMA_init_slider(); - - if (typeof data.action_bookmark == 'undefined') { - if ($('#sqlqueryform input[name="retain_query_box"]').is(':checked') !== true) { - if ($("#togglequerybox").siblings(":visible").length > 0) { - $("#togglequerybox").trigger('click'); - } - } - } - } else if (typeof data !== 'undefined' && data.success === false) { - // show an error message that stays on screen - $sqlqueryresultsouter - .show() - .html(data.error); - } - PMA_ajaxRemoveMessage($msgbox); - }); // end $.post() - }); // end SQL Query submit - - /** - * Ajax Event handler for the display options - * @memberOf jQuery - * @name displayOptionsForm_submit - */ - $(document).on('submit', "form[name='displayOptionsForm'].ajax", function (event) { - event.preventDefault(); - - $form = $(this); - - var $msgbox = PMA_ajaxShowMessage(); - $.post($form.attr('action'), $form.serialize() + '&ajax_request=true', function (data) { - PMA_ajaxRemoveMessage($msgbox); - var $sqlqueryresults = $form.parents(".sqlqueryresults"); - $sqlqueryresults - .html(data.message) - .trigger('makegrid') - .trigger('stickycolumns'); - PMA_init_slider(); - PMA_highlightSQL($sqlqueryresults); - }); // end $.post() - }); //end displayOptionsForm handler - - // Filter row handling. --STARTS-- - $(document).on("keyup", ".filter_rows", function () { - var unique_id = $(this).data("for"); - var $target_table = $(".table_results[data-uniqueId='" + unique_id + "']"); - var $header_cells = $target_table.find("th[data-column]"); - var target_columns = Array(); - // To handle colspan=4, in case of edit,copy etc options. - var dummy_th = ($(".edit_row_anchor").length !== 0 ? - '' - : ''); - // Selecting columns that will be considered for filtering and searching. - $header_cells.each(function () { - target_columns.push($.trim($(this).text())); - }); - - var phrase = $(this).val(); - // Set same value to both Filter rows fields. - $(".filter_rows[data-for='" + unique_id + "']").not(this).val(phrase); - // Handle colspan. - $target_table.find("thead > tr").prepend(dummy_th); - $.uiTableFilter($target_table, phrase, target_columns); - $target_table.find("th.dummy_th").remove(); - }); - // Filter row handling. --ENDS-- - - // Prompt to confirm on Show All - $('body').on('click', '.navigation .showAllRows', function (e) { - e.preventDefault(); - var $form = $(this).parents('form'); - - if (! $(this).is(':checked')) { // already showing all rows - submitShowAllForm(); - } else { - $form.PMA_confirm(PMA_messages.strShowAllRowsWarning, $form.attr('action'), function (url) { - submitShowAllForm(); - }); - } - - function submitShowAllForm() { - var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true'; - PMA_ajaxShowMessage(); - AJAX.source = $form; - $.post($form.attr('action'), submitData, AJAX.responseHandler); - } - }); - - $('body').on('keyup', '#sqlqueryform', function () { - PMA_handleSimulateQueryButton(); - }); - - /** - * Ajax event handler for 'Simulate DML'. - */ - $('body').on('click', '#simulate_dml', function () { - var $form = $('#sqlqueryform'); - var query = ''; - var delimiter = $('#id_sql_delimiter').val(); - var db_name = $form.find('input[name="db"]').val(); - - if (codemirror_editor) { - query = codemirror_editor.getValue(); - } else { - query = $('#sqlquery').val(); - } - - if (query.length === 0) { - alert(PMA_messages.strFormEmpty); - $('#sqlquery').focus(); - return false; - } - - var $msgbox = PMA_ajaxShowMessage(); - $.ajax({ - type: 'POST', - url: $form.attr('action'), - data: { - token: $form.find('input[name="token"]').val(), - db: db_name, - ajax_request: '1', - simulate_dml: '1', - sql_query: query, - sql_delimiter: delimiter - }, - success: function (response) { - PMA_ajaxRemoveMessage($msgbox); - if (response.success) { - var dialog_content = '
'; - if (response.sql_data) { - var len = response.sql_data.length; - for (var i=0; i' + response.sql_data[i].sql_query + - PMA_messages.strMatchedRows + - ' ' + response.sql_data[i].matched_rows + '
'; - if (i').append($dialog_content).dialog({ - minWidth: 540, - maxHeight: 400, - modal: true, - buttons: button_options, - title: PMA_messages.strSimulateDML, - open: function () { - PMA_highlightSQL($(this)); - }, - close: function () { - $(this).remove(); - } - }); - } else { - PMA_ajaxShowMessage(response.error); - } - }, - error: function (response) { - PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest); - } - }); - }); - - /** - * Handles multi submits of results browsing page such as edit, delete and export - */ - $('body').on('click', 'form[name="resultsForm"].ajax button[name="submit_mult"], form[name="resultsForm"].ajax input[name="submit_mult"]', function (e) { - e.preventDefault(); - var $button = $(this); - var $form = $button.closest('form'); - var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true&submit_mult=' + $button.val(); - PMA_ajaxShowMessage(); - AJAX.source = $form; - $.post($form.attr('action'), submitData, AJAX.responseHandler); - }); -}); // end $() - -/** - * Starting from some th, change the class of all td under it. - * If isAddClass is specified, it will be used to determine whether to add or remove the class. - */ -function PMA_changeClassForColumn($this_th, newclass, isAddClass) -{ - // index 0 is the th containing the big T - var th_index = $this_th.index(); - var has_big_t = $this_th.closest('tr').children(':first').hasClass('column_action'); - // .eq() is zero-based - if (has_big_t) { - th_index--; - } - var $table = $this_th.parents('.table_results'); - if (! $table.length) { - $table = $this_th.parents('table').siblings('.table_results'); - } - var $tds = $table.find('tbody tr').find('td.data:eq(' + th_index + ')'); - if (isAddClass === undefined) { - $tds.toggleClass(newclass); - } else { - $tds.toggleClass(newclass, isAddClass); - } -} - -/** - * Handles browse foreign values modal dialog - * - * @param object $this_a reference to the browse foreign value link - */ -function browseForeignDialog($this_a) -{ - var formId = '#browse_foreign_form'; - var showAllId = '#foreign_showAll'; - var tableId = '#browse_foreign_table'; - var filterId = '#input_foreign_filter'; - var $dialog = null; - $.get($this_a.attr('href'), {'ajax_request': true}, function (data) { - // Creates browse foreign value dialog - $dialog = $('
').append(data.message).dialog({ - title: PMA_messages.strBrowseForeignValues, - width: Math.min($(window).width() - 100, 700), - maxHeight: $(window).height() - 100, - dialogClass: 'browse_foreign_modal', - close: function (ev, ui) { - // remove event handlers attached to elements related to dialog - $(tableId).off('click', 'td a.foreign_value'); - $(formId).off('click', showAllId); - $(formId).off('submit'); - // remove dialog itself - $(this).remove(); - }, - modal: true - }); - }).done(function () { - var showAll = false; - $(tableId).on('click', 'td a.foreign_value', function (e) { - e.preventDefault(); - var $input = $this_a.prev('input[type=text]'); - // Check if input exists or get CEdit edit_box - if ($input.length === 0 ) { - $input = $this_a.closest('.edit_area').prev('.edit_box'); - } - // Set selected value as input value - $input.val($(this).data('key')); - $dialog.dialog('close'); - }); - $(formId).on('click', showAllId, function () { - showAll = true; - }); - $(formId).on('submit', function (e) { - e.preventDefault(); - // if filter value is not equal to old value - // then reset page number to 1 - if ($(filterId).val() != $(filterId).data('old')) { - $(formId).find('select[name=pos]').val('0'); - } - var postParams = $(this).serializeArray(); - // if showAll button was clicked to submit form then - // add showAll button parameter to form - if (showAll) { - postParams.push({ - name: $(showAllId).attr('name'), - value: $(showAllId).val() - }); - } - // updates values in dialog - $.post($(this).attr('action') + '?ajax_request=1', postParams, function (data) { - var $obj = $('
').html(data.message); - $(formId).html($obj.find(formId).html()); - $(tableId).html($obj.find(tableId).html()); - }); - showAll = false; - }); - }); -} - -AJAX.registerOnload('sql.js', function () { - $('body').on('click', 'a.browse_foreign', function (e) { - e.preventDefault(); - browseForeignDialog($(this)); - }); - - /** - * vertical column highlighting in horizontal mode when hovering over the column header - */ - $(document).on('mouseenter', 'th.column_heading.pointer', function (e) { - PMA_changeClassForColumn($(this), 'hover', true); - }); - $(document).on('mouseleave', 'th.column_heading.pointer', function (e) { - PMA_changeClassForColumn($(this), 'hover', false); - }); - - /** - * vertical column marking in horizontal mode when clicking the column header - */ - $(document).on('click', 'th.column_heading.marker', function () { - PMA_changeClassForColumn($(this), 'marked'); - }); - - /** - * create resizable table - */ - $(".sqlqueryresults").trigger('makegrid').trigger('stickycolumns'); -}); - -/* - * Profiling Chart - */ -function makeProfilingChart() -{ - if ($('#profilingchart').length === 0 || - $('#profilingchart').html().length !== 0 || - !$.jqplot || !$.jqplot.Highlighter || !$.jqplot.PieRenderer - ) { - return; - } - - var data = []; - $.each(jQuery.parseJSON($('#profilingChartData').html()), function (key, value) { - data.push([key, parseFloat(value)]); - }); - - // Remove chart and data divs contents - $('#profilingchart').html('').show(); - $('#profilingChartData').html(''); - - PMA_createProfilingChart('profilingchart', data); -} - -/* - * initialize profiling data tables - */ -function initProfilingTables() -{ - if (!$.tablesorter) { - return; - } - - $('#profiletable').tablesorter({ - widgets: ['zebra'], - sortList: [[0, 0]], - textExtraction: function (node) { - if (node.children.length > 0) { - return node.children[0].innerHTML; - } else { - return node.innerHTML; - } - } - }); - - $('#profilesummarytable').tablesorter({ - widgets: ['zebra'], - sortList: [[1, 1]], - textExtraction: function (node) { - if (node.children.length > 0) { - return node.children[0].innerHTML; - } else { - return node.innerHTML; - } - } - }); -} - -/* - * Set position, left, top, width of sticky_columns div - */ -function setStickyColumnsPosition($sticky_columns, $table_results, position, top, left, margin_left) { - $sticky_columns - .css("position", position) - .css("top", top) - .css("left", left ? left : "auto") - .css("margin-left", margin_left ? margin_left : "0px") - .css("width", $table_results.width()); -} - -/* - * Initialize sticky columns - */ -function initStickyColumns($table_results) { - return $('
') - .insertBefore($table_results) - .css("position", "fixed") - .css("z-index", "99") - .css("width", $table_results.width()) - .css("margin-left", $('#page_content').css("margin-left")) - .css("top", $('#floating_menubar').height()) - .css("display", "none"); -} - -/* - * Arrange/Rearrange columns in sticky header - */ -function rearrangeStickyColumns($sticky_columns, $table_results) { - var $originalHeader = $table_results.find("thead"); - var $originalColumns = $originalHeader.find("tr:first").children(); - var $clonedHeader = $originalHeader.clone(); - // clone width per cell - $clonedHeader.find("tr:first").children().width(function(i,val) { - var width = $originalColumns.eq(i).width(); - var is_firefox = navigator.userAgent.indexOf('Firefox') > -1; - if (! is_firefox) { - width += 1; - } - return width; - }); - $sticky_columns.empty().append($clonedHeader); -} - -/* - * Adjust sticky columns on horizontal/vertical scroll for all tables - */ -function handleAllStickyColumns() { - $('.sticky_columns').each(function () { - handleStickyColumns($(this), $(this).next('.table_results')); - }); -} - -/* - * Adjust sticky columns on horizontal/vertical scroll - */ -function handleStickyColumns($sticky_columns, $table_results) { - var currentScrollX = $(window).scrollLeft(); - var windowOffset = $(window).scrollTop(); - var tableStartOffset = $table_results.offset().top; - var tableEndOffset = tableStartOffset + $table_results.height(); - if (windowOffset >= tableStartOffset && windowOffset <= tableEndOffset) { - //for horizontal scrolling - if(prevScrollX != currentScrollX) { - prevScrollX = currentScrollX; - setStickyColumnsPosition($sticky_columns, $table_results, "absolute", $('#floating_menubar').height() + windowOffset - tableStartOffset); - //for vertical scrolling - } else { - setStickyColumnsPosition($sticky_columns, $table_results, "fixed", $('#floating_menubar').height(), $("#pma_navigation").width() - currentScrollX, $('#page_content').css("margin-left")); - } - $sticky_columns.show(); - } else { - $sticky_columns.hide(); - } -} - -AJAX.registerOnload('sql.js', function () { - makeProfilingChart(); - initProfilingTables(); -}); diff --git a/#pma/js/tbl_change.js b/#pma/js/tbl_change.js deleted file mode 100644 index 99914f52..00000000 --- a/#pma/js/tbl_change.js +++ /dev/null @@ -1,725 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * @fileoverview function used in table data manipulation pages - * - * @requires jQuery - * @requires jQueryUI - * @requires js/functions.js - * - */ - -/** - * Modify form controls when the "NULL" checkbox is checked - * - * @param theType string the MySQL field type - * @param urlField string the urlencoded field name - OBSOLETE - * @param md5Field string the md5 hashed field name - * @param multi_edit string the multi_edit row sequence number - * - * @return boolean always true - */ -function nullify(theType, urlField, md5Field, multi_edit) -{ - var rowForm = document.forms.insertForm; - - if (typeof(rowForm.elements['funcs' + multi_edit + '[' + md5Field + ']']) != 'undefined') { - rowForm.elements['funcs' + multi_edit + '[' + md5Field + ']'].selectedIndex = -1; - } - - // "ENUM" field with more than 20 characters - if (theType == 1) { - rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'][1].selectedIndex = -1; - } - // Other "ENUM" field - else if (theType == 2) { - var elts = rowForm.elements['fields' + multi_edit + '[' + md5Field + ']']; - // when there is just one option in ENUM: - if (elts.checked) { - elts.checked = false; - } else { - var elts_cnt = elts.length; - for (var i = 0; i < elts_cnt; i++) { - elts[i].checked = false; - } // end for - - } // end if - } - // "SET" field - else if (theType == 3) { - rowForm.elements['fields' + multi_edit + '[' + md5Field + '][]'].selectedIndex = -1; - } - // Foreign key field (drop-down) - else if (theType == 4) { - rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'].selectedIndex = -1; - } - // foreign key field (with browsing icon for foreign values) - else if (theType == 6) { - rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'].value = ''; - } - // Other field types - else /*if (theType == 5)*/ { - rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'].value = ''; - } // end if... else if... else - - return true; -} // end of the 'nullify()' function - - -/** - * javascript DateTime format validation. - * its used to prevent adding default (0000-00-00 00:00:00) to database when user enter wrong values - * Start of validation part - */ -//function checks the number of days in febuary -function daysInFebruary(year) -{ - return (((year % 4 === 0) && (((year % 100 !== 0)) || (year % 400 === 0))) ? 29 : 28); -} -//function to convert single digit to double digit -function fractionReplace(num) -{ - num = parseInt(num, 10); - return num >= 1 && num <= 9 ? '0' + num : '00'; -} - -/* function to check the validity of date -* The following patterns are accepted in this validation (accepted in mysql as well) -* 1) 2001-12-23 -* 2) 2001-1-2 -* 3) 02-12-23 -* 4) And instead of using '-' the following punctuations can be used (+,.,*,^,@,/) All these are accepted by mysql as well. Therefore no issues -*/ -function isDate(val, tmstmp) -{ - val = val.replace(/[.|*|^|+|//|@]/g, '-'); - var arrayVal = val.split("-"); - for (var a = 0; a < arrayVal.length; a++) { - if (arrayVal[a].length == 1) { - arrayVal[a] = fractionReplace(arrayVal[a]); - } - } - val = arrayVal.join("-"); - var pos = 2; - var dtexp = new RegExp(/^([0-9]{4})-(((01|03|05|07|08|10|12)-((0[0-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)-((0[0-9])|([1-2][0-9])|30))|((00)-(00)))$/); - if (val.length == 8) { - pos = 0; - } - if (dtexp.test(val)) { - var month = parseInt(val.substring(pos + 3, pos + 5), 10); - var day = parseInt(val.substring(pos + 6, pos + 8), 10); - var year = parseInt(val.substring(0, pos + 2), 10); - if (month == 2 && day > daysInFebruary(year)) { - return false; - } - if (val.substring(0, pos + 2).length == 2) { - year = parseInt("20" + val.substring(0, pos + 2), 10); - } - if (tmstmp === true) { - if (year < 1978) { - return false; - } - if (year > 2038 || (year > 2037 && day > 19 && month >= 1) || (year > 2037 && month > 1)) { - return false; - } - } - } else { - return false; - } - return true; -} - -/* function to check the validity of time -* The following patterns are accepted in this validation (accepted in mysql as well) -* 1) 2:3:4 -* 2) 2:23:43 -* 3) 2:23:43.123456 -*/ -function isTime(val) -{ - var arrayVal = val.split(":"); - for (var a = 0, l = arrayVal.length; a < l; a++) { - if (arrayVal[a].length == 1) { - arrayVal[a] = fractionReplace(arrayVal[a]); - } - } - val = arrayVal.join(":"); - var tmexp = new RegExp(/^(-)?(([0-7]?[0-9][0-9])|(8[0-2][0-9])|(83[0-8])):((0[0-9])|([1-5][0-9])):((0[0-9])|([1-5][0-9]))(\.[0-9]{1,6}){0,1}$/); - return tmexp.test(val); -} - -/** - * To check whether insert section is ignored or not - */ -function checkForCheckbox(multi_edit) -{ - if($("#insert_ignore_"+multi_edit).length) { - return $("#insert_ignore_"+multi_edit).is(":unchecked"); - } - return true; -} - -function verificationsAfterFieldChange(urlField, multi_edit, theType) -{ - var evt = window.event || arguments.callee.caller.arguments[0]; - var target = evt.target || evt.srcElement; - var $this_input = $(":input[name^='fields[multi_edit][" + multi_edit + "][" + - urlField + "]']"); - // the function drop-down that corresponds to this input field - var $this_function = $("select[name='funcs[multi_edit][" + multi_edit + "][" + - urlField + "]']"); - var function_selected = false; - if (typeof $this_function.val() !== 'undefined' && - $this_function.val() !== null && - $this_function.val().length > 0 - ) { - function_selected = true; - } - - //To generate the textbox that can take the salt - var new_salt_box = "
"; - - //If encrypting or decrypting functions that take salt as input is selected append the new textbox for salt - if (target.value === 'AES_ENCRYPT' || - target.value === 'AES_DECRYPT' || - target.value === 'DES_ENCRYPT' || - target.value === 'DES_DECRYPT' || - target.value === 'ENCRYPT') { - if (!($("#salt_" + target.id).length)) { - $this_input.after(new_salt_box); - } - } else { - //Remove the textbox for salt - $('#salt_' + target.id).prev('br').remove(); - $("#salt_" + target.id).remove(); - } - - if (target.value === 'AES_DECRYPT' - || target.value === 'AES_ENCRYPT' - || target.value === 'MD5') { - $('#' + target.id).rules("add", { - validationFunctionForFuns: { - param: $this_input, - depends: function() { - return checkForCheckbox(multi_edit); - } - } - }); - } - - // Unchecks the corresponding "NULL" control - $("input[name='fields_null[multi_edit][" + multi_edit + "][" + urlField + "]']").prop('checked', false); - - // Unchecks the Ignore checkbox for the current row - $("input[name='insert_ignore_" + multi_edit + "']").prop('checked', false); - - var charExceptionHandling; - if (theType.substring(0,4) === "char") { - charExceptionHandling = theType.substring(5,6); - } - else if (theType.substring(0,7) === "varchar") { - charExceptionHandling = theType.substring(8,9); - } - if (function_selected) { - $this_input.removeAttr('min'); - $this_input.removeAttr('max'); - // @todo: put back attributes if corresponding function is deselected - } - - if ($this_input.data('rulesadded') == null && ! function_selected) { - - //call validate before adding rules - $($this_input[0].form).validate(); - // validate for date time - if (theType == "datetime" || theType == "time" || theType == "date" || theType == "timestamp") { - $this_input.rules("add", { - validationFunctionForDateTime: { - param: theType, - depends: function() { - return checkForCheckbox(multi_edit); - } - } - }); - } - //validation for integer type - if ($this_input.data('type') === 'INT') { - var mini = parseInt($this_input.attr('min')); - var maxi = parseInt($this_input.attr('max')); - $this_input.rules("add", { - number: { - param : true, - depends: function() { - return checkForCheckbox(multi_edit); - } - }, - min: { - param: mini, - depends: function() { - if (isNaN($this_input.val())) { - return false; - } else { - return checkForCheckbox(multi_edit); - } - } - }, - max: { - param: maxi, - depends: function() { - if (isNaN($this_input.val())) { - return false; - } else { - return checkForCheckbox(multi_edit); - } - } - } - }); - //validation for CHAR types - } else if ($this_input.data('type') === 'CHAR') { - var maxlen = $this_input.data('maxlength'); - if (typeof maxlen !== 'undefined') { - if (maxlen <=4) { - maxlen=charExceptionHandling; - } - $this_input.rules("add", { - maxlength: { - param: maxlen, - depends: function() { - return checkForCheckbox(multi_edit); - } - } - }); - } - // validate binary & blob types - } else if ($this_input.data('type') === 'HEX') { - $this_input.rules("add", { - validationFunctionForHex: { - param: true, - depends: function() { - return checkForCheckbox(multi_edit); - } - } - }); - } - $this_input.data('rulesadded', true); - } else if ($this_input.data('rulesadded') == true && function_selected) { - // remove any rules added - $this_input.rules("remove"); - // remove any error messages - $this_input - .removeClass('error') - .removeAttr('aria-invalid') - .siblings('.error') - .remove(); - $this_input.data('rulesadded', null); - } -} -/* End of fields validation*/ - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('tbl_change.js', function () { - $(document).off('click', 'span.open_gis_editor'); - $(document).off('click', "input[name^='insert_ignore_']"); - $(document).off('click', "input[name='gis_data[save]']"); - $(document).off('click', 'input.checkbox_null'); - $('select[name="submit_type"]').unbind('change'); - $(document).off('change', "#insert_rows"); -}); - -/** - * Ajax handlers for Change Table page - * - * Actions Ajaxified here: - * Submit Data to be inserted into the table. - * Restart insertion with 'N' rows. - */ -AJAX.registerOnload('tbl_change.js', function () { - - if($("#insertForm").length) { - // validate the comment form when it is submitted - $("#insertForm").validate(); - jQuery.validator.addMethod("validationFunctionForHex", function(value, element) { - return value.match(/^[a-f0-9]*$/i) !== null; - }); - - jQuery.validator.addMethod("validationFunctionForFuns", function(value, element, options) { - if (value.substring(0, 3) === "AES" && options.data('type') !== 'HEX') { - return false; - } - - return !(value.substring(0, 3) === "MD5" && - typeof options.data('maxlength') !== 'undefined' && - options.data('maxlength') < 32); - }); - - jQuery.validator.addMethod("validationFunctionForDateTime", function(value, element, options) { - var dt_value = value; - var theType = options; - if (theType == "date") { - return isDate(dt_value); - - } else if (theType == "time") { - return isTime(dt_value); - - } else if (theType == "datetime" || theType == "timestamp") { - var tmstmp = false; - dt_value = dt_value.trim(); - if (dt_value == "CURRENT_TIMESTAMP") { - return true; - } - if (theType == "timestamp") { - tmstmp = true; - } - if (dt_value == "0000-00-00 00:00:00") { - return true; - } - var dv = dt_value.indexOf(" "); - if (dv == -1) { // Only the date component, which is valid - return isDate(dt_value, tmstmp); - } - - return isDate(dt_value.substring(0, dv), tmstmp) && - isTime(dt_value.substring(dv + 1)); - } - }); - /* - * message extending script must be run - * after initiation of functions - */ - extendingValidatorMessages(); - } - - $.datepicker.initialized = false; - - $(document).on('click', 'span.open_gis_editor', function (event) { - event.preventDefault(); - - var $span = $(this); - // Current value - var value = $span.parent('td').children("input[type='text']").val(); - // Field name - var field = $span.parents('tr').children('td:first').find("input[type='hidden']").val(); - // Column type - var type = $span.parents('tr').find('span.column_type').text(); - // Names of input field and null checkbox - var input_name = $span.parent('td').children("input[type='text']").attr('name'); - //Token - var token = $("input[name='token']").val(); - - openGISEditor(); - if (!gisEditorLoaded) { - loadJSAndGISEditor(value, field, type, input_name, token); - } else { - loadGISEditor(value, field, type, input_name, token); - } - }); - - /** - * Forced validation check of fields - */ - $(document).on('click',"input[name^='insert_ignore_']", function (event) { - $("#insertForm").valid(); - }); - - /** - * Uncheck the null checkbox as geometry data is placed on the input field - */ - $(document).on('click', "input[name='gis_data[save]']", function (event) { - var input_name = $('form#gis_data_editor_form').find("input[name='input_name']").val(); - var $null_checkbox = $("input[name='" + input_name + "']").parents('tr').find('.checkbox_null'); - $null_checkbox.prop('checked', false); - }); - - /** - * Handles all current checkboxes for Null; this only takes care of the - * checkboxes on currently displayed rows as the rows generated by - * "Continue insertion" are handled in the "Continue insertion" code - * - */ - $(document).on('click', 'input.checkbox_null', function () { - nullify( - // use hidden fields populated by tbl_change.php - $(this).siblings('.nullify_code').val(), - $(this).closest('tr').find('input:hidden').first().val(), - $(this).siblings('.hashed_field').val(), - $(this).siblings('.multi_edit').val() - ); - }); - - /** - * Reset the auto_increment column to 0 when selecting any of the - * insert options in submit_type-dropdown. Only perform the reset - * when we are in edit-mode, and not in insert-mode(no previous value - * available). - */ - $('select[name="submit_type"]').bind('change', function () { - var thisElemSubmitTypeVal = $(this).val(); - var $table = $('table.insertRowTable'); - var auto_increment_column = $table.find('input[name^="auto_increment"]'); - auto_increment_column.each(function () { - var $thisElemAIField = $(this); - var thisElemName = $thisElemAIField.attr('name'); - - var prev_value_field = $table.find('input[name="' + thisElemName.replace('auto_increment', 'fields_prev') + '"]'); - var value_field = $table.find('input[name="' + thisElemName.replace('auto_increment', 'fields') + '"]'); - var previous_value = $(prev_value_field).val(); - if (previous_value !== undefined) { - if (thisElemSubmitTypeVal == 'insert' - || thisElemSubmitTypeVal == 'insertignore' - || thisElemSubmitTypeVal == 'showinsert' - ) { - $(value_field).val(0); - } else { - $(value_field).val(previous_value); - } - } - }); - - }); - - /** - * Continue Insertion form - */ - $(document).on('change', "#insert_rows", function (event) { - event.preventDefault(); - /** - * @var columnCount Number of number of columns table has. - */ - var columnCount = $("table.insertRowTable:first").find("tr").has("input[name*='fields_name']").length; - /** - * @var curr_rows Number of current insert rows already on page - */ - var curr_rows = $("table.insertRowTable").length; - /** - * @var target_rows Number of rows the user wants - */ - var target_rows = $("#insert_rows").val(); - - // remove all datepickers - $('input.datefield, input.datetimefield').each(function () { - $(this).datepicker('destroy'); - }); - - if (curr_rows < target_rows) { - - var tempIncrementIndex = function () { - - var $this_element = $(this); - /** - * Extract the index from the name attribute for all input/select fields and increment it - * name is of format funcs[multi_edit][10][] - */ - - /** - * @var this_name String containing name of the input/select elements - */ - var this_name = $this_element.attr('name'); - /** split {@link this_name} at [10], so we have the parts that can be concatenated later */ - var name_parts = this_name.split(/\[\d+\]/); - /** extract the [10] from {@link name_parts} */ - var old_row_index_string = this_name.match(/\[\d+\]/)[0]; - /** extract 10 - had to split into two steps to accomodate double digits */ - var old_row_index = parseInt(old_row_index_string.match(/\d+/)[0], 10); - - /** calculate next index i.e. 11 */ - new_row_index = old_row_index + 1; - /** generate the new name i.e. funcs[multi_edit][11][foobarbaz] */ - var new_name = name_parts[0] + '[' + new_row_index + ']' + name_parts[1]; - - var hashed_field = name_parts[1].match(/\[(.+)\]/)[1]; - $this_element.attr('name', new_name); - - /** If element is select[name*='funcs'], update id */ - if ($this_element.is("select[name*='funcs']")) { - var this_id = $this_element.attr("id"); - var id_parts = this_id.split(/\_/); - var old_id_index = id_parts[1]; - var prevSelectedValue = $("#field_" + old_id_index + "_1").val(); - var new_id_index = parseInt(old_id_index) + columnCount; - var new_id = 'field_' + new_id_index + '_1'; - $this_element.attr('id', new_id); - $this_element.find("option").filter(function () { - return $(this).text() === prevSelectedValue; - }).attr("selected","selected"); - - // If salt field is there then update its id. - var nextSaltInput = $this_element.parent().next("td").next("td").find("input[name*='salt']"); - if (nextSaltInput.length !== 0) { - nextSaltInput.attr("id", "salt_" + new_id); - } - } - - // handle input text fields and textareas - if ($this_element.is('.textfield') || $this_element.is('.char') || $this_element.is('textarea')) { - // do not remove the 'value' attribute for ENUM columns - // special handling for radio fields after updating ids to unique - see below - if ($this_element.closest('tr').find('span.column_type').html() != 'enum') { - $this_element.val($this_element.closest('tr').find('span.default_value').html()); - } - $this_element - .unbind('change') - // Remove onchange attribute that was placed - // by tbl_change.php; it refers to the wrong row index - .attr('onchange', null) - // Keep these values to be used when the element - // will change - .data('hashed_field', hashed_field) - .data('new_row_index', new_row_index) - .bind('change', function () { - var $changed_element = $(this); - verificationsAfterFieldChange( - $changed_element.data('hashed_field'), - $changed_element.data('new_row_index'), - $changed_element.closest('tr').find('span.column_type').html() - ); - }); - } - - if ($this_element.is('.checkbox_null')) { - $this_element - // this event was bound earlier by jQuery but - // to the original row, not the cloned one, so unbind() - .unbind('click') - // Keep these values to be used when the element - // will be clicked - .data('hashed_field', hashed_field) - .data('new_row_index', new_row_index) - .bind('click', function () { - var $changed_element = $(this); - nullify( - $changed_element.siblings('.nullify_code').val(), - $this_element.closest('tr').find('input:hidden').first().val(), - $changed_element.data('hashed_field'), - '[multi_edit][' + $changed_element.data('new_row_index') + ']' - ); - }); - } - }; - - var tempReplaceAnchor = function () { - var $anchor = $(this); - var new_value = 'rownumber=' + new_row_index; - // needs improvement in case something else inside - // the href contains this pattern - var new_href = $anchor.attr('href').replace(/rownumber=\d+/, new_value); - $anchor.attr('href', new_href); - }; - - while (curr_rows < target_rows) { - - /** - * @var $last_row Object referring to the last row - */ - var $last_row = $("#insertForm").find(".insertRowTable:last"); - - // need to access this at more than one level - // (also needs improvement because it should be calculated - // just once per cloned row, not once per column) - var new_row_index = 0; - - //Clone the insert tables - $last_row - .clone(true, true) - .insertBefore("#actions_panel") - .find('input[name*=multi_edit],select[name*=multi_edit],textarea[name*=multi_edit]') - .each(tempIncrementIndex) - .end() - .find('.foreign_values_anchor') - .each(tempReplaceAnchor); - - //Insert/Clone the ignore checkboxes - if (curr_rows == 1) { - $('') - .insertBefore("table.insertRowTable:last") - .after(''); - } else { - - /** - * @var $last_checkbox Object reference to the last checkbox in #insertForm - */ - var $last_checkbox = $("#insertForm").children('input:checkbox:last'); - - /** name of {@link $last_checkbox} */ - var last_checkbox_name = $last_checkbox.attr('name'); - /** index of {@link $last_checkbox} */ - var last_checkbox_index = parseInt(last_checkbox_name.match(/\d+/), 10); - /** name of new {@link $last_checkbox} */ - var new_name = last_checkbox_name.replace(/\d+/, last_checkbox_index + 1); - - $('
') - .insertBefore("table.insertRowTable:last"); - - $last_checkbox - .clone() - .attr({'id': new_name, 'name': new_name}) - .prop('checked', true) - .insertBefore("table.insertRowTable:last"); - - $('label[for^=insert_ignore]:last') - .clone() - .attr('for', new_name) - .insertBefore("table.insertRowTable:last"); - - $('
') - .insertBefore("table.insertRowTable:last"); - } - curr_rows++; - } - // recompute tabindex for text fields and other controls at footer; - // IMO it's not really important to handle the tabindex for - // function and Null - var tabindex = 0; - $('.textfield, .char, textarea') - .each(function () { - tabindex++; - $(this).attr('tabindex', tabindex); - // update the IDs of textfields to ensure that they are unique - $(this).attr('id', "field_" + tabindex + "_3"); - - // special handling for radio fields after updating ids to unique - if ($(this).closest('tr').find('span.column_type').html() === 'enum') { - if ($(this).val() === $(this).closest('tr').find('span.default_value').html()) { - $(this).prop('checked', true); - } else { - $(this).prop('checked', false); - } - } - }); - $('.control_at_footer') - .each(function () { - tabindex++; - $(this).attr('tabindex', tabindex); - }); - } else if (curr_rows > target_rows) { - while (curr_rows > target_rows) { - $("input[id^=insert_ignore]:last") - .nextUntil("fieldset") - .addBack() - .remove(); - curr_rows--; - } - } - // Add all the required datepickers back - addDateTimePicker(); - }); -}); - -function changeValueFieldType(elem, searchIndex) -{ - var fieldsValue = $("select#fieldID_" + searchIndex); - if (0 === fieldsValue.size()) { - return; - } - - var type = $(elem).val(); - if ('IN (...)' == type || - 'NOT IN (...)' == type || - 'BETWEEN' == type || - 'NOT BETWEEN' == type - ) { - $("#fieldID_" + searchIndex).attr('multiple', ''); - } else { - $("#fieldID_" + searchIndex).removeAttr('multiple'); - } -} diff --git a/#pma/js/tbl_chart.js b/#pma/js/tbl_chart.js deleted file mode 100644 index 41ff2964..00000000 --- a/#pma/js/tbl_chart.js +++ /dev/null @@ -1,415 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ - -var chart_data = {}; -var temp_chart_title; - -var currentChart = null; -var currentSettings = null; - -var dateTimeCols = []; -var numericCols = []; - -function extractDate(dateString) { - var matches, match; - var dateTimeRegExp = /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/; - var dateRegExp = /[0-9]{4}-[0-9]{2}-[0-9]{2}/; - - matches = dateTimeRegExp.exec(dateString); - if (matches !== null && matches.length > 0) { - match = matches[0]; - return new Date(match.substr(0, 4), parseInt(match.substr(5, 2), 10) - 1, match.substr(8, 2), match.substr(11, 2), match.substr(14, 2), match.substr(17, 2)); - } else { - matches = dateRegExp.exec(dateString); - if (matches !== null && matches.length > 0) { - match = matches[0]; - return new Date(match.substr(0, 4), parseInt(match.substr(5, 2), 10) - 1, match.substr(8, 2)); - } - } - return null; -} - -function PMA_queryChart(data, columnNames, settings) { - if ($('#querychart').length === 0) { - return; - } - - var plotSettings = { - title : { - text : settings.title, - escapeHtml: true - }, - grid : { - drawBorder : false, - shadow : false, - background : 'rgba(0,0,0,0)' - }, - legend : { - show : true, - placement : 'outsideGrid', - location : 'e' - }, - axes : { - xaxis : { - label : escapeHtml(settings.xaxisLabel) - }, - yaxis : { - label : settings.yaxisLabel - } - }, - stackSeries : settings.stackSeries - }; - - // create the chart - var factory = new JQPlotChartFactory(); - var chart = factory.createChart(settings.type, "querychart"); - - // create the data table and add columns - var dataTable = new DataTable(); - if (settings.type == 'timeline') { - dataTable.addColumn(ColumnType.DATE, columnNames[settings.mainAxis]); - } else if (settings.type == 'scatter') { - dataTable.addColumn(ColumnType.NUMBER, columnNames[settings.mainAxis]); - } else { - dataTable.addColumn(ColumnType.STRING, columnNames[settings.mainAxis]); - } - - var i; - if (settings.seriesColumn === null) { - $.each(settings.selectedSeries, function (index, element) { - dataTable.addColumn(ColumnType.NUMBER, columnNames[element]); - }); - - // set data to the data table - var columnsToExtract = [ settings.mainAxis ]; - $.each(settings.selectedSeries, function (index, element) { - columnsToExtract.push(element); - }); - var values = [], newRow, row, col; - for (i = 0; i < data.length; i++) { - row = data[i]; - newRow = []; - for (var j = 0; j < columnsToExtract.length; j++) { - col = columnNames[columnsToExtract[j]]; - if (j === 0) { - if (settings.type == 'timeline') { // first column is date type - newRow.push(extractDate(row[col])); - } else if (settings.type == 'scatter') { - newRow.push(parseFloat(row[col])); - } else { // first column is string type - newRow.push(row[col]); - } - } else { // subsequent columns are of type, number - newRow.push(parseFloat(row[col])); - } - } - values.push(newRow); - } - dataTable.setData(values); - } else { - var seriesNames = {}, seriesNumber = 1; - var seriesColumnName = columnNames[settings.seriesColumn]; - for (i = 0; i < data.length; i++) { - if (! seriesNames[data[i][seriesColumnName]]) { - seriesNames[data[i][seriesColumnName]] = seriesNumber; - seriesNumber++; - } - } - - $.each(seriesNames, function (seriesName, seriesNumber) { - dataTable.addColumn(ColumnType.NUMBER, seriesName); - }); - - var valueMap = {}, xValue, value; - var mainAxisName = columnNames[settings.mainAxis]; - var valueColumnName = columnNames[settings.valueColumn]; - for (i = 0; i < data.length; i++) { - xValue = data[i][mainAxisName]; - value = valueMap[xValue]; - if (! value) { - value = [xValue]; - valueMap[xValue] = value; - } - seriesNumber = seriesNames[data[i][seriesColumnName]]; - value[seriesNumber] = parseFloat(data[i][valueColumnName]); - } - - var values = []; - $.each(valueMap, function(index, value) { - values.push(value); - }); - dataTable.setData(values); - } - - // draw the chart and return the chart object - chart.draw(dataTable, plotSettings); - return chart; -} - -function drawChart() { - currentSettings.width = $('#resizer').width() - 20; - currentSettings.height = $('#resizer').height() - 20; - - // TODO: a better way using .redraw() ? - if (currentChart !== null) { - currentChart.destroy(); - } - - var columnNames = []; - $('select[name="chartXAxis"] option').each(function () { - columnNames.push(escapeHtml($(this).text())); - }); - try { - currentChart = PMA_queryChart(chart_data, columnNames, currentSettings); - if (currentChart != null) { - $('#saveChart').attr('href', currentChart.toImageString()); - } - } catch (err) { - PMA_ajaxShowMessage(err.message, false); - } -} - -function getSelectedSeries() { - var val = $('select[name="chartSeries"]').val() || []; - var ret = []; - $.each(val, function (i, v) { - ret.push(parseInt(v, 10)); - }); - return ret; -} - -function onXAxisChange() { - var $xAxisSelect = $('select[name="chartXAxis"]'); - currentSettings.mainAxis = parseInt($xAxisSelect.val(), 10); - if (dateTimeCols.indexOf(currentSettings.mainAxis) != -1) { - $('span.span_timeline').show(); - } else { - $('span.span_timeline').hide(); - if (currentSettings.type == 'timeline') { - $('input#radio_line').prop('checked', true); - currentSettings.type = 'line'; - } - } - if (numericCols.indexOf(currentSettings.mainAxis) != -1) { - $('span.span_scatter').show(); - } else { - $('span.span_scatter').hide(); - if (currentSettings.type == 'scatter') { - $('input#radio_line').prop('checked', true); - currentSettings.type = 'line'; - } - } - var xaxis_title = $xAxisSelect.children('option:selected').text(); - $('input[name="xaxis_label"]').val(xaxis_title); - currentSettings.xaxisLabel = xaxis_title; -} - -function onDataSeriesChange() { - var $seriesSelect = $('select[name="chartSeries"]'); - currentSettings.selectedSeries = getSelectedSeries(); - var yaxis_title; - if (currentSettings.selectedSeries.length == 1) { - $('span.span_pie').show(); - yaxis_title = $seriesSelect.children('option:selected').text(); - } else { - $('span.span_pie').hide(); - if (currentSettings.type == 'pie') { - $('input#radio_line').prop('checked', true); - currentSettings.type = 'line'; - } - yaxis_title = PMA_messages.strYValues; - } - $('input[name="yaxis_label"]').val(yaxis_title); - currentSettings.yaxisLabel = yaxis_title; -} - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('tbl_chart.js', function () { - $('input[name="chartType"]').unbind('click'); - $('input[name="barStacked"]').unbind('click'); - $('input[name="chkAlternative"]').unbind('click'); - $('input[name="chartTitle"]').unbind('focus').unbind('keyup').unbind('blur'); - $('select[name="chartXAxis"]').unbind('change'); - $('select[name="chartSeries"]').unbind('change'); - $('select[name="chartSeriesColumn"]').unbind('change'); - $('select[name="chartValueColumn"]').unbind('change'); - $('input[name="xaxis_label"]').unbind('keyup'); - $('input[name="yaxis_label"]').unbind('keyup'); - $('#resizer').unbind('resizestop'); - $('#tblchartform').unbind('submit'); -}); - -AJAX.registerOnload('tbl_chart.js', function () { - - // handle manual resize - $('#resizer').bind('resizestop', function (event, ui) { - // make room so that the handle will still appear - $('#querychart').height($('#resizer').height() * 0.96); - $('#querychart').width($('#resizer').width() * 0.96); - if (currentChart !== null) { - currentChart.redraw({ - resetAxes : true - }); - } - }); - - // handle chart type changes - $('input[name="chartType"]').click(function () { - var type = currentSettings.type = $(this).val(); - if (type == 'bar' || type == 'column' || type == 'area') { - $('span.barStacked').show(); - } else { - $('input[name="barStacked"]').prop('checked', false); - $.extend(true, currentSettings, {stackSeries : false}); - $('span.barStacked').hide(); - } - drawChart(); - }); - - // handle chosing alternative data format - $('input[name="chkAlternative"]').click(function () { - var $seriesColumn = $('select[name="chartSeriesColumn"]'); - var $valueColumn = $('select[name="chartValueColumn"]'); - var $chartSeries = $('select[name="chartSeries"]'); - if ($(this).is(':checked')) { - $seriesColumn.prop('disabled', false); - $valueColumn.prop('disabled', false); - $chartSeries.prop('disabled', true); - currentSettings.seriesColumn = parseInt($seriesColumn.val(), 10); - currentSettings.valueColumn = parseInt($valueColumn.val(), 10); - } else { - $seriesColumn.prop('disabled', true); - $valueColumn.prop('disabled', true); - $chartSeries.prop('disabled', false); - currentSettings.seriesColumn = null; - currentSettings.valueColumn = null; - } - drawChart(); - }); - - // handle stacking for bar, column and area charts - $('input[name="barStacked"]').click(function () { - if ($(this).is(':checked')) { - $.extend(true, currentSettings, {stackSeries : true}); - } else { - $.extend(true, currentSettings, {stackSeries : false}); - } - drawChart(); - }); - - // handle changes in chart title - $('input[name="chartTitle"]') - .focus(function () { - temp_chart_title = $(this).val(); - }) - .keyup(function () { - currentSettings.title = $('input[name="chartTitle"]').val(); - drawChart(); - }) - .blur(function () { - if ($(this).val() != temp_chart_title) { - drawChart(); - } - }); - - // handle changing the x-axis - $('select[name="chartXAxis"]').change(function () { - onXAxisChange(); - drawChart(); - }); - - // handle changing the selected data series - $('select[name="chartSeries"]').change(function () { - onDataSeriesChange(); - drawChart(); - }); - - // handle changing the series column - $('select[name="chartSeriesColumn"]').change(function () { - currentSettings.seriesColumn = parseInt($(this).val(), 10); - drawChart(); - }); - - // handle changing the value column - $('select[name="chartValueColumn"]').change(function () { - currentSettings.valueColumn = parseInt($(this).val(), 10); - drawChart(); - }); - - // handle manual changes to the chart x-axis labels - $('input[name="xaxis_label"]').keyup(function () { - currentSettings.xaxisLabel = $(this).val(); - drawChart(); - }); - - // handle manual changes to the chart y-axis labels - $('input[name="yaxis_label"]').keyup(function () { - currentSettings.yaxisLabel = $(this).val(); - drawChart(); - }); - - // handler for ajax form submission - $('#tblchartform').submit(function (event) { - - var $form = $(this); - if (codemirror_editor) { - $form[0].elements.sql_query.value = codemirror_editor.getValue(); - } - if (!checkSqlQuery($form[0])) { - return false; - } - - var $msgbox = PMA_ajaxShowMessage(); - PMA_prepareForAjaxRequest($form); - $.post($form.attr('action'), $form.serialize(), function (data) { - if (typeof data !== 'undefined' && - data.success === true && - typeof data.chartData !== 'undefined') { - chart_data = jQuery.parseJSON(data.chartData); - drawChart(); - PMA_ajaxRemoveMessage($msgbox); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }, "json"); // end $.post() - - return false; - }); - - // from jQuery UI - $('#resizer').resizable({ - minHeight: 240, - minWidth: 300 - }) - .width($('#div_view_options').width() - 50) - .trigger('resizestop'); - - currentSettings = { - type : 'line', - width : $('#resizer').width() - 20, - height : $('#resizer').height() - 20, - xaxisLabel : $('input[name="xaxis_label"]').val(), - yaxisLabel : $('input[name="yaxis_label"]').val(), - title : $('input[name="chartTitle"]').val(), - stackSeries : false, - mainAxis : parseInt($('select[name="chartXAxis"]').val(), 10), - selectedSeries : getSelectedSeries(), - seriesColumn : null - }; - - var vals = $('input[name="dateTimeCols"]').val().split(' '); - $.each(vals, function (i, v) { - dateTimeCols.push(parseInt(v, 10)); - }); - - vals = $('input[name="numericCols"]').val().split(' '); - $.each(vals, function (i, v) { - numericCols.push(parseInt(v, 10)); - }); - - onXAxisChange(); - onDataSeriesChange(); - - $("#tblchartform").submit(); -}); diff --git a/#pma/js/tbl_find_replace.js b/#pma/js/tbl_find_replace.js deleted file mode 100644 index c164bac2..00000000 --- a/#pma/js/tbl_find_replace.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('tbl_find_replace.js', function () { - $('#find_replace_form').unbind('submit'); - $('#toggle_find').unbind('click'); -}); - -/** - * Bind events - */ -AJAX.registerOnload('tbl_find_replace.js', function () { - - $('
') - .insertAfter('#find_replace_form') - .hide(); - - $('#toggle_find') - .html(PMA_messages.strHideFindNReplaceCriteria) - .click(function () { - var $link = $(this); - $('#find_replace_form').slideToggle(); - if ($link.text() == PMA_messages.strHideFindNReplaceCriteria) { - $link.text(PMA_messages.strShowFindNReplaceCriteria); - } else { - $link.text(PMA_messages.strHideFindNReplaceCriteria); - } - return false; - }); - - $('#find_replace_form').submit(function (e) { - e.preventDefault(); - var findReplaceForm = $('#find_replace_form'); - PMA_prepareForAjaxRequest(findReplaceForm); - var $msgbox = PMA_ajaxShowMessage(); - $.post(findReplaceForm.attr('action'), findReplaceForm.serialize(), function (data) { - PMA_ajaxRemoveMessage($msgbox); - if (data.success === true) { - $('#toggle_find_div').show(); - $('#toggle_find').click(); - $("#sqlqueryresultsouter").html(data.preview); - } else { - $("#sqlqueryresultsouter").html(data.error); - } - }); - }); -}); diff --git a/#pma/js/tbl_gis_visualization.js b/#pma/js/tbl_gis_visualization.js deleted file mode 100644 index f2216921..00000000 --- a/#pma/js/tbl_gis_visualization.js +++ /dev/null @@ -1,365 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * @fileoverview functions used for visualizing GIS data - * - * @requires jquery - * @requires jquery/jquery.svg.js - * @requires jquery/jquery.mousewheel.js - * @requires jquery/jquery.event.drag-2.2.js - */ - -// Constants -var zoomFactor = 1.5; -var defaultX = 0; -var defaultY = 0; - -// Variables -var x = 0; -var y = 0; -var scale = 1; - -var svg; - -/** - * Zooms and pans the visualization. - */ -function zoomAndPan() -{ - var g = svg.getElementById('groupPanel'); - if (!g) { - return; - } - - g.setAttribute('transform', 'translate(' + x + ', ' + y + ') scale(' + scale + ')'); - var id; - var circle; - $('circle.vector').each(function () { - id = $(this).attr('id'); - circle = svg.getElementById(id); - svg.change(circle, { - r : (3 / scale), - "stroke-width" : (2 / scale) - }); - }); - - var line; - $('polyline.vector').each(function () { - id = $(this).attr('id'); - line = svg.getElementById(id); - svg.change(line, { - "stroke-width" : (2 / scale) - }); - }); - - var polygon; - $('path.vector').each(function () { - id = $(this).attr('id'); - polygon = svg.getElementById(id); - svg.change(polygon, { - "stroke-width" : (0.5 / scale) - }); - }); -} - -/** - * Initially loads either SVG or OSM visualization based on the choice. - */ -function selectVisualization() { - if ($('#choice').prop('checked') !== true) { - $('#openlayersmap').hide(); - } else { - $('#placeholder').hide(); - } -} - -/** - * Adds necessary styles to the div that coontains the openStreetMap. - */ -function styleOSM() { - var $placeholder = $('#placeholder'); - var cssObj = { - 'border' : '1px solid #aaa', - 'width' : $placeholder.width(), - 'height' : $placeholder.height(), - 'float' : 'right' - }; - $('#openlayersmap').css(cssObj); -} - -/** - * Loads the SVG element and make a reference to it. - */ -function loadSVG() { - var $placeholder = $('#placeholder'); - - $placeholder.svg({ - onLoad: function (svg_ref) { - svg = svg_ref; - } - }); - - // Removes the second SVG element unnecessarily added due to the above command - $placeholder.find('svg:nth-child(2)').remove(); -} - -/** - * Adds controllers for zooming and panning. - */ -function addZoomPanControllers() { - var $placeholder = $('#placeholder'); - if ($("#placeholder").find("svg").length > 0) { - var pmaThemeImage = $('#pmaThemeImage').val(); - // add panning arrows - $('').appendTo($placeholder); - $('').appendTo($placeholder); - $('').appendTo($placeholder); - $('').appendTo($placeholder); - // add zooming controls - $('').appendTo($placeholder); - $('').appendTo($placeholder); - $('').appendTo($placeholder); - } -} - -/** - * Resizes the GIS visualization to fit into the space available. - */ -function resizeGISVisualization() { - var $placeholder = $('#placeholder'); - var old_width = $placeholder.width(); - var visWidth = $('#div_view_options').width() - 48; - - // Assign new value for width - $placeholder.width(visWidth); - $('svg').attr('width', visWidth); - - // Assign the offset created due to resizing to defaultX and center the svg. - defaultX = (visWidth - old_width) / 2; - x = defaultX; - y = 0; - scale = 1; -} - -/** - * Initialize the GIS visualization. - */ -function initGISVisualization() { - // Loads either SVG or OSM visualization based on the choice - selectVisualization(); - // Resizes the GIS visualization to fit into the space available - resizeGISVisualization(); - if (typeof OpenLayers !== 'undefined') { - // Configure OpenLayers - OpenLayers._getScriptLocation = function() {return './js/openlayers/';}; - // Adds necessary styles to the div that coontains the openStreetMap - styleOSM(); - // Draws openStreetMap with openLayers - drawOpenLayers(); - } - // Loads the SVG element and make a reference to it - loadSVG(); - // Adds controllers for zooming and panning - addZoomPanControllers(); - zoomAndPan(); -} - -function getRelativeCoords(e) { - var position = $('#placeholder').offset(); - return { - x : e.pageX - position.left, - y : e.pageY - position.top - }; -} - -/** - * Ajax handlers for GIS visualization page - * - * Actions Ajaxified here: - * - * Zooming in and zooming out on mousewheel movement. - * Panning the visualization on dragging. - * Zooming in on double clicking. - * Zooming out on clicking the zoom out button. - * Panning on clicking the arrow buttons. - * Displaying tooltips for GIS objects. - */ - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('tbl_gis_visualization.js', function () { - $(document).off('click', '#choice'); - $(document).off('mousewheel', '#placeholder'); - $(document).off('dragstart', 'svg'); - $(document).off('mouseup', 'svg'); - $(document).off('drag', 'svg'); - $(document).off('dblclick', '#placeholder'); - $(document).off('click', '#zoom_in'); - $(document).off('click', '#zoom_world'); - $(document).off('click', '#zoom_out'); - $(document).off('click', '#left_arrow'); - $(document).off('click', '#right_arrow'); - $(document).off('click', '#up_arrow'); - $(document).off('click', '#down_arrow'); - $('.vector').unbind('mousemove').unbind('mouseout'); -}); - -AJAX.registerOnload('tbl_gis_visualization.js', function () { - - // If we are in GIS visualization, initialize it - if ($('#gis_div').length > 0) { - initGISVisualization(); - } - - if (typeof OpenLayers === 'undefined') { - $('#choice, #labelChoice').hide(); - } - $(document).on('click', '#choice', function () { - if ($(this).prop('checked') === false) { - $('#placeholder').show(); - $('#openlayersmap').hide(); - } else { - $('#placeholder').hide(); - $('#openlayersmap').show(); - } - }); - - $(document).on('mousewheel', '#placeholder', function (event, delta) { - event.preventDefault(); - var relCoords = getRelativeCoords(event); - if (delta > 0) { - //zoom in - scale *= zoomFactor; - // zooming in keeping the position under mouse pointer unmoved. - x = relCoords.x - (relCoords.x - x) * zoomFactor; - y = relCoords.y - (relCoords.y - y) * zoomFactor; - zoomAndPan(); - } else { - //zoom out - scale /= zoomFactor; - // zooming out keeping the position under mouse pointer unmoved. - x = relCoords.x - (relCoords.x - x) / zoomFactor; - y = relCoords.y - (relCoords.y - y) / zoomFactor; - zoomAndPan(); - } - return true; - }); - - var dragX = 0; - var dragY = 0; - - $(document).on('dragstart', 'svg', function (event, dd) { - $('#placeholder').addClass('placeholderDrag'); - dragX = Math.round(dd.offsetX); - dragY = Math.round(dd.offsetY); - }); - - $(document).on('mouseup', 'svg', function (event) { - $('#placeholder').removeClass('placeholderDrag'); - }); - - $(document).on('drag', 'svg', function (event, dd) { - var newX = Math.round(dd.offsetX); - x += newX - dragX; - dragX = newX; - var newY = Math.round(dd.offsetY); - y += newY - dragY; - dragY = newY; - zoomAndPan(); - }); - - $(document).on('dblclick', '#placeholder', function (event) { - scale *= zoomFactor; - // zooming in keeping the position under mouse pointer unmoved. - var relCoords = getRelativeCoords(event); - x = relCoords.x - (relCoords.x - x) * zoomFactor; - y = relCoords.y - (relCoords.y - y) * zoomFactor; - zoomAndPan(); - }); - - $(document).on('click', '#zoom_in', function (e) { - e.preventDefault(); - //zoom in - scale *= zoomFactor; - - var $placeholder = $('#placeholder').find('svg'); - width = $placeholder.attr('width'); - height = $placeholder.attr('height'); - // zooming in keeping the center unmoved. - x = width / 2 - (width / 2 - x) * zoomFactor; - y = height / 2 - (height / 2 - y) * zoomFactor; - zoomAndPan(); - }); - - $(document).on('click', '#zoom_world', function (e) { - e.preventDefault(); - scale = 1; - x = defaultX; - y = defaultY; - zoomAndPan(); - }); - - $(document).on('click', '#zoom_out', function (e) { - e.preventDefault(); - //zoom out - scale /= zoomFactor; - - var $placeholder = $('#placeholder').find('svg'); - width = $placeholder.attr('width'); - height = $placeholder.attr('height'); - // zooming out keeping the center unmoved. - x = width / 2 - (width / 2 - x) / zoomFactor; - y = height / 2 - (height / 2 - y) / zoomFactor; - zoomAndPan(); - }); - - $(document).on('click', '#left_arrow', function (e) { - e.preventDefault(); - x += 100; - zoomAndPan(); - }); - - $(document).on('click', '#right_arrow', function (e) { - e.preventDefault(); - x -= 100; - zoomAndPan(); - }); - - $(document).on('click', '#up_arrow', function (e) { - e.preventDefault(); - y += 100; - zoomAndPan(); - }); - - $(document).on('click', '#down_arrow', function (e) { - e.preventDefault(); - y -= 100; - zoomAndPan(); - }); - - /** - * Detect the mousemove event and show tooltips. - */ - $('.vector').bind('mousemove', function (event) { - var contents = $.trim(escapeHtml($(this).attr('name'))); - $("#tooltip").remove(); - if (contents !== '') { - $('
' + contents + '
').css({ - position : 'absolute', - top : event.pageY + 10, - left : event.pageX + 10, - border : '1px solid #fdd', - padding : '2px', - 'background-color' : '#fee', - opacity : 0.90 - }).appendTo("body").fadeIn(200); - } - }); - - /** - * Detect the mouseout event and hide tooltips. - */ - $('.vector').bind('mouseout', function (event) { - $("#tooltip").remove(); - }); -}); diff --git a/#pma/js/tbl_operations.js b/#pma/js/tbl_operations.js deleted file mode 100644 index a188a968..00000000 --- a/#pma/js/tbl_operations.js +++ /dev/null @@ -1,304 +0,0 @@ -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('tbl_operations.js', function () { - $(document).off('submit', "#copyTable.ajax"); - $(document).off('submit', "#moveTableForm"); - $(document).off('submit', "#tableOptionsForm"); - $(document).off('submit', "#partitionsForm"); - $(document).off('click', "#tbl_maintenance li a.maintain_action.ajax"); - $(document).off('click', "#drop_tbl_anchor.ajax"); - $(document).off('click', "#drop_view_anchor.ajax"); - $(document).off('click', "#truncate_tbl_anchor.ajax"); -}); - -/** - * jQuery coding for 'Table operations'. Used on tbl_operations.php - * Attach Ajax Event handlers for Table operations - */ -AJAX.registerOnload('tbl_operations.js', function () { - /** - *Ajax action for submitting the "Copy table" - **/ - $(document).on('submit', "#copyTable.ajax", function (event) { - event.preventDefault(); - var $form = $(this); - PMA_prepareForAjaxRequest($form); - $.post($form.attr('action'), $form.serialize() + "&submit_copy=Go", function (data) { - if (typeof data !== 'undefined' && data.success === true) { - if ($form.find("input[name='switch_to_new']").prop('checked')) { - PMA_commonParams.set( - 'db', - $form.find("select[name='target_db']").val() - ); - PMA_commonParams.set( - 'table', - $form.find("input[name='new_name']").val() - ); - PMA_commonActions.refreshMain(false, function () { - PMA_ajaxShowMessage(data.message); - }); - } else { - PMA_ajaxShowMessage(data.message); - } - // Refresh navigation when the table is copied - PMA_reloadNavigation(); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }); // end $.post() - });//end of copyTable ajax submit - - /** - *Ajax action for submitting the "Move table" - */ - $(document).on('submit', "#moveTableForm", function (event) { - event.preventDefault(); - var $form = $(this); - var db = $form.find('select[name=target_db]').val(); - var tbl = $form.find('input[name=new_name]').val(); - PMA_prepareForAjaxRequest($form); - $.post($form.attr('action'), $form.serialize() + "&submit_move=1", function (data) { - if (typeof data !== 'undefined' && data.success === true) { - PMA_commonParams.set('db', db); - PMA_commonParams.set('table', tbl); - PMA_commonActions.refreshMain(false, function () { - PMA_ajaxShowMessage(data.message); - }); - // Refresh navigation when the table is copied - PMA_reloadNavigation(); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }); // end $.post() - }); - - /** - * Ajax action for submitting the "Table options" - */ - $(document).on('submit', "#tableOptionsForm", function (event) { - event.preventDefault(); - event.stopPropagation(); - var $form = $(this); - var $tblNameField = $form.find('input[name=new_name]'); - var $tblCollationField = $form.find('select[name=tbl_collation]'); - var collationOrigValue = $('select[name="tbl_collation"] option[selected]').val(); - var $changeAllColumnCollationsCheckBox = $('#checkbox_change_all_collations'); - var question = PMA_messages.strChangeAllColumnCollationsWarning; - - if ($tblNameField.val() !== $tblNameField[0].defaultValue) { - // reload page and navigation if the table has been renamed - PMA_prepareForAjaxRequest($form); - - if ($tblCollationField.val() !== collationOrigValue && $changeAllColumnCollationsCheckBox.is(':checked')) { - $form.PMA_confirm(question, $form.attr('action'), function (url) { - submitOptionsForm(); - }); - } else { - submitOptionsForm(); - } - } else { - - if ($tblCollationField.val() !== collationOrigValue && $changeAllColumnCollationsCheckBox.is(':checked')) { - $form.PMA_confirm(question, $form.attr('action'), function (url) { - $form.removeClass('ajax').submit().addClass('ajax'); - }); - } else { - $form.removeClass('ajax').submit().addClass('ajax'); - } - } - - function submitOptionsForm() { - $.post($form.attr('action'), $form.serialize(), function (data) { - if (typeof data !== 'undefined' && data.success === true) { - PMA_commonParams.set('table', data._params.table); - PMA_commonActions.refreshMain(false, function () { - $('#page_content').html(data.message); - PMA_highlightSQL($('#page_content')); - }); - // Refresh navigation when the table is renamed - PMA_reloadNavigation(); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }); // end $.post() - } - }); - - /** - *Ajax events for actions in the "Table maintenance" - **/ - $(document).on('click', "#tbl_maintenance li a.maintain_action.ajax", function (event) { - event.preventDefault(); - if ($(".sqlqueryresults").length !== 0) { - $(".sqlqueryresults").remove(); - } - if ($(".result_query").length !== 0) { - $(".result_query").remove(); - } - //variables which stores the common attributes - $.post($(this).attr('href'), { ajax_request: 1 }, function (data) { - function scrollToTop() { - $('html, body').animate({ scrollTop: 0 }); - } - var $temp_div; - if (typeof data !== 'undefined' && data.success === true && data.sql_query !== undefined) { - PMA_ajaxShowMessage(data.message); - $("
").prependTo("#page_content"); - $(".sqlqueryresults").html(data.sql_query); - PMA_highlightSQL($('#page_content')); - scrollToTop(); - } else if (typeof data !== 'undefined' && data.success === true) { - var $temp_div = $("
"); - $temp_div.html(data.message); - var $success = $temp_div.find(".result_query .success"); - PMA_ajaxShowMessage($success); - $("
").prependTo("#page_content"); - $(".sqlqueryresults").html(data.message); - PMA_highlightSQL($('#page_content')); - PMA_init_slider(); - $(".sqlqueryresults").children("fieldset,br").remove(); - scrollToTop(); - } else { - $temp_div = $("
"); - $temp_div.html(data.error); - var $error = $temp_div.find("code").addClass("error"); - PMA_ajaxShowMessage($error, false); - } - }); // end $.post() - });//end of table maintenance ajax click - - /** - * Ajax action for submitting the "Partition Maintenance" - * Also, asks for confirmation when DROP partition is submitted - */ - $(document).on('submit', "#partitionsForm", function (event) { - event.preventDefault(); - var $form = $(this); - - function submitPartitionMaintenance() { - var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true'; - PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); - AJAX.source = $form; - $.post($form.attr('action'), submitData, AJAX.responseHandler); - } - - if ($('#partition_operation_DROP').is(':checked')) { - var question = PMA_messages.strDropPartitionWarning; - $form.PMA_confirm(question, $form.attr('action'), function (url) { - submitPartitionMaintenance(); - }); - } else if ($('#partition_operation_TRUNCATE').is(':checked')) { - var question = PMA_messages.strTruncatePartitionWarning; - $form.PMA_confirm(question, $form.attr('action'), function (url) { - submitPartitionMaintenance(); - }); - } else { - submitPartitionMaintenance(); - } - }); - - $(document).on('click', "#drop_tbl_anchor.ajax", function (event) { - event.preventDefault(); - /** - * @var question String containing the question to be asked for confirmation - */ - var question = PMA_messages.strDropTableStrongWarning + ' '; - question += PMA_sprintf( - PMA_messages.strDoYouReally, - 'DROP TABLE ' + escapeHtml(PMA_commonParams.get('table')) - ) + getForeignKeyCheckboxLoader(); - - $(this).PMA_confirm(question, $(this).attr('href'), function (url) { - - var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); - - var params = getJSConfirmCommonParam(this); - - $.post(url, params, function (data) { - if (typeof data !== 'undefined' && data.success === true) { - PMA_ajaxRemoveMessage($msgbox); - // Table deleted successfully, refresh both the frames - PMA_reloadNavigation(); - PMA_commonParams.set('table', ''); - PMA_commonActions.refreshMain( - PMA_commonParams.get('opendb_url'), - function () { - PMA_ajaxShowMessage(data.message); - } - ); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }); // end $.post() - }, loadForeignKeyCheckbox); // end $.PMA_confirm() - }); //end of Drop Table Ajax action - - $(document).on('click', "#drop_view_anchor.ajax", function (event) { - event.preventDefault(); - /** - * @var question String containing the question to be asked for confirmation - */ - var question = PMA_messages.strDropTableStrongWarning + ' '; - question += PMA_sprintf( - PMA_messages.strDoYouReally, - 'DROP VIEW ' + escapeHtml(PMA_commonParams.get('table')) - ); - - $(this).PMA_confirm(question, $(this).attr('href'), function (url) { - - var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); - $.post(url, {'is_js_confirmed': '1', 'ajax_request': true}, function (data) { - if (typeof data !== 'undefined' && data.success === true) { - PMA_ajaxRemoveMessage($msgbox); - // Table deleted successfully, refresh both the frames - PMA_reloadNavigation(); - PMA_commonParams.set('table', ''); - PMA_commonActions.refreshMain( - PMA_commonParams.get('opendb_url'), - function () { - PMA_ajaxShowMessage(data.message); - } - ); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }); // end $.post() - }); // end $.PMA_confirm() - }); //end of Drop View Ajax action - - $(document).on('click', "#truncate_tbl_anchor.ajax", function (event) { - event.preventDefault(); - /** - * @var question String containing the question to be asked for confirmation - */ - var question = PMA_messages.strTruncateTableStrongWarning + ' '; - question += PMA_sprintf( - PMA_messages.strDoYouReally, - 'TRUNCATE ' + escapeHtml(PMA_commonParams.get('table')) - ) + getForeignKeyCheckboxLoader(); - $(this).PMA_confirm(question, $(this).attr('href'), function (url) { - PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); - - var params = getJSConfirmCommonParam(this); - - $.post(url, params, function (data) { - if ($(".sqlqueryresults").length !== 0) { - $(".sqlqueryresults").remove(); - } - if ($(".result_query").length !== 0) { - $(".result_query").remove(); - } - if (typeof data !== 'undefined' && data.success === true) { - PMA_ajaxShowMessage(data.message); - $("
").prependTo("#page_content"); - $(".sqlqueryresults").html(data.sql_query); - PMA_highlightSQL($('#page_content')); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }); // end $.post() - }, loadForeignKeyCheckbox); // end $.PMA_confirm() - }); //end of Truncate Table Ajax action - -}); //end $(document).ready for 'Table operations' diff --git a/#pma/js/tbl_relation.js b/#pma/js/tbl_relation.js deleted file mode 100644 index e6498ee5..00000000 --- a/#pma/js/tbl_relation.js +++ /dev/null @@ -1,234 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * for tbl_relation.php - * - */ -function show_hide_clauses($thisDropdown) -{ - if ($thisDropdown.val() === '') { - $thisDropdown.parent().nextAll('span').hide(); - } else { - if ($thisDropdown.is('select[name^="destination_foreign_column"]')) { - $thisDropdown.parent().nextAll('span').show(); - } - } -} - -/** - * Sets dropdown options to values - */ -function setDropdownValues($dropdown, values, selectedValue) { - $dropdown.empty(); - var optionsAsString = ''; - // add an empty string to the beginning for empty selection - values.unshift(''); - $.each(values, function () { - optionsAsString += ""; - }); - $dropdown.append($(optionsAsString)); -} - -/** - * Retrieves and populates dropdowns to the left based on the selected value - * - * @param $dropdown the dropdown whose value got changed - */ -function getDropdownValues($dropdown) { - var foreignDb = null, foreignTable = null; - var $databaseDd, $tableDd, $columnDd; - var foreign = ''; - // if the changed dropdown is for foreign key constraints - if ($dropdown.is('select[name^="destination_foreign"]')) { - $databaseDd = $dropdown.parent().parent().parent().find('select[name^="destination_foreign_db"]'); - $tableDd = $dropdown.parent().parent().parent().find('select[name^="destination_foreign_table"]'); - $columnDd = $dropdown.parent().parent().parent().find('select[name^="destination_foreign_column"]'); - foreign = '_foreign'; - } else { // internal relations - $databaseDd = $dropdown.parent().find('select[name^="destination_db"]'); - $tableDd = $dropdown.parent().find('select[name^="destination_table"]'); - $columnDd = $dropdown.parent().find('select[name^="destination_column"]'); - } - - // if the changed dropdown is a database selector - if ($dropdown.is('select[name^="destination' + foreign + '_db"]')) { - foreignDb = $dropdown.val(); - // if no database is selected empty table and column dropdowns - if (foreignDb === '') { - setDropdownValues($tableDd, []); - setDropdownValues($columnDd, []); - return; - } - } else { // if a table selector - foreignDb = $databaseDd.val(); - foreignTable = $dropdown.val(); - // if no table is selected empty the column dropdown - if (foreignTable === '') { - setDropdownValues($columnDd, []); - return; - } - } - var $msgbox = PMA_ajaxShowMessage(); - var $form = $dropdown.parents('form'); - var url = 'tbl_relation.php?getDropdownValues=true&ajax_request=true' + - '&token=' + $form.find('input[name="token"]').val() + - '&db=' + $form.find('input[name="db"]').val() + - '&table=' + $form.find('input[name="table"]').val() + - '&foreign=' + (foreign !== '') + - '&foreignDb=' + encodeURIComponent(foreignDb) + - (foreignTable !== null ? - '&foreignTable=' + encodeURIComponent(foreignTable) : '' - ); - var $server = $form.find('input[name="server"]'); - if ($server.length > 0) { - url += '&server=' + $form.find('input[name="server"]').val(); - } - $.ajax({ - url: url, - datatype: 'json', - success: function (data) { - PMA_ajaxRemoveMessage($msgbox); - if (typeof data !== 'undefined' && data.success) { - // if the changed dropdown is a database selector - if (foreignTable === null) { - // set values for table and column dropdowns - setDropdownValues($tableDd, data.tables); - setDropdownValues($columnDd, []); - } else { // if a table selector - // set values for the column dropdown - var primary = null; - if (typeof data.primary !== 'undefined' - && 1 === data.primary.length - ) { - primary = data.primary[0]; - } - setDropdownValues($columnDd, data.columns, primary); - } - } else { - PMA_ajaxShowMessage(data.error, false); - } - } - }); -} - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('tbl_relation.js', function () { - $('body').off('change', - 'select[name^="destination_db"], ' + - 'select[name^="destination_table"], ' + - 'select[name^="destination_foreign_db"], ' + - 'select[name^="destination_foreign_table"]' - ); - $('body').off('click', 'a.add_foreign_key_field'); - $('body').off('click', 'a.add_foreign_key'); - $('a.drop_foreign_key_anchor.ajax').off('click'); -}); - -AJAX.registerOnload('tbl_relation.js', function () { - - /** - * Ajax event handler to fetch table/column dropdown values. - */ - $('body').on('change', - 'select[name^="destination_db"], ' + - 'select[name^="destination_table"], ' + - 'select[name^="destination_foreign_db"], ' + - 'select[name^="destination_foreign_table"]', - function () { - getDropdownValues($(this)); - } - ); - - /** - * Ajax event handler to add a column to a foreign key constraint. - */ - $('body').on('click', 'a.add_foreign_key_field', function (event) { - event.preventDefault(); - event.stopPropagation(); - - // Add field. - $(this) - .prev('span') - .clone(true, true) - .insertBefore($(this)) - .find('select') - .val(''); - - // Add foreign field. - var $source_elem = $('select[name^="destination_foreign_column[' + - $(this).attr('data-index') + ']"]:last').parent(); - $source_elem - .clone(true, true) - .insertAfter($source_elem) - .find('select') - .val(''); - }); - - /** - * Ajax event handler to add a foreign key constraint. - */ - $('body').on('click', 'a.add_foreign_key', function (event) { - event.preventDefault(); - event.stopPropagation(); - - var $prev_row = $(this).closest('tr').prev('tr'); - var odd_even = ($prev_row.attr('class') == 'odd') ? 'even' : 'odd'; - var $new_row = $prev_row.clone(true, true).attr('class', odd_even); - - // Update serial number. - var curr_index = $new_row - .find('a.add_foreign_key_field') - .attr('data-index'); - var new_index = parseInt(curr_index) + 1; - $new_row.find('a.add_foreign_key_field').attr('data-index', new_index); - - // Update form parameter names. - $new_row.find('select[name^="foreign_key_fields_name"]:not(:first), ' + - 'select[name^="destination_foreign_column"]:not(:first)' - ).each(function () { - $(this).parent().remove(); - }); - $new_row.find('input, select').each(function () { - $(this).attr('name', - $(this).attr('name').replace(/\d/, new_index) - ); - }); - - // Finally add the row. - $new_row.insertAfter($prev_row); - }); - - /** - * Ajax Event handler for 'Drop Foreign key' - */ - $('a.drop_foreign_key_anchor.ajax').on('click', function (event) { - event.preventDefault(); - var $anchor = $(this); - - // Object containing reference to the current field's row - var $curr_row = $anchor.parents('tr'); - - var drop_query = escapeHtml( - $curr_row.children('td') - .children('.drop_foreign_key_msg') - .val() - ); - - var question = PMA_sprintf(PMA_messages.strDoYouReally, drop_query); - - $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) { - var $msg = PMA_ajaxShowMessage(PMA_messages.strDroppingForeignKey, false); - $.post(url, {'is_js_confirmed': 1, 'ajax_request': true}, function (data) { - if (data.success === true) { - PMA_ajaxRemoveMessage($msg); - PMA_commonActions.refreshMain(false, function () { - // Do nothing - }); - } else { - PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest + " : " + data.error, false); - } - }); // end $.post() - }); // end $.PMA_confirm() - }); //end Drop Foreign key -}); diff --git a/#pma/js/tbl_select.js b/#pma/js/tbl_select.js deleted file mode 100644 index b035ff24..00000000 --- a/#pma/js/tbl_select.js +++ /dev/null @@ -1,407 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * @fileoverview JavaScript functions used on tbl_select.php - * - * @requires jQuery - * @requires js/functions.js - */ - -/** - * Ajax event handlers for this page - * - * Actions ajaxified here: - * Table search - */ - -/** - * Checks if given data-type is numeric or date. - * - * @param string data_type Column data-type - * - * @return bool|string - */ -function PMA_checkIfDataTypeNumericOrDate(data_type) -{ - // To test for numeric data-types. - var numeric_re = new RegExp( - 'TINYINT|SMALLINT|MEDIUMINT|INT|BIGINT|DECIMAL|FLOAT|DOUBLE|REAL', - 'i' - ); - - // To test for date data-types. - var date_re = new RegExp( - 'DATETIME|DATE|TIMESTAMP|TIME|YEAR', - 'i' - ); - - // Return matched data-type - if (numeric_re.test(data_type)) { - return numeric_re.exec(data_type)[0]; - } - - if (date_re.test(data_type)) { - return date_re.exec(data_type)[0]; - } - - return false; -} - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('tbl_select.js', function () { - $('#togglesearchformlink').unbind('click'); - $(document).off('submit', "#tbl_search_form.ajax"); - $('select.geom_func').unbind('change'); - $(document).off('click', 'span.open_search_gis_editor'); - $('body').off('click', 'select[name*="criteriaColumnOperators"]'); -}); - -AJAX.registerOnload('tbl_select.js', function () { - /** - * Prepare a div containing a link, otherwise it's incorrectly displayed - * after a couple of clicks - */ - $('
') - .insertAfter('#tbl_search_form') - // don't show it until we have results on-screen - .hide(); - - $('#togglesearchformlink') - .html(PMA_messages.strShowSearchCriteria) - .bind('click', function () { - var $link = $(this); - $('#tbl_search_form').slideToggle(); - if ($link.text() == PMA_messages.strHideSearchCriteria) { - $link.text(PMA_messages.strShowSearchCriteria); - } else { - $link.text(PMA_messages.strHideSearchCriteria); - } - // avoid default click action - return false; - }); - - /** - * Ajax event handler for Table search - */ - $(document).on('submit', "#tbl_search_form.ajax", function (event) { - var unaryFunctions = [ - 'IS NULL', - 'IS NOT NULL', - "= ''", - "!= ''" - ]; - - var geomUnaryFunctions = [ - 'IsEmpty', - 'IsSimple', - 'IsRing', - 'IsClosed', - ]; - - // jQuery object to reuse - var $search_form = $(this); - event.preventDefault(); - - // empty previous search results while we are waiting for new results - $("#sqlqueryresultsouter").empty(); - var $msgbox = PMA_ajaxShowMessage(PMA_messages.strSearching, false); - - PMA_prepareForAjaxRequest($search_form); - - var values = {}; - $search_form.find(':input').each(function () { - var $input = $(this); - if ($input.attr('type') == 'checkbox' || $input.attr('type') == 'radio') { - if ($input.is(':checked')) { - values[this.name] = $input.val(); - } - } else { - values[this.name] = $input.val(); - } - }); - var columnCount = $('select[name="columnsToDisplay[]"] option').length; - // Submit values only for the columns that have unary column operator or a search criteria - for (var a = 0; a < columnCount; a++) { - if ($.inArray(values['criteriaColumnOperators[' + a + ']'], unaryFunctions) >= 0) { - continue; - } - - if (values['geom_func[' + a + ']'] && - $.isArray(values['geom_func[' + a + ']'], geomUnaryFunctions) >= 0) { - continue; - } - - if (values['criteriaValues[' + a + ']'] === '' || values['criteriaValues[' + a + ']'] === null) { - delete values['criteriaValues[' + a + ']']; - delete values['criteriaColumnOperators[' + a + ']']; - delete values['criteriaColumnNames[' + a + ']']; - delete values['criteriaColumnTypes[' + a + ']']; - delete values['criteriaColumnCollations[' + a + ']']; - } - } - // If all columns are selected, use a single parameter to indicate that - if (values['columnsToDisplay[]'] !== null) { - if (values['columnsToDisplay[]'].length == columnCount) { - delete values['columnsToDisplay[]']; - values.displayAllColumns = true; - } - } else { - values.displayAllColumns = true; - } - - $.post($search_form.attr('action'), values, function (data) { - PMA_ajaxRemoveMessage($msgbox); - if (typeof data !== 'undefined' && data.success === true) { - if (typeof data.sql_query !== 'undefined') { // zero rows - $("#sqlqueryresultsouter").html(data.sql_query); - } else { // results found - $("#sqlqueryresultsouter").html(data.message); - $(".sqlqueryresults").trigger('makegrid').trigger('stickycolumns'); - } - $('#tbl_search_form') - // workaround for bug #3168569 - Issue on toggling the "Hide search criteria" in chrome. - .slideToggle() - .hide(); - $('#togglesearchformlink') - // always start with the Show message - .text(PMA_messages.strShowSearchCriteria); - $('#togglesearchformdiv') - // now it's time to show the div containing the link - .show(); - // needed for the display options slider in the results - PMA_init_slider(); - $('html, body').animate({scrollTop: 0}, 'fast'); - } else { - $("#sqlqueryresultsouter").html(data.error); - } - PMA_highlightSQL($('#sqlqueryresultsouter')); - }); // end $.post() - }); - - // Following section is related to the 'function based search' for geometry data types. - // Initialy hide all the open_gis_editor spans - $('span.open_search_gis_editor').hide(); - - $('select.geom_func').bind('change', function () { - var $geomFuncSelector = $(this); - - var binaryFunctions = [ - 'Contains', - 'Crosses', - 'Disjoint', - 'Equals', - 'Intersects', - 'Overlaps', - 'Touches', - 'Within', - 'MBRContains', - 'MBRDisjoint', - 'MBREquals', - 'MBRIntersects', - 'MBROverlaps', - 'MBRTouches', - 'MBRWithin', - 'ST_Contains', - 'ST_Crosses', - 'ST_Disjoint', - 'ST_Equals', - 'ST_Intersects', - 'ST_Overlaps', - 'ST_Touches', - 'ST_Within' - ]; - - var tempArray = [ - 'Envelope', - 'EndPoint', - 'StartPoint', - 'ExteriorRing', - 'Centroid', - 'PointOnSurface' - ]; - var outputGeomFunctions = binaryFunctions.concat(tempArray); - - // If the chosen function takes two geometry objects as parameters - var $operator = $geomFuncSelector.parents('tr').find('td:nth-child(5)').find('select'); - if ($.inArray($geomFuncSelector.val(), binaryFunctions) >= 0) { - $operator.prop('readonly', true); - } else { - $operator.prop('readonly', false); - } - - // if the chosen function's output is a geometry, enable GIS editor - var $editorSpan = $geomFuncSelector.parents('tr').find('span.open_search_gis_editor'); - if ($.inArray($geomFuncSelector.val(), outputGeomFunctions) >= 0) { - $editorSpan.show(); - } else { - $editorSpan.hide(); - } - - }); - - $(document).on('click', 'span.open_search_gis_editor', function (event) { - event.preventDefault(); - - var $span = $(this); - // Current value - var value = $span.parent('td').children("input[type='text']").val(); - // Field name - var field = 'Parameter'; - // Column type - var geom_func = $span.parents('tr').find('.geom_func').val(); - var type; - if (geom_func == 'Envelope') { - type = 'polygon'; - } else if (geom_func == 'ExteriorRing') { - type = 'linestring'; - } else { - type = 'point'; - } - // Names of input field and null checkbox - var input_name = $span.parent('td').children("input[type='text']").attr('name'); - //Token - var token = $("input[name='token']").val(); - - openGISEditor(); - if (!gisEditorLoaded) { - loadJSAndGISEditor(value, field, type, input_name, token); - } else { - loadGISEditor(value, field, type, input_name, token); - } - }); - - /** - * Ajax event handler for Range-Search. - */ - $('body').on('click', 'select[name*="criteriaColumnOperators"]', function () { - $source_select = $(this); - // Get the column name. - var column_name = $(this) - .closest('tr') - .find('th:first') - .text(); - - // Get the data-type of column excluding size. - var data_type = $(this) - .closest('tr') - .find('td[data-type]') - .attr('data-type'); - data_type = PMA_checkIfDataTypeNumericOrDate(data_type); - - // Get the operator. - var operator = $(this).val(); - - if ((operator == 'BETWEEN' || operator == 'NOT BETWEEN') - && data_type - ) { - var $msgbox = PMA_ajaxShowMessage(); - $.ajax({ - url: 'tbl_select.php', - type: 'POST', - data: { - token: $('input[name="token"]').val(), - ajax_request: 1, - db: $('input[name="db"]').val(), - table: $('input[name="table"]').val(), - column: column_name, - range_search: 1 - }, - success: function (response) { - PMA_ajaxRemoveMessage($msgbox); - if (response.success) { - // Get the column min value. - var min = response.column_data.min - ? '(' + PMA_messages.strColumnMin + - ' ' + response.column_data.min + ')' - : ''; - // Get the column max value. - var max = response.column_data.max - ? '(' + PMA_messages.strColumnMax + - ' ' + response.column_data.max + ')' - : ''; - var button_options = {}; - button_options[PMA_messages.strGo] = function () { - var min_value = $('#min_value').val(); - var max_value = $('#max_value').val(); - var final_value = ''; - if (min_value.length && max_value.length) { - final_value = min_value + ', ' + - max_value; - } - var $target_field = $source_select.closest('tr') - .find('[name*="criteriaValues"]'); - - // If target field is a select list. - if ($target_field.is('select')) { - $target_field.val(final_value); - var $options = $target_field.find('option'); - var $closest_min = null; - var $closest_max = null; - // Find closest min and max value. - $options.each(function () { - if ( - $closest_min === null - || Math.abs($(this).val() - min_value) < Math.abs($closest_min.val() - min_value) - ) { - $closest_min = $(this); - } - - if ( - $closest_max === null - || Math.abs($(this).val() - max_value) < Math.abs($closest_max.val() - max_value) - ) { - $closest_max = $(this); - } - }); - - $closest_min.attr('selected', 'selected'); - $closest_max.attr('selected', 'selected'); - } else { - $target_field.val(final_value); - } - $(this).dialog("close"); - }; - button_options[PMA_messages.strCancel] = function () { - $(this).dialog("close"); - }; - - // Display dialog box. - $('
').append( - '
' + - '' + operator + '' + - '' + - '' + '
' + - '' + min + '' + '
' + - '' + - '' + '
' + - '' + max + '' + - '
' - ).dialog({ - minWidth: 500, - maxHeight: 400, - modal: true, - buttons: button_options, - title: PMA_messages.strRangeSearch, - open: function () { - // Add datepicker wherever required. - PMA_addDatepicker($('#min_value'), data_type); - PMA_addDatepicker($('#max_value'), data_type); - }, - close: function () { - $(this).remove(); - } - }); - } else { - PMA_ajaxShowMessage(response.error); - } - }, - error: function (response) { - PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest); - } - }); - } - }); -}); diff --git a/#pma/js/tbl_structure.js b/#pma/js/tbl_structure.js deleted file mode 100644 index 279bb42d..00000000 --- a/#pma/js/tbl_structure.js +++ /dev/null @@ -1,515 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * @fileoverview functions used on the table structure page - * @name Table Structure - * - * @requires jQuery - * @requires jQueryUI - * @required js/functions.js - */ - -/** - * AJAX scripts for tbl_structure.php - * - * Actions ajaxified here: - * Drop Column - * Add Primary Key - * Drop Primary Key/Index - * - */ - -/** - * This function returns the horizontal space available for the menu in pixels. - * To calculate this value we start we the width of the main panel, then we - * substract the margin of the page content, then we substract any cellspacing - * that the table may have (original theme only) and finally we substract the - * width of all columns of the table except for the last one (which is where - * the menu will go). What we should end up with is the distance between the - * start of the last column on the table and the edge of the page, again this - * is the space available for the menu. - * - * In the case where the table cell where the menu will be displayed is already - * off-screen (the table is wider than the page), a negative value will be returned, - * but this will be treated as a zero by the menuResizer plugin. - * - * @return int - */ -function PMA_tbl_structure_menu_resizer_callback() { - var pagewidth = $('body').width(); - var $page = $('#page_content'); - pagewidth -= $page.outerWidth(true) - $page.outerWidth(); - var columnsWidth = 0; - var $columns = $('#tablestructure').find('tr:eq(1)').find('td,th'); - $columns.not(':last').each(function () { - columnsWidth += $(this).outerWidth(true); - }); - var totalCellSpacing = $('#tablestructure').width(); - $columns.each(function () { - totalCellSpacing -= $(this).outerWidth(true); - }); - return pagewidth - columnsWidth - totalCellSpacing - 15; // 15px extra margin -} - -/** - * Reload fields table - */ -function reloadFieldForm() { - $.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize() + "&ajax_request=true", function (form_data) { - var $temp_div = $("
").append(form_data.message); - $("#fieldsForm").replaceWith($temp_div.find("#fieldsForm")); - $("#addColumns").replaceWith($temp_div.find("#addColumns")); - $('#move_columns_dialog').find('ul').replaceWith($temp_div.find("#move_columns_dialog ul")); - $("#moveColumns").removeClass("move-active"); - /* reinitialise the more options in table */ - if ($('#fieldsForm').hasClass('HideStructureActions')) { - $('#fieldsForm').find('ul.table-structure-actions').menuResizer(PMA_tbl_structure_menu_resizer_callback); - } - }); - $('#page_content').show(); -} - -function checkFirst() { - if ($("select[name=after_field] option:selected").data('pos') === 'first') { - $("input[name=field_where]").val('first'); - } else { - $("input[name=field_where]").val('after'); - } -} -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('tbl_structure.js', function () { - $(document).off('click', "a.drop_column_anchor.ajax"); - $(document).off('click', "a.add_key.ajax"); - $(document).off('click', "#move_columns_anchor"); - $(document).off('click', "#printView"); - $(document).off('submit', ".append_fields_form.ajax"); - $('body').off('click', '#fieldsForm.ajax button[name="submit_mult"], #fieldsForm.ajax input[name="submit_mult"]'); - $(document).off('click', 'a[name^=partition_action].ajax'); - $(document).off('click', '#remove_partitioning.ajax'); -}); - -AJAX.registerOnload('tbl_structure.js', function () { - - // Re-initialize variables. - primary_indexes = []; - indexes = []; - fulltext_indexes = []; - spatial_indexes = []; - - /** - *Ajax action for submitting the "Column Change" and "Add Column" form - */ - $(".append_fields_form.ajax").off(); - $(document).on('submit', ".append_fields_form.ajax", function (event) { - event.preventDefault(); - /** - * @var the_form object referring to the export form - */ - var $form = $(this); - var field_cnt = $form.find('input[name=orig_num_fields]').val(); - - - function submitForm(){ - $msg = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); - $.post($form.attr('action'), $form.serialize() + '&do_save_data=1', function (data) { - if ($(".sqlqueryresults").length !== 0) { - $(".sqlqueryresults").remove(); - } else if ($(".error:not(.tab)").length !== 0) { - $(".error:not(.tab)").remove(); - } - if (typeof data.success != 'undefined' && data.success === true) { - $("#page_content") - .empty() - .append(data.message) - .show(); - PMA_highlightSQL($('#page_content')); - $(".result_query .notice").remove(); - reloadFieldForm(); - $form.remove(); - PMA_ajaxRemoveMessage($msg); - PMA_init_slider(); - PMA_reloadNavigation(); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }); // end $.post() - } - - function checkIfConfirmRequired($form, $field_cnt) { - var i = 0, id, elm, val, name_orig, elm_orig, val_orig; - var checkRequired = false; - for (i = 0; i < field_cnt; i++) { - id = "#field_" + i + "_5"; - elm = $(id); - val = elm.val(); - - name_orig = "input[name=field_collation_orig\\[" + i + "\\]]"; - elm_orig = $form.find(name_orig); - val_orig = elm_orig.val(); - - if (val && val_orig && val !== val_orig){ - checkRequired = true; - break; - } - } - return checkRequired; - } - - /* - * First validate the form; if there is a problem, avoid submitting it - * - * checkTableEditForm() needs a pure element and not a jQuery object, - * this is why we pass $form[0] as a parameter (the jQuery object - * is actually an array of DOM elements) - */ - if (checkTableEditForm($form[0], field_cnt)) { - // OK, form passed validation step - - PMA_prepareForAjaxRequest($form); - if (PMA_checkReservedWordColumns($form)) { - //User wants to submit the form - - // If Collation is changed, Warn and Confirm - if (checkIfConfirmRequired($form, field_cnt)){ - var question = sprintf( - PMA_messages.strChangeColumnCollation, 'https://wiki.phpmyadmin.net/pma/Garbled_data' - ); - $form.PMA_confirm(question, $form.attr('action'), function (url) { - submitForm(); - }); - } else { - submitForm(); - } - } - } - }); // end change table button "do_save_data" - - /** - * Attach Event Handler for 'Drop Column' - */ - $(document).on('click', "a.drop_column_anchor.ajax", function (event) { - event.preventDefault(); - /** - * @var curr_table_name String containing the name of the current table - */ - var curr_table_name = $(this).closest('form').find('input[name=table]').val(); - /** - * @var curr_row Object reference to the currently selected row (i.e. field in the table) - */ - var $curr_row = $(this).parents('tr'); - /** - * @var curr_column_name String containing name of the field referred to by {@link curr_row} - */ - var curr_column_name = $curr_row.children('th').children('label').text().trim(); - curr_column_name = escapeHtml(curr_column_name); - /** - * @var $after_field_item Corresponding entry in the 'After' field. - */ - var $after_field_item = $("select[name='after_field'] option[value='" + curr_column_name + "']"); - /** - * @var question String containing the question to be asked for confirmation - */ - var question = PMA_sprintf(PMA_messages.strDoYouReally, 'ALTER TABLE `' + escapeHtml(curr_table_name) + '` DROP `' + escapeHtml(curr_column_name) + '`;'); - $(this).PMA_confirm(question, $(this).attr('href'), function (url) { - var $msg = PMA_ajaxShowMessage(PMA_messages.strDroppingColumn, false); - $.post(url, {'is_js_confirmed' : 1, 'ajax_request' : true, 'ajax_page_request' : true}, function (data) { - if (typeof data !== 'undefined' && data.success === true) { - PMA_ajaxRemoveMessage($msg); - if ($('.result_query').length) { - $('.result_query').remove(); - } - if (data.sql_query) { - $('
') - .html(data.sql_query) - .prependTo('#structure_content'); - PMA_highlightSQL($('#page_content')); - } - toggleRowColors($curr_row.next()); - // Adjust the row numbers - for (var $row = $curr_row.next(); $row.length > 0; $row = $row.next()) { - var new_val = parseInt($row.find('td:nth-child(2)').text(), 10) - 1; - $row.find('td:nth-child(2)').text(new_val); - } - $after_field_item.remove(); - $curr_row.hide("medium").remove(); - - // Remove the dropped column from select menu for 'after field' - $("select[name=after_field]").find( - '[value="' + curr_column_name + '"]' - ).remove(); - - // by default select the (new) last option to add new column - // (in case last column is dropped) - $("select[name=after_field] option:last").attr("selected","selected"); - - //refresh table stats - if (data.tableStat) { - $('#tablestatistics').html(data.tableStat); - } - // refresh the list of indexes (comes from sql.php) - $('.index_info').replaceWith(data.indexes_list); - PMA_reloadNavigation(); - } else { - PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest + " : " + data.error, false); - } - }); // end $.post() - }); // end $.PMA_confirm() - }); //end of Drop Column Anchor action - - /** - * Attach Event Handler for 'Print' link - */ - $(document).on('click', "#printView", function (event) { - event.preventDefault(); - - // Take to preview mode - printPreview(); - }); //end of Print View action - - /** - * Ajax Event handler for adding keys - */ - $(document).on('click', "a.add_key.ajax", function (event) { - event.preventDefault(); - - var $this = $(this); - var curr_table_name = $this.closest('form').find('input[name=table]').val(); - var curr_column_name = $this.parents('tr').children('th').children('label').text().trim(); - - var add_clause = ''; - if ($this.is('.add_primary_key_anchor')) { - add_clause = 'ADD PRIMARY KEY'; - } else if ($this.is('.add_index_anchor')) { - add_clause = 'ADD INDEX'; - } else if ($this.is('.add_unique_anchor')) { - add_clause = 'ADD UNIQUE'; - } else if ($this.is('.add_spatial_anchor')) { - add_clause = 'ADD SPATIAL'; - } else if ($this.is('.add_fulltext_anchor')) { - add_clause = 'ADD FULLTEXT'; - } - var question = PMA_sprintf(PMA_messages.strDoYouReally, 'ALTER TABLE `' + - escapeHtml(curr_table_name) + '` ' + add_clause + '(`' + escapeHtml(curr_column_name) + '`);'); - - $(this).PMA_confirm(question, $(this).attr('href'), function (url) { - PMA_ajaxShowMessage(); - AJAX.source = $this; - $.post(url, {'ajax_request' : true, 'ajax_page_request' : true}, AJAX.responseHandler); - }); // end $.PMA_confirm() - }); //end Add key - - /** - * Inline move columns - **/ - $(document).on('click', "#move_columns_anchor", function (e) { - e.preventDefault(); - - if ($(this).hasClass("move-active")) { - return; - } - - /** - * @var button_options Object that stores the options passed to jQueryUI - * dialog - */ - var button_options = {}; - - button_options[PMA_messages.strGo] = function (event) { - event.preventDefault(); - var $msgbox = PMA_ajaxShowMessage(); - var $this = $(this); - var $form = $this.find("form"); - var serialized = $form.serialize(); - - // check if any columns were moved at all - if (serialized == $form.data("serialized-unmoved")) { - PMA_ajaxRemoveMessage($msgbox); - $this.dialog('close'); - return; - } - - $.post($form.prop("action"), serialized + "&ajax_request=true", function (data) { - if (data.success === false) { - PMA_ajaxRemoveMessage($msgbox); - $this - .clone() - .html(data.error) - .dialog({ - title: $(this).prop("title"), - height: 230, - width: 900, - modal: true, - buttons: button_options_error - }); // end dialog options - } else { - if ($('#fieldsForm').hasClass('HideStructureActions')) { - $('#fieldsForm').find('ul.table-structure-actions').menuResizer('destroy'); - } - // sort the fields table - var $fields_table = $("table#tablestructure tbody"); - // remove all existing rows and remember them - var $rows = $fields_table.find("tr").remove(); - // loop through the correct order - for (var i in data.columns) { - var the_column = data.columns[i]; - var $the_row = $rows - .find("input:checkbox[value=" + the_column + "]") - .closest("tr"); - // append the row for this column to the table - $fields_table.append($the_row); - } - var $firstrow = $fields_table.find("tr").eq(0); - // Adjust the row numbers and colors - for (var $row = $firstrow; $row.length > 0; $row = $row.next()) { - $row - .find('td:nth-child(2)') - .text($row.index() + 1) - .end() - .removeClass("odd even") - .addClass($row.index() % 2 === 0 ? "odd" : "even"); - } - PMA_ajaxShowMessage(data.message); - $this.dialog('close'); - if ($('#fieldsForm').hasClass('HideStructureActions')) { - $('#fieldsForm').find('ul.table-structure-actions').menuResizer(PMA_tbl_structure_menu_resizer_callback); - } - } - }); - }; - button_options[PMA_messages.strCancel] = function () { - $(this).dialog('close'); - }; - - var button_options_error = {}; - button_options_error[PMA_messages.strOK] = function () { - $(this).dialog('close').remove(); - }; - - var columns = []; - - $("#tablestructure").find("tbody tr").each(function () { - var col_name = $(this).find("input:checkbox").eq(0).val(); - var hidden_input = $("") - .prop({ - name: "move_columns[]", - type: "hidden" - }) - .val(col_name); - columns[columns.length] = $("
  • ") - .addClass("placeholderDrag") - .text(col_name) - .append(hidden_input); - }); - - var col_list = $("#move_columns_dialog").find("ul") - .find("li").remove().end(); - for (var i in columns) { - col_list.append(columns[i]); - } - col_list.sortable({ - axis: 'y', - containment: $("#move_columns_dialog").find("div"), - tolerance: 'pointer' - }).disableSelection(); - var $form = $("#move_columns_dialog").find("form"); - $form.data("serialized-unmoved", $form.serialize()); - - $("#move_columns_dialog").dialog({ - modal: true, - buttons: button_options, - open: function () { - if ($('#move_columns_dialog').parents('.ui-dialog').height() > $(window).height()) { - $('#move_columns_dialog').dialog("option", "height", $(window).height()); - } - }, - beforeClose: function () { - $("#move_columns_anchor").removeClass("move-active"); - } - }); - }); - - /** - * Handles multi submits in table structure page such as change, browse, drop, primary etc. - */ - $('body').on('click', '#fieldsForm.ajax button[name="submit_mult"], #fieldsForm.ajax input[name="submit_mult"]', function (e) { - e.preventDefault(); - var $button = $(this); - var $form = $button.parents('form'); - var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true&submit_mult=' + $button.val(); - PMA_ajaxShowMessage(); - AJAX.source = $form; - $.post($form.attr('action'), submitData, AJAX.responseHandler); - }); - - /** - * Handles clicks on Action links in partition table - */ - $(document).on('click', 'a[name^=partition_action].ajax', function (e) { - e.preventDefault(); - var $link = $(this); - - function submitPartitionAction(url) { - var submitData = '&ajax_request=true&ajax_page_request=true'; - PMA_ajaxShowMessage(); - AJAX.source = $link; - $.post(url, submitData, AJAX.responseHandler); - } - - if ($link.is('#partition_action_DROP')) { - var question = PMA_messages.strDropPartitionWarning; - $link.PMA_confirm(question, $link.attr('href'), function (url) { - submitPartitionAction(url); - }); - } else if ($link.is('#partition_action_TRUNCATE')) { - var question = PMA_messages.strTruncatePartitionWarning; - $link.PMA_confirm(question, $link.attr('href'), function (url) { - submitPartitionAction(url); - }); - } else { - submitPartitionAction($link.attr('href')); - } - }); - - /** - * Handles remove partitioning - */ - $(document).on('click', '#remove_partitioning.ajax', function (e) { - e.preventDefault(); - var $link = $(this); - var question = PMA_messages.strRemovePartitioningWarning; - $link.PMA_confirm(question, $link.attr('href'), function (url) { - var submitData = '&ajax_request=true&ajax_page_request=true'; - PMA_ajaxShowMessage(); - AJAX.source = $link; - $.post(url, submitData, AJAX.responseHandler); - }); - }); -}); - -/** Handler for "More" dropdown in structure table rows */ -AJAX.registerOnload('tbl_structure.js', function () { - if ($('#fieldsForm').hasClass('HideStructureActions')) { - $('#fieldsForm').find('ul.table-structure-actions').menuResizer(PMA_tbl_structure_menu_resizer_callback); - } else { - $('.table-structure-actions').width(function () { - var width = 5; - $(this).find('li').each(function () { - width += $(this).outerWidth(true); - }); - return width; - }); - } -}); -AJAX.registerTeardown('tbl_structure.js', function () { - if ($('#fieldsForm').hasClass('HideStructureActions')) { - $('#fieldsForm').find('ul.table-structure-actions').menuResizer('destroy'); - } -}); -$(function () { - $(window).resize($.throttle(function () { - if ($('#fieldsForm').length && $('#fieldsForm').hasClass('HideStructureActions')) { - $('#fieldsForm').find('ul.table-structure-actions').menuResizer('resize'); - } - })); -}); diff --git a/#pma/js/tbl_tracking.js b/#pma/js/tbl_tracking.js deleted file mode 100644 index 920a9225..00000000 --- a/#pma/js/tbl_tracking.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Unbind all event handlers before tearing down the page - */ -AJAX.registerTeardown('tbl_tracking.js', function () { - $('body').off('click', '#versionsForm.ajax button[name="submit_mult"], #versionsForm.ajax input[name="submit_mult"]'); - $('body').off('click', 'a.delete_version_anchor.ajax'); - $('body').off('click', 'a.delete_entry_anchor.ajax'); -}); - -/** - * Bind event handlers - */ -AJAX.registerOnload('tbl_tracking.js', function () { - - $('#versions tr:first th').append($('
    ')); - $('#versions').tablesorter({ - sortList: [[1, 0]], - headers: { - 0: {sorter: false}, - 1: {sorter: "integer"}, - 5: {sorter: false}, - 6: {sorter: false} - } - }); - - if ($('#ddl_versions tbody tr').length > 0) { - $('#ddl_versions tr:first th').append($('
    ')); - $('#ddl_versions').tablesorter({ - sortList: [[0, 0]], - headers: { - 0: {sorter: "integer"}, - 3: {sorter: false}, - 4: {sorter: false} - } - }); - } - - if ($('#dml_versions tbody tr').length > 0) { - $('#dml_versions tr:first th').append($('
    ')); - $('#dml_versions').tablesorter({ - sortList: [[0, 0]], - headers: { - 0: {sorter: "integer"}, - 3: {sorter: false}, - 4: {sorter: false} - } - }); - } - - /** - * Handles multi submit for tracking versions - */ - $('body').on('click', '#versionsForm.ajax button[name="submit_mult"], #versionsForm.ajax input[name="submit_mult"]', function (e) { - e.preventDefault(); - var $button = $(this); - var $form = $button.parent('form'); - var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true&submit_mult=' + $button.val(); - - if ($button.val() == 'delete_version') { - var question = PMA_messages.strDeleteTrackingVersionMultiple; - $button.PMA_confirm(question, $form.attr('action'), function (url) { - PMA_ajaxShowMessage(); - AJAX.source = $form; - $.post(url, submitData, AJAX.responseHandler); - }); - } else { - PMA_ajaxShowMessage(); - AJAX.source = $form; - $.post($form.attr('action'), submitData, AJAX.responseHandler); - } - }); - - /** - * Ajax Event handler for 'Delete version' - */ - $('body').on('click', 'a.delete_version_anchor.ajax', function (e) { - e.preventDefault(); - var $anchor = $(this); - var question = PMA_messages.strDeleteTrackingVersion; - $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) { - PMA_ajaxShowMessage(); - AJAX.source = $anchor; - $.post(url, {'ajax_page_request': true, 'ajax_request': true}, AJAX.responseHandler); - }); - }); - - /** - * Ajax Event handler for 'Delete tracking report entry' - */ - $('body').on('click', 'a.delete_entry_anchor.ajax', function (e) { - e.preventDefault(); - var $anchor = $(this); - var question = PMA_messages.strDeletingTrackingEntry; - $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) { - PMA_ajaxShowMessage(); - AJAX.source = $anchor; - $.post(url, {'ajax_page_request': true, 'ajax_request': true}, AJAX.responseHandler); - }); - }); -}); \ No newline at end of file diff --git a/#pma/js/tbl_zoom_plot_jqplot.js b/#pma/js/tbl_zoom_plot_jqplot.js deleted file mode 100644 index d4344d3e..00000000 --- a/#pma/js/tbl_zoom_plot_jqplot.js +++ /dev/null @@ -1,645 +0,0 @@ -// TODO: change the axis -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - ** @fileoverview JavaScript functions used on tbl_select.php - ** - ** @requires jQuery - ** @requires js/functions.js - **/ - - -/** - ** Display Help/Info - **/ -function displayHelp() { - $('
    ') - .append(PMA_messages.strDisplayHelp) - .appendTo('#page_content') - .dialog({ - width: 450, - height: 'auto', - title: PMA_messages.strHelpTitle - }); - return false; -} - -/** - ** Extend the array object for max function - ** @param array - **/ -Array.max = function (array) { - return Math.max.apply(Math, array); -}; - -/** - ** Extend the array object for min function - ** @param array - **/ -Array.min = function (array) { - return Math.min.apply(Math, array); -}; - -/** - ** Checks if a string contains only numeric value - ** @param n: String (to be checked) - **/ -function isNumeric(n) { - return !isNaN(parseFloat(n)) && isFinite(n); -} - -/** - ** Checks if an object is empty - ** @param n: Object (to be checked) - **/ -function isEmpty(obj) { - var name; - for (name in obj) { - return false; - } - return true; -} - -/** - ** Converts a date/time into timestamp - ** @param val String Date - ** @param type Sring Field type(datetime/timestamp/time/date) - **/ -function getTimeStamp(val, type) { - if (type.toString().search(/datetime/i) != -1 || - type.toString().search(/timestamp/i) != -1 - ) { - return $.datepicker.parseDateTime('yy-mm-dd', 'HH:mm:ss', val); - } - else if (type.toString().search(/time/i) != -1) { - return $.datepicker.parseDateTime('yy-mm-dd', 'HH:mm:ss', '1970-01-01 ' + val); - } - else if (type.toString().search(/date/i) != -1) { - return $.datepicker.parseDate('yy-mm-dd', val); - } -} - -/** - ** Classifies the field type into numeric,timeseries or text - ** @param field: field type (as in database structure) - **/ -function getType(field) { - if (field.toString().search(/int/i) != -1 || - field.toString().search(/decimal/i) != -1 || - field.toString().search(/year/i) != -1 - ) { - return 'numeric'; - } else if (field.toString().search(/time/i) != -1 || - field.toString().search(/date/i) != -1 - ) { - return 'time'; - } else { - return 'text'; - } -} -/** - ** Converts a categorical array into numeric array - ** @param array categorical values array - **/ -function getCord(arr) { - var newCord = []; - var original = $.extend(true, [], arr); - arr = jQuery.unique(arr).sort(); - $.each(original, function (index, value) { - newCord.push(jQuery.inArray(value, arr)); - }); - return [newCord, arr, original]; -} - -/** - ** Scrolls the view to the display section - **/ -function scrollToChart() { - var x = $('#dataDisplay').offset().top - 100; // 100 provides buffer in viewport - $('html,body').animate({scrollTop: x}, 500); -} - -/** - * Unbind all event handlers before tearing down a page - */ -AJAX.registerTeardown('tbl_zoom_plot_jqplot.js', function () { - $('#tableid_0').unbind('change'); - $('#tableid_1').unbind('change'); - $('#tableid_2').unbind('change'); - $('#tableid_3').unbind('change'); - $('#inputFormSubmitId').unbind('click'); - $('#togglesearchformlink').unbind('click'); - $(document).off('keydown', "#dataDisplay :input"); - $('button.button-reset').unbind('click'); - $('div#resizer').unbind('resizestop'); - $('div#querychart').unbind('jqplotDataClick'); -}); - -AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () { - var cursorMode = ($("input[name='mode']:checked").val() == 'edit') ? 'crosshair' : 'pointer'; - var currentChart = null; - var searchedDataKey = null; - var xLabel = $('#tableid_0').val(); - var yLabel = $('#tableid_1').val(); - // will be updated via Ajax - var xType = $('#types_0').val(); - var yType = $('#types_1').val(); - var dataLabel = $('#dataLabel').val(); - var lastX; - var lastY; - var zoomRatio = 1; - - - // Get query result - var searchedData; - try { - searchedData = jQuery.parseJSON($('#querydata').html()); - } catch (err) { - searchedData = null; - } - - /** - ** Input form submit on field change - **/ - - // first column choice corresponds to the X axis - $('#tableid_0').change(function () { - //AJAX request for field type, collation, operators, and value field - $.post('tbl_zoom_select.php', { - 'ajax_request' : true, - 'change_tbl_info' : true, - 'server' : PMA_commonParams.get('server'), - 'db' : PMA_commonParams.get('db'), - 'table' : PMA_commonParams.get('table'), - 'field' : $('#tableid_0').val(), - 'it' : 0, - 'token' : PMA_commonParams.get('token') - }, function (data) { - $('#tableFieldsId').find('tr:eq(1) td:eq(0)').html(data.field_type); - $('#tableFieldsId').find('tr:eq(1) td:eq(1)').html(data.field_collation); - $('#tableFieldsId').find('tr:eq(1) td:eq(2)').html(data.field_operators); - $('#tableFieldsId').find('tr:eq(1) td:eq(3)').html(data.field_value); - xLabel = $('#tableid_0').val(); - $('#types_0').val(data.field_type); - xType = data.field_type; - $('#collations_0').val(data.field_collations); - addDateTimePicker(); - }); - }); - - // second column choice corresponds to the Y axis - $('#tableid_1').change(function () { - //AJAX request for field type, collation, operators, and value field - $.post('tbl_zoom_select.php', { - 'ajax_request' : true, - 'change_tbl_info' : true, - 'server' : PMA_commonParams.get('server'), - 'db' : PMA_commonParams.get('db'), - 'table' : PMA_commonParams.get('table'), - 'field' : $('#tableid_1').val(), - 'it' : 1, - 'token' : PMA_commonParams.get('token') - }, function (data) { - $('#tableFieldsId').find('tr:eq(3) td:eq(0)').html(data.field_type); - $('#tableFieldsId').find('tr:eq(3) td:eq(1)').html(data.field_collation); - $('#tableFieldsId').find('tr:eq(3) td:eq(2)').html(data.field_operators); - $('#tableFieldsId').find('tr:eq(3) td:eq(3)').html(data.field_value); - yLabel = $('#tableid_1').val(); - $('#types_1').val(data.field_type); - yType = data.field_type; - $('#collations_1').val(data.field_collations); - addDateTimePicker(); - }); - }); - - $('#tableid_2').change(function () { - //AJAX request for field type, collation, operators, and value field - $.post('tbl_zoom_select.php', { - 'ajax_request' : true, - 'change_tbl_info' : true, - 'server' : PMA_commonParams.get('server'), - 'db' : PMA_commonParams.get('db'), - 'table' : PMA_commonParams.get('table'), - 'field' : $('#tableid_2').val(), - 'it' : 2, - 'token' : PMA_commonParams.get('token') - }, function (data) { - $('#tableFieldsId').find('tr:eq(6) td:eq(0)').html(data.field_type); - $('#tableFieldsId').find('tr:eq(6) td:eq(1)').html(data.field_collation); - $('#tableFieldsId').find('tr:eq(6) td:eq(2)').html(data.field_operators); - $('#tableFieldsId').find('tr:eq(6) td:eq(3)').html(data.field_value); - $('#types_2').val(data.field_type); - $('#collations_2').val(data.field_collations); - addDateTimePicker(); - }); - }); - - $('#tableid_3').change(function () { - //AJAX request for field type, collation, operators, and value field - $.post('tbl_zoom_select.php', { - 'ajax_request' : true, - 'change_tbl_info' : true, - 'server' : PMA_commonParams.get('server'), - 'db' : PMA_commonParams.get('db'), - 'table' : PMA_commonParams.get('table'), - 'field' : $('#tableid_3').val(), - 'it' : 3, - 'token' : PMA_commonParams.get('token') - }, function (data) { - $('#tableFieldsId').find('tr:eq(8) td:eq(0)').html(data.field_type); - $('#tableFieldsId').find('tr:eq(8) td:eq(1)').html(data.field_collation); - $('#tableFieldsId').find('tr:eq(8) td:eq(2)').html(data.field_operators); - $('#tableFieldsId').find('tr:eq(8) td:eq(3)').html(data.field_value); - $('#types_3').val(data.field_type); - $('#collations_3').val(data.field_collations); - addDateTimePicker(); - }); - }); - - /** - * Input form validation - **/ - $('#inputFormSubmitId').click(function () { - if ($('#tableid_0').get(0).selectedIndex === 0 || $('#tableid_1').get(0).selectedIndex === 0) { - PMA_ajaxShowMessage(PMA_messages.strInputNull); - } else if (xLabel == yLabel) { - PMA_ajaxShowMessage(PMA_messages.strSameInputs); - } - }); - - /** - ** Prepare a div containing a link, otherwise it's incorrectly displayed - ** after a couple of clicks - **/ - $('
    ') - .insertAfter('#zoom_search_form') - // don't show it until we have results on-screen - .hide(); - - $('#togglesearchformlink') - .html(PMA_messages.strShowSearchCriteria) - .bind('click', function () { - var $link = $(this); - $('#zoom_search_form').slideToggle(); - if ($link.text() == PMA_messages.strHideSearchCriteria) { - $link.text(PMA_messages.strShowSearchCriteria); - } else { - $link.text(PMA_messages.strHideSearchCriteria); - } - // avoid default click action - return false; - }); - - /** - ** Set dialog properties for the data display form - **/ - var buttonOptions = {}; - /* - * Handle saving of a row in the editor - */ - buttonOptions[PMA_messages.strSave] = function () { - //Find changed values by comparing form values with selectedRow Object - var newValues = {};//Stores the values changed from original - var sqlTypes = {}; - var it = 0; - var xChange = false; - var yChange = false; - var key; - var tempGetVal = function () { - return $(this).val(); - }; - for (key in selectedRow) { - var oldVal = selectedRow[key]; - var newVal = ($('#edit_fields_null_id_' + it).prop('checked')) ? null : $('#edit_fieldID_' + it).val(); - if (newVal instanceof Array) { // when the column is of type SET - newVal = $('#edit_fieldID_' + it).map(tempGetVal).get().join(","); - } - if (oldVal != newVal) { - selectedRow[key] = newVal; - newValues[key] = newVal; - if (key == xLabel) { - xChange = true; - searchedData[searchedDataKey][xLabel] = newVal; - } else if (key == yLabel) { - yChange = true; - searchedData[searchedDataKey][yLabel] = newVal; - } - } - var $input = $('#edit_fieldID_' + it); - if ($input.hasClass('bit')) { - sqlTypes[key] = 'bit'; - } else { - sqlTypes[key] = null; - } - it++; - } //End data update - - //Update the chart series and replot - if (xChange || yChange) { - //Logic similar to plot generation, replot only if xAxis changes or yAxis changes. - //Code includes a lot of checks so as to replot only when necessary - if (xChange) { - xCord[searchedDataKey] = selectedRow[xLabel]; - // [searchedDataKey][0] contains the x value - if (xType == 'numeric') { - series[0][searchedDataKey][0] = selectedRow[xLabel]; - } else if (xType == 'time') { - series[0][searchedDataKey][0] = - getTimeStamp(selectedRow[xLabel], $('#types_0').val()); - } else { - series[0][searchedDataKey][0] = ''; - // TODO: text values - } - currentChart.series[0].data = series[0]; - // TODO: axis changing - currentChart.replot(); - - } - if (yChange) { - yCord[searchedDataKey] = selectedRow[yLabel]; - // [searchedDataKey][1] contains the y value - if (yType == 'numeric') { - series[0][searchedDataKey][1] = selectedRow[yLabel]; - } else if (yType == 'time') { - series[0][searchedDataKey][1] = - getTimeStamp(selectedRow[yLabel], $('#types_1').val()); - } else { - series[0][searchedDataKey][1] = ''; - // TODO: text values - } - currentChart.series[0].data = series[0]; - // TODO: axis changing - currentChart.replot(); - } - } //End plot update - - //Generate SQL query for update - if (!isEmpty(newValues)) { - var sql_query = 'UPDATE `' + PMA_commonParams.get('table') + '` SET '; - for (key in newValues) { - sql_query += '`' + key + '`='; - var value = newValues[key]; - - // null - if (value === null) { - sql_query += 'NULL, '; - - // empty - } else if ($.trim(value) === '') { - sql_query += "'', "; - - // other - } else { - // type explicitly identified - if (sqlTypes[key] !== null) { - if (sqlTypes[key] == 'bit') { - sql_query += "b'" + value + "', "; - } - // type not explicitly identified - } else { - if (!isNumeric(value)) { - sql_query += "'" + value + "', "; - } else { - sql_query += value + ', '; - } - } - } - } - // remove two extraneous characters ', ' - sql_query = sql_query.substring(0, sql_query.length - 2); - sql_query += ' WHERE ' + PMA_urldecode(searchedData[searchedDataKey].where_clause); - - //Post SQL query to sql.php - $.post('sql.php', { - 'token' : PMA_commonParams.get('token'), - 'server' : PMA_commonParams.get('server'), - 'db' : PMA_commonParams.get('db'), - 'ajax_request' : true, - 'sql_query' : sql_query, - 'inline_edit' : false - }, function (data) { - if (typeof data !== 'undefined' && data.success === true) { - $('#sqlqueryresultsouter').html(data.sql_query); - PMA_highlightSQL($('#sqlqueryresultsouter')); - } else { - PMA_ajaxShowMessage(data.error, false); - } - }); //End $.post - }//End database update - $("#dataDisplay").dialog('close'); - }; - buttonOptions[PMA_messages.strCancel] = function () { - $(this).dialog('close'); - }; - $("#dataDisplay").dialog({ - autoOpen: false, - title: PMA_messages.strDataPointContent, - modal: true, - buttons: buttonOptions, - width: $('#dataDisplay').width() + 80, - open: function () { - $(this).find('input[type=checkbox]').css('margin', '0.5em'); - } - }); - /** - * Attach Ajax event handlers for input fields - * in the dialog. Used to submit the Ajax - * request when the ENTER key is pressed. - */ - $(document).on('keydown', "#dataDisplay :input", function (e) { - if (e.which === 13) { // 13 is the ENTER key - e.preventDefault(); - if (typeof buttonOptions[PMA_messages.strSave] === 'function') { - buttonOptions[PMA_messages.strSave].call(); - } - } - }); - - - /* - * Generate plot using jqplot - */ - - if (searchedData !== null) { - $('#zoom_search_form') - .slideToggle() - .hide(); - $('#togglesearchformlink') - .text(PMA_messages.strShowSearchCriteria); - $('#togglesearchformdiv').show(); - var selectedRow; - var colorCodes = ['#FF0000', '#00FFFF', '#0000FF', '#0000A0', '#FF0080', '#800080', '#FFFF00', '#00FF00', '#FF00FF']; - var series = []; - var xCord = []; - var yCord = []; - var tempX, tempY; - var it = 0; - var xMax; // xAxis extreme max - var xMin; // xAxis extreme min - var yMax; // yAxis extreme max - var yMin; // yAxis extreme min - var xVal; - var yVal; - var format; - - var options = { - series: [ - // for a scatter plot - { showLine: false } - ], - grid: { - drawBorder: false, - shadow: false, - background: 'rgba(0,0,0,0)' - }, - axes: { - xaxis: { - label: $('#tableid_0').val(), - labelRenderer: $.jqplot.CanvasAxisLabelRenderer - }, - yaxis: { - label: $('#tableid_1').val(), - labelRenderer: $.jqplot.CanvasAxisLabelRenderer - } - }, - highlighter: { - show: true, - tooltipAxes: 'y', - yvalues: 2, - // hide the first y value - formatString: '%s%s' - }, - cursor: { - show: true, - zoom: true, - showTooltip: false - } - }; - - // If data label is not set, do not show tooltips - if (dataLabel === '') { - options.highlighter.show = false; - } - - // Classify types as either numeric,time,text - xType = getType(xType); - yType = getType(yType); - - // could have multiple series but we'll have just one - series[0] = []; - - if (xType == 'time') { - var originalXType = $('#types_0').val(); - if (originalXType == 'date') { - format = '%Y-%m-%d'; - } - // TODO: does not seem to work - //else if (originalXType == 'time') { - // format = '%H:%M'; - //} else { - // format = '%Y-%m-%d %H:%M'; - //} - $.extend(options.axes.xaxis, { - renderer: $.jqplot.DateAxisRenderer, - tickOptions: { - formatString: format - } - }); - } - if (yType == 'time') { - var originalYType = $('#types_1').val(); - if (originalYType == 'date') { - format = '%Y-%m-%d'; - } - $.extend(options.axes.yaxis, { - renderer: $.jqplot.DateAxisRenderer, - tickOptions: { - formatString: format - } - }); - } - - $.each(searchedData, function (key, value) { - if (xType == 'numeric') { - xVal = parseFloat(value[xLabel]); - } - if (xType == 'time') { - xVal = getTimeStamp(value[xLabel], originalXType); - } - if (yType == 'numeric') { - yVal = parseFloat(value[yLabel]); - } - if (yType == 'time') { - yVal = getTimeStamp(value[yLabel], originalYType); - } - series[0].push([ - xVal, - yVal, - // extra Y values - value[dataLabel], // for highlighter - // (may set an undefined value) - value.where_clause, // for click on point - key // key from searchedData - ]); - }); - - // under IE 8, the initial display is mangled; after a manual - // resizing, it's ok - // under IE 9, everything is fine - currentChart = $.jqplot('querychart', series, options); - currentChart.resetZoom(); - - $('button.button-reset').click(function (event) { - event.preventDefault(); - currentChart.resetZoom(); - }); - - $('div#resizer').resizable(); - $('div#resizer').bind('resizestop', function (event, ui) { - // make room so that the handle will still appear - $('div#querychart').height($('div#resizer').height() * 0.96); - $('div#querychart').width($('div#resizer').width() * 0.96); - currentChart.replot({resetAxes: true}); - }); - - $('div#querychart').bind('jqplotDataClick', - function (event, seriesIndex, pointIndex, data) { - searchedDataKey = data[4]; // key from searchedData (global) - var field_id = 0; - var post_params = { - 'ajax_request' : true, - 'get_data_row' : true, - 'server' : PMA_commonParams.get('server'), - 'db' : PMA_commonParams.get('db'), - 'table' : PMA_commonParams.get('table'), - 'where_clause' : data[3], - 'token' : PMA_commonParams.get('token') - }; - - $.post('tbl_zoom_select.php', post_params, function (data) { - // Row is contained in data.row_info, - // now fill the displayResultForm with row values - var key; - for (key in data.row_info) { - var $field = $('#edit_fieldID_' + field_id); - var $field_null = $('#edit_fields_null_id_' + field_id); - if (data.row_info[key] === null) { - $field_null.prop('checked', true); - $field.val(''); - } else { - $field_null.prop('checked', false); - if ($field.attr('multiple')) { // when the column is of type SET - $field.val(data.row_info[key].split(',')); - } else { - $field.val(data.row_info[key]); - } - } - field_id++; - } - selectedRow = data.row_info; - }); - - $("#dataDisplay").dialog("open"); - } - ); - } -}); diff --git a/#pma/js/tracekit/tracekit.js b/#pma/js/tracekit/tracekit.js deleted file mode 100644 index 78bb33be..00000000 --- a/#pma/js/tracekit/tracekit.js +++ /dev/null @@ -1,1114 +0,0 @@ -/* - TraceKit - Cross brower stack traces - github.com/occ/TraceKit - MIT license -*/ - -;(function(window, undefined) { - - -var TraceKit = {}; -var _oldTraceKit = window.TraceKit; - -// global reference to slice -var _slice = [].slice; -var UNKNOWN_FUNCTION = '?'; - - -/** - * _has, a better form of hasOwnProperty - * Example: _has(MainHostObject, property) === true/false - * - * @param {Object} host object to check property - * @param {string} key to check - */ -function _has(object, key) { - return Object.prototype.hasOwnProperty.call(object, key); -} - -function _isUndefined(what) { - return typeof what === 'undefined'; -} - -/** - * TraceKit.noConflict: Export TraceKit out to another variable - * Example: var TK = TraceKit.noConflict() - */ -TraceKit.noConflict = function noConflict() { - window.TraceKit = _oldTraceKit; - return TraceKit; -}; - -/** - * TraceKit.wrap: Wrap any function in a TraceKit reporter - * Example: func = TraceKit.wrap(func); - * - * @param {Function} func Function to be wrapped - * @return {Function} The wrapped func - */ -TraceKit.wrap = function traceKitWrapper(func) { - function wrapped() { - try { - return func.apply(this, arguments); - } catch (e) { - TraceKit.report(e); - throw e; - } - } - return wrapped; -}; - -/** - * TraceKit.report: cross-browser processing of unhandled exceptions - * - * Syntax: - * TraceKit.report.subscribe(function(stackInfo) { ... }) - * TraceKit.report.unsubscribe(function(stackInfo) { ... }) - * TraceKit.report(exception) - * try { ...code... } catch(ex) { TraceKit.report(ex); } - * - * Supports: - * - Firefox: full stack trace with line numbers, plus column number - * on top frame; column number is not guaranteed - * - Opera: full stack trace with line and column numbers - * - Chrome: full stack trace with line and column numbers - * - Safari: line and column number for the top frame only; some frames - * may be missing, and column number is not guaranteed - * - IE: line and column number for the top frame only; some frames - * may be missing, and column number is not guaranteed - * - * In theory, TraceKit should work on all of the following versions: - * - IE5.5+ (only 8.0 tested) - * - Firefox 0.9+ (only 3.5+ tested) - * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require - * Exceptions Have Stacktrace to be enabled in opera:config) - * - Safari 3+ (only 4+ tested) - * - Chrome 1+ (only 5+ tested) - * - Konqueror 3.5+ (untested) - * - * Requires TraceKit.computeStackTrace. - * - * Tries to catch all unhandled exceptions and report them to the - * subscribed handlers. Please note that TraceKit.report will rethrow the - * exception. This is REQUIRED in order to get a useful stack trace in IE. - * If the exception does not reach the top of the browser, you will only - * get a stack trace from the point where TraceKit.report was called. - * - * Handlers receive a stackInfo object as described in the - * TraceKit.computeStackTrace docs. - */ -TraceKit.report = (function reportModuleWrapper() { - var handlers = [], - lastException = null, - lastExceptionStack = null; - - /** - * Add a crash handler. - * @param {Function} handler - */ - function subscribe(handler) { - installGlobalHandler(); - handlers.push(handler); - } - - /** - * Remove a crash handler. - * @param {Function} handler - */ - function unsubscribe(handler) { - for (var i = handlers.length - 1; i >= 0; --i) { - if (handlers[i] === handler) { - handlers.splice(i, 1); - } - } - } - - /** - * Dispatch stack information to all handlers. - * @param {Object.} stack - */ - function notifyHandlers(stack, windowError) { - var exception = null; - if (windowError && !TraceKit.collectWindowErrors) { - return; - } - for (var i in handlers) { - if (_has(handlers, i)) { - try { - handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2))); - } catch (inner) { - exception = inner; - } - } - } - - if (exception) { - throw exception; - } - } - - var _oldOnerrorHandler, _onErrorHandlerInstalled; - - /** - * Ensures all global unhandled exceptions are recorded. - * Supported by Gecko and IE. - * @param {string} message Error message. - * @param {string} url URL of script that generated the exception. - * @param {(number|string)} lineNo The line number at which the error - * occurred. - */ - function traceKitWindowOnError(message, url, lineNo) { - var stack = null; - - if (lastExceptionStack) { - TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message); - stack = lastExceptionStack; - lastExceptionStack = null; - lastException = null; - } else { - var location = { - 'url': url, - 'line': lineNo - }; - location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line); - location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line); - stack = { - 'mode': 'onerror', - 'message': message, - 'url': document.location.href, - 'stack': [location], - 'useragent': navigator.userAgent - }; - } - - notifyHandlers(stack, 'from window.onerror'); - - if (_oldOnerrorHandler) { - return _oldOnerrorHandler.apply(this, arguments); - } - - return false; - } - - function installGlobalHandler () - { - if (_onErrorHandlerInstalled === true) { - return; - } - _oldOnerrorHandler = window.onerror; - window.onerror = traceKitWindowOnError; - _onErrorHandlerInstalled = true; - } - - /** - * Reports an unhandled Error to TraceKit. - * @param {Error} ex - */ - function report(ex) { - var args = _slice.call(arguments, 1); - if (lastExceptionStack) { - if (lastException === ex) { - return; // already caught by an inner catch block, ignore - } else { - var s = lastExceptionStack; - lastExceptionStack = null; - lastException = null; - notifyHandlers.apply(null, [s, null].concat(args)); - } - } - - var stack = TraceKit.computeStackTrace(ex); - lastExceptionStack = stack; - lastException = ex; - - // If the stack trace is incomplete, wait for 2 seconds for - // slow slow IE to see if onerror occurs or not before reporting - // this exception; otherwise, we will end up with an incomplete - // stack trace - window.setTimeout(function () { - if (lastException === ex) { - lastExceptionStack = null; - lastException = null; - notifyHandlers.apply(null, [stack, null].concat(args)); - } - }, (stack.incomplete ? 2000 : 0)); - - throw ex; // re-throw to propagate to the top level (and cause window.onerror) - } - - report.subscribe = subscribe; - report.unsubscribe = unsubscribe; - return report; -}()); - -/** - * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript - * - * Syntax: - * s = TraceKit.computeStackTrace.ofCaller([depth]) - * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below) - * Returns: - * s.name - exception name - * s.message - exception message - * s.stack[i].url - JavaScript or HTML file URL - * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work) - * s.stack[i].args - arguments passed to the function, if known - * s.stack[i].line - line number, if known - * s.stack[i].column - column number, if known - * s.stack[i].context - an array of source code lines; the middle element corresponds to the correct line# - * s.mode - 'stack', 'stacktrace', 'multiline', 'callers', 'onerror', or 'failed' -- method used to collect the stack trace - * - * Supports: - * - Firefox: full stack trace with line numbers and unreliable column - * number on top frame - * - Opera 10: full stack trace with line and column numbers - * - Opera 9-: full stack trace with line numbers - * - Chrome: full stack trace with line and column numbers - * - Safari: line and column number for the topmost stacktrace element - * only - * - IE: no line numbers whatsoever - * - * Tries to guess names of anonymous functions by looking for assignments - * in the source code. In IE and Safari, we have to guess source file names - * by searching for function bodies inside all page scripts. This will not - * work for scripts that are loaded cross-domain. - * Here be dragons: some function names may be guessed incorrectly, and - * duplicate functions may be mismatched. - * - * TraceKit.computeStackTrace should only be used for tracing purposes. - * Logging of unhandled exceptions should be done with TraceKit.report, - * which builds on top of TraceKit.computeStackTrace and provides better - * IE support by utilizing the window.onerror event to retrieve information - * about the top of the stack. - * - * Note: In IE and Safari, no stack trace is recorded on the Error object, - * so computeStackTrace instead walks its *own* chain of callers. - * This means that: - * * in Safari, some methods may be missing from the stack trace; - * * in IE, the topmost function in the stack trace will always be the - * caller of computeStackTrace. - * - * This is okay for tracing (because you are likely to be calling - * computeStackTrace from the function you want to be the topmost element - * of the stack trace anyway), but not okay for logging unhandled - * exceptions (because your catch block will likely be far away from the - * inner function that actually caused the exception). - * - * Tracing example: - * function trace(message) { - * var stackInfo = TraceKit.computeStackTrace.ofCaller(); - * var data = message + "\n"; - * for(var i in stackInfo.stack) { - * var item = stackInfo.stack[i]; - * data += (item.func || '[anonymous]') + "() in " + item.url + ":" + (item.line || '0') + "\n"; - * } - * if (window.console) - * console.info(data); - * else - * alert(data); - * } - */ -TraceKit.computeStackTrace = (function computeStackTraceWrapper() { - var debug = false, - sourceCache = {}; - - /** - * Attempts to retrieve source code via XMLHttpRequest, which is used - * to look up anonymous function names. - * @param {string} url URL of source code. - * @return {string} Source contents. - */ - function loadSource(url) { - if (!TraceKit.remoteFetching) { //Only attempt request if remoteFetching is on. - return ''; - } - try { - function getXHR() { - try { - return new window.XMLHttpRequest(); - } catch (e) { - // explicitly bubble up the exception if not found - return new window.ActiveXObject('Microsoft.XMLHTTP'); - } - } - - var request = getXHR(); - request.open('GET', url, false); - request.send(''); - return request.responseText; - } catch (e) { - return ''; - } - } - - /** - * Retrieves source code from the source code cache. - * @param {string} url URL of source code. - * @return {Array.} Source contents. - */ - function getSource(url) { - if (!_has(sourceCache, url)) { - // URL needs to be able to fetched within the acceptable domain. Otherwise, - // cross-domain errors will be triggered. - var source = ''; - if (url.indexOf(document.domain) !== -1) { - source = loadSource(url); - } - sourceCache[url] = source ? source.split('\n') : []; - } - - return sourceCache[url]; - } - - /** - * Tries to use an externally loaded copy of source code to determine - * the name of a function by looking at the name of the variable it was - * assigned to, if any. - * @param {string} url URL of source code. - * @param {(string|number)} lineNo Line number in source code. - * @return {string} The function name, if discoverable. - */ - function guessFunctionName(url, lineNo) { - var reFunctionArgNames = /function ([^(]*)\(([^)]*)\)/, - reGuessFunction = /['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/, - line = '', - maxLines = 10, - source = getSource(url), - m; - - if (!source.length) { - return UNKNOWN_FUNCTION; - } - - // Walk backwards from the first line in the function until we find the line which - // matches the pattern above, which is the function definition - for (var i = 0; i < maxLines; ++i) { - line = source[lineNo - i] + line; - - if (!_isUndefined(line)) { - if ((m = reGuessFunction.exec(line))) { - return m[1]; - } else if ((m = reFunctionArgNames.exec(line))) { - return m[1]; - } - } - } - - return UNKNOWN_FUNCTION; - } - - /** - * Retrieves the surrounding lines from where an exception occurred. - * @param {string} url URL of source code. - * @param {(string|number)} line Line number in source code to centre - * around for context. - * @return {?Array.} Lines of source code. - */ - function gatherContext(url, line) { - var source = getSource(url); - - if (!source.length) { - return null; - } - - var context = [], - // linesBefore & linesAfter are inclusive with the offending line. - // if linesOfContext is even, there will be one extra line - // *before* the offending line. - linesBefore = Math.floor(TraceKit.linesOfContext / 2), - // Add one extra line if linesOfContext is odd - linesAfter = linesBefore + (TraceKit.linesOfContext % 2), - start = Math.max(0, line - linesBefore - 1), - end = Math.min(source.length, line + linesAfter - 1); - - line -= 1; // convert to 0-based index - - for (var i = start; i < end; ++i) { - if (!_isUndefined(source[i])) { - context.push(source[i]); - } - } - - return context.length > 0 ? context : null; - } - - /** - * Escapes special characters, except for whitespace, in a string to be - * used inside a regular expression as a string literal. - * @param {string} text The string. - * @return {string} The escaped string literal. - */ - function escapeRegExp(text) { - return text.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g, '\\$&'); - } - - /** - * Escapes special characters in a string to be used inside a regular - * expression as a string literal. Also ensures that HTML entities will - * be matched the same as their literal friends. - * @param {string} body The string. - * @return {string} The escaped string. - */ - function escapeCodeAsRegExpForMatchingInsideHTML(body) { - return escapeRegExp(body).replace('<', '(?:<|<)').replace('>', '(?:>|>)').replace('&', '(?:&|&)').replace('"', '(?:"|")').replace(/\s+/g, '\\s+'); - } - - /** - * Determines where a code fragment occurs in the source code. - * @param {RegExp} re The function definition. - * @param {Array.} urls A list of URLs to search. - * @return {?Object.} An object containing - * the url, line, and column number of the defined function. - */ - function findSourceInUrls(re, urls) { - var source, m; - for (var i = 0, j = urls.length; i < j; ++i) { - // console.log('searching', urls[i]); - if ((source = getSource(urls[i])).length) { - source = source.join('\n'); - if ((m = re.exec(source))) { - // console.log('Found function in ' + urls[i]); - - return { - 'url': urls[i], - 'line': source.substring(0, m.index).split('\n').length, - 'column': m.index - source.lastIndexOf('\n', m.index) - 1 - }; - } - } - } - - // console.log('no match'); - - return null; - } - - /** - * Determines at which column a code fragment occurs on a line of the - * source code. - * @param {string} fragment The code fragment. - * @param {string} url The URL to search. - * @param {(string|number)} line The line number to examine. - * @return {?number} The column number. - */ - function findSourceInLine(fragment, url, line) { - var source = getSource(url), - re = new RegExp('\\b' + escapeRegExp(fragment) + '\\b'), - m; - - line -= 1; - - if (source && source.length > line && (m = re.exec(source[line]))) { - return m.index; - } - - return null; - } - - /** - * Determines where a function was defined within the source code. - * @param {(Function|string)} func A function reference or serialized - * function definition. - * @return {?Object.} An object containing - * the url, line, and column number of the defined function. - */ - function findSourceByFunctionBody(func) { - var urls = [window.location.href], - scripts = document.getElementsByTagName('script'), - body, - code = '' + func, - codeRE = /^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/, - eventRE = /^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/, - re, - parts, - result; - - for (var i = 0; i < scripts.length; ++i) { - var script = scripts[i]; - if (script.src) { - urls.push(script.src); - } - } - - if (!(parts = codeRE.exec(code))) { - re = new RegExp(escapeRegExp(code).replace(/\s+/g, '\\s+')); - } - - // not sure if this is really necessary, but I don’t have a test - // corpus large enough to confirm that and it was in the original. - else { - var name = parts[1] ? '\\s+' + parts[1] : '', - args = parts[2].split(',').join('\\s*,\\s*'); - - body = escapeRegExp(parts[3]).replace(/;$/, ';?'); // semicolon is inserted if the function ends with a comment.replace(/\s+/g, '\\s+'); - re = new RegExp('function' + name + '\\s*\\(\\s*' + args + '\\s*\\)\\s*{\\s*' + body + '\\s*}'); - } - - // look for a normal function definition - if ((result = findSourceInUrls(re, urls))) { - return result; - } - - // look for an old-school event handler function - if ((parts = eventRE.exec(code))) { - var event = parts[1]; - body = escapeCodeAsRegExpForMatchingInsideHTML(parts[2]); - - // look for a function defined in HTML as an onXXX handler - re = new RegExp('on' + event + '=[\\\'"]\\s*' + body + '\\s*[\\\'"]', 'i'); - - if ((result = findSourceInUrls(re, urls[0]))) { - return result; - } - - // look for ??? - re = new RegExp(body); - - if ((result = findSourceInUrls(re, urls))) { - return result; - } - } - - return null; - } - - // Contents of Exception in various browsers. - // - // SAFARI: - // ex.message = Can't find variable: qq - // ex.line = 59 - // ex.sourceId = 580238192 - // ex.sourceURL = http://... - // ex.expressionBeginOffset = 96 - // ex.expressionCaretOffset = 98 - // ex.expressionEndOffset = 98 - // ex.name = ReferenceError - // - // FIREFOX: - // ex.message = qq is not defined - // ex.fileName = http://... - // ex.lineNumber = 59 - // ex.stack = ...stack trace... (see the example below) - // ex.name = ReferenceError - // - // CHROME: - // ex.message = qq is not defined - // ex.name = ReferenceError - // ex.type = not_defined - // ex.arguments = ['aa'] - // ex.stack = ...stack trace... - // - // INTERNET EXPLORER: - // ex.message = ... - // ex.name = ReferenceError - // - // OPERA: - // ex.message = ...message... (see the example below) - // ex.name = ReferenceError - // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message) - // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace' - - /** - * Computes stack trace information from the stack property. - * Chrome and Gecko use this property. - * @param {Error} ex - * @return {?Object.} Stack trace information. - */ - function computeStackTraceFromStackProp(ex) { - if (!ex.stack) { - return null; - } - - var chrome = /^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i, - gecko = /^\s*(\S*)(?:\((.*?)\))?@((?:file|http|https).*?):(\d+)(?::(\d+))?\s*$/i, - lines = ex.stack.split('\n'), - stack = [], - parts, - element, - reference = /^(.*) is undefined$/.exec(ex.message); - - for (var i = 0, j = lines.length; i < j; ++i) { - if ((parts = gecko.exec(lines[i]))) { - element = { - 'url': parts[3], - 'func': parts[1] || UNKNOWN_FUNCTION, - 'args': parts[2] ? parts[2].split(',') : '', - 'line': +parts[4], - 'column': parts[5] ? +parts[5] : null - }; - } else if ((parts = chrome.exec(lines[i]))) { - element = { - 'url': parts[2], - 'func': parts[1] || UNKNOWN_FUNCTION, - 'line': +parts[3], - 'column': parts[4] ? +parts[4] : null - }; - } else { - continue; - } - - if (!element.func && element.line) { - element.func = guessFunctionName(element.url, element.line); - } - - if (element.line) { - element.context = gatherContext(element.url, element.line); - } - - stack.push(element); - } - - if (stack[0] && stack[0].line && !stack[0].column && reference) { - stack[0].column = findSourceInLine(reference[1], stack[0].url, stack[0].line); - } - - if (!stack.length) { - return null; - } - - return { - 'mode': 'stack', - 'name': ex.name, - 'message': ex.message, - 'url': document.location.href, - 'stack': stack, - 'useragent': navigator.userAgent - }; - } - - /** - * Computes stack trace information from the stacktrace property. - * Opera 10 uses this property. - * @param {Error} ex - * @return {?Object.} Stack trace information. - */ - function computeStackTraceFromStacktraceProp(ex) { - // Access and store the stacktrace property before doing ANYTHING - // else to it because Opera is not very good at providing it - // reliably in other circumstances. - var stacktrace = ex.stacktrace; - - var testRE = / line (\d+), column (\d+) in (?:]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i, - lines = stacktrace.split('\n'), - stack = [], - parts; - - for (var i = 0, j = lines.length; i < j; i += 2) { - if ((parts = testRE.exec(lines[i]))) { - var element = { - 'line': +parts[1], - 'column': +parts[2], - 'func': parts[3] || parts[4], - 'args': parts[5] ? parts[5].split(',') : [], - 'url': parts[6] - }; - - if (!element.func && element.line) { - element.func = guessFunctionName(element.url, element.line); - } - if (element.line) { - try { - element.context = gatherContext(element.url, element.line); - } catch (exc) {} - } - - if (!element.context) { - element.context = [lines[i + 1]]; - } - - stack.push(element); - } - } - - if (!stack.length) { - return null; - } - - return { - 'mode': 'stacktrace', - 'name': ex.name, - 'message': ex.message, - 'url': document.location.href, - 'stack': stack, - 'useragent': navigator.userAgent - }; - } - - /** - * NOT TESTED. - * Computes stack trace information from an error message that includes - * the stack trace. - * Opera 9 and earlier use this method if the option to show stack - * traces is turned on in opera:config. - * @param {Error} ex - * @return {?Object.} Stack information. - */ - function computeStackTraceFromOperaMultiLineMessage(ex) { - // Opera includes a stack trace into the exception message. An example is: - // - // Statement on line 3: Undefined variable: undefinedFunc - // Backtrace: - // Line 3 of linked script file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.js: In function zzz - // undefinedFunc(a); - // Line 7 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function yyy - // zzz(x, y, z); - // Line 3 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function xxx - // yyy(a, a, a); - // Line 1 of function script - // try { xxx('hi'); return false; } catch(ex) { TraceKit.report(ex); } - // ... - - var lines = ex.message.split('\n'); - if (lines.length < 4) { - return null; - } - - var lineRE1 = /^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i, - lineRE2 = /^\s*Line (\d+) of inline#(\d+) script in ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i, - lineRE3 = /^\s*Line (\d+) of function script\s*$/i, - stack = [], - scripts = document.getElementsByTagName('script'), - inlineScriptBlocks = [], - parts, - i, - len, - source; - - for (i in scripts) { - if (_has(scripts, i) && !scripts[i].src) { - inlineScriptBlocks.push(scripts[i]); - } - } - - for (i = 2, len = lines.length; i < len; i += 2) { - var item = null; - if ((parts = lineRE1.exec(lines[i]))) { - item = { - 'url': parts[2], - 'func': parts[3], - 'line': +parts[1] - }; - } else if ((parts = lineRE2.exec(lines[i]))) { - item = { - 'url': parts[3], - 'func': parts[4] - }; - var relativeLine = (+parts[1]); // relative to the start of the "; - } else { - $dynamic_scripts .= ""; - } - continue; - } - $include = true; - if ($value['conditional_ie'] !== false - && PMA_USR_BROWSER_AGENT === 'IE' - ) { - if ($value['conditional_ie'] === true) { - $include = true; - } else if ($value['conditional_ie'] == PMA_USR_BROWSER_VER) { - $include = true; - } else { - $include = false; - } - } - if ($include) { - $scripts[] = "scripts%5B%5D=" . $value['filename']; - } - } - $separator = PMA_URL_getArgSeparator(); - $static_scripts = ''; - // Using chunks of 10 files to avoid too long URLs - // as some servers are set to 512 bytes URL limit - $script_chunks = array_chunk($scripts, 10); - foreach ($script_chunks as $script_chunk) { - $url = 'js/get_scripts.js.php?' - . implode($separator, $script_chunk) - . $separator . Header::getVersionParameter(); - - $static_scripts .= sprintf( - '', - htmlspecialchars($url) - ); - } - return $first_dynamic_scripts . $static_scripts . $dynamic_scripts; - } - - /** - * Generates new Scripts objects - * - */ - public function __construct() - { - $this->_files = array(); - $this->_code = ''; - - } - - /** - * Adds a new file to the list of scripts - * - * @param string $filename The name of the file to include - * @param bool $conditional_ie Whether to wrap the script tag in - * conditional comments for IE - * @param bool $before_statics Whether this dynamic script should be - * included before the static ones - * - * @return void - */ - public function addFile( - $filename, - $conditional_ie = false, - $before_statics = false - ) { - $hash = md5($filename); - if (!empty($this->_files[$hash])) { - return; - } - - $has_onload = $this->_eventBlacklist($filename); - $this->_files[$hash] = array( - 'has_onload' => $has_onload, - 'filename' => $filename, - 'conditional_ie' => $conditional_ie, - 'before_statics' => $before_statics - ); - } - - /** - * Add new files to the list of scripts - * - * @param array $filelist The array of file names - * @param bool $conditional_ie Whether to wrap the script tag in - * conditional comments for IE - * - * @return void - */ - public function addFiles($filelist, $conditional_ie = false) - { - foreach ($filelist as $filename) { - $this->addFile($filename, $conditional_ie); - } - } - - /** - * Determines whether to fire up an onload event for a file - * - * @param string $filename The name of the file to be checked - * against the blacklist - * - * @return int 1 to fire up the event, 0 not to - */ - private function _eventBlacklist($filename) - { - if (strpos($filename, 'jquery') !== false - || strpos($filename, 'codemirror') !== false - || strpos($filename, 'messages.php') !== false - || strpos($filename, 'ajax.js') !== false - || strpos($filename, 'get_image.js.php') !== false - || strpos($filename, 'cross_framing_protection.js') !== false - ) { - return 0; - } - - return 1; - } - - /** - * Adds a new code snippet to the code to be executed - * - * @param string $code The JS code to be added - * - * @return void - */ - public function addCode($code) - { - $this->_code .= "$code\n"; - } - - /** - * Returns a list with filenames and a flag to indicate - * whether to register onload events for this file - * - * @return array - */ - public function getFiles() - { - $retval = array(); - foreach ($this->_files as $file) { - //If filename contains a "?", continue. - if (strpos($file['filename'], "?") !== false) { - continue; - } - - if (! $file['conditional_ie'] || PMA_USR_BROWSER_AGENT == 'IE') { - $retval[] = array( - 'name' => $file['filename'], - 'fire' => $file['has_onload'] - ); - } - } - return $retval; - } - - /** - * Renders all the JavaScript file inclusions, code and events - * - * @return string - */ - public function getDisplay() - { - $retval = ''; - - if (count($this->_files) > 0) { - $retval .= $this->_includeFiles( - $this->_files - ); - } - - $code = 'AJAX.scriptHandler'; - foreach ($this->_files as $file) { - $code .= sprintf( - '.add("%s",%d)', - PMA_escapeJsString($file['filename']), - $file['has_onload'] ? 1 : 0 - ); - } - $code .= ';'; - $this->addCode($code); - - $code = '$(function() {'; - foreach ($this->_files as $file) { - if ($file['has_onload']) { - $code .= 'AJAX.fireOnload("'; - $code .= PMA_escapeJsString($file['filename']); - $code .= '");'; - } - } - $code .= '});'; - $this->addCode($code); - - $retval .= ''; - - return $retval; - } -} diff --git a/#pma/libraries/ServerStatusData.php b/#pma/libraries/ServerStatusData.php deleted file mode 100644 index 8fcdf463..00000000 --- a/#pma/libraries/ServerStatusData.php +++ /dev/null @@ -1,502 +0,0 @@ - section - // variable names match when they begin with the given string - - 'Com_' => 'com', - 'Innodb_' => 'innodb', - 'Ndb_' => 'ndb', - 'Handler_' => 'handler', - 'Qcache_' => 'qcache', - 'Threads_' => 'threads', - 'Slow_launch_threads' => 'threads', - - 'Binlog_cache_' => 'binlog_cache', - 'Created_tmp_' => 'created_tmp', - 'Key_' => 'key', - - 'Delayed_' => 'delayed', - 'Not_flushed_delayed_rows' => 'delayed', - - 'Flush_commands' => 'query', - 'Last_query_cost' => 'query', - 'Slow_queries' => 'query', - 'Queries' => 'query', - 'Prepared_stmt_count' => 'query', - - 'Select_' => 'select', - 'Sort_' => 'sort', - - 'Open_tables' => 'table', - 'Opened_tables' => 'table', - 'Open_table_definitions' => 'table', - 'Opened_table_definitions' => 'table', - 'Table_locks_' => 'table', - - 'Rpl_status' => 'repl', - 'Slave_' => 'repl', - - 'Tc_' => 'tc', - - 'Ssl_' => 'ssl', - - 'Open_files' => 'files', - 'Open_streams' => 'files', - 'Opened_files' => 'files', - ); - } - - /** - * Gets the sections for constructor - * - * @return array - */ - private function _getSections() - { - return array( - // section => section name (description) - 'com' => 'Com', - 'query' => __('SQL query'), - 'innodb' => 'InnoDB', - 'ndb' => 'NDB', - 'handler' => __('Handler'), - 'qcache' => __('Query cache'), - 'threads' => __('Threads'), - 'binlog_cache' => __('Binary log'), - 'created_tmp' => __('Temporary data'), - 'delayed' => __('Delayed inserts'), - 'key' => __('Key cache'), - 'select' => __('Joins'), - 'repl' => __('Replication'), - 'sort' => __('Sorting'), - 'table' => __('Tables'), - 'tc' => __('Transaction coordinator'), - 'files' => __('Files'), - 'ssl' => 'SSL', - 'other' => __('Other') - ); - } - - /** - * Gets the links for constructor - * - * @return array - */ - private function _getLinks() - { - $links = array(); - // variable or section name => (name => url) - - $links['table'][__('Flush (close) all tables')] = $this->selfUrl - . PMA_URL_getCommon( - array( - 'flush' => 'TABLES' - ) - ); - $links['table'][__('Show open tables')] - = 'sql.php' . PMA_URL_getCommon( - array( - 'sql_query' => 'SHOW OPEN TABLES', - 'goto' => $this->selfUrl, - ) - ); - - if ($GLOBALS['replication_info']['master']['status']) { - $links['repl'][__('Show slave hosts')] - = 'sql.php' . PMA_URL_getCommon( - array( - 'sql_query' => 'SHOW SLAVE HOSTS', - 'goto' => $this->selfUrl, - ) - ); - $links['repl'][__('Show master status')] = '#replication_master'; - } - if ($GLOBALS['replication_info']['slave']['status']) { - $links['repl'][__('Show slave status')] = '#replication_slave'; - } - - $links['repl']['doc'] = 'replication'; - - $links['qcache'][__('Flush query cache')] - = $this->selfUrl - . PMA_URL_getCommon( - array( - 'flush' => 'QUERY CACHE' - ) - ); - $links['qcache']['doc'] = 'query_cache'; - - $links['threads']['doc'] = 'mysql_threads'; - - $links['key']['doc'] = 'myisam_key_cache'; - - $links['binlog_cache']['doc'] = 'binary_log'; - - $links['Slow_queries']['doc'] = 'slow_query_log'; - - $links['innodb'][__('Variables')] - = 'server_engines.php?engine=InnoDB&' - . PMA_URL_getCommon(array(), 'html', ''); - $links['innodb'][__('InnoDB Status')] - = 'server_engines.php' - . PMA_URL_getCommon( - array( - 'engine' => 'InnoDB', - 'page' => 'Status' - ) - ); - $links['innodb']['doc'] = 'innodb'; - - return($links); - } - - /** - * Calculate some values - * - * @param array $server_status contains results of SHOW GLOBAL STATUS - * @param array $server_variables contains results of SHOW GLOBAL VARIABLES - * - * @return array $server_status - */ - private function _calculateValues($server_status, $server_variables) - { - // Key_buffer_fraction - if (isset($server_status['Key_blocks_unused']) - && isset($server_variables['key_cache_block_size']) - && isset($server_variables['key_buffer_size']) - && $server_variables['key_buffer_size'] != 0 - ) { - $server_status['Key_buffer_fraction_%'] - = 100 - - $server_status['Key_blocks_unused'] - * $server_variables['key_cache_block_size'] - / $server_variables['key_buffer_size'] - * 100; - } elseif (isset($server_status['Key_blocks_used']) - && isset($server_variables['key_buffer_size']) - && $server_variables['key_buffer_size'] != 0 - ) { - $server_status['Key_buffer_fraction_%'] - = $server_status['Key_blocks_used'] - * 1024 - / $server_variables['key_buffer_size']; - } - - // Ratio for key read/write - if (isset($server_status['Key_writes']) - && isset($server_status['Key_write_requests']) - && $server_status['Key_write_requests'] > 0 - ) { - $key_writes = $server_status['Key_writes']; - $key_write_requests = $server_status['Key_write_requests']; - $server_status['Key_write_ratio_%'] - = 100 * $key_writes / $key_write_requests; - } - - if (isset($server_status['Key_reads']) - && isset($server_status['Key_read_requests']) - && $server_status['Key_read_requests'] > 0 - ) { - $key_reads = $server_status['Key_reads']; - $key_read_requests = $server_status['Key_read_requests']; - $server_status['Key_read_ratio_%'] - = 100 * $key_reads / $key_read_requests; - } - - // Threads_cache_hitrate - if (isset($server_status['Threads_created']) - && isset($server_status['Connections']) - && $server_status['Connections'] > 0 - ) { - - $server_status['Threads_cache_hitrate_%'] - = 100 - $server_status['Threads_created'] - / $server_status['Connections'] * 100; - } - return $server_status; - } - - /** - * Sort variables into arrays - * - * @param array $server_status contains results of SHOW GLOBAL STATUS - * @param array $allocations allocations for sections - * @param array $allocationMap map variables to their section - * @param array $sectionUsed is a section used? - * @param array $used_queries used queries - * - * @return array ($allocationMap, $sectionUsed, $used_queries) - */ - private function _sortVariables( - $server_status, $allocations, $allocationMap, $sectionUsed, - $used_queries - ) { - foreach ($server_status as $name => $value) { - $section_found = false; - foreach ($allocations as $filter => $section) { - if (mb_strpos($name, $filter) !== false) { - $allocationMap[$name] = $section; - $sectionUsed[$section] = true; - $section_found = true; - if ($section == 'com' && $value > 0) { - $used_queries[$name] = $value; - } - break; // Only exits inner loop - } - } - if (! $section_found) { - $allocationMap[$name] = 'other'; - $sectionUsed['other'] = true; - } - } - return array($allocationMap, $sectionUsed, $used_queries); - } - - /** - * Constructor - */ - public function __construct() - { - $this->selfUrl = basename($GLOBALS['PMA_PHP_SELF']); - - // get status from server - $server_status_result = $GLOBALS['dbi']->tryQuery('SHOW GLOBAL STATUS'); - $server_status = array(); - if ($server_status_result === false) { - $this->dataLoaded = false; - } else { - $this->dataLoaded = true; - while ($arr = $GLOBALS['dbi']->fetchRow($server_status_result)) { - $server_status[$arr[0]] = $arr[1]; - } - $GLOBALS['dbi']->freeResult($server_status_result); - } - - // for some calculations we require also some server settings - $server_variables = $GLOBALS['dbi']->fetchResult( - 'SHOW GLOBAL VARIABLES', 0, 1 - ); - - // cleanup of some deprecated values - $server_status = self::cleanDeprecated($server_status); - - // calculate some values - $server_status = $this->_calculateValues( - $server_status, $server_variables - ); - - // split variables in sections - $allocations = $this->_getAllocations(); - - $sections = $this->_getSections(); - - // define some needful links/commands - $links = $this->_getLinks(); - - // Variable to contain all com_ variables (query statistics) - $used_queries = array(); - - // Variable to map variable names to their respective section name - // (used for js category filtering) - $allocationMap = array(); - - // Variable to mark used sections - $sectionUsed = array(); - - // sort vars into arrays - list( - $allocationMap, $sectionUsed, $used_queries - ) = $this->_sortVariables( - $server_status, $allocations, $allocationMap, $sectionUsed, - $used_queries - ); - - // admin commands are not queries (e.g. they include COM_PING, - // which is excluded from $server_status['Questions']) - unset($used_queries['Com_admin_commands']); - - // Set all class properties - $this->db_isLocal = false; - $serverHostToLower = mb_strtolower( - $GLOBALS['cfg']['Server']['host'] - ); - if ($serverHostToLower === 'localhost' - || $GLOBALS['cfg']['Server']['host'] === '127.0.0.1' - || $GLOBALS['cfg']['Server']['host'] === '::1' - ) { - $this->db_isLocal = true; - } - $this->status = $server_status; - $this->sections = $sections; - $this->variables = $server_variables; - $this->used_queries = $used_queries; - $this->allocationMap = $allocationMap; - $this->links = $links; - $this->sectionUsed = $sectionUsed; - } - - /** - * cleanup of some deprecated values - * - * @param array $server_status status array to process - * - * @return array - */ - public static function cleanDeprecated($server_status) - { - $deprecated = array( - 'Com_prepare_sql' => 'Com_stmt_prepare', - 'Com_execute_sql' => 'Com_stmt_execute', - 'Com_dealloc_sql' => 'Com_stmt_close', - ); - foreach ($deprecated as $old => $new) { - if (isset($server_status[$old]) && isset($server_status[$new])) { - unset($server_status[$old]); - } - } - return $server_status; - } - - /** - * Generates menu HTML - * - * @return string - */ - public function getMenuHtml() - { - $url_params = PMA_URL_getCommon(); - $items = array( - array( - 'name' => __('Server'), - 'url' => 'server_status.php' - ), - array( - 'name' => __('Processes'), - 'url' => 'server_status_processes.php' - ), - array( - 'name' => __('Query statistics'), - 'url' => 'server_status_queries.php' - ), - array( - 'name' => __('All status variables'), - 'url' => 'server_status_variables.php' - ), - array( - 'name' => __('Monitor'), - 'url' => 'server_status_monitor.php' - ), - array( - 'name' => __('Advisor'), - 'url' => 'server_status_advisor.php' - ) - ); - - $retval = '
      '; - foreach ($items as $item) { - $class = ''; - if ($item['url'] === $this->selfUrl) { - $class = ' class="tabactive"'; - } - $retval .= '
    • '; - $retval .= ''; - $retval .= $item['name']; - $retval .= ''; - $retval .= '
    • '; - } - $retval .= '
    '; - $retval .= '
    '; - - return $retval; - } - - /** - * Builds a '; - foreach ($refreshRates as $rate) { - $selected = ($rate == $defaultRate)?' selected="selected"':''; - $return .= ''; - } - $return .= ''; - return $return; - } -} - diff --git a/#pma/libraries/StorageEngine.php b/#pma/libraries/StorageEngine.php deleted file mode 100644 index 71aa8ef0..00000000 --- a/#pma/libraries/StorageEngine.php +++ /dev/null @@ -1,463 +0,0 @@ -engine = $engine; - $this->title = $storage_engines[$engine]['Engine']; - $this->comment = (isset($storage_engines[$engine]['Comment']) - ? $storage_engines[$engine]['Comment'] - : ''); - switch ($storage_engines[$engine]['Support']) { - case 'DEFAULT': - $this->support = PMA_ENGINE_SUPPORT_DEFAULT; - break; - case 'YES': - $this->support = PMA_ENGINE_SUPPORT_YES; - break; - case 'DISABLED': - $this->support = PMA_ENGINE_SUPPORT_DISABLED; - break; - case 'NO': - default: - $this->support = PMA_ENGINE_SUPPORT_NO; - } - } - } - - /** - * Returns array of storage engines - * - * @static - * @staticvar array $storage_engines storage engines - * @access public - * @return string[] array of storage engines - */ - static public function getStorageEngines() - { - static $storage_engines = null; - - if (null == $storage_engines) { - $storage_engines - = $GLOBALS['dbi']->fetchResult('SHOW STORAGE ENGINES', 'Engine'); - if (PMA_MYSQL_INT_VERSION >= 50708) { - $disabled = Util::cacheGet( - 'disabled_storage_engines', - function () { - return $GLOBALS['dbi']->fetchValue( - 'SELECT @@disabled_storage_engines' - ); - } - ); - foreach (explode(",", $disabled) as $engine) { - if (isset($storage_engines[$engine])) { - $storage_engines[$engine]['Support'] = 'DISABLED'; - } - } - } - } - - return $storage_engines; - } - - /** - * Returns HTML code for storage engine select box - * - * @param string $name The name of the select form element - * @param string $id The ID of the form field - * @param string $selected The selected engine - * @param boolean $offerUnavailableEngines Should unavailable storage - * engines be offered? - * @param boolean $addEmpty Whether to provide empty option - * - * @static - * @return string html selectbox - */ - static public function getHtmlSelect( - $name = 'engine', $id = null, - $selected = null, $offerUnavailableEngines = false, - $addEmpty = false - ) { - $selected = mb_strtolower($selected); - $output = '' . "\n"; - return $output; - } - - /** - * Loads the corresponding engine plugin, if available. - * - * @param string $engine The engine ID - * - * @return StorageEngine The engine plugin - * @static - */ - static public function getEngine($engine) - { - switch(strtolower($engine)) { - case 'bdb': - return new Bdb($engine); - case 'berkeleydb': - return new Berkeleydb($engine); - case 'binlog': - return new Binlog($engine); - case 'innobase': - return new Innobase($engine); - case 'innodb': - return new Innodb($engine); - case 'memory': - return new Memory($engine); - case 'merge': - return new Merge($engine); - case 'mrg_myisam': - return new Mrg_Myisam($engine); - case 'myisam': - return new Myisam($engine); - case 'ndbcluster': - return new Ndbcluster($engine); - case 'pbxt': - return new Pbxt($engine); - case 'performance_schema': - return new Performance_Schema($engine); - default: - return new StorageEngine($engine); - } - } - - /** - * Returns true if given engine name is supported/valid, otherwise false - * - * @param string $engine name of engine - * - * @static - * @return boolean whether $engine is valid or not - */ - static public function isValid($engine) - { - if ($engine == "PBMS") { - return true; - } - $storage_engines = StorageEngine::getStorageEngines(); - return isset($storage_engines[$engine]); - } - - /** - * Returns as HTML table of the engine's server variables - * - * @return string The table that was generated based on the retrieved - * information - */ - public function getHtmlVariables() - { - $odd_row = false; - $ret = ''; - - foreach ($this->getVariablesStatus() as $details) { - $ret .= '' . "\n" - . ' ' . "\n"; - if (! empty($details['desc'])) { - $ret .= ' ' - . Util::showHint($details['desc']) - . "\n"; - } - $ret .= ' ' . "\n" - . ' ' . htmlspecialchars($details['title']) . '' - . "\n" - . ' '; - switch ($details['type']) { - case PMA_ENGINE_DETAILS_TYPE_SIZE: - $parsed_size = $this->resolveTypeSize($details['value']); - $ret .= $parsed_size[0] . ' ' . $parsed_size[1]; - unset($parsed_size); - break; - case PMA_ENGINE_DETAILS_TYPE_NUMERIC: - $ret .= Util::formatNumber($details['value']) . ' '; - break; - default: - $ret .= htmlspecialchars($details['value']) . ' '; - } - $ret .= '' . "\n" - . '' . "\n"; - $odd_row = ! $odd_row; - } - - if (! $ret) { - $ret = '

    ' . "\n" - . ' ' - . __( - 'There is no detailed status information available for this ' - . 'storage engine.' - ) - . "\n" - . '

    ' . "\n"; - } else { - $ret = '' . "\n" . $ret . '
    ' . "\n"; - } - - return $ret; - } - - /** - * Returns the engine specific handling for - * PMA_ENGINE_DETAILS_TYPE_SIZE type variables. - * - * This function should be overridden when - * PMA_ENGINE_DETAILS_TYPE_SIZE type needs to be - * handled differently for a particular engine. - * - * @param integer $value Value to format - * - * @return string the formatted value and its unit - */ - public function resolveTypeSize($value) - { - return Util::formatByteDown($value); - } - - /** - * Returns array with detailed info about engine specific server variables - * - * @return array array with detailed info about specific engine server variables - */ - public function getVariablesStatus() - { - $variables = $this->getVariables(); - $like = $this->getVariablesLikePattern(); - - if ($like) { - $like = " LIKE '" . $like . "' "; - } else { - $like = ''; - } - - $mysql_vars = array(); - - $sql_query = 'SHOW GLOBAL VARIABLES ' . $like . ';'; - $res = $GLOBALS['dbi']->query($sql_query); - while ($row = $GLOBALS['dbi']->fetchAssoc($res)) { - if (isset($variables[$row['Variable_name']])) { - $mysql_vars[$row['Variable_name']] - = $variables[$row['Variable_name']]; - } elseif (! $like - && mb_strpos(mb_strtolower($row['Variable_name']), mb_strtolower($this->engine)) !== 0 - ) { - continue; - } - $mysql_vars[$row['Variable_name']]['value'] = $row['Value']; - - if (empty($mysql_vars[$row['Variable_name']]['title'])) { - $mysql_vars[$row['Variable_name']]['title'] = $row['Variable_name']; - } - - if (! isset($mysql_vars[$row['Variable_name']]['type'])) { - $mysql_vars[$row['Variable_name']]['type'] - = PMA_ENGINE_DETAILS_TYPE_PLAINTEXT; - } - } - $GLOBALS['dbi']->freeResult($res); - - return $mysql_vars; - } - - /** - * Reveals the engine's title - * - * @return string The title - */ - public function getTitle() - { - return $this->title; - } - - /** - * Fetches the server's comment about this engine - * - * @return string The comment - */ - public function getComment() - { - return $this->comment; - } - - /** - * Information message on whether this storage engine is supported - * - * @return string The localized message. - */ - public function getSupportInformationMessage() - { - switch ($this->support) { - case PMA_ENGINE_SUPPORT_DEFAULT: - $message = __('%s is the default storage engine on this MySQL server.'); - break; - case PMA_ENGINE_SUPPORT_YES: - $message = __('%s is available on this MySQL server.'); - break; - case PMA_ENGINE_SUPPORT_DISABLED: - $message = __('%s has been disabled for this MySQL server.'); - break; - case PMA_ENGINE_SUPPORT_NO: - default: - $message = __( - 'This MySQL server does not support the %s storage engine.' - ); - } - return sprintf($message, htmlspecialchars($this->title)); - } - - /** - * Generates a list of MySQL variables that provide information about this - * engine. This function should be overridden when extending this class - * for a particular engine. - * - * @return array The list of variables. - */ - public function getVariables() - { - return array(); - } - - /** - * Returns string with filename for the MySQL helppage - * about this storage engine - * - * @return string MySQL help page filename - */ - public function getMysqlHelpPage() - { - return $this->engine . '-storage-engine'; - } - - /** - * Returns the pattern to be used in the query for SQL variables - * related to the storage engine - * - * @return string SQL query LIKE pattern - */ - public function getVariablesLikePattern() - { - return ''; - } - - /** - * Returns a list of available information pages with labels - * - * @return string[] The list - */ - public function getInfoPages() - { - return array(); - } - - /** - * Generates the requested information page - * - * @param string $id page id - * - * @return string html output - */ - public function getPage($id) - { - if (! array_key_exists($id, $this->getInfoPages())) { - return ''; - } - - $id = 'getPage' . $id; - - return $this->$id(); - } -} - diff --git a/#pma/libraries/SubPartition.php b/#pma/libraries/SubPartition.php deleted file mode 100644 index fda338ce..00000000 --- a/#pma/libraries/SubPartition.php +++ /dev/null @@ -1,180 +0,0 @@ -db = $row['TABLE_SCHEMA']; - $this->table = $row['TABLE_NAME']; - $this->loadData($row); - } - - /** - * Loads data from the fetched row from information_schema.PARTITIONS - * - * @param array $row fetched row - * - * @return void - */ - protected function loadData($row) - { - $this->name = $row['SUBPARTITION_NAME']; - $this->ordinal = $row['SUBPARTITION_ORDINAL_POSITION']; - $this->method = $row['SUBPARTITION_METHOD']; - $this->expression = $row['SUBPARTITION_EXPRESSION']; - $this->loadCommonData($row); - } - - /** - * Loads some data that is common to both partitions and sub partitions - * - * @param array $row fetched row - * - * @return void - */ - protected function loadCommonData($row) - { - $this->rows = $row['TABLE_ROWS']; - $this->dataLength = $row['DATA_LENGTH']; - $this->indexLength = $row['INDEX_LENGTH']; - $this->comment = $row['PARTITION_COMMENT']; - } - - /** - * Return the partition name - * - * @return string partition name - */ - public function getName() - { - return $this->name; - } - - /** - * Return the ordinal of the partition - * - * @return number the ordinal - */ - public function getOrdinal() - { - return $this->ordinal; - } - - /** - * Returns the partition method - * - * @return string partition method - */ - public function getMethod() - { - return $this->method; - } - - /** - * Returns the partition expression - * - * @return string partition expression - */ - public function getExpression() - { - return $this->expression; - } - - /** - * Returns the number of data rows - * - * @return integer number of rows - */ - public function getRows() - { - return $this->rows; - } - - /** - * Returns the data length - * - * @return integer data length - */ - public function getDataLength() - { - return $this->dataLength; - } - - /** - * Returns the index length - * - * @return integer index length - */ - public function getIndexLength() - { - return $this->indexLength; - } - - /** - * Returns the partition comment - * - * @return string partition comment - */ - public function getComment() - { - return $this->comment; - } -} \ No newline at end of file diff --git a/#pma/libraries/SysInfo.php b/#pma/libraries/SysInfo.php deleted file mode 100644 index 0339d28f..00000000 --- a/#pma/libraries/SysInfo.php +++ /dev/null @@ -1,48 +0,0 @@ - 0); - } - - /** - * Gets information about memory usage - * - * @return array with memory usage data - */ - public function memory() - { - return array(); - } - - /** - * Checks whether class is supported in this environment - * - * @return true on success - */ - public function supported() - { - return true; - } -} \ No newline at end of file diff --git a/#pma/libraries/SysInfoLinux.php b/#pma/libraries/SysInfoLinux.php deleted file mode 100644 index 6d66c9c2..00000000 --- a/#pma/libraries/SysInfoLinux.php +++ /dev/null @@ -1,91 +0,0 @@ - $nums[1] + $nums[2] + $nums[3], - 'idle' => intval($nums[4]), - ); - } - - /** - * Checks whether class is supported in this environment - * - * @return true on success - */ - public function supported() - { - return @is_readable('/proc/meminfo') && @is_readable('/proc/stat'); - } - - /** - * Gets information about memory usage - * - * @return array with memory usage data - */ - function memory() - { - preg_match_all( - MEMORY_REGEXP, - file_get_contents('/proc/meminfo'), - $matches - ); - - $mem = array_combine($matches[1], $matches[2]); - - $defaults = array( - 'MemTotal' => 0, - 'MemFree' => 0, - 'Cached' => 0, - 'Buffers' => 0, - 'SwapTotal' => 0, - 'SwapFree' => 0, - 'SwapCached' => 0, - ); - - $mem = array_merge($defaults, $mem); - - $mem['MemUsed'] = $mem['MemTotal'] - - $mem['MemFree'] - $mem['Cached'] - $mem['Buffers']; - - $mem['SwapUsed'] = $mem['SwapTotal'] - - $mem['SwapFree'] - $mem['SwapCached']; - - foreach ($mem as $idx => $value) { - $mem[$idx] = intval($value); - } - - return $mem; - } -} diff --git a/#pma/libraries/SysInfoSunOS.php b/#pma/libraries/SysInfoSunOS.php deleted file mode 100644 index bca40cae..00000000 --- a/#pma/libraries/SysInfoSunOS.php +++ /dev/null @@ -1,80 +0,0 @@ -_kstat('unix:0:system_misc:avenrun_1min'); - - return array('loadavg' => $load1); - } - - /** - * Checks whether class is supported in this environment - * - * @return true on success - */ - public function supported() - { - return @is_readable('/proc/meminfo'); - } - - /** - * Gets information about memory usage - * - * @return array with memory usage data - */ - public function memory() - { - $pagesize = $this->_kstat('unix:0:seg_cache:slab_size'); - $mem = array(); - $mem['MemTotal'] - = $this->_kstat('unix:0:system_pages:pagestotal') * $pagesize; - $mem['MemUsed'] - = $this->_kstat('unix:0:system_pages:pageslocked') * $pagesize; - $mem['MemFree'] - = $this->_kstat('unix:0:system_pages:pagesfree') * $pagesize; - $mem['SwapTotal'] = $this->_kstat('unix:0:vminfo:swap_avail') / 1024; - $mem['SwapUsed'] = $this->_kstat('unix:0:vminfo:swap_alloc') / 1024; - $mem['SwapFree'] = $this->_kstat('unix:0:vminfo:swap_free') / 1024; - - return $mem; - } -} \ No newline at end of file diff --git a/#pma/libraries/SysInfoWINNT.php b/#pma/libraries/SysInfoWINNT.php deleted file mode 100644 index c56ddbb0..00000000 --- a/#pma/libraries/SysInfoWINNT.php +++ /dev/null @@ -1,126 +0,0 @@ -_wmi = null; - } else { - // initialize the wmi object - $objLocator = new COM('WbemScripting.SWbemLocator'); - $this->_wmi = $objLocator->ConnectServer(); - } - } - - /** - * Gets load information - * - * @return array with load data - */ - function loadavg() - { - $loadavg = ""; - $sum = 0; - $buffer = $this->_getWMI('Win32_Processor', array('LoadPercentage')); - - foreach ($buffer as $load) { - $value = $load['LoadPercentage']; - $loadavg .= $value . ' '; - $sum += $value; - } - - return array('loadavg' => $sum / count($buffer)); - } - - /** - * Checks whether class is supported in this environment - * - * @return true on success - */ - public function supported() - { - return !is_null($this->_wmi); - } - - /** - * Reads data from WMI - * - * @param string $strClass Class to read - * @param array $strValue Values to read - * - * @return array with results - */ - private function _getWMI($strClass, $strValue = array()) - { - $arrData = array(); - - $objWEBM = $this->_wmi->Get($strClass); - $arrProp = $objWEBM->Properties_; - $arrWEBMCol = $objWEBM->Instances_(); - foreach ($arrWEBMCol as $objItem) { - $arrInstance = array(); - foreach ($arrProp as $propItem) { - $name = $propItem->Name; - if (empty($strValue) || in_array($name, $strValue)) { - $value = $objItem->$name; - $arrInstance[$name] = trim($value); - } - } - $arrData[] = $arrInstance; - } - - return $arrData; - } - - /** - * Gets information about memory usage - * - * @return array with memory usage data - */ - function memory() - { - $buffer = $this->_getWMI( - "Win32_OperatingSystem", - array('TotalVisibleMemorySize', 'FreePhysicalMemory') - ); - $mem = Array(); - $mem['MemTotal'] = $buffer[0]['TotalVisibleMemorySize']; - $mem['MemFree'] = $buffer[0]['FreePhysicalMemory']; - $mem['MemUsed'] = $mem['MemTotal'] - $mem['MemFree']; - - $buffer = $this->_getWMI('Win32_PageFileUsage'); - - $mem['SwapTotal'] = 0; - $mem['SwapUsed'] = 0; - $mem['SwapPeak'] = 0; - - foreach ($buffer as $swapdevice) { - $mem['SwapTotal'] += $swapdevice['AllocatedBaseSize'] * 1024; - $mem['SwapUsed'] += $swapdevice['CurrentUsage'] * 1024; - $mem['SwapPeak'] += $swapdevice['PeakUsage'] * 1024; - } - - return $mem; - } -} diff --git a/#pma/libraries/SystemDatabase.php b/#pma/libraries/SystemDatabase.php deleted file mode 100644 index 7e39e462..00000000 --- a/#pma/libraries/SystemDatabase.php +++ /dev/null @@ -1,125 +0,0 @@ -dbi = $dbi; - } - - /** - * Get existing data on transformations applied for - * columns in a particular table - * - * @param string $db Database name looking for - * - * @return \mysqli_result Result of executed SQL query - */ - public function getExistingTransformationData($db) - { - $cfgRelation = \PMA_getRelationsParam(); - - // Get the existing transformation details of the same database - // from pma__column_info table - $pma_transformation_sql = sprintf( - "SELECT * FROM %s.%s WHERE `db_name` = '%s'", - Util::backquote($cfgRelation['db']), - Util::backquote($cfgRelation['column_info']), - $GLOBALS['dbi']->escapeString($db) - ); - - return $this->dbi->tryQuery($pma_transformation_sql); - } - - /** - * Get SQL query for store new transformation details of a VIEW - * - * @param object $pma_transformation_data Result set of SQL execution - * @param array $column_map Details of VIEW columns - * @param string $view_name Name of the VIEW - * @param string $db Database name of the VIEW - * - * @return string $new_transformations_sql SQL query for new transformations - */ - function getNewTransformationDataSql( - $pma_transformation_data, $column_map, $view_name, $db - ) { - $cfgRelation = \PMA_getRelationsParam(); - - // Need to store new transformation details for VIEW - $new_transformations_sql = sprintf( - "INSERT INTO %s.%s (" - . "`db_name`, `table_name`, `column_name`, " - . "`comment`, `mimetype`, `transformation`, " - . "`transformation_options`) VALUES", - Util::backquote($cfgRelation['db']), - Util::backquote($cfgRelation['column_info']) - ); - - $column_count = 0; - $add_comma = false; - - while ($data_row = $this->dbi->fetchAssoc($pma_transformation_data)) { - - foreach ($column_map as $column) { - - if ($data_row['table_name'] != $column['table_name'] - || $data_row['column_name'] != $column['refering_column'] - ) { - continue; - } - - $new_transformations_sql .= sprintf( - "%s ('%s', '%s', '%s', '%s', '%s', '%s', '%s')", - $add_comma ? ', ' : '', - $db, - $view_name, - isset($column['real_column']) - ? $column['real_column'] - : $column['refering_column'], - $data_row['comment'], - $data_row['mimetype'], - $data_row['transformation'], - $GLOBALS['dbi']->escapeString( - $data_row['transformation_options'] - ) - ); - - $add_comma = true; - $column_count++; - break; - } - - if ($column_count == count($column_map)) { - break; - } - } - - return ($column_count > 0) ? $new_transformations_sql : ''; - } -} diff --git a/#pma/libraries/Table.php b/#pma/libraries/Table.php deleted file mode 100644 index 4067dfd8..00000000 --- a/#pma/libraries/Table.php +++ /dev/null @@ -1,2535 +0,0 @@ -_dbi = $dbi; - $this->_name = $table_name; - $this->_db_name = $db_name; - } - - /** - * returns table name - * - * @see Table::getName() - * @return string table name - */ - function __toString() - { - return $this->getName(); - } - - /** - * return the last error - * - * @return string the last error - */ - function getLastError() - { - return end($this->errors); - } - - /** - * return the last message - * - * @return string the last message - */ - function getLastMessage() - { - return end($this->messages); - } - - /** - * returns table name - * - * @param boolean $backquoted whether to quote name with backticks `` - * - * @return string table name - */ - function getName($backquoted = false) - { - if ($backquoted) { - return Util::backquote($this->_name); - } - return $this->_name; - } - - /** - * returns database name for this table - * - * @param boolean $backquoted whether to quote name with backticks `` - * - * @return string database name for this table - */ - function getDbName($backquoted = false) - { - if ($backquoted) { - return Util::backquote($this->_db_name); - } - return $this->_db_name; - } - - /** - * returns full name for table, including database name - * - * @param boolean $backquoted whether to quote name with backticks `` - * - * @return string - */ - function getFullName($backquoted = false) - { - return $this->getDbName($backquoted) . '.' - . $this->getName($backquoted); - } - - /** - * returns whether the table is actually a view - * - * @return boolean whether the given is a view - */ - public function isView() - { - $db = $this->_db_name; - $table = $this->_name; - if (empty($db) || empty($table)) { - return false; - } - - // use cached data or load information with SHOW command - if ($this->_dbi->getCachedTableContent(array($db, $table)) != null - || $GLOBALS['cfg']['Server']['DisableIS'] - ) { - $type = $this->getStatusInfo('TABLE_TYPE'); - return $type == 'VIEW' || $type == 'SYSTEM VIEW'; - } - - // information_schema tables are 'SYSTEM VIEW's - if ($db == 'information_schema') { - return true; - } - - // query information_schema - $result = $this->_dbi->fetchResult( - "SELECT TABLE_NAME - FROM information_schema.VIEWS - WHERE TABLE_SCHEMA = '" . $GLOBALS['dbi']->escapeString($db) . "' - AND TABLE_NAME = '" . $GLOBALS['dbi']->escapeString($table) . "'" - ); - return $result ? true : false; - } - - /** - * Returns whether the table is actually an updatable view - * - * @return boolean whether the given is an updatable view - */ - public function isUpdatableView() - { - if (empty($this->_db_name) || empty($this->_name)) { - return false; - } - - $result = $this->_dbi->fetchResult( - "SELECT TABLE_NAME - FROM information_schema.VIEWS - WHERE TABLE_SCHEMA = '" . $GLOBALS['dbi']->escapeString($this->_db_name) . "' - AND TABLE_NAME = '" . $GLOBALS['dbi']->escapeString($this->_name) . "' - AND IS_UPDATABLE = 'YES'" - ); - return $result ? true : false; - } - - /** - * Returns the analysis of 'SHOW CREATE TABLE' query for the table. - * In case of a view, the values are taken from the information_schema. - * - * @return array analysis of 'SHOW CREATE TABLE' query for the table - */ - public function analyzeStructure() - { - if (empty($this->_db_name) || empty($this->_name)) { - return false; - } - - $analyzed_sql = array(); - if ($this->isView()) { - // For a view, 'SHOW CREATE TABLE' returns the definition, - // but the structure of the view. So, we try to mock - // the result of analyzing 'SHOW CREATE TABLE' query. - $analyzed_sql[0] = array(); - $analyzed_sql[0]['create_table_fields'] = array(); - - $results = $this->_dbi->fetchResult( - "SELECT COLUMN_NAME, DATA_TYPE - FROM information_schema.COLUMNS - WHERE TABLE_SCHEMA = '" . $GLOBALS['dbi']->escapeString($this->_db_name) - . " AND TABLE_NAME = '" . $GLOBALS['dbi']->escapeString($this->_name) . "'" - ); - - foreach ($results as $result) { - $analyzed_sql[0]['create_table_fields'][$result['COLUMN_NAME']] - = array( - 'type' => mb_strtoupper($result['DATA_TYPE']) - ); - } - } else { - $show_create_table = $this->_dbi->fetchValue( - 'SHOW CREATE TABLE ' - . Util::backquote($this->_db_name) - . '.' . Util::backquote($this->_name), - 0, - 1 - ); - $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); - } - return $analyzed_sql; - } - - /** - * Checks if this is a merge table - * - * If the ENGINE of the table is MERGE or MRG_MYISAM (alias), - * this is a merge table. - * - * - * @return boolean true if it is a merge table - */ - public function isMerge() - { - $engine = null; - // if called static, with parameters - if (! empty($this->_db_name) && ! empty($this->_name)) { - $engine = $this->getStatusInfo('ENGINE', null, true); - } - - // did we get engine? - if (empty($engine)) { - return false; - } - - // any of known merge engines? - return in_array( - mb_strtoupper($engine), - array('MERGE', 'MRG_MYISAM') - ); - } - - /** - * Returns full table status info, or specific if $info provided - * this info is collected from information_schema - * - * @param string $info specific information to be fetched - * @param boolean $force_read read new rather than serving from cache - * @param boolean $disable_error if true, disables error message - * - * @todo DatabaseInterface::getTablesFull needs to be merged - * somehow into this class or at least better documented - * - * @return mixed - */ - public function getStatusInfo( - $info = null, - $force_read = false, - $disable_error = false - ) { - $db = $this->_db_name; - $table = $this->_name; - - if (! empty($_SESSION['is_multi_query'])) { - $disable_error = true; - } - - // sometimes there is only one entry (ExactRows) so - // we have to get the table's details - if ($this->_dbi->getCachedTableContent(array($db, $table)) == null - || $force_read - || count($this->_dbi->getCachedTableContent(array($db, $table))) == 1 - ) { - $this->_dbi->getTablesFull($db, $table); - } - - if ($this->_dbi->getCachedTableContent(array($db, $table)) == null) { - // happens when we enter the table creation dialog - // or when we really did not get any status info, for example - // when $table == 'TABLE_NAMES' after the user tried SHOW TABLES - return ''; - } - - if (null === $info) { - return $this->_dbi->getCachedTableContent(array($db, $table)); - } - - // array_key_exists allows for null values - if (!array_key_exists( - $info, $this->_dbi->getCachedTableContent(array($db, $table)) - ) - ) { - if (! $disable_error) { - trigger_error( - __('Unknown table status:') . ' ' . $info, - E_USER_WARNING - ); - } - return false; - } - - return $this->_dbi->getCachedTableContent(array($db, $table, $info)); - } - - /** - * generates column specification for ALTER or CREATE TABLE syntax - * - * @param string $name name - * @param string $type type ('INT', 'VARCHAR', 'BIT', ...) - * @param string $length length ('2', '5,2', '', ...) - * @param string $attribute attribute - * @param string $collation collation - * @param bool|string $null with 'NULL' or 'NOT NULL' - * @param string $default_type whether default is CURRENT_TIMESTAMP, - * NULL, NONE, USER_DEFINED - * @param string $default_value default value for USER_DEFINED - * default type - * @param string $extra 'AUTO_INCREMENT' - * @param string $comment field comment - * @param string $virtuality virtuality of the column - * @param string $expression expression for the virtual column - * @param string $move_to new position for column - * - * @todo move into class PMA_Column - * @todo on the interface, some js to clear the default value when the - * default current_timestamp is checked - * - * @return string field specification - */ - static function generateFieldSpec($name, $type, $length = '', - $attribute = '', $collation = '', $null = false, - $default_type = 'USER_DEFINED', $default_value = '', $extra = '', - $comment = '', $virtuality = '', $expression = '', $move_to = '' - ) { - $is_timestamp = mb_strpos( - mb_strtoupper($type), - 'TIMESTAMP' - ) !== false; - - $query = Util::backquote($name) . ' ' . $type; - - // allow the possibility of a length for TIME, DATETIME and TIMESTAMP - // (will work on MySQL >= 5.6.4) - // - // MySQL permits a non-standard syntax for FLOAT and DOUBLE, - // see https://dev.mysql.com/doc/refman/5.5/en/floating-point-types.html - // - $pattern = '@^(DATE|TINYBLOB|TINYTEXT|BLOB|TEXT|' - . 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN|UUID)$@i'; - if (strlen($length) !== 0 && ! preg_match($pattern, $type)) { - // Note: The variable $length here can contain several other things - // besides length - ENUM/SET value or length of DECIMAL (eg. 12,3) - // so we can't just convert it to integer - $query .= '(' . $length . ')'; - } - - if ($virtuality) { - $query .= ' AS (' . $expression . ') ' . $virtuality; - } else { - if ($attribute != '') { - $query .= ' ' . $attribute; - - if ($is_timestamp - && preg_match('/TIMESTAMP/i', $attribute) - && $length !== 0 - ) { - $query .= '(' . $length . ')'; - } - } - - $matches = preg_match( - '@^(TINYTEXT|TEXT|MEDIUMTEXT|LONGTEXT|VARCHAR|CHAR|ENUM|SET)$@i', - $type - ); - if (! empty($collation) && $collation != 'NULL' && $matches) { - $query .= PMA_generateCharsetQueryPart($collation, true); - } - - if ($null !== false) { - if ($null == 'NULL') { - $query .= ' NULL'; - } else { - $query .= ' NOT NULL'; - } - } - - switch ($default_type) { - case 'USER_DEFINED' : - if ($is_timestamp && $default_value === '0') { - // a TIMESTAMP does not accept DEFAULT '0' - // but DEFAULT 0 works - $query .= ' DEFAULT 0'; - } elseif ($type == 'BIT') { - $query .= ' DEFAULT b\'' - . preg_replace('/[^01]/', '0', $default_value) - . '\''; - } elseif ($type == 'BOOLEAN') { - if (preg_match('/^1|T|TRUE|YES$/i', $default_value)) { - $query .= ' DEFAULT TRUE'; - } elseif (preg_match('/^0|F|FALSE|NO$/i', $default_value)) { - $query .= ' DEFAULT FALSE'; - } else { - // Invalid BOOLEAN value - $query .= ' DEFAULT \'' - . $GLOBALS['dbi']->escapeString($default_value) . '\''; - } - } elseif ($type == 'BINARY' || $type == 'VARBINARY') { - $query .= ' DEFAULT 0x' . $default_value; - } else { - $query .= ' DEFAULT \'' - . $GLOBALS['dbi']->escapeString($default_value) . '\''; - } - break; - /** @noinspection PhpMissingBreakStatementInspection */ - case 'NULL' : - // If user uncheck null checkbox and not change default value null, - // default value will be ignored. - if ($null !== false && $null !== 'NULL') { - break; - } - // else fall-through intended, no break here - case 'CURRENT_TIMESTAMP' : - $query .= ' DEFAULT ' . $default_type; - if ($length !== 0 && $is_timestamp) { - $query .= '(' . $length . ')'; - } - break; - case 'NONE' : - default : - break; - } - - if (!empty($extra)) { - $query .= ' ' . $extra; - } - } - if (!empty($comment)) { - $query .= " COMMENT '" . $GLOBALS['dbi']->escapeString($comment) . "'"; - } - - // move column - if ($move_to == '-first') { // dash can't appear as part of column name - $query .= ' FIRST'; - } elseif ($move_to != '') { - $query .= ' AFTER ' . Util::backquote($move_to); - } - return $query; - } // end function - - /** - * Checks if the number of records in a table is at least equal to - * $min_records - * - * @param int $min_records Number of records to check for in a table - * - * @return bool True, if at least $min_records exist, False otherwise. - */ - public function checkIfMinRecordsExist($min_records = 0) - { - $check_query = 'SELECT '; - $fieldsToSelect = ''; - - $uniqueFields = $this->getUniqueColumns(true, false); - if (count($uniqueFields) > 0) { - $fieldsToSelect = implode(', ', $uniqueFields); - } else { - $indexedCols = $this->getIndexedColumns(true, false); - if (count($indexedCols) > 0) { - $fieldsToSelect = implode(', ', $indexedCols); - } else { - $fieldsToSelect = '*'; - } - } - - $check_query .= $fieldsToSelect - . ' FROM ' . $this->getFullName(true) - . ' LIMIT ' . $min_records; - - $res = $GLOBALS['dbi']->tryQuery( - $check_query - ); - - if ($res !== false) { - $num_records = $GLOBALS['dbi']->numRows($res); - if ($num_records >= $min_records) { - return true; - } - } - - return false; - } - - /** - * Counts and returns (or displays) the number of records in a table - * - * @param bool $force_exact whether to force an exact count - * - * @return mixed the number of records if "retain" param is true, - * otherwise true - */ - public function countRecords($force_exact = false) - { - $is_view = $this->isView(); - $db = $this->_db_name; - $table = $this->_name; - - if ($this->_dbi->getCachedTableContent(array($db, $table, 'ExactRows')) != null) { - $row_count = $this->_dbi->getCachedTableContent( - array($db, $table, 'ExactRows') - ); - return $row_count; - } - $row_count = false; - - if (! $force_exact) { - if (($this->_dbi->getCachedTableContent(array($db, $table, 'Rows')) == null) - && !$is_view - ) { - $tmp_tables = $this->_dbi->getTablesFull($db, $table); - if (isset($tmp_tables[$table])) { - $this->_dbi->cacheTableContent( - array($db, $table), - $tmp_tables[$table] - ); - } - } - if ($this->_dbi->getCachedTableContent(array($db, $table, 'Rows')) != null) { - $row_count = $this->_dbi->getCachedTableContent( - array($db, $table, 'Rows') - ); - } else { - $row_count = false; - } - } - // for a VIEW, $row_count is always false at this point - if (false !== $row_count - && $row_count >= $GLOBALS['cfg']['MaxExactCount'] - ) { - return $row_count; - } - - if (! $is_view) { - $row_count = $this->_dbi->fetchValue( - 'SELECT COUNT(*) FROM ' . Util::backquote($db) . '.' - . Util::backquote($table) - ); - } else { - // For complex views, even trying to get a partial record - // count could bring down a server, so we offer an - // alternative: setting MaxExactCountViews to 0 will bypass - // completely the record counting for views - - if ($GLOBALS['cfg']['MaxExactCountViews'] == 0) { - $row_count = false; - } else { - // Counting all rows of a VIEW could be too long, - // so use a LIMIT clause. - // Use try_query because it can fail (when a VIEW is - // based on a table that no longer exists) - $result = $this->_dbi->tryQuery( - 'SELECT 1 FROM ' . Util::backquote($db) . '.' - . Util::backquote($table) . ' LIMIT ' - . $GLOBALS['cfg']['MaxExactCountViews'], - null, - DatabaseInterface::QUERY_STORE - ); - if (!$this->_dbi->getError()) { - $row_count = $this->_dbi->numRows($result); - $this->_dbi->freeResult($result); - } - } - } - if ($row_count) { - $this->_dbi->cacheTableContent(array($db, $table, 'ExactRows'), $row_count); - } - - return $row_count; - } // end of the 'Table::countRecords()' function - - /** - * Generates column specification for ALTER syntax - * - * @param string $oldcol old column name - * @param string $newcol new column name - * @param string $type type ('INT', 'VARCHAR', 'BIT', ...) - * @param string $length length ('2', '5,2', '', ...) - * @param string $attribute attribute - * @param string $collation collation - * @param bool|string $null with 'NULL' or 'NOT NULL' - * @param string $default_type whether default is CURRENT_TIMESTAMP, - * NULL, NONE, USER_DEFINED - * @param string $default_value default value for USER_DEFINED default - * type - * @param string $extra 'AUTO_INCREMENT' - * @param string $comment field comment - * @param string $virtuality virtuality of the column - * @param string $expression expression for the virtual column - * @param string $move_to new position for column - * - * @see Table::generateFieldSpec() - * - * @return string field specification - */ - static public function generateAlter($oldcol, $newcol, $type, $length, - $attribute, $collation, $null, $default_type, $default_value, - $extra, $comment, $virtuality, $expression, $move_to - ) { - return Util::backquote($oldcol) . ' ' - . Table::generateFieldSpec( - $newcol, $type, $length, $attribute, - $collation, $null, $default_type, $default_value, $extra, - $comment, $virtuality, $expression, $move_to - ); - } // end function - - /** - * Inserts existing entries in a PMA_* table by reading a value from an old - * entry - * - * @param string $work The array index, which Relation feature to - * check ('relwork', 'commwork', ...) - * @param string $pma_table The array index, which PMA-table to update - * ('bookmark', 'relation', ...) - * @param array $get_fields Which fields will be SELECT'ed from the old entry - * @param array $where_fields Which fields will be used for the WHERE query - * (array('FIELDNAME' => 'FIELDVALUE')) - * @param array $new_fields Which fields will be used as new VALUES. - * These are the important keys which differ - * from the old entry - * (array('FIELDNAME' => 'NEW FIELDVALUE')) - * - * @global relation variable - * - * @return int|true - */ - static public function duplicateInfo($work, $pma_table, $get_fields, - $where_fields, $new_fields - ) { - $last_id = -1; - - if (!isset($GLOBALS['cfgRelation']) || !$GLOBALS['cfgRelation'][$work]) { - return true; - } - - $select_parts = array(); - $row_fields = array(); - foreach ($get_fields as $get_field) { - $select_parts[] = Util::backquote($get_field); - $row_fields[$get_field] = 'cc'; - } - - $where_parts = array(); - foreach ($where_fields as $_where => $_value) { - $where_parts[] = Util::backquote($_where) . ' = \'' - . $GLOBALS['dbi']->escapeString($_value) . '\''; - } - - $new_parts = array(); - $new_value_parts = array(); - foreach ($new_fields as $_where => $_value) { - $new_parts[] = Util::backquote($_where); - $new_value_parts[] = $GLOBALS['dbi']->escapeString($_value); - } - - $table_copy_query = ' - SELECT ' . implode(', ', $select_parts) . ' - FROM ' . Util::backquote($GLOBALS['cfgRelation']['db']) . '.' - . Util::backquote($GLOBALS['cfgRelation'][$pma_table]) . ' - WHERE ' . implode(' AND ', $where_parts); - - // must use DatabaseInterface::QUERY_STORE here, since we execute - // another query inside the loop - $table_copy_rs = PMA_queryAsControlUser( - $table_copy_query, true, DatabaseInterface::QUERY_STORE - ); - - while ($table_copy_row = @$GLOBALS['dbi']->fetchAssoc($table_copy_rs)) { - $value_parts = array(); - foreach ($table_copy_row as $_key => $_val) { - if (isset($row_fields[$_key]) && $row_fields[$_key] == 'cc') { - $value_parts[] = $GLOBALS['dbi']->escapeString($_val); - } - } - - $new_table_query = 'INSERT IGNORE INTO ' - . Util::backquote($GLOBALS['cfgRelation']['db']) - . '.' . Util::backquote($GLOBALS['cfgRelation'][$pma_table]) - . ' (' . implode(', ', $select_parts) . ', ' - . implode(', ', $new_parts) . ') VALUES (\'' - . implode('\', \'', $value_parts) . '\', \'' - . implode('\', \'', $new_value_parts) . '\')'; - - PMA_queryAsControlUser($new_table_query); - $last_id = $GLOBALS['dbi']->insertId(); - } // end while - - $GLOBALS['dbi']->freeResult($table_copy_rs); - - return $last_id; - } // end of 'Table::duplicateInfo()' function - - /** - * Copies or renames table - * - * @param string $source_db source database - * @param string $source_table source table - * @param string $target_db target database - * @param string $target_table target table - * @param string $what what to be moved or copied (data, dataonly) - * @param bool $move whether to move - * @param string $mode mode - * - * @return bool true if success, false otherwise - */ - static public function moveCopy($source_db, $source_table, $target_db, - $target_table, $what, $move, $mode - ) { - - global $err_url; - - // Try moving the tables directly, using native `RENAME` statement. - if ($move && $what == 'data') { - $tbl = new Table($source_table, $source_db); - if ($tbl->rename($target_table, $target_db)) { - $GLOBALS['message'] = $tbl->getLastMessage(); - return true; - } - } - - // Setting required export settings. - $GLOBALS['sql_backquotes'] = 1; - $GLOBALS['asfile'] = 1; - - // Ensuring the target database is valid. - if (! $GLOBALS['dblist']->databases->exists($source_db, $target_db)) { - if (! $GLOBALS['dblist']->databases->exists($source_db)) { - $GLOBALS['message'] = Message::rawError( - sprintf( - __('Source database `%s` was not found!'), - htmlspecialchars($source_db) - ) - ); - } - if (! $GLOBALS['dblist']->databases->exists($target_db)) { - $GLOBALS['message'] = Message::rawError( - sprintf( - __('Target database `%s` was not found!'), - htmlspecialchars($target_db) - ) - ); - } - return false; - } - - /** - * The full name of source table, quoted. - * @var string $source - */ - $source = Util::backquote($source_db) - . '.' . Util::backquote($source_table); - - // If the target database is not specified, the operation is taking - // place in the same database. - if (! isset($target_db) || ! mb_strlen($target_db)) { - $target_db = $source_db; - } - - // Selecting the database could avoid some problems with replicated - // databases, when moving table from replicated one to not replicated one. - $GLOBALS['dbi']->selectDb($target_db); - - /** - * The full name of target table, quoted. - * @var string $target - */ - $target = Util::backquote($target_db) - . '.' . Util::backquote($target_table); - - // No table is created when this is a data-only operation. - if ($what != 'dataonly') { - - include_once "libraries/plugin_interface.lib.php"; - - /** - * Instance used for exporting the current structure of the table. - * - * @var \PMA\libraries\plugins\export\ExportSql - */ - $export_sql_plugin = PMA_getPlugin( - "export", - "sql", - 'libraries/plugins/export/', - array( - 'export_type' => 'table', - 'single_table' => false, - ) - ); - - $no_constraints_comments = true; - $GLOBALS['sql_constraints_query'] = ''; - // set the value of global sql_auto_increment variable - if (isset($_POST['sql_auto_increment'])) { - $GLOBALS['sql_auto_increment'] = $_POST['sql_auto_increment']; - } - - /** - * The old structure of the table.. - * @var string $sql_structure - */ - $sql_structure = $export_sql_plugin->getTableDef( - $source_db, $source_table, "\n", $err_url, false, false - ); - - unset($no_constraints_comments); - - // ----------------------------------------------------------------- - // Phase 0: Preparing structures used. - - /** - * The destination where the table is moved or copied to. - * @var Expression - */ - $destination = new Expression( - $target_db, $target_table, '' - ); - - // Find server's SQL mode so the builder can generate correct - // queries. - // One of the options that alters the behaviour is `ANSI_QUOTES`. - Context::setMode( - $GLOBALS['dbi']->fetchValue("SELECT @@sql_mode") - ); - - // ----------------------------------------------------------------- - // Phase 1: Dropping existent element of the same name (if exists - // and required). - - if (isset($_REQUEST['drop_if_exists']) - && $_REQUEST['drop_if_exists'] == 'true' - ) { - - /** - * Drop statement used for building the query. - * @var DropStatement $statement - */ - $statement = new DropStatement(); - - $tbl = new Table($target_db, $target_table); - - $statement->options = new OptionsArray( - array( - $tbl->isView() ? 'VIEW' : 'TABLE', - 'IF EXISTS', - ) - ); - - $statement->fields = array($destination); - - // Building the query. - $drop_query = $statement->build() . ';'; - - // Executing it. - $GLOBALS['dbi']->query($drop_query); - $GLOBALS['sql_query'] .= "\n" . $drop_query; - - // If an existing table gets deleted, maintain any entries for - // the PMA_* tables. - $maintain_relations = true; - } - - // ----------------------------------------------------------------- - // Phase 2: Generating the new query of this structure. - - /** - * The parser responsible for parsing the old queries. - * @var Parser $parser - */ - $parser = new Parser($sql_structure); - - if (!empty($parser->statements[0])) { - - /** - * The CREATE statement of this structure. - * @var \SqlParser\Statements\CreateStatement $statement - */ - $statement = $parser->statements[0]; - - // Changing the destination. - $statement->name = $destination; - - // Building back the query. - $sql_structure = $statement->build() . ';'; - - // Executing it. - $GLOBALS['dbi']->query($sql_structure); - $GLOBALS['sql_query'] .= "\n" . $sql_structure; - } - - // ----------------------------------------------------------------- - // Phase 3: Adding constraints. - // All constraint names are removed because they must be unique. - - if (($move || isset($GLOBALS['add_constraints'])) - && !empty($GLOBALS['sql_constraints_query']) - ) { - - $parser = new Parser($GLOBALS['sql_constraints_query']); - - /** - * The ALTER statement that generates the constraints. - * @var \SqlParser\Statements\AlterStatement $statement - */ - $statement = $parser->statements[0]; - - // Changing the altered table to the destination. - $statement->table = $destination; - - // Removing the name of the constraints. - foreach ($statement->altered as $idx => $altered) { - // All constraint names are removed because they must be unique. - if ($altered->options->has('CONSTRAINT')) { - $altered->field = null; - } - } - - // Building back the query. - $GLOBALS['sql_constraints_query'] = $statement->build() . ';'; - - // Executing it. - if ($mode == 'one_table') { - $GLOBALS['dbi']->query($GLOBALS['sql_constraints_query']); - } - $GLOBALS['sql_query'] .= "\n" . $GLOBALS['sql_constraints_query']; - if ($mode == 'one_table') { - unset($GLOBALS['sql_constraints_query']); - } - } - - // ----------------------------------------------------------------- - // Phase 4: Adding indexes. - // View phase 3. - - if (!empty($GLOBALS['sql_indexes'])) { - - $parser = new Parser($GLOBALS['sql_indexes']); - - $GLOBALS['sql_indexes'] = ''; - /** - * The ALTER statement that generates the indexes. - * @var \SqlParser\Statements\AlterStatement $statement - */ - foreach ($parser->statements as $statement) { - - // Changing the altered table to the destination. - $statement->table = $destination; - - // Removing the name of the constraints. - foreach ($statement->altered as $idx => $altered) { - // All constraint names are removed because they must be unique. - if ($altered->options->has('CONSTRAINT')) { - $altered->field = null; - } - } - - // Building back the query. - $sql_index = $statement->build() . ';'; - - // Executing it. - if ($mode == 'one_table' || $mode == 'db_copy') { - $GLOBALS['dbi']->query($sql_index); - } - - $GLOBALS['sql_indexes'] .= $sql_index; - } - - $GLOBALS['sql_query'] .= "\n" . $GLOBALS['sql_indexes']; - if ($mode == 'one_table' || $mode == 'db_copy') { - unset($GLOBALS['sql_indexes']); - } - } - - // ----------------------------------------------------------------- - // Phase 5: Adding AUTO_INCREMENT. - - if (! empty($GLOBALS['sql_auto_increments'])) { - if ($mode == 'one_table' || $mode == 'db_copy') { - - $parser = new Parser($GLOBALS['sql_auto_increments']); - - /** - * The ALTER statement that alters the AUTO_INCREMENT value. - * @var \SqlParser\Statements\AlterStatement $statement - */ - $statement = $parser->statements[0]; - - // Changing the altered table to the destination. - $statement->table = $destination; - - // Building back the query. - $GLOBALS['sql_auto_increments'] = $statement->build() . ';'; - - // Executing it. - $GLOBALS['dbi']->query($GLOBALS['sql_auto_increments']); - $GLOBALS['sql_query'] .= "\n" . $GLOBALS['sql_auto_increments']; - unset($GLOBALS['sql_auto_increments']); - } - } - } else { - $GLOBALS['sql_query'] = ''; - } - - $_table = new Table($target_table, $target_db); - // Copy the data unless this is a VIEW - if (($what == 'data' || $what == 'dataonly') - && ! $_table->isView() - ) { - $sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'"; - $GLOBALS['dbi']->query($sql_set_mode); - $GLOBALS['sql_query'] .= "\n\n" . $sql_set_mode . ';'; - - $_old_table = new Table($source_table, $source_db); - $nonGeneratedCols = $_old_table->getNonGeneratedColumns(true); - if (count($nonGeneratedCols) > 0) { - $sql_insert_data = 'INSERT INTO ' . $target . '(' - . implode(', ', $nonGeneratedCols) - . ') SELECT ' . implode(', ', $nonGeneratedCols) - . ' FROM ' . $source; - - $GLOBALS['dbi']->query($sql_insert_data); - $GLOBALS['sql_query'] .= "\n\n" . $sql_insert_data . ';'; - } - } - - PMA_getRelationsParam(); - - // Drops old table if the user has requested to move it - if ($move) { - - // This could avoid some problems with replicated databases, when - // moving table from replicated one to not replicated one - $GLOBALS['dbi']->selectDb($source_db); - - $_source_table = new Table($source_table, $source_db); - if ($_source_table->isView()) { - $sql_drop_query = 'DROP VIEW'; - } else { - $sql_drop_query = 'DROP TABLE'; - } - $sql_drop_query .= ' ' . $source; - $GLOBALS['dbi']->query($sql_drop_query); - - // Renable table in configuration storage - PMA_REL_renameTable( - $source_db, $target_db, - $source_table, $target_table - ); - - $GLOBALS['sql_query'] .= "\n\n" . $sql_drop_query . ';'; - // end if ($move) - return true; - } - - // we are copying - // Create new entries as duplicates from old PMA DBs - if ($what == 'dataonly' || isset($maintain_relations)) { - return true; - } - - if ($GLOBALS['cfgRelation']['commwork']) { - // Get all comments and MIME-Types for current table - $comments_copy_rs = PMA_queryAsControlUser( - 'SELECT column_name, comment' - . ($GLOBALS['cfgRelation']['mimework'] - ? ', mimetype, transformation, transformation_options' - : '') - . ' FROM ' - . Util::backquote($GLOBALS['cfgRelation']['db']) - . '.' - . Util::backquote($GLOBALS['cfgRelation']['column_info']) - . ' WHERE ' - . ' db_name = \'' - . $GLOBALS['dbi']->escapeString($source_db) . '\'' - . ' AND ' - . ' table_name = \'' - . $GLOBALS['dbi']->escapeString($source_table) . '\'' - ); - - // Write every comment as new copied entry. [MIME] - while ($comments_copy_row - = $GLOBALS['dbi']->fetchAssoc($comments_copy_rs)) { - $new_comment_query = 'REPLACE INTO ' - . Util::backquote($GLOBALS['cfgRelation']['db']) - . '.' . Util::backquote( - $GLOBALS['cfgRelation']['column_info'] - ) - . ' (db_name, table_name, column_name, comment' - . ($GLOBALS['cfgRelation']['mimework'] - ? ', mimetype, transformation, transformation_options' - : '') - . ') ' . ' VALUES(' . '\'' . $GLOBALS['dbi']->escapeString($target_db) - . '\',\'' . $GLOBALS['dbi']->escapeString($target_table) . '\',\'' - . $GLOBALS['dbi']->escapeString($comments_copy_row['column_name']) - . '\'' - . ($GLOBALS['cfgRelation']['mimework'] - ? ',\'' . $GLOBALS['dbi']->escapeString( - $comments_copy_row['comment'] - ) - . '\',' . '\'' . $GLOBALS['dbi']->escapeString( - $comments_copy_row['mimetype'] - ) - . '\',' . '\'' . $GLOBALS['dbi']->escapeString( - $comments_copy_row['transformation'] - ) - . '\',' . '\'' . $GLOBALS['dbi']->escapeString( - $comments_copy_row['transformation_options'] - ) - . '\'' - : '') - . ')'; - PMA_queryAsControlUser($new_comment_query); - } // end while - $GLOBALS['dbi']->freeResult($comments_copy_rs); - unset($comments_copy_rs); - } - - // duplicating the bookmarks must not be done here, but - // just once per db - - $get_fields = array('display_field'); - $where_fields = array( - 'db_name' => $source_db, - 'table_name' => $source_table - ); - $new_fields = array( - 'db_name' => $target_db, - 'table_name' => $target_table - ); - Table::duplicateInfo( - 'displaywork', - 'table_info', - $get_fields, - $where_fields, - $new_fields - ); - - /** - * @todo revise this code when we support cross-db relations - */ - $get_fields = array( - 'master_field', - 'foreign_table', - 'foreign_field' - ); - $where_fields = array( - 'master_db' => $source_db, - 'master_table' => $source_table - ); - $new_fields = array( - 'master_db' => $target_db, - 'foreign_db' => $target_db, - 'master_table' => $target_table - ); - Table::duplicateInfo( - 'relwork', - 'relation', - $get_fields, - $where_fields, - $new_fields - ); - - $get_fields = array( - 'foreign_field', - 'master_table', - 'master_field' - ); - $where_fields = array( - 'foreign_db' => $source_db, - 'foreign_table' => $source_table - ); - $new_fields = array( - 'master_db' => $target_db, - 'foreign_db' => $target_db, - 'foreign_table' => $target_table - ); - Table::duplicateInfo( - 'relwork', - 'relation', - $get_fields, - $where_fields, - $new_fields - ); - - /** - * @todo Can't get duplicating PDFs the right way. The - * page numbers always get screwed up independently from - * duplication because the numbers do not seem to be stored on a - * per-database basis. Would the author of pdf support please - * have a look at it? - * - $get_fields = array('page_descr'); - $where_fields = array('db_name' => $source_db); - $new_fields = array('db_name' => $target_db); - $last_id = Table::duplicateInfo( - 'pdfwork', - 'pdf_pages', - $get_fields, - $where_fields, - $new_fields - ); - - if (isset($last_id) && $last_id >= 0) { - $get_fields = array('x', 'y'); - $where_fields = array( - 'db_name' => $source_db, - 'table_name' => $source_table - ); - $new_fields = array( - 'db_name' => $target_db, - 'table_name' => $target_table, - 'pdf_page_number' => $last_id - ); - Table::duplicateInfo( - 'pdfwork', - 'table_coords', - $get_fields, - $where_fields, - $new_fields - ); - } - */ - - return true; - } - - /** - * checks if given name is a valid table name, - * currently if not empty, trailing spaces, '.', '/' and '\' - * - * @param string $table_name name to check - * @param boolean $is_backquoted whether this name is used inside backquotes or not - * - * @todo add check for valid chars in filename on current system/os - * @see https://dev.mysql.com/doc/refman/5.0/en/legal-names.html - * - * @return boolean whether the string is valid or not - */ - static function isValidName($table_name, $is_backquoted = false) - { - if ($table_name !== rtrim($table_name)) { - // trailing spaces not allowed even in backquotes - return false; - } - - if (! mb_strlen($table_name)) { - // zero length - return false; - } - - if (! $is_backquoted && $table_name !== trim($table_name)) { - // spaces at the start or in between only allowed inside backquotes - return false; - } - - if (! $is_backquoted && preg_match('/^[a-zA-Z0-9_$]+$/', $table_name)) { - // only allow the above regex in unquoted identifiers - // see : http://dev.mysql.com/doc/refman/5.7/en/identifiers.html - return true; - } else if ($is_backquoted) { - // If backquoted, all characters should be allowed (except w/ trailing spaces) - return true; - } - - // If not backquoted and doesn't follow the above regex - return false; - } - - /** - * renames table - * - * @param string $new_name new table name - * @param string $new_db new database name - * - * @return bool success - */ - function rename($new_name, $new_db = null) - { - $lowerCaseTableNames = Util::cacheGet( - 'lower_case_table_names', - function () { - return $GLOBALS['dbi']->fetchValue( - "SELECT @@lower_case_table_names" - ); - } - ); - if ($lowerCaseTableNames) { - $new_name = strtolower($new_name); - } - - if (null !== $new_db && $new_db !== $this->getDbName()) { - // Ensure the target is valid - if (! $GLOBALS['dblist']->databases->exists($new_db)) { - $this->errors[] = __('Invalid database:') . ' ' . $new_db; - return false; - } - } else { - $new_db = $this->getDbName(); - } - - $new_table = new Table($new_name, $new_db); - - if ($this->getFullName() === $new_table->getFullName()) { - return true; - } - - // Allow whitespaces (not trailing) in $new_name, - // since we are using $backquoted in getting the fullName of table - // below to be used in the query - if (! Table::isValidName($new_name, true)) { - $this->errors[] = __('Invalid table name:') . ' ' - . $new_table->getFullName(); - return false; - } - - // If the table is moved to a different database drop its triggers first - $triggers = $this->_dbi->getTriggers( - $this->getDbName(), $this->getName(), '' - ); - $handle_triggers = $this->getDbName() != $new_db && $triggers; - if ($handle_triggers) { - foreach ($triggers as $trigger) { - $sql = 'DROP TRIGGER IF EXISTS ' - . Util::backquote($this->getDbName()) - . '.' . Util::backquote($trigger['name']) . ';'; - $this->_dbi->query($sql); - } - } - - /* - * tested also for a view, in MySQL 5.0.92, 5.1.55 and 5.5.13 - */ - $GLOBALS['sql_query'] = ' - RENAME TABLE ' . $this->getFullName(true) . ' - TO ' . $new_table->getFullName(true) . ';'; - // I don't think a specific error message for views is necessary - if (! $this->_dbi->query($GLOBALS['sql_query'])) { - // Restore triggers in the old database - if ($handle_triggers) { - $this->_dbi->selectDb($this->getDbName()); - foreach ($triggers as $trigger) { - $this->_dbi->query($trigger['create']); - } - } - $this->errors[] = sprintf( - __('Failed to rename table %1$s to %2$s!'), - $this->getFullName(), - $new_table->getFullName() - ); - return false; - } - - $old_name = $this->getName(); - $old_db = $this->getDbName(); - $this->_name = $new_name; - $this->_db_name = $new_db; - - // Renable table in configuration storage - PMA_REL_renameTable( - $old_db, $new_db, - $old_name, $new_name - ); - - $this->messages[] = sprintf( - __('Table %1$s has been renamed to %2$s.'), - htmlspecialchars($old_name), - htmlspecialchars($new_name) - ); - return true; - } - - /** - * Get all unique columns - * - * returns an array with all columns with unique content, in fact these are - * all columns being single indexed in PRIMARY or UNIQUE - * - * e.g. - * - PRIMARY(id) // id - * - UNIQUE(name) // name - * - PRIMARY(fk_id1, fk_id2) // NONE - * - UNIQUE(x,y) // NONE - * - * @param bool $backquoted whether to quote name with backticks `` - * @param bool $fullName whether to include full name of the table as a prefix - * - * @return array - */ - public function getUniqueColumns($backquoted = true, $fullName = true) - { - $sql = $this->_dbi->getTableIndexesSql( - $this->getDbName(), - $this->getName(), - 'Non_unique = 0' - ); - $uniques = $this->_dbi->fetchResult( - $sql, - array('Key_name', null), - 'Column_name' - ); - - $return = array(); - foreach ($uniques as $index) { - if (count($index) > 1) { - continue; - } - if ($fullName) { - $possible_column = $this->getFullName($backquoted) . '.'; - } else { - $possible_column = ''; - } - if ($backquoted) { - $possible_column .= Util::backquote($index[0]); - } else { - $possible_column .= $index[0]; - } - // a column might have a primary and an unique index on it - if (! in_array($possible_column, $return)) { - $return[] = $possible_column; - } - } - - return $return; - } - - /** - * Get all indexed columns - * - * returns an array with all columns that make use of an index - * - * e.g. index(col1, col2) would return col1, col2 - * - * @param bool $backquoted whether to quote name with backticks `` - * @param bool $fullName whether to include full name of the table as a prefix - * - * @return array - */ - public function getIndexedColumns($backquoted = true, $fullName = true) - { - $sql = $this->_dbi->getTableIndexesSql( - $this->getDbName(), - $this->getName(), - '' - ); - $indexed = $this->_dbi->fetchResult($sql, 'Column_name', 'Column_name'); - - $return = array(); - foreach ($indexed as $column) { - $return[] = ($fullName ? $this->getFullName($backquoted) . '.' : '') - . ($backquoted ? Util::backquote($column) : $column); - } - - return $return; - } - - /** - * Get all columns - * - * returns an array with all columns - * - * @param bool $backquoted whether to quote name with backticks `` - * @param bool $fullName whether to include full name of the table as a prefix - * - * @return array - */ - public function getColumns($backquoted = true, $fullName = true) - { - $sql = 'SHOW COLUMNS FROM ' . $this->getFullName(true); - $indexed = $this->_dbi->fetchResult($sql, 'Field', 'Field'); - - $return = array(); - foreach ($indexed as $column) { - $return[] = ($fullName ? $this->getFullName($backquoted) . '.' : '') - . ($backquoted ? Util::backquote($column) : $column); - } - - return $return; - } - - /** - * Get meta info for fields in table - * - * @return mixed - */ - public function getColumnsMeta() - { - $move_columns_sql_query = sprintf( - 'SELECT * FROM %s.%s LIMIT 1', - Util::backquote($this->_db_name), - Util::backquote($this->_name) - ); - $move_columns_sql_result = $this->_dbi->tryQuery($move_columns_sql_query); - if ($move_columns_sql_result !== false) { - return $this->_dbi->getFieldsMeta($move_columns_sql_result); - } else { - // unsure how to reproduce but it was seen on the reporting server - return array(); - } - } - - /** - * Get non-generated columns in table - * - * @param bool $backquoted whether to quote name with backticks `` - * - * @return array - */ - public function getNonGeneratedColumns($backquoted = true) - { - $columns_meta_query = 'SHOW COLUMNS FROM ' . $this->getFullName(true); - $ret = array(); - - $columns_meta_query_result = $this->_dbi->fetchResult( - $columns_meta_query - ); - - if ($columns_meta_query_result - && $columns_meta_query_result !== false - ) { - foreach ($columns_meta_query_result as $column) { - $value = $column['Field']; - if ($backquoted === true) { - $value = Util::backquote($value); - } - - if (strpos($column['Extra'], 'GENERATED') === false) { - array_push($ret, $value); - } - } - } - - return $ret; - } - - /** - * Return UI preferences for this table from phpMyAdmin database. - * - * @return array - */ - protected function getUiPrefsFromDb() - { - $cfgRelation = PMA_getRelationsParam(); - $pma_table = Util::backquote($cfgRelation['db']) . "." - . Util::backquote($cfgRelation['table_uiprefs']); - - // Read from phpMyAdmin database - $sql_query = " SELECT `prefs` FROM " . $pma_table - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'" - . " AND `db_name` = '" . $GLOBALS['dbi']->escapeString($this->_db_name) . "'" - . " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($this->_name) . "'"; - - $row = $this->_dbi->fetchArray(PMA_queryAsControlUser($sql_query)); - if (isset($row[0])) { - return json_decode($row[0], true); - } else { - return array(); - } - } - - /** - * Save this table's UI preferences into phpMyAdmin database. - * - * @return true|Message - */ - protected function saveUiPrefsToDb() - { - $cfgRelation = PMA_getRelationsParam(); - $pma_table = Util::backquote($cfgRelation['db']) . "." - . Util::backquote($cfgRelation['table_uiprefs']); - - $secureDbName = $GLOBALS['dbi']->escapeString($this->_db_name); - - $username = $GLOBALS['cfg']['Server']['user']; - $sql_query = " REPLACE INTO " . $pma_table - . " (username, db_name, table_name, prefs) VALUES ('" - . $GLOBALS['dbi']->escapeString($username) . "', '" . $secureDbName - . "', '" . $GLOBALS['dbi']->escapeString($this->_name) . "', '" - . $GLOBALS['dbi']->escapeString(json_encode($this->uiprefs)) . "')"; - - $success = $this->_dbi->tryQuery($sql_query, $GLOBALS['controllink']); - - if (!$success) { - $message = Message::error( - __('Could not save table UI preferences!') - ); - $message->addMessage('

    '); - $message->addMessage( - Message::rawError( - $this->_dbi->getError($GLOBALS['controllink']) - ) - ); - return $message; - } - - // Remove some old rows in table_uiprefs if it exceeds the configured - // maximum rows - $sql_query = 'SELECT COUNT(*) FROM ' . $pma_table; - $rows_count = $this->_dbi->fetchValue($sql_query); - $max_rows = $GLOBALS['cfg']['Server']['MaxTableUiprefs']; - if ($rows_count > $max_rows) { - $num_rows_to_delete = $rows_count - $max_rows; - $sql_query - = ' DELETE FROM ' . $pma_table . - ' ORDER BY last_update ASC' . - ' LIMIT ' . $num_rows_to_delete; - $success = $this->_dbi->tryQuery( - $sql_query, $GLOBALS['controllink'] - ); - - if (!$success) { - $message = Message::error( - sprintf( - __( - 'Failed to cleanup table UI preferences (see ' . - '$cfg[\'Servers\'][$i][\'MaxTableUiprefs\'] %s)' - ), - Util::showDocu('config', 'cfg_Servers_MaxTableUiprefs') - ) - ); - $message->addMessage('

    '); - $message->addMessage( - Message::rawError( - $this->_dbi->getError($GLOBALS['controllink']) - ) - ); - return $message; - } - } - - return true; - } - - /** - * Loads the UI preferences for this table. - * If pmadb and table_uiprefs is set, it will load the UI preferences from - * phpMyAdmin database. - * - * @return void - */ - protected function loadUiPrefs() - { - $cfgRelation = PMA_getRelationsParam(); - $server_id = $GLOBALS['server']; - - // set session variable if it's still undefined - if (!isset($_SESSION['tmpval']['table_uiprefs'][$server_id][$this->_db_name][$this->_name])) { - // check whether we can get from pmadb - $_SESSION['tmpval']['table_uiprefs'][$server_id][$this->_db_name] - [$this->_name] = $cfgRelation['uiprefswork'] - ? $this->getUiPrefsFromDb() - : array(); - } - $this->uiprefs =& $_SESSION['tmpval']['table_uiprefs'][$server_id] - [$this->_db_name][$this->_name]; - } - - /** - * Get a property from UI preferences. - * Return false if the property is not found. - * Available property: - * - PROP_SORTED_COLUMN - * - PROP_COLUMN_ORDER - * - PROP_COLUMN_VISIB - * - * @param string $property property - * - * @return mixed - */ - public function getUiProp($property) - { - if (! isset($this->uiprefs)) { - $this->loadUiPrefs(); - } - - // do checking based on property - if ($property == self::PROP_SORTED_COLUMN) { - if (!isset($this->uiprefs[$property])) { - return false; - } - - if (!isset($_REQUEST['discard_remembered_sort'])) { - // check if the column name exists in this table - $tmp = explode(' ', $this->uiprefs[$property]); - $colname = $tmp[0]; - //remove backquoting from colname - $colname = str_replace('`', '', $colname); - //get the available column name without backquoting - $avail_columns = $this->getColumns(false); - - foreach ($avail_columns as $each_col) { - // check if $each_col ends with $colname - if (substr_compare( - $each_col, - $colname, - mb_strlen($each_col) - mb_strlen($colname) - ) === 0 - ) { - return $this->uiprefs[$property]; - } - } - } - // remove the property, since it no longer exists in database - $this->removeUiProp(self::PROP_SORTED_COLUMN); - return false; - } - - if ($property == self::PROP_COLUMN_ORDER - || $property == self::PROP_COLUMN_VISIB - ) { - if ($this->isView() || !isset($this->uiprefs[$property])) { - return false; - } - - // check if the table has not been modified - if ($this->getStatusInfo('Create_time') == $this->uiprefs['CREATE_TIME'] - ) { - return $this->uiprefs[$property]; - } - - // remove the property, since the table has been modified - $this->removeUiProp(self::PROP_COLUMN_ORDER); - return false; - } - - // default behaviour for other property: - return isset($this->uiprefs[$property]) ? $this->uiprefs[$property] : false; - } - - /** - * Set a property from UI preferences. - * If pmadb and table_uiprefs is set, it will save the UI preferences to - * phpMyAdmin database. - * Available property: - * - PROP_SORTED_COLUMN - * - PROP_COLUMN_ORDER - * - PROP_COLUMN_VISIB - * - * @param string $property Property - * @param mixed $value Value for the property - * @param string $table_create_time Needed for PROP_COLUMN_ORDER - * and PROP_COLUMN_VISIB - * - * @return boolean|Message - */ - public function setUiProp($property, $value, $table_create_time = null) - { - if (! isset($this->uiprefs)) { - $this->loadUiPrefs(); - } - // we want to save the create time if the property is PROP_COLUMN_ORDER - if (! $this->isView() - && ($property == self::PROP_COLUMN_ORDER - || $property == self::PROP_COLUMN_VISIB) - ) { - $curr_create_time = $this->getStatusInfo('CREATE_TIME'); - if (isset($table_create_time) - && $table_create_time == $curr_create_time - ) { - $this->uiprefs['CREATE_TIME'] = $curr_create_time; - } else { - // there is no $table_create_time, or - // supplied $table_create_time is older than current create time, - // so don't save - return Message::error( - sprintf( - __( - 'Cannot save UI property "%s". The changes made will ' . - 'not be persistent after you refresh this page. ' . - 'Please check if the table structure has been changed.' - ), - $property - ) - ); - } - } - // save the value - $this->uiprefs[$property] = $value; - - // check if pmadb is set - $cfgRelation = PMA_getRelationsParam(); - if ($cfgRelation['uiprefswork']) { - return $this->saveUiprefsToDb(); - } - return true; - } - - /** - * Remove a property from UI preferences. - * - * @param string $property the property - * - * @return true|Message - */ - public function removeUiProp($property) - { - if (! isset($this->uiprefs)) { - $this->loadUiPrefs(); - } - if (isset($this->uiprefs[$property])) { - unset($this->uiprefs[$property]); - - // check if pmadb is set - $cfgRelation = PMA_getRelationsParam(); - if ($cfgRelation['uiprefswork']) { - return $this->saveUiprefsToDb(); - } - } - return true; - } - - /** - * Get all column names which are MySQL reserved words - * - * @return array - * @access public - */ - public function getReservedColumnNames() - { - $columns = $this->getColumns(false); - $return = array(); - foreach ($columns as $column) { - $temp = explode('.', $column); - $column_name = $temp[2]; - if (Context::isKeyword($column_name, true)) { - $return[] = $column_name; - } - } - return $return; - } - - /** - * Function to get the name and type of the columns of a table - * - * @return array - */ - public function getNameAndTypeOfTheColumns() - { - $columns = array(); - foreach ($this->_dbi->getColumnsFull( - $this->_db_name, $this->_name - ) as $row) { - if (preg_match('@^(set|enum)\((.+)\)$@i', $row['Type'], $tmp)) { - $tmp[2] = mb_substr( - preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1 - ); - $columns[$row['Field']] = $tmp[1] . '(' - . str_replace(',', ', ', $tmp[2]) . ')'; - } else { - $columns[$row['Field']] = $row['Type']; - } - } - return $columns; - } - - /** - * Get index with index name - * - * @param string $index Index name - * - * @return Index - */ - public function getIndex($index) - { - return Index::singleton($this->_db_name, $this->_name, $index); - } - - /** - * Function to get the sql query for index creation or edit - * - * @param Index $index current index - * @param bool &$error whether error occurred or not - * - * @return string - */ - public function getSqlQueryForIndexCreateOrEdit($index, &$error) - { - // $sql_query is the one displayed in the query box - $sql_query = sprintf( - 'ALTER TABLE %s.%s', - Util::backquote($this->_db_name), - Util::backquote($this->_name) - ); - - // Drops the old index - if (! empty($_REQUEST['old_index'])) { - if ($_REQUEST['old_index'] == 'PRIMARY') { - $sql_query .= ' DROP PRIMARY KEY,'; - } else { - $sql_query .= sprintf( - ' DROP INDEX %s,', - Util::backquote($_REQUEST['old_index']) - ); - } - } // end if - - // Builds the new one - switch ($index->getChoice()) { - case 'PRIMARY': - if ($index->getName() == '') { - $index->setName('PRIMARY'); - } elseif ($index->getName() != 'PRIMARY') { - $error = Message::error( - __('The name of the primary key must be "PRIMARY"!') - ); - } - $sql_query .= ' ADD PRIMARY KEY'; - break; - case 'FULLTEXT': - case 'UNIQUE': - case 'INDEX': - case 'SPATIAL': - if ($index->getName() == 'PRIMARY') { - $error = Message::error( - __('Can\'t rename index to PRIMARY!') - ); - } - $sql_query .= sprintf( - ' ADD %s ', - $index->getChoice() - ); - if ($index->getName()) { - $sql_query .= Util::backquote($index->getName()); - } - break; - } // end switch - - $index_fields = array(); - foreach ($index->getColumns() as $key => $column) { - $index_fields[$key] = Util::backquote($column->getName()); - if ($column->getSubPart()) { - $index_fields[$key] .= '(' . $column->getSubPart() . ')'; - } - } // end while - - if (empty($index_fields)) { - $error = Message::error(__('No index parts defined!')); - } else { - $sql_query .= ' (' . implode(', ', $index_fields) . ')'; - } - - $keyBlockSizes = $index->getKeyBlockSize(); - if (! empty($keyBlockSizes)) { - $sql_query .= sprintf( - ' KEY_BLOCK_SIZE = ', - $GLOBALS['dbi']->escapeString($keyBlockSizes) - ); - } - - // specifying index type is allowed only for primary, unique and index only - $type = $index->getType(); - if ($index->getChoice() != 'SPATIAL' - && $index->getChoice() != 'FULLTEXT' - && in_array($type, Index::getIndexTypes()) - ) { - $sql_query .= ' USING ' . $type; - } - - $parser = $index->getParser(); - if ($index->getChoice() == 'FULLTEXT' && ! empty($parser)) { - $sql_query .= ' WITH PARSER ' . $GLOBALS['dbi']->escapeString($parser); - } - - $comment = $index->getComment(); - if (! empty($comment)) { - $sql_query .= sprintf( - " COMMENT '%s'", - $GLOBALS['dbi']->escapeString($comment) - ); - } - - $sql_query .= ';'; - - return $sql_query; - } - - /** - * Function to handle update for display field - * - * @param string $disp current display field - * @param string $display_field display field - * @param array $cfgRelation configuration relation - * - * @return boolean True on update succeed or False on failure - */ - public function updateDisplayField($disp, $display_field, $cfgRelation) - { - $upd_query = false; - if ($disp) { - if ($display_field == '') { - $upd_query = 'DELETE FROM ' - . Util::backquote($GLOBALS['cfgRelation']['db']) - . '.' . Util::backquote($cfgRelation['table_info']) - . ' WHERE db_name = \'' - . $GLOBALS['dbi']->escapeString($this->_db_name) . '\'' - . ' AND table_name = \'' - . $GLOBALS['dbi']->escapeString($this->_name) . '\''; - } elseif ($disp != $display_field) { - $upd_query = 'UPDATE ' - . Util::backquote($GLOBALS['cfgRelation']['db']) - . '.' . Util::backquote($cfgRelation['table_info']) - . ' SET display_field = \'' - . $GLOBALS['dbi']->escapeString($display_field) . '\'' - . ' WHERE db_name = \'' - . $GLOBALS['dbi']->escapeString($this->_db_name) . '\'' - . ' AND table_name = \'' - . $GLOBALS['dbi']->escapeString($this->_name) . '\''; - } - } elseif ($display_field != '') { - $upd_query = 'INSERT INTO ' - . Util::backquote($GLOBALS['cfgRelation']['db']) - . '.' . Util::backquote($cfgRelation['table_info']) - . '(db_name, table_name, display_field) VALUES(' - . '\'' . $GLOBALS['dbi']->escapeString($this->_db_name) . '\',' - . '\'' . $GLOBALS['dbi']->escapeString($this->_name) . '\',' - . '\'' . $GLOBALS['dbi']->escapeString($display_field) . '\')'; - } - - if ($upd_query) { - $this->_dbi->query( - $upd_query, - $GLOBALS['controllink'], - 0, - false - ); - return true; - } - return false; - } - - /** - * Function to get update query for updating internal relations - * - * @param array $multi_edit_columns_name multi edit column names - * @param array $destination_db destination tables - * @param array $destination_table destination tables - * @param array $destination_column destination columns - * @param array $cfgRelation configuration relation - * @param array|null $existrel db, table, column - * - * @return boolean - */ - public function updateInternalRelations($multi_edit_columns_name, - $destination_db, $destination_table, $destination_column, - $cfgRelation, $existrel - ) { - $updated = false; - foreach ($destination_db as $master_field_md5 => $foreign_db) { - $upd_query = null; - // Map the fieldname's md5 back to its real name - $master_field = $multi_edit_columns_name[$master_field_md5]; - $foreign_table = $destination_table[$master_field_md5]; - $foreign_field = $destination_column[$master_field_md5]; - if (! empty($foreign_db) - && ! empty($foreign_table) - && ! empty($foreign_field) - ) { - if (! isset($existrel[$master_field])) { - $upd_query = 'INSERT INTO ' - . Util::backquote($GLOBALS['cfgRelation']['db']) - . '.' . Util::backquote($cfgRelation['relation']) - . '(master_db, master_table, master_field, foreign_db,' - . ' foreign_table, foreign_field)' - . ' values(' - . '\'' . $GLOBALS['dbi']->escapeString($this->_db_name) . '\', ' - . '\'' . $GLOBALS['dbi']->escapeString($this->_name) . '\', ' - . '\'' . $GLOBALS['dbi']->escapeString($master_field) . '\', ' - . '\'' . $GLOBALS['dbi']->escapeString($foreign_db) . '\', ' - . '\'' . $GLOBALS['dbi']->escapeString($foreign_table) . '\',' - . '\'' . $GLOBALS['dbi']->escapeString($foreign_field) . '\')'; - - } elseif ($existrel[$master_field]['foreign_db'] != $foreign_db - || $existrel[$master_field]['foreign_table'] != $foreign_table - || $existrel[$master_field]['foreign_field'] != $foreign_field - ) { - $upd_query = 'UPDATE ' - . Util::backquote($GLOBALS['cfgRelation']['db']) - . '.' . Util::backquote($cfgRelation['relation']) - . ' SET foreign_db = \'' - . $GLOBALS['dbi']->escapeString($foreign_db) . '\', ' - . ' foreign_table = \'' - . $GLOBALS['dbi']->escapeString($foreign_table) . '\', ' - . ' foreign_field = \'' - . $GLOBALS['dbi']->escapeString($foreign_field) . '\' ' - . ' WHERE master_db = \'' - . $GLOBALS['dbi']->escapeString($this->_db_name) . '\'' - . ' AND master_table = \'' - . $GLOBALS['dbi']->escapeString($this->_name) . '\'' - . ' AND master_field = \'' - . $GLOBALS['dbi']->escapeString($master_field) . '\''; - } // end if... else.... - } elseif (isset($existrel[$master_field])) { - $upd_query = 'DELETE FROM ' - . Util::backquote($GLOBALS['cfgRelation']['db']) - . '.' . Util::backquote($cfgRelation['relation']) - . ' WHERE master_db = \'' - . $GLOBALS['dbi']->escapeString($this->_db_name) . '\'' - . ' AND master_table = \'' - . $GLOBALS['dbi']->escapeString($this->_name) . '\'' - . ' AND master_field = \'' - . $GLOBALS['dbi']->escapeString($master_field) . '\''; - } // end if... else.... - - if (isset($upd_query)) { - $this->_dbi->query( - $upd_query, - $GLOBALS['controllink'], - 0, - false - ); - $updated = true; - } - } - return $updated; - } - - /** - * Function to handle foreign key updates - * - * @param array $destination_foreign_db destination foreign database - * @param array $multi_edit_columns_name multi edit column names - * @param array $destination_foreign_table destination foreign table - * @param array $destination_foreign_column destination foreign column - * @param array $options_array options array - * @param string $table current table - * @param array $existrel_foreign db, table, column - * - * @return array - */ - public function updateForeignKeys($destination_foreign_db, - $multi_edit_columns_name, $destination_foreign_table, - $destination_foreign_column, $options_array, $table, $existrel_foreign - ) { - $html_output = ''; - $preview_sql_data = ''; - $display_query = ''; - $seen_error = false; - - foreach ($destination_foreign_db as $master_field_md5 => $foreign_db) { - $create = false; - $drop = false; - - // Map the fieldname's md5 back to its real name - $master_field = $multi_edit_columns_name[$master_field_md5]; - - $foreign_table = $destination_foreign_table[$master_field_md5]; - $foreign_field = $destination_foreign_column[$master_field_md5]; - - if (isset($existrel_foreign[$master_field_md5]['ref_db_name'])) { - $ref_db_name = $existrel_foreign[$master_field_md5]['ref_db_name']; - } else { - $ref_db_name = $GLOBALS['db']; - } - - $empty_fields = false; - foreach ($master_field as $key => $one_field) { - if ((! empty($one_field) && empty($foreign_field[$key])) - || (empty($one_field) && ! empty($foreign_field[$key])) - ) { - $empty_fields = true; - } - - if (empty($one_field) && empty($foreign_field[$key])) { - unset($master_field[$key]); - unset($foreign_field[$key]); - } - } - - if (! empty($foreign_db) - && ! empty($foreign_table) - && ! $empty_fields - ) { - if (isset($existrel_foreign[$master_field_md5])) { - $constraint_name - = $existrel_foreign[$master_field_md5]['constraint']; - $on_delete = !empty( - $existrel_foreign[$master_field_md5]['on_delete'] - ) - ? $existrel_foreign[$master_field_md5]['on_delete'] - : 'RESTRICT'; - $on_update = ! empty( - $existrel_foreign[$master_field_md5]['on_update'] - ) - ? $existrel_foreign[$master_field_md5]['on_update'] - : 'RESTRICT'; - - if ($ref_db_name != $foreign_db - || $existrel_foreign[$master_field_md5]['ref_table_name'] != $foreign_table - || $existrel_foreign[$master_field_md5]['ref_index_list'] != $foreign_field - || $existrel_foreign[$master_field_md5]['index_list'] != $master_field - || $_REQUEST['constraint_name'][$master_field_md5] != $constraint_name - || ($_REQUEST['on_delete'][$master_field_md5] != $on_delete) - || ($_REQUEST['on_update'][$master_field_md5] != $on_update) - ) { - // another foreign key is already defined for this field - // or an option has been changed for ON DELETE or ON UPDATE - $drop = true; - $create = true; - } // end if... else.... - } else { - // no key defined for this field(s) - $create = true; - } - } elseif (isset($existrel_foreign[$master_field_md5])) { - $drop = true; - } // end if... else.... - - $tmp_error_drop = false; - if ($drop) { - $drop_query = 'ALTER TABLE ' . Util::backquote($table) - . ' DROP FOREIGN KEY ' - . Util::backquote( - $existrel_foreign[$master_field_md5]['constraint'] - ) - . ';'; - - if (! isset($_REQUEST['preview_sql'])) { - $display_query .= $drop_query . "\n"; - $this->_dbi->tryQuery($drop_query); - $tmp_error_drop = $this->_dbi->getError(); - - if (! empty($tmp_error_drop)) { - $seen_error = true; - $html_output .= Util::mysqlDie( - $tmp_error_drop, $drop_query, false, '', false - ); - continue; - } - } else { - $preview_sql_data .= $drop_query . "\n"; - } - } - $tmp_error_create = false; - if (!$create) { - continue; - } - - $create_query = $this->_getSQLToCreateForeignKey( - $table, $master_field, $foreign_db, $foreign_table, $foreign_field, - $_REQUEST['constraint_name'][$master_field_md5], - $options_array[$_REQUEST['on_delete'][$master_field_md5]], - $options_array[$_REQUEST['on_update'][$master_field_md5]] - ); - - if (! isset($_REQUEST['preview_sql'])) { - $display_query .= $create_query . "\n"; - $this->_dbi->tryQuery($create_query); - $tmp_error_create = $this->_dbi->getError(); - if (! empty($tmp_error_create)) { - $seen_error = true; - - if (substr($tmp_error_create, 1, 4) == '1005') { - $message = Message::error( - __( - 'Error creating foreign key on %1$s (check data ' . - 'types)' - ) - ); - $message->addParam(implode(', ', $master_field)); - $html_output .= $message->getDisplay(); - } else { - $html_output .= Util::mysqlDie( - $tmp_error_create, $create_query, false, '', false - ); - } - $html_output .= Util::showMySQLDocu( - 'InnoDB_foreign_key_constraints' - ) . "\n"; - } - } else { - $preview_sql_data .= $create_query . "\n"; - } - - // this is an alteration and the old constraint has been dropped - // without creation of a new one - if ($drop && $create && empty($tmp_error_drop) - && ! empty($tmp_error_create) - ) { - // a rollback may be better here - $sql_query_recreate = '# Restoring the dropped constraint...' . "\n"; - $sql_query_recreate .= $this->_getSQLToCreateForeignKey( - $table, - $master_field, - $existrel_foreign[$master_field_md5]['ref_db_name'], - $existrel_foreign[$master_field_md5]['ref_table_name'], - $existrel_foreign[$master_field_md5]['ref_index_list'], - $existrel_foreign[$master_field_md5]['constraint'], - $options_array[$existrel_foreign[$master_field_md5]['on_delete']], - $options_array[$existrel_foreign[$master_field_md5]['on_update']] - ); - if (! isset($_REQUEST['preview_sql'])) { - $display_query .= $sql_query_recreate . "\n"; - $this->_dbi->tryQuery($sql_query_recreate); - } else { - $preview_sql_data .= $sql_query_recreate; - } - } - } // end foreach - - return array( - $html_output, - $preview_sql_data, - $display_query, - $seen_error - ); - } - - /** - * Returns the SQL query for foreign key constraint creation - * - * @param string $table table name - * @param array $field field names - * @param string $foreignDb foreign database name - * @param string $foreignTable foreign table name - * @param array $foreignField foreign field names - * @param string $name name of the constraint - * @param string $onDelete on delete action - * @param string $onUpdate on update action - * - * @return string SQL query for foreign key constraint creation - */ - private function _getSQLToCreateForeignKey( - $table, - $field, - $foreignDb, - $foreignTable, - $foreignField, - $name = null, - $onDelete = null, - $onUpdate = null - ) { - $sql_query = 'ALTER TABLE ' . Util::backquote($table) . ' ADD '; - // if user entered a constraint name - if (! empty($name)) { - $sql_query .= ' CONSTRAINT ' . Util::backquote($name); - } - - foreach ($field as $key => $one_field) { - $field[$key] = Util::backquote($one_field); - } - foreach ($foreignField as $key => $one_field) { - $foreignField[$key] = Util::backquote($one_field); - } - $sql_query .= ' FOREIGN KEY (' . implode(', ', $field) . ') REFERENCES ' - . ($this->_db_name != $foreignDb - ? Util::backquote($foreignDb) . '.' : '') - . Util::backquote($foreignTable) - . '(' . implode(', ', $foreignField) . ')'; - - if (! empty($onDelete)) { - $sql_query .= ' ON DELETE ' . $onDelete; - } - if (! empty($onUpdate)) { - $sql_query .= ' ON UPDATE ' . $onUpdate; - } - $sql_query .= ';'; - - return $sql_query; - } - - /** - * Returns the generation expression for virtual columns - * - * @param string $column name of the column - * - * @return array|boolean associative array of column name and their expressions - * or false on failure - */ - public function getColumnGenerationExpression($column = null) - { - $serverType = Util::getServerType(); - if ($serverType == 'MySQL' - && PMA_MYSQL_INT_VERSION > 50705 - && ! $GLOBALS['cfg']['Server']['DisableIS'] - ) { - $sql - = "SELECT - `COLUMN_NAME` AS `Field`, - `GENERATION_EXPRESSION` AS `Expression` - FROM - `information_schema`.`COLUMNS` - WHERE - `TABLE_SCHEMA` = '" . $GLOBALS['dbi']->escapeString($this->_db_name) . "' - AND `TABLE_NAME` = '" . $GLOBALS['dbi']->escapeString($this->_name) . "'"; - if ($column != null) { - $sql .= " AND `COLUMN_NAME` = '" . $GLOBALS['dbi']->escapeString($column) - . "'"; - } - $columns = $this->_dbi->fetchResult($sql, 'Field', 'Expression'); - return $columns; - } - - $createTable = $this->showCreate(); - if (!$createTable) { - return false; - } - - $parser = new Parser($createTable); - /** - * @var \SqlParser\Statements\CreateStatement $stmt - */ - $stmt = $parser->statements[0]; - $fields = Table::getFields($stmt); - if ($column != null) { - $expression = isset($fields[$column]['expr']) ? - substr($fields[$column]['expr'], 1, -1) : ''; - return array($column => $expression); - } - - $ret = array(); - foreach ($fields as $field => $options) { - if (isset($options['expr'])) { - $ret[$field] = substr($options['expr'], 1, -1); - } - } - return $ret; - } - - /** - * Returns the CREATE statement for this table - * - * @return mixed - */ - public function showCreate() - { - return $this->_dbi->fetchValue( - 'SHOW CREATE TABLE ' . Util::backquote($this->_db_name) . '.' - . Util::backquote($this->_name), - 0, 1 - ); - } - - /** - * Returns the real row count for a table - * - * @return number - */ - function getRealRowCountTable() - { - // SQL query to get row count for a table. - $result = $this->_dbi->fetchSingleRow( - sprintf( - 'SELECT COUNT(*) AS %s FROM %s.%s', - Util::backquote('row_count'), - Util::backquote($this->_db_name), - Util::backquote($this->_name) - ) - ); - return $result['row_count']; - } - - /** - * Get columns with indexes - * - * @param int $types types bitmask - * - * @return array an array of columns - */ - function getColumnsWithIndex($types) - { - $columns_with_index = array(); - foreach ( - Index::getFromTableByChoice( - $this->_name, - $this->_db_name, - $types - ) as $index - ) { - $columns = $index->getColumns(); - foreach ($columns as $column_name => $dummy) { - $columns_with_index[] = $column_name; - } - } - return $columns_with_index; - } -} diff --git a/#pma/libraries/Template.php b/#pma/libraries/Template.php deleted file mode 100644 index 6f2faa0e..00000000 --- a/#pma/libraries/Template.php +++ /dev/null @@ -1,167 +0,0 @@ -name = $name; - $this->data = $data; - $this->helperFunctions = $helperFunctions; - } - - /** - * Template getter - * - * @param string $name Template name - * @param array $data Variables to be provided to the template - * @param array $helperFunctions Helper functions to be used by template - * - * @return Template - */ - public static function get($name, $data = array(), $helperFunctions = array()) - { - return new Template($name, $data, $helperFunctions); - } - - /** - * Adds more entries to the data for this template - * - * @param array|string $data containing data array or data key - * @param string $value containing data value - */ - public function set($data, $value = null) - { - if(is_array($data) && ! $value) { - $this->data = array_merge( - $this->data, - $data - ); - } else if (is_string($data)) { - $this->data[$data] = $value; - } - } - - /** - * Adds a function for use by the template - * - * @param string $funcName function name - * @param callable $funcDef function definition - */ - public function setHelper($funcName, $funcDef) - { - if (! isset($this->helperFunctions[$funcName])) { - $this->helperFunctions[$funcName] = $funcDef; - } else { - throw new \LogicException( - 'The function "' . $funcName . '" is already associated with the template.' - ); - } - } - - /** - * Removes a function - * - * @param string $funcName function name - */ - public function removeHelper($funcName) - { - if (isset($this->helperFunctions[$funcName])) { - unset($this->helperFunctions[$funcName]); - } else { - throw new \LogicException( - 'The function "' . $funcName . '" is not associated with the template.' - ); - } - } - - /** - * Magic call to locally inaccessible but associated helper functions - * - * @param string $funcName function name - * @param array $arguments function arguments - */ - public function __call($funcName, $arguments) - { - if (isset($this->helperFunctions[$funcName])) { - return call_user_func_array($this->helperFunctions[$funcName], $arguments); - } else { - throw new \LogicException( - 'The function "' . $funcName . '" is not associated with the template.' - ); - } - } - - /** - * Render template - * - * @param array $data Variables to be provided to the template - * @param bool $trim Trim content (does nothing, removed in future) - * @param array $helperFunctions Helper functions to be used by template - * - * @return string - */ - public function render($data = array(), $trim = true, $helperFunctions = array()) - { - $template = static::BASE_PATH . $this->name . '.phtml'; - try { - $this->set($data); - $this->helperFunctions = array_merge( - $this->helperFunctions, - $helperFunctions - ); - extract($this->data); - ob_start(); - if (file_exists($template)) { - include $template; - } else { - throw new \LogicException( - 'The template "' . $template . '" not found.' - ); - } - $content = ob_get_clean(); - - return $content; - } catch (\LogicException $e) { - ob_end_clean(); - throw new \LogicException($e->getMessage()); - } - } -} diff --git a/#pma/libraries/Theme.php b/#pma/libraries/Theme.php deleted file mode 100644 index 0762cce1..00000000 --- a/#pma/libraries/Theme.php +++ /dev/null @@ -1,482 +0,0 @@ -getPath() . '/info.inc.php')) { - return false; - } - - if ($this->mtime_info === filemtime($this->getPath() . '/info.inc.php')) { - return true; - } - - @include $this->getPath() . '/info.inc.php'; - - // was it set correctly? - if (! isset($theme_name)) { - return false; - } - - $this->mtime_info = filemtime($this->getPath() . '/info.inc.php'); - $this->filesize_info = filesize($this->getPath() . '/info.inc.php'); - - if (isset($theme_full_version)) { - $this->setVersion($theme_full_version); - } elseif (isset($theme_generation, $theme_version)) { - $this->setVersion($theme_generation . '.' . $theme_version); - } - $this->setName($theme_name); - - return true; - } - - /** - * returns theme object loaded from given folder - * or false if theme is invalid - * - * @param string $folder path to theme - * - * @return Theme|false - * @static - * @access public - */ - static public function load($folder) - { - $theme = new Theme(); - - $theme->setPath($folder); - - if (! $theme->loadInfo()) { - return false; - } - - $theme->checkImgPath(); - - return $theme; - } - - /** - * checks image path for existence - if not found use img from fallback theme - * - * @access public - * @return bool - */ - public function checkImgPath() - { - // try current theme first - if (is_dir($this->getPath() . '/img/')) { - $this->setImgPath($this->getPath() . '/img/'); - return true; - } - - // try fallback theme - $fallback = $GLOBALS['cfg']['ThemePath'] . '/' - . ThemeManager::FALLBACK_THEME - . '/img/'; - if (is_dir($fallback)) { - $this->setImgPath($fallback); - return true; - } - - // we failed - trigger_error( - sprintf( - __('No valid image path for theme %s found!'), - $this->getName() - ), - E_USER_ERROR - ); - return false; - } - - /** - * returns path to theme - * - * @access public - * @return string path to theme - */ - public function getPath() - { - return $this->path; - } - - /** - * returns layout file - * - * @access public - * @return string layout file - */ - public function getLayoutFile() - { - return $this->getPath() . '/layout.inc.php'; - } - - /** - * set path to theme - * - * @param string $path path to theme - * - * @return void - * @access public - */ - public function setPath($path) - { - $this->path = trim($path); - } - - /** - * sets version - * - * @param string $version version to set - * - * @return void - * @access public - */ - public function setVersion($version) - { - $this->version = trim($version); - } - - /** - * returns version - * - * @return string version - * @access public - */ - public function getVersion() - { - return $this->version; - } - - /** - * checks theme version against $version - * returns true if theme version is equal or higher to $version - * - * @param string $version version to compare to - * - * @return boolean true if theme version is equal or higher to $version - * @access public - */ - public function checkVersion($version) - { - return version_compare($this->getVersion(), $version, 'lt'); - } - - /** - * sets name - * - * @param string $name name to set - * - * @return void - * @access public - */ - public function setName($name) - { - $this->name = trim($name); - } - - /** - * returns name - * - * @access public - * @return string name - */ - public function getName() - { - return $this->name; - } - - /** - * sets id - * - * @param string $id new id - * - * @return void - * @access public - */ - public function setId($id) - { - $this->id = trim($id); - } - - /** - * returns id - * - * @return string id - * @access public - */ - public function getId() - { - return $this->id; - } - - /** - * Sets path to images for the theme - * - * @param string $path path to images for this theme - * - * @return void - * @access public - */ - public function setImgPath($path) - { - $this->img_path = $path; - } - - /** - * Returns the path to image for the theme. - * If filename is given, it possibly fallbacks to fallback - * theme for it if image does not exist. - * - * @param string $file file name for image - * - * @access public - * @return string image path for this theme - */ - public function getImgPath($file = null) - { - if (is_null($file)) { - return $this->img_path; - } - - if (is_readable($this->img_path . $file)) { - return $this->img_path . $file; - } - - return $GLOBALS['cfg']['ThemePath'] . '/' - . ThemeManager::FALLBACK_THEME . '/img/' . $file; - } - - /** - * load css (send to stdout, normally the browser) - * - * @return bool - * @access public - */ - public function loadCss() - { - $success = true; - - if ($GLOBALS['text_dir'] === 'ltr') { - $right = 'right'; - $left = 'left'; - } else { - $right = 'left'; - $left = 'right'; - } - - foreach ($this->_cssFiles as $file) { - $path = $this->getPath() . "/css/$file.css.php"; - $fallback = "./themes/" - . ThemeManager::FALLBACK_THEME . "/css/$file.css.php"; - - if (is_readable($path)) { - echo "\n/* FILE: " , $file , ".css.php */\n"; - include $path; - } else if (is_readable($fallback)) { - echo "\n/* FILE: " , $file , ".css.php */\n"; - include $fallback; - } else { - $success = false; - } - } - - include './themes/sprites.css.php'; - - return $success; - } - - /** - * Renders the preview for this theme - * - * @return string - * @access public - */ - public function getPrintPreview() - { - $url_params = array('set_theme' => $this->getId()); - $url = 'index.php' . PMA_URL_getCommon($url_params); - - $retval = ''; - return $retval; - } - - /** - * Remove filter for IE. - * - * @return string CSS code. - */ - function getCssIEClearFilter() - { - return PMA_USR_BROWSER_AGENT == 'IE' - && PMA_USR_BROWSER_VER >= 6 - && PMA_USR_BROWSER_VER <= 8 - ? 'filter: none' - : ''; - } - - /** - * Gets currently configured font size. - * - * @return String with font size. - */ - function getFontSize() - { - $fs = $GLOBALS['PMA_Config']->get('fontsize'); - if (!is_null($fs)) { - return $fs; - } - if (isset($_COOKIE['pma_fontsize'])) { - return htmlspecialchars($_COOKIE['pma_fontsize']); - } - return '82%'; - } - - /** - * Generates code for CSS gradient using various browser extensions. - * - * @param string $start_color Color of gradient start, hex value without # - * @param string $end_color Color of gradient end, hex value without # - * - * @return string CSS code. - */ - function getCssGradient($start_color, $end_color) - { - $result = array(); - // Opera 9.5+, IE 9 - $result[] = 'background-image: url(./themes/svg_gradient.php?from=' - . $start_color . '&to=' . $end_color . ');'; - $result[] = 'background-size: 100% 100%;'; - // Safari 4-5, Chrome 1-9 - $result[] = 'background: ' - . '-webkit-gradient(linear, left top, left bottom, from(#' - . $start_color . '), to(#' . $end_color . '));'; - // Safari 5.1, Chrome 10+ - $result[] = 'background: -webkit-linear-gradient(top, #' - . $start_color . ', #' . $end_color . ');'; - // Firefox 3.6+ - $result[] = 'background: -moz-linear-gradient(top, #' - . $start_color . ', #' . $end_color . ');'; - // IE 10 - $result[] = 'background: -ms-linear-gradient(top, #' - . $start_color . ', #' . $end_color . ');'; - // Opera 11.10 - $result[] = 'background: -o-linear-gradient(top, #' - . $start_color . ', #' . $end_color . ');'; - // IE 6-8 - if (PMA_USR_BROWSER_AGENT == 'IE' - && PMA_USR_BROWSER_VER >= 6 - && PMA_USR_BROWSER_VER <= 8 - ) { - $result[] = 'filter: ' - . 'progid:DXImageTransform.Microsoft.gradient(startColorstr="#' - . $start_color . '", endColorstr="#' . $end_color . '");'; - } - return implode("\n", $result); - } -} diff --git a/#pma/libraries/ThemeManager.php b/#pma/libraries/ThemeManager.php deleted file mode 100644 index 8a1ed451..00000000 --- a/#pma/libraries/ThemeManager.php +++ /dev/null @@ -1,526 +0,0 @@ -init(); - } - - /** - * sets path to folder containing the themes - * - * @param string $path path to themes folder - * - * @access public - * @return boolean success - */ - public function setThemesPath($path) - { - if (! $this->_checkThemeFolder($path)) { - return false; - } - - $this->_themes_path = trim($path); - return true; - } - - /** - * Returns path to folder containing themes - * - * @access public - * @return string theme path - */ - public function getThemesPath() - { - return $this->_themes_path; - } - - /** - * sets if there are different themes per server - * - * @param boolean $per_server Whether to enable per server flag - * - * @access public - * @return void - */ - public function setThemePerServer($per_server) - { - $this->per_server = (bool) $per_server; - } - - /** - * Initialise the class - * - * @access public - * @return void - */ - public function init() - { - $this->themes = array(); - $this->theme_default = self::FALLBACK_THEME; - $this->active_theme = ''; - - if (! $this->setThemesPath($GLOBALS['cfg']['ThemePath'])) { - return; - } - - $this->setThemePerServer($GLOBALS['cfg']['ThemePerServer']); - - $this->loadThemes(); - - $this->theme = new Theme; - - if (! $this->checkTheme($GLOBALS['cfg']['ThemeDefault'])) { - trigger_error( - sprintf( - __('Default theme %s not found!'), - htmlspecialchars($GLOBALS['cfg']['ThemeDefault']) - ), - E_USER_ERROR - ); - $GLOBALS['cfg']['ThemeDefault'] = false; - } - - $this->theme_default = $GLOBALS['cfg']['ThemeDefault']; - - // check if user have a theme cookie - if (! $this->getThemeCookie() - || ! $this->setActiveTheme($this->getThemeCookie()) - ) { - if ($GLOBALS['cfg']['ThemeDefault']) { - // otherwise use default theme - $this->setActiveTheme($this->theme_default); - } else { - // or fallback theme - $this->setActiveTheme(self::FALLBACK_THEME); - } - } - } - - /** - * Checks configuration - * - * @access public - * @return void - */ - public function checkConfig() - { - if ($this->_themes_path != trim($GLOBALS['cfg']['ThemePath']) - || $this->theme_default != $GLOBALS['cfg']['ThemeDefault'] - ) { - $this->init(); - } else { - // at least the theme path needs to be checked every time for new - // themes, as there is no other way at the moment to keep track of - // new or removed themes - $this->loadThemes(); - } - } - - /** - * Sets active theme - * - * @param string $theme theme name - * - * @access public - * @return bool true on success - */ - public function setActiveTheme($theme = null) - { - if (! $this->checkTheme($theme)) { - trigger_error( - sprintf( - __('Theme %s not found!'), - htmlspecialchars($theme) - ), - E_USER_ERROR - ); - return false; - } - - $this->active_theme = $theme; - $this->theme = $this->themes[$theme]; - - // need to set later - //$this->setThemeCookie(); - - return true; - } - - /** - * Returns name for storing theme - * - * @return string cookie name - * @access public - */ - public function getThemeCookieName() - { - // Allow different theme per server - if (isset($GLOBALS['server']) && $this->per_server) { - return $this->cookie_name . '-' . $GLOBALS['server']; - } else { - return $this->cookie_name; - } - } - - /** - * returns name of theme stored in the cookie - * - * @return string theme name from cookie - * @access public - */ - public function getThemeCookie() - { - if (isset($_COOKIE[$this->getThemeCookieName()])) { - return $_COOKIE[$this->getThemeCookieName()]; - } - - return false; - } - - /** - * save theme in cookie - * - * @return bool true - * @access public - */ - public function setThemeCookie() - { - $GLOBALS['PMA_Config']->setCookie( - $this->getThemeCookieName(), - $this->theme->id, - $this->theme_default - ); - // force a change of a dummy session variable to avoid problems - // with the caching of phpmyadmin.css.php - $GLOBALS['PMA_Config']->set('theme-update', $this->theme->id); - return true; - } - - /** - * Checks whether folder is valid for storing themes - * - * @param string $folder Folder name to test - * - * @return boolean - * @access private - */ - private function _checkThemeFolder($folder) - { - if (! is_dir($folder)) { - trigger_error( - sprintf( - __('Theme path not found for theme %s!'), - htmlspecialchars($folder) - ), - E_USER_ERROR - ); - return false; - } - - return true; - } - - /** - * read all themes - * - * @return bool true - * @access public - */ - public function loadThemes() - { - $this->themes = array(); - - if (false === ($handleThemes = opendir($this->getThemesPath()))) { - trigger_error( - 'phpMyAdmin-ERROR: cannot open themes folder: ' - . $this->getThemesPath(), - E_USER_WARNING - ); - return false; - } - - // check for themes directory - while (false !== ($PMA_Theme = readdir($handleThemes))) { - // Skip non dirs, . and .. - if ($PMA_Theme == '.' - || $PMA_Theme == '..' - || ! is_dir($this->getThemesPath() . '/' . $PMA_Theme) - ) { - continue; - } - if (array_key_exists($PMA_Theme, $this->themes)) { - continue; - } - $new_theme = Theme::load( - $this->getThemesPath() . '/' . $PMA_Theme - ); - if ($new_theme) { - $new_theme->setId($PMA_Theme); - $this->themes[$PMA_Theme] = $new_theme; - } - } // end get themes - closedir($handleThemes); - - ksort($this->themes); - return true; - } - - /** - * checks if given theme name is a known theme - * - * @param string $theme name fo theme to check for - * - * @return bool - * @access public - */ - public function checkTheme($theme) - { - if (! array_key_exists($theme, $this->themes)) { - return false; - } - - return true; - } - - /** - * returns HTML selectbox, with or without form enclosed - * - * @param boolean $form whether enclosed by from tags or not - * - * @return string - * @access public - */ - public function getHtmlSelectBox($form = true) - { - $select_box = ''; - - if ($form) { - $select_box .= '
    '; - $select_box .= $theme_preview_href . __('Theme:') . '' . "\n"; - - $select_box .= ''; - - if ($form) { - $select_box .= '
    '; - } - - return $select_box; - } - - /** - * enables backward compatibility - * - * @return void - * @access public - */ - public function makeBc() - { - $GLOBALS['theme'] = $this->theme->getId(); - $GLOBALS['pmaThemePath'] = $this->theme->getPath(); - $GLOBALS['pmaThemeImage'] = $this->theme->getImgPath(); - - /** - * load layout file if exists - */ - if (file_exists($this->theme->getLayoutFile())) { - include $this->theme->getLayoutFile(); - } - } - - /** - * Renders the previews for all themes - * - * @return string - * @access public - */ - public function getPrintPreviews() - { - $retval = ''; - foreach ($this->themes as $each_theme) { - $retval .= $each_theme->getPrintPreview(); - } // end 'open themes' - return $retval; - } - - /** - * returns Theme object for fall back theme - * - * @return Theme fall back theme - * @access public - */ - public function getFallBackTheme() - { - if (isset($this->themes[self::FALLBACK_THEME])) { - return $this->themes[self::FALLBACK_THEME]; - } - - return false; - } - - /** - * prints css data - * - * @return bool - * @access public - */ - public function printCss() - { - if ($this->theme->loadCss()) { - return true; - } - - // if loading css for this theme failed, try default theme css - $fallback_theme = $this->getFallBackTheme(); - if ($fallback_theme && $fallback_theme->loadCss()) { - return true; - } - - return false; - } - - /** - * Theme initialization - * - * @return void - * @access public - */ - public static function initializeTheme() - { - /** - * @global ThemeManager $_SESSION['ThemeManager'] - */ - if (! isset($_SESSION['PMA_Theme_Manager'])) { - $_SESSION['PMA_Theme_Manager'] = new ThemeManager; - } else { - /** - * @todo move all __wakeup() functionality into session.inc.php - */ - $_SESSION['PMA_Theme_Manager']->checkConfig(); - } - - // for the theme per server feature - if (isset($_REQUEST['server']) && ! isset($_REQUEST['set_theme'])) { - $GLOBALS['server'] = $_REQUEST['server']; - $tmp = $_SESSION['PMA_Theme_Manager']->getThemeCookie(); - if (empty($tmp)) { - $tmp = $_SESSION['PMA_Theme_Manager']->theme_default; - } - $_SESSION['PMA_Theme_Manager']->setActiveTheme($tmp); - } - /** - * @todo move into ThemeManager::__wakeup() - */ - if (isset($_REQUEST['set_theme'])) { - // if user selected a theme - $_SESSION['PMA_Theme_Manager']->setActiveTheme($_REQUEST['set_theme']); - } - - /** - * the theme object - * - *@global Theme $_SESSION['PMA_Theme'] - */ - $_SESSION['PMA_Theme'] = $_SESSION['PMA_Theme_Manager']->theme; - - // BC - /** - * the active theme - * @global string $GLOBALS['theme'] - */ - $GLOBALS['theme'] = $_SESSION['PMA_Theme']->getName(); - /** - * the theme path - * @global string $GLOBALS['pmaThemePath'] - */ - $GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath(); - /** - * the theme image path - * @global string $GLOBALS['pmaThemeImage'] - */ - $GLOBALS['pmaThemeImage'] = $_SESSION['PMA_Theme']->getImgPath(); - - /** - * load layout file if exists - */ - if (@file_exists($_SESSION['PMA_Theme']->getLayoutFile())) { - include $_SESSION['PMA_Theme']->getLayoutFile(); - } - } -} diff --git a/#pma/libraries/Tracker.php b/#pma/libraries/Tracker.php deleted file mode 100644 index 06b77d03..00000000 --- a/#pma/libraries/Tracker.php +++ /dev/null @@ -1,959 +0,0 @@ -escapeString($dbname) . "' " . - " AND table_name = '" . $GLOBALS['dbi']->escapeString($tablename) . "' " . - " ORDER BY version DESC"; - - $row = $GLOBALS['dbi']->fetchArray(PMA_queryAsControlUser($sql_query)); - - if (isset($row['tracking_active']) && $row['tracking_active'] == 1) { - return true; - } else { - return false; - } - } - - /** - * Returns the comment line for the log. - * - * @return string Comment, contains date and username - */ - static public function getLogComment() - { - $date = date('Y-m-d H:i:s'); - $user = preg_replace('/\s+/', ' ', $GLOBALS['cfg']['Server']['user']); - - return "# log " . $date . " " . $user . "\n"; - } - - /** - * Creates tracking version of a table / view - * (in other words: create a job to track future changes on the table). - * - * @param string $dbname name of database - * @param string $tablename name of table - * @param string $version version - * @param string $tracking_set set of tracking statements - * @param bool $is_view if table is a view - * - * @static - * - * @return int result of version insertion - */ - static public function createVersion($dbname, $tablename, $version, - $tracking_set = '', $is_view = false - ) { - global $sql_backquotes, $export_type; - - if ($tracking_set == '') { - $tracking_set - = $GLOBALS['cfg']['Server']['tracking_default_statements']; - } - - // get Export SQL instance - include_once "libraries/plugin_interface.lib.php"; - /* @var $export_sql_plugin \PMA\libraries\plugins\export\ExportSql */ - $export_sql_plugin = PMA_getPlugin( - "export", - "sql", - 'libraries/plugins/export/', - array( - 'export_type' => $export_type, - 'single_table' => false, - ) - ); - - $sql_backquotes = true; - - $date = date('Y-m-d H:i:s'); - - // Get data definition snapshot of table - - $columns = $GLOBALS['dbi']->getColumns($dbname, $tablename, null, true); - // int indices to reduce size - $columns = array_values($columns); - // remove Privileges to reduce size - for ($i = 0, $nb = count($columns); $i < $nb; $i++) { - unset($columns[$i]['Privileges']); - } - - $indexes = $GLOBALS['dbi']->getTableIndexes($dbname, $tablename); - - $snapshot = array('COLUMNS' => $columns, 'INDEXES' => $indexes); - $snapshot = serialize($snapshot); - - // Get DROP TABLE / DROP VIEW and CREATE TABLE SQL statements - $sql_backquotes = true; - - $create_sql = ""; - - if ($GLOBALS['cfg']['Server']['tracking_add_drop_table'] == true - && $is_view == false - ) { - $create_sql .= self::getLogComment() - . 'DROP TABLE IF EXISTS ' . Util::backquote($tablename) . ";\n"; - - } - - if ($GLOBALS['cfg']['Server']['tracking_add_drop_view'] == true - && $is_view == true - ) { - $create_sql .= self::getLogComment() - . 'DROP VIEW IF EXISTS ' . Util::backquote($tablename) . ";\n"; - } - - $create_sql .= self::getLogComment() . - $export_sql_plugin->getTableDef($dbname, $tablename, "\n", ""); - - // Save version - - $sql_query = "/*NOTRACK*/\n" . - "INSERT INTO " . self::_getTrackingTable() . " (" . - "db_name, " . - "table_name, " . - "version, " . - "date_created, " . - "date_updated, " . - "schema_snapshot, " . - "schema_sql, " . - "data_sql, " . - "tracking " . - ") " . - "values ( - '" . $GLOBALS['dbi']->escapeString($dbname) . "', - '" . $GLOBALS['dbi']->escapeString($tablename) . "', - '" . $GLOBALS['dbi']->escapeString($version) . "', - '" . $GLOBALS['dbi']->escapeString($date) . "', - '" . $GLOBALS['dbi']->escapeString($date) . "', - '" . $GLOBALS['dbi']->escapeString($snapshot) . "', - '" . $GLOBALS['dbi']->escapeString($create_sql) . "', - '" . $GLOBALS['dbi']->escapeString("\n") . "', - '" . $GLOBALS['dbi']->escapeString($tracking_set) - . "' )"; - - $result = PMA_queryAsControlUser($sql_query); - - if ($result) { - // Deactivate previous version - self::deactivateTracking($dbname, $tablename, ($version - 1)); - } - - return $result; - } - - - /** - * Removes all tracking data for a table or a version of a table - * - * @param string $dbname name of database - * @param string $tablename name of table - * @param string $version version - * - * @static - * - * @return int result of version insertion - */ - static public function deleteTracking($dbname, $tablename, $version = '') - { - $sql_query = "/*NOTRACK*/\n" - . "DELETE FROM " . self::_getTrackingTable() - . " WHERE `db_name` = '" - . $GLOBALS['dbi']->escapeString($dbname) . "'" - . " AND `table_name` = '" - . $GLOBALS['dbi']->escapeString($tablename) . "'"; - if ($version) { - $sql_query .= " AND `version` = '" - . $GLOBALS['dbi']->escapeString($version) . "'"; - } - $result = PMA_queryAsControlUser($sql_query); - - return $result; - } - - /** - * Creates tracking version of a database - * (in other words: create a job to track future changes on the database). - * - * @param string $dbname name of database - * @param string $version version - * @param string $query query - * @param string $tracking_set set of tracking statements - * - * @static - * - * @return int result of version insertion - */ - static public function createDatabaseVersion($dbname, $version, $query, - $tracking_set = 'CREATE DATABASE,ALTER DATABASE,DROP DATABASE' - ) { - $date = date('Y-m-d H:i:s'); - - if ($tracking_set == '') { - $tracking_set - = $GLOBALS['cfg']['Server']['tracking_default_statements']; - } - - $create_sql = ""; - - if ($GLOBALS['cfg']['Server']['tracking_add_drop_database'] == true) { - $create_sql .= self::getLogComment() - . 'DROP DATABASE IF EXISTS ' . Util::backquote($dbname) . ";\n"; - } - - $create_sql .= self::getLogComment() . $query; - - // Save version - $sql_query = "/*NOTRACK*/\n" . - "INSERT INTO " . self::_getTrackingTable() . " (" . - "db_name, " . - "table_name, " . - "version, " . - "date_created, " . - "date_updated, " . - "schema_snapshot, " . - "schema_sql, " . - "data_sql, " . - "tracking " . - ") " . - "values ( - '" . $GLOBALS['dbi']->escapeString($dbname) . "', - '" . $GLOBALS['dbi']->escapeString('') . "', - '" . $GLOBALS['dbi']->escapeString($version) . "', - '" . $GLOBALS['dbi']->escapeString($date) . "', - '" . $GLOBALS['dbi']->escapeString($date) . "', - '" . $GLOBALS['dbi']->escapeString('') . "', - '" . $GLOBALS['dbi']->escapeString($create_sql) . "', - '" . $GLOBALS['dbi']->escapeString("\n") . "', - '" . $GLOBALS['dbi']->escapeString($tracking_set) - . "' )"; - - $result = PMA_queryAsControlUser($sql_query); - - return $result; - } - - - - /** - * Changes tracking of a table. - * - * @param string $dbname name of database - * @param string $tablename name of table - * @param string $version version - * @param integer $new_state the new state of tracking - * - * @static - * - * @return int result of SQL query - */ - static private function _changeTracking($dbname, $tablename, - $version, $new_state - ) { - - $sql_query = " UPDATE " . self::_getTrackingTable() . - " SET `tracking_active` = '" . $new_state . "' " . - " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . - " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($tablename) . "' " . - " AND `version` = '" . $GLOBALS['dbi']->escapeString($version) . "' "; - - $result = PMA_queryAsControlUser($sql_query); - - return $result; - } - - /** - * Changes tracking data of a table. - * - * @param string $dbname name of database - * @param string $tablename name of table - * @param string $version version - * @param string $type type of data(DDL || DML) - * @param string|array $new_data the new tracking data - * - * @static - * - * @return bool result of change - */ - static public function changeTrackingData($dbname, $tablename, - $version, $type, $new_data - ) { - if ($type == 'DDL') { - $save_to = 'schema_sql'; - } elseif ($type == 'DML') { - $save_to = 'data_sql'; - } else { - return false; - } - $date = date('Y-m-d H:i:s'); - - $new_data_processed = ''; - if (is_array($new_data)) { - foreach ($new_data as $data) { - $new_data_processed .= '# log ' . $date . ' ' . $data['username'] - . $GLOBALS['dbi']->escapeString($data['statement']) . "\n"; - } - } else { - $new_data_processed = $new_data; - } - - $sql_query = " UPDATE " . self::_getTrackingTable() . - " SET `" . $save_to . "` = '" . $new_data_processed . "' " . - " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . - " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($tablename) . "' " . - " AND `version` = '" . $GLOBALS['dbi']->escapeString($version) . "' "; - - $result = PMA_queryAsControlUser($sql_query); - - return (boolean) $result; - } - - /** - * Activates tracking of a table. - * - * @param string $dbname name of database - * @param string $tablename name of table - * @param string $version version - * - * @static - * - * @return int result of SQL query - */ - static public function activateTracking($dbname, $tablename, $version) - { - return self::_changeTracking($dbname, $tablename, $version, 1); - } - - - /** - * Deactivates tracking of a table. - * - * @param string $dbname name of database - * @param string $tablename name of table - * @param string $version version - * - * @static - * - * @return int result of SQL query - */ - static public function deactivateTracking($dbname, $tablename, $version) - { - return self::_changeTracking($dbname, $tablename, $version, 0); - } - - - /** - * Gets the newest version of a tracking job - * (in other words: gets the HEAD version). - * - * @param string $dbname name of database - * @param string $tablename name of table - * @param string $statement tracked statement - * - * @static - * - * @return int (-1 if no version exists | > 0 if a version exists) - */ - static public function getVersion($dbname, $tablename, $statement = null) - { - $sql_query = " SELECT MAX(version) FROM " . self::_getTrackingTable() . - " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . - " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($tablename) . "' "; - - if ($statement != "") { - $sql_query .= " AND FIND_IN_SET('" - . $statement . "',tracking) > 0" ; - } - $row = $GLOBALS['dbi']->fetchArray(PMA_queryAsControlUser($sql_query)); - return isset($row[0]) - ? $row[0] - : -1; - } - - - /** - * Gets the record of a tracking job. - * - * @param string $dbname name of database - * @param string $tablename name of table - * @param string $version version number - * - * @static - * - * @return mixed record DDM log, DDL log, structure snapshot, tracked - * statements. - */ - static public function getTrackedData($dbname, $tablename, $version) - { - $sql_query = " SELECT * FROM " . self::_getTrackingTable() . - " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' "; - if (! empty($tablename)) { - $sql_query .= " AND `table_name` = '" - . $GLOBALS['dbi']->escapeString($tablename) . "' "; - } - $sql_query .= " AND `version` = '" . $GLOBALS['dbi']->escapeString($version) - . "' " . " ORDER BY `version` DESC LIMIT 1"; - - $mixed = $GLOBALS['dbi']->fetchAssoc(PMA_queryAsControlUser($sql_query)); - - // Parse log - $log_schema_entries = explode('# log ', $mixed['schema_sql']); - $log_data_entries = explode('# log ', $mixed['data_sql']); - - $ddl_date_from = $date = date('Y-m-d H:i:s'); - - $ddlog = array(); - $first_iteration = true; - - // Iterate tracked data definition statements - // For each log entry we want to get date, username and statement - foreach ($log_schema_entries as $log_entry) { - if (trim($log_entry) != '') { - $date = mb_substr($log_entry, 0, 19); - $username = mb_substr( - $log_entry, 20, mb_strpos($log_entry, "\n") - 20 - ); - if ($first_iteration) { - $ddl_date_from = $date; - $first_iteration = false; - } - $statement = rtrim(mb_strstr($log_entry, "\n")); - - $ddlog[] = array( 'date' => $date, - 'username'=> $username, - 'statement' => $statement ); - } - } - - $date_from = $ddl_date_from; - $ddl_date_to = $date; - - $dml_date_from = $date_from; - - $dmlog = array(); - $first_iteration = true; - - // Iterate tracked data manipulation statements - // For each log entry we want to get date, username and statement - foreach ($log_data_entries as $log_entry) { - if (trim($log_entry) != '') { - $date = mb_substr($log_entry, 0, 19); - $username = mb_substr( - $log_entry, 20, mb_strpos($log_entry, "\n") - 20 - ); - if ($first_iteration) { - $dml_date_from = $date; - $first_iteration = false; - } - $statement = rtrim(mb_strstr($log_entry, "\n")); - - $dmlog[] = array( 'date' => $date, - 'username' => $username, - 'statement' => $statement ); - } - } - - $dml_date_to = $date; - - // Define begin and end of date range for both logs - $data = array(); - if (strtotime($ddl_date_from) <= strtotime($dml_date_from)) { - $data['date_from'] = $ddl_date_from; - } else { - $data['date_from'] = $dml_date_from; - } - if (strtotime($ddl_date_to) >= strtotime($dml_date_to)) { - $data['date_to'] = $ddl_date_to; - } else { - $data['date_to'] = $dml_date_to; - } - $data['ddlog'] = $ddlog; - $data['dmlog'] = $dmlog; - $data['tracking'] = $mixed['tracking']; - $data['schema_snapshot'] = $mixed['schema_snapshot']; - - return $data; - } - - - /** - * Parses a query. Gets - * - statement identifier (UPDATE, ALTER TABLE, ...) - * - type of statement, is it part of DDL or DML ? - * - tablename - * - * @param string $query query - * - * @static - * @todo: using PMA SQL Parser when possible - * @todo: support multi-table/view drops - * - * @return mixed Array containing identifier, type and tablename. - * - */ - static public function parseQuery($query) - { - // Usage of PMA_SQP does not work here - // - // require_once("libraries/sqlparser.lib.php"); - // $parsed_sql = PMA_SQP_parse($query); - // $sql_info = PMA_SQP_analyze($parsed_sql); - - $query = str_replace("\n", " ", $query); - $query = str_replace("\r", " ", $query); - - $query = trim($query); - $query = trim($query, ' -'); - - $tokens = explode(" ", $query); - foreach ($tokens as $key => $value) { - $tokens[$key] = mb_strtoupper($value); - } - - // Parse USE statement, need it for SQL dump imports - if (mb_substr($query, 0, 4) == 'USE ') { - $prefix = explode('USE ', $query); - $GLOBALS['db'] = self::getTableName($prefix[1]); - } - - /* - * DDL statements - */ - - $result = array(); - $result['type'] = 'DDL'; - - // Parse CREATE VIEW statement - if (in_array('CREATE', $tokens) == true - && in_array('VIEW', $tokens) == true - && in_array('AS', $tokens) == true - ) { - $result['identifier'] = 'CREATE VIEW'; - - $index = array_search('VIEW', $tokens); - - $result['tablename'] = mb_strtolower( - self::getTableName($tokens[$index + 1]) - ); - } - - // Parse ALTER VIEW statement - if (in_array('ALTER', $tokens) == true - && in_array('VIEW', $tokens) == true - && in_array('AS', $tokens) == true - && ! isset($result['identifier']) - ) { - $result['identifier'] = 'ALTER VIEW'; - - $index = array_search('VIEW', $tokens); - - $result['tablename'] = mb_strtolower( - self::getTableName($tokens[$index + 1]) - ); - } - - // Parse DROP VIEW statement - if (! isset($result['identifier']) - && substr($query, 0, 10) == 'DROP VIEW ' - ) { - $result['identifier'] = 'DROP VIEW'; - - $prefix = explode('DROP VIEW ', $query); - $str = str_replace('IF EXISTS', '', $prefix[1]); - $result['tablename'] = self::getTableName($str); - } - - // Parse CREATE DATABASE statement - if (! isset($result['identifier']) - && substr($query, 0, 15) == 'CREATE DATABASE' - ) { - $result['identifier'] = 'CREATE DATABASE'; - $str = str_replace('CREATE DATABASE', '', $query); - $str = str_replace('IF NOT EXISTS', '', $str); - - $prefix = explode('DEFAULT ', $str); - - $result['tablename'] = ''; - $GLOBALS['db'] = self::getTableName($prefix[0]); - } - - // Parse ALTER DATABASE statement - if (! isset($result['identifier']) - && substr($query, 0, 14) == 'ALTER DATABASE' - ) { - $result['identifier'] = 'ALTER DATABASE'; - $result['tablename'] = ''; - } - - // Parse DROP DATABASE statement - if (! isset($result['identifier']) - && substr($query, 0, 13) == 'DROP DATABASE' - ) { - $result['identifier'] = 'DROP DATABASE'; - $str = str_replace('DROP DATABASE', '', $query); - $str = str_replace('IF EXISTS', '', $str); - $GLOBALS['db'] = self::getTableName($str); - $result['tablename'] = ''; - } - - // Parse CREATE TABLE statement - if (! isset($result['identifier']) - && substr($query, 0, 12) == 'CREATE TABLE' - ) { - $result['identifier'] = 'CREATE TABLE'; - $query = str_replace('IF NOT EXISTS', '', $query); - $prefix = explode('CREATE TABLE ', $query); - $suffix = explode('(', $prefix[1]); - $result['tablename'] = self::getTableName($suffix[0]); - } - - // Parse ALTER TABLE statement - if (! isset($result['identifier']) - && substr($query, 0, 12) == 'ALTER TABLE ' - ) { - $result['identifier'] = 'ALTER TABLE'; - - $prefix = explode('ALTER TABLE ', $query); - $suffix = explode(' ', $prefix[1]); - $result['tablename'] = self::getTableName($suffix[0]); - } - - // Parse DROP TABLE statement - if (! isset($result['identifier']) - && substr($query, 0, 11) == 'DROP TABLE ' - ) { - $result['identifier'] = 'DROP TABLE'; - - $prefix = explode('DROP TABLE ', $query); - $str = str_replace('IF EXISTS', '', $prefix[1]); - $result['tablename'] = self::getTableName($str); - } - - // Parse CREATE INDEX statement - if (! isset($result['identifier']) - && (substr($query, 0, 12) == 'CREATE INDEX' - || substr($query, 0, 19) == 'CREATE UNIQUE INDEX' - || substr($query, 0, 20) == 'CREATE SPATIAL INDEX') - ) { - $result['identifier'] = 'CREATE INDEX'; - $prefix = explode('ON ', $query); - $suffix = explode('(', $prefix[1]); - $result['tablename'] = self::getTableName($suffix[0]); - } - - // Parse DROP INDEX statement - if (! isset($result['identifier']) - && substr($query, 0, 10) == 'DROP INDEX' - ) { - $result['identifier'] = 'DROP INDEX'; - $prefix = explode('ON ', $query); - $result['tablename'] = self::getTableName($prefix[1]); - } - - // Parse RENAME TABLE statement - if (! isset($result['identifier']) - && substr($query, 0, 13) == 'RENAME TABLE ' - ) { - $result['identifier'] = 'RENAME TABLE'; - $prefix = explode('RENAME TABLE ', $query); - $names = explode(' TO ', $prefix[1]); - $result['tablename'] = self::getTableName($names[0]); - $result["tablename_after_rename"] = self::getTableName($names[1]); - } - - /* - * DML statements - */ - - if (! isset($result['identifier'])) { - $result["type"] = 'DML'; - } - // Parse UPDATE statement - if (! isset($result['identifier']) - && substr($query, 0, 6) == 'UPDATE' - ) { - $result['identifier'] = 'UPDATE'; - $prefix = explode('UPDATE ', $query); - $suffix = explode(' ', $prefix[1]); - $result['tablename'] = self::getTableName($suffix[0]); - } - - // Parse INSERT INTO statement - if (! isset($result['identifier']) - && substr($query, 0, 11) == 'INSERT INTO' - ) { - $result['identifier'] = 'INSERT'; - $prefix = explode('INSERT INTO', $query); - $suffix = explode('(', $prefix[1]); - $result['tablename'] = self::getTableName($suffix[0]); - } - - // Parse DELETE statement - if (! isset($result['identifier']) - && substr($query, 0, 6) == 'DELETE' - ) { - $result['identifier'] = 'DELETE'; - $prefix = explode('FROM ', $query); - $suffix = explode(' ', $prefix[1]); - $result['tablename'] = self::getTableName($suffix[0]); - } - - // Parse TRUNCATE statement - if (! isset($result['identifier']) - && substr($query, 0, 8) == 'TRUNCATE' - ) { - $result['identifier'] = 'TRUNCATE'; - $prefix = explode('TRUNCATE', $query); - $result['tablename'] = self::getTableName($prefix[1]); - } - - return $result; - } - - - /** - * Analyzes a given SQL statement and saves tracking data. - * - * @param string $query a SQL query - * - * @static - * - * @return void - */ - static public function handleQuery($query) - { - // If query is marked as untouchable, leave - if (mb_strstr($query, "/*NOTRACK*/")) { - return; - } - - if (! (substr($query, -1) == ';')) { - $query = $query . ";\n"; - } - // Get some information about query - $result = self::parseQuery($query); - - // Get database name - $dbname = trim(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', '`'); - // $dbname can be empty, for example when coming from Synchronize - // and this is a query for the remote server - if (empty($dbname)) { - return; - } - - // If we found a valid statement - if (isset($result['identifier'])) { - $version = self::getVersion( - $dbname, $result['tablename'], $result['identifier'] - ); - - // If version not exists and auto-creation is enabled - if ($GLOBALS['cfg']['Server']['tracking_version_auto_create'] == true - && self::isTracked($dbname, $result['tablename']) == false - && $version == -1 - ) { - // Create the version - - switch ($result['identifier']) { - case 'CREATE TABLE': - self::createVersion($dbname, $result['tablename'], '1'); - break; - case 'CREATE VIEW': - self::createVersion( - $dbname, $result['tablename'], '1', '', true - ); - break; - case 'CREATE DATABASE': - self::createDatabaseVersion($dbname, '1', $query); - break; - } // end switch - } - - // If version exists - if (self::isTracked($dbname, $result['tablename']) && $version != -1) { - if ($result['type'] == 'DDL') { - $save_to = 'schema_sql'; - } elseif ($result['type'] == 'DML') { - $save_to = 'data_sql'; - } else { - $save_to = ''; - } - $date = date('Y-m-d H:i:s'); - - // Cut off `dbname`. from query - $query = preg_replace( - '/`' . preg_quote($dbname, '/') . '`\s?\./', - '', - $query - ); - - // Add log information - $query = self::getLogComment() . $query ; - - // Mark it as untouchable - $sql_query = " /*NOTRACK*/\n" - . " UPDATE " . self::_getTrackingTable() - . " SET " . Util::backquote($save_to) - . " = CONCAT( " . Util::backquote($save_to) . ",'\n" - . $GLOBALS['dbi']->escapeString($query) . "') ," - . " `date_updated` = '" . $date . "' "; - - // If table was renamed we have to change - // the tablename attribute in pma_tracking too - if ($result['identifier'] == 'RENAME TABLE') { - $sql_query .= ', `table_name` = \'' - . $GLOBALS['dbi']->escapeString($result['tablename_after_rename']) - . '\' '; - } - - // Save the tracking information only for - // 1. the database - // 2. the table / view - // 3. the statements - // we want to track - $sql_query .= - " WHERE FIND_IN_SET('" . $result['identifier'] . "',tracking) > 0" . - " AND `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . - " AND `table_name` = '" - . $GLOBALS['dbi']->escapeString($result['tablename']) . "' " . - " AND `version` = '" . $GLOBALS['dbi']->escapeString($version) . "' "; - - PMA_queryAsControlUser($sql_query); - } - } - } - - /** - * Returns the tracking table - * - * @return string tracking table - */ - private static function _getTrackingTable() - { - $cfgRelation = PMA_getRelationsParam(); - return Util::backquote($cfgRelation['db']) - . '.' . Util::backquote($cfgRelation['tracking']); - } -} diff --git a/#pma/libraries/Types.php b/#pma/libraries/Types.php deleted file mode 100644 index 49416add..00000000 --- a/#pma/libraries/Types.php +++ /dev/null @@ -1,296 +0,0 @@ -getUnaryOperators()); - } - - /** - * Returns list of operators checking for NULL. - * - * @return string[] - */ - public function getNullOperators() - { - return array( - 'IS NULL', - 'IS NOT NULL', - ); - } - - /** - * ENUM search operators - * - * @return string[] - */ - public function getEnumOperators() - { - return array( - '=', - '!=', - ); - } - - /** - * TEXT search operators - * - * @return string[] - */ - public function getTextOperators() - { - return array( - 'LIKE', - 'LIKE %...%', - 'NOT LIKE', - '=', - '!=', - 'REGEXP', - 'REGEXP ^...$', - 'NOT REGEXP', - "= ''", - "!= ''", - 'IN (...)', - 'NOT IN (...)', - 'BETWEEN', - 'NOT BETWEEN', - ); - } - - /** - * Number search operators - * - * @return string[] - */ - public function getNumberOperators() - { - return array( - '=', - '>', - '>=', - '<', - '<=', - '!=', - 'LIKE', - 'LIKE %...%', - 'NOT LIKE', - 'IN (...)', - 'NOT IN (...)', - 'BETWEEN', - 'NOT BETWEEN', - ); - } - - /** - * Returns operators for given type - * - * @param string $type Type of field - * @param boolean $null Whether field can be NULL - * - * @return string[] - */ - public function getTypeOperators($type, $null) - { - $ret = array(); - $class = $this->getTypeClass($type); - - if (strncasecmp($type, 'enum', 4) == 0) { - $ret = array_merge($ret, $this->getEnumOperators()); - } elseif ($class == 'CHAR') { - $ret = array_merge($ret, $this->getTextOperators()); - } else { - $ret = array_merge($ret, $this->getNumberOperators()); - } - - if ($null) { - $ret = array_merge($ret, $this->getNullOperators()); - } - - return $ret; - } - - /** - * Returns operators for given type as html options - * - * @param string $type Type of field - * @param boolean $null Whether field can be NULL - * @param string $selectedOperator Option to be selected - * - * @return string Generated Html - */ - public function getTypeOperatorsHtml($type, $null, $selectedOperator = null) - { - $html = ''; - - foreach ($this->getTypeOperators($type, $null) as $fc) { - if (isset($selectedOperator) && $selectedOperator == $fc) { - $selected = ' selected="selected"'; - } else { - $selected = ''; - } - $html .= ''; - } - - return $html; - } - - /** - * Returns the data type description. - * - * @param string $type The data type to get a description. - * - * @return string - * - */ - public function getTypeDescription($type) - { - return ''; - } - - /** - * Returns class of a type, used for functions available for type - * or default values. - * - * @param string $type The data type to get a class. - * - * @return string - * - */ - public function getTypeClass($type) - { - return ''; - } - - /** - * Returns array of functions available for a class. - * - * @param string $class The class to get function list. - * - * @return string[] - * - */ - public function getFunctionsClass($class) - { - return array(); - } - - /** - * Returns array of functions available for a type. - * - * @param string $type The data type to get function list. - * - * @return string[] - * - */ - public function getFunctions($type) - { - $class = $this->getTypeClass($type); - return $this->getFunctionsClass($class); - } - - /** - * Returns array of all functions available. - * - * @return string[] - * - */ - public function getAllFunctions() - { - $ret = array_merge( - $this->getFunctionsClass('CHAR'), - $this->getFunctionsClass('NUMBER'), - $this->getFunctionsClass('DATE'), - $this->getFunctionsClass('UUID') - ); - sort($ret); - return $ret; - } - - /** - * Returns array of all attributes available. - * - * @return string[] - * - */ - public function getAttributes() - { - return array(); - } - - /** - * Returns array of all column types available. - * - * @return string[] - * - */ - public function getColumns() - { - // most used types - return array( - 'INT', - 'VARCHAR', - 'TEXT', - 'DATE', - ); - } - - /** - * Returns an array of integer types - * - * @return string[] integer types - */ - public function getIntegerTypes() - { - return array(); - } - - /** - * Returns the min and max values of a given integer type - * - * @param string $type integer type - * @param boolean $signed whether signed - * - * @return string[] min and max values - */ - public function getIntegerRange($type, $signed = true) - { - return array('', ''); - } -} diff --git a/#pma/libraries/TypesMySQL.php b/#pma/libraries/TypesMySQL.php deleted file mode 100644 index a1ee7bac..00000000 --- a/#pma/libraries/TypesMySQL.php +++ /dev/null @@ -1,590 +0,0 @@ -= 50708 - && \PMA\libraries\Util::getServerType() != 'MariaDB' - ) { - $ret['JSON'] = array( - 'JSON', - ); - } - - return $ret; - } - - /** - * Returns an array of integer types - * - * @return string[] integer types - */ - public function getIntegerTypes() - { - return array('tinyint', 'smallint', 'mediumint', 'int', 'bigint'); - } - - /** - * Returns the min and max values of a given integer type - * - * @param string $type integer type - * @param boolean $signed whether signed - * - * @return string[] min and max values - */ - public function getIntegerRange($type, $signed = true) - { - static $min_max_data = array( - 'unsigned' => array( - 'tinyint' => array('0', '255'), - 'smallint' => array('0', '65535'), - 'mediumint' => array('0', '16777215'), - 'int' => array('0', '4294967295'), - 'bigint' => array('0', '18446744073709551615') - ), - 'signed' => array( - 'tinyint' => array('-128', '127'), - 'smallint' => array('-32768', '32767'), - 'mediumint' => array('-8388608', '8388607'), - 'int' => array('-2147483648', '2147483647'), - 'bigint' => array('-9223372036854775808', '9223372036854775807') - ) - ); - $relevantArray = $signed - ? $min_max_data['signed'] - : $min_max_data['unsigned']; - return isset($relevantArray[$type]) ? $relevantArray[$type] : array('', ''); - } -} diff --git a/#pma/libraries/Util.php b/#pma/libraries/Util.php deleted file mode 100644 index 7832ec8a..00000000 --- a/#pma/libraries/Util.php +++ /dev/null @@ -1,4978 +0,0 @@ -'; - if ($include_icon) { - $button .= self::getImage($icon, $alternate); - } - if ($include_icon && $include_text) { - $button .= ' '; - } - if ($include_text) { - $button .= $alternate; - } - $button .= $menu_icon ? '' : ''; - - return $button; - } - - /** - * Returns an HTML IMG tag for a particular image from a theme, - * which may be an actual file or an icon from a sprite - * - * @param string $image The name of the file to get - * @param string $alternate Used to set 'alt' and 'title' attributes - * of the image - * @param array $attributes An associative array of other attributes - * - * @return string an html IMG tag - */ - public static function getImage($image, $alternate = '', $attributes = array()) - { - static $sprites; // cached list of available sprites (if any) - if (defined('TESTSUITE')) { - // prevent caching in testsuite - unset($sprites); - } - - $is_sprite = false; - $alternate = htmlspecialchars($alternate); - - // If it's the first time this function is called - if (! isset($sprites)) { - $sprites = array(); - // Try to load the list of sprites - if (isset($_SESSION['PMA_Theme'])) { - $sprite_file = $_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php'; - if (is_readable($sprite_file)) { - include_once $sprite_file; - $sprites = PMA_sprites(); - } - } - } - - // Check if we have the requested image as a sprite - // and set $url accordingly - $class = str_replace(array('.gif','.png'), '', $image); - if (array_key_exists($class, $sprites)) { - $is_sprite = true; - $url = (defined('PMA_TEST_THEME') ? '../' : '') . 'themes/dot.gif'; - } elseif (isset($GLOBALS['pmaThemeImage'])) { - $url = $GLOBALS['pmaThemeImage'] . $image; - } else { - $url = './themes/pmahomme/' . $image; - } - - // set class attribute - if ($is_sprite) { - if (isset($attributes['class'])) { - $attributes['class'] = "icon ic_$class " . $attributes['class']; - } else { - $attributes['class'] = "icon ic_$class"; - } - } - - // set all other attributes - $attr_str = ''; - foreach ($attributes as $key => $value) { - if (! in_array($key, array('alt', 'title'))) { - $attr_str .= " $key=\"$value\""; - } - } - - // override the alt attribute - if (isset($attributes['alt'])) { - $alt = $attributes['alt']; - } else { - $alt = $alternate; - } - - // override the title attribute - if (isset($attributes['title'])) { - $title = $attributes['title']; - } else { - $title = $alternate; - } - - // generate the IMG tag - $template = '%s'; - $retval = sprintf($template, $url, $title, $alt, $attr_str); - - return $retval; - } - - /** - * Returns the formatted maximum size for an upload - * - * @param integer $max_upload_size the size - * - * @return string the message - * - * @access public - */ - public static function getFormattedMaximumUploadSize($max_upload_size) - { - // I have to reduce the second parameter (sensitiveness) from 6 to 4 - // to avoid weird results like 512 kKib - list($max_size, $max_unit) = self::formatByteDown($max_upload_size, 4); - return '(' . sprintf(__('Max: %s%s'), $max_size, $max_unit) . ')'; - } - - /** - * Generates a hidden field which should indicate to the browser - * the maximum size for upload - * - * @param integer $max_size the size - * - * @return string the INPUT field - * - * @access public - */ - public static function generateHiddenMaxFileSize($max_size) - { - return ''; - } - - /** - * Add slashes before "_" and "%" characters for using them in MySQL - * database, table and field names. - * Note: This function does not escape backslashes! - * - * @param string $name the string to escape - * - * @return string the escaped string - * - * @access public - */ - public static function escapeMysqlWildcards($name) - { - return strtr($name, array('_' => '\\_', '%' => '\\%')); - } // end of the 'escapeMysqlWildcards()' function - - /** - * removes slashes before "_" and "%" characters - * Note: This function does not unescape backslashes! - * - * @param string $name the string to escape - * - * @return string the escaped string - * - * @access public - */ - public static function unescapeMysqlWildcards($name) - { - return strtr($name, array('\\_' => '_', '\\%' => '%')); - } // end of the 'unescapeMysqlWildcards()' function - - /** - * removes quotes (',",`) from a quoted string - * - * checks if the string is quoted and removes this quotes - * - * @param string $quoted_string string to remove quotes from - * @param string $quote type of quote to remove - * - * @return string unqoted string - */ - public static function unQuote($quoted_string, $quote = null) - { - $quotes = array(); - - if ($quote === null) { - $quotes[] = '`'; - $quotes[] = '"'; - $quotes[] = "'"; - } else { - $quotes[] = $quote; - } - - foreach ($quotes as $quote) { - if (mb_substr($quoted_string, 0, 1) === $quote - && mb_substr($quoted_string, -1, 1) === $quote - ) { - $unquoted_string = mb_substr($quoted_string, 1, -1); - // replace escaped quotes - $unquoted_string = str_replace( - $quote . $quote, - $quote, - $unquoted_string - ); - return $unquoted_string; - } - } - - return $quoted_string; - } - - /** - * format sql strings - * - * @param string $sqlQuery raw SQL string - * @param boolean $truncate truncate the query if it is too long - * - * @return string the formatted sql - * - * @global array $cfg the configuration array - * - * @access public - * @todo move into PMA_Sql - */ - public static function formatSql($sqlQuery, $truncate = false) - { - global $cfg; - - if ($truncate - && mb_strlen($sqlQuery) > $cfg['MaxCharactersInDisplayedSQL'] - ) { - $sqlQuery = mb_substr( - $sqlQuery, - 0, - $cfg['MaxCharactersInDisplayedSQL'] - ) . '[...]'; - } - return '
    ' . "\n"
    -            . htmlspecialchars($sqlQuery) . "\n"
    -            . '
    '; - } // end of the "formatSql()" function - - /** - * Displays a link to the documentation as an icon - * - * @param string $link documentation link - * @param string $target optional link target - * @param boolean $bbcode optional flag indicating whether to output bbcode - * - * @return string the html link - * - * @access public - */ - public static function showDocLink($link, $target = 'documentation', $bbcode = false) - { - if($bbcode){ - return "[a@$link@$target][dochelpicon][/a]"; - }else{ - return '' - . self::getImage('b_help.png', __('Documentation')) - . ''; - } - } // end of the 'showDocLink()' function - - /** - * Get a URL link to the official MySQL documentation - * - * @param string $link contains name of page/anchor that is being linked - * @param string $anchor anchor to page part - * - * @return string the URL link - * - * @access public - */ - public static function getMySQLDocuURL($link, $anchor = '') - { - // Fixup for newly used names: - $link = str_replace('_', '-', mb_strtolower($link)); - - if (empty($link)) { - $link = 'index'; - } - $mysql = '5.5'; - $lang = 'en'; - if (defined('PMA_MYSQL_INT_VERSION')) { - if (PMA_MYSQL_INT_VERSION >= 50700) { - $mysql = '5.7'; - } elseif (PMA_MYSQL_INT_VERSION >= 50600) { - $mysql = '5.6'; - } elseif (PMA_MYSQL_INT_VERSION >= 50500) { - $mysql = '5.5'; - } - } - $url = 'https://dev.mysql.com/doc/refman/' - . $mysql . '/' . $lang . '/' . $link . '.html'; - if (! empty($anchor)) { - $url .= '#' . $anchor; - } - - return PMA_linkURL($url); - } - - /** - * Displays a link to the official MySQL documentation - * - * @param string $link contains name of page/anchor that is being linked - * @param bool $big_icon whether to use big icon (like in left frame) - * @param string $anchor anchor to page part - * @param bool $just_open whether only the opening tag should be returned - * - * @return string the html link - * - * @access public - */ - public static function showMySQLDocu( - $link, - $big_icon = false, - $anchor = '', - $just_open = false - ) { - $url = self::getMySQLDocuURL($link, $anchor); - $open_link = ''; - if ($just_open) { - return $open_link; - } elseif ($big_icon) { - return $open_link - . self::getImage('b_sqlhelp.png', __('Documentation')) . ''; - } else { - return self::showDocLink($url, 'mysql_doc'); - } - } // end of the 'showMySQLDocu()' function - - /** - * Returns link to documentation. - * - * @param string $page Page in documentation - * @param string $anchor Optional anchor in page - * - * @return string URL - */ - public static function getDocuLink($page, $anchor = '') - { - /* Construct base URL */ - $url = $page . '.html'; - if (!empty($anchor)) { - $url .= '#' . $anchor; - } - - /* Check if we have built local documentation */ - if (defined('TESTSUITE')) { - /* Provide consistent URL for testsuite */ - return PMA_linkURL('https://docs.phpmyadmin.net/en/latest/' . $url); - } elseif (@file_exists('doc/html/index.html')) { - if (defined('PMA_SETUP')) { - return '../doc/html/' . $url; - } else { - return './doc/html/' . $url; - } - } else { - /* TODO: Should link to correct branch for released versions */ - return PMA_linkURL('https://docs.phpmyadmin.net/en/latest/' . $url); - } - } - - /** - * Displays a link to the phpMyAdmin documentation - * - * @param string $page Page in documentation - * @param string $anchor Optional anchor in page - * @param boolean $bbcode Optional flag indicating whether to output bbcode - * - * @return string the html link - * - * @access public - */ - public static function showDocu($page, $anchor = '', $bbcode = false) - { - return self::showDocLink(self::getDocuLink($page, $anchor), 'documentation', $bbcode); - } // end of the 'showDocu()' function - - /** - * Displays a link to the PHP documentation - * - * @param string $target anchor in documentation - * - * @return string the html link - * - * @access public - */ - public static function showPHPDocu($target) - { - $url = PMA_getPHPDocLink($target); - - return self::showDocLink($url); - } // end of the 'showPHPDocu()' function - - /** - * Returns HTML code for a tooltip - * - * @param string $message the message for the tooltip - * - * @return string - * - * @access public - */ - public static function showHint($message) - { - if ($GLOBALS['cfg']['ShowHint']) { - $classClause = ' class="pma_hint"'; - } else { - $classClause = ''; - } - return '' - . self::getImage('b_help.png') - . '' . $message . '' - . ''; - } - - /** - * Displays a MySQL error message in the main panel when $exit is true. - * Returns the error message otherwise. - * - * @param string|bool $server_msg Server's error message. - * @param string $sql_query The SQL query that failed. - * @param bool $is_modify_link Whether to show a "modify" link or not. - * @param string $back_url URL for the "back" link (full path is - * not required). - * @param bool $exit Whether execution should be stopped or - * the error message should be returned. - * - * @return string - * - * @global string $table The current table. - * @global string $db The current database. - * - * @access public - */ - public static function mysqlDie( - $server_msg = '', - $sql_query = '', - $is_modify_link = true, - $back_url = '', - $exit = true - ) { - global $table, $db; - - /** - * Error message to be built. - * @var string $error_msg - */ - $error_msg = ''; - - // Checking for any server errors. - if (empty($server_msg)) { - $server_msg = $GLOBALS['dbi']->getError(); - } - - // Finding the query that failed, if not specified. - if ((empty($sql_query) && (!empty($GLOBALS['sql_query'])))) { - $sql_query = $GLOBALS['sql_query']; - } - $sql_query = trim($sql_query); - - /** - * The lexer used for analysis. - * @var Lexer $lexer - */ - $lexer = new Lexer($sql_query); - - /** - * The parser used for analysis. - * @var Parser $parser - */ - $parser = new Parser($lexer->list); - - /** - * The errors found by the lexer and the parser. - * @var array $errors - */ - $errors = ParserError::get(array($lexer, $parser)); - - if (empty($sql_query)) { - $formatted_sql = ''; - } elseif (count($errors)) { - $formatted_sql = htmlspecialchars($sql_query); - } else { - $formatted_sql = self::formatSql($sql_query, true); - } - - $error_msg .= '

    ' . __('Error') . '

    '; - - // For security reasons, if the MySQL refuses the connection, the query - // is hidden so no details are revealed. - if ((!empty($sql_query)) && (!(mb_strstr($sql_query, 'connect')))) { - // Static analysis errors. - if (!empty($errors)) { - $error_msg .= '

    ' . __('Static analysis:') - . '

    '; - $error_msg .= '

    ' . sprintf( - __('%d errors were found during analysis.'), - count($errors) - ) . '

    '; - $error_msg .= '

      '; - $error_msg .= implode( - ParserError::format( - $errors, - '
    1. %2$s (near "%4$s" at position %5$d)
    2. ' - ) - ); - $error_msg .= '

    '; - } - - // Display the SQL query and link to MySQL documentation. - $error_msg .= '

    ' . __('SQL query:') . '' . "\n"; - $formattedSqlToLower = mb_strtolower($formatted_sql); - - // TODO: Show documentation for all statement types. - if (mb_strstr($formattedSqlToLower, 'select')) { - // please show me help to the error on select - $error_msg .= self::showMySQLDocu('SELECT'); - } - - if ($is_modify_link) { - $_url_params = array( - 'sql_query' => $sql_query, - 'show_query' => 1, - ); - if (mb_strlen($table)) { - $_url_params['db'] = $db; - $_url_params['table'] = $table; - $doedit_goto = ''; - } elseif (mb_strlen($db)) { - $_url_params['db'] = $db; - $doedit_goto = ''; - } else { - $doedit_goto = ''; - } - - $error_msg .= $doedit_goto - . self::getIcon('b_edit.png', __('Edit')) - . ''; - } - - $error_msg .= '

    ' . "\n" - . '

    ' . "\n" - . $formatted_sql . "\n" - . '

    ' . "\n"; - } - - // Display server's error. - if (!empty($server_msg)) { - $server_msg = preg_replace( - "@((\015\012)|(\015)|(\012)){3,}@", - "\n\n", - $server_msg - ); - - // Adds a link to MySQL documentation. - $error_msg .= '

    ' . "\n" - . ' ' . __('MySQL said: ') . '' - . self::showMySQLDocu('Error-messages-server') - . "\n" - . '

    ' . "\n"; - - // The error message will be displayed within a CODE segment. - // To preserve original formatting, but allow word-wrapping, - // a couple of replacements are done. - // All non-single blanks and TAB-characters are replaced with their - // HTML-counterpart - $server_msg = str_replace( - array(' ', "\t"), - array('  ', '    '), - $server_msg - ); - - // Replace line breaks - $server_msg = nl2br($server_msg); - - $error_msg .= '' . $server_msg . '
    '; - } - - $error_msg .= '
    '; - $_SESSION['Import_message']['message'] = $error_msg; - - if (!$exit) { - return $error_msg; - } - - /** - * If this is an AJAX request, there is no "Back" link and - * `Response()` is used to send the response. - */ - if (!empty($GLOBALS['is_ajax_request'])) { - $response = Response::getInstance(); - $response->setRequestStatus(false); - $response->addJSON('message', $error_msg); - exit; - } - - if (!empty($back_url)) { - if (mb_strstr($back_url, '?')) { - $back_url .= '&no_history=true'; - } else { - $back_url .= '?no_history=true'; - } - - $_SESSION['Import_message']['go_back_url'] = $back_url; - - $error_msg .= '
    ' - . '[ ' . __('Back') . ' ]' - . '
    ' . "\n\n"; - } - - exit($error_msg); - } - - /** - * Check the correct row count - * - * @param string $db the db name - * @param array $table the table infos - * - * @return int $rowCount the possibly modified row count - * - */ - private static function _checkRowCount($db, $table) - { - $rowCount = 0; - - if ($table['Rows'] === null) { - // Do not check exact row count here, - // if row count is invalid possibly the table is defect - // and this would break the navigation panel; - // but we can check row count if this is a view or the - // information_schema database - // since Table::countRecords() returns a limited row count - // in this case. - - // set this because Table::countRecords() can use it - $tbl_is_view = $table['TABLE_TYPE'] == 'VIEW'; - - if ($tbl_is_view || $GLOBALS['dbi']->isSystemSchema($db)) { - $rowCount = $GLOBALS['dbi'] - ->getTable($db, $table['Name']) - ->countRecords(); - } - } - return $rowCount; - } - - /** - * returns array with tables of given db with extended information and grouped - * - * @param string $db name of db - * @param string $tables name of tables - * @param integer $limit_offset list offset - * @param int|bool $limit_count max tables to return - * - * @return array (recursive) grouped table list - */ - public static function getTableList( - $db, - $tables = null, - $limit_offset = 0, - $limit_count = false - ) { - $sep = $GLOBALS['cfg']['NavigationTreeTableSeparator']; - - if ($tables === null) { - $tables = $GLOBALS['dbi']->getTablesFull( - $db, - '', - false, - null, - $limit_offset, - $limit_count - ); - if ($GLOBALS['cfg']['NaturalOrder']) { - uksort($tables, 'strnatcasecmp'); - } - } - - if (count($tables) < 1) { - return $tables; - } - - $default = array( - 'Name' => '', - 'Rows' => 0, - 'Comment' => '', - 'disp_name' => '', - ); - - $table_groups = array(); - - foreach ($tables as $table_name => $table) { - $table['Rows'] = self::_checkRowCount($db, $table); - - // in $group we save the reference to the place in $table_groups - // where to store the table info - if ($GLOBALS['cfg']['NavigationTreeEnableGrouping'] - && $sep && mb_strstr($table_name, $sep) - ) { - $parts = explode($sep, $table_name); - - $group =& $table_groups; - $i = 0; - $group_name_full = ''; - $parts_cnt = count($parts) - 1; - - while (($i < $parts_cnt) - && ($i < $GLOBALS['cfg']['NavigationTreeTableLevel']) - ) { - $group_name = $parts[$i] . $sep; - $group_name_full .= $group_name; - - if (! isset($group[$group_name])) { - $group[$group_name] = array(); - $group[$group_name]['is' . $sep . 'group'] = true; - $group[$group_name]['tab' . $sep . 'count'] = 1; - $group[$group_name]['tab' . $sep . 'group'] - = $group_name_full; - - } elseif (! isset($group[$group_name]['is' . $sep . 'group'])) { - $table = $group[$group_name]; - $group[$group_name] = array(); - $group[$group_name][$group_name] = $table; - $group[$group_name]['is' . $sep . 'group'] = true; - $group[$group_name]['tab' . $sep . 'count'] = 1; - $group[$group_name]['tab' . $sep . 'group'] - = $group_name_full; - - } else { - $group[$group_name]['tab' . $sep . 'count']++; - } - - $group =& $group[$group_name]; - $i++; - } - - } else { - if (! isset($table_groups[$table_name])) { - $table_groups[$table_name] = array(); - } - $group =& $table_groups; - } - - $table['disp_name'] = $table['Name']; - $group[$table_name] = array_merge($default, $table); - } - - return $table_groups; - } - - /* ----------------------- Set of misc functions ----------------------- */ - - /** - * Adds backquotes on both sides of a database, table or field name. - * and escapes backquotes inside the name with another backquote - * - * example: - * - * echo backquote('owner`s db'); // `owner``s db` - * - * - * - * @param mixed $a_name the database, table or field name to "backquote" - * or array of it - * @param boolean $do_it a flag to bypass this function (used by dump - * functions) - * - * @return mixed the "backquoted" database, table or field name - * - * @access public - */ - public static function backquote($a_name, $do_it = true) - { - if (is_array($a_name)) { - foreach ($a_name as &$data) { - $data = self::backquote($data, $do_it); - } - return $a_name; - } - - if (! $do_it) { - if (!(Context::isKeyword($a_name) & Token::FLAG_KEYWORD_RESERVED) - ) { - return $a_name; - } - } - - // '0' is also empty for php :-( - if (mb_strlen($a_name) && $a_name !== '*') { - return '`' . str_replace('`', '``', $a_name) . '`'; - } else { - return $a_name; - } - } // end of the 'backquote()' function - - /** - * Adds backquotes on both sides of a database, table or field name. - * in compatibility mode - * - * example: - * - * echo backquoteCompat('owner`s db'); // `owner``s db` - * - * - * - * @param mixed $a_name the database, table or field name to - * "backquote" or array of it - * @param string $compatibility string compatibility mode (used by dump - * functions) - * @param boolean $do_it a flag to bypass this function (used by dump - * functions) - * - * @return mixed the "backquoted" database, table or field name - * - * @access public - */ - public static function backquoteCompat( - $a_name, - $compatibility = 'MSSQL', - $do_it = true - ) { - if (is_array($a_name)) { - foreach ($a_name as &$data) { - $data = self::backquoteCompat($data, $compatibility, $do_it); - } - return $a_name; - } - - if (! $do_it) { - if (!Context::isKeyword($a_name)) { - return $a_name; - } - } - - // @todo add more compatibility cases (ORACLE for example) - switch ($compatibility) { - case 'MSSQL': - $quote = '"'; - break; - default: - $quote = "`"; - break; - } - - // '0' is also empty for php :-( - if (mb_strlen($a_name) && $a_name !== '*') { - return $quote . $a_name . $quote; - } else { - return $a_name; - } - } // end of the 'backquoteCompat()' function - - /** - * Defines the value depending on the user OS. - * - * @return string the value to use - * - * @access public - */ - public static function whichCrlf() - { - // The 'PMA_USR_OS' constant is defined in "libraries/Config.php" - // Win case - if (PMA_USR_OS == 'Win') { - $the_crlf = "\r\n"; - } else { - // Others - $the_crlf = "\n"; - } - - return $the_crlf; - } // end of the 'whichCrlf()' function - - /** - * Prepare the message and the query - * usually the message is the result of the query executed - * - * @param Message|string $message the message to display - * @param string $sql_query the query to display - * @param string $type the type (level) of the message - * - * @return string - * - * @access public - */ - public static function getMessage( - $message, - $sql_query = null, - $type = 'notice' - ) { - global $cfg; - $retval = ''; - - if (null === $sql_query) { - if (! empty($GLOBALS['display_query'])) { - $sql_query = $GLOBALS['display_query']; - } elseif (! empty($GLOBALS['unparsed_sql'])) { - $sql_query = $GLOBALS['unparsed_sql']; - } elseif (! empty($GLOBALS['sql_query'])) { - $sql_query = $GLOBALS['sql_query']; - } else { - $sql_query = ''; - } - } - - $render_sql = $cfg['ShowSQL'] == true && ! empty($sql_query) && $sql_query !== ';'; - - if (isset($GLOBALS['using_bookmark_message'])) { - $retval .= $GLOBALS['using_bookmark_message']->getDisplay(); - unset($GLOBALS['using_bookmark_message']); - } - - if ($render_sql) { - $retval .= '
    ' . "\n"; - } - - if ($message instanceof Message) { - if (isset($GLOBALS['special_message'])) { - $message->addMessage($GLOBALS['special_message']); - unset($GLOBALS['special_message']); - } - $retval .= $message->getDisplay(); - } else { - $retval .= '
    '; - $retval .= PMA_sanitize($message); - if (isset($GLOBALS['special_message'])) { - $retval .= PMA_sanitize($GLOBALS['special_message']); - unset($GLOBALS['special_message']); - } - $retval .= '
    '; - } - - if ($render_sql) { - // Html format the query to be displayed - // If we want to show some sql code it is easiest to create it here - /* SQL-Parser-Analyzer */ - - if (! empty($GLOBALS['show_as_php'])) { - $new_line = '\\n"
    ' . "\n" - . '    . "'; - $query_base = htmlspecialchars(addslashes($sql_query)); - $query_base = preg_replace( - '/((\015\012)|(\015)|(\012))/', - $new_line, - $query_base - ); - } else { - $query_base = $sql_query; - } - - $query_too_big = false; - - $queryLength = mb_strlen($query_base); - if ($queryLength > $cfg['MaxCharactersInDisplayedSQL']) { - // when the query is large (for example an INSERT of binary - // data), the parser chokes; so avoid parsing the query - $query_too_big = true; - $shortened_query_base = nl2br( - htmlspecialchars( - mb_substr( - $sql_query, - 0, - $cfg['MaxCharactersInDisplayedSQL'] - ) . '[...]' - ) - ); - } - - if (! empty($GLOBALS['show_as_php'])) { - $query_base = '$sql = \'' . $query_base; - $query_base = '
    ' . "\n"
    -                    . $query_base;
    -            } elseif (isset($query_base)) {
    -                $query_base = self::formatSql($query_base);
    -            }
    -
    -            // Prepares links that may be displayed to edit/explain the query
    -            // (don't go to default pages, we must go to the page
    -            // where the query box is available)
    -
    -            // Basic url query part
    -            $url_params = array();
    -            if (! isset($GLOBALS['db'])) {
    -                $GLOBALS['db'] = '';
    -            }
    -            if (mb_strlen($GLOBALS['db'])) {
    -                $url_params['db'] = $GLOBALS['db'];
    -                if (mb_strlen($GLOBALS['table'])) {
    -                    $url_params['table'] = $GLOBALS['table'];
    -                    $edit_link = 'tbl_sql.php';
    -                } else {
    -                    $edit_link = 'db_sql.php';
    -                }
    -            } else {
    -                $edit_link = 'server_sql.php';
    -            }
    -
    -            // Want to have the query explained
    -            // but only explain a SELECT (that has not been explained)
    -            /* SQL-Parser-Analyzer */
    -            $explain_link = '';
    -            $is_select = preg_match('@^SELECT[[:space:]]+@i', $sql_query);
    -            if (! empty($cfg['SQLQuery']['Explain']) && ! $query_too_big) {
    -                $explain_params = $url_params;
    -                if ($is_select) {
    -                    $explain_params['sql_query'] = 'EXPLAIN ' . $sql_query;
    -                    $explain_link = ' ['
    -                        . self::linkOrButton(
    -                            'import.php' . PMA_URL_getCommon($explain_params),
    -                            __('Explain SQL')
    -                        ) . ']';
    -                } elseif (preg_match(
    -                    '@^EXPLAIN[[:space:]]+SELECT[[:space:]]+@i',
    -                    $sql_query
    -                )) {
    -                    $explain_params['sql_query']
    -                        = mb_substr($sql_query, 8);
    -                    $explain_link = ' ['
    -                        . self::linkOrButton(
    -                            'import.php' . PMA_URL_getCommon($explain_params),
    -                            __('Skip Explain SQL')
    -                        ) . ']';
    -                    $url = 'https://mariadb.org/explain_analyzer/analyze/'
    -                        . '?client=phpMyAdmin&raw_explain='
    -                        . urlencode(self::_generateRowQueryOutput($sql_query));
    -                    $explain_link .= ' ['
    -                        . self::linkOrButton(
    -                            htmlspecialchars('url.php?url=' . urlencode($url)),
    -                            sprintf(__('Analyze Explain at %s'), 'mariadb.org'),
    -                            array(),
    -                            true,
    -                            false,
    -                            '_blank'
    -                        ) . ']';
    -                }
    -            } //show explain
    -
    -            $url_params['sql_query']  = $sql_query;
    -            $url_params['show_query'] = 1;
    -
    -            // even if the query is big and was truncated, offer the chance
    -            // to edit it (unless it's enormous, see linkOrButton() )
    -            if (! empty($cfg['SQLQuery']['Edit'])
    -                && empty($GLOBALS['show_as_php'])
    -            ) {
    -                $edit_link .= PMA_URL_getCommon($url_params) . '#querybox';
    -                $edit_link = ' ['
    -                    . self::linkOrButton($edit_link, __('Edit'))
    -                    . ']';
    -            } else {
    -                $edit_link = '';
    -            }
    -
    -            // Also we would like to get the SQL formed in some nice
    -            // php-code
    -            if (! empty($cfg['SQLQuery']['ShowAsPHP']) && ! $query_too_big) {
    -
    -                if (! empty($GLOBALS['show_as_php'])) {
    -                    $php_link = ' ['
    -                        . self::linkOrButton(
    -                            'import.php' . PMA_URL_getCommon($url_params),
    -                            __('Without PHP code'),
    -                            array(),
    -                            true,
    -                            false,
    -                            '',
    -                            true
    -                        )
    -                        . ']';
    -
    -                    $php_link .= ' ['
    -                        . self::linkOrButton(
    -                            'import.php' . PMA_URL_getCommon($url_params),
    -                            __('Submit query'),
    -                            array(),
    -                            true,
    -                            false,
    -                            '',
    -                            true
    -                        )
    -                        . ']';
    -                } else {
    -                    $php_params = $url_params;
    -                    $php_params['show_as_php'] = 1;
    -                    $_message = __('Create PHP code');
    -                    $php_link = ' ['
    -                        . self::linkOrButton(
    -                            'import.php' . PMA_URL_getCommon($php_params),
    -                            $_message
    -                        )
    -                        . ']';
    -                }
    -            } else {
    -                $php_link = '';
    -            } //show as php
    -
    -            // Refresh query
    -            if (! empty($cfg['SQLQuery']['Refresh'])
    -                && ! isset($GLOBALS['show_as_php']) // 'Submit query' does the same
    -                && preg_match('@^(SELECT|SHOW)[[:space:]]+@i', $sql_query)
    -            ) {
    -                $refresh_link = 'import.php' . PMA_URL_getCommon($url_params);
    -                $refresh_link = ' ['
    -                    . self::linkOrButton($refresh_link, __('Refresh')) . ']';
    -            } else {
    -                $refresh_link = '';
    -            } //refresh
    -
    -            $retval .= '
    '; - if ($query_too_big) { - $retval .= $shortened_query_base; - } else { - $retval .= $query_base; - } - - //Clean up the end of the PHP - if (! empty($GLOBALS['show_as_php'])) { - $retval .= '\';' . "\n" - . '
    '; - } - $retval .= '
    '; - - $retval .= ''; - - $retval .= '
    '; - } - - - return $retval; - } // end of the 'getMessage()' function - - /** - * Execute an EXPLAIN query and formats results similar to MySQL command line - * utility. - * - * @param string $sqlQuery EXPLAIN query - * - * @return string query resuls - */ - private static function _generateRowQueryOutput($sqlQuery) - { - $ret = ''; - $result = $GLOBALS['dbi']->query($sqlQuery); - if ($result) { - $devider = '+'; - $columnNames = '|'; - $fieldsMeta = $GLOBALS['dbi']->getFieldsMeta($result); - foreach ($fieldsMeta as $meta) { - $devider .= '---+'; - $columnNames .= ' ' . $meta->name . ' |'; - } - $devider .= "\n"; - - $ret .= $devider . $columnNames . "\n" . $devider; - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $values = '|'; - foreach ($row as $value) { - if (is_null($value)) { - $value = 'NULL'; - } - $values .= ' ' . $value . ' |'; - } - $ret .= $values . "\n"; - } - $ret .= $devider; - } - return $ret; - } - - /** - * Verifies if current MySQL server supports profiling - * - * @access public - * - * @return boolean whether profiling is supported - */ - public static function profilingSupported() - { - if (!self::cacheExists('profiling_supported')) { - // 5.0.37 has profiling but for example, 5.1.20 does not - // (avoid a trip to the server for MySQL before 5.0.37) - // and do not set a constant as we might be switching servers - if (defined('PMA_MYSQL_INT_VERSION') - && $GLOBALS['dbi']->fetchValue("SELECT @@have_profiling") - ) { - self::cacheSet('profiling_supported', true); - } else { - self::cacheSet('profiling_supported', false); - } - } - - return self::cacheGet('profiling_supported'); - } - - /** - * Formats $value to byte view - * - * @param double|int $value the value to format - * @param int $limes the sensitiveness - * @param int $comma the number of decimals to retain - * - * @return array the formatted value and its unit - * - * @access public - */ - public static function formatByteDown($value, $limes = 6, $comma = 0) - { - if ($value === null) { - return null; - } - - $byteUnits = array( - /* l10n: shortcuts for Byte */ - __('B'), - /* l10n: shortcuts for Kilobyte */ - __('KiB'), - /* l10n: shortcuts for Megabyte */ - __('MiB'), - /* l10n: shortcuts for Gigabyte */ - __('GiB'), - /* l10n: shortcuts for Terabyte */ - __('TiB'), - /* l10n: shortcuts for Petabyte */ - __('PiB'), - /* l10n: shortcuts for Exabyte */ - __('EiB') - ); - - $dh = self::pow(10, $comma); - $li = self::pow(10, $limes); - $unit = $byteUnits[0]; - - for ($d = 6, $ex = 15; $d >= 1; $d--, $ex-=3) { - $unitSize = $li * self::pow(10, $ex); - if (isset($byteUnits[$d]) && $value >= $unitSize) { - // use 1024.0 to avoid integer overflow on 64-bit machines - $value = round($value / (self::pow(1024, $d) / $dh)) /$dh; - $unit = $byteUnits[$d]; - break 1; - } // end if - } // end for - - if ($unit != $byteUnits[0]) { - // if the unit is not bytes (as represented in current language) - // reformat with max length of 5 - // 4th parameter=true means do not reformat if value < 1 - $return_value = self::formatNumber($value, 5, $comma, true); - } else { - // do not reformat, just handle the locale - $return_value = self::formatNumber($value, 0); - } - - return array(trim($return_value), $unit); - } // end of the 'formatByteDown' function - - /** - * Changes thousands and decimal separators to locale specific values. - * - * @param string $value the value - * - * @return string - */ - public static function localizeNumber($value) - { - return str_replace( - array(',', '.'), - array( - /* l10n: Thousands separator */ - __(','), - /* l10n: Decimal separator */ - __('.'), - ), - $value - ); - } - - /** - * Formats $value to the given length and appends SI prefixes - * with a $length of 0 no truncation occurs, number is only formatted - * to the current locale - * - * examples: - * - * echo formatNumber(123456789, 6); // 123,457 k - * echo formatNumber(-123456789, 4, 2); // -123.46 M - * echo formatNumber(-0.003, 6); // -3 m - * echo formatNumber(0.003, 3, 3); // 0.003 - * echo formatNumber(0.00003, 3, 2); // 0.03 m - * echo formatNumber(0, 6); // 0 - * - * - * @param double $value the value to format - * @param integer $digits_left number of digits left of the comma - * @param integer $digits_right number of digits right of the comma - * @param boolean $only_down do not reformat numbers below 1 - * @param boolean $noTrailingZero removes trailing zeros right of the comma - * (default: true) - * - * @return string the formatted value and its unit - * - * @access public - */ - public static function formatNumber( - $value, - $digits_left = 3, - $digits_right = 0, - $only_down = false, - $noTrailingZero = true - ) { - if ($value == 0) { - return '0'; - } - - $originalValue = $value; - //number_format is not multibyte safe, str_replace is safe - if ($digits_left === 0) { - $value = number_format($value, $digits_right); - if (($originalValue != 0) && (floatval($value) == 0)) { - $value = ' <' . (1 / self::pow(10, $digits_right)); - } - return self::localizeNumber($value); - } - - // this units needs no translation, ISO - $units = array( - -8 => 'y', - -7 => 'z', - -6 => 'a', - -5 => 'f', - -4 => 'p', - -3 => 'n', - -2 => 'µ', - -1 => 'm', - 0 => ' ', - 1 => 'k', - 2 => 'M', - 3 => 'G', - 4 => 'T', - 5 => 'P', - 6 => 'E', - 7 => 'Z', - 8 => 'Y' - ); - - // check for negative value to retain sign - if ($value < 0) { - $sign = '-'; - $value = abs($value); - } else { - $sign = ''; - } - - $dh = self::pow(10, $digits_right); - - /* - * This gives us the right SI prefix already, - * but $digits_left parameter not incorporated - */ - $d = floor(log10($value) / 3); - /* - * Lowering the SI prefix by 1 gives us an additional 3 zeros - * So if we have 3,6,9,12.. free digits ($digits_left - $cur_digits) - * to use, then lower the SI prefix - */ - $cur_digits = floor(log10($value / self::pow(1000, $d, 'pow'))+1); - if ($digits_left > $cur_digits) { - $d -= floor(($digits_left - $cur_digits)/3); - } - - if ($d < 0 && $only_down) { - $d = 0; - } - - $value = round($value / (self::pow(1000, $d, 'pow') / $dh)) /$dh; - $unit = $units[$d]; - - // number_format is not multibyte safe, str_replace is safe - $formattedValue = number_format($value, $digits_right); - // If we don't want any zeros, remove them now - if ($noTrailingZero && strpos($formattedValue, '.') !== false) { - $formattedValue = preg_replace('/\.?0+$/', '', $formattedValue); - } - $localizedValue = self::localizeNumber($formattedValue); - - if ($originalValue != 0 && floatval($value) == 0) { - return ' <' . self::localizeNumber((1 / self::pow(10, $digits_right))) - . ' ' . $unit; - } - - return $sign . $localizedValue . ' ' . $unit; - } // end of the 'formatNumber' function - - /** - * Returns the number of bytes when a formatted size is given - * - * @param string $formatted_size the size expression (for example 8MB) - * - * @return integer The numerical part of the expression (for example 8) - */ - public static function extractValueFromFormattedSize($formatted_size) - { - $return_value = -1; - - if (preg_match('/^[0-9]+GB$/', $formatted_size)) { - $return_value = mb_substr($formatted_size, 0, -2) - * self::pow(1024, 3); - } elseif (preg_match('/^[0-9]+MB$/', $formatted_size)) { - $return_value = mb_substr($formatted_size, 0, -2) - * self::pow(1024, 2); - } elseif (preg_match('/^[0-9]+K$/', $formatted_size)) { - $return_value = mb_substr($formatted_size, 0, -1) - * self::pow(1024, 1); - } - return $return_value; - }// end of the 'extractValueFromFormattedSize' function - - /** - * Writes localised date - * - * @param integer $timestamp the current timestamp - * @param string $format format - * - * @return string the formatted date - * - * @access public - */ - public static function localisedDate($timestamp = -1, $format = '') - { - $month = array( - /* l10n: Short month name */ - __('Jan'), - /* l10n: Short month name */ - __('Feb'), - /* l10n: Short month name */ - __('Mar'), - /* l10n: Short month name */ - __('Apr'), - /* l10n: Short month name */ - _pgettext('Short month name', 'May'), - /* l10n: Short month name */ - __('Jun'), - /* l10n: Short month name */ - __('Jul'), - /* l10n: Short month name */ - __('Aug'), - /* l10n: Short month name */ - __('Sep'), - /* l10n: Short month name */ - __('Oct'), - /* l10n: Short month name */ - __('Nov'), - /* l10n: Short month name */ - __('Dec')); - $day_of_week = array( - /* l10n: Short week day name */ - _pgettext('Short week day name', 'Sun'), - /* l10n: Short week day name */ - __('Mon'), - /* l10n: Short week day name */ - __('Tue'), - /* l10n: Short week day name */ - __('Wed'), - /* l10n: Short week day name */ - __('Thu'), - /* l10n: Short week day name */ - __('Fri'), - /* l10n: Short week day name */ - __('Sat')); - - if ($format == '') { - /* l10n: See http://www.php.net/manual/en/function.strftime.php */ - $format = __('%B %d, %Y at %I:%M %p'); - } - - if ($timestamp == -1) { - $timestamp = time(); - } - - $date = preg_replace( - '@%[aA]@', - $day_of_week[(int)strftime('%w', $timestamp)], - $format - ); - $date = preg_replace( - '@%[bB]@', - $month[(int)strftime('%m', $timestamp)-1], - $date - ); - - $ret = strftime($date, $timestamp); - // Some OSes such as Win8.1 Traditional Chinese version did not produce UTF-8 - // output here. See https://sourceforge.net/p/phpmyadmin/bugs/4207/ - if (mb_detect_encoding($ret, 'UTF-8', true) != 'UTF-8') { - $ret = date('Y-m-d H:i:s', $timestamp); - } - - return $ret; - } // end of the 'localisedDate()' function - - /** - * returns a tab for tabbed navigation. - * If the variables $link and $args ar left empty, an inactive tab is created - * - * @param array $tab array with all options - * @param array $url_params tab specific URL parameters - * - * @return string html code for one tab, a link if valid otherwise a span - * - * @access public - */ - public static function getHtmlTab($tab, $url_params = array()) - { - // default values - $defaults = array( - 'text' => '', - 'class' => '', - 'active' => null, - 'link' => '', - 'sep' => '?', - 'attr' => '', - 'args' => '', - 'warning' => '', - 'fragment' => '', - 'id' => '', - ); - - $tab = array_merge($defaults, $tab); - - // determine additional style-class - if (empty($tab['class'])) { - if (! empty($tab['active']) - || PMA_isValid($GLOBALS['active_page'], 'identical', $tab['link']) - ) { - $tab['class'] = 'active'; - } elseif (is_null($tab['active']) && empty($GLOBALS['active_page']) - && (basename($GLOBALS['PMA_PHP_SELF']) == $tab['link']) - ) { - $tab['class'] = 'active'; - } - } - - // If there are any tab specific URL parameters, merge those with - // the general URL parameters - if (! empty($tab['url_params']) && is_array($tab['url_params'])) { - $url_params = array_merge($url_params, $tab['url_params']); - } - - // build the link - if (! empty($tab['link'])) { - $tab['link'] = htmlentities($tab['link']); - $tab['link'] = $tab['link'] . PMA_URL_getCommon($url_params); - if (! empty($tab['args'])) { - foreach ($tab['args'] as $param => $value) { - $tab['link'] .= PMA_URL_getArgSeparator('html') - . urlencode($param) . '=' . urlencode($value); - } - } - } - - if (! empty($tab['fragment'])) { - $tab['link'] .= $tab['fragment']; - } - - // display icon - if (isset($tab['icon'])) { - // avoid generating an alt tag, because it only illustrates - // the text that follows and if browser does not display - // images, the text is duplicated - $tab['text'] = self::getIcon( - $tab['icon'], - $tab['text'], - false, - true, - 'TabsMode' - ); - - } elseif (empty($tab['text'])) { - // check to not display an empty link-text - $tab['text'] = '?'; - trigger_error( - 'empty linktext in function ' . __FUNCTION__ . '()', - E_USER_NOTICE - ); - } - - //Set the id for the tab, if set in the params - $tabId = (empty($tab['id']) ? null : $tab['id']); - - $item = array(); - if (!empty($tab['link'])) { - $item = array( - 'content' => $tab['text'], - 'url' => array( - 'href' => empty($tab['link']) ? null : $tab['link'], - 'id' => $tabId, - 'class' => 'tab' . htmlentities($tab['class']), - ), - ); - } else { - $item['content'] = '' . $tab['text'] . ''; - } - - $item['class'] = $tab['class'] == 'active' ? 'active' : ''; - - return Template::get('list/item') - ->render($item); - } // end of the 'getHtmlTab()' function - - /** - * returns html-code for a tab navigation - * - * @param array $tabs one element per tab - * @param array $url_params additional URL parameters - * @param string $menu_id HTML id attribute for the menu container - * @param bool $resizable whether to add a "resizable" class - * - * @return string html-code for tab-navigation - */ - public static function getHtmlTabs( - $tabs, - $url_params, - $menu_id, - $resizable = false - ) { - $class = ''; - if ($resizable) { - $class = ' class="resizable-menu"'; - } - - $tab_navigation = '' . "\n"; - - return $tab_navigation; - } - - /** - * Displays a link, or a button if the link's URL is too large, to - * accommodate some browsers' limitations - * - * @param string $url the URL - * @param string $message the link message - * @param mixed $tag_params string: js confirmation - * array: additional tag params (f.e. style="") - * @param boolean $new_form we set this to false when we are already in - * a form, to avoid generating nested forms - * @param boolean $strip_img whether to strip the image - * @param string $target target - * @param boolean $force_button use a button even when the URL is not too long - * - * @return string the results to be echoed or saved in an array - */ - public static function linkOrButton( - $url, $message, $tag_params = array(), - $new_form = true, $strip_img = false, $target = '', $force_button = false - ) { - $url_length = mb_strlen($url); - // with this we should be able to catch case of image upload - // into a (MEDIUM) BLOB; not worth generating even a form for these - if ($url_length > $GLOBALS['cfg']['LinkLengthLimit'] * 100) { - return ''; - } - - if (! is_array($tag_params)) { - $tmp = $tag_params; - $tag_params = array(); - if (! empty($tmp)) { - $tag_params['onclick'] = 'return confirmLink(this, \'' - . PMA_escapeJsString($tmp) . '\')'; - } - unset($tmp); - } - if (! empty($target)) { - $tag_params['target'] = htmlentities($target); - if ($target === '_blank' && strncmp($url, 'url.php?', 8) == 0) { - $tag_params['rel'] = 'noopener noreferrer'; - } - } - - $displayed_message = ''; - // Add text if not already added - if (stristr($message, ''; - } - - // Suhosin: Check that each query parameter is not above maximum - $in_suhosin_limits = true; - if ($url_length <= $GLOBALS['cfg']['LinkLengthLimit']) { - $suhosin_get_MaxValueLength = ini_get('suhosin.get.max_value_length'); - if ($suhosin_get_MaxValueLength) { - $query_parts = self::splitURLQuery($url); - foreach ($query_parts as $query_pair) { - if (strpos($query_pair, '=') === false) { - continue; - } - - list(, $eachval) = explode('=', $query_pair); - if (mb_strlen($eachval) > $suhosin_get_MaxValueLength - ) { - $in_suhosin_limits = false; - break; - } - } - } - } - - if (($url_length <= $GLOBALS['cfg']['LinkLengthLimit']) - && $in_suhosin_limits - && ! $force_button - ) { - $tag_params_strings = array(); - foreach ($tag_params as $par_name => $par_value) { - // htmlspecialchars() only on non javascript - $par_value = mb_substr($par_name, 0, 2) == 'on' - ? $par_value - : htmlspecialchars($par_value); - $tag_params_strings[] = $par_name . '="' . $par_value . '"'; - } - - // no whitespace within an else Safari will make it part of the link - $ret = "\n" . '' - . $message . $displayed_message . '' . "\n"; - } else { - // no spaces (line breaks) at all - // or after the hidden fields - // IE will display them all - - if (! isset($query_parts)) { - $query_parts = self::splitURLQuery($url); - } - $url_parts = parse_url($url); - - if ($new_form) { - if ($target) { - $target = ' target="' . $target . '"'; - } - $ret = ''; - } - } // end if... else... - - return $ret; - } // end of the 'linkOrButton()' function - - /** - * Splits a URL string by parameter - * - * @param string $url the URL - * - * @return array the parameter/value pairs, for example [0] db=sakila - */ - public static function splitURLQuery($url) - { - // decode encoded url separators - $separator = PMA_URL_getArgSeparator(); - // on most places separator is still hard coded ... - if ($separator !== '&') { - // ... so always replace & with $separator - $url = str_replace(htmlentities('&'), $separator, $url); - $url = str_replace('&', $separator, $url); - } - - $url = str_replace(htmlentities($separator), $separator, $url); - // end decode - - $url_parts = parse_url($url); - - if (! empty($url_parts['query'])) { - return explode($separator, $url_parts['query']); - } else { - return array(); - } - } - - /** - * Returns a given timespan value in a readable format. - * - * @param int $seconds the timespan - * - * @return string the formatted value - */ - public static function timespanFormat($seconds) - { - $days = floor($seconds / 86400); - if ($days > 0) { - $seconds -= $days * 86400; - } - - $hours = floor($seconds / 3600); - if ($days > 0 || $hours > 0) { - $seconds -= $hours * 3600; - } - - $minutes = floor($seconds / 60); - if ($days > 0 || $hours > 0 || $minutes > 0) { - $seconds -= $minutes * 60; - } - - return sprintf( - __('%s days, %s hours, %s minutes and %s seconds'), - (string)$days, - (string)$hours, - (string)$minutes, - (string)$seconds - ); - } - - /** - * Takes a string and outputs each character on a line for itself. Used - * mainly for horizontalflipped display mode. - * Takes care of special html-characters. - * Fulfills https://sourceforge.net/p/phpmyadmin/feature-requests/164/ - * - * @param string $string The string - * @param string $Separator The Separator (defaults to "
    \n") - * - * @access public - * @todo add a multibyte safe function $GLOBALS['String']->split() - * - * @return string The flipped string - */ - public static function flipstring($string, $Separator = "
    \n") - { - $format_string = ''; - $charbuff = false; - - for ($i = 0, $str_len = mb_strlen($string); - $i < $str_len; - $i++ - ) { - $char = $string{$i}; - $append = false; - - if ($char == '&') { - $format_string .= $charbuff; - $charbuff = $char; - } elseif ($char == ';' && ! empty($charbuff)) { - $format_string .= $charbuff . $char; - $charbuff = false; - $append = true; - } elseif (! empty($charbuff)) { - $charbuff .= $char; - } else { - $format_string .= $char; - $append = true; - } - - // do not add separator after the last character - if ($append && ($i != $str_len - 1)) { - $format_string .= $Separator; - } - } - - return $format_string; - } - - /** - * Function added to avoid path disclosures. - * Called by each script that needs parameters, it displays - * an error message and, by default, stops the execution. - * - * Not sure we could use a strMissingParameter message here, - * would have to check if the error message file is always available - * - * @param string[] $params The names of the parameters needed by the calling - * script - * @param bool $request Whether to include this list in checking for - * special params - * - * @return void - * - * @global boolean $checked_special flag whether any special variable - * was required - * - * @access public - */ - public static function checkParameters($params, $request = true) - { - global $checked_special; - - if (! isset($checked_special)) { - $checked_special = false; - } - - $reported_script_name = basename($GLOBALS['PMA_PHP_SELF']); - $found_error = false; - $error_message = ''; - - foreach ($params as $param) { - if ($request && ($param != 'db') && ($param != 'table')) { - $checked_special = true; - } - - if (! isset($GLOBALS[$param])) { - $error_message .= $reported_script_name - . ': ' . __('Missing parameter:') . ' ' - . $param - . self::showDocu('faq', 'faqmissingparameters',true) - . '[br]'; - $found_error = true; - } - } - if ($found_error) { - PMA_fatalError($error_message, null, false); - } - } // end function - - /** - * Function to generate unique condition for specified row. - * - * @param resource $handle current query result - * @param integer $fields_cnt number of fields - * @param array $fields_meta meta information about fields - * @param array $row current row - * @param boolean $force_unique generate condition only on pk - * or unique - * @param string|boolean $restrict_to_table restrict the unique condition - * to this table or false if - * none - * @param array $analyzed_sql_results the analyzed query - * - * @access public - * - * @return array the calculated condition and whether condition is unique - */ - public static function getUniqueCondition( - $handle, $fields_cnt, $fields_meta, $row, $force_unique = false, - $restrict_to_table = false, $analyzed_sql_results = null - ) { - $primary_key = ''; - $unique_key = ''; - $nonprimary_condition = ''; - $preferred_condition = ''; - $primary_key_array = array(); - $unique_key_array = array(); - $nonprimary_condition_array = array(); - $condition_array = array(); - - for ($i = 0; $i < $fields_cnt; ++$i) { - - $con_val = ''; - $field_flags = $GLOBALS['dbi']->fieldFlags($handle, $i); - $meta = $fields_meta[$i]; - - // do not use a column alias in a condition - if (! isset($meta->orgname) || ! mb_strlen($meta->orgname)) { - $meta->orgname = $meta->name; - - if (!empty($analyzed_sql_results['statement']->expr)) { - foreach ($analyzed_sql_results['statement']->expr as $expr) { - if ((empty($expr->alias)) || (empty($expr->column))) { - continue; - } - if (strcasecmp($meta->name, $expr->alias) == 0) { - $meta->orgname = $expr->column; - break; - } - } - } - } - - // Do not use a table alias in a condition. - // Test case is: - // select * from galerie x WHERE - //(select count(*) from galerie y where y.datum=x.datum)>1 - // - // But orgtable is present only with mysqli extension so the - // fix is only for mysqli. - // Also, do not use the original table name if we are dealing with - // a view because this view might be updatable. - // (The isView() verification should not be costly in most cases - // because there is some caching in the function). - if (isset($meta->orgtable) - && ($meta->table != $meta->orgtable) - && ! $GLOBALS['dbi']->getTable($GLOBALS['db'], $meta->table)->isView() - ) { - $meta->table = $meta->orgtable; - } - - // If this field is not from the table which the unique clause needs - // to be restricted to. - if ($restrict_to_table && $restrict_to_table != $meta->table) { - continue; - } - - // to fix the bug where float fields (primary or not) - // can't be matched because of the imprecision of - // floating comparison, use CONCAT - // (also, the syntax "CONCAT(field) IS NULL" - // that we need on the next "if" will work) - if ($meta->type == 'real') { - $con_key = 'CONCAT(' . self::backquote($meta->table) . '.' - . self::backquote($meta->orgname) . ')'; - } else { - $con_key = self::backquote($meta->table) . '.' - . self::backquote($meta->orgname); - } // end if... else... - $condition = ' ' . $con_key . ' '; - - if (! isset($row[$i]) || is_null($row[$i])) { - $con_val = 'IS NULL'; - } else { - // timestamp is numeric on some MySQL 4.1 - // for real we use CONCAT above and it should compare to string - if ($meta->numeric - && ($meta->type != 'timestamp') - && ($meta->type != 'real') - ) { - $con_val = '= ' . $row[$i]; - } elseif ((($meta->type == 'blob') || ($meta->type == 'string')) - && stristr($field_flags, 'BINARY') - && ! empty($row[$i]) - ) { - // hexify only if this is a true not empty BLOB or a BINARY - - // do not waste memory building a too big condition - if (mb_strlen($row[$i]) < 1000) { - // use a CAST if possible, to avoid problems - // if the field contains wildcard characters % or _ - $con_val = '= CAST(0x' . bin2hex($row[$i]) . ' AS BINARY)'; - } elseif ($fields_cnt == 1) { - // when this blob is the only field present - // try settling with length comparison - $condition = ' CHAR_LENGTH(' . $con_key . ') '; - $con_val = ' = ' . mb_strlen($row[$i]); - } else { - // this blob won't be part of the final condition - $con_val = null; - } - } elseif (in_array($meta->type, self::getGISDatatypes()) - && ! empty($row[$i]) - ) { - // do not build a too big condition - if (mb_strlen($row[$i]) < 5000) { - $condition .= '=0x' . bin2hex($row[$i]) . ' AND'; - } else { - $condition = ''; - } - } elseif ($meta->type == 'bit') { - $con_val = "= b'" - . self::printableBitValue($row[$i], $meta->length) . "'"; - } else { - $con_val = '= \'' - . $GLOBALS['dbi']->escapeString($row[$i]) . '\''; - } - } - - if ($con_val != null) { - - $condition .= $con_val . ' AND'; - - if ($meta->primary_key > 0) { - $primary_key .= $condition; - $primary_key_array[$con_key] = $con_val; - } elseif ($meta->unique_key > 0) { - $unique_key .= $condition; - $unique_key_array[$con_key] = $con_val; - } - - $nonprimary_condition .= $condition; - $nonprimary_condition_array[$con_key] = $con_val; - } - } // end for - - // Correction University of Virginia 19991216: - // prefer primary or unique keys for condition, - // but use conjunction of all values if no primary key - $clause_is_unique = true; - - if ($primary_key) { - $preferred_condition = $primary_key; - $condition_array = $primary_key_array; - - } elseif ($unique_key) { - $preferred_condition = $unique_key; - $condition_array = $unique_key_array; - - } elseif (! $force_unique) { - $preferred_condition = $nonprimary_condition; - $condition_array = $nonprimary_condition_array; - $clause_is_unique = false; - } - - $where_clause = trim(preg_replace('|\s?AND$|', '', $preferred_condition)); - return(array($where_clause, $clause_is_unique, $condition_array)); - } // end function - - /** - * Generate a button or image tag - * - * @param string $button_name name of button element - * @param string $button_class class of button or image element - * @param string $image_name name of image element - * @param string $text text to display - * @param string $image image to display - * @param string $value value - * - * @return string html content - * - * @access public - */ - public static function getButtonOrImage( - $button_name, $button_class, $image_name, $text, $image, $value = '' - ) { - if ($value == '') { - $value = $text; - } - - if ($GLOBALS['cfg']['ActionLinksMode'] == 'text') { - return ' ' . "\n"; - } - - /* Opera has trouble with */ - /* IE (before version 9) has trouble with ' . "\n"; - } - } // end function - - /** - * Generate a pagination selector for browsing resultsets - * - * @param string $name The name for the request parameter - * @param int $rows Number of rows in the pagination set - * @param int $pageNow current page number - * @param int $nbTotalPage number of total pages - * @param int $showAll If the number of pages is lower than this - * variable, no pages will be omitted in pagination - * @param int $sliceStart How many rows at the beginning should always - * be shown? - * @param int $sliceEnd How many rows at the end should always be shown? - * @param int $percent Percentage of calculation page offsets to hop to a - * next page - * @param int $range Near the current page, how many pages should - * be considered "nearby" and displayed as well? - * @param string $prompt The prompt to display (sometimes empty) - * - * @return string - * - * @access public - */ - public static function pageselector( - $name, $rows, $pageNow = 1, $nbTotalPage = 1, $showAll = 200, - $sliceStart = 5, - $sliceEnd = 5, $percent = 20, $range = 10, $prompt = '' - ) { - $increment = floor($nbTotalPage / $percent); - $pageNowMinusRange = ($pageNow - $range); - $pageNowPlusRange = ($pageNow + $range); - - $gotopage = $prompt . ' '; - - return $gotopage; - } // end function - - /** - * Prepare navigation for a list - * - * @param int $count number of elements in the list - * @param int $pos current position in the list - * @param array $_url_params url parameters - * @param string $script script name for form target - * @param string $frame target frame - * @param int $max_count maximum number of elements to display from - * the list - * @param string $name the name for the request parameter - * @param string[] $classes additional classes for the container - * - * @return string $list_navigator_html the html content - * - * @access public - * - * @todo use $pos from $_url_params - */ - public static function getListNavigator( - $count, $pos, $_url_params, $script, $frame, $max_count, $name = 'pos', - $classes = array() - ) { - - $class = $frame == 'frame_navigation' ? ' class="ajax"' : ''; - - $list_navigator_html = ''; - - if ($max_count < $count) { - - $classes[] = 'pageselector'; - $list_navigator_html .= '
    '; - - if ($frame != 'frame_navigation') { - $list_navigator_html .= __('Page number:'); - } - - // Move to the beginning or to the previous page - if ($pos > 0) { - $caption1 = ''; $caption2 = ''; - if (self::showIcons('TableNavigationLinksMode')) { - $caption1 .= '<< '; - $caption2 .= '< '; - } - if (self::showText('TableNavigationLinksMode')) { - $caption1 .= _pgettext('First page', 'Begin'); - $caption2 .= _pgettext('Previous page', 'Previous'); - } - $title1 = ' title="' . _pgettext('First page', 'Begin') . '"'; - $title2 = ' title="' . _pgettext('Previous page', 'Previous') . '"'; - - $_url_params[$name] = 0; - $list_navigator_html .= '' . $caption1 - . ''; - - $_url_params[$name] = $pos - $max_count; - $list_navigator_html .= ' ' - . $caption2 . ''; - } - - $list_navigator_html .= '
    '; - - $list_navigator_html .= PMA_URL_getHiddenInputs($_url_params); - $list_navigator_html .= self::pageselector( - $name, - $max_count, - floor(($pos + 1) / $max_count) + 1, - ceil($count / $max_count) - ); - $list_navigator_html .= '
    '; - - if ($pos + $max_count < $count) { - $caption3 = ''; $caption4 = ''; - if (self::showText('TableNavigationLinksMode')) { - $caption3 .= _pgettext('Next page', 'Next'); - $caption4 .= _pgettext('Last page', 'End'); - } - if (self::showIcons('TableNavigationLinksMode')) { - $caption3 .= ' >'; - $caption4 .= ' >>'; - if (! self::showText('TableNavigationLinksMode')) { - - } - } - $title3 = ' title="' . _pgettext('Next page', 'Next') . '"'; - $title4 = ' title="' . _pgettext('Last page', 'End') . '"'; - - $_url_params[$name] = $pos + $max_count; - $list_navigator_html .= '' . $caption3 - . ''; - - $_url_params[$name] = floor($count / $max_count) * $max_count; - if ($_url_params[$name] == $count) { - $_url_params[$name] = $count - $max_count; - } - - $list_navigator_html .= ' ' - . $caption4 . ''; - } - $list_navigator_html .= '
    ' . "\n"; - } - - return $list_navigator_html; - } - - /** - * replaces %u in given path with current user name - * - * example: - * - * $user_dir = userDir('/var/pma_tmp/%u/'); // '/var/pma_tmp/root/' - * - * - * - * @param string $dir with wildcard for user - * - * @return string per user directory - */ - public static function userDir($dir) - { - // add trailing slash - if (mb_substr($dir, -1) != '/') { - $dir .= '/'; - } - - return str_replace('%u', PMA_securePath($GLOBALS['cfg']['Server']['user']), $dir); - } - - /** - * returns html code for db link to default db page - * - * @param string $database database - * - * @return string html link to default db page - */ - public static function getDbLink($database = null) - { - if (! mb_strlen($database)) { - if (! mb_strlen($GLOBALS['db'])) { - return ''; - } - $database = $GLOBALS['db']; - } else { - $database = self::unescapeMysqlWildcards($database); - } - - return '' . htmlspecialchars($database) . ''; - } - - /** - * Prepare a lightbulb hint explaining a known external bug - * that affects a functionality - * - * @param string $functionality localized message explaining the func. - * @param string $component 'mysql' (eventually, 'php') - * @param string $minimum_version of this component - * @param string $bugref bug reference for this component - * - * @return String - */ - public static function getExternalBug( - $functionality, $component, $minimum_version, $bugref - ) { - $ext_but_html = ''; - if (($component == 'mysql') && (PMA_MYSQL_INT_VERSION < $minimum_version)) { - $ext_but_html .= self::showHint( - sprintf( - __('The %s functionality is affected by a known bug, see %s'), - $functionality, - PMA_linkURL('https://bugs.mysql.com/') . $bugref - ) - ); - } - return $ext_but_html; - } - - /** - * Returns a HTML checkbox - * - * @param string $html_field_name the checkbox HTML field - * @param string $label label for checkbox - * @param boolean $checked is it initially checked? - * @param boolean $onclick should it submit the form on click? - * @param string $html_field_id id for the checkbox - * - * @return string HTML for the checkbox - */ - public static function getCheckbox( - $html_field_name, $label, $checked, $onclick, $html_field_id = '' - ) { - return '' - . '' . $label . ''; - } - - /** - * Generates a set of radio HTML fields - * - * @param string $html_field_name the radio HTML field - * @param array $choices the choices values and labels - * @param string $checked_choice the choice to check by default - * @param boolean $line_break whether to add HTML line break after a choice - * @param boolean $escape_label whether to use htmlspecialchars() on label - * @param string $class enclose each choice with a div of this class - * @param string $id_prefix prefix for the id attribute, name will be - * used if this is not supplied - * - * @return string set of html radio fiels - */ - public static function getRadioFields( - $html_field_name, $choices, $checked_choice = '', - $line_break = true, $escape_label = true, $class = '', - $id_prefix = '' - ) { - $radio_html = ''; - - foreach ($choices as $choice_value => $choice_label) { - - if (! empty($class)) { - $radio_html .= '
    '; - } - - if (! $id_prefix) { - $id_prefix = $html_field_name; - } - $html_field_id = $id_prefix . '_' . $choice_value; - $radio_html .= '' - . ($escape_label - ? htmlspecialchars($choice_label) - : $choice_label) - . ''; - - if ($line_break) { - $radio_html .= '
    '; - } - - if (! empty($class)) { - $radio_html .= '
    '; - } - $radio_html .= "\n"; - } - - return $radio_html; - } - - /** - * Generates and returns an HTML dropdown - * - * @param string $select_name name for the select element - * @param array $choices choices values - * @param string $active_choice the choice to select by default - * @param string $id id of the select element; can be different in - * case the dropdown is present more than once - * on the page - * @param string $class class for the select element - * @param string $placeholder Placeholder for dropdown if nothing else - * is selected - * - * @return string html content - * - * @todo support titles - */ - public static function getDropdown( - $select_name, $choices, $active_choice, $id, $class = '', $placeholder = null - ) { - $result = ''; - - $resultOptions = ''; - $selected = false; - - foreach ($choices as $one_choice_value => $one_choice_label) { - $resultOptions .= '' - . $resultOptions; - } - - $result .= $resultOptions - . ''; - - return $result; - } - - /** - * Generates a slider effect (jQjuery) - * Takes care of generating the initial
    and the link - * controlling the slider; you have to generate the
    yourself - * after the sliding section. - * - * @param string $id the id of the
    on which to apply the effect - * @param string $message the message to show as a link - * - * @return string html div element - * - */ - public static function getDivForSliderEffect($id = '', $message = '') - { - if ($GLOBALS['cfg']['InitialSlidersState'] == 'disabled') { - return ''; - } - /** - * Bad hack on the next line. document.write() conflicts with jQuery, - * hence, opening the
    with PHP itself instead of JavaScript. - * - * @todo find a better solution that uses $.append(), the recommended - * method maybe by using an additional param, the id of the div to - * append to - */ - - return '
    '; - - return $multi_values; -} - -/** - * Prints Html For Export Hidden Input - * - * @param String $export_type Selected Export Type - * @param String $db Selected DB - * @param String $table Selected Table - * @param String $single_table Single Table - * @param String $sql_query Sql Query - * - * @return string - */ -function PMA_getHtmlForHiddenInput( - $export_type, $db, $table, $single_table, $sql_query -) { - global $cfg; - $html = ""; - if ($export_type == 'server') { - $html .= PMA_URL_getHiddenInputs('', '', 1); - } elseif ($export_type == 'database') { - $html .= PMA_URL_getHiddenInputs($db, '', 1); - } else { - $html .= PMA_URL_getHiddenInputs($db, $table, 1); - } - - // just to keep this value for possible next display of this form after saving - // on server - if (!empty($single_table)) { - $html .= '' - . "\n"; - } - - $html .= ''; - $html .= "\n"; - - // If the export method was not set, the default is quick - if (isset($_GET['export_method'])) { - $cfg['Export']['method'] = $_GET['export_method']; - } elseif (! isset($cfg['Export']['method'])) { - $cfg['Export']['method'] = 'quick'; - } - // The export method (quick, custom or custom-no-form) - $html .= ''; - - if (! empty($sql_query)) { - $html .= '' . "\n"; - } elseif (isset($_GET['sql_query'])) { - $html .= '' . "\n"; - } - - $html .= ''; - - return $html; -} - -/** - * Prints Html For Export Options Header - * - * @param String $export_type Selected Export Type - * @param String $db Selected DB - * @param String $table Selected Table - * - * @return string - */ -function PMA_getHtmlForExportOptionHeader($export_type, $db, $table) -{ - $html = ''; - - return $html; -} - -/** - * Returns HTML for export template operations - * - * @param string $export_type export type - server, database, or table - * - * @return string HTML for export template operations - */ -function PMA_getHtmlForExportTemplateLoading($export_type) -{ - $html = '
    '; - $html .= '

    ' . __('Export templates:') . '

    '; - - $html .= '
    '; - $html .= '
    '; - $html .= '

    ' . __('New template:') . '

    '; - $html .= ''; - $html .= ''; - $html .= '
    '; - $html .= '
    '; - - $html .= '
    '; - $html .= '
    '; - $html .= '

    ' . __('Existing templates:') . '

    '; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= '
    '; - $html .= '
    '; - - $html .= '
    '; - - $html .= '
    '; - - return $html; -} - -/** - * Returns HTML for the options in teplate dropdown - * - * @param string $export_type export type - server, database, or table - * - * @return string HTML for the options in teplate dropdown - */ -function PMA_getOptionsForExportTemplates($export_type) -{ - $ret = ''; - - // Get the relation settings - $cfgRelation = PMA_getRelationsParam(); - - $query = "SELECT `id`, `template_name` FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) . '.' - . PMA\libraries\Util::backquote($cfgRelation['export_templates']) - . " WHERE `username` = " - . "'" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) - . "' AND `export_type` = '" . $GLOBALS['dbi']->escapeString($export_type) . "'" - . " ORDER BY `template_name`;"; - - $result = PMA_queryAsControlUser($query); - if (!$result) { - return $ret; - } - - while ($row = $GLOBALS['dbi']->fetchAssoc($result, $GLOBALS['controllink'])) { - $ret .= '
    '; // pma_navigation_content - $retval .= $this->_getDropHandler(); - $retval .= '
  • '; // pma_navigation - } - - return $retval; - } - - /** - * Add an item of navigation tree to the hidden items list in PMA database. - * - * @param string $itemName name of the navigation tree item - * @param string $itemType type of the navigation tree item - * @param string $dbName database name - * @param string $tableName table name if applicable - * - * @return void - */ - public function hideNavigationItem( - $itemName, $itemType, $dbName, $tableName = null - ) { - $navTable = Util::backquote($GLOBALS['cfgRelation']['db']) - . "." . Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); - $sqlQuery = "INSERT INTO " . $navTable - . "(`username`, `item_name`, `item_type`, `db_name`, `table_name`)" - . " VALUES (" - . "'" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'," - . "'" . $GLOBALS['dbi']->escapeString($itemName) . "'," - . "'" . $GLOBALS['dbi']->escapeString($itemType) . "'," - . "'" . $GLOBALS['dbi']->escapeString($dbName) . "'," - . "'" . (! empty($tableName)? $GLOBALS['dbi']->escapeString($tableName) : "" ) - . "')"; - PMA_queryAsControlUser($sqlQuery, false); - } - - /** - * Inserts Drag and Drop Import handler - * - * @return string html code for drop handler - */ - private function _getDropHandler() - { - $retval = ''; - $retval .= '
    ' - . __('Drop files here') - . '
    '; - $retval .= '
    '; - $retval .= '

    SQL upload ( '; - $retval .= '0 '; - $retval .= ') x'; - $retval .= '-

    '; - $retval .= '
    '; - $retval .= '
    '; - return $retval; - } - - /** - * Remove a hidden item of navigation tree from the - * list of hidden items in PMA database. - * - * @param string $itemName name of the navigation tree item - * @param string $itemType type of the navigation tree item - * @param string $dbName database name - * @param string $tableName table name if applicable - * - * @return void - */ - public function unhideNavigationItem( - $itemName, $itemType, $dbName, $tableName = null - ) { - $navTable = Util::backquote($GLOBALS['cfgRelation']['db']) - . "." . Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); - $sqlQuery = "DELETE FROM " . $navTable - . " WHERE" - . " `username`='" - . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'" - . " AND `item_name`='" . $GLOBALS['dbi']->escapeString($itemName) . "'" - . " AND `item_type`='" . $GLOBALS['dbi']->escapeString($itemType) . "'" - . " AND `db_name`='" . $GLOBALS['dbi']->escapeString($dbName) . "'" - . (! empty($tableName) - ? " AND `table_name`='" . $GLOBALS['dbi']->escapeString($tableName) . "'" - : "" - ); - PMA_queryAsControlUser($sqlQuery, false); - } - - /** - * Returns HTML for the dialog to show hidden navigation items. - * - * @param string $dbName database name - * @param string $itemType type of the items to include - * @param string $tableName table name - * - * @return string HTML for the dialog to show hidden navigation items - */ - public function getItemUnhideDialog($dbName, $itemType = null, $tableName = null) - { - $html = '
    '; - $html .= '
    '; - $html .= PMA_URL_getHiddenInputs($dbName, $tableName); - - $navTable = Util::backquote($GLOBALS['cfgRelation']['db']) - . "." . Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); - $sqlQuery = "SELECT `item_name`, `item_type` FROM " . $navTable - . " WHERE `username`='" - . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'" - . " AND `db_name`='" . $GLOBALS['dbi']->escapeString($dbName) . "'" - . " AND `table_name`='" - . (! empty($tableName) ? $GLOBALS['dbi']->escapeString($tableName) : '') . "'"; - $result = PMA_queryAsControlUser($sqlQuery, false); - - $hidden = array(); - if ($result) { - while ($row = $GLOBALS['dbi']->fetchArray($result)) { - $type = $row['item_type']; - if (! isset($hidden[$type])) { - $hidden[$type] = array(); - } - $hidden[$type][] = $row['item_name']; - } - } - $GLOBALS['dbi']->freeResult($result); - - $typeMap = array( - 'group' => __('Groups:'), - 'event' => __('Events:'), - 'function' => __('Functions:'), - 'procedure' => __('Procedures:'), - 'table' => __('Tables:'), - 'view' => __('Views:'), - ); - if (empty($tableName)) { - $first = true; - foreach ($typeMap as $t => $lable) { - if ((empty($itemType) || $itemType == $t) - && isset($hidden[$t]) - ) { - $html .= (! $first ? '
    ' : '') - . '' . $lable . ''; - $html .= ''; - $odd = true; - foreach ($hidden[$t] as $hiddenItem) { - $html .= ''; - $html .= ''; - $html .= ''; - $odd = ! $odd; - } - $html .= '
    ' . htmlspecialchars($hiddenItem) . '' - . Util::getIcon('lightbulb.png', __('Show')) - . '
    '; - $first = false; - } - } - } - - $html .= '
    '; - $html .= '
    '; - return $html; - } -} diff --git a/#pma/libraries/navigation/NavigationHeader.php b/#pma/libraries/navigation/NavigationHeader.php deleted file mode 100644 index faa8b55d..00000000 --- a/#pma/libraries/navigation/NavigationHeader.php +++ /dev/null @@ -1,249 +0,0 @@ - true, - ) - ); - $class = ' class="list_container'; - if ($GLOBALS['cfg']['NavigationLinkWithMainPanel']) { - $class .= ' synced'; - } - if ($GLOBALS['cfg']['NavigationTreePointerEnable']) { - $class .= ' highlight'; - } - $class .= '"'; - $buffer = '
    '; - $buffer .= '
    '; - $buffer .= '
    '; - $buffer .= '
    '; - $buffer .= '
    '; - $buffer .= sprintf( - '', - $link_url - ); - $buffer .= $this->_logo(); - $buffer .= $this->_links(); - $buffer .= $this->_serverChoice(); - $buffer .= PMA\libraries\Util::getImage( - 'ajax_clock_small.gif', - __('Loading…'), - array( - 'style' => 'visibility: hidden; display:none', - 'class' => 'throbber', - ) - ); - $buffer .= '
    '; // pma_navigation_header - $buffer .= '
    '; - - return $buffer; - } - - /** - * Create the code for displaying the phpMyAdmin - * logo based on configuration settings - * - * @return string HTML code for the logo - */ - private function _logo() - { - // display Logo, depending on $GLOBALS['cfg']['NavigationDisplayLogo'] - if (!$GLOBALS['cfg']['NavigationDisplayLogo']) { - return Template::get('navigation/logo') - ->render(array('displayLogo' => false)); - } - - $logo = 'phpMyAdmin'; - if (@file_exists($GLOBALS['pmaThemeImage'] . 'logo_left.png')) { - $logo = ''; - } elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) { - $logo = ''; - } - - if (!$GLOBALS['cfg']['NavigationLogoLink']) { - return Template::get('navigation/logo') - ->render( - array( - 'displayLogo' => true, - 'useLogoLink' => false, - 'logo' => $logo, - ) - ); - } - - $useLogoLink = true; - $linkAttriks = null; - $logoLink = trim( - htmlspecialchars($GLOBALS['cfg']['NavigationLogoLink']) - ); - // prevent XSS, see PMASA-2013-9 - // if link has protocol, allow only http and https - if (! PMA_checkLink($logoLink, true)) { - $logoLink = 'index.php'; - } - switch ($GLOBALS['cfg']['NavigationLogoLinkWindow']) { - case 'new': - $linkAttriks = 'target="_blank" rel="noopener noreferrer"'; - break; - case 'main': - // do not add our parameters for an external link - $host = parse_url( - $GLOBALS['cfg']['NavigationLogoLink'], - PHP_URL_HOST - ); - if (empty($host)) { - $logoLink .= PMA_URL_getCommon(); - } else { - $linkAttriks = 'target="_blank" rel="noopener noreferrer"'; - } - } - - return Template::get('navigation/logo') - ->render( - array( - 'displayLogo' => true, - 'useLogoLink' => $useLogoLink, - 'logoLink' => $logoLink, - 'linkAttribs' => $linkAttriks, - 'logo' => $logo, - ) - ); - } - - /** - * Creates the code for displaying the links - * at the top of the navigation panel - * - * @return string HTML code for the links - */ - private function _links() - { - // always iconic - $showIcon = true; - $showText = false; - - $retval = ''; - $retval .= ''; - $retval .= ''; - - return $retval; - } - - /** - * Displays the MySQL servers choice form - * - * @return string HTML code for the MySQL servers choice - */ - private function _serverChoice() - { - $retval = ''; - if ($GLOBALS['cfg']['NavigationDisplayServers'] - && count($GLOBALS['cfg']['Servers']) > 1 - ) { - include_once './libraries/select_server.lib.php'; - $retval .= ''; - $retval .= '
    '; - $retval .= PMA_selectServer(true, true); - $retval .= '
    '; - $retval .= ''; - } - - return $retval; - } -} diff --git a/#pma/libraries/navigation/NavigationTree.php b/#pma/libraries/navigation/NavigationTree.php deleted file mode 100644 index 2b7ca44a..00000000 --- a/#pma/libraries/navigation/NavigationTree.php +++ /dev/null @@ -1,1560 +0,0 @@ -_pos = (int)$_REQUEST['pos']; - } - if (!isset($this->_pos)) { - $this->_pos = $this->_getNavigationDbPos(); - } - // Get the active node - if (isset($_REQUEST['aPath'])) { - $this->_aPath[0] = $this->_parsePath($_REQUEST['aPath']); - $this->_pos2_name[0] = $_REQUEST['pos2_name']; - $this->_pos2_value[0] = $_REQUEST['pos2_value']; - if (isset($_REQUEST['pos3_name'])) { - $this->_pos3_name[0] = $_REQUEST['pos3_name']; - $this->_pos3_value[0] = $_REQUEST['pos3_value']; - } - } else { - if (isset($_REQUEST['n0_aPath'])) { - $count = 0; - while (isset($_REQUEST['n' . $count . '_aPath'])) { - $this->_aPath[$count] = $this->_parsePath( - $_REQUEST['n' . $count . '_aPath'] - ); - $index = 'n' . $count . '_pos2_'; - $this->_pos2_name[$count] = $_REQUEST[$index . 'name']; - $this->_pos2_value[$count] = $_REQUEST[$index . 'value']; - $index = 'n' . $count . '_pos3_'; - if (isset($_REQUEST[$index])) { - $this->_pos3_name[$count] = $_REQUEST[$index . 'name']; - $this->_pos3_value[$count] = $_REQUEST[$index . 'value']; - } - $count++; - } - } - } - if (isset($_REQUEST['vPath'])) { - $this->_vPath[0] = $this->_parsePath($_REQUEST['vPath']); - } else { - if (isset($_REQUEST['n0_vPath'])) { - $count = 0; - while (isset($_REQUEST['n' . $count . '_vPath'])) { - $this->_vPath[$count] = $this->_parsePath( - $_REQUEST['n' . $count . '_vPath'] - ); - $count++; - } - } - } - if (isset($_REQUEST['searchClause'])) { - $this->_searchClause = $_REQUEST['searchClause']; - } - if (isset($_REQUEST['searchClause2'])) { - $this->_searchClause2 = $_REQUEST['searchClause2']; - } - // Initialise the tree by creating a root node - $node = NodeFactory::getInstance('NodeDatabaseContainer', 'root'); - $this->_tree = $node; - if ($GLOBALS['cfg']['NavigationTreeEnableGrouping'] - && $GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] - ) { - $this->_tree->separator = $GLOBALS['cfg']['NavigationTreeDbSeparator']; - $this->_tree->separator_depth = 10000; - } - } - - /** - * Returns the database position for the page selector - * - * @return int - */ - private function _getNavigationDbPos() - { - $retval = 0; - - if (empty($GLOBALS['db'])) { - return $retval; - } - - /* - * @todo describe a scenario where this code is executed - */ - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $query = "SELECT (COUNT(DB_first_level) DIV %d) * %d "; - $query .= "from ( "; - $query .= " SELECT distinct SUBSTRING_INDEX(SCHEMA_NAME, "; - $query .= " '" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['NavigationTreeDbSeparator']) . "', 1) "; - $query .= " DB_first_level "; - $query .= " FROM INFORMATION_SCHEMA.SCHEMATA "; - $query .= " WHERE `SCHEMA_NAME` < '%s' "; - $query .= ") t "; - - $retval = $GLOBALS['dbi']->fetchValue( - sprintf( - $query, - (int)$GLOBALS['cfg']['FirstLevelNavigationItems'], - (int)$GLOBALS['cfg']['FirstLevelNavigationItems'], - $GLOBALS['dbi']->escapeString($GLOBALS['db']) - ) - ); - - return $retval; - } - - $prefixMap = array(); - if ($GLOBALS['dbs_to_test'] === false) { - $handle = $GLOBALS['dbi']->tryQuery("SHOW DATABASES"); - if ($handle !== false) { - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if (strcasecmp($arr[0], $GLOBALS['db']) >= 0) { - break; - } - - $prefix = strstr( - $arr[0], - $GLOBALS['cfg']['NavigationTreeDbSeparator'], - true - ); - if ($prefix === false) { - $prefix = $arr[0]; - } - $prefixMap[$prefix] = 1; - } - } - } else { - $databases = array(); - foreach ($GLOBALS['dbs_to_test'] as $db) { - $query = "SHOW DATABASES LIKE '" . $db . "'"; - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle === false) { - continue; - } - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - $databases[] = $arr[0]; - } - } - sort($databases); - foreach ($databases as $database) { - if (strcasecmp($database, $GLOBALS['db']) >= 0) { - break; - } - - $prefix = strstr( - $database, - $GLOBALS['cfg']['NavigationTreeDbSeparator'], - true - ); - if ($prefix === false) { - $prefix = $database; - } - $prefixMap[$prefix] = 1; - } - } - - $navItems = (int)$GLOBALS['cfg']['FirstLevelNavigationItems']; - $retval = floor((count($prefixMap) / $navItems)) * $navItems; - - return $retval; - } - - /** - * Converts an encoded path to a node in string format to an array - * - * @param string $string The path to parse - * - * @return array - */ - private function _parsePath($string) - { - $path = explode('.', $string); - foreach ($path as $key => $value) { - $path[$key] = base64_decode($value); - } - - return $path; - } - - /** - * Generates the tree structure so that it can be rendered later - * - * @return Node|false The active node or false in case of failure - */ - private function _buildPath() - { - $retval = $this->_tree; - - // Add all databases unconditionally - $data = $this->_tree->getData( - 'databases', - $this->_pos, - $this->_searchClause - ); - $hiddenCounts = $this->_tree->getNavigationHidingData(); - foreach ($data as $db) { - $node = NodeFactory::getInstance('NodeDatabase', $db); - if (isset($hiddenCounts[$db])) { - $node->setHiddenCount($hiddenCounts[$db]); - } - $this->_tree->addChild($node); - } - - // Whether build other parts of the tree depends - // on whether we have any paths in $this->_aPath - foreach ($this->_aPath as $key => $path) { - $retval = $this->_buildPathPart( - $path, - $this->_pos2_name[$key], - $this->_pos2_value[$key], - isset($this->_pos3_name[$key]) ? $this->_pos3_name[$key] : '', - isset($this->_pos3_value[$key]) ? $this->_pos3_value[$key] : '' - ); - } - - return $retval; - } - - /** - * Builds a branch of the tree - * - * @param array $path A paths pointing to the branch - * of the tree that needs to be built - * @param string $type2 The type of item being paginated on - * the second level of the tree - * @param int $pos2 The position for the pagination of - * the branch at the second level of the tree - * @param string $type3 The type of item being paginated on - * the third level of the tree - * @param int $pos3 The position for the pagination of - * the branch at the third level of the tree - * - * @return Node|false The active node or false in case of failure - */ - private function _buildPathPart($path, $type2, $pos2, $type3, $pos3) - { - if (empty($pos2)) { - $pos2 = 0; - } - if (empty($pos3)) { - $pos3 = 0; - } - - $retval = true; - if (count($path) <= 1) { - return $retval; - } - - array_shift($path); // remove 'root' - /* @var $db NodeDatabase */ - $db = $this->_tree->getChild($path[0]); - $retval = $db; - - if ($db === false) { - return false; - } - - $containers = $this->_addDbContainers($db, $type2, $pos2); - - array_shift($path); // remove db - - if ((count($path) <= 0 || !array_key_exists($path[0], $containers)) - && count($containers) != 1 - ) { - return $retval; - } - - if (count($containers) == 1) { - $container = array_shift($containers); - } else { - $container = $db->getChild($path[0], true); - if ($container === false) { - return false; - } - } - $retval = $container; - - if (count($container->children) <= 1) { - $dbData = $db->getData( - $container->real_name, - $pos2, - $this->_searchClause2 - ); - foreach ($dbData as $item) { - switch ($container->real_name) { - case 'events': - $node = NodeFactory::getInstance( - 'NodeEvent', - $item - ); - break; - case 'functions': - $node = NodeFactory::getInstance( - 'NodeFunction', - $item - ); - break; - case 'procedures': - $node = NodeFactory::getInstance( - 'NodeProcedure', - $item - ); - break; - case 'tables': - $node = NodeFactory::getInstance( - 'NodeTable', - $item - ); - break; - case 'views': - $node = NodeFactory::getInstance( - 'NodeView', - $item - ); - break; - default: - break; - } - if (isset($node)) { - if ($type2 == $container->real_name) { - $node->pos2 = $pos2; - } - $container->addChild($node); - } - } - } - if (count($path) > 1 && $path[0] != 'tables') { - $retval = false; - - return $retval; - } - - array_shift($path); // remove container - if (count($path) <= 0) { - return $retval; - } - - /* @var $table NodeTable */ - $table = $container->getChild($path[0], true); - if ($table === false) { - if (!$db->getPresence('tables', $path[0])) { - return false; - } - - $node = NodeFactory::getInstance( - 'NodeTable', - $path[0] - ); - if ($type2 == $container->real_name) { - $node->pos2 = $pos2; - } - $container->addChild($node); - $table = $container->getChild($path[0], true); - } - $retval = $table; - $containers = $this->_addTableContainers( - $table, - $pos2, - $type3, - $pos3 - ); - array_shift($path); // remove table - if (count($path) <= 0 - || !array_key_exists($path[0], $containers) - ) { - return $retval; - } - - $container = $table->getChild($path[0], true); - $retval = $container; - $tableData = $table->getData( - $container->real_name, - $pos3 - ); - foreach ($tableData as $item) { - switch ($container->real_name) { - case 'indexes': - $node = NodeFactory::getInstance( - 'NodeIndex', - $item - ); - break; - case 'columns': - $node = NodeFactory::getInstance( - 'NodeColumn', - $item - ); - break; - case 'triggers': - $node = NodeFactory::getInstance( - 'NodeTrigger', - $item - ); - break; - default: - break; - } - if (isset($node)) { - $node->pos2 = $container->parent->pos2; - if ($type3 == $container->real_name) { - $node->pos3 = $pos3; - } - $container->addChild($node); - } - } - - return $retval; - } - - /** - * Adds containers to a node that is a table - * - * References to existing children are returned - * if this function is called twice on the same node - * - * @param NodeTable $table The table node, new containers will be - * attached to this node - * @param int $pos2 The position for the pagination of - * the branch at the second level of the tree - * @param string $type3 The type of item being paginated on - * the third level of the tree - * @param int $pos3 The position for the pagination of - * the branch at the third level of the tree - * - * @return array An array of new nodes - */ - private function _addTableContainers($table, $pos2, $type3, $pos3) - { - $retval = array(); - if ($table->hasChildren(true) == 0) { - if ($table->getPresence('columns')) { - $retval['columns'] = NodeFactory::getInstance( - 'NodeColumnContainer' - ); - } - if ($table->getPresence('indexes')) { - $retval['indexes'] = NodeFactory::getInstance( - 'NodeIndexContainer' - ); - } - if ($table->getPresence('triggers')) { - $retval['triggers'] = NodeFactory::getInstance( - 'NodeTriggerContainer' - ); - } - // Add all new Nodes to the tree - foreach ($retval as $node) { - $node->pos2 = $pos2; - if ($type3 == $node->real_name) { - $node->pos3 = $pos3; - } - $table->addChild($node); - } - } else { - foreach ($table->children as $node) { - if ($type3 == $node->real_name) { - $node->pos3 = $pos3; - } - $retval[$node->real_name] = $node; - } - } - - return $retval; - } - - /** - * Adds containers to a node that is a database - * - * References to existing children are returned - * if this function is called twice on the same node - * - * @param NodeDatabase $db The database node, new containers will be - * attached to this node - * @param string $type The type of item being paginated on - * the second level of the tree - * @param int $pos2 The position for the pagination of - * the branch at the second level of the tree - * - * @return array An array of new nodes - */ - private function _addDbContainers($db, $type, $pos2) - { - // Get items to hide - $hidden = $db->getHiddenItems('group'); - if (!$GLOBALS['cfg']['NavigationTreeShowTables'] - && !in_array('tables', $hidden) - ) { - $hidden[] = 'tables'; - } - if (!$GLOBALS['cfg']['NavigationTreeShowViews'] - && !in_array('views', $hidden) - ) { - $hidden[] = 'views'; - } - if (!$GLOBALS['cfg']['NavigationTreeShowFunctions'] - && !in_array('functions', $hidden) - ) { - $hidden[] = 'functions'; - } - if (!$GLOBALS['cfg']['NavigationTreeShowProcedures'] - && !in_array('procedures', $hidden) - ) { - $hidden[] = 'procedures'; - } - if (!$GLOBALS['cfg']['NavigationTreeShowEvents'] - && !in_array('events', $hidden) - ) { - $hidden[] = 'events'; - } - - $retval = array(); - if ($db->hasChildren(true) == 0) { - if (!in_array('tables', $hidden) && $db->getPresence('tables')) { - $retval['tables'] = NodeFactory::getInstance( - 'NodeTableContainer' - ); - } - if (!in_array('views', $hidden) && $db->getPresence('views')) { - $retval['views'] = NodeFactory::getInstance( - 'NodeViewContainer' - ); - } - if (!in_array('functions', $hidden) && $db->getPresence('functions')) { - $retval['functions'] = NodeFactory::getInstance( - 'NodeFunctionContainer' - ); - } - if (!in_array('procedures', $hidden) && $db->getPresence('procedures')) { - $retval['procedures'] = NodeFactory::getInstance( - 'NodeProcedureContainer' - ); - } - if (!in_array('events', $hidden) && $db->getPresence('events')) { - $retval['events'] = NodeFactory::getInstance( - 'NodeEventContainer' - ); - } - // Add all new Nodes to the tree - foreach ($retval as $node) { - if ($type == $node->real_name) { - $node->pos2 = $pos2; - } - $db->addChild($node); - } - } else { - foreach ($db->children as $node) { - if ($type == $node->real_name) { - $node->pos2 = $pos2; - } - $retval[$node->real_name] = $node; - } - } - - return $retval; - } - - /** - * Recursively groups tree nodes given a separator - * - * @param mixed $node The node to group or null - * to group the whole tree. If - * passed as an argument, $node - * must be of type CONTAINER - * - * @return void - */ - public function groupTree($node = null) - { - if (!isset($node)) { - $node = $this->_tree; - } - $this->groupNode($node); - foreach ($node->children as $child) { - $this->groupTree($child); - } - } - - /** - * Recursively groups tree nodes given a separator - * - * @param Node $node The node to group - * - * @return void - */ - public function groupNode($node) - { - if ($node->type != Node::CONTAINER - || !$GLOBALS['cfg']['NavigationTreeEnableExpansion'] - ) { - return; - } - - $separators = array(); - if (is_array($node->separator)) { - $separators = $node->separator; - } else { - if (strlen($node->separator)) { - $separators[] = $node->separator; - } - } - $prefixes = array(); - if ($node->separator_depth > 0) { - foreach ($node->children as $child) { - $prefix_pos = false; - foreach ($separators as $separator) { - $sep_pos = mb_strpos($child->name, $separator); - if ($sep_pos != false - && $sep_pos != mb_strlen($child->name) - && $sep_pos != 0 - && ($prefix_pos == false || $sep_pos < $prefix_pos) - ) { - $prefix_pos = $sep_pos; - } - } - if ($prefix_pos !== false) { - $prefix = mb_substr($child->name, 0, $prefix_pos); - if (!isset($prefixes[$prefix])) { - $prefixes[$prefix] = 1; - } else { - $prefixes[$prefix]++; - } - } - //Bug #4375: Check if prefix is the name of a DB, to create a group. - foreach ($node->children as $otherChild) { - if (array_key_exists($otherChild->name, $prefixes)) { - $prefixes[$otherChild->name]++; - } - } - } - //Check if prefix is the name of a DB, to create a group. - foreach ($node->children as $child) { - if (array_key_exists($child->name, $prefixes)) { - $prefixes[$child->name]++; - } - } - } - // It is not a group if it has only one item - foreach ($prefixes as $key => $value) { - if ($value == 1) { - unset($prefixes[$key]); - } - } - // rfe #1634 Don't group if there's only one group and no other items - if (count($prefixes) == 1) { - $keys = array_keys($prefixes); - $key = $keys[0]; - if ($prefixes[$key] == count($node->children) - 1) { - unset($prefixes[$key]); - } - } - if (count($prefixes)) { - /** @var Node[] $groups */ - $groups = array(); - foreach ($prefixes as $key => $value) { - - // warn about large groups - if ($value > 500 && !$this->_largeGroupWarning) { - trigger_error( - __( - 'There are large item groups in navigation panel which ' - . 'may affect the performance. Consider disabling item ' - . 'grouping in the navigation panel.' - ), - E_USER_WARNING - ); - $this->_largeGroupWarning = true; - } - - $groups[$key] = new Node( - $key, - Node::CONTAINER, - true - ); - $groups[$key]->separator = $node->separator; - $groups[$key]->separator_depth = $node->separator_depth - 1; - $groups[$key]->icon = Util::getImage( - 'b_group.png' - ); - $groups[$key]->pos2 = $node->pos2; - $groups[$key]->pos3 = $node->pos3; - if ($node instanceof NodeTableContainer - || $node instanceof NodeViewContainer - ) { - $tblGroup = '&tbl_group=' . urlencode($key); - $groups[$key]->links = array( - 'text' => $node->links['text'] . $tblGroup, - 'icon' => $node->links['icon'] . $tblGroup, - ); - } - $node->addChild($groups[$key]); - foreach ($separators as $separator) { - $separatorLength = strlen($separator); - // FIXME: this could be more efficient - foreach ($node->children as $child) { - $keySeparatorLength = mb_strlen($key) + $separatorLength; - $name_substring = mb_substr( - $child->name, - 0, - $keySeparatorLength - ); - if (($name_substring != $key . $separator - && $child->name != $key) - || $child->type != Node::OBJECT - ) { - continue; - } - $class = get_class($child); - $className = substr($class, strrpos($class, '\\') + 1); - unset($class); - $new_child = NodeFactory::getInstance( - $className, - mb_substr( - $child->name, - $keySeparatorLength - ) - ); - - if ($new_child instanceof NodeDatabase - && $child->getHiddenCount() > 0 - ) { - $new_child->setHiddenCount($child->getHiddenCount()); - } - - $new_child->real_name = $child->real_name; - $new_child->icon = $child->icon; - $new_child->links = $child->links; - $new_child->pos2 = $child->pos2; - $new_child->pos3 = $child->pos3; - $groups[$key]->addChild($new_child); - foreach ($child->children as $elm) { - $new_child->addChild($elm); - } - $node->removeChild($child->name); - } - } - } - foreach ($prefixes as $key => $value) { - $this->groupNode($groups[$key]); - $groups[$key]->classes = "navGroup"; - } - } - } - - /** - * Renders a state of the tree, used in light mode when - * either JavaScript and/or Ajax are disabled - * - * @return string HTML code for the navigation tree - */ - public function renderState() - { - $this->_buildPath(); - $retval = $this->_quickWarp(); - $retval .= '
    '; - $retval .= '
      '; - $retval .= $this->_fastFilterHtml($this->_tree); - if ($GLOBALS['cfg']['NavigationTreeEnableExpansion'] - ) { - $retval .= $this->_controls(); - } - $retval .= '
    '; - $retval .= $this->_getPageSelector($this->_tree); - $this->groupTree(); - $retval .= "
      "; - $children = $this->_tree->children; - usort( - $children, - array('PMA\\libraries\\navigation\\NavigationTree', 'sortNode') - ); - $this->_setVisibility(); - for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) { - if ($i == 0) { - $retval .= $this->_renderNode($children[0], true, 'first'); - } else { - if ($i + 1 != $nbChildren) { - $retval .= $this->_renderNode($children[$i], true); - } else { - $retval .= $this->_renderNode($children[$i], true, 'last'); - } - } - } - $retval .= "
    "; - - return $retval; - } - - /** - * Renders a part of the tree, used for Ajax - * requests in light mode - * - * @return string HTML code for the navigation tree - */ - public function renderPath() - { - $node = $this->_buildPath(); - if ($node === false) { - $retval = false; - } else { - $this->groupTree(); - $retval = ""; - } - - if (!empty($this->_searchClause) || !empty($this->_searchClause2)) { - $results = 0; - if (!empty($this->_searchClause2)) { - if (is_object($node->realParent())) { - $results = $node->realParent() - ->getPresence( - $node->real_name, - $this->_searchClause2 - ); - } - } else { - $results = $this->_tree->getPresence( - 'databases', - $this->_searchClause - ); - } - $results = sprintf( - _ngettext( - '%s result found', - '%s results found', - $results - ), - $results - ); - Response::getInstance() - ->addJSON( - 'results', - $results - ); - } - - return $retval; - } - - /** - * Renders the parameters that are required on the client - * side to know which page(s) we will be requesting data from - * - * @param Node $node The node to create the pagination parameters for - * - * @return string - */ - private function _getPaginationParamsHtml($node) - { - $retval = ''; - $paths = $node->getPaths(); - if (isset($paths['aPath_clean'][2])) { - $retval .= ""; - $retval .= $paths['aPath_clean'][2]; - $retval .= ""; - $retval .= ""; - $retval .= htmlspecialchars($node->pos2); - $retval .= ""; - } - if (isset($paths['aPath_clean'][4])) { - $retval .= ""; - $retval .= $paths['aPath_clean'][4]; - $retval .= ""; - $retval .= ""; - $retval .= htmlspecialchars($node->pos3); - $retval .= ""; - } - - return $retval; - } - - /** - * Finds whether given tree matches this tree. - * - * @param array $tree Tree to check - * @param array $paths Paths to check - * - * @return boolean - */ - private function _findTreeMatch($tree, $paths) - { - $match = false; - foreach ($tree as $path) { - $match = true; - foreach ($paths as $key => $part) { - if (!isset($path[$key]) || $part != $path[$key]) { - $match = false; - break; - } - } - if ($match) { - break; - } - } - - return $match; - } - - /** - * Renders a single node or a branch of the tree - * - * @param Node $node The node to render - * @param bool $recursive Bool: Whether to render a single node or a branch - * @param string $class An additional class for the list item - * - * @return string HTML code for the tree node or branch - */ - private function _renderNode($node, $recursive, $class = '') - { - $retval = ''; - $paths = $node->getPaths(); - if ($node->hasSiblings() - || $node->realParent() === false - ) { - if ($node->type == Node::CONTAINER - && count($node->children) == 0 - && $GLOBALS['is_ajax_request'] != true - ) { - return ''; - } - $retval .= '
  • '; - $sterile = array( - 'events', - 'triggers', - 'functions', - 'procedures', - 'views', - 'columns', - 'indexes', - ); - $parentName = ''; - $parents = $node->parents(false, true); - if (count($parents)) { - $parentName = $parents[0]->real_name; - } - // if node name itself is in sterile, then allow - if ($node->is_group - || (!in_array($parentName, $sterile) && !$node->isNew) - || (in_array($node->real_name, $sterile)) - ) { - $retval .= "
    "; - $iClass = ''; - if ($class == 'first') { - $iClass = " class='first'"; - } - $retval .= ""; - if (strpos($class, 'last') === false) { - $retval .= ""; - } - - $match = $this->_findTreeMatch( - $this->_vPath, - $paths['vPath_clean'] - ); - - $retval .= '_pos; - $retval .= ""; - $retval .= $this->_getPaginationParamsHtml($node); - if ($GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] - || $parentName != 'root' - ) { - $retval .= $node->getIcon($match); - } - - $retval .= ""; - $retval .= "
    "; - } else { - $retval .= "
    "; - $iClass = ''; - if ($class == 'first') { - $iClass = " class='first'"; - } - $retval .= ""; - $retval .= $this->_getPaginationParamsHtml($node); - $retval .= "
    "; - } - - $linkClass = ''; - $haveAjax = array( - 'functions', - 'procedures', - 'events', - 'triggers', - 'indexes', - ); - $parent = $node->parents(false, true); - $isNewView = $parent[0]->real_name == 'views' && $node->isNew === true; - if ($parent[0]->type == Node::CONTAINER - && (in_array($parent[0]->real_name, $haveAjax) || $isNewView) - ) { - $linkClass = ' ajax'; - } - - if ($node->type == Node::CONTAINER) { - $retval .= ""; - } - - $divClass = ''; - - if (isset($node->links['icon']) && !empty($node->links['icon'])) { - $iconLinks = $node->links['icon']; - $icons = $node->icon; - if (!is_array($iconLinks)) { - $iconLinks = array($iconLinks); - $icons = array($icons); - } - - if (count($icons) > 1) { - $divClass = 'double'; - } - } - - $retval .= "
    "; - - if (isset($node->links['icon']) && !empty($node->links['icon'])) { - $args = array(); - foreach ($node->parents(true) as $parent) { - $args[] = urlencode($parent->real_name); - } - - foreach ($icons as $key => $icon) { - $link = vsprintf($iconLinks[$key], $args); - if ($linkClass != '') { - $retval .= ""; - $retval .= "{$icon}"; - } else { - $retval .= "{$icon}"; - } - } - } else { - $retval .= "{$node->icon}"; - } - $retval .= "
    "; - - if (isset($node->links['text'])) { - $args = array(); - foreach ($node->parents(true) as $parent) { - $args[] = urlencode($parent->real_name); - } - $link = vsprintf($node->links['text'], $args); - $title = empty($node->links['title']) ? '' : $node->links['title']; - if ($node->type == Node::CONTAINER) { - $retval .= " "; - $retval .= htmlspecialchars($node->name); - $retval .= ""; - } else { - $retval .= "real_name); - $retval .= ""; - } - } else { - $retval .= " {$node->name}"; - } - $retval .= $node->getHtmlForControlButtons(); - if ($node->type == Node::CONTAINER) { - $retval .= "
    "; - } - $retval .= '
    '; - $wrap = true; - } else { - $node->visible = true; - $wrap = false; - $retval .= $this->_getPaginationParamsHtml($node); - } - - if ($recursive) { - $hide = ''; - if (!$node->visible) { - $hide = " style='display: none;'"; - } - $children = $node->children; - usort( - $children, - array('PMA\\libraries\\navigation\\NavigationTree', 'sortNode') - ); - $buffer = ''; - $extra_class = ''; - for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) { - if ($i + 1 == $nbChildren) { - $extra_class = ' last'; - } - $buffer .= $this->_renderNode( - $children[$i], - true, - $children[$i]->classes . $extra_class - ); - } - if (!empty($buffer)) { - if ($wrap) { - $retval .= "
      "; - } - $retval .= $this->_fastFilterHtml($node); - $retval .= $this->_getPageSelector($node); - $retval .= $buffer; - if ($wrap) { - $retval .= "
  • "; - } - } - } - if ($node->hasSiblings()) { - $retval .= ""; - } - - return $retval; - } - - /** - * Renders a database select box like the pre-4.0 navigation panel - * - * @return string HTML code - */ - public function renderDbSelect() - { - $this->_buildPath(); - $retval = $this->_quickWarp(); - $this->_tree->is_group = false; - $retval .= '
    '; - // Provide for pagination in database select - $retval .= Util::getListNavigator( - $this->_tree->getPresence('databases', ''), - $this->_pos, - array('server' => $GLOBALS['server']), - 'navigation.php', - 'frame_navigation', - $GLOBALS['cfg']['FirstLevelNavigationItems'], - 'pos', - array('dbselector') - ); - $children = $this->_tree->children; - array_shift($children); - $url_params = array( - 'token' => $_SESSION[' PMA_token '], - 'server' => $GLOBALS['server'], - ); - $retval .= '
    '; - $retval .= '
    '; - $retval .= PMA_getHiddenFields($url_params); - $retval .= '
    '; - $retval .= '
    '; - $retval .= '
      '; - $children = $this->_tree->children; - usort( - $children, - array('PMA\\libraries\\navigation\\NavigationTree', 'sortNode') - ); - $this->_setVisibility(); - for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) { - if ($i == 0) { - $retval .= $this->_renderNode($children[0], true, 'first'); - } else { - if ($i + 1 != $nbChildren) { - $retval .= $this->_renderNode($children[$i], true); - } else { - $retval .= $this->_renderNode($children[$i], true, 'last'); - } - } - } - $retval .= '
    '; - - return $retval; - } - - /** - * Makes some nodes visible based on the which node is active - * - * @return void - */ - private function _setVisibility() - { - foreach ($this->_vPath as $path) { - $node = $this->_tree; - foreach ($path as $value) { - $child = $node->getChild($value); - if ($child !== false) { - $child->visible = true; - $node = $child; - } - } - } - } - - /** - * Generates the HTML code for displaying the fast filter for tables - * - * @param Node $node The node for which to generate the fast filter html - * - * @return string LI element used for the fast filter - */ - private function _fastFilterHtml($node) - { - $retval = ''; - $filter_db_min - = (int)$GLOBALS['cfg']['NavigationTreeDisplayDbFilterMinimum']; - $filter_item_min - = (int)$GLOBALS['cfg']['NavigationTreeDisplayItemFilterMinimum']; - if ($node === $this->_tree - && $this->_tree->getPresence() >= $filter_db_min - ) { - $url_params = array( - 'pos' => 0, - ); - $retval .= '
  • '; - $retval .= '
    '; - $retval .= PMA_getHiddenFields($url_params); - $retval .= ' 9 - ) { - $placeholder_key = 'placeholder'; - } - $retval .= " $placeholder_key='" - . __("Type to filter these, Enter to search all"); - $retval .= "' />"; - $retval .= 'X'; - $retval .= "
    "; - $retval .= "
  • "; - - return $retval; - } - - if (($node->type == Node::CONTAINER - && ($node->real_name == 'tables' - || $node->real_name == 'views' - || $node->real_name == 'functions' - || $node->real_name == 'procedures' - || $node->real_name == 'events')) - && method_exists($node->realParent(), 'getPresence') - && $node->realParent()->getPresence($node->real_name) >= $filter_item_min - ) { - $paths = $node->getPaths(); - $url_params = array( - 'pos' => $this->_pos, - 'aPath' => $paths['aPath'], - 'vPath' => $paths['vPath'], - 'pos2_name' => $node->real_name, - 'pos2_value' => 0, - ); - $retval .= "
  • "; - $retval .= "
    "; - $retval .= PMA_getHiddenFields($url_params); - $retval .= " 9) { - $placeholder_key = 'placeholder'; - } - $retval .= " $placeholder_key='" - . __("Type to filter these, Enter to search all") . "' />"; - $retval .= "X"; - $retval .= "
    "; - $retval .= "
  • "; - } - - return $retval; - } - - /** - * Creates the code for displaying the controls - * at the top of the navigation tree - * - * @return string HTML code for the controls - */ - private function _controls() - { - // always iconic - $showIcon = true; - $showText = false; - - $retval = ''; - $retval .= ''; - $retval .= ''; - - return $retval; - } - - /** - * Generates the HTML code for displaying the list pagination - * - * @param Node $node The node for whose children the page - * selector will be created - * - * @return string - */ - private function _getPageSelector($node) - { - $retval = ''; - if ($node === $this->_tree) { - $retval .= Util::getListNavigator( - $this->_tree->getPresence('databases', $this->_searchClause), - $this->_pos, - array('server' => $GLOBALS['server']), - 'navigation.php', - 'frame_navigation', - $GLOBALS['cfg']['FirstLevelNavigationItems'], - 'pos', - array('dbselector') - ); - } else { - if ($node->type == Node::CONTAINER && !$node->is_group) { - $paths = $node->getPaths(); - - $level = isset($paths['aPath_clean'][4]) ? 3 : 2; - $_url_params = array( - 'aPath' => $paths['aPath'], - 'vPath' => $paths['vPath'], - 'pos' => $this->_pos, - 'server' => $GLOBALS['server'], - 'pos2_name' => $paths['aPath_clean'][2], - ); - if ($level == 3) { - $pos = $node->pos3; - $_url_params['pos2_value'] = $node->pos2; - $_url_params['pos3_name'] = $paths['aPath_clean'][4]; - } else { - $pos = $node->pos2; - } - $num = $node->realParent() - ->getPresence( - $node->real_name, - $this->_searchClause2 - ); - $retval .= Util::getListNavigator( - $num, - $pos, - $_url_params, - 'navigation.php', - 'frame_navigation', - $GLOBALS['cfg']['MaxNavigationItems'], - 'pos' . $level . '_value' - ); - } - } - - return $retval; - } - - /** - * Called by usort() for sorting the nodes in a container - * - * @param Node $a The first element used in the comparison - * @param Node $b The second element used in the comparison - * - * @return int See strnatcmp() and strcmp() - */ - static public function sortNode($a, $b) - { - if ($a->isNew) { - return -1; - } else { - if ($b->isNew) { - return 1; - } - } - if ($GLOBALS['cfg']['NaturalOrder']) { - return strnatcasecmp($a->name, $b->name); - } else { - return strcasecmp($a->name, $b->name); - } - } - - /** - * Display quick warp links, contain Recents and Favorites - * - * @return string HTML code - */ - private function _quickWarp() - { - $retval = '
    '; - if ($GLOBALS['cfg']['NumRecentTables'] > 0) { - $retval .= RecentFavoriteTable::getInstance('recent') - ->getHtml(); - } - if ($GLOBALS['cfg']['NumFavoriteTables'] > 0) { - $retval .= RecentFavoriteTable::getInstance('favorite') - ->getHtml(); - } - $retval .= '
    '; - $retval .= '
    '; - - return $retval; - } -} diff --git a/#pma/libraries/navigation/NodeFactory.php b/#pma/libraries/navigation/NodeFactory.php deleted file mode 100644 index adbc4873..00000000 --- a/#pma/libraries/navigation/NodeFactory.php +++ /dev/null @@ -1,94 +0,0 @@ -loadClass($class) - ) { - $class = sprintf(self::$_namespace, 'Node'); - trigger_error( - sprintf( - __('Could not load class "%1$s"'), - $class - ), - E_USER_ERROR - ); - } - - return $class; - } - - /** - * Instantiates a Node object - * - * @param string $class The name of the class to instantiate - * @param string $name An identifier for the new node - * @param int $type Type of node, may be one of CONTAINER or OBJECT - * @param bool $is_group Whether this object has been created - * while grouping nodes - * - * @return mixed - */ - public static function getInstance( - $class = 'Node', - $name = 'default', - $type = Node::OBJECT, - $is_group = false - ) { - $class = self::_sanitizeClass($class); - return new $class($name, $type, $is_group); - } -} - diff --git a/#pma/libraries/navigation/nodes/Node.php b/#pma/libraries/navigation/nodes/Node.php deleted file mode 100644 index 8265f631..00000000 --- a/#pma/libraries/navigation/nodes/Node.php +++ /dev/null @@ -1,836 +0,0 @@ -name = $name; - $this->real_name = $name; - } - if ($type === Node::CONTAINER) { - $this->type = Node::CONTAINER; - } - $this->is_group = (bool)$is_group; - } - - /** - * Adds a child node to this node - * - * @param Node $child A child node - * - * @return void - */ - public function addChild($child) - { - $this->children[] = $child; - $child->parent = $this; - } - - /** - * Returns a child node given it's name - * - * @param string $name The name of requested child - * @param bool $real_name Whether to use the "real_name" - * instead of "name" in comparisons - * - * @return false|Node The requested child node or false, - * if the requested node cannot be found - */ - public function getChild($name, $real_name = false) - { - if ($real_name) { - foreach ($this->children as $child) { - if ($child->real_name == $name) { - return $child; - } - } - } else { - foreach ($this->children as $child) { - if ($child->name == $name) { - return $child; - } - } - } - - return false; - } - - /** - * Removes a child node from this node - * - * @param string $name The name of child to be removed - * - * @return void - */ - public function removeChild($name) - { - foreach ($this->children as $key => $child) { - if ($child->name == $name) { - unset($this->children[$key]); - break; - } - } - } - - /** - * Retrieves the parents for a node - * - * @param bool $self Whether to include the Node itself in the results - * @param bool $containers Whether to include nodes of type CONTAINER - * @param bool $groups Whether to include nodes which have $group == true - * - * @return array An array of parent Nodes - */ - public function parents($self = false, $containers = false, $groups = false) - { - $parents = array(); - if ($self - && ($this->type != Node::CONTAINER || $containers) - && (!$this->is_group || $groups) - ) { - $parents[] = $this; - } - $parent = $this->parent; - while (isset($parent)) { - if (($parent->type != Node::CONTAINER || $containers) - && (!$parent->is_group || $groups) - ) { - $parents[] = $parent; - } - $parent = $parent->parent; - } - - return $parents; - } - - /** - * Returns the actual parent of a node. If used twice on an index or columns - * node, it will return the table and database nodes. The names of the returned - * nodes can be used in SQL queries, etc... - * - * @return Node|false - */ - public function realParent() - { - $retval = $this->parents(); - if (count($retval) <= 0) { - return false; - } - - return $retval[0]; - } - - /** - * This function checks if the node has children nodes associated with it - * - * @param bool $count_empty_containers Whether to count empty child - * containers as valid children - * - * @return bool Whether the node has child nodes - */ - public function hasChildren($count_empty_containers = true) - { - $retval = false; - if ($count_empty_containers) { - if (count($this->children)) { - $retval = true; - } - } else { - foreach ($this->children as $child) { - if ($child->type == Node::OBJECT || $child->hasChildren(false)) { - $retval = true; - break; - } - } - } - - return $retval; - } - - /** - * Returns true if the node has some siblings (other nodes on the same tree - * level, in the same branch), false otherwise. - * The only exception is for nodes on - * the third level of the tree (columns and indexes), for which the function - * always returns true. This is because we want to render the containers - * for these nodes - * - * @return bool - */ - public function hasSiblings() - { - $retval = false; - $paths = $this->getPaths(); - if (count($paths['aPath_clean']) > 3) { - $retval = true; - - return $retval; - } - - foreach ($this->parent->children as $child) { - if ($child !== $this - && ($child->type == Node::OBJECT || $child->hasChildren(false)) - ) { - $retval = true; - break; - } - } - - return $retval; - } - - /** - * Returns the number of child nodes that a node has associated with it - * - * @return int The number of children nodes - */ - public function numChildren() - { - $retval = 0; - foreach ($this->children as $child) { - if ($child->type == Node::OBJECT) { - $retval++; - } else { - $retval += $child->numChildren(); - } - } - - return $retval; - } - - /** - * Returns the actual path and the virtual paths for a node - * both as clean arrays and base64 encoded strings - * - * @return array - */ - public function getPaths() - { - $aPath = array(); - $aPath_clean = array(); - foreach ($this->parents(true, true, false) as $parent) { - $aPath[] = base64_encode($parent->real_name); - $aPath_clean[] = $parent->real_name; - } - $aPath = implode('.', array_reverse($aPath)); - $aPath_clean = array_reverse($aPath_clean); - - $vPath = array(); - $vPath_clean = array(); - foreach ($this->parents(true, true, true) as $parent) { - $vPath[] = base64_encode($parent->name); - $vPath_clean[] = $parent->name; - } - $vPath = implode('.', array_reverse($vPath)); - $vPath_clean = array_reverse($vPath_clean); - - return array( - 'aPath' => $aPath, - 'aPath_clean' => $aPath_clean, - 'vPath' => $vPath, - 'vPath_clean' => $vPath_clean, - ); - } - - /** - * Returns the names of children of type $type present inside this container - * This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase and PMA\libraries\navigation\nodes\NodeTable classes - * - * @param string $type The type of item we are looking for - * ('tables', 'views', etc) - * @param int $pos The offset of the list within the results - * @param string $searchClause A string used to filter the results of the query - * - * @return array - */ - public function getData($type, $pos, $searchClause = '') - { - $maxItems = $GLOBALS['cfg']['FirstLevelNavigationItems']; - if (!$GLOBALS['cfg']['NavigationTreeEnableGrouping'] - || !$GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] - ) { - if (isset($GLOBALS['cfg']['Server']['DisableIS']) - && !$GLOBALS['cfg']['Server']['DisableIS'] - ) { - $query = "SELECT `SCHEMA_NAME` "; - $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA` "; - $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); - $query .= "ORDER BY `SCHEMA_NAME` "; - $query .= "LIMIT $pos, $maxItems"; - $retval = $GLOBALS['dbi']->fetchResult($query); - - return $retval; - } - - if ($GLOBALS['dbs_to_test'] === false) { - $retval = array(); - $query = "SHOW DATABASES "; - $query .= $this->_getWhereClause('Database', $searchClause); - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle === false) { - return $retval; - } - - $count = 0; - if (!$GLOBALS['dbi']->dataSeek($handle, $pos)) { - return $retval; - } - - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if ($count < $maxItems) { - $retval[] = $arr[0]; - $count++; - } else { - break; - } - } - - return $retval; - } - - $retval = array(); - $count = 0; - foreach ($this->_getDatabasesToSearch($searchClause) as $db) { - $query = "SHOW DATABASES LIKE '" . $db . "'"; - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle === false) { - continue; - } - - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if ($this->_isHideDb($arr[0])) { - continue; - } - if (in_array($arr[0], $retval)) { - continue; - } - - if ($pos <= 0 && $count < $maxItems) { - $retval[] = $arr[0]; - $count++; - } - $pos--; - } - } - sort($retval); - - return $retval; - } - - $dbSeparator = $GLOBALS['cfg']['NavigationTreeDbSeparator']; - if (isset($GLOBALS['cfg']['Server']['DisableIS']) - && !$GLOBALS['cfg']['Server']['DisableIS'] - ) { - $query = "SELECT `SCHEMA_NAME` "; - $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA`, "; - $query .= "("; - $query .= "SELECT DB_first_level "; - $query .= "FROM ( "; - $query .= "SELECT DISTINCT SUBSTRING_INDEX(SCHEMA_NAME, "; - $query .= "'" . $GLOBALS['dbi']->escapeString($dbSeparator) . "', 1) "; - $query .= "DB_first_level "; - $query .= "FROM INFORMATION_SCHEMA.SCHEMATA "; - $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); - $query .= ") t "; - $query .= "ORDER BY DB_first_level ASC "; - $query .= "LIMIT $pos, $maxItems"; - $query .= ") t2 "; - $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); - $query .= "AND 1 = LOCATE(CONCAT(DB_first_level, "; - $query .= "'" . $GLOBALS['dbi']->escapeString($dbSeparator) . "'), "; - $query .= "CONCAT(SCHEMA_NAME, "; - $query .= "'" . $GLOBALS['dbi']->escapeString($dbSeparator) . "')) "; - $query .= "ORDER BY SCHEMA_NAME ASC"; - $retval = $GLOBALS['dbi']->fetchResult($query); - - return $retval; - } - - if ($GLOBALS['dbs_to_test'] === false) { - $query = "SHOW DATABASES "; - $query .= $this->_getWhereClause('Database', $searchClause); - $handle = $GLOBALS['dbi']->tryQuery($query); - $prefixes = array(); - if ($handle !== false) { - $prefixMap = array(); - $total = $pos + $maxItems; - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - $prefix = strstr($arr[0], $dbSeparator, true); - if ($prefix === false) { - $prefix = $arr[0]; - } - $prefixMap[$prefix] = 1; - if (sizeof($prefixMap) == $total) { - break; - } - } - $prefixes = array_slice(array_keys($prefixMap), $pos); - } - - $query = "SHOW DATABASES "; - $query .= $this->_getWhereClause('Database', $searchClause); - $query .= "AND ("; - $subClauses = array(); - foreach ($prefixes as $prefix) { - $subClauses[] = " LOCATE('" - . $GLOBALS['dbi']->escapeString($prefix) . $dbSeparator - . "', " - . "CONCAT(`Database`, '" . $dbSeparator . "')) = 1 "; - } - $query .= implode("OR", $subClauses) . ")"; - $retval = $GLOBALS['dbi']->fetchResult($query); - - return $retval; - } - - $retval = array(); - $prefixMap = array(); - $total = $pos + $maxItems; - foreach ($this->_getDatabasesToSearch($searchClause) as $db) { - $query = "SHOW DATABASES LIKE '" . $db . "'"; - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle === false) { - continue; - } - - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if ($this->_isHideDb($arr[0])) { - continue; - } - $prefix = strstr($arr[0], $dbSeparator, true); - if ($prefix === false) { - $prefix = $arr[0]; - } - $prefixMap[$prefix] = 1; - if (sizeof($prefixMap) == $total) { - break 2; - } - } - } - $prefixes = array_slice(array_keys($prefixMap), $pos); - - foreach ($this->_getDatabasesToSearch($searchClause) as $db) { - $query = "SHOW DATABASES LIKE '" . $db . "'"; - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle === false) { - continue; - } - - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if ($this->_isHideDb($arr[0])) { - continue; - } - if (in_array($arr[0], $retval)) { - continue; - } - - foreach ($prefixes as $prefix) { - $starts_with = strpos( - $arr[0] . $dbSeparator, - $prefix . $dbSeparator - ) === 0; - if ($starts_with) { - $retval[] = $arr[0]; - break; - } - } - } - } - sort($retval); - - return $retval; - } - - /** - * Returns the number of children of type $type present inside this container - * This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase and PMA\libraries\navigation\nodes\NodeTable classes - * - * @param string $type The type of item we are looking for - * ('tables', 'views', etc) - * @param string $searchClause A string used to filter the results of the query - * - * @return int - */ - public function getPresence($type = '', $searchClause = '') - { - if (!$GLOBALS['cfg']['NavigationTreeEnableGrouping'] - || !$GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] - ) { - if (isset($GLOBALS['cfg']['Server']['DisableIS']) - && !$GLOBALS['cfg']['Server']['DisableIS'] - ) { - $query = "SELECT COUNT(*) "; - $query .= "FROM INFORMATION_SCHEMA.SCHEMATA "; - $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); - $retval = (int)$GLOBALS['dbi']->fetchValue($query); - - return $retval; - } - - if ($GLOBALS['dbs_to_test'] === false) { - $query = "SHOW DATABASES "; - $query .= $this->_getWhereClause('Database', $searchClause); - $retval = $GLOBALS['dbi']->numRows( - $GLOBALS['dbi']->tryQuery($query) - ); - - return $retval; - } - - $retval = 0; - foreach ($this->_getDatabasesToSearch($searchClause) as $db) { - $query = "SHOW DATABASES LIKE '" . $db . "'"; - $retval += $GLOBALS['dbi']->numRows( - $GLOBALS['dbi']->tryQuery($query) - ); - } - - return $retval; - } - - $dbSeparator = $GLOBALS['cfg']['NavigationTreeDbSeparator']; - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $query = "SELECT COUNT(*) "; - $query .= "FROM ( "; - $query .= "SELECT DISTINCT SUBSTRING_INDEX(SCHEMA_NAME, "; - $query .= "'$dbSeparator', 1) "; - $query .= "DB_first_level "; - $query .= "FROM INFORMATION_SCHEMA.SCHEMATA "; - $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); - $query .= ") t "; - $retval = (int)$GLOBALS['dbi']->fetchValue($query); - - return $retval; - } - - if ($GLOBALS['dbs_to_test'] !== false) { - $prefixMap = array(); - foreach ($this->_getDatabasesToSearch($searchClause) as $db) { - $query = "SHOW DATABASES LIKE '" . $db . "'"; - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle === false) { - continue; - } - - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if ($this->_isHideDb($arr[0])) { - continue; - } - $prefix = strstr($arr[0], $dbSeparator, true); - if ($prefix === false) { - $prefix = $arr[0]; - } - $prefixMap[$prefix] = 1; - } - } - $retval = count($prefixMap); - - return $retval; - } - - $prefixMap = array(); - $query = "SHOW DATABASES "; - $query .= $this->_getWhereClause('Database', $searchClause); - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle !== false) { - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - $prefix = strstr($arr[0], $dbSeparator, true); - if ($prefix === false) { - $prefix = $arr[0]; - } - $prefixMap[$prefix] = 1; - } - } - $retval = count($prefixMap); - - return $retval; - } - - /** - * Detemines whether a given database should be hidden according to 'hide_db' - * - * @param string $db database name - * - * @return boolean whether to hide - */ - private function _isHideDb($db) - { - if (!empty($GLOBALS['cfg']['Server']['hide_db']) - && preg_match('/' . $GLOBALS['cfg']['Server']['hide_db'] . '/', $db) - ) { - return true; - } - - return false; - } - - /** - * Get the list of databases for 'SHOW DATABASES LIKE' queries. - * If a search clause is set it gets the highest priority while only_db gets - * the next priority. In case both are empty list of databases determined by - * GRANTs are used - * - * @param string $searchClause search clause - * - * @return array array of databases - */ - private function _getDatabasesToSearch($searchClause) - { - if (!empty($searchClause)) { - $databases = array( - "%" . $GLOBALS['dbi']->escapeString($searchClause, true) . "%", - ); - } elseif (!empty($GLOBALS['cfg']['Server']['only_db'])) { - $databases = $GLOBALS['cfg']['Server']['only_db']; - } elseif (!empty($GLOBALS['dbs_to_test'])) { - $databases = $GLOBALS['dbs_to_test']; - } - sort($databases); - - return $databases; - } - - /** - * Returns the WHERE clause depending on the $searchClause parameter - * and the hide_db directive - * - * @param string $columnName Column name of the column having database names - * @param string $searchClause A string used to filter the results of the query - * - * @return string - */ - private function _getWhereClause($columnName, $searchClause = '') - { - $whereClause = "WHERE TRUE "; - if (!empty($searchClause)) { - $whereClause .= "AND " . Util::backquote($columnName) - . " LIKE '%"; - $whereClause .= $GLOBALS['dbi']->escapeString( - $searchClause, - true - ); - $whereClause .= "%' "; - } - - if (!empty($GLOBALS['cfg']['Server']['hide_db'])) { - $whereClause .= "AND " . Util::backquote($columnName) - . " NOT REGEXP '" - . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['hide_db']) - . "' "; - } - - if (!empty($GLOBALS['cfg']['Server']['only_db'])) { - if (is_string($GLOBALS['cfg']['Server']['only_db'])) { - $GLOBALS['cfg']['Server']['only_db'] = array( - $GLOBALS['cfg']['Server']['only_db'], - ); - } - $whereClause .= "AND ("; - $subClauses = array(); - foreach ($GLOBALS['cfg']['Server']['only_db'] as $each_only_db) { - $subClauses[] = " " . Util::backquote($columnName) - . " LIKE '" - . $GLOBALS['dbi']->escapeString($each_only_db) . "' "; - } - $whereClause .= implode("OR", $subClauses) . ") "; - } - - return $whereClause; - } - - /** - * Returns HTML for control buttons displayed infront of a node - * - * @return String HTML for control buttons - */ - public function getHtmlForControlButtons() - { - return ''; - } - - /** - * Returns CSS classes for a node - * - * @param boolean $match Whether the node matched loaded tree - * - * @return String with html classes. - */ - public function getCssClasses($match) - { - if (!$GLOBALS['cfg']['NavigationTreeEnableExpansion'] - ) { - return ''; - } - - $result = array('expander'); - - if ($this->is_group || $match) { - $result[] = 'loaded'; - } - if ($this->type == Node::CONTAINER) { - $result[] = 'container'; - } - - return implode(' ', $result); - } - - /** - * Returns icon for the node - * - * @param boolean $match Whether the node matched loaded tree - * - * @return String with image name - */ - public function getIcon($match) - { - if (!$GLOBALS['cfg']['NavigationTreeEnableExpansion'] - ) { - return ''; - } elseif ($match && !$this->is_group) { - $this->visible = true; - - return Util::getImage('b_minus.png'); - } else { - return Util::getImage('b_plus.png', __('Expand/Collapse')); - } - } - - /** - * Gets the count of hidden elements for each database - * - * @return array array containing the count of hidden elements for each database - */ - public function getNavigationHidingData() - { - $cfgRelation = PMA_getRelationsParam(); - if ($cfgRelation['navwork']) { - $navTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote( - $cfgRelation['navigationhiding'] - ); - $sqlQuery = "SELECT `db_name`, COUNT(*) AS `count` FROM " . $navTable - . " WHERE `username`='" - . $GLOBALS['dbi']->escapeString( - $GLOBALS['cfg']['Server']['user'] - ) . "'" - . " GROUP BY `db_name`"; - $counts = $GLOBALS['dbi']->fetchResult( - $sqlQuery, - 'db_name', - 'count', - $GLOBALS['controllink'] - ); - - return $counts; - } - - return null; - } -} diff --git a/#pma/libraries/navigation/nodes/NodeColumn.php b/#pma/libraries/navigation/nodes/NodeColumn.php deleted file mode 100644 index 75f64b6f..00000000 --- a/#pma/libraries/navigation/nodes/NodeColumn.php +++ /dev/null @@ -1,44 +0,0 @@ -icon = PMA\libraries\Util::getImage('pause.png', __('Column')); - $this->links = array( - 'text' => 'tbl_structure.php?server=' . $GLOBALS['server'] - . '&db=%3$s&table=%2$s&field=%1$s' - . '&change_column=1' - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] - . '&db=%3$s&table=%2$s&field=%1$s' - . '&change_column=1' - . '&token=' . $_SESSION[' PMA_token '], - 'title' => __('Structure'), - ); - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeColumnContainer.php b/#pma/libraries/navigation/nodes/NodeColumnContainer.php deleted file mode 100644 index aa678a72..00000000 --- a/#pma/libraries/navigation/nodes/NodeColumnContainer.php +++ /dev/null @@ -1,59 +0,0 @@ -icon = Util::getImage('pause.png', __('Columns')); - $this->links = array( - 'text' => 'tbl_structure.php?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s' - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s' - . '&token=' . $_SESSION[' PMA_token '], - ); - $this->real_name = 'columns'; - - $new_label = _pgettext('Create new column', 'New'); - $new = NodeFactory::getInstance( - 'Node', - $new_label - ); - $new->isNew = true; - $new->icon = Util::getImage('b_column_add.png', $new_label); - $new->links = array( - 'text' => 'tbl_addfield.php?server=' . $GLOBALS['server'] - . '&db=%3$s&table=%2$s' - . '&field_where=last&after_field=' - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'tbl_addfield.php?server=' . $GLOBALS['server'] - . '&db=%3$s&table=%2$s' - . '&field_where=last&after_field=' - . '&token=' . $_SESSION[' PMA_token '], - ); - $new->classes = 'new_column italics'; - $this->addChild($new); - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeDatabase.php b/#pma/libraries/navigation/nodes/NodeDatabase.php deleted file mode 100644 index 27915fb2..00000000 --- a/#pma/libraries/navigation/nodes/NodeDatabase.php +++ /dev/null @@ -1,712 +0,0 @@ -icon = Util::getImage( - 's_db.png', - __('Database operations') - ); - - $script_name = Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabDatabase'], - 'database' - ); - $this->links = array( - 'text' => $script_name - . '?server=' . $GLOBALS['server'] - . '&db=%1$s&token=' . $_SESSION[' PMA_token '], - 'icon' => 'db_operations.php?server=' . $GLOBALS['server'] - . '&db=%1$s&token=' . $_SESSION[' PMA_token '], - 'title' => __('Structure'), - ); - $this->classes = 'database'; - } - - /** - * Returns the number of children of type $type present inside this container - * This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase - * and PMA\libraries\navigation\nodes\NodeTable classes - * - * @param string $type The type of item we are looking for - * ('tables', 'views', etc) - * @param string $searchClause A string used to filter the results of - * the query - * @param boolean $singleItem Whether to get presence of a single known - * item or false in none - * - * @return int - */ - public function getPresence($type = '', $searchClause = '', $singleItem = false) - { - $retval = 0; - switch ($type) { - case 'tables': - $retval = $this->_getTableCount($searchClause, $singleItem); - break; - case 'views': - $retval = $this->_getViewCount($searchClause, $singleItem); - break; - case 'procedures': - $retval = $this->_getProcedureCount($searchClause, $singleItem); - break; - case 'functions': - $retval = $this->_getFunctionCount($searchClause, $singleItem); - break; - case 'events': - $retval = $this->_getEventCount($searchClause, $singleItem); - break; - default: - break; - } - - return $retval; - } - - /** - * Returns the number of tables or views present inside this database - * - * @param string $which tables|views - * @param string $searchClause A string used to filter the results of - * the query - * @param boolean $singleItem Whether to get presence of a single known - * item or false in none - * - * @return int - */ - private function _getTableOrViewCount($which, $searchClause, $singleItem) - { - $db = $this->real_name; - if ($which == 'tables') { - $condition = '='; - } else { - $condition = '!='; - } - - if (! $GLOBALS['cfg']['Server']['DisableIS']) { - $db = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`TABLES` "; - $query .= "WHERE `TABLE_SCHEMA`='$db' "; - $query .= "AND `TABLE_TYPE`" . $condition . "'BASE TABLE' "; - if (! empty($searchClause)) { - $query .= "AND " . $this->_getWhereClauseForSearch( - $searchClause, - $singleItem, - 'TABLE_NAME' - ); - } - $retval = (int)$GLOBALS['dbi']->fetchValue($query); - } else { - $query = "SHOW FULL TABLES FROM "; - $query .= Util::backquote($db); - $query .= " WHERE `Table_type`" . $condition . "'BASE TABLE' "; - if (!empty($searchClause)) { - $query .= "AND " . $this->_getWhereClauseForSearch( - $searchClause, - $singleItem, - 'Tables_in_' . $db - ); - } - $retval = $GLOBALS['dbi']->numRows( - $GLOBALS['dbi']->tryQuery($query) - ); - } - - return $retval; - } - - /** - * Returns the number of tables present inside this database - * - * @param string $searchClause A string used to filter the results of - * the query - * @param boolean $singleItem Whether to get presence of a single known - * item or false in none - * - * @return int - */ - private function _getTableCount($searchClause, $singleItem) - { - return $this->_getTableOrViewCount( - 'tables', - $searchClause, - $singleItem - ); - } - - /** - * Returns the number of views present inside this database - * - * @param string $searchClause A string used to filter the results of - * the query - * @param boolean $singleItem Whether to get presence of a single known - * item or false in none - * - * @return int - */ - private function _getViewCount($searchClause, $singleItem) - { - return $this->_getTableOrViewCount( - 'views', - $searchClause, - $singleItem - ); - } - - /** - * Returns the number of procedures present inside this database - * - * @param string $searchClause A string used to filter the results of - * the query - * @param boolean $singleItem Whether to get presence of a single known - * item or false in none - * - * @return int - */ - private function _getProcedureCount($searchClause, $singleItem) - { - $db = $this->real_name; - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $db = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`ROUTINES` "; - $query .= "WHERE `ROUTINE_SCHEMA` " - . Util::getCollateForIS() . "='$db'"; - $query .= "AND `ROUTINE_TYPE`='PROCEDURE' "; - if (!empty($searchClause)) { - $query .= "AND " . $this->_getWhereClauseForSearch( - $searchClause, - $singleItem, - 'ROUTINE_NAME' - ); - } - $retval = (int)$GLOBALS['dbi']->fetchValue($query); - } else { - $db = $GLOBALS['dbi']->escapeString($db); - $query = "SHOW PROCEDURE STATUS WHERE `Db`='$db' "; - if (!empty($searchClause)) { - $query .= "AND " . $this->_getWhereClauseForSearch( - $searchClause, - $singleItem, - 'Name' - ); - } - $retval = $GLOBALS['dbi']->numRows( - $GLOBALS['dbi']->tryQuery($query) - ); - } - - return $retval; - } - - /** - * Returns the number of functions present inside this database - * - * @param string $searchClause A string used to filter the results of - * the query - * @param boolean $singleItem Whether to get presence of a single known - * item or false in none - * - * @return int - */ - private function _getFunctionCount($searchClause, $singleItem) - { - $db = $this->real_name; - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $db = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`ROUTINES` "; - $query .= "WHERE `ROUTINE_SCHEMA` " - . Util::getCollateForIS() . "='$db' "; - $query .= "AND `ROUTINE_TYPE`='FUNCTION' "; - if (!empty($searchClause)) { - $query .= "AND " . $this->_getWhereClauseForSearch( - $searchClause, - $singleItem, - 'ROUTINE_NAME' - ); - } - $retval = (int)$GLOBALS['dbi']->fetchValue($query); - } else { - $db = $GLOBALS['dbi']->escapeString($db); - $query = "SHOW FUNCTION STATUS WHERE `Db`='$db' "; - if (!empty($searchClause)) { - $query .= "AND " . $this->_getWhereClauseForSearch( - $searchClause, - $singleItem, - 'Name' - ); - } - $retval = $GLOBALS['dbi']->numRows( - $GLOBALS['dbi']->tryQuery($query) - ); - } - - return $retval; - } - - /** - * Returns the number of events present inside this database - * - * @param string $searchClause A string used to filter the results of - * the query - * @param boolean $singleItem Whether to get presence of a single known - * item or false in none - * - * @return int - */ - private function _getEventCount($searchClause, $singleItem) - { - $db = $this->real_name; - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $db = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`EVENTS` "; - $query .= "WHERE `EVENT_SCHEMA` " - . Util::getCollateForIS() . "='$db' "; - if (!empty($searchClause)) { - $query .= "AND " . $this->_getWhereClauseForSearch( - $searchClause, - $singleItem, - 'EVENT_NAME' - ); - } - $retval = (int)$GLOBALS['dbi']->fetchValue($query); - } else { - $db = Util::backquote($db); - $query = "SHOW EVENTS FROM $db "; - if (!empty($searchClause)) { - $query .= "WHERE " . $this->_getWhereClauseForSearch( - $searchClause, - $singleItem, - 'Name' - ); - } - $retval = $GLOBALS['dbi']->numRows( - $GLOBALS['dbi']->tryQuery($query) - ); - } - - return $retval; - } - - /** - * Returns the WHERE clause for searching inside a database - * - * @param string $searchClause A string used to filter the results of the query - * @param boolean $singleItem Whether to get presence of a single known item - * @param string $columnName Name of the column in the result set to match - * - * @return string WHERE clause for searching - */ - private function _getWhereClauseForSearch( - $searchClause, - $singleItem, - $columnName - ) { - $query = ''; - if ($singleItem) { - $query .= Util::backquote($columnName) . " = "; - $query .= "'" . $GLOBALS['dbi']->escapeString($searchClause) . "'"; - } else { - $query .= Util::backquote($columnName) . " LIKE "; - $query .= "'%" . $GLOBALS['dbi']->escapeString($searchClause) - . "%'"; - } - - return $query; - } - - /** - * Returns the names of children of type $type present inside this container - * This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase - * and PMA\libraries\navigation\nodes\NodeTable classes - * - * @param string $type The type of item we are looking for - * ('tables', 'views', etc) - * @param int $pos The offset of the list within the results - * @param string $searchClause A string used to filter the results of the query - * - * @return array - */ - public function getData($type, $pos, $searchClause = '') - { - $retval = array(); - switch ($type) { - case 'tables': - $retval = $this->_getTables($pos, $searchClause); - break; - case 'views': - $retval = $this->_getViews($pos, $searchClause); - break; - case 'procedures': - $retval = $this->_getProcedures($pos, $searchClause); - break; - case 'functions': - $retval = $this->_getFunctions($pos, $searchClause); - break; - case 'events': - $retval = $this->_getEvents($pos, $searchClause); - break; - default: - break; - } - - // Remove hidden items so that they are not displayed in navigation tree - $cfgRelation = PMA_getRelationsParam(); - if ($cfgRelation['navwork']) { - $hiddenItems = $this->getHiddenItems(substr($type, 0, -1)); - foreach ($retval as $key => $item) { - if (in_array($item, $hiddenItems)) { - unset($retval[$key]); - } - } - } - - return $retval; - } - - /** - * Return list of hidden items of given type - * - * @param string $type The type of items we are looking for - * ('table', 'function', 'group', etc.) - * - * @return array Array containing hidden items of given type - */ - public function getHiddenItems($type) - { - $db = $this->real_name; - $cfgRelation = PMA_getRelationsParam(); - if (empty($cfgRelation['navigationhiding'])) { - return array(); - } - $navTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['navigationhiding']); - $sqlQuery = "SELECT `item_name` FROM " . $navTable - . " WHERE `username`='" . $cfgRelation['user'] . "'" - . " AND `item_type`='" . $type - . "'" . " AND `db_name`='" . $GLOBALS['dbi']->escapeString($db) - . "'"; - $result = PMA_queryAsControlUser($sqlQuery, false); - $hiddenItems = array(); - if ($result) { - while ($row = $GLOBALS['dbi']->fetchArray($result)) { - $hiddenItems[] = $row[0]; - } - } - $GLOBALS['dbi']->freeResult($result); - - return $hiddenItems; - } - - /** - * Returns the list of tables or views inside this database - * - * @param string $which tables|views - * @param int $pos The offset of the list within the results - * @param string $searchClause A string used to filter the results of the query - * - * @return array - */ - private function _getTablesOrViews($which, $pos, $searchClause) - { - if ($which == 'tables') { - $condition = '='; - } else { - $condition = '!='; - } - $maxItems = $GLOBALS['cfg']['MaxNavigationItems']; - $retval = array(); - $db = $this->real_name; - if (! $GLOBALS['cfg']['Server']['DisableIS']) { - $escdDb = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT `TABLE_NAME` AS `name` "; - $query .= "FROM `INFORMATION_SCHEMA`.`TABLES` "; - $query .= "WHERE `TABLE_SCHEMA`='$escdDb' "; - $query .= "AND `TABLE_TYPE`" . $condition . "'BASE TABLE' "; - if (! empty($searchClause)) { - $query .= "AND `TABLE_NAME` LIKE '%"; - $query .= $GLOBALS['dbi']->escapeString($searchClause); - $query .= "%'"; - } - $query .= "ORDER BY `TABLE_NAME` ASC "; - $query .= "LIMIT " . intval($pos) . ", $maxItems"; - $retval = $GLOBALS['dbi']->fetchResult($query); - } else { - $query = " SHOW FULL TABLES FROM "; - $query .= Util::backquote($db); - $query .= " WHERE `Table_type`" . $condition . "'BASE TABLE' "; - if (!empty($searchClause)) { - $query .= "AND " . Util::backquote( - "Tables_in_" . $db - ); - $query .= " LIKE '%" . $GLOBALS['dbi']->escapeString( - $searchClause - ); - $query .= "%'"; - } - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle !== false) { - $count = 0; - if ($GLOBALS['dbi']->dataSeek($handle, $pos)) { - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if ($count < $maxItems) { - $retval[] = $arr[0]; - $count++; - } else { - break; - } - } - } - } - } - - return $retval; - } - - /** - * Returns the list of tables inside this database - * - * @param int $pos The offset of the list within the results - * @param string $searchClause A string used to filter the results of the query - * - * @return array - */ - private function _getTables($pos, $searchClause) - { - return $this->_getTablesOrViews('tables', $pos, $searchClause); - } - - /** - * Returns the list of views inside this database - * - * @param int $pos The offset of the list within the results - * @param string $searchClause A string used to filter the results of the query - * - * @return array - */ - private function _getViews($pos, $searchClause) - { - return $this->_getTablesOrViews('views', $pos, $searchClause); - } - - /** - * Returns the list of procedures or functions inside this database - * - * @param string $routineType PROCEDURE|FUNCTION - * @param int $pos The offset of the list within the results - * @param string $searchClause A string used to filter the results of the query - * - * @return array - */ - private function _getRoutines($routineType, $pos, $searchClause) - { - $maxItems = $GLOBALS['cfg']['MaxNavigationItems']; - $retval = array(); - $db = $this->real_name; - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $escdDb = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT `ROUTINE_NAME` AS `name` "; - $query .= "FROM `INFORMATION_SCHEMA`.`ROUTINES` "; - $query .= "WHERE `ROUTINE_SCHEMA` " - . Util::getCollateForIS() . "='$escdDb'"; - $query .= "AND `ROUTINE_TYPE`='" . $routineType . "' "; - if (!empty($searchClause)) { - $query .= "AND `ROUTINE_NAME` LIKE '%"; - $query .= $GLOBALS['dbi']->escapeString($searchClause); - $query .= "%'"; - } - $query .= "ORDER BY `ROUTINE_NAME` ASC "; - $query .= "LIMIT " . intval($pos) . ", $maxItems"; - $retval = $GLOBALS['dbi']->fetchResult($query); - } else { - $escdDb = $GLOBALS['dbi']->escapeString($db); - $query = "SHOW " . $routineType . " STATUS WHERE `Db`='$escdDb' "; - if (!empty($searchClause)) { - $query .= "AND `Name` LIKE '%"; - $query .= $GLOBALS['dbi']->escapeString($searchClause); - $query .= "%'"; - } - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle !== false) { - $count = 0; - if ($GLOBALS['dbi']->dataSeek($handle, $pos)) { - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if ($count < $maxItems) { - $retval[] = $arr['Name']; - $count++; - } else { - break; - } - } - } - } - } - - return $retval; - } - - /** - * Returns the list of procedures inside this database - * - * @param int $pos The offset of the list within the results - * @param string $searchClause A string used to filter the results of the query - * - * @return array - */ - private function _getProcedures($pos, $searchClause) - { - return $this->_getRoutines('PROCEDURE', $pos, $searchClause); - } - - /** - * Returns the list of functions inside this database - * - * @param int $pos The offset of the list within the results - * @param string $searchClause A string used to filter the results of the query - * - * @return array - */ - private function _getFunctions($pos, $searchClause) - { - return $this->_getRoutines('FUNCTION', $pos, $searchClause); - } - - /** - * Returns the list of events inside this database - * - * @param int $pos The offset of the list within the results - * @param string $searchClause A string used to filter the results of the query - * - * @return array - */ - private function _getEvents($pos, $searchClause) - { - $maxItems = $GLOBALS['cfg']['MaxNavigationItems']; - $retval = array(); - $db = $this->real_name; - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $escdDb = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT `EVENT_NAME` AS `name` "; - $query .= "FROM `INFORMATION_SCHEMA`.`EVENTS` "; - $query .= "WHERE `EVENT_SCHEMA` " - . Util::getCollateForIS() . "='$escdDb' "; - if (!empty($searchClause)) { - $query .= "AND `EVENT_NAME` LIKE '%"; - $query .= $GLOBALS['dbi']->escapeString($searchClause); - $query .= "%'"; - } - $query .= "ORDER BY `EVENT_NAME` ASC "; - $query .= "LIMIT " . intval($pos) . ", $maxItems"; - $retval = $GLOBALS['dbi']->fetchResult($query); - } else { - $escdDb = Util::backquote($db); - $query = "SHOW EVENTS FROM $escdDb "; - if (!empty($searchClause)) { - $query .= "WHERE `Name` LIKE '%"; - $query .= $GLOBALS['dbi']->escapeString($searchClause); - $query .= "%'"; - } - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle !== false) { - $count = 0; - if ($GLOBALS['dbi']->dataSeek($handle, $pos)) { - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if ($count < $maxItems) { - $retval[] = $arr['Name']; - $count++; - } else { - break; - } - } - } - } - } - - return $retval; - } - - /** - * Returns HTML for control buttons displayed infront of a node - * - * @return String HTML for control buttons - */ - public function getHtmlForControlButtons() - { - $ret = ''; - $cfgRelation = PMA_getRelationsParam(); - if ($cfgRelation['navwork']) { - if ($this->hiddenCount > 0) { - $ret = '' - . '' - . Util::getImage( - 'lightbulb.png', - __('Show hidden items') - ) - . ''; - } - } - - return $ret; - } - - /** - * Sets the number of hidden items in this database - * - * @param int $count hidden item count - * - * @return void - */ - public function setHiddenCount($count) - { - $this->hiddenCount = $count; - } - - /** - * Returns the number of hidden items in this database - * - * @return int hidden item count - */ - public function getHiddenCount() - { - return $this->hiddenCount; - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeDatabaseChild.php b/#pma/libraries/navigation/nodes/NodeDatabaseChild.php deleted file mode 100644 index 94477bdd..00000000 --- a/#pma/libraries/navigation/nodes/NodeDatabaseChild.php +++ /dev/null @@ -1,54 +0,0 @@ -realParent()->real_name; - $item = $this->real_name; - $ret = '' - . '' - . PMA\libraries\Util::getImage('lightbulb_off.png', __('Hide')) - . ''; - } - - return $ret; - } -} diff --git a/#pma/libraries/navigation/nodes/NodeDatabaseChildContainer.php b/#pma/libraries/navigation/nodes/NodeDatabaseChildContainer.php deleted file mode 100644 index 59250f72..00000000 --- a/#pma/libraries/navigation/nodes/NodeDatabaseChildContainer.php +++ /dev/null @@ -1,43 +0,0 @@ -separator = $GLOBALS['cfg']['NavigationTreeTableSeparator']; - $this->separator_depth = (int)( - $GLOBALS['cfg']['NavigationTreeTableLevel'] - ); - } - } - - /** - * Returns the type of the item represented by the node. - * - * @return string type of the item - */ - protected function getItemType() - { - return 'group'; - } -} diff --git a/#pma/libraries/navigation/nodes/NodeDatabaseContainer.php b/#pma/libraries/navigation/nodes/NodeDatabaseContainer.php deleted file mode 100644 index b636748c..00000000 --- a/#pma/libraries/navigation/nodes/NodeDatabaseContainer.php +++ /dev/null @@ -1,50 +0,0 @@ -isNew = true; - $new->icon = PMA\libraries\Util::getImage('b_newdb.png', ''); - $new->links = array( - 'text' => 'server_databases.php?server=' . $GLOBALS['server'] - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'server_databases.php?server=' . $GLOBALS['server'] - . '&token=' . $_SESSION[' PMA_token '], - ); - $new->classes = 'new_database italics'; - $this->addChild($new); - } - } -} diff --git a/#pma/libraries/navigation/nodes/NodeEvent.php b/#pma/libraries/navigation/nodes/NodeEvent.php deleted file mode 100644 index d3946820..00000000 --- a/#pma/libraries/navigation/nodes/NodeEvent.php +++ /dev/null @@ -1,52 +0,0 @@ -icon = PMA\libraries\Util::getImage('b_events.png'); - $this->links = array( - 'text' => 'db_events.php?server=' . $GLOBALS['server'] - . '&db=%2$s&item_name=%1$s&edit_item=1' - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'db_events.php?server=' . $GLOBALS['server'] - . '&db=%2$s&item_name=%1$s&export_item=1' - . '&token=' . $_SESSION[' PMA_token '], - ); - $this->classes = 'event'; - } - - /** - * Returns the type of the item represented by the node. - * - * @return string type of the item - */ - protected function getItemType() - { - return 'event'; - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeEventContainer.php b/#pma/libraries/navigation/nodes/NodeEventContainer.php deleted file mode 100644 index a244231f..00000000 --- a/#pma/libraries/navigation/nodes/NodeEventContainer.php +++ /dev/null @@ -1,53 +0,0 @@ -icon = PMA\libraries\Util::getImage('b_events.png', ''); - $this->links = array( - 'text' => 'db_events.php?server=' . $GLOBALS['server'] - . '&db=%1$s&token=' . $_SESSION[' PMA_token '], - 'icon' => 'db_events.php?server=' . $GLOBALS['server'] - . '&db=%1$s&token=' . $_SESSION[' PMA_token '], - ); - $this->real_name = 'events'; - - $new = NodeFactory::getInstance( - 'Node', - _pgettext('Create new event', 'New') - ); - $new->isNew = true; - $new->icon = PMA\libraries\Util::getImage('b_event_add.png', ''); - $new->links = array( - 'text' => 'db_events.php?server=' . $GLOBALS['server'] - . '&db=%2$s&token=' . $_SESSION[' PMA_token '] - . '&add_item=1', - 'icon' => 'db_events.php?server=' . $GLOBALS['server'] - . '&db=%2$s&token=' . $_SESSION[' PMA_token '] - . '&add_item=1', - ); - $new->classes = 'new_event italics'; - $this->addChild($new); - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeFunction.php b/#pma/libraries/navigation/nodes/NodeFunction.php deleted file mode 100644 index 61d87b2b..00000000 --- a/#pma/libraries/navigation/nodes/NodeFunction.php +++ /dev/null @@ -1,52 +0,0 @@ -icon = PMA\libraries\Util::getImage('b_routines.png', __('Function')); - $this->links = array( - 'text' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%2$s&item_name=%1$s&item_type=FUNCTION' - . '&edit_item=1&token=' . $_SESSION[' PMA_token '], - 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%2$s&item_name=%1$s&item_type=FUNCTION' - . '&execute_dialog=1&token=' . $_SESSION[' PMA_token '], - ); - $this->classes = 'function'; - } - - /** - * Returns the type of the item represented by the node. - * - * @return string type of the item - */ - protected function getItemType() - { - return 'function'; - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeFunctionContainer.php b/#pma/libraries/navigation/nodes/NodeFunctionContainer.php deleted file mode 100644 index 523d6b62..00000000 --- a/#pma/libraries/navigation/nodes/NodeFunctionContainer.php +++ /dev/null @@ -1,59 +0,0 @@ -icon = PMA\libraries\Util::getImage( - 'b_routines.png', - __('Functions') - ); - $this->links = array( - 'text' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%1$s&token=' . $_SESSION[' PMA_token '] - . '&type=FUNCTION', - 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%1$s&token=' . $_SESSION[' PMA_token '] - . '&type=FUNCTION', - ); - $this->real_name = 'functions'; - - $new_label = _pgettext('Create new function', 'New'); - $new = NodeFactory::getInstance( - 'Node', - $new_label - ); - $new->isNew = true; - $new->icon = PMA\libraries\Util::getImage('b_routine_add.png', $new_label); - $new->links = array( - 'text' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%2$s&token=' . $_SESSION[' PMA_token '] - . '&add_item=1&item_type=FUNCTION', - 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%2$s&token=' . $_SESSION[' PMA_token '] - . '&add_item=1&item_type=FUNCTION', - ); - $new->classes = 'new_function italics'; - $this->addChild($new); - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeIndex.php b/#pma/libraries/navigation/nodes/NodeIndex.php deleted file mode 100644 index fa964a0d..00000000 --- a/#pma/libraries/navigation/nodes/NodeIndex.php +++ /dev/null @@ -1,42 +0,0 @@ -icon = PMA\libraries\Util::getImage('b_index.png', __('Index')); - $this->links = array( - 'text' => 'tbl_indexes.php?server=' . $GLOBALS['server'] - . '&db=%3$s&table=%2$s&index=%1$s' - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'tbl_indexes.php?server=' . $GLOBALS['server'] - . '&db=%3$s&table=%2$s&index=%1$s' - . '&token=' . $_SESSION[' PMA_token '], - ); - $this->classes = 'index'; - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeIndexContainer.php b/#pma/libraries/navigation/nodes/NodeIndexContainer.php deleted file mode 100644 index 8398729f..00000000 --- a/#pma/libraries/navigation/nodes/NodeIndexContainer.php +++ /dev/null @@ -1,58 +0,0 @@ -icon = PMA\libraries\Util::getImage('b_index.png', __('Indexes')); - $this->links = array( - 'text' => 'tbl_structure.php?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s' - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s' - . '&token=' . $_SESSION[' PMA_token '], - ); - $this->real_name = 'indexes'; - - $new_label = _pgettext('Create new index', 'New'); - $new = NodeFactory::getInstance( - 'Node', - $new_label - ); - $new->isNew = true; - $new->icon = PMA\libraries\Util::getImage('b_index_add.png', $new_label); - $new->links = array( - 'text' => 'tbl_indexes.php?server=' . $GLOBALS['server'] - . '&create_index=1&added_fields=2' - . '&db=%3$s&table=%2$s&token=' - . $_SESSION[' PMA_token '], - 'icon' => 'tbl_indexes.php?server=' . $GLOBALS['server'] - . '&create_index=1&added_fields=2' - . '&db=%3$s&table=%2$s&token=' - . $_SESSION[' PMA_token '], - ); - $new->classes = 'new_index italics'; - $this->addChild($new); - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeProcedure.php b/#pma/libraries/navigation/nodes/NodeProcedure.php deleted file mode 100644 index 579b1168..00000000 --- a/#pma/libraries/navigation/nodes/NodeProcedure.php +++ /dev/null @@ -1,55 +0,0 @@ -icon = PMA\libraries\Util::getImage( - 'b_routines.png', - __('Procedure') - ); - $this->links = array( - 'text' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%2$s&item_name=%1$s&item_type=PROCEDURE' - . '&edit_item=1&token=' . $_SESSION[' PMA_token '], - 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%2$s&item_name=%1$s&item_type=PROCEDURE' - . '&execute_dialog=1&token=' . $_SESSION[' PMA_token '], - ); - $this->classes = 'procedure'; - } - - /** - * Returns the type of the item represented by the node. - * - * @return string type of the item - */ - protected function getItemType() - { - return 'procedure'; - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeProcedureContainer.php b/#pma/libraries/navigation/nodes/NodeProcedureContainer.php deleted file mode 100644 index 21acc484..00000000 --- a/#pma/libraries/navigation/nodes/NodeProcedureContainer.php +++ /dev/null @@ -1,59 +0,0 @@ -icon = PMA\libraries\Util::getImage( - 'b_routines.png', - __('Procedures') - ); - $this->links = array( - 'text' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%1$s&token=' . $_SESSION[' PMA_token '] - . '&type=PROCEDURE', - 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%1$s&token=' . $_SESSION[' PMA_token '] - . '&type=PROCEDURE', - ); - $this->real_name = 'procedures'; - - $new_label = _pgettext('Create new procedure', 'New'); - $new = NodeFactory::getInstance( - 'Node', - $new_label - ); - $new->isNew = true; - $new->icon = PMA\libraries\Util::getImage('b_routine_add.png', $new_label); - $new->links = array( - 'text' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%2$s&token=' . $_SESSION[' PMA_token '] - . '&add_item=1', - 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] - . '&db=%2$s&token=' . $_SESSION[' PMA_token '] - . '&add_item=1', - ); - $new->classes = 'new_procedure italics'; - $this->addChild($new); - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeTable.php b/#pma/libraries/navigation/nodes/NodeTable.php deleted file mode 100644 index 89020cae..00000000 --- a/#pma/libraries/navigation/nodes/NodeTable.php +++ /dev/null @@ -1,319 +0,0 @@ -icon = array(); - $this->_addIcon( - Util::getScriptNameForOption( - $GLOBALS['cfg']['NavigationTreeDefaultTabTable'], - 'table' - ) - ); - $this->_addIcon( - Util::getScriptNameForOption( - $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], - 'table' - ) - ); - $title = Util::getTitleForTarget( - $GLOBALS['cfg']['DefaultTabTable'] - ); - $this->title = $title; - - $script_name = Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], - 'table' - ); - $this->links = array( - 'text' => $script_name - . '?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s' - . '&pos=0&token=' . $_SESSION[' PMA_token '], - 'icon' => array( - Util::getScriptNameForOption( - $GLOBALS['cfg']['NavigationTreeDefaultTabTable'], - 'table' - ) - . '?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s&token=' - . $_SESSION[' PMA_token '], - Util::getScriptNameForOption( - $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], - 'table' - ) - . '?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s&token=' - . $_SESSION[' PMA_token '], - ), - 'title' => $this->title, - ); - $this->classes = 'table'; - } - - /** - * Returns the number of children of type $type present inside this container - * This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase - * and PMA\libraries\navigation\nodes\NodeTable classes - * - * @param string $type The type of item we are looking for - * ('columns' or 'indexes') - * @param string $searchClause A string used to filter the results of the query - * - * @return int - */ - public function getPresence($type = '', $searchClause = '') - { - $retval = 0; - $db = $this->realParent()->real_name; - $table = $this->real_name; - switch ($type) { - case 'columns': - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $db = $GLOBALS['dbi']->escapeString($db); - $table = $GLOBALS['dbi']->escapeString($table); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`COLUMNS` "; - $query .= "WHERE `TABLE_NAME`='$table' "; - $query .= "AND `TABLE_SCHEMA`='$db'"; - $retval = (int)$GLOBALS['dbi']->fetchValue($query); - } else { - $db = Util::backquote($db); - $table = Util::backquote($table); - $query = "SHOW COLUMNS FROM $table FROM $db"; - $retval = (int)$GLOBALS['dbi']->numRows( - $GLOBALS['dbi']->tryQuery($query) - ); - } - break; - case 'indexes': - $db = Util::backquote($db); - $table = Util::backquote($table); - $query = "SHOW INDEXES FROM $table FROM $db"; - $retval = (int)$GLOBALS['dbi']->numRows( - $GLOBALS['dbi']->tryQuery($query) - ); - break; - case 'triggers': - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $db = $GLOBALS['dbi']->escapeString($db); - $table = $GLOBALS['dbi']->escapeString($table); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`TRIGGERS` "; - $query .= "WHERE `EVENT_OBJECT_SCHEMA` " - . Util::getCollateForIS() . "='$db' "; - $query .= "AND `EVENT_OBJECT_TABLE` " - . Util::getCollateForIS() . "='$table'"; - $retval = (int)$GLOBALS['dbi']->fetchValue($query); - } else { - $db = Util::backquote($db); - $table = $GLOBALS['dbi']->escapeString($table); - $query = "SHOW TRIGGERS FROM $db WHERE `Table` = '$table'"; - $retval = (int)$GLOBALS['dbi']->numRows( - $GLOBALS['dbi']->tryQuery($query) - ); - } - break; - default: - break; - } - - return $retval; - } - - /** - * Returns the names of children of type $type present inside this container - * This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase - * and PMA\libraries\navigation\nodes\NodeTable classes - * - * @param string $type The type of item we are looking for - * ('tables', 'views', etc) - * @param int $pos The offset of the list within the results - * @param string $searchClause A string used to filter the results of the query - * - * @return array - */ - public function getData($type, $pos, $searchClause = '') - { - $maxItems = $GLOBALS['cfg']['MaxNavigationItems']; - $retval = array(); - $db = $this->realParent()->real_name; - $table = $this->real_name; - switch ($type) { - case 'columns': - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $db = $GLOBALS['dbi']->escapeString($db); - $table = $GLOBALS['dbi']->escapeString($table); - $query = "SELECT `COLUMN_NAME` AS `name` "; - $query .= "FROM `INFORMATION_SCHEMA`.`COLUMNS` "; - $query .= "WHERE `TABLE_NAME`='$table' "; - $query .= "AND `TABLE_SCHEMA`='$db' "; - $query .= "ORDER BY `COLUMN_NAME` ASC "; - $query .= "LIMIT " . intval($pos) . ", $maxItems"; - $retval = $GLOBALS['dbi']->fetchResult($query); - break; - } - - $db = Util::backquote($db); - $table = Util::backquote($table); - $query = "SHOW COLUMNS FROM $table FROM $db"; - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle === false) { - break; - } - - $count = 0; - if ($GLOBALS['dbi']->dataSeek($handle, $pos)) { - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if ($count < $maxItems) { - $retval[] = $arr['Field']; - $count++; - } else { - break; - } - } - } - break; - case 'indexes': - $db = Util::backquote($db); - $table = Util::backquote($table); - $query = "SHOW INDEXES FROM $table FROM $db"; - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle === false) { - break; - } - - $count = 0; - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if (in_array($arr['Key_name'], $retval)) { - continue; - } - if ($pos <= 0 && $count < $maxItems) { - $retval[] = $arr['Key_name']; - $count++; - } - $pos--; - } - break; - case 'triggers': - if (!$GLOBALS['cfg']['Server']['DisableIS']) { - $db = $GLOBALS['dbi']->escapeString($db); - $table = $GLOBALS['dbi']->escapeString($table); - $query = "SELECT `TRIGGER_NAME` AS `name` "; - $query .= "FROM `INFORMATION_SCHEMA`.`TRIGGERS` "; - $query .= "WHERE `EVENT_OBJECT_SCHEMA` " - . Util::getCollateForIS() . "='$db' "; - $query .= "AND `EVENT_OBJECT_TABLE` " - . Util::getCollateForIS() . "='$table' "; - $query .= "ORDER BY `TRIGGER_NAME` ASC "; - $query .= "LIMIT " . intval($pos) . ", $maxItems"; - $retval = $GLOBALS['dbi']->fetchResult($query); - break; - } - - $db = Util::backquote($db); - $table = $GLOBALS['dbi']->escapeString($table); - $query = "SHOW TRIGGERS FROM $db WHERE `Table` = '$table'"; - $handle = $GLOBALS['dbi']->tryQuery($query); - if ($handle === false) { - break; - } - - $count = 0; - if ($GLOBALS['dbi']->dataSeek($handle, $pos)) { - while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { - if ($count < $maxItems) { - $retval[] = $arr['Trigger']; - $count++; - } else { - break; - } - } - } - break; - default: - break; - } - - return $retval; - } - - /** - * Returns the type of the item represented by the node. - * - * @return string type of the item - */ - protected function getItemType() - { - return 'table'; - } - - /** - * Add an icon to navigation tree - * - * @param string $page Page name to redirect - * - * @return void - */ - private function _addIcon($page) - { - if (empty($page)) { - return; - } - - switch ($page) { - case 'tbl_structure.php': - $this->icon[] = Util::getImage( - 'b_props.png', - __('Structure') - ); - break; - case 'tbl_select.php': - $this->icon[] = Util::getImage( - 'b_search.png', - __('Search') - ); - break; - case 'tbl_change.php': - $this->icon[] = Util::getImage( - 'b_insrow.png', - __('Insert') - ); - break; - case 'tbl_sql.php': - $this->icon[] = Util::getImage('b_sql.png', __('SQL')); - break; - case 'sql.php': - $this->icon[] = Util::getImage( - 'b_browse.png', - __('Browse') - ); - break; - } - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeTableContainer.php b/#pma/libraries/navigation/nodes/NodeTableContainer.php deleted file mode 100644 index 8928fb01..00000000 --- a/#pma/libraries/navigation/nodes/NodeTableContainer.php +++ /dev/null @@ -1,55 +0,0 @@ -icon = PMA\libraries\Util::getImage('b_browse.png', __('Tables')); - $this->links = array( - 'text' => 'db_structure.php?server=' . $GLOBALS['server'] - . '&db=%1$s&tbl_type=table' - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'db_structure.php?server=' . $GLOBALS['server'] - . '&db=%1$s&tbl_type=table' - . '&token=' . $_SESSION[' PMA_token '], - ); - $this->real_name = 'tables'; - $this->classes = 'tableContainer subContainer'; - - $new_label = _pgettext('Create new table', 'New'); - $new = NodeFactory::getInstance( - 'Node', - $new_label - ); - $new->isNew = true; - $new->icon = PMA\libraries\Util::getImage('b_table_add.png', $new_label); - $new->links = array( - 'text' => 'tbl_create.php?server=' . $GLOBALS['server'] - . '&db=%2$s&token=' . $_SESSION[' PMA_token '], - 'icon' => 'tbl_create.php?server=' . $GLOBALS['server'] - . '&db=%2$s&token=' . $_SESSION[' PMA_token '], - ); - $new->classes = 'new_table italics'; - $this->addChild($new); - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeTrigger.php b/#pma/libraries/navigation/nodes/NodeTrigger.php deleted file mode 100644 index ee0960ba..00000000 --- a/#pma/libraries/navigation/nodes/NodeTrigger.php +++ /dev/null @@ -1,42 +0,0 @@ -icon = PMA\libraries\Util::getImage('b_triggers.png'); - $this->links = array( - 'text' => 'db_triggers.php?server=' . $GLOBALS['server'] - . '&db=%3$s&item_name=%1$s&edit_item=1' - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'db_triggers.php?server=' . $GLOBALS['server'] - . '&db=%3$s&item_name=%1$s&export_item=1' - . '&token=' . $_SESSION[' PMA_token '], - ); - $this->classes = 'trigger'; - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeTriggerContainer.php b/#pma/libraries/navigation/nodes/NodeTriggerContainer.php deleted file mode 100644 index 5d1e643a..00000000 --- a/#pma/libraries/navigation/nodes/NodeTriggerContainer.php +++ /dev/null @@ -1,55 +0,0 @@ -icon = PMA\libraries\Util::getImage('b_triggers.png'); - $this->links = array( - 'text' => 'db_triggers.php?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s&token=' - . $_SESSION[' PMA_token '], - 'icon' => 'db_triggers.php?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s&token=' - . $_SESSION[' PMA_token '], - ); - $this->real_name = 'triggers'; - - $new = NodeFactory::getInstance( - 'Node', - _pgettext('Create new trigger', 'New') - ); - $new->isNew = true; - $new->icon = PMA\libraries\Util::getImage('b_trigger_add.png', ''); - $new->links = array( - 'text' => 'db_triggers.php?server=' . $GLOBALS['server'] - . '&db=%3$s&token=' . $_SESSION[' PMA_token '] - . '&add_item=1', - 'icon' => 'db_triggers.php?server=' . $GLOBALS['server'] - . '&db=%3$s&token=' . $_SESSION[' PMA_token '] - . '&add_item=1', - ); - $new->classes = 'new_trigger italics'; - $this->addChild($new); - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeView.php b/#pma/libraries/navigation/nodes/NodeView.php deleted file mode 100644 index 80407972..00000000 --- a/#pma/libraries/navigation/nodes/NodeView.php +++ /dev/null @@ -1,52 +0,0 @@ -icon = PMA\libraries\Util::getImage('b_props.png', __('View')); - $this->links = array( - 'text' => 'sql.php?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s&pos=0' - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] - . '&db=%2$s&table=%1$s' - . '&token=' . $_SESSION[' PMA_token '], - ); - $this->classes = 'view'; - } - - /** - * Returns the type of the item represented by the node. - * - * @return string type of the item - */ - protected function getItemType() - { - return 'view'; - } -} - diff --git a/#pma/libraries/navigation/nodes/NodeViewContainer.php b/#pma/libraries/navigation/nodes/NodeViewContainer.php deleted file mode 100644 index 89dfbe77..00000000 --- a/#pma/libraries/navigation/nodes/NodeViewContainer.php +++ /dev/null @@ -1,55 +0,0 @@ -icon = PMA\libraries\Util::getImage('b_views.png', __('Views')); - $this->links = array( - 'text' => 'db_structure.php?server=' . $GLOBALS['server'] - . '&db=%1$s&tbl_type=view' - . '&token=' . $_SESSION[' PMA_token '], - 'icon' => 'db_structure.php?server=' . $GLOBALS['server'] - . '&db=%1$s&tbl_type=view' - . '&token=' . $_SESSION[' PMA_token '], - ); - $this->classes = 'viewContainer subContainer'; - $this->real_name = 'views'; - - $new_label = _pgettext('Create new view', 'New'); - $new = NodeFactory::getInstance( - 'Node', - $new_label - ); - $new->isNew = true; - $new->icon = PMA\libraries\Util::getImage('b_view_add.png', $new_label); - $new->links = array( - 'text' => 'view_create.php?server=' . $GLOBALS['server'] - . '&db=%2$s&token=' . $_SESSION[' PMA_token '], - 'icon' => 'view_create.php?server=' . $GLOBALS['server'] - . '&db=%2$s&token=' . $_SESSION[' PMA_token '], - ); - $new->classes = 'new_view italics'; - $this->addChild($new); - } -} - diff --git a/#pma/libraries/normalization.lib.php b/#pma/libraries/normalization.lib.php deleted file mode 100644 index 36e866ac..00000000 --- a/#pma/libraries/normalization.lib.php +++ /dev/null @@ -1,979 +0,0 @@ -getColumns(); - $columnTypeList = $types[$colTypeCategory]; - } - $GLOBALS['dbi']->selectDb($db, $GLOBALS['userlink']); - $columns = $GLOBALS['dbi']->getColumns( - $db, $table, null, - true, $GLOBALS['userlink'] - ); - $type = ""; - $selectColHtml = ""; - foreach ($columns as $column => $def) { - if (isset($def['Type'])) { - $extracted_columnspec = Util::extractColumnSpec($def['Type']); - $type = $extracted_columnspec['type']; - } - if (empty($columnTypeList) - || in_array(mb_strtoupper($type), $columnTypeList) - ) { - if ($listType == 'checkbox') { - $selectColHtml .= '' - . htmlspecialchars($column) . ' [ ' - . htmlspecialchars($def['Type']) . ' ]
    '; - } else { - $selectColHtml .= ''; - } - } - } - return $selectColHtml; -} - -/** - * get the html of the form to add the new column to given table - * - * @param integer $num_fields number of columns to add - * @param string $db current database - * @param string $table current table - * @param array $columnMeta array containing default values for the fields - * - * @return string HTML - */ -function PMA_getHtmlForCreateNewColumn( - $num_fields, $db, $table, $columnMeta=array() -) { - $cfgRelation = PMA_getRelationsParam(); - $content_cells = array(); - $available_mime = array(); - $mime_map = array(); - if ($cfgRelation['mimework'] && $GLOBALS['cfg']['BrowseMIME']) { - $mime_map = PMA_getMIME($db, $table); - $available_mime = PMA_getAvailableMIMEtypes(); - } - $comments_map = PMA_getComments($db, $table); - for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) { - $content_cells[$columnNumber] = array( - 'columnNumber' => $columnNumber, - 'columnMeta' => $columnMeta, - 'type_upper' => '', - 'length_values_input_size' => 8, - 'length' => '', - 'extracted_columnspec' => array(), - 'submit_attribute' => null, - 'comments_map' => $comments_map, - 'fields_meta' => null, - 'is_backup' => true, - 'move_columns' => array(), - 'cfgRelation' => $cfgRelation, - 'available_mime' => isset($available_mime)?$available_mime:array(), - 'mime_map' => $mime_map - ); - } - - return PMA\libraries\Template::get( - 'columns_definitions/table_fields_definitions' - ) - ->render( - array( - 'is_backup' => true, - 'fields_meta' => null, - 'mimework' => $cfgRelation['mimework'], - 'content_cells' => $content_cells - ) - ); -} -/** - * build the html for step 1.1 of normalization - * - * @param string $db current database - * @param string $table current table - * @param string $normalizedTo up to which step normalization will go, - * possible values 1nf|2nf|3nf - * - * @return string HTML for step 1.1 - */ -function PMA_getHtmlFor1NFStep1($db, $table, $normalizedTo) -{ - $step = 1; - $stepTxt = __('Make all columns atomic'); - $html = "

    " - . __('First step of normalization (1NF)') . "

    "; - $html .= "
    " . - "
    " . - "" . __('Step 1.') . $step . " " . $stepTxt . "" . - "

    " . __( - 'Do you have any column which can be split into more than' - . ' one column? ' - . 'For example: address can be split into street, city, country and zip.' - ) - . "
    ( " - . __( - 'Show me the central list of columns that are not already in this table' - ) . " )

    " - . "

    " . __( - 'Select a column which can be split into more ' - . 'than one (on select of \'no such column\', it\'ll move to next step).' - ) - . "

    " - . "
    " - . "" - . "" . __('split into ') - . "" - . "
    " - . "
    " - . "
    " - . "
    " - . "
    "; - return $html; -} - -/** - * build the html contents of various html elements in step 1.2 - * - * @param string $db current database - * @param string $table current table - * - * @return string HTML contents for step 1.2 - */ -function PMA_getHtmlContentsFor1NFStep2($db, $table) -{ - $step = 2; - $stepTxt = __('Have a primary key'); - $primary = PMA\libraries\Index::getPrimary($table, $db); - $hasPrimaryKey = "0"; - $legendText = __('Step 1.') . $step . " " . $stepTxt; - $extra = ''; - if ($primary) { - $headText = __("Primary key already exists."); - $subText = __("Taking you to next step…"); - $hasPrimaryKey = "1"; - } else { - $headText = __( - "There is no primary key; please add one.
    " - . "Hint: A primary key is a column " - . "(or combination of columns) that uniquely identify all rows." - ); - $subText = '' - . Util::getIcon( - 'b_index_add.png', __( - 'Add a primary key on existing column(s)' - ) - ) - . ''; - $extra = __( - "If it's not possible to make existing " - . "column combinations as primary key" - ) . "
    " - . '' - . __('+ Add a new primary key column') . ''; - } - $res = array( - 'legendText' => $legendText, - 'headText' => $headText, - 'subText' => $subText, - 'hasPrimaryKey' => $hasPrimaryKey, - 'extra' => $extra - ); - return $res; -} - -/** - * build the html contents of various html elements in step 1.4 - * - * @param string $db current database - * @param string $table current table - * - * @return string HTML contents for step 1.4 - */ -function PMA_getHtmlContentsFor1NFStep4($db, $table) -{ - $step = 4; - $stepTxt = __('Remove redundant columns'); - $legendText = __('Step 1.') . $step . " " . $stepTxt; - $headText = __( - "Do you have a group of columns which on combining gives an existing" - . " column? For example, if you have first_name, last_name and" - . " full_name then combining first_name and last_name gives full_name" - . " which is redundant." - ); - $subText = __( - "Check the columns which are redundant and click on remove. " - . "If no redundant column, click on 'No redundant column'" - ); - $extra = PMA_getHtmlForColumnsList($db, $table, 'all', "checkbox") . "
    " - . '' - . ''; - $res = array( - 'legendText' => $legendText, - 'headText' => $headText, - 'subText' => $subText, - 'extra' => $extra - ); - return $res; -} - -/** - * build the html contents of various html elements in step 1.3 - * - * @param string $db current database - * @param string $table current table - * - * @return string HTML contents for step 1.3 - */ -function PMA_getHtmlContentsFor1NFStep3($db, $table) -{ - $step = 3; - $stepTxt = __('Move repeating groups'); - $legendText = __('Step 1.') . $step . " " . $stepTxt; - $headText = __( - "Do you have a group of two or more columns that are closely " - . "related and are all repeating the same attribute? For example, " - . "a table that holds data on books might have columns such as book_id, " - . "author1, author2, author3 and so on which form a " - . "repeating group. In this case a new table (book_id, author) should " - . "be created." - ); - $subText = __( - "Check the columns which form a repeating group. " - . "If no such group, click on 'No repeating group'" - ); - $extra = PMA_getHtmlForColumnsList($db, $table, 'all', "checkbox") . "
    " - . '' - . ''; - $primary = PMA\libraries\Index::getPrimary($table, $db); - $primarycols = $primary->getColumns(); - $pk = array(); - foreach ($primarycols as $col) { - $pk[] = $col->getName(); - } - $res = array( - 'legendText' => $legendText, - 'headText' => $headText, - 'subText' => $subText, - 'extra' => $extra, - 'primary_key' => json_encode($pk) - ); - return $res; -} - -/** - * build html contents for 2NF step 2.1 - * - * @param string $db current database - * @param string $table current table - * - * @return string HTML contents for 2NF step 2.1 - */ -function PMA_getHtmlFor2NFstep1($db, $table) -{ - $legendText = __('Step 2.') . "1 " . __('Find partial dependencies'); - $primary = PMA\libraries\Index::getPrimary($table, $db); - $primarycols = $primary->getColumns(); - $pk = array(); - $subText = ''; - $selectPkForm = ""; - $extra = ""; - foreach ($primarycols as $col) { - $pk[] = $col->getName(); - $selectPkForm .= '' - . htmlspecialchars($col->getName()); - } - $key = implode(', ', $pk); - if (count($primarycols) > 1) { - $GLOBALS['dbi']->selectDb($db, $GLOBALS['userlink']); - $columns = (array) $GLOBALS['dbi']->getColumnNames( - $db, $table, $GLOBALS['userlink'] - ); - if (count($pk) == count($columns)) { - $headText = sprintf( - __( - 'No partial dependencies possible as ' - . 'no non-primary column exists since primary key ( %1$s ) ' - . 'is composed of all the columns in the table.' - ), htmlspecialchars($key) - ) . '
    '; - $extra = '

    ' . __('Table is already in second normal form.') - . '

    '; - } else { - $headText = sprintf( - __( - 'The primary key ( %1$s ) consists of more than one column ' - . 'so we need to find the partial dependencies.' - ), htmlspecialchars($key) - ) . '
    ' . __( - 'Please answer the following question(s) ' - . 'carefully to obtain a correct normalization.' - ) - . '
    ' . __( - '+ Show me the possible partial dependencies ' - . 'based on data in the table' - ) . ''; - $subText = __( - 'For each column below, ' - . 'please select the minimal set of columns among given set ' - . 'whose values combined together are sufficient' - . ' to determine the value of the column.' - ); - $cnt = 0; - foreach ($columns as $column) { - if (!in_array($column, $pk)) { - $cnt++; - $extra .= "" . sprintf( - __('\'%1$s\' depends on:'), htmlspecialchars($column) - ) . "
    "; - $extra .= '
    ' - . $selectPkForm . '


    '; - } - } - } - } else { - $headText = sprintf( - __( - 'No partial dependencies possible as the primary key' - . ' ( %1$s ) has just one column.' - ), htmlspecialchars($key) - ) . '
    '; - $extra = '

    ' . __('Table is already in second normal form.') . '

    '; - } - $res = array( - 'legendText' => $legendText, - 'headText' => $headText, - 'subText' => $subText, - 'extra' => $extra, - 'primary_key' => $key - ); - return $res; -} - -/** - * build the html for showing the tables to have in order to put current table in 2NF - * - * @param array $partialDependencies array containing all the dependencies - * @param string $table current table - * - * @return string HTML - */ -function PMA_getHtmlForNewTables2NF($partialDependencies,$table) -{ - $html = '

    ' . sprintf( - __( - 'In order to put the ' - . 'original table \'%1$s\' into Second normal form we need ' - . 'to create the following tables:' - ), htmlspecialchars($table) - ) . '

    '; - $tableName = $table; - $i = 1; - foreach ($partialDependencies as $key=>$dependents) { - $html .= '

    ' - . '( ' . htmlspecialchars($key) . '' - . (count($dependents)>0?', ':'') - . htmlspecialchars(implode(', ', $dependents)) . ' )'; - $i++; - $tableName = 'table' . $i; - } - return $html; -} - -/** - * create/alter the tables needed for 2NF - * - * @param array $partialDependencies array containing all the partial dependencies - * @param object $tablesName name of new tables - * @param string $table current table - * @param string $db current database - * - * @return array - */ -function PMA_createNewTablesFor2NF($partialDependencies, $tablesName, $table, $db) -{ - $dropCols = false; - $nonPKCols = array(); - $queries = array(); - $error = false; - $headText = '

    ' . sprintf( - __('The second step of normalization is complete for table \'%1$s\'.'), - htmlspecialchars($table) - ) . '

    '; - if (count((array)$partialDependencies) == 1) { - return array( - 'legendText'=>__('End of step'), 'headText'=>$headText, - 'queryError'=>$error - ); - } - $message = ''; - $GLOBALS['dbi']->selectDb($db, $GLOBALS['userlink']); - foreach ($partialDependencies as $key=>$dependents) { - if ($tablesName->$key != $table) { - $backquotedKey = implode(', ', Util::backquote(explode(', ', $key))); - $queries[] = 'CREATE TABLE ' . Util::backquote($tablesName->$key) - . ' SELECT DISTINCT ' . $backquotedKey - . (count($dependents)>0?', ':'') - . implode(',', Util::backquote($dependents)) - . ' FROM ' . Util::backquote($table) . ';'; - $queries[] = 'ALTER TABLE ' . Util::backquote($tablesName->$key) - . ' ADD PRIMARY KEY(' . $backquotedKey . ');'; - $nonPKCols = array_merge($nonPKCols, $dependents); - } else { - $dropCols = true; - } - } - - if ($dropCols) { - $query = 'ALTER TABLE ' . Util::backquote($table); - foreach ($nonPKCols as $col) { - $query .= ' DROP ' . Util::backquote($col) . ','; - } - $query = trim($query, ', '); - $query .= ';'; - $queries[] = $query; - } else { - $queries[] = 'DROP TABLE ' . Util::backquote($table); - } - foreach ($queries as $query) { - if (!$GLOBALS['dbi']->tryQuery($query, $GLOBALS['userlink'])) { - $message = Message::error(__('Error in processing!')); - $message->addMessage('

    '); - $message->addMessage( - Message::rawError( - $GLOBALS['dbi']->getError($GLOBALS['userlink']) - ) - ); - $error = true; - break; - } - } - return array( - 'legendText' => __('End of step'), - 'headText' => $headText, - 'queryError' => $error, - 'extra' => $message - ); -} - -/** - * build the html for showing the new tables to have in order - * to put given tables in 3NF - * - * @param object $dependencies containing all the dependencies - * @param array $tables tables formed after 2NF and need to convert to 3NF - * @param string $db current database - * - * @return array containing html and the list of new tables - */ -function PMA_getHtmlForNewTables3NF($dependencies, $tables, $db) -{ - $html = ""; - $i = 1; - $newTables = array(); - foreach ($tables as $table=>$arrDependson) { - if (count(array_unique($arrDependson)) == 1) { - continue; - } - $primary = PMA\libraries\Index::getPrimary($table, $db); - $primarycols = $primary->getColumns(); - $pk = array(); - foreach ($primarycols as $col) { - $pk[] = $col->getName(); - } - $html .= '

    ' . sprintf( - __( - 'In order to put the ' - . 'original table \'%1$s\' into Third normal form we need ' - . 'to create the following tables:' - ), htmlspecialchars($table) - ) . '

    '; - $tableName = $table; - $columnList = array(); - foreach ($arrDependson as $key) { - $dependents = $dependencies->$key; - if ($key == $table) { - $key = implode(', ', $pk); - } - $tmpTableCols =array_merge(explode(', ', $key), $dependents); - sort($tmpTableCols); - if (!in_array($tmpTableCols, $columnList)) { - $columnList[] = $tmpTableCols; - $html .= '

    ' - . '( ' . htmlspecialchars($key) . '' - . (count($dependents)>0?', ':'') - . htmlspecialchars(implode(', ', $dependents)) . ' )'; - $newTables[$table][$tableName] = array( - "pk"=>$key, "nonpk"=>implode(', ', $dependents) - ); - $i++; - $tableName = 'table' . $i; - } - } - } - return array('html' => $html, 'newTables' => $newTables); -} - -/** - * create new tables or alter existing to get 3NF - * - * @param array $newTables list of new tables to be created - * @param string $db current database - * - * @return array - */ -function PMA_createNewTablesFor3NF($newTables, $db) -{ - $queries = array(); - $dropCols = false; - $error = false; - $headText = '

    ' . - __('The third step of normalization is complete.') - . '

    '; - if (count((array)$newTables) == 0) { - return array( - 'legendText'=>__('End of step'), 'headText'=>$headText, - 'queryError'=>$error - ); - } - $message = ''; - $GLOBALS['dbi']->selectDb($db, $GLOBALS['userlink']); - foreach ($newTables as $originalTable=>$tablesList) { - foreach ($tablesList as $table=>$cols) { - if ($table != $originalTable) { - $quotedPk = implode( - ', ', Util::backquote(explode(', ', $cols->pk)) - ); - $quotedNonpk = implode( - ', ', Util::backquote(explode(', ', $cols->nonpk)) - ); - $queries[] = 'CREATE TABLE ' . Util::backquote($table) - . ' SELECT DISTINCT ' . $quotedPk - . ', ' . $quotedNonpk - . ' FROM ' . Util::backquote($originalTable) . ';'; - $queries[] = 'ALTER TABLE ' . Util::backquote($table) - . ' ADD PRIMARY KEY(' . $quotedPk . ');'; - } else { - $dropCols = $cols; - } - } - if ($dropCols) { - $columns = (array) $GLOBALS['dbi']->getColumnNames( - $db, $originalTable, $GLOBALS['userlink'] - ); - $colPresent = array_merge( - explode(', ', $dropCols->pk), explode(', ', $dropCols->nonpk) - ); - $query = 'ALTER TABLE ' . Util::backquote($originalTable); - foreach ($columns as $col) { - if (!in_array($col, $colPresent)) { - $query .= ' DROP ' . Util::backquote($col) . ','; - } - } - $query = trim($query, ', '); - $query .= ';'; - $queries[] = $query; - } else { - $queries[] = 'DROP TABLE ' . Util::backquote($originalTable); - } - $dropCols = false; - } - foreach ($queries as $query) { - if (!$GLOBALS['dbi']->tryQuery($query, $GLOBALS['userlink'])) { - $message = Message::error(__('Error in processing!')); - $message->addMessage('

    '); - $message->addMessage( - Message::rawError( - $GLOBALS['dbi']->getError($GLOBALS['userlink']) - ) - ); - $error = true; - break; - } - } - return array( - 'legendText' => __('End of step'), - 'headText' => $headText, - 'queryError' => $error, - 'extra' => $message - ); -} -/** - * move the repeating group of columns to a new table - * - * @param string $repeatingColumns comma separated list of repeating group columns - * @param string $primary_columns comma separated list of column in primary key - * of $table - * @param string $newTable name of the new table to be created - * @param string $newColumn name of the new column in the new table - * @param string $table current table - * @param string $db current database - * - * @return array - */ -function PMA_moveRepeatingGroup( - $repeatingColumns, $primary_columns, $newTable, $newColumn, $table, $db -) { - $repeatingColumnsArr = (array)Util::backquote( - explode(', ', $repeatingColumns) - ); - $primary_columns = implode( - ',', Util::backquote(explode(',', $primary_columns)) - ); - $query1 = 'CREATE TABLE ' . Util::backquote($newTable); - $query2 = 'ALTER TABLE ' . Util::backquote($table); - $message = Message::success( - sprintf( - __('Selected repeating group has been moved to the table \'%s\''), - htmlspecialchars($table) - ) - ); - $first = true; - $error = false; - foreach ($repeatingColumnsArr as $repeatingColumn) { - if (!$first) { - $query1 .= ' UNION '; - } - $first = false; - $query1 .= ' SELECT ' . $primary_columns . ',' . $repeatingColumn - . ' as ' . Util::backquote($newColumn) - . ' FROM ' . Util::backquote($table); - $query2 .= ' DROP ' . $repeatingColumn . ','; - } - $query2 = trim($query2, ','); - $queries = array($query1, $query2); - $GLOBALS['dbi']->selectDb($db, $GLOBALS['userlink']); - foreach ($queries as $query) { - if (!$GLOBALS['dbi']->tryQuery($query, $GLOBALS['userlink'])) { - $message = Message::error(__('Error in processing!')); - $message->addMessage('

    '); - $message->addMessage( - Message::rawError( - $GLOBALS['dbi']->getError($GLOBALS['userlink']) - ) - ); - $error = true; - break; - } - } - return array( - 'queryError' => $error, 'message' => $message - ); -} - -/** - * build html for 3NF step 1 to find the transitive dependencies - * - * @param string $db current database - * @param array $tables tables formed after 2NF and need to process for 3NF - * - * @return string - */ -function PMA_getHtmlFor3NFstep1($db, $tables) -{ - $legendText = __('Step 3.') . "1 " . __('Find transitive dependencies'); - $extra = ""; - $headText = __( - 'Please answer the following question(s) ' - . 'carefully to obtain a correct normalization.' - ); - $subText = __( - 'For each column below, ' - . 'please select the minimal set of columns among given set ' - . 'whose values combined together are sufficient' - . ' to determine the value of the column.
    ' - . 'Note: A column may have no transitive dependency, ' - . 'in that case you don\'t have to select any.' - ); - $cnt = 0; - foreach ($tables as $table) { - $primary = PMA\libraries\Index::getPrimary($table, $db); - $primarycols = $primary->getColumns(); - $selectTdForm = ""; - $pk = array(); - foreach ($primarycols as $col) { - $pk[] = $col->getName(); - } - $GLOBALS['dbi']->selectDb($db, $GLOBALS['userlink']); - $columns = (array) $GLOBALS['dbi']->getColumnNames( - $db, $table, $GLOBALS['userlink'] - ); - if (count($columns) - count($pk) <= 1) { - continue; - } - foreach ($columns as $column) { - if (!in_array($column, $pk)) { - $selectTdForm .= '' - . '' . htmlspecialchars($column) . ''; - } - } - foreach ($columns as $column) { - if (!in_array($column, $pk)) { - $cnt++; - $extra .= "" . sprintf( - __('\'%1$s\' depends on:'), htmlspecialchars($column) - ) - . "
    "; - $extra .= '
    ' - . $selectTdForm - . '


    '; - } - } - } - if ($extra == "") { - $headText = __( - "No Transitive dependencies possible as the table " - . "doesn't have any non primary key columns" - ); - $subText = ""; - $extra = "

    " . __("Table is already in Third normal form!") . "

    "; - } - $res = array( - 'legendText' => $legendText, - 'headText' => $headText, - 'subText' => $subText, - 'extra' => $extra - ); - return $res; -} -/** - * get html for options to normalize table - * - * @return string HTML - */ -function PMA_getHtmlForNormalizetable() -{ - $html_output = '
    ' - . PMA_URL_getHiddenInputs($GLOBALS['db'], $GLOBALS['table']) - . ''; - $html_output .= '
    '; - $html_output .= '' - . __('Improve table structure (Normalization):') . ''; - $html_output .= '

    ' . __('Select up to what step you want to normalize') - . '

    '; - $choices = array( - '1nf' => __('First step of normalization (1NF)'), - '2nf' => __('Second step of normalization (1NF+2NF)'), - '3nf' => __('Third step of normalization (1NF+2NF+3NF)')); - - $html_output .= Util::getRadioFields( - 'normalizeTo', $choices, '1nf', true - ); - $html_output .= '
    ' - . "" . __( - 'Hint: Please follow the procedure carefully in order ' - . 'to obtain correct normalization' - ) . "" - . '' - . '
    ' - . '
    ' - . '
    '; - - return $html_output; -} - -/** - * find all the possible partial dependencies based on data in the table. - * - * @param string $table current table - * @param string $db current database - * - * @return string HTML containing the list of all the possible partial dependencies - */ -function PMA_findPartialDependencies($table, $db) -{ - $dependencyList = array(); - $GLOBALS['dbi']->selectDb($db, $GLOBALS['userlink']); - $columns = (array) $GLOBALS['dbi']->getColumnNames( - $db, $table, $GLOBALS['userlink'] - ); - $columns = (array)Util::backquote($columns); - $totalRowsRes = $GLOBALS['dbi']->fetchResult( - 'SELECT COUNT(*) FROM (SELECT * FROM ' - . Util::backquote($table) . ' LIMIT 500) as dt;' - ); - $totalRows = $totalRowsRes[0]; - $primary = PMA\libraries\Index::getPrimary($table, $db); - $primarycols = $primary->getColumns(); - $pk = array(); - foreach ($primarycols as $col) { - $pk[] = Util::backquote($col->getName()); - } - $partialKeys = PMA_getAllCombinationPartialKeys($pk); - $distinctValCount = PMA_findDistinctValuesCount( - array_unique( - array_merge($columns, $partialKeys) - ), $table - ); - foreach ($columns as $column) { - if (!in_array($column, $pk)) { - foreach ($partialKeys as $partialKey) { - if ($partialKey - && PMA_checkPartialDependency( - $partialKey, $column, $table, - $distinctValCount[$partialKey], - $distinctValCount[$column], $totalRows - ) - ) { - $dependencyList[$partialKey][] = $column; - } - } - } - } - - $html = __( - 'This list is based on a subset of the table\'s data ' - . 'and is not necessarily accurate. ' - ) - . '
    '; - foreach ($dependencyList as $dependon=>$colList) { - $html .= '' - . '' - . '' - . htmlspecialchars(str_replace('`', '', $dependon)) . ' -> ' - . '' - . htmlspecialchars(str_replace('`', '', implode(', ', $colList))) - . '' - . ''; - } - if (empty($dependencyList)) { - $html .= '

    ' - . __('No partial dependencies found!') . '

    '; - } - $html .= '
    '; - return $html; -} -/** - * check whether a particular column is dependent on given subset of primary key - * - * @param string $partialKey the partial key, subset of primary key, - * each column in key supposed to be backquoted - * @param string $column backquoted column on whose dependency being checked - * @param string $table current table - * @param integer $pkCnt distinct value count for given partial key - * @param integer $colCnt distinct value count for given column - * @param integer $totalRows total distinct rows count of the table - * - * @return boolean TRUE if $column is dependent on $partialKey, False otherwise - */ -function PMA_checkPartialDependency( - $partialKey, $column, $table, $pkCnt, $colCnt, $totalRows -) { - $query = 'SELECT ' - . 'COUNT(DISTINCT ' . $partialKey . ',' . $column . ') as pkColCnt ' - . 'FROM (SELECT * FROM ' . Util::backquote($table) - . ' LIMIT 500) as dt' . ';'; - $res = $GLOBALS['dbi']->fetchResult($query, null, null, $GLOBALS['userlink']); - $pkColCnt = $res[0]; - if ($pkCnt && $pkCnt == $colCnt && $colCnt == $pkColCnt) { - return true; - } - if ($totalRows && $totalRows == $pkCnt) { - return true; - } - return false; -} - -/** - * function to get distinct values count of all the column in the array $columns - * - * @param array $columns array of backquoted columns whose distinct values - * need to be counted. - * @param string $table table to which these columns belong - * - * @return array associative array containing the count - */ -function PMA_findDistinctValuesCount($columns, $table) -{ - $result = array(); - $query = 'SELECT '; - foreach ($columns as $column) { - if ($column) { //each column is already backquoted - $query .= 'COUNT(DISTINCT ' . $column . ') as \'' - . $column . '_cnt\', '; - } - } - $query = trim($query, ', '); - $query .= ' FROM (SELECT * FROM ' . Util::backquote($table) - . ' LIMIT 500) as dt' . ';'; - $res = $GLOBALS['dbi']->fetchResult($query, null, null, $GLOBALS['userlink']); - foreach ($columns as $column) { - if ($column) { - $result[$column] = $res[0][$column . '_cnt']; - } - } - return $result; -} - -/** - * find all the possible partial keys - * - * @param array $primaryKey array containing all the column present in primary key - * - * @return array containing all the possible partial keys(subset of primary key) - */ -function PMA_getAllCombinationPartialKeys($primaryKey) -{ - $results = array(''); - foreach ($primaryKey as $element) { - foreach ($results as $combination) { - array_push( - $results, trim($element . ',' . $combination, ',') - ); - } - } - array_pop($results); //remove key which consist of all primary key columns - return $results; -} diff --git a/#pma/libraries/opendocument.lib.php b/#pma/libraries/opendocument.lib.php deleted file mode 100644 index 71305d86..00000000 --- a/#pma/libraries/opendocument.lib.php +++ /dev/null @@ -1,167 +0,0 @@ - addFile($mime, 'mimetype'); - $zipfile -> addFile($data, 'content.xml'); - $zipfile -> addFile( - '' - . '' - . '' - . 'phpMyAdmin ' . PMA_VERSION . '' - . 'phpMyAdmin ' . PMA_VERSION - . '' - . '' . strftime('%Y-%m-%dT%H:%M:%S') - . '' - . '' - . '', - 'meta.xml' - ); - $zipfile -> addFile( - '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '', - 'styles.xml' - ); - $zipfile -> addFile( - '' - . '' - . '' - . '' - . '' - . '' - . '', - 'META-INF/manifest.xml' - ); - return $zipfile -> file(); -} diff --git a/#pma/libraries/operations.lib.php b/#pma/libraries/operations.lib.php deleted file mode 100644 index 358bd8a2..00000000 --- a/#pma/libraries/operations.lib.php +++ /dev/null @@ -1,2164 +0,0 @@ -' - . '
    ' - . PMA_URL_getHiddenInputs($db) - . '
    ' - . ''; - if (PMA\libraries\Util::showIcons('ActionLinksMode')) { - $html_output .= PMA\libraries\Util::getImage('b_comment.png') . ' '; - } - $html_output .= __('Database comment'); - $html_output .= ''; - $html_output .= '' - . '
    '; - $html_output .= '
    ' - . '' - . '
    ' - . '
    ' - . '
    '; - - return $html_output; -} - -/** - * Get HTML output for rename database - * - * @param string $db database name - * - * @return string $html_output - */ -function PMA_getHtmlForRenameDatabase($db) -{ - $html_output = '
    ' - . '
    '; - if (isset($_REQUEST['db_collation'])) { - $html_output .= '' . "\n"; - } - $html_output .= '' - . '' - . PMA_URL_getHiddenInputs($db) - . '
    ' - . ''; - - if (PMA\libraries\Util::showIcons('ActionLinksMode')) { - $html_output .= PMA\libraries\Util::getImage('b_edit.png') . ' '; - } - $html_output .= __('Rename database to') - . ''; - - $html_output .= ''; - - if ($GLOBALS['db_priv'] && $GLOBALS['table_priv'] - && $GLOBALS['col_priv'] && $GLOBALS['proc_priv'] - && $GLOBALS['is_reload_priv'] - ) { - $html_output .= ''; - } else { - $html_output .= ''; - } - - $html_output .= '
    '; - - $html_output .= '' - . '
    ' - . '
    ' - . '' - . '
    ' - . '
    ' - . '
    '; - - return $html_output; -} - -/** - * Get HTML for database drop link - * - * @param string $db database name - * - * @return string $html_output - */ -function PMA_getHtmlForDropDatabaseLink($db) -{ - $this_sql_query = 'DROP DATABASE ' . PMA\libraries\Util::backquote($db); - $this_url_params = array( - 'sql_query' => $this_sql_query, - 'back' => 'db_operations.php', - 'goto' => 'index.php', - 'reload' => '1', - 'purge' => '1', - 'message_to_show' => sprintf( - __('Database %s has been dropped.'), - htmlspecialchars(PMA\libraries\Util::backquote($db)) - ), - 'db' => null, - ); - - $html_output = '
    ' - . '
    '; - $html_output .= ''; - if (PMA\libraries\Util::showIcons('ActionLinksMode')) { - $html_output .= PMA\libraries\Util::getImage('b_deltbl.png') . ' '; - } - $html_output .= __('Remove database') - . ''; - $html_output .= '
      '; - $html_output .= PMA_getDeleteDataOrTablelink( - $this_url_params, - 'DROP_DATABASE', - __('Drop the database (DROP)'), - 'drop_db_anchor' - ); - $html_output .= '
    ' - . '
    '; - - return $html_output; -} - -/** - * Get HTML snippet for copy database - * - * @param string $db database name - * - * @return string $html_output - */ -function PMA_getHtmlForCopyDatabase($db) -{ - $drop_clause = 'DROP TABLE / DROP VIEW'; - $choices = array( - 'structure' => __('Structure only'), - 'data' => __('Structure and data'), - 'dataonly' => __('Data only') - ); - - if (isset($_COOKIE) - && isset($_COOKIE['pma_switch_to_new']) - && $_COOKIE['pma_switch_to_new'] == 'true' - ) { - $pma_switch_to_new = 'true'; - } - - $html_output = '
    '; - $html_output .= '
    '; - - if (isset($_REQUEST['db_collation'])) { - $html_output .= '' . "\n"; - } - $html_output .= '' . "\n" - . PMA_URL_getHiddenInputs($db); - $html_output .= '
    ' - . ''; - - if (PMA\libraries\Util::showIcons('ActionLinksMode')) { - $html_output .= PMA\libraries\Util::getImage('b_edit.png') . ' '; - } - $html_output .= __('Copy database to') - . '' - . '
    ' - . PMA\libraries\Util::getRadioFields( - 'what', $choices, 'data', true - ); - $html_output .= '
    '; - $html_output .= ''; - $html_output .= '
    '; - $html_output .= ''; - $html_output .= '
    '; - $html_output .= ''; - $html_output .= '
    '; - $html_output .= ''; - $html_output .= '
    '; - $html_output .= '
    '; - - if ($GLOBALS['db_priv'] && $GLOBALS['table_priv'] - && $GLOBALS['col_priv'] && $GLOBALS['proc_priv'] - && $GLOBALS['is_reload_priv'] - ) { - $html_output .= ''; - } else { - $html_output .= ''; - } - $html_output .= '
    '; - - $html_output .= ''; - $html_output .= '' - . '
    '; - $html_output .= '
    ' - . '' - . '
    ' - . '
    ' - . '
    '; - - return $html_output; -} - -/** - * Get HTML snippet for change database charset - * - * @param string $db database name - * @param string $table table name - * - * @return string $html_output - */ -function PMA_getHtmlForChangeDatabaseCharset($db, $table) -{ - $html_output = '
    ' - . '
    '; - if (PMA\libraries\Util::showIcons('ActionLinksMode')) { - $html_output .= PMA\libraries\Util::getImage('s_asci.png') . ' '; - } - $html_output .= '' . "\n" - . '' . "\n" - . PMA_generateCharsetDropdownBox( - PMA_CSDROPDOWN_COLLATION, - 'db_collation', - 'select_db_collation', - isset($_REQUEST['db_collation']) ? $_REQUEST['db_collation'] : '', - false - ) - . '' - . '
    ' - . '' . "\n" - . '
    ' . "\n" - . '
    ' . "\n"; - - return $html_output; -} - -/** - * Run the Procedure definitions and function definitions - * - * to avoid selecting alternatively the current and new db - * we would need to modify the CREATE definitions to qualify - * the db name - * - * @param string $db database name - * - * @return void - */ -function PMA_runProcedureAndFunctionDefinitions($db) -{ - $procedure_names = $GLOBALS['dbi']->getProceduresOrFunctions($db, 'PROCEDURE'); - if ($procedure_names) { - foreach ($procedure_names as $procedure_name) { - $GLOBALS['dbi']->selectDb($db); - $tmp_query = $GLOBALS['dbi']->getDefinition( - $db, 'PROCEDURE', $procedure_name - ); - // collect for later display - $GLOBALS['sql_query'] .= "\n" . $tmp_query; - $GLOBALS['dbi']->selectDb($_REQUEST['newname']); - $GLOBALS['dbi']->query($tmp_query); - } - } - - $function_names = $GLOBALS['dbi']->getProceduresOrFunctions($db, 'FUNCTION'); - if ($function_names) { - foreach ($function_names as $function_name) { - $GLOBALS['dbi']->selectDb($db); - $tmp_query = $GLOBALS['dbi']->getDefinition( - $db, 'FUNCTION', $function_name - ); - // collect for later display - $GLOBALS['sql_query'] .= "\n" . $tmp_query; - $GLOBALS['dbi']->selectDb($_REQUEST['newname']); - $GLOBALS['dbi']->query($tmp_query); - } - } -} - -/** - * Create database before copy - * - * @return void - */ -function PMA_createDbBeforeCopy() -{ - // lower_case_table_names=1 `DB` becomes `db` - $lowerCaseTableNames = $GLOBALS['dbi']->fetchValue( - 'SELECT @@lower_case_table_names' - ); - if ($lowerCaseTableNames === '1') { - $_REQUEST['newname'] = mb_strtolower( - $_REQUEST['newname'] - ); - } - - $local_query = 'CREATE DATABASE IF NOT EXISTS ' - . PMA\libraries\Util::backquote($_REQUEST['newname']); - if (isset($_REQUEST['db_collation'])) { - $local_query .= ' DEFAULT' - . PMA_generateCharsetQueryPart($_REQUEST['db_collation']); - } - $local_query .= ';'; - $GLOBALS['sql_query'] .= $local_query; - - // save the original db name because Tracker.php which - // may be called under $GLOBALS['dbi']->query() changes $GLOBALS['db'] - // for some statements, one of which being CREATE DATABASE - $original_db = $GLOBALS['db']; - $GLOBALS['dbi']->query($local_query); - $GLOBALS['db'] = $original_db; - - // Set the SQL mode to NO_AUTO_VALUE_ON_ZERO to prevent MySQL from creating - // export statements it cannot import - $sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'"; - $GLOBALS['dbi']->query($sql_set_mode); - - // rebuild the database list because Table::moveCopy - // checks in this list if the target db exists - $GLOBALS['dblist']->databases->build(); -} - -/** - * Get views as an array and create SQL view stand-in - * - * @param array $tables_full array of all tables in given db or dbs - * @param ExportSql $export_sql_plugin export plugin instance - * @param string $db database name - * - * @return array $views - */ -function PMA_getViewsAndCreateSqlViewStandIn( - $tables_full, $export_sql_plugin, $db -) { - $views = array(); - foreach ($tables_full as $each_table => $tmp) { - // to be able to rename a db containing views, - // first all the views are collected and a stand-in is created - // the real views are created after the tables - if ($GLOBALS['dbi']->getTable($db, $each_table)->isView()) { - - // If view exists, and 'add drop view' is selected: Drop it! - if ($_REQUEST['what'] != 'nocopy' - && isset($_REQUEST['drop_if_exists']) - && $_REQUEST['drop_if_exists'] == 'true' - ) { - $drop_query = 'DROP VIEW IF EXISTS ' - . PMA\libraries\Util::backquote($_REQUEST['newname']) . '.' - . PMA\libraries\Util::backquote($each_table); - $GLOBALS['dbi']->query($drop_query); - - $GLOBALS['sql_query'] .= "\n" . $drop_query . ';'; - } - - $views[] = $each_table; - // Create stand-in definition to resolve view dependencies - $sql_view_standin = $export_sql_plugin->getTableDefStandIn( - $db, $each_table, "\n" - ); - $GLOBALS['dbi']->selectDb($_REQUEST['newname']); - $GLOBALS['dbi']->query($sql_view_standin); - $GLOBALS['sql_query'] .= "\n" . $sql_view_standin; - } - } - return $views; -} - -/** - * Get sql query for copy/rename table and boolean for whether copy/rename or not - * - * @param array $tables_full array of all tables in given db or dbs - * @param boolean $move whether database name is empty or not - * @param string $db database name - * - * @return array SQL queries for the constraints - */ -function PMA_copyTables($tables_full, $move, $db) -{ - $sqlContraints = array(); - foreach ($tables_full as $each_table => $tmp) { - // skip the views; we have created stand-in definitions - if ($GLOBALS['dbi']->getTable($db, $each_table)->isView()) { - continue; - } - - // value of $what for this table only - $this_what = $_REQUEST['what']; - - // do not copy the data from a Merge table - // note: on the calling FORM, 'data' means 'structure and data' - if ($GLOBALS['dbi']->getTable($db, $each_table)->isMerge()) { - if ($this_what == 'data') { - $this_what = 'structure'; - } - if ($this_what == 'dataonly') { - $this_what = 'nocopy'; - } - } - - if ($this_what != 'nocopy') { - // keep the triggers from the original db+table - // (third param is empty because delimiters are only intended - // for importing via the mysql client or our Import feature) - $triggers = $GLOBALS['dbi']->getTriggers($db, $each_table, ''); - - if (! Table::moveCopy( - $db, $each_table, $_REQUEST['newname'], $each_table, - (isset($this_what) ? $this_what : 'data'), - $move, 'db_copy' - )) { - $GLOBALS['_error'] = true; - break; - } - // apply the triggers to the destination db+table - if ($triggers) { - $GLOBALS['dbi']->selectDb($_REQUEST['newname']); - foreach ($triggers as $trigger) { - $GLOBALS['dbi']->query($trigger['create']); - $GLOBALS['sql_query'] .= "\n" . $trigger['create'] . ';'; - } - } - - // this does not apply to a rename operation - if (isset($_REQUEST['add_constraints']) - && ! empty($GLOBALS['sql_constraints_query']) - ) { - $sqlContraints[] = $GLOBALS['sql_constraints_query']; - unset($GLOBALS['sql_constraints_query']); - } - } - } - return $sqlContraints; -} - -/** - * Run the EVENT definition for selected database - * - * to avoid selecting alternatively the current and new db - * we would need to modify the CREATE definitions to qualify - * the db name - * - * @param string $db database name - * - * @return void - */ -function PMA_runEventDefinitionsForDb($db) -{ - $event_names = $GLOBALS['dbi']->fetchResult( - 'SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' - . $GLOBALS['dbi']->escapeString($db) . '\';' - ); - if ($event_names) { - foreach ($event_names as $event_name) { - $GLOBALS['dbi']->selectDb($db); - $tmp_query = $GLOBALS['dbi']->getDefinition($db, 'EVENT', $event_name); - // collect for later display - $GLOBALS['sql_query'] .= "\n" . $tmp_query; - $GLOBALS['dbi']->selectDb($_REQUEST['newname']); - $GLOBALS['dbi']->query($tmp_query); - } - } -} - -/** - * Handle the views, return the boolean value whether table rename/copy or not - * - * @param array $views views as an array - * @param boolean $move whether database name is empty or not - * @param string $db database name - * - * @return void - */ -function PMA_handleTheViews($views, $move, $db) -{ - // temporarily force to add DROP IF EXIST to CREATE VIEW query, - // to remove stand-in VIEW that was created earlier - // ( $_REQUEST['drop_if_exists'] is used in moveCopy() ) - if (isset($_REQUEST['drop_if_exists'])) { - $temp_drop_if_exists = $_REQUEST['drop_if_exists']; - } - - $_REQUEST['drop_if_exists'] = 'true'; - foreach ($views as $view) { - $copying_succeeded = Table::moveCopy( - $db, $view, $_REQUEST['newname'], $view, 'structure', $move, 'db_copy' - ); - if (! $copying_succeeded) { - $GLOBALS['_error'] = true; - break; - } - } - unset($_REQUEST['drop_if_exists']); - - if (isset($temp_drop_if_exists)) { - // restore previous value - $_REQUEST['drop_if_exists'] = $temp_drop_if_exists; - } -} - -/** - * Adjust the privileges after Renaming the db - * - * @param string $oldDb Database name before renaming - * @param string $newname New Database name requested - * - * @return void - */ -function PMA_AdjustPrivileges_moveDB($oldDb, $newname) -{ - if ($GLOBALS['db_priv'] && $GLOBALS['table_priv'] - && $GLOBALS['col_priv'] && $GLOBALS['proc_priv'] - && $GLOBALS['is_reload_priv'] - ) { - $GLOBALS['dbi']->selectDb('mysql'); - $newname = str_replace("_", "\_", $newname); - $oldDb = str_replace("_", "\_", $oldDb); - - // For Db specific privileges - $query_db_specific = 'UPDATE ' . Util::backquote('db') - . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newname) - . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\';'; - $GLOBALS['dbi']->query($query_db_specific); - - // For table specific privileges - $query_table_specific = 'UPDATE ' . Util::backquote('tables_priv') - . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newname) - . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\';'; - $GLOBALS['dbi']->query($query_table_specific); - - // For column specific privileges - $query_col_specific = 'UPDATE ' . Util::backquote('columns_priv') - . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newname) - . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\';'; - $GLOBALS['dbi']->query($query_col_specific); - - // For procedures specific privileges - $query_proc_specific = 'UPDATE ' . Util::backquote('procs_priv') - . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newname) - . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\';'; - $GLOBALS['dbi']->query($query_proc_specific); - - // Finally FLUSH the new privileges - $flush_query = "FLUSH PRIVILEGES;"; - $GLOBALS['dbi']->query($flush_query); - } -} - -/** - * Adjust the privileges after Copying the db - * - * @param string $oldDb Database name before copying - * @param string $newname New Database name requested - * - * @return void - */ -function PMA_AdjustPrivileges_copyDB($oldDb, $newname) -{ - if ($GLOBALS['db_priv'] && $GLOBALS['table_priv'] - && $GLOBALS['col_priv'] && $GLOBALS['proc_priv'] - && $GLOBALS['is_reload_priv'] - ) { - $GLOBALS['dbi']->selectDb('mysql'); - $newname = str_replace("_", "\_", $newname); - $oldDb = str_replace("_", "\_", $oldDb); - - $query_db_specific_old = 'SELECT * FROM ' - . Util::backquote('db') . ' WHERE ' - . 'Db = "' . $oldDb . '";'; - - $old_privs_db = $GLOBALS['dbi']->fetchResult($query_db_specific_old, 0); - - foreach ($old_privs_db as $old_priv) { - $newDb_db_privs_query = 'INSERT INTO ' . Util::backquote('db') - . ' VALUES("' . $old_priv[0] . '", "' . $newname . '", "' - . $old_priv[2] . '", "' . $old_priv[3] . '", "' . $old_priv[4] - . '", "' . $old_priv[5] . '", "' . $old_priv[6] . '", "' - . $old_priv[7] . '", "' . $old_priv[8] . '", "' . $old_priv[9] - . '", "' . $old_priv[10] . '", "' . $old_priv[11] . '", "' - . $old_priv[12] . '", "' . $old_priv[13] . '", "' . $old_priv[14] - . '", "' . $old_priv[15] . '", "' . $old_priv[16] . '", "' - . $old_priv[17] . '", "' . $old_priv[18] . '", "' . $old_priv[19] - . '", "' . $old_priv[20] . '", "' . $old_priv[21] . '");'; - - $GLOBALS['dbi']->query($newDb_db_privs_query); - } - - // For Table Specific privileges - $query_table_specific_old = 'SELECT * FROM ' - . Util::backquote('tables_priv') . ' WHERE ' - . 'Db = "' . $oldDb . '";'; - - $old_privs_table = $GLOBALS['dbi']->fetchResult( - $query_table_specific_old, - 0 - ); - - foreach ($old_privs_table as $old_priv) { - $newDb_table_privs_query = 'INSERT INTO ' . Util::backquote( - 'tables_priv' - ) . ' VALUES("' . $old_priv[0] . '", "' . $newname . '", "' - . $old_priv[2] . '", "' . $old_priv[3] . '", "' . $old_priv[4] - . '", "' . $old_priv[5] . '", "' . $old_priv[6] . '", "' - . $old_priv[7] . '");'; - - $GLOBALS['dbi']->query($newDb_table_privs_query); - } - - // For Column Specific privileges - $query_col_specific_old = 'SELECT * FROM ' - . Util::backquote('columns_priv') . ' WHERE ' - . 'Db = "' . $oldDb . '";'; - - $old_privs_col = $GLOBALS['dbi']->fetchResult( - $query_col_specific_old, - 0 - ); - - foreach ($old_privs_col as $old_priv) { - $newDb_col_privs_query = 'INSERT INTO ' . Util::backquote( - 'columns_priv' - ) . ' VALUES("' . $old_priv[0] . '", "' . $newname . '", "' - . $old_priv[2] . '", "' . $old_priv[3] . '", "' . $old_priv[4] - . '", "' . $old_priv[5] . '", "' . $old_priv[6] . '");'; - - $GLOBALS['dbi']->query($newDb_col_privs_query); - } - - // For Procedure Specific privileges - $query_proc_specific_old = 'SELECT * FROM ' - . Util::backquote('procs_priv') . ' WHERE ' - . 'Db = "' . $oldDb . '";'; - - $old_privs_proc = $GLOBALS['dbi']->fetchResult( - $query_proc_specific_old, - 0 - ); - - foreach ($old_privs_proc as $old_priv) { - $newDb_proc_privs_query = 'INSERT INTO ' . Util::backquote( - 'procs_priv' - ) . ' VALUES("' . $old_priv[0] . '", "' . $newname . '", "' - . $old_priv[2] . '", "' . $old_priv[3] . '", "' . $old_priv[4] - . '", "' . $old_priv[5] . '", "' . $old_priv[6] . '", "' - . $old_priv[7] . '");'; - - $GLOBALS['dbi']->query($newDb_proc_privs_query); - } - - // Finally FLUSH the new privileges - $flush_query = "FLUSH PRIVILEGES;"; - $GLOBALS['dbi']->query($flush_query); - } -} - -/** - * Create all accumulated constraints - * - * @param array $sqlConstratints array of sql constraints for the database - * - * @return void - */ -function PMA_createAllAccumulatedConstraints($sqlConstratints) -{ - $GLOBALS['dbi']->selectDb($_REQUEST['newname']); - foreach ($sqlConstratints as $one_query) { - $GLOBALS['dbi']->query($one_query); - // and prepare to display them - $GLOBALS['sql_query'] .= "\n" . $one_query; - } -} - -/** - * Duplicate the bookmarks for the db (done once for each db) - * - * @param boolean $_error whether table rename/copy or not - * @param string $db database name - * - * @return void - */ -function PMA_duplicateBookmarks($_error, $db) -{ - if (! $_error && $db != $_REQUEST['newname']) { - $get_fields = array('user', 'label', 'query'); - $where_fields = array('dbase' => $db); - $new_fields = array('dbase' => $_REQUEST['newname']); - Table::duplicateInfo( - 'bookmarkwork', 'bookmark', $get_fields, - $where_fields, $new_fields - ); - } -} - -/** - * Get the HTML snippet for order the table - * - * @param array $columns columns array - * - * @return string $html_out - */ -function PMA_getHtmlForOrderTheTable($columns) -{ - $html_output = '
    '; - $html_output .= '
    '; - $html_output .= PMA_URL_getHiddenInputs( - $GLOBALS['db'], $GLOBALS['table'] - ); - $html_output .= '
    ' - . '' . __('Alter table order by') . '' - . ' ' . __('(singly)') . ' ' - . '
    ' - . '' - . '' - . '' - . '' - . '
    ' - . '
    ' - . '' - . '' - . '
    ' - . '
    ' - . '
    '; - - return $html_output; -} - -/** - * Get the HTML snippet for move table - * - * @return string $html_output - */ -function PMA_getHtmlForMoveTable() -{ - $html_output = '
    '; - $html_output .= '
    ' - . PMA_URL_getHiddenInputs($GLOBALS['db'], $GLOBALS['table']); - - $html_output .= '' - . '' - . '
    '; - - $html_output .= '' . __('Move table to (database.table)') - . ''; - - if (count($GLOBALS['dblist']->databases) > $GLOBALS['cfg']['MaxDbList']) { - $html_output .= ''; - } else { - $html_output .= ''; - } - $html_output .= ' . '; - $html_output .= '
    '; - - // starting with MySQL 5.0.24, SHOW CREATE TABLE includes the AUTO_INCREMENT - // next value but users can decide if they want it or not for the operation - - $html_output .= '' - . '
    '; - - if ($GLOBALS['table_priv'] && $GLOBALS['col_priv'] - && $GLOBALS['is_reload_priv'] - ) { - $html_output .= ''; - } else { - $html_output .= ''; - } - $html_output .= '
    '; - - $html_output .= '
    ' - . '' - . '
    ' - . '
    ' - . '
    '; - - return $html_output; -} - -/** - * Get the HTML div for Table option - * - * @param string $comment Comment - * @param array $tbl_collation table collation - * @param string $tbl_storage_engine table storage engine - * @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not - * @param boolean $is_isam whether ISAM or not - * @param string $pack_keys pack keys - * @param string $auto_increment value of auto increment - * @param string $delay_key_write delay key write - * @param string $transactional value of transactional - * @param string $page_checksum value of page checksum - * @param boolean $is_innodb whether INNODB or not - * @param boolean $is_pbxt whether PBXT or not - * @param boolean $is_aria whether ARIA or not - * @param string $checksum the checksum - * - * @return string $html_output - */ -function PMA_getTableOptionDiv($comment, $tbl_collation, $tbl_storage_engine, - $is_myisam_or_aria, $is_isam, $pack_keys, $auto_increment, $delay_key_write, - $transactional, $page_checksum, $is_innodb, $is_pbxt, $is_aria, $checksum -) { - $html_output = '
    '; - $html_output .= '
    ' - . '' - . '' - . '
    ' - . '
    '; - - return $html_output; -} - -/** - * Get HTML for the rename table part of table options - * - * @return string $html_output - */ -function PMA_getHtmlForRenameTable() -{ - $html_output = '' . __('Rename table to') . '' - . '' - . '' - . '' - . ''; - - if ($GLOBALS['table_priv'] && $GLOBALS['col_priv'] - && $GLOBALS['is_reload_priv'] - ) { - $html_output .= ''; - } else { - $html_output .= ''; - } - $html_output .= ''; - - $html_output .= ''; - return $html_output; -} - -/** - * Get HTML for the table comments part of table options - * - * @param string $current_value of the table comments - * - * @return string $html_output - */ -function PMA_getHtmlForTableComments($current_value) -{ - $commentLength = PMA_MYSQL_INT_VERSION >= 50503 ? 2048 : 60; - $html_output = '' . __('Table comments') . '' - . '' - . '' - . '' - . ''; - - return $html_output; -} - -/** - * Get HTML for the PACK KEYS part of table options - * - * @param string $current_value of the pack keys option - * - * @return string $html_output - */ -function PMA_getHtmlForPackKeys($current_value) -{ - $html_output = '' - . '' - . '' - . '' - . ''; - - if ($is_myisam_or_aria || $is_isam) { - $html_output .= PMA_getHtmlForPackKeys($pack_keys); - } // end if (MYISAM|ISAM) - - if ($is_myisam_or_aria) { - $html_output .= PMA_getHtmlForTableRow( - 'new_checksum', - 'CHECKSUM', - $checksum - ); - - $html_output .= PMA_getHtmlForTableRow( - 'new_delay_key_write', - 'DELAY_KEY_WRITE', - $delay_key_write - ); - } // end if (MYISAM) - - if ($is_aria) { - $html_output .= PMA_getHtmlForTableRow( - 'new_transactional', - 'TRANSACTIONAL', - $transactional - ); - - $html_output .= PMA_getHtmlForTableRow( - 'new_page_checksum', - 'PAGE_CHECKSUM', - $page_checksum - ); - } // end if (ARIA) - - if (mb_strlen($auto_increment) > 0 - && ($is_myisam_or_aria || $is_innodb || $is_pbxt) - ) { - $html_output .= '' - . '' - . '' - . ' '; - } // end if (MYISAM|INNODB) - - $possible_row_formats = PMA_getPossibleRowFormat(); - - // for MYISAM there is also COMPRESSED but it can be set only by the - // myisampack utility, so don't offer here the choice because if we - // try it inside an ALTER TABLE, MySQL (at least in 5.1.23-maria) - // does not return a warning - // (if the table was compressed, it can be seen on the Structure page) - - if (isset($possible_row_formats[$tbl_storage_engine])) { - $current_row_format - = mb_strtoupper($GLOBALS['showtable']['Row_format']); - $html_output .= '' - . '' - . ''; - $html_output .= PMA\libraries\Util::getDropdown( - 'new_row_format', $possible_row_formats[$tbl_storage_engine], - $current_row_format, 'new_row_format' - ); - $html_output .= ''; - } - $html_output .= '' - . ''; - - return $html_output; -} - -/** - * Get the common HTML table row (tr) for new_checksum, new_delay_key_write, - * new_transactional and new_page_checksum - * - * @param string $attribute class, name and id attribute - * @param string $label label value - * @param string $val checksum, delay_key_write, transactional, page_checksum - * - * @return string $html_output - */ -function PMA_getHtmlForTableRow($attribute, $label, $val) -{ - return '' - . '' - . '' - . '' - . '' - . '' - . '' - . ''; -} - -/** - * Get array of possible row formats - * - * @return array $possible_row_formats - */ -function PMA_getPossibleRowFormat() -{ - // the outer array is for engines, the inner array contains the dropdown - // option values as keys then the dropdown option labels - - $possible_row_formats = array( - 'ARCHIVE' => array( - 'COMPRESSED' => 'COMPRESSED', - ), - 'ARIA' => array( - 'FIXED' => 'FIXED', - 'DYNAMIC' => 'DYNAMIC', - 'PAGE' => 'PAGE' - ), - 'MARIA' => array( - 'FIXED' => 'FIXED', - 'DYNAMIC' => 'DYNAMIC', - 'PAGE' => 'PAGE' - ), - 'MYISAM' => array( - 'FIXED' => 'FIXED', - 'DYNAMIC' => 'DYNAMIC' - ), - 'PBXT' => array( - 'FIXED' => 'FIXED', - 'DYNAMIC' => 'DYNAMIC' - ), - 'INNODB' => array( - 'COMPACT' => 'COMPACT', - 'REDUNDANT' => 'REDUNDANT' - ) - ); - - /** @var Innodb $innodbEnginePlugin */ - $innodbEnginePlugin = StorageEngine::getEngine('Innodb'); - $innodbPluginVersion = $innodbEnginePlugin->getInnodbPluginVersion(); - if (!empty($innodbPluginVersion)) { - $innodb_file_format = $innodbEnginePlugin->getInnodbFileFormat(); - } else { - $innodb_file_format = ''; - } - if ('Barracuda' == $innodb_file_format - && $innodbEnginePlugin->supportsFilePerTable() - ) { - $possible_row_formats['INNODB']['DYNAMIC'] = 'DYNAMIC'; - $possible_row_formats['INNODB']['COMPRESSED'] = 'COMPRESSED'; - } - - return $possible_row_formats; -} - -/** - * Get HTML div for copy table - * - * @return string $html_output - */ -function PMA_getHtmlForCopytable() -{ - $html_output = '
    '; - $html_output .= '
    ' - . PMA_URL_getHiddenInputs($GLOBALS['db'], $GLOBALS['table']) - . ''; - - $html_output .= '
    '; - $html_output .= '' - . __('Copy table to (database.table)') . ''; - - if (count($GLOBALS['dblist']->databases) > $GLOBALS['cfg']['MaxDbList']) { - $html_output .= ''; - } else { - $html_output .= ''; - } - $html_output .= ' . '; - $html_output .= '
    '; - - $choices = array( - 'structure' => __('Structure only'), - 'data' => __('Structure and data'), - 'dataonly' => __('Data only') - ); - - $html_output .= PMA\libraries\Util::getRadioFields( - 'what', $choices, 'data', true - ); - $html_output .= '
    '; - - $html_output .= '' - . '
    ' - . '' - . '
    '; - - // display "Add constraints" choice only if there are - // foreign keys - if (PMA_getForeigners($GLOBALS['db'], $GLOBALS['table'], '', 'foreign')) { - $html_output .= ''; - $html_output .= '
    '; - } // endif - - $html_output .= '
    '; - - if ($GLOBALS['table_priv'] && $GLOBALS['col_priv'] - && $GLOBALS['is_reload_priv'] - ) { - $html_output .= ''; - } else { - $html_output .= ''; - } - $html_output .= '
    '; - - if (isset($_COOKIE['pma_switch_to_new']) - && $_COOKIE['pma_switch_to_new'] == 'true' - ) { - $pma_switch_to_new = 'true'; - } - - $html_output .= ''); - $html_output .= '' - . '
    '; - - $html_output .= '
    ' - . '' - . '
    ' - . '
    ' - . '
    '; - - return $html_output; -} - -/** - * Get HTML snippet for table maintenance - * - * @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not - * @param boolean $is_innodb whether innodb or not - * @param boolean $is_berkeleydb whether berkeleydb or not - * @param array $url_params array of URL parameters - * - * @return string $html_output - */ -function PMA_getHtmlForTableMaintenance( - $is_myisam_or_aria, $is_innodb, $is_berkeleydb, $url_params -) { - $html_output = '
    '; - $html_output .= '
    ' - . '' . __('Table maintenance') . ''; - $html_output .= '
      '; - - // Note: BERKELEY (BDB) is no longer supported, starting with MySQL 5.1 - $html_output .= PMA_getListofMaintainActionLink( - $is_myisam_or_aria, $is_innodb, $url_params, $is_berkeleydb - ); - - $html_output .= '
    ' - . '
    ' - . '
    '; - - return $html_output; -} - -/** - * Get HTML 'li' having a link of maintain action - * - * @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not - * @param boolean $is_innodb whether innodb or not - * @param array $url_params array of URL parameters - * @param boolean $is_berkeleydb whether berkeleydb or not - * - * @return string $html_output - */ -function PMA_getListofMaintainActionLink($is_myisam_or_aria, - $is_innodb, $url_params, $is_berkeleydb -) { - $html_output = ''; - - // analyze table - if ($is_innodb || $is_myisam_or_aria || $is_berkeleydb) { - $params = array( - 'sql_query' => 'ANALYZE TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']), - 'table_maintenance' => 'Go', - ); - $html_output .= PMA_getMaintainActionlink( - __('Analyze table'), - $params, - $url_params, - 'ANALYZE_TABLE' - ); - } - - // check table - if ($is_myisam_or_aria || $is_innodb) { - $params = array( - 'sql_query' => 'CHECK TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']), - 'table_maintenance' => 'Go', - ); - $html_output .= PMA_getMaintainActionlink( - __('Check table'), - $params, - $url_params, - 'CHECK_TABLE' - ); - } - - // checksum table - $params = array( - 'sql_query' => 'CHECKSUM TABLE ' - . Util::backquote($GLOBALS['table']), - 'table_maintenance' => 'Go', - ); - $html_output .= PMA_getMaintainActionlink( - __('Checksum table'), - $params, - $url_params, - 'CHECKSUM_TABLE' - ); - - // defragment table - if ($is_innodb) { - $params = array( - 'sql_query' => 'ALTER TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']) - . ' ENGINE = InnoDB;' - ); - $html_output .= PMA_getMaintainActionlink( - __('Defragment table'), - $params, - $url_params, - 'InnoDB_File_Defragmenting' - ); - } - - // flush table - $params = array( - 'sql_query' => 'FLUSH TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']), - 'message_to_show' => sprintf( - __('Table %s has been flushed.'), - htmlspecialchars($GLOBALS['table']) - ), - 'reload' => 1, - ); - $html_output .= PMA_getMaintainActionlink( - __('Flush the table (FLUSH)'), - $params, - $url_params, - 'FLUSH' - ); - - // optimize table - if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { - $params = array( - 'sql_query' => 'OPTIMIZE TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']), - 'table_maintenance' => 'Go', - ); - $html_output .= PMA_getMaintainActionlink( - __('Optimize table'), - $params, - $url_params, - 'OPTIMIZE_TABLE' - ); - } - - // repair table - if ($is_myisam_or_aria) { - $params = array( - 'sql_query' => 'REPAIR TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']), - 'table_maintenance' => 'Go', - ); - $html_output .= PMA_getMaintainActionlink( - __('Repair table'), - $params, - $url_params, - 'REPAIR_TABLE' - ); - } - - return $html_output; -} - -/** - * Get maintain action HTML link - * - * @param string $action_message action message - * @param array $params url parameters array - * @param array $url_params additional url parameters - * @param string $link contains name of page/anchor that is being linked - * - * @return string $html_output - */ -function PMA_getMaintainActionlink($action_message, $params, $url_params, $link) -{ - return '
  • ' - . '' - . $action_message - . '' - . PMA\libraries\Util::showMySQLDocu($link) - . '
  • '; -} - -/** - * Get HTML for Delete data or table (truncate table, drop table) - * - * @param array $truncate_table_url_params url parameter array for truncate table - * @param array $dropTableUrlParams url parameter array for drop table - * - * @return string $html_output - */ -function PMA_getHtmlForDeleteDataOrTable( - $truncate_table_url_params, - $dropTableUrlParams -) { - $html_output = '
    ' - . '
    ' - . '' . __('Delete data or table') . ''; - - $html_output .= '
      '; - - if (! empty($truncate_table_url_params)) { - $html_output .= PMA_getDeleteDataOrTablelink( - $truncate_table_url_params, - 'TRUNCATE_TABLE', - __('Empty the table (TRUNCATE)'), - 'truncate_tbl_anchor' - ); - } - if (!empty($dropTableUrlParams)) { - $html_output .= PMA_getDeleteDataOrTablelink( - $dropTableUrlParams, - 'DROP_TABLE', - __('Delete the table (DROP)'), - 'drop_tbl_anchor' - ); - } - $html_output .= '
    '; - - return $html_output; -} - -/** - * Get the HTML link for Truncate table, Drop table and Drop db - * - * @param array $url_params url parameter array for delete data or table - * @param string $syntax TRUNCATE_TABLE or DROP_TABLE or DROP_DATABASE - * @param string $link link to be shown - * @param string $htmlId id of the link - * - * @return String html output - */ -function PMA_getDeleteDataOrTablelink($url_params, $syntax, $link, $htmlId) -{ - return '
  • ' - . $link . '' - . PMA\libraries\Util::showMySQLDocu($syntax) - . '
  • '; -} - -/** - * Get HTML snippet for partition maintenance - * - * @param array $partition_names array of partition names for a specific db/table - * @param array $url_params url parameters - * - * @return string $html_output - */ -function PMA_getHtmlForPartitionMaintenance($partition_names, $url_params) -{ - $choices = array( - 'ANALYZE' => __('Analyze'), - 'CHECK' => __('Check'), - 'OPTIMIZE' => __('Optimize'), - 'REBUILD' => __('Rebuild'), - 'REPAIR' => __('Repair'), - 'TRUNCATE' => __('Truncate') - ); - - $partition_method = Partition::getPartitionMethod( - $GLOBALS['db'], $GLOBALS['table'] - ); - // add COALESCE or DROP option to choices array depeding on Partition method - if ($partition_method == 'RANGE' - || $partition_method == 'RANGE COLUMNS' - || $partition_method == 'LIST' - || $partition_method == 'LIST COLUMNS' - ) { - $choices['DROP'] = __('Drop'); - } else { - $choices['COALESCE'] = __('Coalesce'); - } - - $html_output = '
    ' - . '
    ' - . PMA_URL_getHiddenInputs($GLOBALS['db'], $GLOBALS['table']) - . '
    ' - . '' - . __('Partition maintenance') - . PMA\libraries\Util::showMySQLDocu('partitioning_maintenance') - . ''; - - $html_select = '' . "\n"; - $html_output .= sprintf(__('Partition %s'), $html_select); - - $html_output .= '
    '; - $html_output .= PMA\libraries\Util::getRadioFields( - 'partition_operation', $choices, 'ANALYZE', false, true, 'floatleft' - ); - $this_url_params = array_merge( - $url_params, - array( - 'sql_query' => 'ALTER TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']) - . ' REMOVE PARTITIONING;' - ) - ); - $html_output .= '

    '; - - $html_output .= '' - . __('Remove partitioning') . ''; - - $html_output .= '
    ' - . '
    ' - . '' - . '' - . '
    ' - . '
    ' - . '
    '; - - return $html_output; -} - -/** - * Get the HTML for Referential Integrity check - * - * @param array $foreign all Relations to foreign tables for a given table - * or optionally a given column in a table - * @param array $url_params array of url parameters - * - * @return string $html_output - */ -function PMA_getHtmlForReferentialIntegrityCheck($foreign, $url_params) -{ - $html_output = '
    ' - . '
    ' - . '' . __('Check referential integrity:') . ''; - - $html_output .= '
      '; - - foreach ($foreign as $master => $arr) { - $join_query = 'SELECT ' - . PMA\libraries\Util::backquote($GLOBALS['table']) . '.*' - . ' FROM ' . PMA\libraries\Util::backquote($GLOBALS['table']) - . ' LEFT JOIN ' - . PMA\libraries\Util::backquote($arr['foreign_db']) - . '.' - . PMA\libraries\Util::backquote($arr['foreign_table']); - if ($arr['foreign_table'] == $GLOBALS['table']) { - $foreign_table = $GLOBALS['table'] . '1'; - $join_query .= ' AS ' . PMA\libraries\Util::backquote($foreign_table); - } else { - $foreign_table = $arr['foreign_table']; - } - $join_query .= ' ON ' - . PMA\libraries\Util::backquote($GLOBALS['table']) . '.' - . PMA\libraries\Util::backquote($master) - . ' = ' - . PMA\libraries\Util::backquote($arr['foreign_db']) - . '.' - . PMA\libraries\Util::backquote($foreign_table) . '.' - . PMA\libraries\Util::backquote($arr['foreign_field']) - . ' WHERE ' - . PMA\libraries\Util::backquote($arr['foreign_db']) - . '.' - . PMA\libraries\Util::backquote($foreign_table) . '.' - . PMA\libraries\Util::backquote($arr['foreign_field']) - . ' IS NULL AND ' - . PMA\libraries\Util::backquote($GLOBALS['table']) . '.' - . PMA\libraries\Util::backquote($master) - . ' IS NOT NULL'; - $this_url_params = array_merge( - $url_params, - array('sql_query' => $join_query) - ); - - $html_output .= '
    • ' - . '' - . $master . ' -> ' . $arr['foreign_db'] . '.' - . $arr['foreign_table'] . '.' . $arr['foreign_field'] - . '
    • ' . "\n"; - } // foreach $foreign - $html_output .= '
    '; - - return $html_output; -} - -/** - * Reorder table based on request params - * - * @return array SQL query and result - */ -function PMA_getQueryAndResultForReorderingTable() -{ - $sql_query = 'ALTER TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']) - . ' ORDER BY ' - . PMA\libraries\Util::backquote(urldecode($_REQUEST['order_field'])); - if (isset($_REQUEST['order_order']) - && $_REQUEST['order_order'] === 'desc' - ) { - $sql_query .= ' DESC'; - } - $sql_query .= ';'; - $result = $GLOBALS['dbi']->query($sql_query); - - return array($sql_query, $result); -} - -/** - * Get table alters array - * - * @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not - * @param boolean $is_isam whether ISAM or not - * @param string $pack_keys pack keys - * @param string $checksum value of checksum - * @param boolean $is_aria whether ARIA or not - * @param string $page_checksum value of page checksum - * @param string $delay_key_write delay key write - * @param boolean $is_innodb whether INNODB or not - * @param boolean $is_pbxt whether PBXT or not - * @param string $row_format row format - * @param string $newTblStorageEngine table storage engine - * @param string $transactional value of transactional - * @param string $tbl_collation collation of the table - * - * @return array $table_alters - */ -function PMA_getTableAltersArray($is_myisam_or_aria, $is_isam, $pack_keys, - $checksum, $is_aria, $page_checksum, $delay_key_write, $is_innodb, - $is_pbxt, $row_format, $newTblStorageEngine, $transactional, $tbl_collation -) { - global $auto_increment; - - $table_alters = array(); - - if (isset($_REQUEST['comment']) - && urldecode($_REQUEST['prev_comment']) !== $_REQUEST['comment'] - ) { - $table_alters[] = 'COMMENT = \'' - . $GLOBALS['dbi']->escapeString($_REQUEST['comment']) . '\''; - } - - if (! empty($newTblStorageEngine) - && mb_strtolower($newTblStorageEngine) !== mb_strtolower($GLOBALS['tbl_storage_engine']) - ) { - $table_alters[] = 'ENGINE = ' . $newTblStorageEngine; - } - if (! empty($_REQUEST['tbl_collation']) - && $_REQUEST['tbl_collation'] !== $tbl_collation - ) { - $table_alters[] = 'DEFAULT ' - . PMA_generateCharsetQueryPart($_REQUEST['tbl_collation']); - } - - if (($is_myisam_or_aria || $is_isam) - && isset($_REQUEST['new_pack_keys']) - && $_REQUEST['new_pack_keys'] != (string)$pack_keys - ) { - $table_alters[] = 'pack_keys = ' . $_REQUEST['new_pack_keys']; - } - - $_REQUEST['new_checksum'] = empty($_REQUEST['new_checksum']) ? '0' : '1'; - if ($is_myisam_or_aria - && $_REQUEST['new_checksum'] !== $checksum - ) { - $table_alters[] = 'checksum = ' . $_REQUEST['new_checksum']; - } - - $_REQUEST['new_transactional'] - = empty($_REQUEST['new_transactional']) ? '0' : '1'; - if ($is_aria - && $_REQUEST['new_transactional'] !== $transactional - ) { - $table_alters[] = 'TRANSACTIONAL = ' . $_REQUEST['new_transactional']; - } - - $_REQUEST['new_page_checksum'] - = empty($_REQUEST['new_page_checksum']) ? '0' : '1'; - if ($is_aria - && $_REQUEST['new_page_checksum'] !== $page_checksum - ) { - $table_alters[] = 'PAGE_CHECKSUM = ' . $_REQUEST['new_page_checksum']; - } - - $_REQUEST['new_delay_key_write'] - = empty($_REQUEST['new_delay_key_write']) ? '0' : '1'; - if ($is_myisam_or_aria - && $_REQUEST['new_delay_key_write'] !== $delay_key_write - ) { - $table_alters[] = 'delay_key_write = ' . $_REQUEST['new_delay_key_write']; - } - - if (($is_myisam_or_aria || $is_innodb || $is_pbxt) - && ! empty($_REQUEST['new_auto_increment']) - && (! isset($auto_increment) - || $_REQUEST['new_auto_increment'] !== $auto_increment) - ) { - $table_alters[] = 'auto_increment = ' - . $GLOBALS['dbi']->escapeString($_REQUEST['new_auto_increment']); - } - - if (! empty($_REQUEST['new_row_format'])) { - $newRowFormat = $_REQUEST['new_row_format']; - $newRowFormatLower = mb_strtolower($newRowFormat); - if (($is_myisam_or_aria || $is_innodb || $is_pbxt) - && (!mb_strlen($row_format) - || $newRowFormatLower !== mb_strtolower($row_format)) - ) { - $table_alters[] = 'ROW_FORMAT = ' - . $GLOBALS['dbi']->escapeString($newRowFormat); - } - } - - return $table_alters; -} - -/** - * set initial value of the set of variables, based on the current table engine - * - * @param string $tbl_storage_engine table storage engine in upper case - * - * @return array ($is_myisam_or_aria, $is_innodb, $is_isam, - * $is_berkeleydb, $is_aria, $is_pbxt) - */ -function PMA_setGlobalVariablesForEngine($tbl_storage_engine) -{ - //Options that apply to MYISAM usually apply to ARIA - $is_myisam_or_aria = ($tbl_storage_engine == 'MYISAM' - || $tbl_storage_engine == 'ARIA' - || $tbl_storage_engine == 'MARIA' - ); - $is_aria = ($tbl_storage_engine == 'ARIA'); - - $is_isam = ($tbl_storage_engine == 'ISAM'); - $is_innodb = ($tbl_storage_engine == 'INNODB'); - $is_berkeleydb = ($tbl_storage_engine == 'BERKELEYDB'); - $is_pbxt = ($tbl_storage_engine == 'PBXT'); - - return array( - $is_myisam_or_aria, $is_innodb, $is_isam, - $is_berkeleydb, $is_aria, $is_pbxt - ); -} - -/** - * Get warning messages array - * - * @return array $warning_messages - */ -function PMA_getWarningMessagesArray() -{ - $warning_messages = array(); - foreach ($GLOBALS['dbi']->getWarnings() as $warning) { - // In MariaDB 5.1.44, when altering a table from Maria to MyISAM - // and if TRANSACTIONAL was set, the system reports an error; - // I discussed with a Maria developer and he agrees that this - // should not be reported with a Level of Error, so here - // I just ignore it. But there are other 1478 messages - // that it's better to show. - if (! ($_REQUEST['new_tbl_storage_engine'] == 'MyISAM' - && $warning['Code'] == '1478' - && $warning['Level'] == 'Error') - ) { - $warning_messages[] = $warning['Level'] . ': #' . $warning['Code'] - . ' ' . $warning['Message']; - } - } - return $warning_messages; -} - -/** - * Get SQL query and result after ran this SQL query for a partition operation - * has been requested by the user - * - * @return array $sql_query, $result - */ -function PMA_getQueryAndResultForPartition() -{ - $sql_query = 'ALTER TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']) . ' ' - . $_REQUEST['partition_operation'] - . ' PARTITION '; - - if ($_REQUEST['partition_operation'] == 'COALESCE') { - $sql_query .= count($_REQUEST['partition_name']); - } else { - $sql_query .= implode(', ', $_REQUEST['partition_name']) . ';'; - } - - $result = $GLOBALS['dbi']->query($sql_query); - - return array($sql_query, $result); -} - -/** - * Adjust the privileges after renaming/moving a table - * - * @param string $oldDb Database name before table renaming/moving table - * @param string $oldTable Table name before table renaming/moving table - * @param string $newDb Database name after table renaming/ moving table - * @param string $newTable Table name after table renaming/moving table - * - * @return void - */ -function PMA_AdjustPrivileges_renameOrMoveTable($oldDb, $oldTable, $newDb, $newTable) -{ - if ($GLOBALS['table_priv'] && $GLOBALS['col_priv'] - && $GLOBALS['is_reload_priv'] - ) { - $GLOBALS['dbi']->selectDb('mysql'); - - // For table specific privileges - $query_table_specific = 'UPDATE ' . Util::backquote('tables_priv') - . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newDb) . '\', Table_name = \'' . $GLOBALS['dbi']->escapeString($newTable) - . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\' AND Table_name = \'' . $GLOBALS['dbi']->escapeString($oldTable) - . '\';'; - $GLOBALS['dbi']->query($query_table_specific); - - // For column specific privileges - $query_col_specific = 'UPDATE ' . Util::backquote('columns_priv') - . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newDb) . '\', Table_name = \'' . $GLOBALS['dbi']->escapeString($newTable) - . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\' AND Table_name = \'' . $GLOBALS['dbi']->escapeString($oldTable) - . '\';'; - $GLOBALS['dbi']->query($query_col_specific); - - // Finally FLUSH the new privileges - $flush_query = "FLUSH PRIVILEGES;"; - $GLOBALS['dbi']->query($flush_query); - } -} - -/** - * Adjust the privileges after copying a table - * - * @param string $oldDb Database name before table copying - * @param string $oldTable Table name before table copying - * @param string $newDb Database name after table copying - * @param string $newTable Table name after table copying - * - * @return void - */ -function PMA_AdjustPrivileges_copyTable($oldDb, $oldTable, $newDb, $newTable) -{ - if ($GLOBALS['table_priv'] && $GLOBALS['col_priv'] - && $GLOBALS['is_reload_priv'] - ) { - $GLOBALS['dbi']->selectDb('mysql'); - - // For Table Specific privileges - $query_table_specific_old = 'SELECT * FROM ' - . Util::backquote('tables_priv') . ' where ' - . 'Db = "' . $oldDb . '" AND Table_name = "' . $oldTable . '";'; - - $old_privs_table = $GLOBALS['dbi']->fetchResult( - $query_table_specific_old, - 0 - ); - - foreach ($old_privs_table as $old_priv) { - $newDb_table_privs_query = 'INSERT INTO ' - . Util::backquote('tables_priv') . ' VALUES("' - . $old_priv[0] . '", "' . $newDb . '", "' . $old_priv[2] . '", "' - . $newTable . '", "' . $old_priv[4] . '", "' . $old_priv[5] - . '", "' . $old_priv[6] . '", "' . $old_priv[7] . '");'; - - $GLOBALS['dbi']->query($newDb_table_privs_query); - } - - // For Column Specific privileges - $query_col_specific_old = 'SELECT * FROM ' - . Util::backquote('columns_priv') . ' WHERE ' - . 'Db = "' . $oldDb . '" AND Table_name = "' . $oldTable . '";'; - - $old_privs_col = $GLOBALS['dbi']->fetchResult( - $query_col_specific_old, - 0 - ); - - foreach ($old_privs_col as $old_priv) { - $newDb_col_privs_query = 'INSERT INTO ' - . Util::backquote('columns_priv') . ' VALUES("' - . $old_priv[0] . '", "' . $newDb . '", "' . $old_priv[2] . '", "' - . $newTable . '", "' . $old_priv[4] . '", "' . $old_priv[5] - . '", "' . $old_priv[6] . '");'; - - $GLOBALS['dbi']->query($newDb_col_privs_query); - } - - // Finally FLUSH the new privileges - $flush_query = "FLUSH PRIVILEGES;"; - $GLOBALS['dbi']->query($flush_query); - } -} - -/** - * Change all collations and character sets of all columns in table - * - * @param string $db Database name - * @param string $table Table name - * @param string $tbl_collation Collation Name - * - * @return void - */ -function PMA_changeAllColumnsCollation($db, $table, $tbl_collation) -{ - $GLOBALS['dbi']->selectDb($db); - - $change_all_collations_query = 'ALTER TABLE ' - . PMA\libraries\Util::backquote($table) - . ' CONVERT TO'; - - list($charset) = explode('_', $tbl_collation); - - $change_all_collations_query .= ' CHARACTER SET ' . $charset - . ($charset == $tbl_collation ? '' : ' COLLATE ' . $tbl_collation); - - $GLOBALS['dbi']->query($change_all_collations_query); -} - -/** - * Move or copy a table - * - * @param string $db current database name - * @param string $table current table name - * - * @return void - */ -function PMA_moveOrCopyTable($db, $table) -{ - /** - * Selects the database to work with - */ - $GLOBALS['dbi']->selectDb($db); - - /** - * $_REQUEST['target_db'] could be empty in case we came from an input field - * (when there are many databases, no drop-down) - */ - if (empty($_REQUEST['target_db'])) { - $_REQUEST['target_db'] = $db; - } - - /** - * A target table name has been sent to this script -> do the work - */ - if (PMA_isValid($_REQUEST['new_name'])) { - if ($db == $_REQUEST['target_db'] && $table == $_REQUEST['new_name']) { - if (isset($_REQUEST['submit_move'])) { - $message = Message::error(__('Can\'t move table to same one!')); - } else { - $message = Message::error(__('Can\'t copy table to same one!')); - } - } else { - Table::moveCopy( - $db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'], - $_REQUEST['what'], isset($_REQUEST['submit_move']), 'one_table' - ); - - if (isset($_REQUEST['adjust_privileges']) - && ! empty($_REQUEST['adjust_privileges']) - ) { - if (isset($_REQUEST['submit_move'])) { - PMA_AdjustPrivileges_renameOrMoveTable( - $db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'] - ); - } else { - PMA_AdjustPrivileges_copyTable( - $db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'] - ); - } - - if (isset($_REQUEST['submit_move'])) { - $message = Message::success( - __( - 'Table %s has been moved to %s. Privileges have been ' - . 'adjusted.' - ) - ); - } else { - $message = Message::success( - __( - 'Table %s has been copied to %s. Privileges have been ' - . 'adjusted.' - ) - ); - } - - } else { - if (isset($_REQUEST['submit_move'])) { - $message = Message::success( - __('Table %s has been moved to %s.') - ); - } else { - $message = Message::success( - __('Table %s has been copied to %s.') - ); - } - } - - $old = PMA\libraries\Util::backquote($db) . '.' - . PMA\libraries\Util::backquote($table); - $message->addParam($old); - $new = PMA\libraries\Util::backquote($_REQUEST['target_db']) . '.' - . PMA\libraries\Util::backquote($_REQUEST['new_name']); - $message->addParam($new); - - /* Check: Work on new table or on old table? */ - if (isset($_REQUEST['submit_move']) - || PMA_isValid($_REQUEST['switch_to_new']) - ) { - } - } - } else { - /** - * No new name for the table! - */ - $message = Message::error(__('The table name is empty!')); - } - - if ($GLOBALS['is_ajax_request'] == true) { - $response = PMA\libraries\Response::getInstance(); - $response->addJSON('message', $message); - if ($message->isSuccess()) { - $response->addJSON('db', $GLOBALS['db']); - } else { - $response->setRequestStatus(false); - } - exit; - } -} diff --git a/#pma/libraries/parse_analyze.lib.php b/#pma/libraries/parse_analyze.lib.php deleted file mode 100644 index 81945467..00000000 --- a/#pma/libraries/parse_analyze.lib.php +++ /dev/null @@ -1,68 +0,0 @@ - 1) { - - /** - * @todo if there are more than one table name in the Select: - * - do not extract the first table name - * - do not show a table name in the page header - * - do not display the sub-pages links) - */ - $table = ''; - } else { - $table = $analyzed_sql_results['select_tables'][0][0]; - if (!empty($analyzed_sql_results['select_tables'][0][1])) { - $db = $analyzed_sql_results['select_tables'][0][1]; - } - } - // There is no point checking if a reload is required if we already decided - // to reload. Also, no reload is required for AJAX requests. - if ((empty($reload)) && (empty($GLOBALS['is_ajax_request']))) { - // NOTE: Database names are case-insensitive. - $reload = strcasecmp($db, $prev_db) != 0; - } - - // Updating the array. - $analyzed_sql_results['reload'] = $reload; - } - - return array($analyzed_sql_results, $db, $table); -} diff --git a/#pma/libraries/php-gettext/gettext.inc b/#pma/libraries/php-gettext/gettext.inc deleted file mode 100644 index 397ce028..00000000 --- a/#pma/libraries/php-gettext/gettext.inc +++ /dev/null @@ -1,550 +0,0 @@ - - Copyright (c) 2009 Danilo Segan - - Drop in replacement for native gettext. - - This file is part of PHP-gettext. - - PHP-gettext is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PHP-gettext is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with PHP-gettext; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ -/* -LC_CTYPE 0 -LC_NUMERIC 1 -LC_TIME 2 -LC_COLLATE 3 -LC_MONETARY 4 -LC_MESSAGES 5 -LC_ALL 6 -*/ - -// LC_MESSAGES is not available if php-gettext is not loaded -// while the other constants are already available from session extension. -if (!defined('LC_MESSAGES')) { - define('LC_MESSAGES', 5); -} - -require('streams.php'); -require('gettext.php'); - - -// Variables - -global $text_domains, $default_domain, $LC_CATEGORIES, $EMULATEGETTEXT, $CURRENTLOCALE; -$text_domains = array(); -$default_domain = 'messages'; -$LC_CATEGORIES = array('LC_CTYPE', 'LC_NUMERIC', 'LC_TIME', 'LC_COLLATE', 'LC_MONETARY', 'LC_MESSAGES', 'LC_ALL'); -$EMULATEGETTEXT = 0; -$CURRENTLOCALE = ''; - -/* Class to hold a single domain included in $text_domains. */ -class domain { - var $l10n; - var $path; - var $codeset; -} - -// Utility functions - -/** - * Return a list of locales to try for any POSIX-style locale specification. - */ -function get_list_of_locales($locale) { - /* Figure out all possible locale names and start with the most - * specific ones. I.e. for sr_CS.UTF-8@latin, look through all of - * sr_CS.UTF-8@latin, sr_CS@latin, sr@latin, sr_CS.UTF-8, sr_CS, sr. - */ - $locale_names = array(); - $lang = NULL; - $country = NULL; - $charset = NULL; - $modifier = NULL; - if ($locale) { - if (preg_match("/^(?P[a-z]{2,3})" // language code - ."(?:_(?P[A-Z]{2}))?" // country code - ."(?:\.(?P[-A-Za-z0-9_]+))?" // charset - ."(?:@(?P[-A-Za-z0-9_]+))?$/", // @ modifier - $locale, $matches)) { - - if (isset($matches["lang"])) $lang = $matches["lang"]; - if (isset($matches["country"])) $country = $matches["country"]; - if (isset($matches["charset"])) $charset = $matches["charset"]; - if (isset($matches["modifier"])) $modifier = $matches["modifier"]; - - if ($modifier) { - if ($country) { - if ($charset) - array_push($locale_names, "${lang}_$country.$charset@$modifier"); - array_push($locale_names, "${lang}_$country@$modifier"); - } elseif ($charset) - array_push($locale_names, "${lang}.$charset@$modifier"); - array_push($locale_names, "$lang@$modifier"); - } - if ($country) { - if ($charset) - array_push($locale_names, "${lang}_$country.$charset"); - array_push($locale_names, "${lang}_$country"); - } elseif ($charset) - array_push($locale_names, "${lang}.$charset"); - array_push($locale_names, $lang); - } - - // If the locale name doesn't match POSIX style, just include it as-is. - if (!in_array($locale, $locale_names)) - array_push($locale_names, $locale); - } - return $locale_names; -} - -/** - * Utility function to get a StreamReader for the given text domain. - */ -function _get_reader($domain=null, $category=5, $enable_cache=true) { - global $text_domains, $default_domain, $LC_CATEGORIES; - if (is_null($domain)) $domain = $default_domain; - if (!isset($text_domains[$domain]->l10n)) { - // get the current locale - $locale = _setlocale(LC_MESSAGES, 0); - $bound_path = isset($text_domains[$domain]->path) ? - $text_domains[$domain]->path : './'; - $subpath = $LC_CATEGORIES[$category] ."/$domain.mo"; - - $locale_names = get_list_of_locales($locale); - $input = null; - foreach ($locale_names as $locale) { - $full_path = $bound_path . $locale . "/" . $subpath; - if (file_exists($full_path)) { - $input = new FileReader($full_path); - break; - } - } - - if (!array_key_exists($domain, $text_domains)) { - // Initialize an empty domain object. - $text_domains[$domain] = new domain(); - } - $text_domains[$domain]->l10n = new gettext_reader($input, - $enable_cache); - } - return $text_domains[$domain]->l10n; -} - -/** - * Returns whether we are using our emulated gettext API or PHP built-in one. - */ -function locale_emulation() { - global $EMULATEGETTEXT; - return $EMULATEGETTEXT; -} - -/** - * Checks if the current locale is supported on this system. - */ -function _check_locale_and_function($function=false) { - global $EMULATEGETTEXT; - if ($function and !function_exists($function)) - return false; - return !$EMULATEGETTEXT; -} - -/** - * Get the codeset for the given domain. - */ -function _get_codeset($domain=null) { - global $text_domains, $default_domain, $LC_CATEGORIES; - if (!isset($domain)) { - $domain = $default_domain; - } - if (isset($text_domains[$domain]->codeset)) { - return $text_domains[$domain]->codeset; - } - if (!empty(ini_get('mbstring.internal_encoding'))) { - return ini_get('mbstring.internal_encoding'); - } - return 'utf-8'; -} - -/** - * Convert the given string to the encoding set by bind_textdomain_codeset. - */ -function _encode($text) { - $source_encoding = 'utf-8'; - if (function_exists('mb_detect_encoding')) { - $source_encoding = mb_detect_encoding($text); - if ($source_encoding === false) { - $source_encoding = 'utf-8'; - } - } - $target_encoding = _get_codeset(); - if ($source_encoding != $target_encoding) { - return mb_convert_encoding($text, $target_encoding, $source_encoding); - } - else { - return $text; - } -} - - -// Custom implementation of the standard gettext related functions - -/** - * Returns passed in $locale, or environment variable $LANG if $locale == ''. - */ -function _get_default_locale($locale) { - if ($locale == '') // emulate variable support - return getenv('LANG'); - else - return $locale; -} - -/** - * Sets a requested locale, if needed emulates it. - */ -function _setlocale($category, $locale) { - global $CURRENTLOCALE, $EMULATEGETTEXT; - if ($locale === 0) { // use === to differentiate between string "0" - if ($CURRENTLOCALE != '') - return $CURRENTLOCALE; - else - // obey LANG variable, maybe extend to support all of LC_* vars - // even if we tried to read locale without setting it first - return _setlocale($category, $CURRENTLOCALE); - } else { - if (function_exists('setlocale')) { - $ret = setlocale($category, $locale); - if (($locale == '' and !$ret) or // failed setting it by env - ($locale != '' and $ret != $locale)) { // failed setting it - // Failed setting it according to environment. - $CURRENTLOCALE = _get_default_locale($locale); - $EMULATEGETTEXT = 1; - } else { - $CURRENTLOCALE = $ret; - $EMULATEGETTEXT = 0; - } - } else { - // No function setlocale(), emulate it all. - $CURRENTLOCALE = _get_default_locale($locale); - $EMULATEGETTEXT = 1; - } - // Allow locale to be changed on the go for one translation domain. - global $text_domains, $default_domain; - if (array_key_exists($default_domain, $text_domains)) { - unset($text_domains[$default_domain]->l10n); - } - return $CURRENTLOCALE; - } -} - -/** - * Sets the path for a domain. - */ -function _bindtextdomain($domain, $path) { - global $text_domains; - // ensure $path ends with a slash ('/' should work for both, but lets still play nice) - if (DIRECTORY_SEPARATOR == '\\') { - if ($path[strlen($path)-1] != '\\' and $path[strlen($path)-1] != '/') - $path .= '\\'; - } else { - if ($path[strlen($path)-1] != '/') - $path .= '/'; - } - if (!array_key_exists($domain, $text_domains)) { - // Initialize an empty domain object. - $text_domains[$domain] = new domain(); - } - $text_domains[$domain]->path = $path; -} - -/** - * Specify the character encoding in which the messages from the DOMAIN message catalog will be returned. - */ -function _bind_textdomain_codeset($domain, $codeset) { - global $text_domains; - $text_domains[$domain]->codeset = $codeset; -} - -/** - * Sets the default domain. - */ -function _textdomain($domain) { - global $default_domain; - $default_domain = $domain; -} - -/** - * Lookup a message in the current domain. - */ -function _gettext($msgid) { - $l10n = _get_reader(); - return _encode($l10n->translate($msgid)); -} - -/** - * Alias for gettext. - */ -function __($msgid) { - return _gettext($msgid); -} - -/** - * Plural version of gettext. - */ -function _ngettext($singular, $plural, $number) { - $l10n = _get_reader(); - return _encode($l10n->ngettext($singular, $plural, $number)); -} - -/** - * Override the current domain. - */ -function _dgettext($domain, $msgid) { - $l10n = _get_reader($domain); - return _encode($l10n->translate($msgid)); -} - -/** - * Plural version of dgettext. - */ -function _dngettext($domain, $singular, $plural, $number) { - $l10n = _get_reader($domain); - return _encode($l10n->ngettext($singular, $plural, $number)); -} - -/** - * Overrides the domain and category for a single lookup. - */ -function _dcgettext($domain, $msgid, $category) { - $l10n = _get_reader($domain, $category); - return _encode($l10n->translate($msgid)); -} -/** - * Plural version of dcgettext. - */ -function _dcngettext($domain, $singular, $plural, $number, $category) { - $l10n = _get_reader($domain, $category); - return _encode($l10n->ngettext($singular, $plural, $number)); -} - -/** - * Context version of gettext. - */ -function _pgettext($context, $msgid) { - $l10n = _get_reader(); - return _encode($l10n->pgettext($context, $msgid)); -} - -/** - * Override the current domain in a context gettext call. - */ -function _dpgettext($domain, $context, $msgid) { - $l10n = _get_reader($domain); - return _encode($l10n->pgettext($context, $msgid)); -} - -/** - * Overrides the domain and category for a single context-based lookup. - */ -function _dcpgettext($domain, $context, $msgid, $category) { - $l10n = _get_reader($domain, $category); - return _encode($l10n->pgettext($context, $msgid)); -} - -/** - * Context version of ngettext. - */ -function _npgettext($context, $singular, $plural) { - $l10n = _get_reader(); - return _encode($l10n->npgettext($context, $singular, $plural)); -} - -/** - * Override the current domain in a context ngettext call. - */ -function _dnpgettext($domain, $context, $singular, $plural) { - $l10n = _get_reader($domain); - return _encode($l10n->npgettext($context, $singular, $plural)); -} - -/** - * Overrides the domain and category for a plural context-based lookup. - */ -function _dcnpgettext($domain, $context, $singular, $plural, $category) { - $l10n = _get_reader($domain, $category); - return _encode($l10n->npgettext($context, $singular, $plural)); -} - - - -// Wrappers to use if the standard gettext functions are available, -// but the current locale is not supported by the system. -// Use the standard impl if the current locale is supported, use the -// custom impl otherwise. - -function T_setlocale($category, $locale) { - return _setlocale($category, $locale); -} - -function T_bindtextdomain($domain, $path) { - if (_check_locale_and_function()) return bindtextdomain($domain, $path); - else return _bindtextdomain($domain, $path); -} -function T_bind_textdomain_codeset($domain, $codeset) { - // bind_textdomain_codeset is available only in PHP 4.2.0+ - if (_check_locale_and_function('bind_textdomain_codeset')) - return bind_textdomain_codeset($domain, $codeset); - else return _bind_textdomain_codeset($domain, $codeset); -} -function T_textdomain($domain) { - if (_check_locale_and_function()) return textdomain($domain); - else return _textdomain($domain); -} -function T_gettext($msgid) { - if (_check_locale_and_function()) return gettext($msgid); - else return _gettext($msgid); -} -function T_($msgid) { - if (_check_locale_and_function()) return _($msgid); - return __($msgid); -} -function T_ngettext($singular, $plural, $number) { - if (_check_locale_and_function()) - return ngettext($singular, $plural, $number); - else return _ngettext($singular, $plural, $number); -} -function T_dgettext($domain, $msgid) { - if (_check_locale_and_function()) return dgettext($domain, $msgid); - else return _dgettext($domain, $msgid); -} -function T_dngettext($domain, $singular, $plural, $number) { - if (_check_locale_and_function()) - return dngettext($domain, $singular, $plural, $number); - else return _dngettext($domain, $singular, $plural, $number); -} -function T_dcgettext($domain, $msgid, $category) { - if (_check_locale_and_function()) - return dcgettext($domain, $msgid, $category); - else return _dcgettext($domain, $msgid, $category); -} -function T_dcngettext($domain, $singular, $plural, $number, $category) { - if (_check_locale_and_function()) - return dcngettext($domain, $singular, $plural, $number, $category); - else return _dcngettext($domain, $singular, $plural, $number, $category); -} - -function T_pgettext($context, $msgid) { - if (_check_locale_and_function('pgettext')) - return pgettext($context, $msgid); - else - return _pgettext($context, $msgid); -} - -function T_dpgettext($domain, $context, $msgid) { - if (_check_locale_and_function('dpgettext')) - return dpgettext($domain, $context, $msgid); - else - return _dpgettext($domain, $context, $msgid); -} - -function T_dcpgettext($domain, $context, $msgid, $category) { - if (_check_locale_and_function('dcpgettext')) - return dcpgettext($domain, $context, $msgid, $category); - else - return _dcpgettext($domain, $context, $msgid, $category); -} - -function T_npgettext($context, $singular, $plural, $number) { - if (_check_locale_and_function('npgettext')) - return npgettext($context, $singular, $plural, $number); - else - return _npgettext($context, $singular, $plural, $number); -} - -function T_dnpgettext($domain, $context, $singular, $plural, $number) { - if (_check_locale_and_function('dnpgettext')) - return dnpgettext($domain, $context, $singular, $plural, $number); - else - return _dnpgettext($domain, $context, $singular, $plural, $number); -} - -function T_dcnpgettext($domain, $context, $singular, $plural, - $number, $category) { - if (_check_locale_and_function('dcnpgettext')) - return dcnpgettext($domain, $context, $singular, - $plural, $number, $category); - else - return _dcnpgettext($domain, $context, $singular, - $plural, $number, $category); -} - - - -// Wrappers used as a drop in replacement for the standard gettext functions - -if (!function_exists('gettext')) { - function bindtextdomain($domain, $path) { - return _bindtextdomain($domain, $path); - } - function bind_textdomain_codeset($domain, $codeset) { - return _bind_textdomain_codeset($domain, $codeset); - } - function textdomain($domain) { - return _textdomain($domain); - } - function gettext($msgid) { - return _gettext($msgid); - } - function _($msgid) { - return __($msgid); - } - function ngettext($singular, $plural, $number) { - return _ngettext($singular, $plural, $number); - } - function dgettext($domain, $msgid) { - return _dgettext($domain, $msgid); - } - function dngettext($domain, $singular, $plural, $number) { - return _dngettext($domain, $singular, $plural, $number); - } - function dcgettext($domain, $msgid, $category) { - return _dcgettext($domain, $msgid, $category); - } - function dcngettext($domain, $singular, $plural, $number, $category) { - return _dcngettext($domain, $singular, $plural, $number, $category); - } - function pgettext($context, $msgid) { - return _pgettext($context, $msgid); - } - function npgettext($context, $singular, $plural, $number) { - return _npgettext($context, $singular, $plural, $number); - } - function dpgettext($domain, $context, $msgid) { - return _dpgettext($domain, $context, $msgid); - } - function dnpgettext($domain, $context, $singular, $plural, $number) { - return _dnpgettext($domain, $context, $singular, $plural, $number); - } - function dcpgettext($domain, $context, $msgid, $category) { - return _dcpgettext($domain, $context, $msgid, $category); - } - function dcnpgettext($domain, $context, $singular, $plural, - $number, $category) { - return _dcnpgettext($domain, $context, $singular, $plural, - $number, $category); - } -} - -?> diff --git a/#pma/libraries/php-gettext/gettext.php b/#pma/libraries/php-gettext/gettext.php deleted file mode 100644 index d712deac..00000000 --- a/#pma/libraries/php-gettext/gettext.php +++ /dev/null @@ -1,431 +0,0 @@ -. - Copyright (c) 2005 Nico Kaiser - - This file is part of PHP-gettext. - - PHP-gettext is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PHP-gettext is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with PHP-gettext; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - -/** - * Provides a simple gettext replacement that works independently from - * the system's gettext abilities. - * It can read MO files and use them for translating strings. - * The files are passed to gettext_reader as a Stream (see streams.php) - * - * This version has the ability to cache all strings and translations to - * speed up the string lookup. - * While the cache is enabled by default, it can be switched off with the - * second parameter in the constructor (e.g. whenusing very large MO files - * that you don't want to keep in memory) - */ -class gettext_reader { - //public: - var $error = 0; // public variable that holds error code (0 if no error) - - //private: - var $BYTEORDER = 0; // 0: low endian, 1: big endian - var $STREAM = NULL; - var $short_circuit = false; - var $enable_cache = false; - var $originals = NULL; // offset of original table - var $translations = NULL; // offset of translation table - var $pluralheader = NULL; // cache header field for plural forms - var $total = 0; // total string count - var $table_originals = NULL; // table for original strings (offsets) - var $table_translations = NULL; // table for translated strings (offsets) - var $cache_translations = NULL; // original -> translation mapping - - - /* Methods */ - - - /** - * Reads a 32bit Integer from the Stream - * - * @access private - * @return Integer from the Stream - */ - function readint() { - if ($this->BYTEORDER == 0) { - // low endian - $input=unpack('V', $this->STREAM->read(4)); - return array_shift($input); - } else { - // big endian - $input=unpack('N', $this->STREAM->read(4)); - return array_shift($input); - } - } - - function read($bytes) { - return $this->STREAM->read($bytes); - } - - /** - * Reads an array of Integers from the Stream - * - * @param int count How many elements should be read - * @return Array of Integers - */ - function readintarray($count) { - if ($this->BYTEORDER == 0) { - // low endian - return unpack('V'.$count, $this->STREAM->read(4 * $count)); - } else { - // big endian - return unpack('N'.$count, $this->STREAM->read(4 * $count)); - } - } - - /** - * Constructor - * - * @param object Reader the StreamReader object - * @param boolean enable_cache Enable or disable caching of strings (default on) - */ - public function __construct($Reader, $enable_cache = true) { - // If there isn't a StreamReader, turn on short circuit mode. - if (! $Reader || isset($Reader->error) ) { - $this->short_circuit = true; - return; - } - - // Caching can be turned off - $this->enable_cache = $enable_cache; - - $MAGIC1 = "\x95\x04\x12\xde"; - $MAGIC2 = "\xde\x12\x04\x95"; - - $this->STREAM = $Reader; - $magic = $this->read(4); - if ($magic == $MAGIC1) { - $this->BYTEORDER = 1; - } elseif ($magic == $MAGIC2) { - $this->BYTEORDER = 0; - } else { - $this->error = 1; // not MO file - return false; - } - - // FIXME: Do we care about revision? We should. - $revision = $this->readint(); - - $this->total = $this->readint(); - $this->originals = $this->readint(); - $this->translations = $this->readint(); - } - - /** - * Loads the translation tables from the MO file into the cache - * If caching is enabled, also loads all strings into a cache - * to speed up translation lookups - * - * @access private - */ - function load_tables() { - if (is_array($this->cache_translations) && - is_array($this->table_originals) && - is_array($this->table_translations)) - return; - - /* get original and translations tables */ - if (!is_array($this->table_originals)) { - $this->STREAM->seekto($this->originals); - $this->table_originals = $this->readintarray($this->total * 2); - } - if (!is_array($this->table_translations)) { - $this->STREAM->seekto($this->translations); - $this->table_translations = $this->readintarray($this->total * 2); - } - - if ($this->enable_cache) { - $this->cache_translations = array (); - /* read all strings in the cache */ - for ($i = 0; $i < $this->total; $i++) { - $this->STREAM->seekto($this->table_originals[$i * 2 + 2]); - $original = $this->STREAM->read($this->table_originals[$i * 2 + 1]); - $this->STREAM->seekto($this->table_translations[$i * 2 + 2]); - $translation = $this->STREAM->read($this->table_translations[$i * 2 + 1]); - $this->cache_translations[$original] = $translation; - } - } - } - - /** - * Returns a string from the "originals" table - * - * @access private - * @param int num Offset number of original string - * @return string Requested string if found, otherwise '' - */ - function get_original_string($num) { - $length = $this->table_originals[$num * 2 + 1]; - $offset = $this->table_originals[$num * 2 + 2]; - if (! $length) - return ''; - $this->STREAM->seekto($offset); - $data = $this->STREAM->read($length); - return (string)$data; - } - - /** - * Returns a string from the "translations" table - * - * @access private - * @param int num Offset number of original string - * @return string Requested string if found, otherwise '' - */ - function get_translation_string($num) { - $length = $this->table_translations[$num * 2 + 1]; - $offset = $this->table_translations[$num * 2 + 2]; - if (! $length) - return ''; - $this->STREAM->seekto($offset); - $data = $this->STREAM->read($length); - return (string)$data; - } - - /** - * Binary search for string - * - * @access private - * @param string string - * @param int start (internally used in recursive function) - * @param int end (internally used in recursive function) - * @return int string number (offset in originals table) - */ - function find_string($string, $start = -1, $end = -1) { - if (($start == -1) or ($end == -1)) { - // find_string is called with only one parameter, set start end end - $start = 0; - $end = $this->total; - } - if (abs($start - $end) <= 1) { - // We're done, now we either found the string, or it doesn't exist - $txt = $this->get_original_string($start); - if ($string == $txt) - return $start; - else - return -1; - } else if ($start > $end) { - // start > end -> turn around and start over - return $this->find_string($string, $end, $start); - } else { - // Divide table in two parts - $half = (int)(($start + $end) / 2); - $cmp = strcmp($string, $this->get_original_string($half)); - if ($cmp == 0) - // string is exactly in the middle => return it - return $half; - else if ($cmp < 0) - // The string is in the upper half - return $this->find_string($string, $start, $half); - else - // The string is in the lower half - return $this->find_string($string, $half, $end); - } - } - - /** - * Translates a string - * - * @access public - * @param string string to be translated - * @return string translated string (or original, if not found) - */ - function translate($string) { - if ($this->short_circuit) - return $string; - $this->load_tables(); - - if ($this->enable_cache) { - // Caching enabled, get translated string from cache - if (array_key_exists($string, $this->cache_translations)) - return $this->cache_translations[$string]; - else - return $string; - } else { - // Caching not enabled, try to find string - $num = $this->find_string($string); - if ($num == -1) - return $string; - else - return $this->get_translation_string($num); - } - } - - /** - * Sanitize plural form expression for use in PHP eval call. - * - * @access private - * @return string sanitized plural form expression - */ - function sanitize_plural_expression($expr) { - // Get rid of disallowed characters. - $expr = preg_replace('@[^a-zA-Z0-9_:;\(\)\?\|\&=!<>+*/\%-]@', '', $expr); - - // Add parenthesis for tertiary '?' operator. - $expr .= ';'; - $res = ''; - $p = 0; - for ($i = 0; $i < strlen($expr); $i++) { - $ch = $expr[$i]; - switch ($ch) { - case '?': - $res .= ' ? ('; - $p++; - break; - case ':': - $res .= ') : ('; - break; - case ';': - $res .= str_repeat( ')', $p) . ';'; - $p = 0; - break; - default: - $res .= $ch; - } - } - return $res; - } - - /** - * Parse full PO header and extract only plural forms line. - * - * @access private - * @return string verbatim plural form header field - */ - function extract_plural_forms_header_from_po_header($header) { - if (preg_match("/(^|\n)plural-forms: ([^\n]*)\n/i", $header, $regs)) - $expr = $regs[2]; - else - $expr = "nplurals=2; plural=n == 1 ? 0 : 1;"; - return $expr; - } - - /** - * Get possible plural forms from MO header - * - * @access private - * @return string plural form header - */ - function get_plural_forms() { - // lets assume message number 0 is header - // this is true, right? - $this->load_tables(); - - // cache header field for plural forms - if (! is_string($this->pluralheader)) { - if ($this->enable_cache) { - $header = $this->cache_translations[""]; - } else { - $header = $this->get_translation_string(0); - } - $expr = $this->extract_plural_forms_header_from_po_header($header); - $this->pluralheader = $this->sanitize_plural_expression($expr); - } - return $this->pluralheader; - } - - /** - * Detects which plural form to take - * - * @access private - * @param n count - * @return int array index of the right plural form - */ - function select_string($n) { - $string = $this->get_plural_forms(); - $string = str_replace('nplurals',"\$total",$string); - $string = str_replace("n",$n,$string); - $string = str_replace('plural',"\$plural",$string); - - $total = 0; - $plural = 0; - - eval("$string"); - if ($plural >= $total) $plural = $total - 1; - return $plural; - } - - /** - * Plural version of gettext - * - * @access public - * @param string single - * @param string plural - * @param string number - * @return translated plural form - */ - function ngettext($single, $plural, $number) { - if ($this->short_circuit) { - if ($number != 1) - return $plural; - else - return $single; - } - - // find out the appropriate form - $select = $this->select_string($number); - - // this should contains all strings separated by NULLs - $key = $single . chr(0) . $plural; - - - if ($this->enable_cache) { - if (! array_key_exists($key, $this->cache_translations)) { - return ($number != 1) ? $plural : $single; - } else { - $result = $this->cache_translations[$key]; - $list = explode(chr(0), $result); - return $list[$select]; - } - } else { - $num = $this->find_string($key); - if ($num == -1) { - return ($number != 1) ? $plural : $single; - } else { - $result = $this->get_translation_string($num); - $list = explode(chr(0), $result); - return $list[$select]; - } - } - } - - function pgettext($context, $msgid) { - $key = $context . chr(4) . $msgid; - $ret = $this->translate($key); - if (strpos($ret, "\004") !== FALSE) { - return $msgid; - } else { - return $ret; - } - } - - function npgettext($context, $singular, $plural, $number) { - $key = $context . chr(4) . $singular; - $ret = $this->ngettext($key, $plural, $number); - if (strpos($ret, "\004") !== FALSE) { - return $singular; - } else { - return $ret; - } - - } -} - diff --git a/#pma/libraries/php-gettext/streams.php b/#pma/libraries/php-gettext/streams.php deleted file mode 100644 index 19cd9b2c..00000000 --- a/#pma/libraries/php-gettext/streams.php +++ /dev/null @@ -1,166 +0,0 @@ -. - - This file is part of PHP-gettext. - - PHP-gettext is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PHP-gettext is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with PHP-gettext; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - - - // Simple class to wrap file streams, string streams, etc. - // seek is essential, and it should be byte stream -class StreamReader { - // should return a string [FIXME: perhaps return array of bytes?] - function read($bytes) { - return false; - } - - // should return new position - function seekto($position) { - return false; - } - - // returns current position - function currentpos() { - return false; - } - - // returns length of entire stream (limit for seekto()s) - function length() { - return false; - } -}; - -class StringReader { - var $_pos; - var $_str; - - public function __construct($str='') { - $this->_str = $str; - $this->_pos = 0; - } - - function read($bytes) { - $data = substr($this->_str, $this->_pos, $bytes); - $this->_pos += $bytes; - if (strlen($this->_str)<$this->_pos) - $this->_pos = strlen($this->_str); - - return $data; - } - - function seekto($pos) { - $this->_pos = $pos; - if (strlen($this->_str)<$this->_pos) - $this->_pos = strlen($this->_str); - return $this->_pos; - } - - function currentpos() { - return $this->_pos; - } - - function length() { - return strlen($this->_str); - } - -}; - - -class FileReader { - var $_pos; - var $_fd; - var $_length; - - public function __construct($filename) { - if (file_exists($filename)) { - - $this->_length=filesize($filename); - $this->_pos = 0; - $this->_fd = fopen($filename,'rb'); - if (!$this->_fd) { - $this->error = 3; // Cannot read file, probably permissions - return false; - } - } else { - $this->error = 2; // File doesn't exist - return false; - } - } - - function read($bytes) { - if ($bytes) { - fseek($this->_fd, $this->_pos); - - // PHP 5.1.1 does not read more than 8192 bytes in one fread() - // the discussions at PHP Bugs suggest it's the intended behaviour - $data = ''; - while ($bytes > 0) { - $chunk = fread($this->_fd, $bytes); - $data .= $chunk; - $bytes -= strlen($chunk); - } - $this->_pos = ftell($this->_fd); - - return $data; - } else return ''; - } - - function seekto($pos) { - fseek($this->_fd, $pos); - $this->_pos = ftell($this->_fd); - return $this->_pos; - } - - function currentpos() { - return $this->_pos; - } - - function length() { - return $this->_length; - } - - function close() { - fclose($this->_fd); - } - -}; - -// Preloads entire file in memory first, then creates a StringReader -// over it (it assumes knowledge of StringReader internals) -class CachedFileReader extends StringReader { - public function __construct($filename) { - if (file_exists($filename)) { - - $length=filesize($filename); - $fd = fopen($filename,'rb'); - - if (!$fd) { - $this->error = 3; // Cannot read file, probably permissions - return false; - } - $this->_str = fread($fd, $length); - fclose($fd); - - } else { - $this->error = 2; // File doesn't exist - return false; - } - } -}; - - diff --git a/#pma/libraries/phpseclib/Crypt/AES.php b/#pma/libraries/phpseclib/Crypt/AES.php deleted file mode 100644 index a0902907..00000000 --- a/#pma/libraries/phpseclib/Crypt/AES.php +++ /dev/null @@ -1,131 +0,0 @@ - - * setKey('abcdefghijklmnop'); - * - * $size = 10 * 1024; - * $plaintext = ''; - * for ($i = 0; $i < $size; $i++) { - * $plaintext.= 'a'; - * } - * - * echo $aes->decrypt($aes->encrypt($plaintext)); - * ?> - * - * - * @category Crypt - * @package AES - * @author Jim Wigginton - * @copyright 2008 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://phpseclib.sourceforge.net - */ -namespace phpseclib\Crypt; - -if (! defined('PHPMYADMIN')) { - exit; -} - -use phpseclib\Crypt\Rijndael; - -/** - * Pure-PHP implementation of AES. - * - * @package AES - * @author Jim Wigginton - * @access public - */ -class AES extends Rijndael -{ - /** - * Dummy function - * - * Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, this function is, technically, available, but it doesn't do anything. - * - * @see \phpseclib\Crypt\Rijndael::setBlockLength() - * @access public - * @param int $length - */ - function setBlockLength($length) - { - return; - } - - /** - * Sets the key length - * - * Valid key lengths are 128, 192, and 256. If the length is less than 128, it will be rounded up to - * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. - * - * @see \phpseclib\Crypt\Rijndael:setKeyLength() - * @access public - * @param int $length - */ - function setKeyLength($length) - { - switch ($length) { - case 160: - $length = 192; - break; - case 224: - $length = 256; - } - parent::setKeyLength($length); - } - - /** - * Sets the key. - * - * Rijndael supports five different key lengths, AES only supports three. - * - * @see \phpseclib\Crypt\Rijndael:setKey() - * @see setKeyLength() - * @access public - * @param string $key - */ - function setKey($key) - { - parent::setKey($key); - - if (!$this->explicit_key_length) { - $length = strlen($key); - switch (true) { - case $length <= 16: - $this->key_length = 16; - break; - case $length <= 24: - $this->key_length = 24; - break; - default: - $this->key_length = 32; - } - $this->_setEngine(); - } - } -} diff --git a/#pma/libraries/phpseclib/Crypt/Base.php b/#pma/libraries/phpseclib/Crypt/Base.php deleted file mode 100644 index e1d0b8b2..00000000 --- a/#pma/libraries/phpseclib/Crypt/Base.php +++ /dev/null @@ -1,2549 +0,0 @@ - - * @author Hans-Juergen Petrich - * @copyright 2007 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://phpseclib.sourceforge.net - */ - -namespace phpseclib\Crypt; - -use phpseclib\Crypt\Hash; - -/** - * Base Class for all \phpseclib\Crypt\* cipher classes - * - * @package Base - * @author Jim Wigginton - * @author Hans-Juergen Petrich - */ -abstract class Base -{ - /**#@+ - * @access public - * @see \phpseclib\Crypt\Base::encrypt() - * @see \phpseclib\Crypt\Base::decrypt() - */ - /** - * Encrypt / decrypt using the Counter mode. - * - * Set to -1 since that's what Crypt/Random.php uses to index the CTR mode. - * - * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29 - */ - const MODE_CTR = -1; - /** - * Encrypt / decrypt using the Electronic Code Book mode. - * - * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29 - */ - const MODE_ECB = 1; - /** - * Encrypt / decrypt using the Code Book Chaining mode. - * - * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29 - */ - const MODE_CBC = 2; - /** - * Encrypt / decrypt using the Cipher Feedback mode. - * - * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher_feedback_.28CFB.29 - */ - const MODE_CFB = 3; - /** - * Encrypt / decrypt using the Output Feedback mode. - * - * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Output_feedback_.28OFB.29 - */ - const MODE_OFB = 4; - /** - * Encrypt / decrypt using streaming mode. - */ - const MODE_STREAM = 5; - /**#@-*/ - - /** - * Whirlpool available flag - * - * @see \phpseclib\Crypt\Base::_hashInlineCryptFunction() - * @var bool - * @access private - */ - static $WHIRLPOOL_AVAILABLE; - - /**#@+ - * @access private - * @see \phpseclib\Crypt\Base::__construct() - */ - /** - * Base value for the internal implementation $engine switch - */ - const ENGINE_INTERNAL = 1; - /** - * Base value for the mcrypt implementation $engine switch - */ - const ENGINE_MCRYPT = 2; - /** - * Base value for the mcrypt implementation $engine switch - */ - const ENGINE_OPENSSL = 3; - /**#@-*/ - - /** - * The Encryption Mode - * - * @see self::__construct() - * @var int - * @access private - */ - var $mode; - - /** - * The Block Length of the block cipher - * - * @var int - * @access private - */ - var $block_size = 16; - - /** - * The Key - * - * @see self::setKey() - * @var string - * @access private - */ - var $key = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; - - /** - * The Initialization Vector - * - * @see self::setIV() - * @var string - * @access private - */ - var $iv; - - /** - * A "sliding" Initialization Vector - * - * @see self::enableContinuousBuffer() - * @see self::_clearBuffers() - * @var string - * @access private - */ - var $encryptIV; - - /** - * A "sliding" Initialization Vector - * - * @see self::enableContinuousBuffer() - * @see self::_clearBuffers() - * @var string - * @access private - */ - var $decryptIV; - - /** - * Continuous Buffer status - * - * @see self::enableContinuousBuffer() - * @var bool - * @access private - */ - var $continuousBuffer = false; - - /** - * Encryption buffer for CTR, OFB and CFB modes - * - * @see self::encrypt() - * @see self::_clearBuffers() - * @var array - * @access private - */ - var $enbuffer; - - /** - * Decryption buffer for CTR, OFB and CFB modes - * - * @see self::decrypt() - * @see self::_clearBuffers() - * @var array - * @access private - */ - var $debuffer; - - /** - * mcrypt resource for encryption - * - * The mcrypt resource can be recreated every time something needs to be created or it can be created just once. - * Since mcrypt operates in continuous mode, by default, it'll need to be recreated when in non-continuous mode. - * - * @see self::encrypt() - * @var resource - * @access private - */ - var $enmcrypt; - - /** - * mcrypt resource for decryption - * - * The mcrypt resource can be recreated every time something needs to be created or it can be created just once. - * Since mcrypt operates in continuous mode, by default, it'll need to be recreated when in non-continuous mode. - * - * @see self::decrypt() - * @var resource - * @access private - */ - var $demcrypt; - - /** - * Does the enmcrypt resource need to be (re)initialized? - * - * @see \phpseclib\Crypt\Twofish::setKey() - * @see \phpseclib\Crypt\Twofish::setIV() - * @var bool - * @access private - */ - var $enchanged = true; - - /** - * Does the demcrypt resource need to be (re)initialized? - * - * @see \phpseclib\Crypt\Twofish::setKey() - * @see \phpseclib\Crypt\Twofish::setIV() - * @var bool - * @access private - */ - var $dechanged = true; - - /** - * mcrypt resource for CFB mode - * - * mcrypt's CFB mode, in (and only in) buffered context, - * is broken, so phpseclib implements the CFB mode by it self, - * even when the mcrypt php extension is available. - * - * In order to do the CFB-mode work (fast) phpseclib - * use a separate ECB-mode mcrypt resource. - * - * @link http://phpseclib.sourceforge.net/cfb-demo.phps - * @see self::encrypt() - * @see self::decrypt() - * @see self::_setupMcrypt() - * @var resource - * @access private - */ - var $ecb; - - /** - * Optimizing value while CFB-encrypting - * - * Only relevant if $continuousBuffer enabled - * and $engine == self::ENGINE_MCRYPT - * - * It's faster to re-init $enmcrypt if - * $buffer bytes > $cfb_init_len than - * using the $ecb resource furthermore. - * - * This value depends of the chosen cipher - * and the time it would be needed for it's - * initialization [by mcrypt_generic_init()] - * which, typically, depends on the complexity - * on its internaly Key-expanding algorithm. - * - * @see self::encrypt() - * @var int - * @access private - */ - var $cfb_init_len = 600; - - /** - * Does internal cipher state need to be (re)initialized? - * - * @see self::setKey() - * @see self::setIV() - * @see self::disableContinuousBuffer() - * @var bool - * @access private - */ - var $changed = true; - - /** - * Padding status - * - * @see self::enablePadding() - * @var bool - * @access private - */ - var $padding = true; - - /** - * Is the mode one that is paddable? - * - * @see self::__construct() - * @var bool - * @access private - */ - var $paddable = false; - - /** - * Holds which crypt engine internaly should be use, - * which will be determined automatically on __construct() - * - * Currently available $engines are: - * - self::ENGINE_OPENSSL (very fast, php-extension: openssl, extension_loaded('openssl') required) - * - self::ENGINE_MCRYPT (fast, php-extension: mcrypt, extension_loaded('mcrypt') required) - * - self::ENGINE_INTERNAL (slower, pure php-engine, no php-extension required) - * - * @see self::_setEngine() - * @see self::encrypt() - * @see self::decrypt() - * @var int - * @access private - */ - var $engine; - - /** - * Holds the preferred crypt engine - * - * @see self::_setEngine() - * @see self::setPreferredEngine() - * @var int - * @access private - */ - var $preferredEngine; - - /** - * The mcrypt specific name of the cipher - * - * Only used if $engine == self::ENGINE_MCRYPT - * - * @link http://www.php.net/mcrypt_module_open - * @link http://www.php.net/mcrypt_list_algorithms - * @see self::_setupMcrypt() - * @var string - * @access private - */ - var $cipher_name_mcrypt; - - /** - * The openssl specific name of the cipher - * - * Only used if $engine == self::ENGINE_OPENSSL - * - * @link http://www.php.net/openssl-get-cipher-methods - * @var string - * @access private - */ - var $cipher_name_openssl; - - /** - * The openssl specific name of the cipher in ECB mode - * - * If OpenSSL does not support the mode we're trying to use (CTR) - * it can still be emulated with ECB mode. - * - * @link http://www.php.net/openssl-get-cipher-methods - * @var string - * @access private - */ - var $cipher_name_openssl_ecb; - - /** - * The default salt used by setPassword() - * - * @see self::setPassword() - * @var string - * @access private - */ - var $password_default_salt = 'phpseclib/salt'; - - /** - * The name of the performance-optimized callback function - * - * Used by encrypt() / decrypt() - * only if $engine == self::ENGINE_INTERNAL - * - * @see self::encrypt() - * @see self::decrypt() - * @see self::_setupInlineCrypt() - * @see self::$use_inline_crypt - * @var Callback - * @access private - */ - var $inline_crypt; - - /** - * Holds whether performance-optimized $inline_crypt() can/should be used. - * - * @see self::encrypt() - * @see self::decrypt() - * @see self::inline_crypt - * @var mixed - * @access private - */ - var $use_inline_crypt; - - /** - * If OpenSSL can be used in ECB but not in CTR we can emulate CTR - * - * @see self::_openssl_ctr_process() - * @var bool - * @access private - */ - var $openssl_emulate_ctr = false; - - /** - * Determines what options are passed to openssl_encrypt/decrypt - * - * @see self::isValidEngine() - * @var mixed - * @access private - */ - var $openssl_options; - - /** - * Has the key length explicitly been set or should it be derived from the key, itself? - * - * @see self::setKeyLength() - * @var bool - * @access private - */ - var $explicit_key_length = false; - - /** - * Don't truncate / null pad key - * - * @see self::_clearBuffers() - * @var bool - * @access private - */ - var $skip_key_adjustment = false; - - /** - * Default Constructor. - * - * Determines whether or not the mcrypt extension should be used. - * - * $mode could be: - * - * - self::MODE_ECB - * - * - self::MODE_CBC - * - * - self::MODE_CTR - * - * - self::MODE_CFB - * - * - self::MODE_OFB - * - * If not explicitly set, self::MODE_CBC will be used. - * - * @param int $mode - * @access public - */ - function __construct($mode = self::MODE_CBC) - { - // $mode dependent settings - switch ($mode) { - case self::MODE_ECB: - $this->paddable = true; - $this->mode = self::MODE_ECB; - break; - case self::MODE_CTR: - case self::MODE_CFB: - case self::MODE_OFB: - case self::MODE_STREAM: - $this->mode = $mode; - break; - case self::MODE_CBC: - default: - $this->paddable = true; - $this->mode = self::MODE_CBC; - } - - $this->_setEngine(); - - // Determining whether inline crypting can be used by the cipher - if ($this->use_inline_crypt !== false && function_exists('create_function')) { - $this->use_inline_crypt = true; - } - } - - /** - * Sets the initialization vector. (optional) - * - * SetIV is not required when self::MODE_ECB (or ie for AES: \phpseclib\Crypt\AES::MODE_ECB) is being used. If not explicitly set, it'll be assumed - * to be all zero's. - * - * @access public - * @param string $iv - * @internal Can be overwritten by a sub class, but does not have to be - */ - function setIV($iv) - { - if ($this->mode == self::MODE_ECB) { - return; - } - - $this->iv = $iv; - $this->changed = true; - } - - /** - * Sets the key length. - * - * Keys with explicitly set lengths need to be treated accordingly - * - * @access public - * @param int $length - */ - function setKeyLength($length) - { - $this->explicit_key_length = true; - $this->changed = true; - $this->_setEngine(); - } - - /** - * Returns the current key length in bits - * - * @access public - * @return int - */ - function getKeyLength() - { - return $this->key_length << 3; - } - - /** - * Returns the current block length in bits - * - * @access public - * @return int - */ - function getBlockLength() - { - return $this->block_size << 3; - } - - /** - * Sets the key. - * - * The min/max length(s) of the key depends on the cipher which is used. - * If the key not fits the length(s) of the cipher it will paded with null bytes - * up to the closest valid key length. If the key is more than max length, - * we trim the excess bits. - * - * If the key is not explicitly set, it'll be assumed to be all null bytes. - * - * @access public - * @param string $key - * @internal Could, but not must, extend by the child Crypt_* class - */ - function setKey($key) - { - if (!$this->explicit_key_length) { - $this->setKeyLength(strlen($key) << 3); - $this->explicit_key_length = false; - } - - $this->key = $key; - $this->changed = true; - $this->_setEngine(); - } - - /** - * Sets the password. - * - * Depending on what $method is set to, setPassword()'s (optional) parameters are as follows: - * {@link http://en.wikipedia.org/wiki/PBKDF2 pbkdf2} or pbkdf1: - * $hash, $salt, $count, $dkLen - * - * Where $hash (default = sha1) currently supports the following hashes: see: Crypt/Hash.php - * - * @see Crypt/Hash.php - * @param string $password - * @param string $method - * @return bool - * @access public - * @internal Could, but not must, extend by the child Crypt_* class - */ - function setPassword($password, $method = 'pbkdf2') - { - $key = ''; - - switch ($method) { - default: // 'pbkdf2' or 'pbkdf1' - $func_args = func_get_args(); - - // Hash function - $hash = isset($func_args[2]) ? $func_args[2] : 'sha1'; - - // WPA and WPA2 use the SSID as the salt - $salt = isset($func_args[3]) ? $func_args[3] : $this->password_default_salt; - - // RFC2898#section-4.2 uses 1,000 iterations by default - // WPA and WPA2 use 4,096. - $count = isset($func_args[4]) ? $func_args[4] : 1000; - - // Keylength - if (isset($func_args[5])) { - $dkLen = $func_args[5]; - } else { - $dkLen = $method == 'pbkdf1' ? 2 * $this->key_length : $this->key_length; - } - - switch (true) { - case $method == 'pbkdf1': - $hashObj = new Hash(); - $hashObj->setHash($hash); - if ($dkLen > $hashObj->getLength()) { - user_error('Derived key too long'); - return false; - } - $t = $password . $salt; - for ($i = 0; $i < $count; ++$i) { - $t = $hashObj->hash($t); - } - $key = substr($t, 0, $dkLen); - - $this->setKey(substr($key, 0, $dkLen >> 1)); - $this->setIV(substr($key, $dkLen >> 1)); - - return true; - // Determining if php[>=5.5.0]'s hash_pbkdf2() function avail- and useable - case !function_exists('hash_pbkdf2'): - case !function_exists('hash_algos'): - case !in_array($hash, hash_algos()): - $i = 1; - while (strlen($key) < $dkLen) { - $hmac = new Hash(); - $hmac->setHash($hash); - $hmac->setKey($password); - $f = $u = $hmac->hash($salt . pack('N', $i++)); - for ($j = 2; $j <= $count; ++$j) { - $u = $hmac->hash($u); - $f^= $u; - } - $key.= $f; - } - $key = substr($key, 0, $dkLen); - break; - default: - $key = hash_pbkdf2($hash, $password, $salt, $count, $dkLen, true); - } - } - - $this->setKey($key); - - return true; - } - - /** - * Encrypts a message. - * - * $plaintext will be padded with additional bytes such that it's length is a multiple of the block size. Other cipher - * implementations may or may not pad in the same manner. Other common approaches to padding and the reasons why it's - * necessary are discussed in the following - * URL: - * - * {@link http://www.di-mgt.com.au/cryptopad.html http://www.di-mgt.com.au/cryptopad.html} - * - * An alternative to padding is to, separately, send the length of the file. This is what SSH, in fact, does. - * strlen($plaintext) will still need to be a multiple of the block size, however, arbitrary values can be added to make it that - * length. - * - * @see self::decrypt() - * @access public - * @param string $plaintext - * @return string $ciphertext - * @internal Could, but not must, extend by the child Crypt_* class - */ - function encrypt($plaintext) - { - if ($this->paddable) { - $plaintext = $this->_pad($plaintext); - } - - if ($this->engine === self::ENGINE_OPENSSL) { - if ($this->changed) { - $this->_clearBuffers(); - $this->changed = false; - } - switch ($this->mode) { - case self::MODE_STREAM: - return openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options); - case self::MODE_ECB: - $result = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options); - return !defined('OPENSSL_RAW_DATA') ? substr($result, 0, -$this->block_size) : $result; - case self::MODE_CBC: - $result = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $this->encryptIV); - if ($this->continuousBuffer) { - $this->encryptIV = substr($result, -$this->block_size); - } - return !defined('OPENSSL_RAW_DATA') ? substr($result, 0, -$this->block_size) : $result; - case self::MODE_CTR: - return $this->_openssl_ctr_process($plaintext, $this->encryptIV, $this->enbuffer); - case self::MODE_CFB: - // cfb loosely routines inspired by openssl's: - // {@link http://cvs.openssl.org/fileview?f=openssl/crypto/modes/cfb128.c&v=1.3.2.2.2.1} - $ciphertext = ''; - if ($this->continuousBuffer) { - $iv = &$this->encryptIV; - $pos = &$this->enbuffer['pos']; - } else { - $iv = $this->encryptIV; - $pos = 0; - } - $len = strlen($plaintext); - $i = 0; - if ($pos) { - $orig_pos = $pos; - $max = $this->block_size - $pos; - if ($len >= $max) { - $i = $max; - $len-= $max; - $pos = 0; - } else { - $i = $len; - $pos+= $len; - $len = 0; - } - // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize - $ciphertext = substr($iv, $orig_pos) ^ $plaintext; - $iv = substr_replace($iv, $ciphertext, $orig_pos, $i); - $plaintext = substr($plaintext, $i); - } - - $overflow = $len % $this->block_size; - - if ($overflow) { - $ciphertext.= openssl_encrypt(substr($plaintext, 0, -$overflow) . str_repeat("\0", $this->block_size), $this->cipher_name_openssl, $this->key, $this->openssl_options, $iv); - $iv = $this->_string_pop($ciphertext, $this->block_size); - - $size = $len - $overflow; - $block = $iv ^ substr($plaintext, -$overflow); - $iv = substr_replace($iv, $block, 0, $overflow); - $ciphertext.= $block; - $pos = $overflow; - } elseif ($len) { - $ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $iv); - $iv = substr($ciphertext, -$this->block_size); - } - - return $ciphertext; - case self::MODE_OFB: - return $this->_openssl_ofb_process($plaintext, $this->encryptIV, $this->enbuffer); - } - } - - if ($this->engine === self::ENGINE_MCRYPT) { - if ($this->changed) { - $this->_setupMcrypt(); - $this->changed = false; - } - if ($this->enchanged) { - mcrypt_generic_init($this->enmcrypt, $this->key, $this->encryptIV); - $this->enchanged = false; - } - - // re: {@link http://phpseclib.sourceforge.net/cfb-demo.phps} - // using mcrypt's default handing of CFB the above would output two different things. using phpseclib's - // rewritten CFB implementation the above outputs the same thing twice. - if ($this->mode == self::MODE_CFB && $this->continuousBuffer) { - $block_size = $this->block_size; - $iv = &$this->encryptIV; - $pos = &$this->enbuffer['pos']; - $len = strlen($plaintext); - $ciphertext = ''; - $i = 0; - if ($pos) { - $orig_pos = $pos; - $max = $block_size - $pos; - if ($len >= $max) { - $i = $max; - $len-= $max; - $pos = 0; - } else { - $i = $len; - $pos+= $len; - $len = 0; - } - $ciphertext = substr($iv, $orig_pos) ^ $plaintext; - $iv = substr_replace($iv, $ciphertext, $orig_pos, $i); - $this->enbuffer['enmcrypt_init'] = true; - } - if ($len >= $block_size) { - if ($this->enbuffer['enmcrypt_init'] === false || $len > $this->cfb_init_len) { - if ($this->enbuffer['enmcrypt_init'] === true) { - mcrypt_generic_init($this->enmcrypt, $this->key, $iv); - $this->enbuffer['enmcrypt_init'] = false; - } - $ciphertext.= mcrypt_generic($this->enmcrypt, substr($plaintext, $i, $len - $len % $block_size)); - $iv = substr($ciphertext, -$block_size); - $len%= $block_size; - } else { - while ($len >= $block_size) { - $iv = mcrypt_generic($this->ecb, $iv) ^ substr($plaintext, $i, $block_size); - $ciphertext.= $iv; - $len-= $block_size; - $i+= $block_size; - } - } - } - - if ($len) { - $iv = mcrypt_generic($this->ecb, $iv); - $block = $iv ^ substr($plaintext, -$len); - $iv = substr_replace($iv, $block, 0, $len); - $ciphertext.= $block; - $pos = $len; - } - - return $ciphertext; - } - - $ciphertext = mcrypt_generic($this->enmcrypt, $plaintext); - - if (!$this->continuousBuffer) { - mcrypt_generic_init($this->enmcrypt, $this->key, $this->encryptIV); - } - - return $ciphertext; - } - - if ($this->changed) { - $this->_setup(); - $this->changed = false; - } - if ($this->use_inline_crypt) { - $inline = $this->inline_crypt; - return $inline('encrypt', $this, $plaintext); - } - - $buffer = &$this->enbuffer; - $block_size = $this->block_size; - $ciphertext = ''; - switch ($this->mode) { - case self::MODE_ECB: - for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { - $ciphertext.= $this->_encryptBlock(substr($plaintext, $i, $block_size)); - } - break; - case self::MODE_CBC: - $xor = $this->encryptIV; - for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { - $block = substr($plaintext, $i, $block_size); - $block = $this->_encryptBlock($block ^ $xor); - $xor = $block; - $ciphertext.= $block; - } - if ($this->continuousBuffer) { - $this->encryptIV = $xor; - } - break; - case self::MODE_CTR: - $xor = $this->encryptIV; - if (strlen($buffer['ciphertext'])) { - for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { - $block = substr($plaintext, $i, $block_size); - if (strlen($block) > strlen($buffer['ciphertext'])) { - $buffer['ciphertext'].= $this->_encryptBlock($xor); - } - $this->_increment_str($xor); - $key = $this->_string_shift($buffer['ciphertext'], $block_size); - $ciphertext.= $block ^ $key; - } - } else { - for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { - $block = substr($plaintext, $i, $block_size); - $key = $this->_encryptBlock($xor); - $this->_increment_str($xor); - $ciphertext.= $block ^ $key; - } - } - if ($this->continuousBuffer) { - $this->encryptIV = $xor; - if ($start = strlen($plaintext) % $block_size) { - $buffer['ciphertext'] = substr($key, $start) . $buffer['ciphertext']; - } - } - break; - case self::MODE_CFB: - // cfb loosely routines inspired by openssl's: - // {@link http://cvs.openssl.org/fileview?f=openssl/crypto/modes/cfb128.c&v=1.3.2.2.2.1} - if ($this->continuousBuffer) { - $iv = &$this->encryptIV; - $pos = &$buffer['pos']; - } else { - $iv = $this->encryptIV; - $pos = 0; - } - $len = strlen($plaintext); - $i = 0; - if ($pos) { - $orig_pos = $pos; - $max = $block_size - $pos; - if ($len >= $max) { - $i = $max; - $len-= $max; - $pos = 0; - } else { - $i = $len; - $pos+= $len; - $len = 0; - } - // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize - $ciphertext = substr($iv, $orig_pos) ^ $plaintext; - $iv = substr_replace($iv, $ciphertext, $orig_pos, $i); - } - while ($len >= $block_size) { - $iv = $this->_encryptBlock($iv) ^ substr($plaintext, $i, $block_size); - $ciphertext.= $iv; - $len-= $block_size; - $i+= $block_size; - } - if ($len) { - $iv = $this->_encryptBlock($iv); - $block = $iv ^ substr($plaintext, $i); - $iv = substr_replace($iv, $block, 0, $len); - $ciphertext.= $block; - $pos = $len; - } - break; - case self::MODE_OFB: - $xor = $this->encryptIV; - if (strlen($buffer['xor'])) { - for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { - $block = substr($plaintext, $i, $block_size); - if (strlen($block) > strlen($buffer['xor'])) { - $xor = $this->_encryptBlock($xor); - $buffer['xor'].= $xor; - } - $key = $this->_string_shift($buffer['xor'], $block_size); - $ciphertext.= $block ^ $key; - } - } else { - for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { - $xor = $this->_encryptBlock($xor); - $ciphertext.= substr($plaintext, $i, $block_size) ^ $xor; - } - $key = $xor; - } - if ($this->continuousBuffer) { - $this->encryptIV = $xor; - if ($start = strlen($plaintext) % $block_size) { - $buffer['xor'] = substr($key, $start) . $buffer['xor']; - } - } - break; - case self::MODE_STREAM: - $ciphertext = $this->_encryptBlock($plaintext); - break; - } - - return $ciphertext; - } - - /** - * Decrypts a message. - * - * If strlen($ciphertext) is not a multiple of the block size, null bytes will be added to the end of the string until - * it is. - * - * @see self::encrypt() - * @access public - * @param string $ciphertext - * @return string $plaintext - * @internal Could, but not must, extend by the child Crypt_* class - */ - function decrypt($ciphertext) - { - if ($this->paddable) { - // we pad with chr(0) since that's what mcrypt_generic does. to quote from {@link http://www.php.net/function.mcrypt-generic}: - // "The data is padded with "\0" to make sure the length of the data is n * blocksize." - $ciphertext = str_pad($ciphertext, strlen($ciphertext) + ($this->block_size - strlen($ciphertext) % $this->block_size) % $this->block_size, chr(0)); - } - - if ($this->engine === self::ENGINE_OPENSSL) { - if ($this->changed) { - $this->_clearBuffers(); - $this->changed = false; - } - switch ($this->mode) { - case self::MODE_STREAM: - $plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options); - break; - case self::MODE_ECB: - if (!defined('OPENSSL_RAW_DATA')) { - $ciphertext.= openssl_encrypt('', $this->cipher_name_openssl_ecb, $this->key, true); - } - $plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options); - break; - case self::MODE_CBC: - if (!defined('OPENSSL_RAW_DATA')) { - $padding = str_repeat(chr($this->block_size), $this->block_size) ^ substr($ciphertext, -$this->block_size); - $ciphertext.= substr(openssl_encrypt($padding, $this->cipher_name_openssl_ecb, $this->key, true), 0, $this->block_size); - } - $plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $this->decryptIV); - if ($this->continuousBuffer) { - $this->decryptIV = substr($ciphertext, -$this->block_size); - } - break; - case self::MODE_CTR: - $plaintext = $this->_openssl_ctr_process($ciphertext, $this->decryptIV, $this->debuffer); - break; - case self::MODE_CFB: - // cfb loosely routines inspired by openssl's: - // {@link http://cvs.openssl.org/fileview?f=openssl/crypto/modes/cfb128.c&v=1.3.2.2.2.1} - $plaintext = ''; - if ($this->continuousBuffer) { - $iv = &$this->decryptIV; - $pos = &$this->buffer['pos']; - } else { - $iv = $this->decryptIV; - $pos = 0; - } - $len = strlen($ciphertext); - $i = 0; - if ($pos) { - $orig_pos = $pos; - $max = $this->block_size - $pos; - if ($len >= $max) { - $i = $max; - $len-= $max; - $pos = 0; - } else { - $i = $len; - $pos+= $len; - $len = 0; - } - // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $this->blocksize - $plaintext = substr($iv, $orig_pos) ^ $ciphertext; - $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i); - $ciphertext = substr($ciphertext, $i); - } - $overflow = $len % $this->block_size; - if ($overflow) { - $plaintext.= openssl_decrypt(substr($ciphertext, 0, -$overflow), $this->cipher_name_openssl, $this->key, $this->openssl_options, $iv); - if ($len - $overflow) { - $iv = substr($ciphertext, -$overflow - $this->block_size, -$overflow); - } - $iv = openssl_encrypt(str_repeat("\0", $this->block_size), $this->cipher_name_openssl, $this->key, $this->openssl_options, $iv); - $plaintext.= $iv ^ substr($ciphertext, -$overflow); - $iv = substr_replace($iv, substr($ciphertext, -$overflow), 0, $overflow); - $pos = $overflow; - } elseif ($len) { - $plaintext.= openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $iv); - $iv = substr($ciphertext, -$this->block_size); - } - break; - case self::MODE_OFB: - $plaintext = $this->_openssl_ofb_process($ciphertext, $this->decryptIV, $this->debuffer); - } - - return $this->paddable ? $this->_unpad($plaintext) : $plaintext; - } - - if ($this->engine === self::ENGINE_MCRYPT) { - $block_size = $this->block_size; - if ($this->changed) { - $this->_setupMcrypt(); - $this->changed = false; - } - if ($this->dechanged) { - mcrypt_generic_init($this->demcrypt, $this->key, $this->decryptIV); - $this->dechanged = false; - } - - if ($this->mode == self::MODE_CFB && $this->continuousBuffer) { - $iv = &$this->decryptIV; - $pos = &$this->debuffer['pos']; - $len = strlen($ciphertext); - $plaintext = ''; - $i = 0; - if ($pos) { - $orig_pos = $pos; - $max = $block_size - $pos; - if ($len >= $max) { - $i = $max; - $len-= $max; - $pos = 0; - } else { - $i = $len; - $pos+= $len; - $len = 0; - } - // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize - $plaintext = substr($iv, $orig_pos) ^ $ciphertext; - $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i); - } - if ($len >= $block_size) { - $cb = substr($ciphertext, $i, $len - $len % $block_size); - $plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb; - $iv = substr($cb, -$block_size); - $len%= $block_size; - } - if ($len) { - $iv = mcrypt_generic($this->ecb, $iv); - $plaintext.= $iv ^ substr($ciphertext, -$len); - $iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len); - $pos = $len; - } - - return $plaintext; - } - - $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext); - - if (!$this->continuousBuffer) { - mcrypt_generic_init($this->demcrypt, $this->key, $this->decryptIV); - } - - return $this->paddable ? $this->_unpad($plaintext) : $plaintext; - } - - if ($this->changed) { - $this->_setup(); - $this->changed = false; - } - if ($this->use_inline_crypt) { - $inline = $this->inline_crypt; - return $inline('decrypt', $this, $ciphertext); - } - - $block_size = $this->block_size; - - $buffer = &$this->debuffer; - $plaintext = ''; - switch ($this->mode) { - case self::MODE_ECB: - for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { - $plaintext.= $this->_decryptBlock(substr($ciphertext, $i, $block_size)); - } - break; - case self::MODE_CBC: - $xor = $this->decryptIV; - for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { - $block = substr($ciphertext, $i, $block_size); - $plaintext.= $this->_decryptBlock($block) ^ $xor; - $xor = $block; - } - if ($this->continuousBuffer) { - $this->decryptIV = $xor; - } - break; - case self::MODE_CTR: - $xor = $this->decryptIV; - if (strlen($buffer['ciphertext'])) { - for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { - $block = substr($ciphertext, $i, $block_size); - if (strlen($block) > strlen($buffer['ciphertext'])) { - $buffer['ciphertext'].= $this->_encryptBlock($xor); - $this->_increment_str($xor); - } - $key = $this->_string_shift($buffer['ciphertext'], $block_size); - $plaintext.= $block ^ $key; - } - } else { - for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { - $block = substr($ciphertext, $i, $block_size); - $key = $this->_encryptBlock($xor); - $this->_increment_str($xor); - $plaintext.= $block ^ $key; - } - } - if ($this->continuousBuffer) { - $this->decryptIV = $xor; - if ($start = strlen($ciphertext) % $block_size) { - $buffer['ciphertext'] = substr($key, $start) . $buffer['ciphertext']; - } - } - break; - case self::MODE_CFB: - if ($this->continuousBuffer) { - $iv = &$this->decryptIV; - $pos = &$buffer['pos']; - } else { - $iv = $this->decryptIV; - $pos = 0; - } - $len = strlen($ciphertext); - $i = 0; - if ($pos) { - $orig_pos = $pos; - $max = $block_size - $pos; - if ($len >= $max) { - $i = $max; - $len-= $max; - $pos = 0; - } else { - $i = $len; - $pos+= $len; - $len = 0; - } - // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize - $plaintext = substr($iv, $orig_pos) ^ $ciphertext; - $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i); - } - while ($len >= $block_size) { - $iv = $this->_encryptBlock($iv); - $cb = substr($ciphertext, $i, $block_size); - $plaintext.= $iv ^ $cb; - $iv = $cb; - $len-= $block_size; - $i+= $block_size; - } - if ($len) { - $iv = $this->_encryptBlock($iv); - $plaintext.= $iv ^ substr($ciphertext, $i); - $iv = substr_replace($iv, substr($ciphertext, $i), 0, $len); - $pos = $len; - } - break; - case self::MODE_OFB: - $xor = $this->decryptIV; - if (strlen($buffer['xor'])) { - for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { - $block = substr($ciphertext, $i, $block_size); - if (strlen($block) > strlen($buffer['xor'])) { - $xor = $this->_encryptBlock($xor); - $buffer['xor'].= $xor; - } - $key = $this->_string_shift($buffer['xor'], $block_size); - $plaintext.= $block ^ $key; - } - } else { - for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { - $xor = $this->_encryptBlock($xor); - $plaintext.= substr($ciphertext, $i, $block_size) ^ $xor; - } - $key = $xor; - } - if ($this->continuousBuffer) { - $this->decryptIV = $xor; - if ($start = strlen($ciphertext) % $block_size) { - $buffer['xor'] = substr($key, $start) . $buffer['xor']; - } - } - break; - case self::MODE_STREAM: - $plaintext = $this->_decryptBlock($ciphertext); - break; - } - return $this->paddable ? $this->_unpad($plaintext) : $plaintext; - } - - /** - * OpenSSL CTR Processor - * - * PHP's OpenSSL bindings do not operate in continuous mode so we'll wrap around it. Since the keystream - * for CTR is the same for both encrypting and decrypting this function is re-used by both Base::encrypt() - * and Base::decrypt(). Also, OpenSSL doesn't implement CTR for all of it's symmetric ciphers so this - * function will emulate CTR with ECB when necesary. - * - * @see self::encrypt() - * @see self::decrypt() - * @param string $plaintext - * @param string $encryptIV - * @param array $buffer - * @return string - * @access private - */ - function _openssl_ctr_process($plaintext, &$encryptIV, &$buffer) - { - $ciphertext = ''; - - $block_size = $this->block_size; - $key = $this->key; - - if ($this->openssl_emulate_ctr) { - $xor = $encryptIV; - if (strlen($buffer['ciphertext'])) { - for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { - $block = substr($plaintext, $i, $block_size); - if (strlen($block) > strlen($buffer['ciphertext'])) { - $result = openssl_encrypt($xor, $this->cipher_name_openssl_ecb, $key, $this->openssl_options); - $result = !defined('OPENSSL_RAW_DATA') ? substr($result, 0, -$this->block_size) : $result; - $buffer['ciphertext'].= $result; - } - $this->_increment_str($xor); - $otp = $this->_string_shift($buffer['ciphertext'], $block_size); - $ciphertext.= $block ^ $otp; - } - } else { - for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { - $block = substr($plaintext, $i, $block_size); - $otp = openssl_encrypt($xor, $this->cipher_name_openssl_ecb, $key, $this->openssl_options); - $otp = !defined('OPENSSL_RAW_DATA') ? substr($otp, 0, -$this->block_size) : $otp; - $this->_increment_str($xor); - $ciphertext.= $block ^ $otp; - } - } - if ($this->continuousBuffer) { - $encryptIV = $xor; - if ($start = strlen($plaintext) % $block_size) { - $buffer['ciphertext'] = substr($key, $start) . $buffer['ciphertext']; - } - } - - return $ciphertext; - } - - if (strlen($buffer['ciphertext'])) { - $ciphertext = $plaintext ^ $this->_string_shift($buffer['ciphertext'], strlen($plaintext)); - $plaintext = substr($plaintext, strlen($ciphertext)); - - if (!strlen($plaintext)) { - return $ciphertext; - } - } - - $overflow = strlen($plaintext) % $block_size; - if ($overflow) { - $plaintext2 = $this->_string_pop($plaintext, $overflow); // ie. trim $plaintext to a multiple of $block_size and put rest of $plaintext in $plaintext2 - $encrypted = openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV); - $temp = $this->_string_pop($encrypted, $block_size); - $ciphertext.= $encrypted . ($plaintext2 ^ $temp); - if ($this->continuousBuffer) { - $buffer['ciphertext'] = substr($temp, $overflow); - $encryptIV = $temp; - } - } elseif (!strlen($buffer['ciphertext'])) { - $ciphertext.= openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV); - $temp = $this->_string_pop($ciphertext, $block_size); - if ($this->continuousBuffer) { - $encryptIV = $temp; - } - } - if ($this->continuousBuffer) { - if (!defined('OPENSSL_RAW_DATA')) { - $encryptIV.= openssl_encrypt('', $this->cipher_name_openssl_ecb, $key, $this->openssl_options); - } - $encryptIV = openssl_decrypt($encryptIV, $this->cipher_name_openssl_ecb, $key, $this->openssl_options); - if ($overflow) { - $this->_increment_str($encryptIV); - } - } - - return $ciphertext; - } - - /** - * OpenSSL OFB Processor - * - * PHP's OpenSSL bindings do not operate in continuous mode so we'll wrap around it. Since the keystream - * for OFB is the same for both encrypting and decrypting this function is re-used by both Base::encrypt() - * and Base::decrypt(). - * - * @see self::encrypt() - * @see self::decrypt() - * @param string $plaintext - * @param string $encryptIV - * @param array $buffer - * @return string - * @access private - */ - function _openssl_ofb_process($plaintext, &$encryptIV, &$buffer) - { - if (strlen($buffer['xor'])) { - $ciphertext = $plaintext ^ $buffer['xor']; - $buffer['xor'] = substr($buffer['xor'], strlen($ciphertext)); - $plaintext = substr($plaintext, strlen($ciphertext)); - } else { - $ciphertext = ''; - } - - $block_size = $this->block_size; - - $len = strlen($plaintext); - $key = $this->key; - $overflow = $len % $block_size; - - if (strlen($plaintext)) { - if ($overflow) { - $ciphertext.= openssl_encrypt(substr($plaintext, 0, -$overflow) . str_repeat("\0", $block_size), $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV); - $xor = $this->_string_pop($ciphertext, $block_size); - if ($this->continuousBuffer) { - $encryptIV = $xor; - } - $ciphertext.= $this->_string_shift($xor, $overflow) ^ substr($plaintext, -$overflow); - if ($this->continuousBuffer) { - $buffer['xor'] = $xor; - } - } else { - $ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV); - if ($this->continuousBuffer) { - $encryptIV = substr($ciphertext, -$block_size) ^ substr($plaintext, -$block_size); - } - } - } - - return $ciphertext; - } - - /** - * phpseclib <-> OpenSSL Mode Mapper - * - * May need to be overwritten by classes extending this one in some cases - * - * @return int - * @access private - */ - function _openssl_translate_mode() - { - switch ($this->mode) { - case self::MODE_ECB: - return 'ecb'; - case self::MODE_CBC: - return 'cbc'; - case self::MODE_CTR: - return 'ctr'; - case self::MODE_CFB: - return 'cfb'; - case self::MODE_OFB: - return 'ofb'; - } - } - - /** - * Pad "packets". - * - * Block ciphers working by encrypting between their specified [$this->]block_size at a time - * If you ever need to encrypt or decrypt something that isn't of the proper length, it becomes necessary to - * pad the input so that it is of the proper length. - * - * Padding is enabled by default. Sometimes, however, it is undesirable to pad strings. Such is the case in SSH, - * where "packets" are padded with random bytes before being encrypted. Unpad these packets and you risk stripping - * away characters that shouldn't be stripped away. (SSH knows how many bytes are added because the length is - * transmitted separately) - * - * @see self::disablePadding() - * @access public - */ - function enablePadding() - { - $this->padding = true; - } - - /** - * Do not pad packets. - * - * @see self::enablePadding() - * @access public - */ - function disablePadding() - { - $this->padding = false; - } - - /** - * Treat consecutive "packets" as if they are a continuous buffer. - * - * Say you have a 32-byte plaintext $plaintext. Using the default behavior, the two following code snippets - * will yield different outputs: - * - * - * echo $rijndael->encrypt(substr($plaintext, 0, 16)); - * echo $rijndael->encrypt(substr($plaintext, 16, 16)); - * - * - * echo $rijndael->encrypt($plaintext); - * - * - * The solution is to enable the continuous buffer. Although this will resolve the above discrepancy, it creates - * another, as demonstrated with the following: - * - * - * $rijndael->encrypt(substr($plaintext, 0, 16)); - * echo $rijndael->decrypt($rijndael->encrypt(substr($plaintext, 16, 16))); - * - * - * echo $rijndael->decrypt($rijndael->encrypt(substr($plaintext, 16, 16))); - * - * - * With the continuous buffer disabled, these would yield the same output. With it enabled, they yield different - * outputs. The reason is due to the fact that the initialization vector's change after every encryption / - * decryption round when the continuous buffer is enabled. When it's disabled, they remain constant. - * - * Put another way, when the continuous buffer is enabled, the state of the \phpseclib\Crypt\*() object changes after each - * encryption / decryption round, whereas otherwise, it'd remain constant. For this reason, it's recommended that - * continuous buffers not be used. They do offer better security and are, in fact, sometimes required (SSH uses them), - * however, they are also less intuitive and more likely to cause you problems. - * - * @see self::disableContinuousBuffer() - * @access public - * @internal Could, but not must, extend by the child Crypt_* class - */ - function enableContinuousBuffer() - { - if ($this->mode == self::MODE_ECB) { - return; - } - - $this->continuousBuffer = true; - - $this->_setEngine(); - } - - /** - * Treat consecutive packets as if they are a discontinuous buffer. - * - * The default behavior. - * - * @see self::enableContinuousBuffer() - * @access public - * @internal Could, but not must, extend by the child Crypt_* class - */ - function disableContinuousBuffer() - { - if ($this->mode == self::MODE_ECB) { - return; - } - if (!$this->continuousBuffer) { - return; - } - - $this->continuousBuffer = false; - $this->changed = true; - - $this->_setEngine(); - } - - /** - * Test for engine validity - * - * @see self::__construct() - * @param int $engine - * @access public - * @return bool - */ - function isValidEngine($engine) - { - switch ($engine) { - case self::ENGINE_OPENSSL: - if ($this->mode == self::MODE_STREAM && $this->continuousBuffer) { - return false; - } - $this->openssl_emulate_ctr = false; - $result = $this->cipher_name_openssl && - extension_loaded('openssl') && - // PHP 5.3.0 - 5.3.2 did not let you set IV's - version_compare(PHP_VERSION, '5.3.3', '>='); - if (!$result) { - return false; - } - - // prior to PHP 5.4.0 OPENSSL_RAW_DATA and OPENSSL_ZERO_PADDING were not defined. instead of expecting an integer - // $options openssl_encrypt expected a boolean $raw_data. - if (!defined('OPENSSL_RAW_DATA')) { - $this->openssl_options = true; - } else { - $this->openssl_options = OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING; - } - - $methods = openssl_get_cipher_methods(); - if (in_array($this->cipher_name_openssl, $methods)) { - return true; - } - // not all of openssl's symmetric cipher's support ctr. for those - // that don't we'll emulate it - switch ($this->mode) { - case self::MODE_CTR: - if (in_array($this->cipher_name_openssl_ecb, $methods)) { - $this->openssl_emulate_ctr = true; - return true; - } - } - return false; - case self::ENGINE_MCRYPT: - return $this->cipher_name_mcrypt && - extension_loaded('mcrypt') && - in_array($this->cipher_name_mcrypt, mcrypt_list_algorithms()); - case self::ENGINE_INTERNAL: - return true; - } - - return false; - } - - /** - * Sets the preferred crypt engine - * - * Currently, $engine could be: - * - * - \phpseclib\Crypt\Base::ENGINE_OPENSSL [very fast] - * - * - \phpseclib\Crypt\Base::ENGINE_MCRYPT [fast] - * - * - \phpseclib\Crypt\Base::ENGINE_INTERNAL [slow] - * - * If the preferred crypt engine is not available the fastest available one will be used - * - * @see self::__construct() - * @param int $engine - * @access public - */ - function setPreferredEngine($engine) - { - switch ($engine) { - //case self::ENGINE_OPENSSL; - case self::ENGINE_MCRYPT: - case self::ENGINE_INTERNAL: - $this->preferredEngine = $engine; - break; - default: - $this->preferredEngine = self::ENGINE_OPENSSL; - } - - $this->_setEngine(); - } - - /** - * Returns the engine currently being utilized - * - * @see self::_setEngine() - * @access public - */ - function getEngine() - { - return $this->engine; - } - - /** - * Sets the engine as appropriate - * - * @see self::__construct() - * @access private - */ - function _setEngine() - { - $this->engine = null; - - $candidateEngines = array( - $this->preferredEngine, - self::ENGINE_OPENSSL, - self::ENGINE_MCRYPT - ); - foreach ($candidateEngines as $engine) { - if ($this->isValidEngine($engine)) { - $this->engine = $engine; - break; - } - } - if (!$this->engine) { - $this->engine = self::ENGINE_INTERNAL; - } - - if ($this->engine != self::ENGINE_MCRYPT && $this->enmcrypt) { - // Closing the current mcrypt resource(s). _mcryptSetup() will, if needed, - // (re)open them with the module named in $this->cipher_name_mcrypt - mcrypt_module_close($this->enmcrypt); - mcrypt_module_close($this->demcrypt); - $this->enmcrypt = null; - $this->demcrypt = null; - - if ($this->ecb) { - mcrypt_module_close($this->ecb); - $this->ecb = null; - } - } - - $this->changed = true; - } - - /** - * Encrypts a block - * - * Note: Must be extended by the child \phpseclib\Crypt\* class - * - * @access private - * @param string $in - * @return string - */ - abstract function _encryptBlock($in); - - /** - * Decrypts a block - * - * Note: Must be extended by the child \phpseclib\Crypt\* class - * - * @access private - * @param string $in - * @return string - */ - abstract function _decryptBlock($in); - - /** - * Setup the key (expansion) - * - * Only used if $engine == self::ENGINE_INTERNAL - * - * Note: Must extend by the child \phpseclib\Crypt\* class - * - * @see self::_setup() - * @access private - */ - abstract function _setupKey(); - - /** - * Setup the self::ENGINE_INTERNAL $engine - * - * (re)init, if necessary, the internal cipher $engine and flush all $buffers - * Used (only) if $engine == self::ENGINE_INTERNAL - * - * _setup() will be called each time if $changed === true - * typically this happens when using one or more of following public methods: - * - * - setKey() - * - * - setIV() - * - * - disableContinuousBuffer() - * - * - First run of encrypt() / decrypt() with no init-settings - * - * @see self::setKey() - * @see self::setIV() - * @see self::disableContinuousBuffer() - * @access private - * @internal _setup() is always called before en/decryption. - * @internal Could, but not must, extend by the child Crypt_* class - */ - function _setup() - { - $this->_clearBuffers(); - $this->_setupKey(); - - if ($this->use_inline_crypt) { - $this->_setupInlineCrypt(); - } - } - - /** - * Setup the self::ENGINE_MCRYPT $engine - * - * (re)init, if necessary, the (ext)mcrypt resources and flush all $buffers - * Used (only) if $engine = self::ENGINE_MCRYPT - * - * _setupMcrypt() will be called each time if $changed === true - * typically this happens when using one or more of following public methods: - * - * - setKey() - * - * - setIV() - * - * - disableContinuousBuffer() - * - * - First run of encrypt() / decrypt() - * - * @see self::setKey() - * @see self::setIV() - * @see self::disableContinuousBuffer() - * @access private - * @internal Could, but not must, extend by the child Crypt_* class - */ - function _setupMcrypt() - { - $this->_clearBuffers(); - $this->enchanged = $this->dechanged = true; - - if (!isset($this->enmcrypt)) { - static $mcrypt_modes = array( - self::MODE_CTR => 'ctr', - self::MODE_ECB => MCRYPT_MODE_ECB, - self::MODE_CBC => MCRYPT_MODE_CBC, - self::MODE_CFB => 'ncfb', - self::MODE_OFB => MCRYPT_MODE_NOFB, - self::MODE_STREAM => MCRYPT_MODE_STREAM, - ); - - $this->demcrypt = mcrypt_module_open($this->cipher_name_mcrypt, '', $mcrypt_modes[$this->mode], ''); - $this->enmcrypt = mcrypt_module_open($this->cipher_name_mcrypt, '', $mcrypt_modes[$this->mode], ''); - - // we need the $ecb mcrypt resource (only) in MODE_CFB with enableContinuousBuffer() - // to workaround mcrypt's broken ncfb implementation in buffered mode - // see: {@link http://phpseclib.sourceforge.net/cfb-demo.phps} - if ($this->mode == self::MODE_CFB) { - $this->ecb = mcrypt_module_open($this->cipher_name_mcrypt, '', MCRYPT_MODE_ECB, ''); - } - } // else should mcrypt_generic_deinit be called? - - if ($this->mode == self::MODE_CFB) { - mcrypt_generic_init($this->ecb, $this->key, str_repeat("\0", $this->block_size)); - } - } - - /** - * Pads a string - * - * Pads a string using the RSA PKCS padding standards so that its length is a multiple of the blocksize. - * $this->block_size - (strlen($text) % $this->block_size) bytes are added, each of which is equal to - * chr($this->block_size - (strlen($text) % $this->block_size) - * - * If padding is disabled and $text is not a multiple of the blocksize, the string will be padded regardless - * and padding will, hence forth, be enabled. - * - * @see self::_unpad() - * @param string $text - * @access private - * @return string - */ - function _pad($text) - { - $length = strlen($text); - - if (!$this->padding) { - if ($length % $this->block_size == 0) { - return $text; - } else { - user_error("The plaintext's length ($length) is not a multiple of the block size ({$this->block_size})"); - $this->padding = true; - } - } - - $pad = $this->block_size - ($length % $this->block_size); - - return str_pad($text, $length + $pad, chr($pad)); - } - - /** - * Unpads a string. - * - * If padding is enabled and the reported padding length is invalid the encryption key will be assumed to be wrong - * and false will be returned. - * - * @see self::_pad() - * @param string $text - * @access private - * @return string - */ - function _unpad($text) - { - if (!$this->padding) { - return $text; - } - - $length = ord($text[strlen($text) - 1]); - - if (!$length || $length > $this->block_size) { - return false; - } - - return substr($text, 0, -$length); - } - - /** - * Clears internal buffers - * - * Clearing/resetting the internal buffers is done everytime - * after disableContinuousBuffer() or on cipher $engine (re)init - * ie after setKey() or setIV() - * - * @access public - * @internal Could, but not must, extend by the child Crypt_* class - */ - function _clearBuffers() - { - $this->enbuffer = $this->debuffer = array('ciphertext' => '', 'xor' => '', 'pos' => 0, 'enmcrypt_init' => true); - - // mcrypt's handling of invalid's $iv: - // $this->encryptIV = $this->decryptIV = strlen($this->iv) == $this->block_size ? $this->iv : str_repeat("\0", $this->block_size); - $this->encryptIV = $this->decryptIV = str_pad(substr($this->iv, 0, $this->block_size), $this->block_size, "\0"); - - if (!$this->skip_key_adjustment) { - $this->key = str_pad(substr($this->key, 0, $this->key_length), $this->key_length, "\0"); - } - } - - /** - * String Shift - * - * Inspired by array_shift - * - * @param string $string - * @param int $index - * @access private - * @return string - */ - function _string_shift(&$string, $index = 1) - { - $substr = substr($string, 0, $index); - $string = substr($string, $index); - return $substr; - } - - /** - * String Pop - * - * Inspired by array_pop - * - * @param string $string - * @param int $index - * @access private - * @return string - */ - function _string_pop(&$string, $index = 1) - { - $substr = substr($string, -$index); - $string = substr($string, 0, -$index); - return $substr; - } - - /** - * Increment the current string - * - * @see self::decrypt() - * @see self::encrypt() - * @param string $var - * @access private - */ - function _increment_str(&$var) - { - for ($i = 4; $i <= strlen($var); $i+= 4) { - $temp = substr($var, -$i, 4); - switch ($temp) { - case "\xFF\xFF\xFF\xFF": - $var = substr_replace($var, "\x00\x00\x00\x00", -$i, 4); - break; - case "\x7F\xFF\xFF\xFF": - $var = substr_replace($var, "\x80\x00\x00\x00", -$i, 4); - return; - default: - $temp = unpack('Nnum', $temp); - $var = substr_replace($var, pack('N', $temp['num'] + 1), -$i, 4); - return; - } - } - - $remainder = strlen($var) % 4; - - if ($remainder == 0) { - return; - } - - $temp = unpack('Nnum', str_pad(substr($var, 0, $remainder), 4, "\0", STR_PAD_LEFT)); - $temp = substr(pack('N', $temp['num'] + 1), -$remainder); - $var = substr_replace($var, $temp, 0, $remainder); - } - - /** - * Setup the performance-optimized function for de/encrypt() - * - * Stores the created (or existing) callback function-name - * in $this->inline_crypt - * - * Internally for phpseclib developers: - * - * _setupInlineCrypt() would be called only if: - * - * - $engine == self::ENGINE_INTERNAL and - * - * - $use_inline_crypt === true - * - * - each time on _setup(), after(!) _setupKey() - * - * - * This ensures that _setupInlineCrypt() has always a - * full ready2go initializated internal cipher $engine state - * where, for example, the keys allready expanded, - * keys/block_size calculated and such. - * - * It is, each time if called, the responsibility of _setupInlineCrypt(): - * - * - to set $this->inline_crypt to a valid and fully working callback function - * as a (faster) replacement for encrypt() / decrypt() - * - * - NOT to create unlimited callback functions (for memory reasons!) - * no matter how often _setupInlineCrypt() would be called. At some - * point of amount they must be generic re-useable. - * - * - the code of _setupInlineCrypt() it self, - * and the generated callback code, - * must be, in following order: - * - 100% safe - * - 100% compatible to encrypt()/decrypt() - * - using only php5+ features/lang-constructs/php-extensions if - * compatibility (down to php4) or fallback is provided - * - readable/maintainable/understandable/commented and... not-cryptic-styled-code :-) - * - >= 10% faster than encrypt()/decrypt() [which is, by the way, - * the reason for the existence of _setupInlineCrypt() :-)] - * - memory-nice - * - short (as good as possible) - * - * Note: - _setupInlineCrypt() is using _createInlineCryptFunction() to create the full callback function code. - * - In case of using inline crypting, _setupInlineCrypt() must extend by the child \phpseclib\Crypt\* class. - * - The following variable names are reserved: - * - $_* (all variable names prefixed with an underscore) - * - $self (object reference to it self. Do not use $this, but $self instead) - * - $in (the content of $in has to en/decrypt by the generated code) - * - The callback function should not use the 'return' statement, but en/decrypt'ing the content of $in only - * - * - * @see self::_setup() - * @see self::_createInlineCryptFunction() - * @see self::encrypt() - * @see self::decrypt() - * @access private - * @internal If a Crypt_* class providing inline crypting it must extend _setupInlineCrypt() - */ - function _setupInlineCrypt() - { - // If, for any reason, an extending \phpseclib\Crypt\Base() \phpseclib\Crypt\* class - // not using inline crypting then it must be ensured that: $this->use_inline_crypt = false - // ie in the class var declaration of $use_inline_crypt in general for the \phpseclib\Crypt\* class, - // in the constructor at object instance-time - // or, if it's runtime-specific, at runtime - - $this->use_inline_crypt = false; - } - - /** - * Creates the performance-optimized function for en/decrypt() - * - * Internally for phpseclib developers: - * - * _createInlineCryptFunction(): - * - * - merge the $cipher_code [setup'ed by _setupInlineCrypt()] - * with the current [$this->]mode of operation code - * - * - create the $inline function, which called by encrypt() / decrypt() - * as its replacement to speed up the en/decryption operations. - * - * - return the name of the created $inline callback function - * - * - used to speed up en/decryption - * - * - * - * The main reason why can speed up things [up to 50%] this way are: - * - * - using variables more effective then regular. - * (ie no use of expensive arrays but integers $k_0, $k_1 ... - * or even, for example, the pure $key[] values hardcoded) - * - * - avoiding 1000's of function calls of ie _encryptBlock() - * but inlining the crypt operations. - * in the mode of operation for() loop. - * - * - full loop unroll the (sometimes key-dependent) rounds - * avoiding this way ++$i counters and runtime-if's etc... - * - * The basic code architectur of the generated $inline en/decrypt() - * lambda function, in pseudo php, is: - * - * - * +----------------------------------------------------------------------------------------------+ - * | callback $inline = create_function: | - * | lambda_function_0001_crypt_ECB($action, $text) | - * | { | - * | INSERT PHP CODE OF: | - * | $cipher_code['init_crypt']; // general init code. | - * | // ie: $sbox'es declarations used for | - * | // encrypt and decrypt'ing. | - * | | - * | switch ($action) { | - * | case 'encrypt': | - * | INSERT PHP CODE OF: | - * | $cipher_code['init_encrypt']; // encrypt sepcific init code. | - * | ie: specified $key or $box | - * | declarations for encrypt'ing. | - * | | - * | foreach ($ciphertext) { | - * | $in = $block_size of $ciphertext; | - * | | - * | INSERT PHP CODE OF: | - * | $cipher_code['encrypt_block']; // encrypt's (string) $in, which is always: | - * | // strlen($in) == $this->block_size | - * | // here comes the cipher algorithm in action | - * | // for encryption. | - * | // $cipher_code['encrypt_block'] has to | - * | // encrypt the content of the $in variable | - * | | - * | $plaintext .= $in; | - * | } | - * | return $plaintext; | - * | | - * | case 'decrypt': | - * | INSERT PHP CODE OF: | - * | $cipher_code['init_decrypt']; // decrypt sepcific init code | - * | ie: specified $key or $box | - * | declarations for decrypt'ing. | - * | foreach ($plaintext) { | - * | $in = $block_size of $plaintext; | - * | | - * | INSERT PHP CODE OF: | - * | $cipher_code['decrypt_block']; // decrypt's (string) $in, which is always | - * | // strlen($in) == $this->block_size | - * | // here comes the cipher algorithm in action | - * | // for decryption. | - * | // $cipher_code['decrypt_block'] has to | - * | // decrypt the content of the $in variable | - * | $ciphertext .= $in; | - * | } | - * | return $ciphertext; | - * | } | - * | } | - * +----------------------------------------------------------------------------------------------+ - * - * - * See also the \phpseclib\Crypt\*::_setupInlineCrypt()'s for - * productive inline $cipher_code's how they works. - * - * Structure of: - * - * $cipher_code = array( - * 'init_crypt' => (string) '', // optional - * 'init_encrypt' => (string) '', // optional - * 'init_decrypt' => (string) '', // optional - * 'encrypt_block' => (string) '', // required - * 'decrypt_block' => (string) '' // required - * ); - * - * - * @see self::_setupInlineCrypt() - * @see self::encrypt() - * @see self::decrypt() - * @param array $cipher_code - * @access private - * @return string (the name of the created callback function) - */ - function _createInlineCryptFunction($cipher_code) - { - $block_size = $this->block_size; - - // optional - $init_crypt = isset($cipher_code['init_crypt']) ? $cipher_code['init_crypt'] : ''; - $init_encrypt = isset($cipher_code['init_encrypt']) ? $cipher_code['init_encrypt'] : ''; - $init_decrypt = isset($cipher_code['init_decrypt']) ? $cipher_code['init_decrypt'] : ''; - // required - $encrypt_block = $cipher_code['encrypt_block']; - $decrypt_block = $cipher_code['decrypt_block']; - - // Generating mode of operation inline code, - // merged with the $cipher_code algorithm - // for encrypt- and decryption. - switch ($this->mode) { - case self::MODE_ECB: - $encrypt = $init_encrypt . ' - $_ciphertext = ""; - $_plaintext_len = strlen($_text); - - for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { - $in = substr($_text, $_i, '.$block_size.'); - '.$encrypt_block.' - $_ciphertext.= $in; - } - - return $_ciphertext; - '; - - $decrypt = $init_decrypt . ' - $_plaintext = ""; - $_text = str_pad($_text, strlen($_text) + ('.$block_size.' - strlen($_text) % '.$block_size.') % '.$block_size.', chr(0)); - $_ciphertext_len = strlen($_text); - - for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { - $in = substr($_text, $_i, '.$block_size.'); - '.$decrypt_block.' - $_plaintext.= $in; - } - - return $self->_unpad($_plaintext); - '; - break; - case self::MODE_CTR: - $encrypt = $init_encrypt . ' - $_ciphertext = ""; - $_plaintext_len = strlen($_text); - $_xor = $self->encryptIV; - $_buffer = &$self->enbuffer; - if (strlen($_buffer["ciphertext"])) { - for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { - $_block = substr($_text, $_i, '.$block_size.'); - if (strlen($_block) > strlen($_buffer["ciphertext"])) { - $in = $_xor; - '.$encrypt_block.' - $self->_increment_str($_xor); - $_buffer["ciphertext"].= $in; - } - $_key = $self->_string_shift($_buffer["ciphertext"], '.$block_size.'); - $_ciphertext.= $_block ^ $_key; - } - } else { - for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { - $_block = substr($_text, $_i, '.$block_size.'); - $in = $_xor; - '.$encrypt_block.' - $self->_increment_str($_xor); - $_key = $in; - $_ciphertext.= $_block ^ $_key; - } - } - if ($self->continuousBuffer) { - $self->encryptIV = $_xor; - if ($_start = $_plaintext_len % '.$block_size.') { - $_buffer["ciphertext"] = substr($_key, $_start) . $_buffer["ciphertext"]; - } - } - - return $_ciphertext; - '; - - $decrypt = $init_encrypt . ' - $_plaintext = ""; - $_ciphertext_len = strlen($_text); - $_xor = $self->decryptIV; - $_buffer = &$self->debuffer; - - if (strlen($_buffer["ciphertext"])) { - for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { - $_block = substr($_text, $_i, '.$block_size.'); - if (strlen($_block) > strlen($_buffer["ciphertext"])) { - $in = $_xor; - '.$encrypt_block.' - $self->_increment_str($_xor); - $_buffer["ciphertext"].= $in; - } - $_key = $self->_string_shift($_buffer["ciphertext"], '.$block_size.'); - $_plaintext.= $_block ^ $_key; - } - } else { - for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { - $_block = substr($_text, $_i, '.$block_size.'); - $in = $_xor; - '.$encrypt_block.' - $self->_increment_str($_xor); - $_key = $in; - $_plaintext.= $_block ^ $_key; - } - } - if ($self->continuousBuffer) { - $self->decryptIV = $_xor; - if ($_start = $_ciphertext_len % '.$block_size.') { - $_buffer["ciphertext"] = substr($_key, $_start) . $_buffer["ciphertext"]; - } - } - - return $_plaintext; - '; - break; - case self::MODE_CFB: - $encrypt = $init_encrypt . ' - $_ciphertext = ""; - $_buffer = &$self->enbuffer; - - if ($self->continuousBuffer) { - $_iv = &$self->encryptIV; - $_pos = &$_buffer["pos"]; - } else { - $_iv = $self->encryptIV; - $_pos = 0; - } - $_len = strlen($_text); - $_i = 0; - if ($_pos) { - $_orig_pos = $_pos; - $_max = '.$block_size.' - $_pos; - if ($_len >= $_max) { - $_i = $_max; - $_len-= $_max; - $_pos = 0; - } else { - $_i = $_len; - $_pos+= $_len; - $_len = 0; - } - $_ciphertext = substr($_iv, $_orig_pos) ^ $_text; - $_iv = substr_replace($_iv, $_ciphertext, $_orig_pos, $_i); - } - while ($_len >= '.$block_size.') { - $in = $_iv; - '.$encrypt_block.'; - $_iv = $in ^ substr($_text, $_i, '.$block_size.'); - $_ciphertext.= $_iv; - $_len-= '.$block_size.'; - $_i+= '.$block_size.'; - } - if ($_len) { - $in = $_iv; - '.$encrypt_block.' - $_iv = $in; - $_block = $_iv ^ substr($_text, $_i); - $_iv = substr_replace($_iv, $_block, 0, $_len); - $_ciphertext.= $_block; - $_pos = $_len; - } - return $_ciphertext; - '; - - $decrypt = $init_encrypt . ' - $_plaintext = ""; - $_buffer = &$self->debuffer; - - if ($self->continuousBuffer) { - $_iv = &$self->decryptIV; - $_pos = &$_buffer["pos"]; - } else { - $_iv = $self->decryptIV; - $_pos = 0; - } - $_len = strlen($_text); - $_i = 0; - if ($_pos) { - $_orig_pos = $_pos; - $_max = '.$block_size.' - $_pos; - if ($_len >= $_max) { - $_i = $_max; - $_len-= $_max; - $_pos = 0; - } else { - $_i = $_len; - $_pos+= $_len; - $_len = 0; - } - $_plaintext = substr($_iv, $_orig_pos) ^ $_text; - $_iv = substr_replace($_iv, substr($_text, 0, $_i), $_orig_pos, $_i); - } - while ($_len >= '.$block_size.') { - $in = $_iv; - '.$encrypt_block.' - $_iv = $in; - $cb = substr($_text, $_i, '.$block_size.'); - $_plaintext.= $_iv ^ $cb; - $_iv = $cb; - $_len-= '.$block_size.'; - $_i+= '.$block_size.'; - } - if ($_len) { - $in = $_iv; - '.$encrypt_block.' - $_iv = $in; - $_plaintext.= $_iv ^ substr($_text, $_i); - $_iv = substr_replace($_iv, substr($_text, $_i), 0, $_len); - $_pos = $_len; - } - - return $_plaintext; - '; - break; - case self::MODE_OFB: - $encrypt = $init_encrypt . ' - $_ciphertext = ""; - $_plaintext_len = strlen($_text); - $_xor = $self->encryptIV; - $_buffer = &$self->enbuffer; - - if (strlen($_buffer["xor"])) { - for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { - $_block = substr($_text, $_i, '.$block_size.'); - if (strlen($_block) > strlen($_buffer["xor"])) { - $in = $_xor; - '.$encrypt_block.' - $_xor = $in; - $_buffer["xor"].= $_xor; - } - $_key = $self->_string_shift($_buffer["xor"], '.$block_size.'); - $_ciphertext.= $_block ^ $_key; - } - } else { - for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { - $in = $_xor; - '.$encrypt_block.' - $_xor = $in; - $_ciphertext.= substr($_text, $_i, '.$block_size.') ^ $_xor; - } - $_key = $_xor; - } - if ($self->continuousBuffer) { - $self->encryptIV = $_xor; - if ($_start = $_plaintext_len % '.$block_size.') { - $_buffer["xor"] = substr($_key, $_start) . $_buffer["xor"]; - } - } - return $_ciphertext; - '; - - $decrypt = $init_encrypt . ' - $_plaintext = ""; - $_ciphertext_len = strlen($_text); - $_xor = $self->decryptIV; - $_buffer = &$self->debuffer; - - if (strlen($_buffer["xor"])) { - for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { - $_block = substr($_text, $_i, '.$block_size.'); - if (strlen($_block) > strlen($_buffer["xor"])) { - $in = $_xor; - '.$encrypt_block.' - $_xor = $in; - $_buffer["xor"].= $_xor; - } - $_key = $self->_string_shift($_buffer["xor"], '.$block_size.'); - $_plaintext.= $_block ^ $_key; - } - } else { - for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { - $in = $_xor; - '.$encrypt_block.' - $_xor = $in; - $_plaintext.= substr($_text, $_i, '.$block_size.') ^ $_xor; - } - $_key = $_xor; - } - if ($self->continuousBuffer) { - $self->decryptIV = $_xor; - if ($_start = $_ciphertext_len % '.$block_size.') { - $_buffer["xor"] = substr($_key, $_start) . $_buffer["xor"]; - } - } - return $_plaintext; - '; - break; - case self::MODE_STREAM: - $encrypt = $init_encrypt . ' - $_ciphertext = ""; - '.$encrypt_block.' - return $_ciphertext; - '; - $decrypt = $init_decrypt . ' - $_plaintext = ""; - '.$decrypt_block.' - return $_plaintext; - '; - break; - // case self::MODE_CBC: - default: - $encrypt = $init_encrypt . ' - $_ciphertext = ""; - $_plaintext_len = strlen($_text); - - $in = $self->encryptIV; - - for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { - $in = substr($_text, $_i, '.$block_size.') ^ $in; - '.$encrypt_block.' - $_ciphertext.= $in; - } - - if ($self->continuousBuffer) { - $self->encryptIV = $in; - } - - return $_ciphertext; - '; - - $decrypt = $init_decrypt . ' - $_plaintext = ""; - $_text = str_pad($_text, strlen($_text) + ('.$block_size.' - strlen($_text) % '.$block_size.') % '.$block_size.', chr(0)); - $_ciphertext_len = strlen($_text); - - $_iv = $self->decryptIV; - - for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { - $in = $_block = substr($_text, $_i, '.$block_size.'); - '.$decrypt_block.' - $_plaintext.= $in ^ $_iv; - $_iv = $_block; - } - - if ($self->continuousBuffer) { - $self->decryptIV = $_iv; - } - - return $self->_unpad($_plaintext); - '; - break; - } - - // Create the $inline function and return its name as string. Ready to run! - return create_function('$_action, &$self, $_text', $init_crypt . 'if ($_action == "encrypt") { ' . $encrypt . ' } else { ' . $decrypt . ' }'); - } - - /** - * Holds the lambda_functions table (classwide) - * - * Each name of the lambda function, created from - * _setupInlineCrypt() && _createInlineCryptFunction() - * is stored, classwide (!), here for reusing. - * - * The string-based index of $function is a classwide - * uniqe value representing, at least, the $mode of - * operation (or more... depends of the optimizing level) - * for which $mode the lambda function was created. - * - * @access private - * @return array &$functions - */ - function &_getLambdaFunctions() - { - static $functions = array(); - return $functions; - } - - /** - * Generates a digest from $bytes - * - * @see self::_setupInlineCrypt() - * @access private - * @param $bytes - * @return string - */ - function _hashInlineCryptFunction($bytes) - { - if (!isset(self::$WHIRLPOOL_AVAILABLE)) { - self::$WHIRLPOOL_AVAILABLE = extension_loaded('hash') && in_array('whirlpool', hash_algos()); - } - - $result = ''; - $hash = $bytes; - - switch (true) { - case self::$WHIRLPOOL_AVAILABLE: - foreach (str_split($bytes, 64) as $t) { - $hash = hash('whirlpool', $hash, true); - $result .= $t ^ $hash; - } - return $result . hash('whirlpool', $hash, true); - default: - $len = strlen($bytes); - for ($i = 0; $i < $len; $i+=20) { - $t = substr($bytes, $i, 20); - $hash = pack('H*', sha1($hash)); - $result .= $t ^ $hash; - } - return $result . pack('H*', sha1($hash)); - } - } -} diff --git a/#pma/libraries/phpseclib/Crypt/Random.php b/#pma/libraries/phpseclib/Crypt/Random.php deleted file mode 100644 index 586bd6c4..00000000 --- a/#pma/libraries/phpseclib/Crypt/Random.php +++ /dev/null @@ -1,243 +0,0 @@ - - * - * - * - * @category Crypt - * @package Random - * @author Jim Wigginton - * @copyright 2007 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://phpseclib.sourceforge.net - */ - -namespace phpseclib\Crypt; - -use phpseclib\Crypt\AES; -use phpseclib\Crypt\Base; -use phpseclib\Crypt\Blowfish; -use phpseclib\Crypt\DES; -use phpseclib\Crypt\RC4; -use phpseclib\Crypt\TripleDES; -use phpseclib\Crypt\Twofish; - -/** - * Pure-PHP Random Number Generator - * - * @package Random - * @author Jim Wigginton - * @access public - */ -class Random -{ - /** - * Generate a random string. - * - * Although microoptimizations are generally discouraged as they impair readability this function is ripe with - * microoptimizations because this function has the potential of being called a huge number of times. - * eg. for RSA key generation. - * - * @param int $length - * @return string - */ - static function string($length) - { - if (version_compare(PHP_VERSION, '7.0.0', '>=')) { - try { - return \random_bytes($length); - } catch (\Throwable $e) { - // If a sufficient source of randomness is unavailable, random_bytes() will throw an - // object that implements the Throwable interface (Exception, TypeError, Error). - // We don't actually need to do anything here. The string() method should just continue - // as normal. Note, however, that if we don't have a sufficient source of randomness for - // random_bytes(), most of the other calls here will fail too, so we'll end up using - // the PHP implementation. - } - } - - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - // method 1. prior to PHP 5.3 this would call rand() on windows hence the function_exists('class_alias') call. - // ie. class_alias is a function that was introduced in PHP 5.3 - if (extension_loaded('mcrypt') && function_exists('class_alias')) { - return mcrypt_create_iv($length); - } - // method 2. openssl_random_pseudo_bytes was introduced in PHP 5.3.0 but prior to PHP 5.3.4 there was, - // to quote , "possible blocking behavior". as of 5.3.4 - // openssl_random_pseudo_bytes and mcrypt_create_iv do the exact same thing on Windows. ie. they both - // call php_win32_get_random_bytes(): - // - // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/openssl/openssl.c#L5008 - // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1392 - // - // php_win32_get_random_bytes() is defined thusly: - // - // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/win32/winutil.c#L80 - // - // we're calling it, all the same, in the off chance that the mcrypt extension is not available - if (extension_loaded('openssl') && version_compare(PHP_VERSION, '5.3.4', '>=')) { - return openssl_random_pseudo_bytes($length); - } - } else { - // method 1. the fastest - if (extension_loaded('openssl')) { - return openssl_random_pseudo_bytes($length); - } - // method 2 - static $fp = true; - if ($fp === true) { - // warning's will be output unles the error suppression operator is used. errors such as - // "open_basedir restriction in effect", "Permission denied", "No such file or directory", etc. - $fp = @fopen('/dev/urandom', 'rb'); - } - if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource() - return fread($fp, $length); - } - // method 3. pretty much does the same thing as method 2 per the following url: - // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391 - // surprisingly slower than method 2. maybe that's because mcrypt_create_iv does a bunch of error checking that we're - // not doing. regardless, this'll only be called if this PHP script couldn't open /dev/urandom due to open_basedir - // restrictions or some such - if (extension_loaded('mcrypt')) { - return mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); - } - } - // at this point we have no choice but to use a pure-PHP CSPRNG - - // cascade entropy across multiple PHP instances by fixing the session and collecting all - // environmental variables, including the previous session data and the current session - // data. - // - // mt_rand seeds itself by looking at the PID and the time, both of which are (relatively) - // easy to guess at. linux uses mouse clicks, keyboard timings, etc, as entropy sources, but - // PHP isn't low level to be able to use those as sources and on a web server there's not likely - // going to be a ton of keyboard or mouse action. web servers do have one thing that we can use - // however, a ton of people visiting the website. obviously you don't want to base your seeding - // soley on parameters a potential attacker sends but (1) not everything in $_SERVER is controlled - // by the user and (2) this isn't just looking at the data sent by the current user - it's based - // on the data sent by all users. one user requests the page and a hash of their info is saved. - // another user visits the page and the serialization of their data is utilized along with the - // server envirnment stuff and a hash of the previous http request data (which itself utilizes - // a hash of the session data before that). certainly an attacker should be assumed to have - // full control over his own http requests. he, however, is not going to have control over - // everyone's http requests. - static $crypto = false, $v; - if ($crypto === false) { - // save old session data - $old_session_id = session_id(); - $old_use_cookies = ini_get('session.use_cookies'); - $old_session_cache_limiter = session_cache_limiter(); - $_OLD_SESSION = isset($_SESSION) ? $_SESSION : false; - if ($old_session_id != '') { - session_write_close(); - } - - session_id(1); - ini_set('session.use_cookies', 0); - session_cache_limiter(''); - session_start(); - - $v = $seed = $_SESSION['seed'] = pack('H*', sha1( - serialize($_SERVER) . - serialize($_POST) . - serialize($_GET) . - serialize($_COOKIE) . - serialize($GLOBALS) . - serialize($_SESSION) . - serialize($_OLD_SESSION) - )); - if (!isset($_SESSION['count'])) { - $_SESSION['count'] = 0; - } - $_SESSION['count']++; - - session_write_close(); - - // restore old session data - if ($old_session_id != '') { - session_id($old_session_id); - session_start(); - ini_set('session.use_cookies', $old_use_cookies); - session_cache_limiter($old_session_cache_limiter); - } else { - if ($_OLD_SESSION !== false) { - $_SESSION = $_OLD_SESSION; - unset($_OLD_SESSION); - } else { - unset($_SESSION); - } - } - - // in SSH2 a shared secret and an exchange hash are generated through the key exchange process. - // the IV client to server is the hash of that "nonce" with the letter A and for the encryption key it's the letter C. - // if the hash doesn't produce enough a key or an IV that's long enough concat successive hashes of the - // original hash and the current hash. we'll be emulating that. for more info see the following URL: - // - // http://tools.ietf.org/html/rfc4253#section-7.2 - // - // see the is_string($crypto) part for an example of how to expand the keys - $key = pack('H*', sha1($seed . 'A')); - $iv = pack('H*', sha1($seed . 'C')); - - // ciphers are used as per the nist.gov link below. also, see this link: - // - // http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator#Designs_based_on_cryptographic_primitives - switch (true) { - case class_exists('\phpseclib\Crypt\AES'): - $crypto = new AES(Base::MODE_CTR); - break; - case class_exists('\phpseclib\Crypt\Twofish'): - $crypto = new Twofish(Base::MODE_CTR); - break; - case class_exists('\phpseclib\Crypt\Blowfish'): - $crypto = new Blowfish(Base::MODE_CTR); - break; - case class_exists('\phpseclib\Crypt\TripleDES'): - $crypto = new TripleDES(Base::MODE_CTR); - break; - case class_exists('\phpseclib\Crypt\DES'): - $crypto = new DES(Base::MODE_CTR); - break; - case class_exists('\phpseclib\Crypt\RC4'): - $crypto = new RC4(); - break; - default: - user_error(__CLASS__ . ' requires at least one symmetric cipher be loaded'); - return false; - } - - $crypto->setKey($key); - $crypto->setIV($iv); - $crypto->enableContinuousBuffer(); - } - - //return $crypto->encrypt(str_repeat("\0", $length)); - - // the following is based off of ANSI X9.31: - // - // http://csrc.nist.gov/groups/STM/cavp/documents/rng/931rngext.pdf - // - // OpenSSL uses that same standard for it's random numbers: - // - // http://www.opensource.apple.com/source/OpenSSL/OpenSSL-38/openssl/fips-1.0/rand/fips_rand.c - // (do a search for "ANS X9.31 A.2.4") - $result = ''; - while (strlen($result) < $length) { - $i = $crypto->encrypt(microtime()); // strlen(microtime()) == 21 - $r = $crypto->encrypt($i ^ $v); // strlen($v) == 20 - $v = $crypto->encrypt($r ^ $i); // strlen($r) == 20 - $result.= $r; - } - return substr($result, 0, $length); - } -} diff --git a/#pma/libraries/phpseclib/Crypt/Rijndael.php b/#pma/libraries/phpseclib/Crypt/Rijndael.php deleted file mode 100644 index 05bfc982..00000000 --- a/#pma/libraries/phpseclib/Crypt/Rijndael.php +++ /dev/null @@ -1,941 +0,0 @@ - - * setKey('abcdefghijklmnop'); - * - * $size = 10 * 1024; - * $plaintext = ''; - * for ($i = 0; $i < $size; $i++) { - * $plaintext.= 'a'; - * } - * - * echo $rijndael->decrypt($rijndael->encrypt($plaintext)); - * ?> - * - * - * @category Crypt - * @package Rijndael - * @author Jim Wigginton - * @copyright 2008 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://phpseclib.sourceforge.net - */ -namespace phpseclib\Crypt; - -if (! defined('PHPMYADMIN')) { - exit; -} - -use phpseclib\Crypt\Base; - -/** - * Pure-PHP implementation of Rijndael. - * - * @package Rijndael - * @author Jim Wigginton - * @access public - */ -class Rijndael extends Base -{ - /** - * The mcrypt specific name of the cipher - * - * Mcrypt is useable for 128/192/256-bit $block_size/$key_length. For 160/224 not. - * \phpseclib\Crypt\Rijndael determines automatically whether mcrypt is useable - * or not for the current $block_size/$key_length. - * In case of, $cipher_name_mcrypt will be set dynamically at run time accordingly. - * - * @see \phpseclib\Crypt\Base::cipher_name_mcrypt - * @see \phpseclib\Crypt\Base::engine - * @see self::isValidEngine() - * @var string - * @access private - */ - var $cipher_name_mcrypt = 'rijndael-128'; - - /** - * The default salt used by setPassword() - * - * @see \phpseclib\Crypt\Base::password_default_salt - * @see \phpseclib\Crypt\Base::setPassword() - * @var string - * @access private - */ - var $password_default_salt = 'phpseclib'; - - /** - * The Key Schedule - * - * @see self::_setup() - * @var array - * @access private - */ - var $w; - - /** - * The Inverse Key Schedule - * - * @see self::_setup() - * @var array - * @access private - */ - var $dw; - - /** - * The Block Length divided by 32 - * - * @see self::setBlockLength() - * @var int - * @access private - * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4. Exists in conjunction with $block_size - * because the encryption / decryption / key schedule creation requires this number and not $block_size. We could - * derive this from $block_size or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu - * of that, we'll just precompute it once. - */ - var $Nb = 4; - - /** - * The Key Length (in bytes) - * - * @see self::setKeyLength() - * @var int - * @access private - * @internal The max value is 256 / 8 = 32, the min value is 128 / 8 = 16. Exists in conjunction with $Nk - * because the encryption / decryption / key schedule creation requires this number and not $key_length. We could - * derive this from $key_length or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu - * of that, we'll just precompute it once. - */ - var $key_length = 16; - - /** - * The Key Length divided by 32 - * - * @see self::setKeyLength() - * @var int - * @access private - * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4 - */ - var $Nk = 4; - - /** - * The Number of Rounds - * - * @var int - * @access private - * @internal The max value is 14, the min value is 10. - */ - var $Nr; - - /** - * Shift offsets - * - * @var array - * @access private - */ - var $c; - - /** - * Holds the last used key- and block_size information - * - * @var array - * @access private - */ - var $kl; - - /** - * Sets the key length. - * - * Valid key lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to - * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. - * - * Note: phpseclib extends Rijndael (and AES) for using 160- and 224-bit keys but they are officially not defined - * and the most (if not all) implementations are not able using 160/224-bit keys but round/pad them up to - * 192/256 bits as, for example, mcrypt will do. - * - * That said, if you want be compatible with other Rijndael and AES implementations, - * you should not setKeyLength(160) or setKeyLength(224). - * - * Additional: In case of 160- and 224-bit keys, phpseclib will/can, for that reason, not use - * the mcrypt php extension, even if available. - * This results then in slower encryption. - * - * @access public - * @param int $length - */ - function setKeyLength($length) - { - switch (true) { - case $length <= 128: - $this->key_length = 16; - break; - case $length <= 160: - $this->key_length = 20; - break; - case $length <= 192: - $this->key_length = 24; - break; - case $length <= 224: - $this->key_length = 28; - break; - default: - $this->key_length = 32; - } - - parent::setKeyLength($length); - } - - /** - * Sets the block length - * - * Valid block lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to - * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. - * - * @access public - * @param int $length - */ - function setBlockLength($length) - { - $length >>= 5; - if ($length > 8) { - $length = 8; - } elseif ($length < 4) { - $length = 4; - } - $this->Nb = $length; - $this->block_size = $length << 2; - $this->changed = true; - $this->_setEngine(); - } - - /** - * Test for engine validity - * - * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine() - * - * @see \phpseclib\Crypt\Base::__construct() - * @param int $engine - * @access public - * @return bool - */ - function isValidEngine($engine) - { - switch ($engine) { - case self::ENGINE_OPENSSL: - if ($this->block_size != 16) { - return false; - } - $this->cipher_name_openssl_ecb = 'aes-' . ($this->key_length << 3) . '-ecb'; - $this->cipher_name_openssl = 'aes-' . ($this->key_length << 3) . '-' . $this->_openssl_translate_mode(); - break; - case self::ENGINE_MCRYPT: - $this->cipher_name_mcrypt = 'rijndael-' . ($this->block_size << 3); - if ($this->key_length % 8) { // is it a 160/224-bit key? - // mcrypt is not usable for them, only for 128/192/256-bit keys - return false; - } - } - - return parent::isValidEngine($engine); - } - - /** - * Encrypts a block - * - * @access private - * @param string $in - * @return string - */ - function _encryptBlock($in) - { - static $tables; - if (empty($tables)) { - $tables = &$this->_getTables(); - } - $t0 = $tables[0]; - $t1 = $tables[1]; - $t2 = $tables[2]; - $t3 = $tables[3]; - $sbox = $tables[4]; - - $state = array(); - $words = unpack('N*', $in); - - $c = $this->c; - $w = $this->w; - $Nb = $this->Nb; - $Nr = $this->Nr; - - // addRoundKey - $wc = $Nb - 1; - foreach ($words as $word) { - $state[] = $word ^ $w[++$wc]; - } - - // fips-197.pdf#page=19, "Figure 5. Pseudo Code for the Cipher", states that this loop has four components - - // subBytes, shiftRows, mixColumns, and addRoundKey. fips-197.pdf#page=30, "Implementation Suggestions Regarding - // Various Platforms" suggests that performs enhanced implementations are described in Rijndael-ammended.pdf. - // Rijndael-ammended.pdf#page=20, "Implementation aspects / 32-bit processor", discusses such an optimization. - // Unfortunately, the description given there is not quite correct. Per aes.spec.v316.pdf#page=19 [1], - // equation (7.4.7) is supposed to use addition instead of subtraction, so we'll do that here, as well. - - // [1] http://fp.gladman.plus.com/cryptography_technology/rijndael/aes.spec.v316.pdf - $temp = array(); - for ($round = 1; $round < $Nr; ++$round) { - $i = 0; // $c[0] == 0 - $j = $c[1]; - $k = $c[2]; - $l = $c[3]; - - while ($i < $Nb) { - $temp[$i] = $t0[$state[$i] >> 24 & 0x000000FF] ^ - $t1[$state[$j] >> 16 & 0x000000FF] ^ - $t2[$state[$k] >> 8 & 0x000000FF] ^ - $t3[$state[$l] & 0x000000FF] ^ - $w[++$wc]; - ++$i; - $j = ($j + 1) % $Nb; - $k = ($k + 1) % $Nb; - $l = ($l + 1) % $Nb; - } - $state = $temp; - } - - // subWord - for ($i = 0; $i < $Nb; ++$i) { - $state[$i] = $sbox[$state[$i] & 0x000000FF] | - ($sbox[$state[$i] >> 8 & 0x000000FF] << 8) | - ($sbox[$state[$i] >> 16 & 0x000000FF] << 16) | - ($sbox[$state[$i] >> 24 & 0x000000FF] << 24); - } - - // shiftRows + addRoundKey - $i = 0; // $c[0] == 0 - $j = $c[1]; - $k = $c[2]; - $l = $c[3]; - while ($i < $Nb) { - $temp[$i] = ($state[$i] & 0xFF000000) ^ - ($state[$j] & 0x00FF0000) ^ - ($state[$k] & 0x0000FF00) ^ - ($state[$l] & 0x000000FF) ^ - $w[$i]; - ++$i; - $j = ($j + 1) % $Nb; - $k = ($k + 1) % $Nb; - $l = ($l + 1) % $Nb; - } - - switch ($Nb) { - case 8: - return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6], $temp[7]); - case 7: - return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6]); - case 6: - return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5]); - case 5: - return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4]); - default: - return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3]); - } - } - - /** - * Decrypts a block - * - * @access private - * @param string $in - * @return string - */ - function _decryptBlock($in) - { - static $invtables; - if (empty($invtables)) { - $invtables = &$this->_getInvTables(); - } - $dt0 = $invtables[0]; - $dt1 = $invtables[1]; - $dt2 = $invtables[2]; - $dt3 = $invtables[3]; - $isbox = $invtables[4]; - - $state = array(); - $words = unpack('N*', $in); - - $c = $this->c; - $dw = $this->dw; - $Nb = $this->Nb; - $Nr = $this->Nr; - - // addRoundKey - $wc = $Nb - 1; - foreach ($words as $word) { - $state[] = $word ^ $dw[++$wc]; - } - - $temp = array(); - for ($round = $Nr - 1; $round > 0; --$round) { - $i = 0; // $c[0] == 0 - $j = $Nb - $c[1]; - $k = $Nb - $c[2]; - $l = $Nb - $c[3]; - - while ($i < $Nb) { - $temp[$i] = $dt0[$state[$i] >> 24 & 0x000000FF] ^ - $dt1[$state[$j] >> 16 & 0x000000FF] ^ - $dt2[$state[$k] >> 8 & 0x000000FF] ^ - $dt3[$state[$l] & 0x000000FF] ^ - $dw[++$wc]; - ++$i; - $j = ($j + 1) % $Nb; - $k = ($k + 1) % $Nb; - $l = ($l + 1) % $Nb; - } - $state = $temp; - } - - // invShiftRows + invSubWord + addRoundKey - $i = 0; // $c[0] == 0 - $j = $Nb - $c[1]; - $k = $Nb - $c[2]; - $l = $Nb - $c[3]; - - while ($i < $Nb) { - $word = ($state[$i] & 0xFF000000) | - ($state[$j] & 0x00FF0000) | - ($state[$k] & 0x0000FF00) | - ($state[$l] & 0x000000FF); - - $temp[$i] = $dw[$i] ^ ($isbox[$word & 0x000000FF] | - ($isbox[$word >> 8 & 0x000000FF] << 8) | - ($isbox[$word >> 16 & 0x000000FF] << 16) | - ($isbox[$word >> 24 & 0x000000FF] << 24)); - ++$i; - $j = ($j + 1) % $Nb; - $k = ($k + 1) % $Nb; - $l = ($l + 1) % $Nb; - } - - switch ($Nb) { - case 8: - return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6], $temp[7]); - case 7: - return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6]); - case 6: - return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5]); - case 5: - return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4]); - default: - return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3]); - } - } - - /** - * Setup the key (expansion) - * - * @see \phpseclib\Crypt\Base::_setupKey() - * @access private - */ - function _setupKey() - { - // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field. - // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse - static $rcon = array(0, - 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, - 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000, - 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000, - 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000, - 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000, - 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000 - ); - - if (isset($this->kl['key']) && $this->key === $this->kl['key'] && $this->key_length === $this->kl['key_length'] && $this->block_size === $this->kl['block_size']) { - // already expanded - return; - } - $this->kl = array('key' => $this->key, 'key_length' => $this->key_length, 'block_size' => $this->block_size); - - $this->Nk = $this->key_length >> 2; - // see Rijndael-ammended.pdf#page=44 - $this->Nr = max($this->Nk, $this->Nb) + 6; - - // shift offsets for Nb = 5, 7 are defined in Rijndael-ammended.pdf#page=44, - // "Table 8: Shift offsets in Shiftrow for the alternative block lengths" - // shift offsets for Nb = 4, 6, 8 are defined in Rijndael-ammended.pdf#page=14, - // "Table 2: Shift offsets for different block lengths" - switch ($this->Nb) { - case 4: - case 5: - case 6: - $this->c = array(0, 1, 2, 3); - break; - case 7: - $this->c = array(0, 1, 2, 4); - break; - case 8: - $this->c = array(0, 1, 3, 4); - } - - $w = array_values(unpack('N*words', $this->key)); - - $length = $this->Nb * ($this->Nr + 1); - for ($i = $this->Nk; $i < $length; $i++) { - $temp = $w[$i - 1]; - if ($i % $this->Nk == 0) { - // according to , "the size of an integer is platform-dependent". - // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine, - // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and' - // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is. - $temp = (($temp << 8) & 0xFFFFFF00) | (($temp >> 24) & 0x000000FF); // rotWord - $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk]; - } elseif ($this->Nk > 6 && $i % $this->Nk == 4) { - $temp = $this->_subWord($temp); - } - $w[$i] = $w[$i - $this->Nk] ^ $temp; - } - - // convert the key schedule from a vector of $Nb * ($Nr + 1) length to a matrix with $Nr + 1 rows and $Nb columns - // and generate the inverse key schedule. more specifically, - // according to (section 5.3.3), - // "The key expansion for the Inverse Cipher is defined as follows: - // 1. Apply the Key Expansion. - // 2. Apply InvMixColumn to all Round Keys except the first and the last one." - // also, see fips-197.pdf#page=27, "5.3.5 Equivalent Inverse Cipher" - list($dt0, $dt1, $dt2, $dt3) = $this->_getInvTables(); - $temp = $this->w = $this->dw = array(); - for ($i = $row = $col = 0; $i < $length; $i++, $col++) { - if ($col == $this->Nb) { - if ($row == 0) { - $this->dw[0] = $this->w[0]; - } else { - // subWord + invMixColumn + invSubWord = invMixColumn - $j = 0; - while ($j < $this->Nb) { - $dw = $this->_subWord($this->w[$row][$j]); - $temp[$j] = $dt0[$dw >> 24 & 0x000000FF] ^ - $dt1[$dw >> 16 & 0x000000FF] ^ - $dt2[$dw >> 8 & 0x000000FF] ^ - $dt3[$dw & 0x000000FF]; - $j++; - } - $this->dw[$row] = $temp; - } - - $col = 0; - $row++; - } - $this->w[$row][$col] = $w[$i]; - } - - $this->dw[$row] = $this->w[$row]; - - // Converting to 1-dim key arrays (both ascending) - $this->dw = array_reverse($this->dw); - $w = array_pop($this->w); - $dw = array_pop($this->dw); - foreach ($this->w as $r => $wr) { - foreach ($wr as $c => $wc) { - $w[] = $wc; - $dw[] = $this->dw[$r][$c]; - } - } - $this->w = $w; - $this->dw = $dw; - } - - /** - * Performs S-Box substitutions - * - * @access private - * @param int $word - */ - function _subWord($word) - { - static $sbox; - if (empty($sbox)) { - list(, , , , $sbox) = $this->_getTables(); - } - - return $sbox[$word & 0x000000FF] | - ($sbox[$word >> 8 & 0x000000FF] << 8) | - ($sbox[$word >> 16 & 0x000000FF] << 16) | - ($sbox[$word >> 24 & 0x000000FF] << 24); - } - - /** - * Provides the mixColumns and sboxes tables - * - * @see self::_encryptBlock() - * @see self::_setupInlineCrypt() - * @see self::_subWord() - * @access private - * @return array &$tables - */ - function &_getTables() - { - static $tables; - if (empty($tables)) { - // according to (section 5.2.1), - // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so - // those are the names we'll use. - $t3 = array_map('intval', array( - // with array_map('intval', ...) we ensure we have only int's and not - // some slower floats converted by php automatically on high values - 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491, - 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC, - 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB, - 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B, - 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83, - 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A, - 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F, - 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA, - 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B, - 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713, - 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6, - 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85, - 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411, - 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B, - 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1, - 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF, - 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E, - 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6, - 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B, - 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD, - 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8, - 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2, - 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049, - 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810, - 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197, - 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F, - 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C, - 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927, - 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, - 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, - 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, - 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C - )); - - foreach ($t3 as $t3i) { - $t0[] = (($t3i << 24) & 0xFF000000) | (($t3i >> 8) & 0x00FFFFFF); - $t1[] = (($t3i << 16) & 0xFFFF0000) | (($t3i >> 16) & 0x0000FFFF); - $t2[] = (($t3i << 8) & 0xFFFFFF00) | (($t3i >> 24) & 0x000000FF); - } - - $tables = array( - // The Precomputed mixColumns tables t0 - t3 - $t0, - $t1, - $t2, - $t3, - // The SubByte S-Box - array( - 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, - 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, - 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, - 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75, - 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, - 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, - 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, - 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, - 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73, - 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, - 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, - 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, - 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, - 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, - 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, - 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16 - ) - ); - } - return $tables; - } - - /** - * Provides the inverse mixColumns and inverse sboxes tables - * - * @see self::_decryptBlock() - * @see self::_setupInlineCrypt() - * @see self::_setupKey() - * @access private - * @return array &$tables - */ - function &_getInvTables() - { - static $tables; - if (empty($tables)) { - $dt3 = array_map('intval', array( - 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B, - 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5, - 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B, - 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E, - 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D, - 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9, - 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66, - 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED, - 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4, - 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD, - 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60, - 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79, - 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C, - 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24, - 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C, - 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814, - 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B, - 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084, - 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077, - 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22, - 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F, - 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582, - 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB, - 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF, - 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035, - 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17, - 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46, - 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D, - 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, - 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, - 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, - 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0 - )); - - foreach ($dt3 as $dt3i) { - $dt0[] = (($dt3i << 24) & 0xFF000000) | (($dt3i >> 8) & 0x00FFFFFF); - $dt1[] = (($dt3i << 16) & 0xFFFF0000) | (($dt3i >> 16) & 0x0000FFFF); - $dt2[] = (($dt3i << 8) & 0xFFFFFF00) | (($dt3i >> 24) & 0x000000FF); - }; - - $tables = array( - // The Precomputed inverse mixColumns tables dt0 - dt3 - $dt0, - $dt1, - $dt2, - $dt3, - // The inverse SubByte S-Box - array( - 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB, - 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, - 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, - 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, - 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, - 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, - 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, - 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, - 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, - 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, - 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, - 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, - 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, - 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, - 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D - ) - ); - } - return $tables; - } - - /** - * Setup the performance-optimized function for de/encrypt() - * - * @see \phpseclib\Crypt\Base::_setupInlineCrypt() - * @access private - */ - function _setupInlineCrypt() - { - // Note: _setupInlineCrypt() will be called only if $this->changed === true - // So here we are'nt under the same heavy timing-stress as we are in _de/encryptBlock() or de/encrypt(). - // However...the here generated function- $code, stored as php callback in $this->inline_crypt, must work as fast as even possible. - - $lambda_functions =& self::_getLambdaFunctions(); - - // We create max. 10 hi-optimized code for memory reason. Means: For each $key one ultra fast inline-crypt function. - // (Currently, for Crypt_Rijndael/AES, one generated $lambda_function cost on php5.5@32bit ~80kb unfreeable mem and ~130kb on php5.5@64bit) - // After that, we'll still create very fast optimized code but not the hi-ultimative code, for each $mode one. - $gen_hi_opt_code = (bool)(count($lambda_functions) < 10); - - // Generation of a uniqe hash for our generated code - $code_hash = "Crypt_Rijndael, {$this->mode}, {$this->Nr}, {$this->Nb}"; - if ($gen_hi_opt_code) { - $code_hash = str_pad($code_hash, 32) . $this->_hashInlineCryptFunction($this->key); - } - - if (!isset($lambda_functions[$code_hash])) { - switch (true) { - case $gen_hi_opt_code: - // The hi-optimized $lambda_functions will use the key-words hardcoded for better performance. - $w = $this->w; - $dw = $this->dw; - $init_encrypt = ''; - $init_decrypt = ''; - break; - default: - for ($i = 0, $cw = count($this->w); $i < $cw; ++$i) { - $w[] = '$w[' . $i . ']'; - $dw[] = '$dw[' . $i . ']'; - } - $init_encrypt = '$w = $self->w;'; - $init_decrypt = '$dw = $self->dw;'; - } - - $Nr = $this->Nr; - $Nb = $this->Nb; - $c = $this->c; - - // Generating encrypt code: - $init_encrypt.= ' - static $tables; - if (empty($tables)) { - $tables = &$self->_getTables(); - } - $t0 = $tables[0]; - $t1 = $tables[1]; - $t2 = $tables[2]; - $t3 = $tables[3]; - $sbox = $tables[4]; - '; - - $s = 'e'; - $e = 's'; - $wc = $Nb - 1; - - // Preround: addRoundKey - $encrypt_block = '$in = unpack("N*", $in);'."\n"; - for ($i = 0; $i < $Nb; ++$i) { - $encrypt_block .= '$s'.$i.' = $in['.($i + 1).'] ^ '.$w[++$wc].";\n"; - } - - // Mainrounds: shiftRows + subWord + mixColumns + addRoundKey - for ($round = 1; $round < $Nr; ++$round) { - list($s, $e) = array($e, $s); - for ($i = 0; $i < $Nb; ++$i) { - $encrypt_block.= - '$'.$e.$i.' = - $t0[($'.$s.$i .' >> 24) & 0xff] ^ - $t1[($'.$s.(($i + $c[1]) % $Nb).' >> 16) & 0xff] ^ - $t2[($'.$s.(($i + $c[2]) % $Nb).' >> 8) & 0xff] ^ - $t3[ $'.$s.(($i + $c[3]) % $Nb).' & 0xff] ^ - '.$w[++$wc].";\n"; - } - } - - // Finalround: subWord + shiftRows + addRoundKey - for ($i = 0; $i < $Nb; ++$i) { - $encrypt_block.= - '$'.$e.$i.' = - $sbox[ $'.$e.$i.' & 0xff] | - ($sbox[($'.$e.$i.' >> 8) & 0xff] << 8) | - ($sbox[($'.$e.$i.' >> 16) & 0xff] << 16) | - ($sbox[($'.$e.$i.' >> 24) & 0xff] << 24);'."\n"; - } - $encrypt_block .= '$in = pack("N*"'."\n"; - for ($i = 0; $i < $Nb; ++$i) { - $encrypt_block.= ', - ($'.$e.$i .' & '.((int)0xFF000000).') ^ - ($'.$e.(($i + $c[1]) % $Nb).' & 0x00FF0000 ) ^ - ($'.$e.(($i + $c[2]) % $Nb).' & 0x0000FF00 ) ^ - ($'.$e.(($i + $c[3]) % $Nb).' & 0x000000FF ) ^ - '.$w[$i]."\n"; - } - $encrypt_block .= ');'; - - // Generating decrypt code: - $init_decrypt.= ' - static $invtables; - if (empty($invtables)) { - $invtables = &$self->_getInvTables(); - } - $dt0 = $invtables[0]; - $dt1 = $invtables[1]; - $dt2 = $invtables[2]; - $dt3 = $invtables[3]; - $isbox = $invtables[4]; - '; - - $s = 'e'; - $e = 's'; - $wc = $Nb - 1; - - // Preround: addRoundKey - $decrypt_block = '$in = unpack("N*", $in);'."\n"; - for ($i = 0; $i < $Nb; ++$i) { - $decrypt_block .= '$s'.$i.' = $in['.($i + 1).'] ^ '.$dw[++$wc].';'."\n"; - } - - // Mainrounds: shiftRows + subWord + mixColumns + addRoundKey - for ($round = 1; $round < $Nr; ++$round) { - list($s, $e) = array($e, $s); - for ($i = 0; $i < $Nb; ++$i) { - $decrypt_block.= - '$'.$e.$i.' = - $dt0[($'.$s.$i .' >> 24) & 0xff] ^ - $dt1[($'.$s.(($Nb + $i - $c[1]) % $Nb).' >> 16) & 0xff] ^ - $dt2[($'.$s.(($Nb + $i - $c[2]) % $Nb).' >> 8) & 0xff] ^ - $dt3[ $'.$s.(($Nb + $i - $c[3]) % $Nb).' & 0xff] ^ - '.$dw[++$wc].";\n"; - } - } - - // Finalround: subWord + shiftRows + addRoundKey - for ($i = 0; $i < $Nb; ++$i) { - $decrypt_block.= - '$'.$e.$i.' = - $isbox[ $'.$e.$i.' & 0xff] | - ($isbox[($'.$e.$i.' >> 8) & 0xff] << 8) | - ($isbox[($'.$e.$i.' >> 16) & 0xff] << 16) | - ($isbox[($'.$e.$i.' >> 24) & 0xff] << 24);'."\n"; - } - $decrypt_block .= '$in = pack("N*"'."\n"; - for ($i = 0; $i < $Nb; ++$i) { - $decrypt_block.= ', - ($'.$e.$i. ' & '.((int)0xFF000000).') ^ - ($'.$e.(($Nb + $i - $c[1]) % $Nb).' & 0x00FF0000 ) ^ - ($'.$e.(($Nb + $i - $c[2]) % $Nb).' & 0x0000FF00 ) ^ - ($'.$e.(($Nb + $i - $c[3]) % $Nb).' & 0x000000FF ) ^ - '.$dw[$i]."\n"; - } - $decrypt_block .= ');'; - - $lambda_functions[$code_hash] = $this->_createInlineCryptFunction( - array( - 'init_crypt' => '', - 'init_encrypt' => $init_encrypt, - 'init_decrypt' => $init_decrypt, - 'encrypt_block' => $encrypt_block, - 'decrypt_block' => $decrypt_block - ) - ); - } - $this->inline_crypt = $lambda_functions[$code_hash]; - } -} diff --git a/#pma/libraries/phpseclib/LICENSE b/#pma/libraries/phpseclib/LICENSE deleted file mode 100644 index 75f6b204..00000000 --- a/#pma/libraries/phpseclib/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2007-2013 TerraFrost and other contributors -http://phpseclib.sourceforge.net/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/#pma/libraries/plugin_interface.lib.php b/#pma/libraries/plugin_interface.lib.php deleted file mode 100644 index 0376e87e..00000000 --- a/#pma/libraries/plugin_interface.lib.php +++ /dev/null @@ -1,578 +0,0 @@ -getProperties()) { - $plugin_list[] = $plugin; - } - } - } - } - - ksort($plugin_list); - return $plugin_list; -} - -/** - * Returns locale string for $name or $name if no locale is found - * - * @param string $name for local string - * - * @return string locale string for $name - */ -function PMA_getString($name) -{ - return isset($GLOBALS[$name]) ? $GLOBALS[$name] : $name; -} - -/** - * Returns html input tag option 'checked' if plugin $opt - * should be set by config or request - * - * @param string $section name of config section in - * $GLOBALS['cfg'][$section] for plugin - * @param string $opt name of option - * - * @return string html input tag option 'checked' - */ -function PMA_pluginCheckboxCheck($section, $opt) -{ - // If the form is being repopulated using $_GET data, that is priority - if (isset($_GET[$opt]) - || ! isset($_GET['repopulate']) - && ((! empty($GLOBALS['timeout_passed']) && isset($_REQUEST[$opt])) - || ! empty($GLOBALS['cfg'][$section][$opt])) - ) { - return ' checked="checked"'; - } - return ''; -} - -/** - * Returns default value for option $opt - * - * @param string $section name of config section in - * $GLOBALS['cfg'][$section] for plugin - * @param string $opt name of option - * - * @return string default value for option $opt - */ -function PMA_pluginGetDefault($section, $opt) -{ - if (isset($_GET[$opt])) { - // If the form is being repopulated using $_GET data, that is priority - return htmlspecialchars($_GET[$opt]); - } - - if (isset($GLOBALS['timeout_passed']) - && $GLOBALS['timeout_passed'] - && isset($_REQUEST[$opt]) - ) { - return htmlspecialchars($_REQUEST[$opt]); - } - - if (!isset($GLOBALS['cfg'][$section][$opt])) { - return ''; - } - - $matches = array(); - /* Possibly replace localised texts */ - if (!preg_match_all( - '/(str[A-Z][A-Za-z0-9]*)/', - $GLOBALS['cfg'][$section][$opt], - $matches - )) { - return htmlspecialchars($GLOBALS['cfg'][$section][$opt]); - } - - $val = $GLOBALS['cfg'][$section][$opt]; - foreach ($matches[0] as $match) { - if (isset($GLOBALS[$match])) { - $val = str_replace($match, $GLOBALS[$match], $val); - } - } - return htmlspecialchars($val); -} - -/** - * Returns html select form element for plugin choice - * and hidden fields denoting whether each plugin must be exported as a file - * - * @param string $section name of config section in - * $GLOBALS['cfg'][$section] for plugin - * @param string $name name of select element - * @param array &$list array with plugin instances - * @param string $cfgname name of config value, if none same as $name - * - * @return string html select tag - */ -function PMA_pluginGetChoice($section, $name, &$list, $cfgname = null) -{ - if (! isset($cfgname)) { - $cfgname = $name; - } - $ret = '' . "\n"; - } - $ret .= '' . "\n" . $hidden; - - return $ret; -} - -/** - * Returns single option in a list element - * - * @param string $section name of - * config - * section in - * $GLOBALS['cfg'][$section] - * for plugin - * @param string $plugin_name unique plugin - * name - * @param array|\PMA\libraries\properties\PropertyItem &$propertyGroup options - * property main - * group - * instance - * @param boolean $is_subgroup if this group - * is a subgroup - * - * @return string table row with option - */ -function PMA_pluginGetOneOption( - $section, - $plugin_name, - &$propertyGroup, - $is_subgroup = false -) { - $ret = "\n"; - - if (! $is_subgroup) { - // for subgroup headers - if (mb_strpos(get_class($propertyGroup), "PropertyItem")) { - $properties = array($propertyGroup); - } else { - // for main groups - $ret .= '
    '; - - if (method_exists($propertyGroup, 'getText')) { - $text = $propertyGroup->getText(); - } - - if ($text != null) { - $ret .= '

    ' . PMA_getString($text) . '

    '; - } - $ret .= '
      '; - } - } - - if (! isset($properties)) { - $not_subgroup_header = true; - if (method_exists($propertyGroup, 'getProperties')) { - $properties = $propertyGroup->getProperties(); - } - } - - if (isset($properties)) { - /** @var OptionsPropertySubgroup $propertyItem */ - foreach ($properties as $propertyItem) { - $property_class = get_class($propertyItem); - // if the property is a subgroup, we deal with it recursively - if (mb_strpos($property_class, "Subgroup")) { - // for subgroups - // each subgroup can have a header, which may also be a form element - /** @var OptionsPropertyItem $subgroup_header */ - $subgroup_header = $propertyItem->getSubgroupHeader(); - if (isset($subgroup_header)) { - $ret .= PMA_pluginGetOneOption( - $section, - $plugin_name, - $subgroup_header - ); - } - - $ret .= '
    • getName() . '">'; - } else { - $ret .= '>'; - } - - $ret .= PMA_pluginGetOneOption( - $section, - $plugin_name, - $propertyItem, - true - ); - continue; - } - - // single property item - $ret .= PMA_getHtmlForProperty( - $section, $plugin_name, $propertyItem - ); - } - } - - if ($is_subgroup) { - // end subgroup - $ret .= '
    '; - } else { - // end main group - if (! empty($not_subgroup_header)) { - $ret .= '
    '; - } - } - - if (method_exists($propertyGroup, "getDoc")) { - $doc = $propertyGroup->getDoc(); - if ($doc != null) { - if (count($doc) == 3) { - $ret .= PMA\libraries\Util::showMySQLDocu( - $doc[1], - false, - $doc[2] - ); - } elseif (count($doc) == 1) { - $ret .= PMA\libraries\Util::showDocu('faq', $doc[0]); - } else { - $ret .= PMA\libraries\Util::showMySQLDocu( - $doc[1] - ); - } - } - } - - // Close the list element after $doc link is displayed - if (isset($property_class)) { - if ($property_class == 'PMA\libraries\properties\options\items\BoolPropertyItem' - || $property_class == 'PMA\libraries\properties\options\items\MessageOnlyPropertyItem' - || $property_class == 'PMA\libraries\properties\options\items\SelectPropertyItem' - || $property_class == 'PMA\libraries\properties\options\items\TextPropertyItem' - ) { - $ret .= ''; - } - } - $ret .= "\n"; - return $ret; -} - -/** - * Get HTML for properties items - * - * @param string $section name of config section in - * $GLOBALS['cfg'][$section] for plugin - * @param string $plugin_name unique plugin name - * @param OptionsPropertyItem $propertyItem Property item - * - * @return string - */ -function PMA_getHtmlForProperty( - $section, $plugin_name, $propertyItem -) { - $ret = null; - $property_class = get_class($propertyItem); - switch ($property_class) { - case 'PMA\libraries\properties\options\items\BoolPropertyItem': - $ret .= '
  • ' . "\n"; - $ret .= 'getName() - ); - - if ($propertyItem->getForce() != null) { - // Same code is also few lines lower, update both if needed - $ret .= ' onclick="if (!this.checked && ' - . '(!document.getElementById(\'checkbox_' . $plugin_name - . '_' . $propertyItem->getForce() . '\') ' - . '|| !document.getElementById(\'checkbox_' - . $plugin_name . '_' . $propertyItem->getForce() - . '\').checked)) ' - . 'return false; else return true;"'; - } - $ret .= ' />'; - $ret .= ''; - break; - case 'PMA\libraries\properties\options\items\DocPropertyItem': - echo 'PMA\libraries\properties\options\items\DocPropertyItem'; - break; - case 'PMA\libraries\properties\options\items\HiddenPropertyItem': - $ret .= '
  • '; - break; - case 'PMA\libraries\properties\options\items\MessageOnlyPropertyItem': - $ret .= '
  • ' . "\n"; - $ret .= '

    ' . PMA_getString($propertyItem->getText()) . '

    '; - break; - case 'PMA\libraries\properties\options\items\RadioPropertyItem': - $default = PMA_pluginGetDefault( - $section, - $plugin_name . '_' . $propertyItem->getName() - ); - foreach ($propertyItem->getValues() as $key => $val) { - $ret .= '
  • ' - . PMA_getString($val) . '
  • '; - } - break; - case 'PMA\libraries\properties\options\items\SelectPropertyItem': - $ret .= '
  • ' . "\n"; - $ret .= ''; - $ret .= ''; - break; - case 'PMA\libraries\properties\options\items\TextPropertyItem': - case 'PMA\libraries\properties\options\items\NumberPropertyItem': - $ret .= '
  • ' . "\n"; - $ret .= ''; - $ret .= 'getSize() != null - ? ' size="' . $propertyItem->getSize() . '"' - : '') - . ($propertyItem->getLen() != null - ? ' maxlength="' . $propertyItem->getLen() . '"' - : '') - . ' />'; - break; - default: - break; - } - return $ret; -} - -/** - * Returns html div with editable options for plugin - * - * @param string $section name of config section in $GLOBALS['cfg'][$section] - * @param array &$list array with plugin instances - * - * @return string html fieldset with plugin options - */ -function PMA_pluginGetOptions($section, &$list) -{ - $ret = ''; - // Options for plugins that support them - foreach ($list as $plugin) { - $properties = $plugin->getProperties(); - if ($properties != null) { - $text = $properties->getText(); - $options = $properties->getOptions(); - } - - $elem = explode('\\', get_class($plugin)); - $plugin_name = array_pop($elem); - unset($elem); - $plugin_name = mb_strtolower( - mb_substr( - $plugin_name, - mb_strlen($section) - ) - ); - - $ret .= '
    '; - $ret .= '

    ' . PMA_getString($text) . '

    '; - - $no_options = true; - if ($options != null && count($options) > 0) { - foreach ($options->getProperties() - as $propertyMainGroup - ) { - // check for hidden properties - $no_options = true; - foreach ($propertyMainGroup->getProperties() as $propertyItem) { - if (strcmp('PMA\libraries\properties\options\items\HiddenPropertyItem', get_class($propertyItem))) { - $no_options = false; - break; - } - } - - $ret .= PMA_pluginGetOneOption( - $section, - $plugin_name, - $propertyMainGroup - ); - } - } - - if ($no_options) { - $ret .= '

    ' . __('This format has no options') . '

    '; - } - $ret .= '
    '; - } - return $ret; -} diff --git a/#pma/libraries/plugins/AuthenticationPlugin.php b/#pma/libraries/plugins/AuthenticationPlugin.php deleted file mode 100644 index 6063aa98..00000000 --- a/#pma/libraries/plugins/AuthenticationPlugin.php +++ /dev/null @@ -1,159 +0,0 @@ - authentication failed - * - * @return boolean - */ - abstract public function authFails(); - - /** - * Perform logout - * - * @return void - */ - public function logOut() - { - global $PHP_AUTH_USER, $PHP_AUTH_PW; - - /* Obtain redirect URL (before doing logout) */ - if (! empty($GLOBALS['cfg']['Server']['LogoutURL'])) { - $redirect_url = $GLOBALS['cfg']['Server']['LogoutURL']; - } else { - $redirect_url = $this->getLoginFormURL(); - } - - /* Clear credentials */ - $PHP_AUTH_USER = ''; - $PHP_AUTH_PW = ''; - - /* delete user's choices that were stored in session */ - $_SESSION = array(); - if (!defined('TESTSUITE')) { - session_destroy(); - } - - /* Redirect to login form (or configured URL) */ - PMA_sendHeaderLocation($redirect_url); - } - - /** - * Returns URL for login form. - * - * @return string - */ - public function getLoginFormURL() - { - return './index.php'; - } - - /** - * Returns error message for failed authentication. - * - * @return string - */ - public function getErrorMessage() - { - if (!empty($GLOBALS['login_without_password_is_forbidden'])) { - return __( - 'Login without a password is forbidden by configuration' - . ' (see AllowNoPassword)' - ); - } elseif (!empty($GLOBALS['allowDeny_forbidden'])) { - return __('Access denied!'); - } elseif (!empty($GLOBALS['no_activity'])) { - return sprintf( - __('No activity within %s seconds; please log in again.'), - intval($GLOBALS['cfg']['LoginCookieValidity']) - ); - } else { - $dbi_error = $GLOBALS['dbi']->getError(); - if (!empty($dbi_error)) { - return htmlspecialchars($dbi_error); - } elseif (isset($GLOBALS['errno'])) { - return '#' . $GLOBALS['errno'] . ' ' - . __('Cannot log in to the MySQL server'); - } else { - return __('Cannot log in to the MySQL server'); - } - } - } - - /** - * Callback when user changes password. - * - * @param string $password New password to set - * - * @return void - */ - public function handlePasswordChange($password) - { - } - - /** - * Store session access time in session. - * - * Tries to workaround PHP 5 session garbage collection which - * looks at the session file's last modified time - * - * @return void - */ - public function setSessionAccessTime() - { - if (isset($_REQUEST['access_time'])) { - // Ensure access_time is in range <0, LoginCookieValidity + 1> - // to avoid excessive extension of validity. - // - // Negative values can cause session expiry extension - // Too big values can cause overflow and lead to same - $_SESSION['last_access_time'] = time() - min(max(0, intval($_REQUEST['access_time'])), $GLOBALS['cfg']['LoginCookieValidity'] + 1); - } else { - $_SESSION['last_access_time'] = time(); - } - } -} diff --git a/#pma/libraries/plugins/ExportPlugin.php b/#pma/libraries/plugins/ExportPlugin.php deleted file mode 100644 index 4d872a61..00000000 --- a/#pma/libraries/plugins/ExportPlugin.php +++ /dev/null @@ -1,367 +0,0 @@ -properties; - } - - /** - * Sets the export plugins properties and is implemented by each export - * plugin - * - * @return void - */ - abstract protected function setProperties(); - - /** - * The following methods are implemented here so that they - * can be used by all export plugin without overriding it. - * Note: If you are creating a export plugin then don't include - * below methods unless you want to override them. - */ - - /** - * Initialize aliases - * - * @param array $aliases Alias information for db/table/column - * @param string &$db the database - * @param string &$table the table - * - * @return void - */ - public function initAlias($aliases, &$db, &$table = null) - { - if (!empty($aliases[$db]['tables'][$table]['alias'])) { - $table = $aliases[$db]['tables'][$table]['alias']; - } - if (!empty($aliases[$db]['alias'])) { - $db = $aliases[$db]['alias']; - } - } - - /** - * Search for alias of a identifier. - * - * @param array $aliases Alias information for db/table/column - * @param string $id the identifier to be searched - * @param string $type db/tbl/col or any combination of them - * representing what to be searched - * @param string $db the database in which search is to be done - * @param string $tbl the table in which search is to be done - * - * @return string alias of the identifier if found or '' - */ - public function getAlias($aliases, $id, $type = 'dbtblcol', $db = '', $tbl = '') - { - if (!empty($db) && isset($aliases[$db])) { - $aliases = array( - $db => $aliases[$db], - ); - } - // search each database - foreach ($aliases as $db_key => $db) { - // check if id is database and has alias - if (stristr($type, 'db') !== false - && $db_key === $id - && !empty($db['alias']) - ) { - return $db['alias']; - } - if (empty($db['tables'])) { - continue; - } - if (!empty($tbl) && isset($db['tables'][$tbl])) { - $db['tables'] = array( - $tbl => $db['tables'][$tbl], - ); - } - // search each of its tables - foreach ($db['tables'] as $table_key => $table) { - // check if id is table and has alias - if (stristr($type, 'tbl') !== false - && $table_key === $id - && !empty($table['alias']) - ) { - return $table['alias']; - } - if (empty($table['columns'])) { - continue; - } - // search each of its columns - foreach ($table['columns'] as $col_key => $col) { - // check if id is column - if (stristr($type, 'col') !== false - && $col_key === $id - && !empty($col) - ) { - return $col; - } - } - } - } - - return ''; - } - - /** - * Gives the relation string and - * also substitutes with alias if required - * in this format: - * [Foreign Table] ([Foreign Field]) - * - * @param array $res_rel the foreigners array - * @param string $field_name the field name - * @param string $db the field name - * @param array $aliases Alias information for db/table/column - * - * @return string the Relation string - */ - public function getRelationString( - $res_rel, - $field_name, - $db, - $aliases = array() - ) { - $relation = ''; - $foreigner = PMA_searchColumnInForeigners($res_rel, $field_name); - if ($foreigner) { - $ftable = $foreigner['foreign_table']; - $ffield = $foreigner['foreign_field']; - if (!empty($aliases[$db]['tables'][$ftable]['columns'][$ffield])) { - $ffield = $aliases[$db]['tables'][$ftable]['columns'][$ffield]; - } - if (!empty($aliases[$db]['tables'][$ftable]['alias'])) { - $ftable = $aliases[$db]['tables'][$ftable]['alias']; - } - $relation = $ftable . ' (' . $ffield . ')'; - } - - return $relation; - } -} diff --git a/#pma/libraries/plugins/IOTransformationsPlugin.php b/#pma/libraries/plugins/IOTransformationsPlugin.php deleted file mode 100644 index eed01717..00000000 --- a/#pma/libraries/plugins/IOTransformationsPlugin.php +++ /dev/null @@ -1,96 +0,0 @@ -error; - } - - /** - * Returns the success status - * - * @return bool - */ - public function isSuccess() - { - return $this->success; - } - - /** - * Resets the object properties - * - * @return void - */ - public function reset() - { - $this->success = true; - $this->error = ''; - } -} diff --git a/#pma/libraries/plugins/ImportPlugin.php b/#pma/libraries/plugins/ImportPlugin.php deleted file mode 100644 index 254ac0ad..00000000 --- a/#pma/libraries/plugins/ImportPlugin.php +++ /dev/null @@ -1,76 +0,0 @@ -properties; - } - - /** - * Sets the export plugins properties and is implemented by each import - * plugin - * - * @return void - */ - abstract protected function setProperties(); - - /** - * Define DB name and options - * - * @param string $currentDb DB - * @param string $defaultDb Default DB name - * - * @return array DB name and options (an associative array of options) - */ - protected function getDbnameAndOptions($currentDb, $defaultDb) - { - if (mb_strlen($currentDb)) { - $db_name = $currentDb; - $options = array('create_db' => false); - } else { - $db_name = $defaultDb; - $options = null; - } - - return array($db_name, $options); - } -} diff --git a/#pma/libraries/plugins/SchemaPlugin.php b/#pma/libraries/plugins/SchemaPlugin.php deleted file mode 100644 index f7696c2e..00000000 --- a/#pma/libraries/plugins/SchemaPlugin.php +++ /dev/null @@ -1,89 +0,0 @@ -properties; - } - - /** - * Sets the export plugins properties and is implemented by - * each schema export plugin - * - * @return void - */ - protected abstract function setProperties(); - - /** - * Exports the schema into the specified format. - * - * @param string $db database name - * - * @return bool Whether it succeeded - */ - public abstract function exportSchema($db); - - /** - * Adds export options common to all plugins. - * - * @param \PMA\libraries\properties\options\groups\OptionsPropertyMainGroup $propertyGroup property group - * - * @return void - */ - protected function addCommonOptions(OptionsPropertyMainGroup $propertyGroup) - { - $leaf = new BoolPropertyItem('show_color', __('Show color')); - $propertyGroup->addProperty($leaf); - $leaf = new BoolPropertyItem('show_keys', __('Only show keys')); - $propertyGroup->addProperty($leaf); - } - - /** - * Returns the array of paper sizes - * - * @return array array of paper sizes - */ - protected function getPaperSizeArray() - { - $ret = array(); - foreach ($GLOBALS['cfg']['PDFPageSizes'] as $val) { - $ret[$val] = $val; - } - - return $ret; - } -} diff --git a/#pma/libraries/plugins/TransformationsInterface.php b/#pma/libraries/plugins/TransformationsInterface.php deleted file mode 100644 index 97332db9..00000000 --- a/#pma/libraries/plugins/TransformationsInterface.php +++ /dev/null @@ -1,46 +0,0 @@ - $value) { - if (isset($options[$key]) && $options[$key] !== '') { - $result[$key] = $options[$key]; - } else { - $result[$key] = $value; - } - } - - return $result; - } -} diff --git a/#pma/libraries/plugins/UploadInterface.php b/#pma/libraries/plugins/UploadInterface.php deleted file mode 100644 index 061812e6..00000000 --- a/#pma/libraries/plugins/UploadInterface.php +++ /dev/null @@ -1,33 +0,0 @@ -upload plugins - * - * @package PhpMyAdmin - */ -namespace PMA\libraries\plugins; - -/** - * Provides a common interface that will have to implemented by all of the - * import->upload plugins. - * - * @package PhpMyAdmin - */ -interface UploadInterface -{ - /** - * Gets the specific upload ID Key - * - * @return string ID Key - */ - public static function getIdKey(); - - /** - * Returns upload status. - * - * @param string $id upload id - * - * @return array|null - */ - public static function getUploadStatus($id); -} diff --git a/#pma/libraries/plugins/auth/AuthenticationConfig.php b/#pma/libraries/plugins/auth/AuthenticationConfig.php deleted file mode 100644 index 77bf980d..00000000 --- a/#pma/libraries/plugins/auth/AuthenticationConfig.php +++ /dev/null @@ -1,176 +0,0 @@ -isAjax()) { - $response->setRequestStatus(false); - // reload_flag removes the token parameter from the URL and reloads - $response->addJSON('reload_flag', '1'); - if (defined('TESTSUITE')) { - return true; - } else { - exit; - } - } - - return true; - } - - /** - * Gets advanced authentication settings - * - * @return boolean always true - */ - public function authCheck() - { - if ($GLOBALS['token_provided'] && $GLOBALS['token_mismatch']) { - return false; - } - - return true; - } - - /** - * Set the user and password after last checkings if required - * - * @return boolean always true - */ - public function authSetUser() - { - $this->setSessionAccessTime(); - - return true; - } - - /** - * User is not allowed to login to MySQL -> authentication failed - * - * @return boolean always true (no return indeed) - */ - public function authFails() - { - $conn_error = $GLOBALS['dbi']->getError(); - if (!$conn_error) { - $conn_error = __('Cannot connect: invalid settings.'); - } - - /* HTML header */ - $response = PMA\libraries\Response::getInstance(); - $response->getFooter() - ->setMinimal(); - $header = $response->getHeader(); - $header->setBodyId('loginform'); - $header->setTitle(__('Access denied!')); - $header->disableMenuAndConsole(); - echo '

    -
    -

    '; - echo sprintf(__('Welcome to %s'), ' phpMyAdmin '); - echo '

    -
    -
    - - - - - - - ' , "\n"; - if (count($GLOBALS['cfg']['Servers']) > 1) { - // offer a chance to login to other servers if the current one failed - include_once './libraries/select_server.lib.php'; - echo '' , "\n"; - echo ' ' , "\n"; - echo '' , "\n"; - } - echo '
    '; - if (isset($GLOBALS['allowDeny_forbidden']) - && $GLOBALS['allowDeny_forbidden'] - ) { - trigger_error(__('Access denied!'), E_USER_NOTICE); - } else { - // Check whether user has configured something - if ($GLOBALS['PMA_Config']->source_mtime == 0) { - echo '

    ' , sprintf( - __( - 'You probably did not create a configuration file.' - . ' You might want to use the %1$ssetup script%2$s to' - . ' create one.' - ), - '', - '' - ) , '

    ' , "\n"; - } elseif (!isset($GLOBALS['errno']) - || (isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) - && $GLOBALS['errno'] != 2003 - ) { - // if we display the "Server not responding" error, do not confuse - // users by telling them they have a settings problem - // (note: it's true that they could have a badly typed host name, - // but anyway the current message tells that the server - // rejected the connection, which is not really what happened) - // 2002 is the error given by mysqli - // 2003 is the error given by mysql - trigger_error( - __( - 'phpMyAdmin tried to connect to the MySQL server, and the' - . ' server rejected the connection. You should check the' - . ' host, username and password in your configuration and' - . ' make sure that they correspond to the information given' - . ' by the administrator of the MySQL server.' - ), - E_USER_WARNING - ); - } - echo PMA\libraries\Util::mysqlDie( - $conn_error, - '', - true, - '', - false - ); - } - $GLOBALS['error_handler']->dispUserErrors(); - echo '
    ' , "\n"; - echo '' - , __('Retry to connect') - , '' , "\n"; - echo '
    ' , "\n"; - echo PMA_selectServer(true, true); - echo '
    ' , "\n"; - if (!defined('TESTSUITE')) { - exit; - } - - return true; - } -} diff --git a/#pma/libraries/plugins/auth/AuthenticationCookie.php b/#pma/libraries/plugins/auth/AuthenticationCookie.php deleted file mode 100644 index 0d37f4db..00000000 --- a/#pma/libraries/plugins/auth/AuthenticationCookie.php +++ /dev/null @@ -1,867 +0,0 @@ -isAjax()) { - $response->setRequestStatus(false); - // redirect_flag redirects to the login page - $response->addJSON('redirect_flag', '1'); - if (defined('TESTSUITE')) { - return true; - } else { - exit; - } - } - - // No recall if blowfish secret is not configured as it would produce - // garbage - if ($GLOBALS['cfg']['LoginCookieRecall'] - && ! empty($GLOBALS['cfg']['blowfish_secret']) - ) { - $default_user = $GLOBALS['PHP_AUTH_USER']; - $default_server = $GLOBALS['pma_auth_server']; - $autocomplete = ''; - } else { - $default_user = ''; - $default_server = ''; - // skip the IE autocomplete feature. - $autocomplete = ' autocomplete="off"'; - } - - $response->getFooter()->setMinimal(); - $header = $response->getHeader(); - $header->setBodyId('loginform'); - $header->setTitle('phpMyAdmin'); - $header->disableMenuAndConsole(); - $header->disableWarnings(); - - if (@file_exists(CUSTOM_HEADER_FILE)) { - include CUSTOM_HEADER_FILE; - } - echo ' -
    - -

    '; - echo sprintf( - __('Welcome to %s'), - 'phpMyAdmin' - ); - echo "

    "; - - // Show error message - if (! empty($conn_error)) { - Message::rawError($conn_error)->display(); - } elseif (isset($_GET['session_expired']) - && intval($_GET['session_expired']) == 1 - ) { - Message::rawError( - __('Your session has expired. Please log in again.') - )->display(); - } - - echo "\n"; - - echo "
    "; - // Displays the languages form - if (empty($GLOBALS['cfg']['Lang'])) { - include_once './libraries/display_select_lang.lib.php'; - // use fieldset, don't show doc link - echo PMA_getLanguageSelectorHtml(true, false); - } - echo '
    -
    - - '; - - if ($GLOBALS['error_handler']->hasDisplayErrors()) { - echo '
    '; - $GLOBALS['error_handler']->dispErrors(); - echo '
    '; - } - echo '
    '; - if (@file_exists(CUSTOM_FOOTER_FILE)) { - include CUSTOM_FOOTER_FILE; - } - if (! defined('TESTSUITE')) { - exit; - } else { - return true; - } - } - - /** - * Gets advanced authentication settings - * - * this function DOES NOT check authentication - it just checks/provides - * authentication credentials required to connect to the MySQL server - * usually with $GLOBALS['dbi']->connect() - * - * it returns false if something is missing - which usually leads to - * auth() which displays login form - * - * it returns true if all seems ok which usually leads to auth_set_user() - * - * it directly switches to authFails() if user inactivity timeout is reached - * - * @return boolean whether we get authentication settings or not - */ - public function authCheck() - { - global $conn_error; - - // Initialization - /** - * @global $GLOBALS['pma_auth_server'] the user provided server to - * connect to - */ - $GLOBALS['pma_auth_server'] = ''; - - $GLOBALS['PHP_AUTH_USER'] = $GLOBALS['PHP_AUTH_PW'] = ''; - $GLOBALS['from_cookie'] = false; - - if (! empty($_REQUEST['pma_username'])) { - - // Verify Captcha if it is required. - if (! empty($GLOBALS['cfg']['CaptchaLoginPrivateKey']) - && ! empty($GLOBALS['cfg']['CaptchaLoginPublicKey']) - ) { - if (! empty($_POST["g-recaptcha-response"])) { - - include_once 'libraries/plugins/auth/recaptcha/autoload.php'; - $reCaptcha = new ReCaptcha( - $GLOBALS['cfg']['CaptchaLoginPrivateKey'] - ); - - // verify captcha status. - $resp = $reCaptcha->verify( - $_POST["g-recaptcha-response"], - $_SERVER["REMOTE_ADDR"] - ); - - // Check if the captcha entered is valid, if not stop the login. - if ($resp == null || ! $resp->isSuccess()) { - $conn_error = __('Entered captcha is wrong, try again!'); - return false; - } - } else { - $conn_error = __('Please enter correct captcha!'); - return false; - } - } - - // The user just logged in - $GLOBALS['PHP_AUTH_USER'] = PMA_sanitizeMySQLUser($_REQUEST['pma_username']); - $GLOBALS['PHP_AUTH_PW'] = empty($_REQUEST['pma_password']) - ? '' - : $_REQUEST['pma_password']; - if ($GLOBALS['cfg']['AllowArbitraryServer'] - && isset($_REQUEST['pma_servername']) - ) { - if ($GLOBALS['cfg']['ArbitraryServerRegexp']) { - $parts = explode(' ', $_REQUEST['pma_servername']); - if (count($parts) == 2) { - $tmp_host = $parts[0]; - } else { - $tmp_host = $_REQUEST['pma_servername']; - } - - $match = preg_match( - $GLOBALS['cfg']['ArbitraryServerRegexp'], $tmp_host - ); - if (! $match) { - $conn_error = __( - 'You are not allowed to log in to this MySQL server!' - ); - return false; - } - } - $GLOBALS['pma_auth_server'] = PMA_sanitizeMySQLHost($_REQUEST['pma_servername']); - } - PMA_secureSession(); - return true; - } - - // At the end, try to set the $GLOBALS['PHP_AUTH_USER'] - // and $GLOBALS['PHP_AUTH_PW'] variables from cookies - - // check cookies - if (empty($_COOKIE['pmaUser-' . $GLOBALS['server']])) { - return false; - } - - $GLOBALS['PHP_AUTH_USER'] = $this->cookieDecrypt( - $_COOKIE['pmaUser-' . $GLOBALS['server']], - $this->_getEncryptionSecret() - ); - - // user was never logged in since session start - if (empty($_SESSION['last_access_time'])) { - return false; - } - - // User inactive too long - $last_access_time = time() - $GLOBALS['cfg']['LoginCookieValidity']; - if ($_SESSION['last_access_time'] < $last_access_time) { - Util::cacheUnset('is_create_db_priv'); - Util::cacheUnset('is_reload_priv'); - Util::cacheUnset('db_to_create'); - Util::cacheUnset('dbs_where_create_table_allowed'); - Util::cacheUnset('dbs_to_test'); - Util::cacheUnset('db_priv'); - Util::cacheUnset('col_priv'); - Util::cacheUnset('table_priv'); - Util::cacheUnset('proc_priv'); - - $GLOBALS['no_activity'] = true; - $this->authFails(); - if (! defined('TESTSUITE')) { - exit; - } else { - return false; - } - } - - // check password cookie - if (empty($_COOKIE['pmaAuth-' . $GLOBALS['server']])) { - return false; - } - - $auth_data = json_decode( - $this->cookieDecrypt( - $_COOKIE['pmaAuth-' . $GLOBALS['server']], - $this->_getSessionEncryptionSecret() - ), - true - ); - if (! is_array($auth_data) || ! isset($auth_data['password'])) { - return false; - } - $GLOBALS['PHP_AUTH_PW'] = $auth_data['password']; - if ($GLOBALS['cfg']['AllowArbitraryServer'] && ! empty($auth_data['server'])) { - $GLOBALS['pma_auth_server'] = $auth_data['server']; - } - - $GLOBALS['from_cookie'] = true; - - return true; - } - - /** - * Set the user and password after last checkings if required - * - * @return boolean always true - */ - public function authSetUser() - { - global $cfg; - - // Ensures valid authentication mode, 'only_db', bookmark database and - // table names and relation table name are used - if (! hash_equals($cfg['Server']['user'], $GLOBALS['PHP_AUTH_USER'])) { - foreach ($cfg['Servers'] as $idx => $current) { - if ($current['host'] == $cfg['Server']['host'] - && $current['port'] == $cfg['Server']['port'] - && $current['socket'] == $cfg['Server']['socket'] - && $current['ssl'] == $cfg['Server']['ssl'] - && $current['connect_type'] == $cfg['Server']['connect_type'] - && hash_equals($current['user'], $GLOBALS['PHP_AUTH_USER']) - ) { - $GLOBALS['server'] = $idx; - $cfg['Server'] = $current; - break; - } - } // end foreach - } // end if - - if ($GLOBALS['cfg']['AllowArbitraryServer'] - && ! empty($GLOBALS['pma_auth_server']) - ) { - /* Allow to specify 'host port' */ - $parts = explode(' ', $GLOBALS['pma_auth_server']); - if (count($parts) == 2) { - $tmp_host = $parts[0]; - $tmp_port = $parts[1]; - } else { - $tmp_host = $GLOBALS['pma_auth_server']; - $tmp_port = ''; - } - if ($cfg['Server']['host'] != $GLOBALS['pma_auth_server']) { - $cfg['Server']['host'] = $tmp_host; - if (! empty($tmp_port)) { - $cfg['Server']['port'] = $tmp_port; - } - } - unset($tmp_host, $tmp_port, $parts); - } - $cfg['Server']['user'] = $GLOBALS['PHP_AUTH_USER']; - $cfg['Server']['password'] = $GLOBALS['PHP_AUTH_PW']; - - // Avoid showing the password in phpinfo()'s output - unset($GLOBALS['PHP_AUTH_PW']); - unset($_SERVER['PHP_AUTH_PW']); - $this->setSessionAccessTime(); - } - - /** - * Stores user credentials after successful login. - * - * @return void|bool - */ - public function storeUserCredentials() - { - global $cfg; - - // Name and password cookies need to be refreshed each time - // Duration = one month for username - $this->storeUsernameCookie($cfg['Server']['user']); - - // Duration = as configured - // Do not store password cookie on password change as we will - // set the cookie again after password has been changed - if (! isset($_POST['change_pw'])) { - $this->storePasswordCookie($cfg['Server']['password']); - } - - // Set server cookies if required (once per session) and, in this case, - // force reload to ensure the client accepts cookies - if (! $GLOBALS['from_cookie']) { - // URL where to go: - $redirect_url = './index.php'; - - // any parameters to pass? - $url_params = array(); - if (mb_strlen($GLOBALS['db'])) { - $url_params['db'] = $GLOBALS['db']; - } - if (mb_strlen($GLOBALS['table'])) { - $url_params['table'] = $GLOBALS['table']; - } - // any target to pass? - if (! empty($GLOBALS['target']) - && $GLOBALS['target'] != 'index.php' - ) { - $url_params['target'] = $GLOBALS['target']; - } - - /** - * Clear user cache. - */ - Util::clearUserCache(); - - Response::getInstance() - ->disable(); - - PMA_sendHeaderLocation( - $redirect_url . PMA_URL_getCommon($url_params, 'text'), - true - ); - if (! defined('TESTSUITE')) { - exit; - } else { - return false; - } - } // end if - - return true; - } - - /** - * Stores username in a cookie. - * - * @param string $username User name - * - * @return void - */ - public function storeUsernameCookie($username) - { - // Name and password cookies need to be refreshed each time - // Duration = one month for username - $GLOBALS['PMA_Config']->setCookie( - 'pmaUser-' . $GLOBALS['server'], - $this->cookieEncrypt( - $username, - $this->_getEncryptionSecret() - ) - ); - } - - /** - * Stores password in a cookie. - * - * @param string $password Password - * - * @return void - */ - public function storePasswordCookie($password) - { - $payload = array('password' => $password); - if ($GLOBALS['cfg']['AllowArbitraryServer'] && ! empty($GLOBALS['pma_auth_server'])) { - $payload['server'] = $GLOBALS['pma_auth_server']; - } - // Duration = as configured - $GLOBALS['PMA_Config']->setCookie( - 'pmaAuth-' . $GLOBALS['server'], - $this->cookieEncrypt( - json_encode($payload), - $this->_getSessionEncryptionSecret() - ), - null, - $GLOBALS['cfg']['LoginCookieStore'] - ); - } - - /** - * User is not allowed to login to MySQL -> authentication failed - * - * prepares error message and switches to auth() which display the error - * and the login form - * - * this function MUST exit/quit the application, - * currently done by call to auth() - * - * @return void - */ - public function authFails() - { - global $conn_error; - - // Deletes password cookie and displays the login form - $GLOBALS['PMA_Config']->removeCookie('pmaAuth-' . $GLOBALS['server']); - - $conn_error = $this->getErrorMessage(); - - $response = Response::getInstance(); - - // needed for PHP-CGI (not need for FastCGI or mod-php) - $response->header('Cache-Control: no-store, no-cache, must-revalidate'); - $response->header('Pragma: no-cache'); - - $this->auth(); - } - - /** - * Returns blowfish secret or generates one if needed. - * - * @return string - */ - private function _getEncryptionSecret() - { - if (empty($GLOBALS['cfg']['blowfish_secret'])) { - return $this->_getSessionEncryptionSecret(); - } else { - return $GLOBALS['cfg']['blowfish_secret']; - } - } - - /** - * Returns blowfish secret or generates one if needed. - * - * @return string - */ - private function _getSessionEncryptionSecret() - { - if (empty($_SESSION['encryption_key'])) { - if (self::useOpenSSL()) { - $_SESSION['encryption_key'] = openssl_random_pseudo_bytes(32); - } else { - $_SESSION['encryption_key'] = Crypt\Random::string(32); - } - } - return $_SESSION['encryption_key']; - } - - /** - * Checks whether we should use openssl for encryption. - * - * @return boolean - */ - public static function useOpenSSL() - { - return ( - function_exists('openssl_encrypt') - && function_exists('openssl_decrypt') - && function_exists('openssl_random_pseudo_bytes') - ); - } - - /** - * Concatenates secret in order to make it 16 bytes log - * - * This doesn't add any security, just ensures the secret - * is long enough by copying it. - * - * @param string $secret Original secret - * - * @return string - */ - public function enlargeSecret($secret) - { - while (strlen($secret) < 16) { - $secret .= $secret; - } - return substr($secret, 0, 16); - } - - /** - * Derives MAC secret from encryption secret. - * - * @param string $secret the secret - * - * @return string the MAC secret - */ - public function getMACSecret($secret) - { - // Grab first part, up to 16 chars - // The MAC and AES secrets can overlap if original secret is short - $length = strlen($secret); - if ($length > 16) { - return substr($secret, 0, 16); - } - return $this->enlargeSecret( - $length == 1 ? $secret : substr($secret, 0, -1) - ); - } - - /** - * Derives AES secret from encryption secret. - * - * @param string $secret the secret - * - * @return string the AES secret - */ - public function getAESSecret($secret) - { - // Grab second part, up to 16 chars - // The MAC and AES secrets can overlap if original secret is short - $length = strlen($secret); - if ($length > 16) { - return substr($secret, -16); - } - return $this->enlargeSecret( - $length == 1 ? $secret : substr($secret, 1) - ); - } - - /** - * Encryption using openssl's AES or phpseclib's AES - * (phpseclib uses mcrypt when it is available) - * - * @param string $data original data - * @param string $secret the secret - * - * @return string the encrypted result - */ - public function cookieEncrypt($data, $secret) - { - $mac_secret = $this->getMACSecret($secret); - $aes_secret = $this->getAESSecret($secret); - $iv = $this->createIV(); - if (self::useOpenSSL()) { - $result = openssl_encrypt( - $data, - 'AES-128-CBC', - $secret, - 0, - $iv - ); - } else { - $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); - $cipher->setIV($iv); - $cipher->setKey($aes_secret); - $result = base64_encode($cipher->encrypt($data)); - } - $iv = base64_encode($iv); - return json_encode( - array( - 'iv' => $iv, - 'mac' => hash_hmac('sha1', $iv . $result, $mac_secret), - 'payload' => $result, - ) - ); - } - - /** - * Decryption using openssl's AES or phpseclib's AES - * (phpseclib uses mcrypt when it is available) - * - * @param string $encdata encrypted data - * @param string $secret the secret - * - * @return string|bool original data, false on error - */ - public function cookieDecrypt($encdata, $secret) - { - $data = json_decode($encdata, true); - - if (! is_array($data) || ! isset($data['mac']) || ! isset($data['iv']) || ! isset($data['payload']) - || ! is_string($data['mac']) || ! is_string($data['iv']) || ! is_string($data['payload']) - ) { - return false; - } - - $mac_secret = $this->getMACSecret($secret); - $aes_secret = $this->getAESSecret($secret); - $newmac = hash_hmac('sha1', $data['iv'] . $data['payload'], $mac_secret); - - if (! hash_equals($data['mac'], $newmac)) { - return false; - } - - if (self::useOpenSSL()) { - return openssl_decrypt( - $data['payload'], - 'AES-128-CBC', - $secret, - 0, - base64_decode($data['iv']) - ); - } else { - $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); - $cipher->setIV(base64_decode($data['iv'])); - $cipher->setKey($aes_secret); - return $cipher->decrypt(base64_decode($data['payload'])); - } - } - - /** - * Returns size of IV for encryption. - * - * @return int - */ - public function getIVSize() - { - if (self::useOpenSSL()) { - return openssl_cipher_iv_length('AES-128-CBC'); - } - $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); - return $cipher->block_size; - } - - /** - * Initialization - * Store the initialization vector because it will be needed for - * further decryption. I don't think necessary to have one iv - * per server so I don't put the server number in the cookie name. - * - * @return void - */ - public function createIV() - { - /* Testsuite shortcut only to allow predictable IV */ - if (! is_null($this->_cookie_iv)) { - return $this->_cookie_iv; - } - if (self::useOpenSSL()) { - return openssl_random_pseudo_bytes( - $this->getIVSize() - ); - } else { - return Crypt\Random::string( - $this->getIVSize() - ); - } - } - - /** - * Sets encryption IV to use - * - * This is for testing only! - * - * @param string $vector The IV - * - * @return void - */ - public function setIV($vector) - { - $this->_cookie_iv = $vector; - } - - /** - * Callback when user changes password. - * - * @param string $password New password to set - * - * @return void - */ - public function handlePasswordChange($password) - { - $this->storePasswordCookie($password); - } - - /** - * Perform logout - * - * @return void - */ - public function logOut() - { - // -> delete password cookie(s) - if ($GLOBALS['cfg']['LoginCookieDeleteAll']) { - foreach ($GLOBALS['cfg']['Servers'] as $key => $val) { - $GLOBALS['PMA_Config']->removeCookie('pmaAuth-' . $key); - if (isset($_COOKIE['pmaAuth-' . $key])) { - unset($_COOKIE['pmaAuth-' . $key]); - } - } - } else { - $GLOBALS['PMA_Config']->removeCookie( - 'pmaAuth-' . $GLOBALS['server'] - ); - if (isset($_COOKIE['pmaAuth-' . $GLOBALS['server']])) { - unset($_COOKIE['pmaAuth-' . $GLOBALS['server']]); - } - } - parent::logOut(); - } -} diff --git a/#pma/libraries/plugins/auth/AuthenticationHttp.php b/#pma/libraries/plugins/auth/AuthenticationHttp.php deleted file mode 100644 index b4c6f928..00000000 --- a/#pma/libraries/plugins/auth/AuthenticationHttp.php +++ /dev/null @@ -1,262 +0,0 @@ -isAjax()) { - $response->setRequestStatus(false); - // reload_flag removes the token parameter from the URL and reloads - $response->addJSON('reload_flag', '1'); - if (defined('TESTSUITE')) { - return true; - } else { - exit; - } - } - - return $this->authForm(); - } - - /** - * Displays authentication form - * - * @return boolean - */ - public function authForm() - { - if (empty($GLOBALS['cfg']['Server']['auth_http_realm'])) { - if (empty($GLOBALS['cfg']['Server']['verbose'])) { - $server_message = $GLOBALS['cfg']['Server']['host']; - } else { - $server_message = $GLOBALS['cfg']['Server']['verbose']; - } - $realm_message = 'phpMyAdmin ' . $server_message; - } else { - $realm_message = $GLOBALS['cfg']['Server']['auth_http_realm']; - } - - $response = Response::getInstance(); - - // remove non US-ASCII to respect RFC2616 - $realm_message = preg_replace('/[^\x20-\x7e]/i', '', $realm_message); - $response->header('WWW-Authenticate: Basic realm="' . $realm_message . '"'); - $response->header('HTTP/1.0 401 Unauthorized'); - if (php_sapi_name() !== 'cgi-fcgi') { - $response->header('status: 401 Unauthorized'); - } - - /* HTML header */ - $footer = $response->getFooter(); - $footer->setMinimal(); - $header = $response->getHeader(); - $header->setTitle(__('Access denied!')); - $header->disableMenuAndConsole(); - $header->setBodyId('loginform'); - - $response->addHTML('

    '); - $response->addHTML(sprintf(__('Welcome to %s'), ' phpMyAdmin')); - $response->addHTML('

    '); - $response->addHTML('

    '); - $response->addHTML( - Message::error( - __('Wrong username/password. Access denied.') - ) - ); - $response->addHTML('

    '); - - if (@file_exists(CUSTOM_FOOTER_FILE)) { - include CUSTOM_FOOTER_FILE; - } - - if (!defined('TESTSUITE')) { - exit; - } else { - return false; - } - } - - /** - * Gets advanced authentication settings - * - * @global string $PHP_AUTH_USER the username if register_globals is - * on - * @global string $PHP_AUTH_PW the password if register_globals is - * on - * - * @return boolean whether we get authentication settings or not - */ - public function authCheck() - { - global $PHP_AUTH_USER, $PHP_AUTH_PW; - - // Grabs the $PHP_AUTH_USER variable whatever are the values of the - // 'register_globals' and the 'variables_order' directives - if (empty($PHP_AUTH_USER)) { - if (PMA_getenv('PHP_AUTH_USER')) { - $PHP_AUTH_USER = PMA_getenv('PHP_AUTH_USER'); - } elseif (PMA_getenv('REMOTE_USER')) { - // CGI, might be encoded, see below - $PHP_AUTH_USER = PMA_getenv('REMOTE_USER'); - } elseif (PMA_getenv('REDIRECT_REMOTE_USER')) { - // CGI, might be encoded, see below - $PHP_AUTH_USER = PMA_getenv('REDIRECT_REMOTE_USER'); - } elseif (PMA_getenv('AUTH_USER')) { - // WebSite Professional - $PHP_AUTH_USER = PMA_getenv('AUTH_USER'); - } elseif (PMA_getenv('HTTP_AUTHORIZATION')) { - // IIS, might be encoded, see below - $PHP_AUTH_USER = PMA_getenv('HTTP_AUTHORIZATION'); - } elseif (PMA_getenv('Authorization')) { - // FastCGI, might be encoded, see below - $PHP_AUTH_USER = PMA_getenv('Authorization'); - } - } - // Grabs the $PHP_AUTH_PW variable whatever are the values of the - // 'register_globals' and the 'variables_order' directives - if (empty($PHP_AUTH_PW)) { - if (PMA_getenv('PHP_AUTH_PW')) { - $PHP_AUTH_PW = PMA_getenv('PHP_AUTH_PW'); - } elseif (PMA_getenv('REMOTE_PASSWORD')) { - // Apache/CGI - $PHP_AUTH_PW = PMA_getenv('REMOTE_PASSWORD'); - } elseif (PMA_getenv('AUTH_PASSWORD')) { - // WebSite Professional - $PHP_AUTH_PW = PMA_getenv('AUTH_PASSWORD'); - } - } - - // Decode possibly encoded information (used by IIS/CGI/FastCGI) - // (do not use explode() because a user might have a colon in his password - if (strcmp(substr($PHP_AUTH_USER, 0, 6), 'Basic ') == 0) { - $usr_pass = base64_decode(substr($PHP_AUTH_USER, 6)); - if (!empty($usr_pass)) { - $colon = strpos($usr_pass, ':'); - if ($colon) { - $PHP_AUTH_USER = substr($usr_pass, 0, $colon); - $PHP_AUTH_PW = substr($usr_pass, $colon + 1); - } - unset($colon); - } - unset($usr_pass); - } - - // sanitize username - $PHP_AUTH_USER = PMA_sanitizeMySQLUser($PHP_AUTH_USER); - - // User logged out -> ensure the new username is not the same - $old_usr = isset($_REQUEST['old_usr']) ? $_REQUEST['old_usr'] : ''; - if (! empty($old_usr) - && (isset($PHP_AUTH_USER) && hash_equals($old_usr, $PHP_AUTH_USER)) - ) { - $PHP_AUTH_USER = ''; - // -> delete user's choices that were stored in session - if (!defined('TESTSUITE')) { - session_destroy(); - } - } - - // Returns whether we get authentication settings or not - if (empty($PHP_AUTH_USER)) { - return false; - } else { - return true; - } - } - - /** - * Set the user and password after last checkings if required - * - * @global array $cfg the valid servers settings - * @global integer $server the id of the current server - * @global string $PHP_AUTH_USER the current username - * @global string $PHP_AUTH_PW the current password - * - * @return boolean always true - */ - public function authSetUser() - { - global $cfg, $server; - global $PHP_AUTH_USER, $PHP_AUTH_PW; - - // Ensures valid authentication mode, 'only_db', bookmark database and - // table names and relation table name are used - if (! hash_equals($cfg['Server']['user'], $PHP_AUTH_USER)) { - $servers_cnt = count($cfg['Servers']); - for ($i = 1; $i <= $servers_cnt; $i++) { - if (isset($cfg['Servers'][$i]) - && ($cfg['Servers'][$i]['host'] == $cfg['Server']['host'] - && hash_equals($cfg['Servers'][$i]['user'], $PHP_AUTH_USER)) - ) { - $server = $i; - $cfg['Server'] = $cfg['Servers'][$i]; - break; - } - } // end for - } // end if - - $cfg['Server']['user'] = $PHP_AUTH_USER; - $cfg['Server']['password'] = $PHP_AUTH_PW; - - // Avoid showing the password in phpinfo()'s output - unset($GLOBALS['PHP_AUTH_PW']); - unset($_SERVER['PHP_AUTH_PW']); - - $this->setSessionAccessTime(); - - return true; - } - - /** - * User is not allowed to login to MySQL -> authentication failed - * - * @return bool true - */ - public function authFails() - { - $error = $GLOBALS['dbi']->getError(); - if ($error && $GLOBALS['errno'] != 1045) { - PMA_fatalError($error); - - return true; - } - - $this->authForm(); - - return true; - } - - /** - * Returns URL for login form. - * - * @return string - */ - public function getLoginFormURL() - { - return './index.php?old_usr=' . $GLOBALS['PHP_AUTH_USER']; - } -} diff --git a/#pma/libraries/plugins/auth/AuthenticationSignon.php b/#pma/libraries/plugins/auth/AuthenticationSignon.php deleted file mode 100644 index df52cb7e..00000000 --- a/#pma/libraries/plugins/auth/AuthenticationSignon.php +++ /dev/null @@ -1,243 +0,0 @@ - authentication failed - * - * @return boolean always true (no return indeed) - */ - public function authFails() - { - /* Session name */ - $session_name = $GLOBALS['cfg']['Server']['SignonSession']; - - /* Does session exist? */ - if (isset($_COOKIE[$session_name])) { - /* End current session */ - if (!defined('TESTSUITE')) { - session_write_close(); - } - - /* Load single signon session */ - session_name($session_name); - session_id($_COOKIE[$session_name]); - if (!defined('TESTSUITE')) { - session_start(); - } - - /* Set error message */ - $_SESSION['PMA_single_signon_error_message'] = $this->getErrorMessage(); - } - $this->auth(); - } - - /** - * Returns URL for login form. - * - * @return string - */ - public function getLoginFormURL() - { - return $GLOBALS['cfg']['Server']['SignonURL']; - } -} diff --git a/#pma/libraries/plugins/auth/recaptcha/LICENSE b/#pma/libraries/plugins/auth/recaptcha/LICENSE deleted file mode 100644 index f6412328..00000000 --- a/#pma/libraries/plugins/auth/recaptcha/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -Copyright 2014, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/ReCaptcha.php b/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/ReCaptcha.php deleted file mode 100644 index e2f7c347..00000000 --- a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/ReCaptcha.php +++ /dev/null @@ -1,97 +0,0 @@ -secret = $secret; - - if (!is_null($requestMethod)) { - $this->requestMethod = $requestMethod; - } else { - $this->requestMethod = new RequestMethod\Post(); - } - } - - /** - * Calls the reCAPTCHA siteverify API to verify whether the user passes - * CAPTCHA test. - * - * @param string $response The value of 'g-recaptcha-response' in the submitted form. - * @param string $remoteIp The end user's IP address. - * @return Response Response from the service. - */ - public function verify($response, $remoteIp = null) - { - // Discard empty solution submissions - if (empty($response)) { - $recaptchaResponse = new Response(false, array('missing-input-response')); - return $recaptchaResponse; - } - - $params = new RequestParameters($this->secret, $response, $remoteIp, self::VERSION); - $rawResponse = $this->requestMethod->submit($params); - return Response::fromJson($rawResponse); - } -} diff --git a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod.php b/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod.php deleted file mode 100644 index fc4dde59..00000000 --- a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod.php +++ /dev/null @@ -1,42 +0,0 @@ -curl = $curl; - } else { - $this->curl = new Curl(); - } - } - - /** - * Submit the cURL request with the specified parameters. - * - * @param RequestParameters $params Request parameters - * @return string Body of the reCAPTCHA response - */ - public function submit(RequestParameters $params) - { - $handle = $this->curl->init(self::SITE_VERIFY_URL); - - $options = array( - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => $params->toQueryString(), - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/x-www-form-urlencoded' - ), - CURLINFO_HEADER_OUT => false, - CURLOPT_HEADER => false, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_SSL_VERIFYPEER => true - ); - $this->curl->setoptArray($handle, $options); - - $response = $this->curl->exec($handle); - $this->curl->close($handle); - - return $response; - } -} diff --git a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/Post.php b/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/Post.php deleted file mode 100644 index 7770d908..00000000 --- a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/Post.php +++ /dev/null @@ -1,70 +0,0 @@ - array( - 'header' => "Content-type: application/x-www-form-urlencoded\r\n", - 'method' => 'POST', - 'content' => $params->toQueryString(), - // Force the peer to validate (not needed in 5.6.0+, but still works - 'verify_peer' => true, - // Force the peer validation to use www.google.com - $peer_key => 'www.google.com', - ), - ); - $context = stream_context_create($options); - return file_get_contents(self::SITE_VERIFY_URL, false, $context); - } -} diff --git a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/Socket.php b/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/Socket.php deleted file mode 100644 index d3c87922..00000000 --- a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/Socket.php +++ /dev/null @@ -1,105 +0,0 @@ -handle = fsockopen($hostname, $port, $errno, $errstr, (is_null($timeout) ? ini_get("default_socket_timeout") : $timeout)); - - if ($this->handle != false && $errno === 0 && $errstr === '') { - return $this->handle; - } else { - return false; - } - } - - /** - * fwrite - * - * @see http://php.net/fwrite - * @param string $string - * @param int $length - * @return int | bool - */ - public function fwrite($string, $length = null) - { - return fwrite($this->handle, $string, (is_null($length) ? strlen($string) : $length)); - } - - /** - * fgets - * - * @see http://php.net/fgets - * @param int $length - * @return string - */ - public function fgets($length = null) - { - return fgets($this->handle, $length); - } - - /** - * feof - * - * @see http://php.net/feof - * @return bool - */ - public function feof() - { - return feof($this->handle); - } - - /** - * fclose - * - * @see http://php.net/fclose - * @return bool - */ - public function fclose() - { - return fclose($this->handle); - } -} diff --git a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/SocketPost.php b/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/SocketPost.php deleted file mode 100644 index 47541215..00000000 --- a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/SocketPost.php +++ /dev/null @@ -1,121 +0,0 @@ -socket = $socket; - } else { - $this->socket = new Socket(); - } - } - - /** - * Submit the POST request with the specified parameters. - * - * @param RequestParameters $params Request parameters - * @return string Body of the reCAPTCHA response - */ - public function submit(RequestParameters $params) - { - $errno = 0; - $errstr = ''; - - if (false === $this->socket->fsockopen('ssl://' . self::RECAPTCHA_HOST, 443, $errno, $errstr, 30)) { - return self::BAD_REQUEST; - } - - $content = $params->toQueryString(); - - $request = "POST " . self::SITE_VERIFY_PATH . " HTTP/1.1\r\n"; - $request .= "Host: " . self::RECAPTCHA_HOST . "\r\n"; - $request .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $request .= "Content-length: " . strlen($content) . "\r\n"; - $request .= "Connection: close\r\n\r\n"; - $request .= $content . "\r\n\r\n"; - - $this->socket->fwrite($request); - $response = ''; - - while (!$this->socket->feof()) { - $response .= $this->socket->fgets(4096); - } - - $this->socket->fclose(); - - if (0 !== strpos($response, 'HTTP/1.1 200 OK')) { - return self::BAD_RESPONSE; - } - - $parts = preg_split("#\n\s*\n#Uis", $response); - - return $parts[1]; - } -} diff --git a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestParameters.php b/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestParameters.php deleted file mode 100644 index cb66f26c..00000000 --- a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/RequestParameters.php +++ /dev/null @@ -1,103 +0,0 @@ -secret = $secret; - $this->response = $response; - $this->remoteIp = $remoteIp; - $this->version = $version; - } - - /** - * Array representation. - * - * @return array Array formatted parameters. - */ - public function toArray() - { - $params = array('secret' => $this->secret, 'response' => $this->response); - - if (!is_null($this->remoteIp)) { - $params['remoteip'] = $this->remoteIp; - } - - if (!is_null($this->version)) { - $params['version'] = $this->version; - } - - return $params; - } - - /** - * Query string representation for HTTP request. - * - * @return string Query string formatted parameters. - */ - public function toQueryString() - { - return http_build_query($this->toArray(), '', '&'); - } -} diff --git a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/Response.php b/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/Response.php deleted file mode 100644 index d2d8a8bf..00000000 --- a/#pma/libraries/plugins/auth/recaptcha/ReCaptcha/Response.php +++ /dev/null @@ -1,102 +0,0 @@ -success = $success; - $this->errorCodes = $errorCodes; - } - - /** - * Is success? - * - * @return boolean - */ - public function isSuccess() - { - return $this->success; - } - - /** - * Get error codes. - * - * @return array - */ - public function getErrorCodes() - { - return $this->errorCodes; - } -} diff --git a/#pma/libraries/plugins/auth/recaptcha/autoload.php b/#pma/libraries/plugins/auth/recaptcha/autoload.php deleted file mode 100644 index a53cbd78..00000000 --- a/#pma/libraries/plugins/auth/recaptcha/autoload.php +++ /dev/null @@ -1,38 +0,0 @@ -initSpecificVariables(); - $this->setProperties(); - } - - /** - * Initialize the local variables that are used for export CodeGen - * - * @return void - */ - protected function initSpecificVariables() - { - $this->_setCgFormats( - array( - "NHibernate C# DO", - "NHibernate XML", - ) - ); - - $this->_setCgHandlers( - array( - "_handleNHibernateCSBody", - "_handleNHibernateXMLBody", - ) - ); - } - - /** - * Sets the export CodeGen properties - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('CodeGen'); - $exportPluginProperties->setExtension('cs'); - $exportPluginProperties->setMimeType('text/cs'); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new HiddenPropertyItem("structure_or_data"); - $generalOptions->addProperty($leaf); - $leaf = new SelectPropertyItem( - "format", - __('Format:') - ); - $leaf->setValues($this->_getCgFormats()); - $generalOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - return true; - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - return true; - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in NHibernate format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - $CG_FORMATS = $this->_getCgFormats(); - $CG_HANDLERS = $this->_getCgHandlers(); - - $format = $GLOBALS['codegen_format']; - if (isset($CG_FORMATS[$format])) { - $method = $CG_HANDLERS[$format]; - - return PMA_exportOutputHandler( - $this->$method($db, $table, $crlf, $aliases) - ); - } - - return PMA_exportOutputHandler(sprintf("%s is not supported.", $format)); - } - - /** - * Used to make identifiers (from table or database names) - * - * @param string $str name to be converted - * @param bool $ucfirst whether to make the first character uppercase - * - * @return string identifier - */ - public static function cgMakeIdentifier($str, $ucfirst = true) - { - // remove unsafe characters - $str = preg_replace('/[^\p{L}\p{Nl}_]/u', '', $str); - // make sure first character is a letter or _ - if (!preg_match('/^\pL/u', $str)) { - $str = '_' . $str; - } - if ($ucfirst) { - $str = ucfirst($str); - } - - return $str; - } - - /** - * C# Handler - * - * @param string $db database name - * @param string $table table name - * @param string $crlf line separator - * @param array $aliases Aliases of db/table/columns - * - * @return string containing C# code lines, separated by "\n" - */ - private function _handleNHibernateCSBody($db, $table, $crlf, $aliases = array()) - { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - $lines = array(); - - $result = $GLOBALS['dbi']->query( - sprintf( - 'DESC %s.%s', - PMA\libraries\Util::backquote($db), - PMA\libraries\Util::backquote($table) - ) - ); - if ($result) { - /** @var TableProperty[] $tableProperties */ - $tableProperties = array(); - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $col_as = $this->getAlias($aliases, $row[0], 'col', $db, $table); - if (!empty($col_as)) { - $row[0] = $col_as; - } - $tableProperties[] = new TableProperty($row); - } - $GLOBALS['dbi']->freeResult($result); - $lines[] = 'using System;'; - $lines[] = 'using System.Collections;'; - $lines[] = 'using System.Collections.Generic;'; - $lines[] = 'using System.Text;'; - $lines[] = 'namespace ' . ExportCodegen::cgMakeIdentifier($db_alias); - $lines[] = '{'; - $lines[] = ' #region ' - . ExportCodegen::cgMakeIdentifier($table_alias); - $lines[] = ' public class ' - . ExportCodegen::cgMakeIdentifier($table_alias); - $lines[] = ' {'; - $lines[] = ' #region Member Variables'; - foreach ($tableProperties as $tableProperty) { - $lines[] = $tableProperty->formatCs( - ' protected #dotNetPrimitiveType# _#name#;' - ); - } - $lines[] = ' #endregion'; - $lines[] = ' #region Constructors'; - $lines[] = ' public ' - . ExportCodegen::cgMakeIdentifier($table_alias) . '() { }'; - $temp = array(); - foreach ($tableProperties as $tableProperty) { - if (!$tableProperty->isPK()) { - $temp[] = $tableProperty->formatCs( - '#dotNetPrimitiveType# #name#' - ); - } - } - $lines[] = ' public ' - . ExportCodegen::cgMakeIdentifier($table_alias) - . '(' - . implode(', ', $temp) - . ')'; - $lines[] = ' {'; - foreach ($tableProperties as $tableProperty) { - if (!$tableProperty->isPK()) { - $lines[] = $tableProperty->formatCs( - ' this._#name#=#name#;' - ); - } - } - $lines[] = ' }'; - $lines[] = ' #endregion'; - $lines[] = ' #region Public Properties'; - foreach ($tableProperties as $tableProperty) { - $lines[] = $tableProperty->formatCs( - ' public virtual #dotNetPrimitiveType# #ucfirstName#' - . "\n" - . ' {' . "\n" - . ' get {return _#name#;}' . "\n" - . ' set {_#name#=value;}' . "\n" - . ' }' - ); - } - $lines[] = ' #endregion'; - $lines[] = ' }'; - $lines[] = ' #endregion'; - $lines[] = '}'; - } - - return implode($crlf, $lines); - } - - /** - * XML Handler - * - * @param string $db database name - * @param string $table table name - * @param string $crlf line separator - * @param array $aliases Aliases of db/table/columns - * - * @return string containing XML code lines, separated by "\n" - */ - private function _handleNHibernateXMLBody( - $db, - $table, - $crlf, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - $lines = array(); - $lines[] = ''; - $lines[] = ''; - $lines[] = ' '; - $result = $GLOBALS['dbi']->query( - sprintf( - "DESC %s.%s", - PMA\libraries\Util::backquote($db), - PMA\libraries\Util::backquote($table) - ) - ); - if ($result) { - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $col_as = $this->getAlias($aliases, $row[0], 'col', $db, $table); - if (!empty($col_as)) { - $row[0] = $col_as; - } - $tableProperty = new TableProperty($row); - if ($tableProperty->isPK()) { - $lines[] = $tableProperty->formatXml( - ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' - ); - } else { - $lines[] = $tableProperty->formatXml( - ' ' . "\n" - . ' ' . "\n" - . ' ' - ); - } - } - $GLOBALS['dbi']->freeResult($result); - } - $lines[] = ' '; - $lines[] = ''; - - return implode($crlf, $lines); - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Getter for CodeGen formats - * - * @return array - */ - private function _getCgFormats() - { - return $this->_cgFormats; - } - - /** - * Setter for CodeGen formats - * - * @param array $CG_FORMATS contains CodeGen Formats - * - * @return void - */ - private function _setCgFormats($CG_FORMATS) - { - $this->_cgFormats = $CG_FORMATS; - } - - /** - * Getter for CodeGen handlers - * - * @return array - */ - private function _getCgHandlers() - { - return $this->_cgHandlers; - } - - /** - * Setter for CodeGen handlers - * - * @param array $CG_HANDLERS contains CodeGen handler methods - * - * @return void - */ - private function _setCgHandlers($CG_HANDLERS) - { - $this->_cgHandlers = $CG_HANDLERS; - } -} diff --git a/#pma/libraries/plugins/export/ExportCsv.php b/#pma/libraries/plugins/export/ExportCsv.php deleted file mode 100644 index 55483658..00000000 --- a/#pma/libraries/plugins/export/ExportCsv.php +++ /dev/null @@ -1,331 +0,0 @@ -setProperties(); - } - - /** - * Sets the export CSV properties - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('CSV'); - $exportPluginProperties->setExtension('csv'); - $exportPluginProperties->setMimeType('text/comma-separated-values'); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create leaf items and add them to the group - $leaf = new TextPropertyItem( - "separator", - __('Columns separated with:') - ); - $generalOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "enclosed", - __('Columns enclosed with:') - ); - $generalOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "escaped", - __('Columns escaped with:') - ); - $generalOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "terminated", - __('Lines terminated with:') - ); - $generalOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - 'null', - __('Replace NULL with:') - ); - $generalOptions->addProperty($leaf); - $leaf = new BoolPropertyItem( - 'removeCRLF', - __('Remove carriage return/line feed characters within columns') - ); - $generalOptions->addProperty($leaf); - $leaf = new BoolPropertyItem( - 'columns', - __('Put columns names in the first row') - ); - $generalOptions->addProperty($leaf); - $leaf = new HiddenPropertyItem( - 'structure_or_data' - ); - $generalOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - global $what, $csv_terminated, $csv_separator, $csv_enclosed, $csv_escaped; - - // Here we just prepare some values for export - if ($what == 'excel') { - $csv_terminated = "\015\012"; - switch ($GLOBALS['excel_edition']) { - case 'win': - // as tested on Windows with Excel 2002 and Excel 2007 - $csv_separator = ';'; - break; - case 'mac_excel2003': - $csv_separator = ';'; - break; - case 'mac_excel2008': - $csv_separator = ','; - break; - } - $csv_enclosed = '"'; - $csv_escaped = '"'; - if (isset($GLOBALS['excel_columns'])) { - $GLOBALS['csv_columns'] = 'yes'; - } - } else { - if (empty($csv_terminated) - || mb_strtolower($csv_terminated) == 'auto' - ) { - $csv_terminated = $GLOBALS['crlf']; - } else { - $csv_terminated = str_replace('\\r', "\015", $csv_terminated); - $csv_terminated = str_replace('\\n', "\012", $csv_terminated); - $csv_terminated = str_replace('\\t', "\011", $csv_terminated); - } // end if - $csv_separator = str_replace('\\t', "\011", $csv_separator); - } - - return true; - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Alias of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - return true; - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in CSV format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - global $what, $csv_terminated, $csv_separator, $csv_enclosed, $csv_escaped; - - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - // Gets the data from the database - $result = $GLOBALS['dbi']->query( - $sql_query, - null, - PMA\libraries\DatabaseInterface::QUERY_UNBUFFERED - ); - $fields_cnt = $GLOBALS['dbi']->numFields($result); - - // If required, get fields name at the first line - if (isset($GLOBALS['csv_columns'])) { - $schema_insert = ''; - for ($i = 0; $i < $fields_cnt; $i++) { - $col_as = $GLOBALS['dbi']->fieldName($result, $i); - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $col_as = stripslashes($col_as); - if ($csv_enclosed == '') { - $schema_insert .= $col_as; - } else { - $schema_insert .= $csv_enclosed - . str_replace( - $csv_enclosed, - $csv_escaped . $csv_enclosed, - $col_as - ) - . $csv_enclosed; - } - $schema_insert .= $csv_separator; - } // end for - $schema_insert = trim(mb_substr($schema_insert, 0, -1)); - if (!PMA_exportOutputHandler($schema_insert . $csv_terminated)) { - return false; - } - } // end if - - // Format the data - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $schema_insert = ''; - for ($j = 0; $j < $fields_cnt; $j++) { - if (!isset($row[$j]) || is_null($row[$j])) { - $schema_insert .= $GLOBALS[$what . '_null']; - } elseif ($row[$j] == '0' || $row[$j] != '') { - // always enclose fields - if ($what == 'excel') { - $row[$j] = preg_replace("/\015(\012)?/", "\012", $row[$j]); - } - // remove CRLF characters within field - if (isset($GLOBALS[$what . '_removeCRLF']) - && $GLOBALS[$what . '_removeCRLF'] - ) { - $row[$j] = str_replace( - "\n", - "", - str_replace( - "\r", - "", - $row[$j] - ) - ); - } - if ($csv_enclosed == '') { - $schema_insert .= $row[$j]; - } else { - // also double the escape string if found in the data - if ($csv_escaped != $csv_enclosed) { - $schema_insert .= $csv_enclosed - . str_replace( - $csv_enclosed, - $csv_escaped . $csv_enclosed, - str_replace( - $csv_escaped, - $csv_escaped . $csv_escaped, - $row[$j] - ) - ) - . $csv_enclosed; - } else { - // avoid a problem when escape string equals enclose - $schema_insert .= $csv_enclosed - . str_replace( - $csv_enclosed, - $csv_escaped . $csv_enclosed, - $row[$j] - ) - . $csv_enclosed; - } - } - } else { - $schema_insert .= ''; - } - if ($j < $fields_cnt - 1) { - $schema_insert .= $csv_separator; - } - } // end for - - if (!PMA_exportOutputHandler($schema_insert . $csv_terminated)) { - return false; - } - } // end while - $GLOBALS['dbi']->freeResult($result); - - return true; - } -} diff --git a/#pma/libraries/plugins/export/ExportExcel.php b/#pma/libraries/plugins/export/ExportExcel.php deleted file mode 100644 index 63f10b32..00000000 --- a/#pma/libraries/plugins/export/ExportExcel.php +++ /dev/null @@ -1,88 +0,0 @@ -setText('CSV for MS Excel'); - $exportPluginProperties->setExtension('csv'); - $exportPluginProperties->setMimeType('text/comma-separated-values'); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new TextPropertyItem( - 'null', - __('Replace NULL with:') - ); - $generalOptions->addProperty($leaf); - $leaf = new BoolPropertyItem( - 'removeCRLF', - __('Remove carriage return/line feed characters within columns') - ); - $generalOptions->addProperty($leaf); - $leaf = new BoolPropertyItem( - 'columns', - __('Put columns names in the first row') - ); - $generalOptions->addProperty($leaf); - $leaf = new SelectPropertyItem( - 'edition', - __('Excel edition:') - ); - $leaf->setValues( - array( - 'win' => 'Windows', - 'mac_excel2003' => 'Excel 2003 / Macintosh', - 'mac_excel2008' => 'Excel 2008 / Macintosh', - ) - ); - $generalOptions->addProperty($leaf); - $leaf = new HiddenPropertyItem( - 'structure_or_data' - ); - $generalOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } -} diff --git a/#pma/libraries/plugins/export/ExportHtmlword.php b/#pma/libraries/plugins/export/ExportHtmlword.php deleted file mode 100644 index b0467f69..00000000 --- a/#pma/libraries/plugins/export/ExportHtmlword.php +++ /dev/null @@ -1,665 +0,0 @@ -setProperties(); - } - - /** - * Sets the export HTML-Word properties - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('Microsoft Word 2000'); - $exportPluginProperties->setExtension('doc'); - $exportPluginProperties->setMimeType('application/vnd.ms-word'); - $exportPluginProperties->setForceFile(true); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // what to dump (structure/data/both) - $dumpWhat = new OptionsPropertyMainGroup( - "dump_what", __('Dump table') - ); - // create primary items and add them to the group - $leaf = new RadioPropertyItem("structure_or_data"); - $leaf->setValues( - array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data'), - ) - ); - $dumpWhat->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($dumpWhat); - - // data options main group - $dataOptions = new OptionsPropertyMainGroup( - "dump_what", __('Data dump options') - ); - $dataOptions->setForce('structure'); - // create primary items and add them to the group - $leaf = new TextPropertyItem( - "null", - __('Replace NULL with:') - ); - $dataOptions->addProperty($leaf); - $leaf = new BoolPropertyItem( - "columns", - __('Put columns names in the first row') - ); - $dataOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($dataOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - global $charset; - - return PMA_exportOutputHandler( - ' - - - - - - - ' - ); - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - return PMA_exportOutputHandler(''); - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - if (empty($db_alias)) { - $db_alias = $db; - } - - return PMA_exportOutputHandler( - '

    ' . __('Database') . ' ' . htmlspecialchars($db_alias) . '

    ' - ); - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in HTML-Word format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - global $what; - - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - if (!PMA_exportOutputHandler( - '

    ' - . __('Dumping data for table') . ' ' . htmlspecialchars($table_alias) - . '

    ' - ) - ) { - return false; - } - if (!PMA_exportOutputHandler( - '' - ) - ) { - return false; - } - - // Gets the data from the database - $result = $GLOBALS['dbi']->query( - $sql_query, - null, - DatabaseInterface::QUERY_UNBUFFERED - ); - $fields_cnt = $GLOBALS['dbi']->numFields($result); - - // If required, get fields name at the first line - if (isset($GLOBALS['htmlword_columns'])) { - $schema_insert = ''; - for ($i = 0; $i < $fields_cnt; $i++) { - $col_as = $GLOBALS['dbi']->fieldName($result, $i); - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $col_as = stripslashes($col_as); - $schema_insert .= ''; - } // end for - $schema_insert .= ''; - if (!PMA_exportOutputHandler($schema_insert)) { - return false; - } - } // end if - - // Format the data - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $schema_insert = ''; - for ($j = 0; $j < $fields_cnt; $j++) { - if (!isset($row[$j]) || is_null($row[$j])) { - $value = $GLOBALS[$what . '_null']; - } elseif ($row[$j] == '0' || $row[$j] != '') { - $value = $row[$j]; - } else { - $value = ''; - } - $schema_insert .= ''; - } // end for - $schema_insert .= ''; - if (!PMA_exportOutputHandler($schema_insert)) { - return false; - } - } // end while - $GLOBALS['dbi']->freeResult($result); - if (!PMA_exportOutputHandler('
    ')) { - return false; - } - - return true; - } - - /** - * Returns a stand-in CREATE definition to resolve view dependencies - * - * @param string $db the database name - * @param string $view the view name - * @param string $crlf the end of line sequence - * @param array $aliases Aliases of db/table/columns - * - * @return string resulting definition - */ - public function getTableDefStandIn($db, $view, $crlf, $aliases = array()) - { - $schema_insert = '' - . '' - . '' - . '' - . '' - . '' - . ''; - - /** - * Get the unique keys in the view - */ - $unique_keys = array(); - $keys = $GLOBALS['dbi']->getTableIndexes($db, $view); - foreach ($keys as $key) { - if ($key['Non_unique'] == 0) { - $unique_keys[] = $key['Column_name']; - } - } - - $columns = $GLOBALS['dbi']->getColumns($db, $view); - foreach ($columns as $column) { - $col_as = $column['Field']; - if (!empty($aliases[$db]['tables'][$view]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$view]['columns'][$col_as]; - } - $schema_insert .= $this->formatOneColumnDefinition( - $column, - $unique_keys, - $col_as - ); - $schema_insert .= ''; - } - - $schema_insert .= '
    '; - - return $schema_insert; - } - - /** - * Returns $table's CREATE definition - * - * @param string $db the database name - * @param string $table the table name - * @param bool $do_relation whether to include relation comments - * @param bool $do_comments whether to include the pmadb-style column - * comments as comments in the structure; - * this is deprecated but the parameter is - * left here because export.php calls - * PMA_exportStructure() also for other - * export types which use this parameter - * @param bool $do_mime whether to include mime comments - * at the end - * @param bool $view whether we're handling a view - * @param array $aliases Aliases of db/table/columns - * - * @return string resulting schema - */ - public function getTableDef( - $db, - $table, - $do_relation, - $do_comments, - $do_mime, - $view = false, - $aliases = array() - ) { - // set $cfgRelation here, because there is a chance that it's modified - // since the class initialization - global $cfgRelation; - - $schema_insert = ''; - - /** - * Gets fields properties - */ - $GLOBALS['dbi']->selectDb($db); - - // Check if we can use Relations - list($res_rel, $have_rel) = PMA_getRelationsAndStatus( - $do_relation && !empty($cfgRelation['relation']), - $db, - $table - ); - - /** - * Displays the table structure - */ - $schema_insert .= ''; - - $schema_insert .= ''; - $schema_insert .= ''; - $schema_insert .= ''; - $schema_insert .= ''; - $schema_insert .= ''; - if ($do_relation && $have_rel) { - $schema_insert .= ''; - } - if ($do_comments) { - $schema_insert .= ''; - $comments = PMA_getComments($db, $table); - } - if ($do_mime && $cfgRelation['mimework']) { - $schema_insert .= ''; - $mime_map = PMA_getMIME($db, $table, true); - } - $schema_insert .= ''; - - $columns = $GLOBALS['dbi']->getColumns($db, $table); - /** - * Get the unique keys in the table - */ - $unique_keys = array(); - $keys = $GLOBALS['dbi']->getTableIndexes($db, $table); - foreach ($keys as $key) { - if ($key['Non_unique'] == 0) { - $unique_keys[] = $key['Column_name']; - } - } - foreach ($columns as $column) { - $col_as = $column['Field']; - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $schema_insert .= $this->formatOneColumnDefinition( - $column, - $unique_keys, - $col_as - ); - $field_name = $column['Field']; - if ($do_relation && $have_rel) { - $schema_insert .= ''; - } - if ($do_comments && $cfgRelation['commwork']) { - $schema_insert .= ''; - } - if ($do_mime && $cfgRelation['mimework']) { - $schema_insert .= ''; - } - - $schema_insert .= ''; - } // end foreach - - $schema_insert .= '
    ' - . htmlspecialchars( - $this->getRelationString( - $res_rel, - $field_name, - $db, - $aliases - ) - ) - . '' - . (isset($comments[$field_name]) - ? htmlspecialchars($comments[$field_name]) - : '') . '' - . (isset($mime_map[$field_name]) ? - htmlspecialchars( - str_replace('_', '/', $mime_map[$field_name]['mimetype']) - ) - : '') . '
    '; - - return $schema_insert; - } - - /** - * Outputs triggers - * - * @param string $db database name - * @param string $table table name - * - * @return string Formatted triggers list - */ - protected function getTriggers($db, $table) - { - $dump = ''; - $dump .= ''; - $dump .= ''; - $dump .= ''; - $dump .= ''; - $dump .= ''; - $dump .= ''; - - $triggers = $GLOBALS['dbi']->getTriggers($db, $table); - - foreach ($triggers as $trigger) { - $dump .= ''; - $dump .= '' - . '' - . '' - . '' - . ''; - } - - $dump .= '
    '; - - return $dump; - } - - /** - * Outputs table's structure - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $export_mode 'create_table', 'triggers', 'create_view', - * 'stand_in' - * @param string $export_type 'server', 'database', 'table' - * @param bool $do_relation whether to include relation comments - * @param bool $do_comments whether to include the pmadb-style column - * comments as comments in the structure; - * this is deprecated but the parameter is - * left here because export.php calls - * PMA_exportStructure() also for other - * export types which use this parameter - * @param bool $do_mime whether to include mime comments - * @param bool $dates whether to include creation/update/check dates - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportStructure( - $db, - $table, - $crlf, - $error_url, - $export_mode, - $export_type, - $do_relation = false, - $do_comments = false, - $do_mime = false, - $dates = false, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - $dump = ''; - - switch ($export_mode) { - case 'create_table': - $dump .= '

    ' - . __('Table structure for table') . ' ' - . htmlspecialchars($table_alias) - . '

    '; - $dump .= $this->getTableDef( - $db, - $table, - $do_relation, - $do_comments, - $do_mime, - false, - $aliases - ); - break; - case 'triggers': - $dump = ''; - $triggers = $GLOBALS['dbi']->getTriggers($db, $table); - if ($triggers) { - $dump .= '

    ' - . __('Triggers') . ' ' . htmlspecialchars($table_alias) - . '

    '; - $dump .= $this->getTriggers($db, $table); - } - break; - case 'create_view': - $dump .= '

    ' - . __('Structure for view') . ' ' . htmlspecialchars($table_alias) - . '

    '; - $dump .= $this->getTableDef( - $db, - $table, - $do_relation, - $do_comments, - $do_mime, - true, - $aliases - ); - break; - case 'stand_in': - $dump .= '

    ' - . __('Stand-in structure for view') . ' ' - . htmlspecialchars($table_alias) - . '

    '; - // export a stand-in definition to resolve view dependencies - $dump .= $this->getTableDefStandIn($db, $table, $crlf, $aliases); - } // end switch - - return PMA_exportOutputHandler($dump); - } - - /** - * Formats the definition for one column - * - * @param array $column info about this column - * @param array $unique_keys unique keys of the table - * @param string $col_alias Column Alias - * - * @return string Formatted column definition - */ - protected function formatOneColumnDefinition( - $column, - $unique_keys, - $col_alias = '' - ) { - if (empty($col_alias)) { - $col_alias = $column['Field']; - } - $definition = ''; - - $extracted_columnspec = Util::extractColumnSpec($column['Type']); - - $type = htmlspecialchars($extracted_columnspec['print_type']); - if (empty($type)) { - $type = ' '; - } - - if (!isset($column['Default'])) { - if ($column['Null'] != 'NO') { - $column['Default'] = 'NULL'; - } - } - - $fmt_pre = ''; - $fmt_post = ''; - if (in_array($column['Field'], $unique_keys)) { - $fmt_pre = '' . $fmt_pre; - $fmt_post = $fmt_post . ''; - } - if ($column['Key'] == 'PRI') { - $fmt_pre = '' . $fmt_pre; - $fmt_post = $fmt_post . ''; - } - $definition .= '' . $fmt_pre - . htmlspecialchars($col_alias) . $fmt_post . ''; - $definition .= '' . htmlspecialchars($type) . ''; - $definition .= '' - . (($column['Null'] == '' || $column['Null'] == 'NO') - ? __('No') - : __('Yes')) - . ''; - $definition .= '' - . htmlspecialchars(isset($column['Default']) ? $column['Default'] : '') - . ''; - - return $definition; - } -} diff --git a/#pma/libraries/plugins/export/ExportJson.php b/#pma/libraries/plugins/export/ExportJson.php deleted file mode 100644 index d5f84cf9..00000000 --- a/#pma/libraries/plugins/export/ExportJson.php +++ /dev/null @@ -1,238 +0,0 @@ -setProperties(); - } - - /** - * Sets the export JSON properties - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('JSON'); - $exportPluginProperties->setExtension('json'); - $exportPluginProperties->setMimeType('text/plain'); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new HiddenPropertyItem("structure_or_data"); - $generalOptions->addProperty($leaf); - - // JSON_PRETTY_PRINT is available since 5.4.0 - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - $leaf = new BoolPropertyItem( - 'pretty_print', - __('Output pretty-printed JSON (Use human-readable formatting)') - ); - $generalOptions->addProperty($leaf); - } - - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - PMA_exportOutputHandler( - '/**' . $GLOBALS['crlf'] - . ' Export to JSON plugin for PHPMyAdmin' . $GLOBALS['crlf'] - . ' @version ' . PMA_VERSION . $GLOBALS['crlf'] - . ' */' . $GLOBALS['crlf'] . $GLOBALS['crlf'] - ); - - return true; - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - if (empty($db_alias)) { - $db_alias = $db; - } - PMA_exportOutputHandler( - '// Database \'' . $db_alias . '\'' . $GLOBALS['crlf'] - ); - - return true; - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in JSON format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - $result = $GLOBALS['dbi']->query( - $sql_query, - null, - PMA\libraries\DatabaseInterface::QUERY_UNBUFFERED - ); - $columns_cnt = $GLOBALS['dbi']->numFields($result); - - $columns = array(); - for ($i = 0; $i < $columns_cnt; $i++) { - $col_as = $GLOBALS['dbi']->fieldName($result, $i); - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $columns[$i] = stripslashes($col_as); - } - - $record_cnt = 0; - while ($record = $GLOBALS['dbi']->fetchRow($result)) { - - $record_cnt++; - - // Output table name as comment if this is the first record of the table - if ($record_cnt == 1) { - $buffer = $crlf . '// ' . $db_alias . '.' . $table_alias - . $crlf . $crlf; - $buffer .= '['; - } else { - $buffer = ', '; - } - - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - - $data = array(); - - for ($i = 0; $i < $columns_cnt; $i++) { - $data[$columns[$i]] = $record[$i]; - } - - if (isset($GLOBALS['json_pretty_print']) - && $GLOBALS['json_pretty_print'] - ) { - $encoded = json_encode($data, JSON_PRETTY_PRINT); - } else { - $encoded = json_encode($data); - } - - if (!PMA_exportOutputHandler($encoded)) { - return false; - } - } - - if ($record_cnt) { - if (!PMA_exportOutputHandler(']' . $crlf)) { - return false; - } - } - - $GLOBALS['dbi']->freeResult($result); - - return true; - } -} diff --git a/#pma/libraries/plugins/export/ExportLatex.php b/#pma/libraries/plugins/export/ExportLatex.php deleted file mode 100644 index 651ef5ba..00000000 --- a/#pma/libraries/plugins/export/ExportLatex.php +++ /dev/null @@ -1,675 +0,0 @@ -initSpecificVariables(); - - $this->setProperties(); - } - - /** - * Initialize the local variables that are used for export Latex - * - * @return void - */ - protected function initSpecificVariables() - { - /* Messages used in default captions */ - $GLOBALS['strLatexContent'] = __('Content of table @TABLE@'); - $GLOBALS['strLatexContinued'] = __('(continued)'); - $GLOBALS['strLatexStructure'] = __('Structure of table @TABLE@'); - } - - /** - * Sets the export Latex properties - * - * @return void - */ - protected function setProperties() - { - global $plugin_param; - $hide_structure = false; - if ($plugin_param['export_type'] == 'table' - && !$plugin_param['single_table'] - ) { - $hide_structure = true; - } - - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('LaTeX'); - $exportPluginProperties->setExtension('tex'); - $exportPluginProperties->setMimeType('application/x-tex'); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new BoolPropertyItem( - "caption", - __('Include table caption') - ); - $generalOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // what to dump (structure/data/both) main group - $dumpWhat = new OptionsPropertyMainGroup( - "dump_what", __('Dump table') - ); - // create primary items and add them to the group - $leaf = new RadioPropertyItem("structure_or_data"); - $leaf->setValues( - array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data'), - ) - ); - $dumpWhat->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($dumpWhat); - - // structure options main group - if (!$hide_structure) { - $structureOptions = new OptionsPropertyMainGroup( - "structure", __('Object creation options') - ); - $structureOptions->setForce('data'); - // create primary items and add them to the group - $leaf = new TextPropertyItem( - "structure_caption", - __('Table caption:') - ); - $leaf->setDoc('faq6-27'); - $structureOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "structure_continued_caption", - __('Table caption (continued):') - ); - $leaf->setDoc('faq6-27'); - $structureOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "structure_label", - __('Label key:') - ); - $leaf->setDoc('faq6-27'); - $structureOptions->addProperty($leaf); - if (!empty($GLOBALS['cfgRelation']['relation'])) { - $leaf = new BoolPropertyItem( - "relation", - __('Display foreign key relationships') - ); - $structureOptions->addProperty($leaf); - } - $leaf = new BoolPropertyItem( - "comments", - __('Display comments') - ); - $structureOptions->addProperty($leaf); - if (!empty($GLOBALS['cfgRelation']['mimework'])) { - $leaf = new BoolPropertyItem( - "mime", - __('Display MIME types') - ); - $structureOptions->addProperty($leaf); - } - // add the main group to the root group - $exportSpecificOptions->addProperty($structureOptions); - } - - // data options main group - $dataOptions = new OptionsPropertyMainGroup( - "data", __('Data dump options') - ); - $dataOptions->setForce('structure'); - // create primary items and add them to the group - $leaf = new BoolPropertyItem( - "columns", - __('Put columns names in the first row:') - ); - $dataOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "data_caption", - __('Table caption:') - ); - $leaf->setDoc('faq6-27'); - $dataOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "data_continued_caption", - __('Table caption (continued):') - ); - $leaf->setDoc('faq6-27'); - $dataOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "data_label", - __('Label key:') - ); - $leaf->setDoc('faq6-27'); - $dataOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - 'null', - __('Replace NULL with:') - ); - $dataOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($dataOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - global $crlf; - global $cfg; - - $head = '% phpMyAdmin LaTeX Dump' . $crlf - . '% version ' . PMA_VERSION . $crlf - . '% https://www.phpmyadmin.net/' . $crlf - . '%' . $crlf - . '% ' . __('Host:') . ' ' . $cfg['Server']['host']; - if (!empty($cfg['Server']['port'])) { - $head .= ':' . $cfg['Server']['port']; - } - $head .= $crlf - . '% ' . __('Generation Time:') . ' ' - . Util::localisedDate() . $crlf - . '% ' . __('Server version:') . ' ' . PMA_MYSQL_STR_VERSION . $crlf - . '% ' . __('PHP Version:') . ' ' . phpversion() . $crlf; - - return PMA_exportOutputHandler($head); - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - if (empty($db_alias)) { - $db_alias = $db; - } - global $crlf; - $head = '% ' . $crlf - . '% ' . __('Database:') . ' ' . '\'' . $db_alias . '\'' . $crlf - . '% ' . $crlf; - - return PMA_exportOutputHandler($head); - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in JSON format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - $result = $GLOBALS['dbi']->tryQuery( - $sql_query, - null, - DatabaseInterface::QUERY_UNBUFFERED - ); - - $columns_cnt = $GLOBALS['dbi']->numFields($result); - $columns = array(); - $columns_alias = array(); - for ($i = 0; $i < $columns_cnt; $i++) { - $columns[$i] = $col_as = $GLOBALS['dbi']->fieldName($result, $i); - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $columns_alias[$i] = $col_as; - } - - $buffer = $crlf . '%' . $crlf . '% ' . __('Data:') . ' ' . $table_alias - . $crlf . '%' . $crlf . ' \\begin{longtable}{|'; - - for ($index = 0; $index < $columns_cnt; $index++) { - $buffer .= 'l|'; - } - $buffer .= '} ' . $crlf; - - $buffer .= ' \\hline \\endhead \\hline \\endfoot \\hline ' . $crlf; - if (isset($GLOBALS['latex_caption'])) { - $buffer .= ' \\caption{' - . Util::expandUserString( - $GLOBALS['latex_data_caption'], - array( - 'texEscape', - get_class($this), - ), - array('table' => $table_alias, 'database' => $db_alias) - ) - . '} \\label{' - . Util::expandUserString( - $GLOBALS['latex_data_label'], - null, - array('table' => $table_alias, 'database' => $db_alias) - ) - . '} \\\\'; - } - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - - // show column names - if (isset($GLOBALS['latex_columns'])) { - $buffer = '\\hline '; - for ($i = 0; $i < $columns_cnt; $i++) { - $buffer .= '\\multicolumn{1}{|c|}{\\textbf{' - . self::texEscape(stripslashes($columns_alias[$i])) . '}} & '; - } - - $buffer = mb_substr($buffer, 0, -2) . '\\\\ \\hline \hline '; - if (!PMA_exportOutputHandler($buffer . ' \\endfirsthead ' . $crlf)) { - return false; - } - if (isset($GLOBALS['latex_caption'])) { - if (!PMA_exportOutputHandler( - '\\caption{' - . Util::expandUserString( - $GLOBALS['latex_data_continued_caption'], - array( - 'texEscape', - get_class($this), - ), - array('table' => $table_alias, 'database' => $db_alias) - ) - . '} \\\\ ' - ) - ) { - return false; - } - } - if (!PMA_exportOutputHandler($buffer . '\\endhead \\endfoot' . $crlf)) { - return false; - } - } else { - if (!PMA_exportOutputHandler('\\\\ \hline')) { - return false; - } - } - - // print the whole table - while ($record = $GLOBALS['dbi']->fetchAssoc($result)) { - $buffer = ''; - // print each row - for ($i = 0; $i < $columns_cnt; $i++) { - if ((!function_exists('is_null') - || !is_null($record[$columns[$i]])) - && isset($record[$columns[$i]]) - ) { - $column_value = self::texEscape( - stripslashes($record[$columns[$i]]) - ); - } else { - $column_value = $GLOBALS['latex_null']; - } - - // last column ... no need for & character - if ($i == ($columns_cnt - 1)) { - $buffer .= $column_value; - } else { - $buffer .= $column_value . " & "; - } - } - $buffer .= ' \\\\ \\hline ' . $crlf; - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - } - - $buffer = ' \\end{longtable}' . $crlf; - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - - $GLOBALS['dbi']->freeResult($result); - - return true; - } // end getTableLaTeX - - /** - * Outputs table's structure - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $export_mode 'create_table', 'triggers', 'create_view', - * 'stand_in' - * @param string $export_type 'server', 'database', 'table' - * @param bool $do_relation whether to include relation comments - * @param bool $do_comments whether to include the pmadb-style column - * comments as comments in the structure; - * this is deprecated but the parameter is - * left here because export.php calls - * exportStructure() also for other - * export types which use this parameter - * @param bool $do_mime whether to include mime comments - * @param bool $dates whether to include creation/update/check dates - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportStructure( - $db, - $table, - $crlf, - $error_url, - $export_mode, - $export_type, - $do_relation = false, - $do_comments = false, - $do_mime = false, - $dates = false, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - global $cfgRelation; - - /* We do not export triggers */ - if ($export_mode == 'triggers') { - return true; - } - - /** - * Get the unique keys in the table - */ - $unique_keys = array(); - $keys = $GLOBALS['dbi']->getTableIndexes($db, $table); - foreach ($keys as $key) { - if ($key['Non_unique'] == 0) { - $unique_keys[] = $key['Column_name']; - } - } - - /** - * Gets fields properties - */ - $GLOBALS['dbi']->selectDb($db); - - // Check if we can use Relations - list($res_rel, $have_rel) = PMA_getRelationsAndStatus( - $do_relation && !empty($cfgRelation['relation']), - $db, - $table - ); - /** - * Displays the table structure - */ - $buffer = $crlf . '%' . $crlf . '% ' . __('Structure:') . ' ' - . $table_alias . $crlf . '%' . $crlf . ' \\begin{longtable}{'; - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - - $alignment = '|l|c|c|c|'; - if ($do_relation && $have_rel) { - $alignment .= 'l|'; - } - if ($do_comments) { - $alignment .= 'l|'; - } - if ($do_mime && $cfgRelation['mimework']) { - $alignment .= 'l|'; - } - $buffer = $alignment . '} ' . $crlf; - - $header = ' \\hline '; - $header .= '\\multicolumn{1}{|c|}{\\textbf{' . __('Column') - . '}} & \\multicolumn{1}{|c|}{\\textbf{' . __('Type') - . '}} & \\multicolumn{1}{|c|}{\\textbf{' . __('Null') - . '}} & \\multicolumn{1}{|c|}{\\textbf{' . __('Default') . '}}'; - if ($do_relation && $have_rel) { - $header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . __('Links to') . '}}'; - } - if ($do_comments) { - $header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . __('Comments') . '}}'; - $comments = PMA_getComments($db, $table); - } - if ($do_mime && $cfgRelation['mimework']) { - $header .= ' & \\multicolumn{1}{|c|}{\\textbf{MIME}}'; - $mime_map = PMA_getMIME($db, $table, true); - } - - // Table caption for first page and label - if (isset($GLOBALS['latex_caption'])) { - $buffer .= ' \\caption{' - . Util::expandUserString( - $GLOBALS['latex_structure_caption'], - array( - 'texEscape', - get_class($this), - ), - array('table' => $table_alias, 'database' => $db_alias) - ) - . '} \\label{' - . Util::expandUserString( - $GLOBALS['latex_structure_label'], - null, - array('table' => $table_alias, 'database' => $db_alias) - ) - . '} \\\\' . $crlf; - } - $buffer .= $header . ' \\\\ \\hline \\hline' . $crlf - . '\\endfirsthead' . $crlf; - // Table caption on next pages - if (isset($GLOBALS['latex_caption'])) { - $buffer .= ' \\caption{' - . Util::expandUserString( - $GLOBALS['latex_structure_continued_caption'], - array( - 'texEscape', - get_class($this), - ), - array('table' => $table_alias, 'database' => $db_alias) - ) - . '} \\\\ ' . $crlf; - } - $buffer .= $header . ' \\\\ \\hline \\hline \\endhead \\endfoot ' . $crlf; - - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - - $fields = $GLOBALS['dbi']->getColumns($db, $table); - foreach ($fields as $row) { - $extracted_columnspec = Util::extractColumnSpec($row['Type']); - $type = $extracted_columnspec['print_type']; - if (empty($type)) { - $type = ' '; - } - - if (!isset($row['Default'])) { - if ($row['Null'] != 'NO') { - $row['Default'] = 'NULL'; - } - } - - $field_name = $col_as = $row['Field']; - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - - $local_buffer = $col_as . "\000" . $type . "\000" - . (($row['Null'] == '' || $row['Null'] == 'NO') - ? __('No') : __('Yes')) - . "\000" . (isset($row['Default']) ? $row['Default'] : ''); - - if ($do_relation && $have_rel) { - $local_buffer .= "\000"; - $local_buffer .= $this->getRelationString( - $res_rel, - $field_name, - $db, - $aliases - ); - } - if ($do_comments && $cfgRelation['commwork']) { - $local_buffer .= "\000"; - if (isset($comments[$field_name])) { - $local_buffer .= $comments[$field_name]; - } - } - if ($do_mime && $cfgRelation['mimework']) { - $local_buffer .= "\000"; - if (isset($mime_map[$field_name])) { - $local_buffer .= str_replace( - '_', - '/', - $mime_map[$field_name]['mimetype'] - ); - } - } - $local_buffer = self::texEscape($local_buffer); - if ($row['Key'] == 'PRI') { - $pos = mb_strpos($local_buffer, "\000"); - $local_buffer = '\\textit{' - . - mb_substr($local_buffer, 0, $pos) - . '}' . - mb_substr($local_buffer, $pos); - } - if (in_array($field_name, $unique_keys)) { - $pos = mb_strpos($local_buffer, "\000"); - $local_buffer = '\\textbf{' - . - mb_substr($local_buffer, 0, $pos) - . '}' . - mb_substr($local_buffer, $pos); - } - $buffer = str_replace("\000", ' & ', $local_buffer); - $buffer .= ' \\\\ \\hline ' . $crlf; - - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - } // end while - - $buffer = ' \\end{longtable}' . $crlf; - - return PMA_exportOutputHandler($buffer); - } // end of the 'exportStructure' method - - /** - * Escapes some special characters for use in TeX/LaTeX - * - * @param string $string the string to convert - * - * @return string the converted string with escape codes - */ - public static function texEscape($string) - { - $escape = array('$', '%', '{', '}', '&', '#', '_', '^'); - $cnt_escape = count($escape); - for ($k = 0; $k < $cnt_escape; $k++) { - $string = str_replace($escape[$k], '\\' . $escape[$k], $string); - } - - return $string; - } -} diff --git a/#pma/libraries/plugins/export/ExportMediawiki.php b/#pma/libraries/plugins/export/ExportMediawiki.php deleted file mode 100644 index 810198bb..00000000 --- a/#pma/libraries/plugins/export/ExportMediawiki.php +++ /dev/null @@ -1,379 +0,0 @@ -setProperties(); - } - - /** - * Sets the export MediaWiki properties - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('MediaWiki Table'); - $exportPluginProperties->setExtension('mediawiki'); - $exportPluginProperties->setMimeType('text/plain'); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup( - "general_opts", __('Dump table') - ); - - // what to dump (structure/data/both) - $subgroup = new OptionsPropertySubgroup( - "dump_table", __("Dump table") - ); - $leaf = new RadioPropertyItem('structure_or_data'); - $leaf->setValues( - array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data'), - ) - ); - $subgroup->setSubgroupHeader($leaf); - $generalOptions->addProperty($subgroup); - - // export table name - $leaf = new BoolPropertyItem( - "caption", - __('Export table names') - ); - $generalOptions->addProperty($leaf); - - // export table headers - $leaf = new BoolPropertyItem( - "headers", - __('Export table headers') - ); - $generalOptions->addProperty($leaf); - //add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - return true; - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Alias of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - return true; - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs table's structure - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $export_mode 'create_table','triggers','create_view', - * 'stand_in' - * @param string $export_type 'server', 'database', 'table' - * @param bool $do_relation whether to include relation comments - * @param bool $do_comments whether to include the pmadb-style column - * comments as comments in the structure; this is - * deprecated but the parameter is left here - * because export.php calls exportStructure() - * also for other export types which use this - * parameter - * @param bool $do_mime whether to include mime comments - * @param bool $dates whether to include creation/update/check dates - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportStructure( - $db, - $table, - $crlf, - $error_url, - $export_mode, - $export_type, - $do_relation = false, - $do_comments = false, - $do_mime = false, - $dates = false, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - $output = ''; - switch ($export_mode) { - case 'create_table': - $columns = $GLOBALS['dbi']->getColumns($db, $table); - $columns = array_values($columns); - $row_cnt = count($columns); - - // Print structure comment - $output = $this->_exportComment( - "Table structure for " - . PMA\libraries\Util::backquote($table_alias) - ); - - // Begin the table construction - $output .= "{| class=\"wikitable\" style=\"text-align:center;\"" - . $this->_exportCRLF(); - - // Add the table name - if (isset($GLOBALS['mediawiki_caption'])) { - $output .= "|+'''" . $table_alias . "'''" . $this->_exportCRLF(); - } - - // Add the table headers - if (isset($GLOBALS['mediawiki_headers'])) { - $output .= "|- style=\"background:#ffdead;\"" . $this->_exportCRLF(); - $output .= "! style=\"background:#ffffff\" | " - . $this->_exportCRLF(); - for ($i = 0; $i < $row_cnt; ++$i) { - $col_as = $columns[$i]['Field']; - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as]) - ) { - $col_as - = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $output .= " | " . $col_as . $this->_exportCRLF(); - } - } - - // Add the table structure - $output .= "|-" . $this->_exportCRLF(); - $output .= "! Type" . $this->_exportCRLF(); - for ($i = 0; $i < $row_cnt; ++$i) { - $output .= " | " . $columns[$i]['Type'] . $this->_exportCRLF(); - } - - $output .= "|-" . $this->_exportCRLF(); - $output .= "! Null" . $this->_exportCRLF(); - for ($i = 0; $i < $row_cnt; ++$i) { - $output .= " | " . $columns[$i]['Null'] . $this->_exportCRLF(); - } - - $output .= "|-" . $this->_exportCRLF(); - $output .= "! Default" . $this->_exportCRLF(); - for ($i = 0; $i < $row_cnt; ++$i) { - $output .= " | " . $columns[$i]['Default'] . $this->_exportCRLF(); - } - - $output .= "|-" . $this->_exportCRLF(); - $output .= "! Extra" . $this->_exportCRLF(); - for ($i = 0; $i < $row_cnt; ++$i) { - $output .= " | " . $columns[$i]['Extra'] . $this->_exportCRLF(); - } - - $output .= "|}" . str_repeat($this->_exportCRLF(), 2); - break; - } // end switch - - return PMA_exportOutputHandler($output); - } - - /** - * Outputs the content of a table in MediaWiki format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - // Print data comment - $output = $this->_exportComment( - "Table data for " . PMA\libraries\Util::backquote($table_alias) - ); - - // Begin the table construction - // Use the "wikitable" class for style - // Use the "sortable" class for allowing tables to be sorted by column - $output .= "{| class=\"wikitable sortable\" style=\"text-align:center;\"" - . $this->_exportCRLF(); - - // Add the table name - if (isset($GLOBALS['mediawiki_caption'])) { - $output .= "|+'''" . $table_alias . "'''" . $this->_exportCRLF(); - } - - // Add the table headers - if (isset($GLOBALS['mediawiki_headers'])) { - // Get column names - $column_names = $GLOBALS['dbi']->getColumnNames($db, $table); - - // Add column names as table headers - if (!is_null($column_names)) { - // Use '|-' for separating rows - $output .= "|-" . $this->_exportCRLF(); - - // Use '!' for separating table headers - foreach ($column_names as $column) { - if (!empty($aliases[$db]['tables'][$table]['columns'][$column]) - ) { - $column - = $aliases[$db]['tables'][$table]['columns'][$column]; - } - $output .= " ! " . $column . "" . $this->_exportCRLF(); - } - } - } - - // Get the table data from the database - $result = $GLOBALS['dbi']->query( - $sql_query, - null, - PMA\libraries\DatabaseInterface::QUERY_UNBUFFERED - ); - $fields_cnt = $GLOBALS['dbi']->numFields($result); - - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $output .= "|-" . $this->_exportCRLF(); - - // Use '|' for separating table columns - for ($i = 0; $i < $fields_cnt; ++$i) { - $output .= " | " . $row[$i] . "" . $this->_exportCRLF(); - } - } - - // End table construction - $output .= "|}" . str_repeat($this->_exportCRLF(), 2); - - return PMA_exportOutputHandler($output); - } - - /** - * Outputs comments containing info about the exported tables - * - * @param string $text Text of comment - * - * @return string The formatted comment - */ - private function _exportComment($text = '') - { - // see http://www.mediawiki.org/wiki/Help:Formatting - $comment = $this->_exportCRLF(); - $comment .= '' . str_repeat($this->_exportCRLF(), 2); - - return $comment; - } - - /** - * Outputs CRLF - * - * @return string CRLF - */ - private function _exportCRLF() - { - // The CRLF expected by the mediawiki format is "\n" - return "\n"; - } -} diff --git a/#pma/libraries/plugins/export/ExportOds.php b/#pma/libraries/plugins/export/ExportOds.php deleted file mode 100644 index 8ee621c5..00000000 --- a/#pma/libraries/plugins/export/ExportOds.php +++ /dev/null @@ -1,342 +0,0 @@ -setProperties(); - } - - /** - * Sets the export ODS properties - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('OpenDocument Spreadsheet'); - $exportPluginProperties->setExtension('ods'); - $exportPluginProperties->setMimeType( - 'application/vnd.oasis.opendocument.spreadsheet' - ); - $exportPluginProperties->setForceFile(true); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new TextPropertyItem( - "null", - __('Replace NULL with:') - ); - $generalOptions->addProperty($leaf); - $leaf = new BoolPropertyItem( - "columns", - __('Put columns names in the first row') - ); - $generalOptions->addProperty($leaf); - $leaf = new HiddenPropertyItem("structure_or_data"); - $generalOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - $GLOBALS['ods_buffer'] .= '' - . '' - . '' - . '' - . '' - . '/' - . '' - . '/' - . '' - . '' - . '' - . '' - . ':' - . '' - . ':' - . '' - . ' ' - . '' - . '' - . '' - . '' - . '/' - . '' - . '/' - . '' - . ' ' - . '' - . ':' - . '' - . ' ' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . ''; - - return true; - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - $GLOBALS['ods_buffer'] .= '' - . '' - . ''; - if (!PMA_exportOutputHandler( - PMA_createOpenDocument( - 'application/vnd.oasis.opendocument.spreadsheet', - $GLOBALS['ods_buffer'] - ) - ) - ) { - return false; - } - - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - return true; - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in NHibernate format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - global $what; - - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - // Gets the data from the database - $result = $GLOBALS['dbi']->query( - $sql_query, - null, - DatabaseInterface::QUERY_UNBUFFERED - ); - $fields_cnt = $GLOBALS['dbi']->numFields($result); - $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); - $field_flags = array(); - for ($j = 0; $j < $fields_cnt; $j++) { - $field_flags[$j] = $GLOBALS['dbi']->fieldFlags($result, $j); - } - - $GLOBALS['ods_buffer'] - .= ''; - - // If required, get fields name at the first line - if (isset($GLOBALS[$what . '_columns'])) { - $GLOBALS['ods_buffer'] .= ''; - for ($i = 0; $i < $fields_cnt; $i++) { - $col_as = $GLOBALS['dbi']->fieldName($result, $i); - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $GLOBALS['ods_buffer'] - .= '' - . '' - . htmlspecialchars( - stripslashes($col_as) - ) - . '' - . ''; - } // end for - $GLOBALS['ods_buffer'] .= ''; - } // end if - - // Format the data - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $GLOBALS['ods_buffer'] .= ''; - for ($j = 0; $j < $fields_cnt; $j++) { - if (!isset($row[$j]) || is_null($row[$j])) { - $GLOBALS['ods_buffer'] - .= '' - . '' - . htmlspecialchars($GLOBALS[$what . '_null']) - . '' - . ''; - } elseif (stristr($field_flags[$j], 'BINARY') - && $fields_meta[$j]->blob - ) { - // ignore BLOB - $GLOBALS['ods_buffer'] - .= '' - . '' - . ''; - } elseif ($fields_meta[$j]->type == "date") { - $GLOBALS['ods_buffer'] - .= '' - . '' - . htmlspecialchars($row[$j]) - . '' - . ''; - } elseif ($fields_meta[$j]->type == "time") { - $GLOBALS['ods_buffer'] - .= '' - . '' - . htmlspecialchars($row[$j]) - . '' - . ''; - } elseif ($fields_meta[$j]->type == "datetime") { - $GLOBALS['ods_buffer'] - .= '' - . '' - . htmlspecialchars($row[$j]) - . '' - . ''; - } elseif (($fields_meta[$j]->numeric - && $fields_meta[$j]->type != 'timestamp' - && !$fields_meta[$j]->blob) - || $fields_meta[$j]->type == 'real' - ) { - $GLOBALS['ods_buffer'] - .= '' - . '' - . htmlspecialchars($row[$j]) - . '' - . ''; - } else { - $GLOBALS['ods_buffer'] - .= '' - . '' - . htmlspecialchars($row[$j]) - . '' - . ''; - } - } // end for - $GLOBALS['ods_buffer'] .= ''; - } // end while - $GLOBALS['dbi']->freeResult($result); - - $GLOBALS['ods_buffer'] .= ''; - - return true; - } -} diff --git a/#pma/libraries/plugins/export/ExportOdt.php b/#pma/libraries/plugins/export/ExportOdt.php deleted file mode 100644 index 152619ce..00000000 --- a/#pma/libraries/plugins/export/ExportOdt.php +++ /dev/null @@ -1,802 +0,0 @@ -setProperties(); - } - - /** - * Sets the export ODT properties - * - * @return void - */ - protected function setProperties() - { - global $plugin_param; - $hide_structure = false; - if ($plugin_param['export_type'] == 'table' - && !$plugin_param['single_table'] - ) { - $hide_structure = true; - } - - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('OpenDocument Text'); - $exportPluginProperties->setExtension('odt'); - $exportPluginProperties->setMimeType( - 'application/vnd.oasis.opendocument.text' - ); - $exportPluginProperties->setForceFile(true); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // what to dump (structure/data/both) main group - $dumpWhat = new OptionsPropertyMainGroup( - "general_opts", __('Dump table') - ); - // create primary items and add them to the group - $leaf = new RadioPropertyItem("structure_or_data"); - $leaf->setValues( - array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data'), - ) - ); - $dumpWhat->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($dumpWhat); - - // structure options main group - if (!$hide_structure) { - $structureOptions = new OptionsPropertyMainGroup( - "structure", __('Object creation options') - ); - $structureOptions->setForce('data'); - // create primary items and add them to the group - if (!empty($GLOBALS['cfgRelation']['relation'])) { - $leaf = new BoolPropertyItem( - "relation", - __('Display foreign key relationships') - ); - $structureOptions->addProperty($leaf); - } - $leaf = new BoolPropertyItem( - "comments", - __('Display comments') - ); - $structureOptions->addProperty($leaf); - if (!empty($GLOBALS['cfgRelation']['mimework'])) { - $leaf = new BoolPropertyItem( - "mime", - __('Display MIME types') - ); - $structureOptions->addProperty($leaf); - } - // add the main group to the root group - $exportSpecificOptions->addProperty($structureOptions); - } - - // data options main group - $dataOptions = new OptionsPropertyMainGroup( - "data", __('Data dump options') - ); - $dataOptions->setForce('structure'); - // create primary items and add them to the group - $leaf = new BoolPropertyItem( - "columns", - __('Put columns names in the first row') - ); - $dataOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - 'null', - __('Replace NULL with:') - ); - $dataOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($dataOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - $GLOBALS['odt_buffer'] .= '' - . '' - . '' - . ''; - - return true; - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - $GLOBALS['odt_buffer'] .= '' - . '' - . ''; - if (!PMA_exportOutputHandler( - PMA_createOpenDocument( - 'application/vnd.oasis.opendocument.text', - $GLOBALS['odt_buffer'] - ) - ) - ) { - return false; - } - - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - if (empty($db_alias)) { - $db_alias = $db; - } - $GLOBALS['odt_buffer'] - .= '' - . __('Database') . ' ' . htmlspecialchars($db_alias) - . ''; - - return true; - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in NHibernate format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - global $what; - - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - // Gets the data from the database - $result = $GLOBALS['dbi']->query( - $sql_query, - null, - DatabaseInterface::QUERY_UNBUFFERED - ); - $fields_cnt = $GLOBALS['dbi']->numFields($result); - $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); - $field_flags = array(); - for ($j = 0; $j < $fields_cnt; $j++) { - $field_flags[$j] = $GLOBALS['dbi']->fieldFlags($result, $j); - } - - $GLOBALS['odt_buffer'] - .= '' - . __('Dumping data for table') . ' ' . htmlspecialchars($table_alias) - . '' - . '' - . ''; - - // If required, get fields name at the first line - if (isset($GLOBALS[$what . '_columns'])) { - $GLOBALS['odt_buffer'] .= ''; - for ($i = 0; $i < $fields_cnt; $i++) { - $col_as = $GLOBALS['dbi']->fieldName($result, $i); - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $GLOBALS['odt_buffer'] - .= '' - . '' - . htmlspecialchars( - stripslashes($col_as) - ) - . '' - . ''; - } // end for - $GLOBALS['odt_buffer'] .= ''; - } // end if - - // Format the data - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $GLOBALS['odt_buffer'] .= ''; - for ($j = 0; $j < $fields_cnt; $j++) { - if (!isset($row[$j]) || is_null($row[$j])) { - $GLOBALS['odt_buffer'] - .= '' - . '' - . htmlspecialchars($GLOBALS[$what . '_null']) - . '' - . ''; - } elseif (stristr($field_flags[$j], 'BINARY') - && $fields_meta[$j]->blob - ) { - // ignore BLOB - $GLOBALS['odt_buffer'] - .= '' - . '' - . ''; - } elseif ($fields_meta[$j]->numeric - && $fields_meta[$j]->type != 'timestamp' - && !$fields_meta[$j]->blob - ) { - $GLOBALS['odt_buffer'] - .= '' - . '' - . htmlspecialchars($row[$j]) - . '' - . ''; - } else { - $GLOBALS['odt_buffer'] - .= '' - . '' - . htmlspecialchars($row[$j]) - . '' - . ''; - } - } // end for - $GLOBALS['odt_buffer'] .= ''; - } // end while - $GLOBALS['dbi']->freeResult($result); - - $GLOBALS['odt_buffer'] .= ''; - - return true; - } - - /** - * Returns a stand-in CREATE definition to resolve view dependencies - * - * @param string $db the database name - * @param string $view the view name - * @param string $crlf the end of line sequence - * @param array $aliases Aliases of db/table/columns - * - * @return string resulting definition - */ - public function getTableDefStandIn($db, $view, $crlf, $aliases = array()) - { - $db_alias = $db; - $view_alias = $view; - $this->initAlias($aliases, $db_alias, $view_alias); - /** - * Gets fields properties - */ - $GLOBALS['dbi']->selectDb($db); - - /** - * Displays the table structure - */ - $GLOBALS['odt_buffer'] - .= ''; - $columns_cnt = 4; - $GLOBALS['odt_buffer'] - .= ''; - /* Header */ - $GLOBALS['odt_buffer'] .= '' - . '' - . '' . __('Column') . '' - . '' - . '' - . '' . __('Type') . '' - . '' - . '' - . '' . __('Null') . '' - . '' - . '' - . '' . __('Default') . '' - . '' - . ''; - - $columns = $GLOBALS['dbi']->getColumns($db, $view); - foreach ($columns as $column) { - $col_as = $column['Field']; - if (!empty($aliases[$db]['tables'][$view]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$view]['columns'][$col_as]; - } - $GLOBALS['odt_buffer'] .= $this->formatOneColumnDefinition( - $column, - $col_as - ); - $GLOBALS['odt_buffer'] .= ''; - } // end foreach - - $GLOBALS['odt_buffer'] .= ''; - - return true; - } - - /** - * Returns $table's CREATE definition - * - * @param string $db the database name - * @param string $table the table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param bool $do_relation whether to include relation comments - * @param bool $do_comments whether to include the pmadb-style column - * comments as comments in the structure; - * this is deprecated but the parameter is - * left here because export.php calls - * PMA_exportStructure() also for other - * @param bool $do_mime whether to include mime comments - * @param bool $show_dates whether to include creation/update/check dates - * @param bool $add_semicolon whether to add semicolon and end-of-line at - * the end - * @param bool $view whether we're handling a view - * @param array $aliases Aliases of db/table/columns - * - * @return bool true - */ - public function getTableDef( - $db, - $table, - $crlf, - $error_url, - $do_relation, - $do_comments, - $do_mime, - $show_dates = false, - $add_semicolon = true, - $view = false, - $aliases = array() - ) { - global $cfgRelation; - - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - /** - * Gets fields properties - */ - $GLOBALS['dbi']->selectDb($db); - - // Check if we can use Relations - list($res_rel, $have_rel) = PMA_getRelationsAndStatus( - $do_relation && !empty($cfgRelation['relation']), - $db, - $table - ); - /** - * Displays the table structure - */ - $GLOBALS['odt_buffer'] .= ''; - $columns_cnt = 4; - if ($do_relation && $have_rel) { - $columns_cnt++; - } - if ($do_comments) { - $columns_cnt++; - } - if ($do_mime && $cfgRelation['mimework']) { - $columns_cnt++; - } - $GLOBALS['odt_buffer'] .= ''; - /* Header */ - $GLOBALS['odt_buffer'] .= '' - . '' - . '' . __('Column') . '' - . '' - . '' - . '' . __('Type') . '' - . '' - . '' - . '' . __('Null') . '' - . '' - . '' - . '' . __('Default') . '' - . ''; - if ($do_relation && $have_rel) { - $GLOBALS['odt_buffer'] .= '' - . '' . __('Links to') . '' - . ''; - } - if ($do_comments) { - $GLOBALS['odt_buffer'] .= '' - . '' . __('Comments') . '' - . ''; - $comments = PMA_getComments($db, $table); - } - if ($do_mime && $cfgRelation['mimework']) { - $GLOBALS['odt_buffer'] .= '' - . '' . __('MIME type') . '' - . ''; - $mime_map = PMA_getMIME($db, $table, true); - } - $GLOBALS['odt_buffer'] .= ''; - - $columns = $GLOBALS['dbi']->getColumns($db, $table); - foreach ($columns as $column) { - $col_as = $field_name = $column['Field']; - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $GLOBALS['odt_buffer'] .= $this->formatOneColumnDefinition( - $column, - $col_as - ); - if ($do_relation && $have_rel) { - $foreigner = PMA_searchColumnInForeigners($res_rel, $field_name); - if ($foreigner) { - $rtable = $foreigner['foreign_table']; - $rfield = $foreigner['foreign_field']; - if (!empty($aliases[$db]['tables'][$rtable]['columns'][$rfield]) - ) { - $rfield - = $aliases[$db]['tables'][$rtable]['columns'][$rfield]; - } - if (!empty($aliases[$db]['tables'][$rtable]['alias'])) { - $rtable = $aliases[$db]['tables'][$rtable]['alias']; - } - $relation = htmlspecialchars($rtable . ' (' . $rfield . ')'); - $GLOBALS['odt_buffer'] - .= '' - . '' - . htmlspecialchars($relation) - . '' - . ''; - } - } - if ($do_comments) { - if (isset($comments[$field_name])) { - $GLOBALS['odt_buffer'] - .= '' - . '' - . htmlspecialchars($comments[$field_name]) - . '' - . ''; - } else { - $GLOBALS['odt_buffer'] - .= '' - . '' - . ''; - } - } - if ($do_mime && $cfgRelation['mimework']) { - if (isset($mime_map[$field_name])) { - $GLOBALS['odt_buffer'] - .= '' - . '' - . htmlspecialchars( - str_replace('_', '/', $mime_map[$field_name]['mimetype']) - ) - . '' - . ''; - } else { - $GLOBALS['odt_buffer'] - .= '' - . '' - . ''; - } - } - $GLOBALS['odt_buffer'] .= ''; - } // end foreach - - $GLOBALS['odt_buffer'] .= ''; - - return true; - } // end of the '$this->getTableDef()' function - - /** - * Outputs triggers - * - * @param string $db database name - * @param string $table table name - * @param array $aliases Aliases of db/table/columns - * - * @return bool true - */ - protected function getTriggers($db, $table, $aliases = array()) - { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - $GLOBALS['odt_buffer'] .= '' - . '' - . '' - . '' - . '' . __('Name') . '' - . '' - . '' - . '' . __('Time') . '' - . '' - . '' - . '' . __('Event') . '' - . '' - . '' - . '' . __('Definition') . '' - . '' - . ''; - - $triggers = $GLOBALS['dbi']->getTriggers($db, $table); - - foreach ($triggers as $trigger) { - $GLOBALS['odt_buffer'] .= ''; - $GLOBALS['odt_buffer'] .= '' - . '' - . htmlspecialchars($trigger['name']) - . '' - . ''; - $GLOBALS['odt_buffer'] .= '' - . '' - . htmlspecialchars($trigger['action_timing']) - . '' - . ''; - $GLOBALS['odt_buffer'] .= '' - . '' - . htmlspecialchars($trigger['event_manipulation']) - . '' - . ''; - $GLOBALS['odt_buffer'] .= '' - . '' - . htmlspecialchars($trigger['definition']) - . '' - . ''; - $GLOBALS['odt_buffer'] .= ''; - } - - $GLOBALS['odt_buffer'] .= ''; - - return true; - } - - /** - * Outputs table's structure - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $export_mode 'create_table', 'triggers', 'create_view', - * 'stand_in' - * @param string $export_type 'server', 'database', 'table' - * @param bool $do_relation whether to include relation comments - * @param bool $do_comments whether to include the pmadb-style column - * comments as comments in the structure; - * this is deprecated but the parameter is - * left here because export.php calls - * PMA_exportStructure() also for other - * @param bool $do_mime whether to include mime comments - * @param bool $dates whether to include creation/update/check dates - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportStructure( - $db, - $table, - $crlf, - $error_url, - $export_mode, - $export_type, - $do_relation = false, - $do_comments = false, - $do_mime = false, - $dates = false, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - switch ($export_mode) { - case 'create_table': - $GLOBALS['odt_buffer'] - .= '' - . __('Table structure for table') . ' ' . - htmlspecialchars($table_alias) - . ''; - $this->getTableDef( - $db, - $table, - $crlf, - $error_url, - $do_relation, - $do_comments, - $do_mime, - $dates, - true, - false, - $aliases - ); - break; - case 'triggers': - $triggers = $GLOBALS['dbi']->getTriggers($db, $table, $aliases); - if ($triggers) { - $GLOBALS['odt_buffer'] - .= '' - . __('Triggers') . ' ' - . htmlspecialchars($table_alias) - . ''; - $this->getTriggers($db, $table); - } - break; - case 'create_view': - $GLOBALS['odt_buffer'] - .= '' - . __('Structure for view') . ' ' - . htmlspecialchars($table_alias) - . ''; - $this->getTableDef( - $db, - $table, - $crlf, - $error_url, - $do_relation, - $do_comments, - $do_mime, - $dates, - true, - true, - $aliases - ); - break; - case 'stand_in': - $GLOBALS['odt_buffer'] - .= '' - . __('Stand-in structure for view') . ' ' - . htmlspecialchars($table_alias) - . ''; - // export a stand-in definition to resolve view dependencies - $this->getTableDefStandIn($db, $table, $crlf, $aliases); - } // end switch - - return true; - } // end of the '$this->exportStructure' function - - /** - * Formats the definition for one column - * - * @param array $column info about this column - * @param string $col_as column alias - * - * @return string Formatted column definition - */ - protected function formatOneColumnDefinition($column, $col_as = '') - { - if (empty($col_as)) { - $col_as = $column['Field']; - } - $definition = ''; - $definition .= '' - . '' . htmlspecialchars($col_as) . '' - . ''; - - $extracted_columnspec - = Util::extractColumnSpec($column['Type']); - $type = htmlspecialchars($extracted_columnspec['print_type']); - if (empty($type)) { - $type = ' '; - } - - $definition .= '' - . '' . htmlspecialchars($type) . '' - . ''; - if (!isset($column['Default'])) { - if ($column['Null'] != 'NO') { - $column['Default'] = 'NULL'; - } else { - $column['Default'] = ''; - } - } - $definition .= '' - . '' - . (($column['Null'] == '' || $column['Null'] == 'NO') - ? __('No') - : __('Yes')) - . '' - . ''; - $definition .= '' - . '' . htmlspecialchars($column['Default']) . '' - . ''; - - return $definition; - } -} diff --git a/#pma/libraries/plugins/export/ExportPdf.php b/#pma/libraries/plugins/export/ExportPdf.php deleted file mode 100644 index ccf8c9c6..00000000 --- a/#pma/libraries/plugins/export/ExportPdf.php +++ /dev/null @@ -1,390 +0,0 @@ -initSpecificVariables(); - - $this->setProperties(); - } - - /** - * Initialize the local variables that are used for export PDF - * - * @return void - */ - protected function initSpecificVariables() - { - if (!empty($_POST['pdf_report_title'])) { - $this->_setPdfReportTitle($_POST['pdf_report_title']); - } - $this->_setPdf(new PMA_ExportPdf('L', 'pt', 'A3')); - } - - /** - * Sets the export PDF properties - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('PDF'); - $exportPluginProperties->setExtension('pdf'); - $exportPluginProperties->setMimeType('application/pdf'); - $exportPluginProperties->setForceFile(true); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new TextPropertyItem( - "report_title", - __('Report title:') - ); - $generalOptions->addProperty($leaf); - // add the group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // what to dump (structure/data/both) main group - $dumpWhat = new OptionsPropertyMainGroup( - "dump_what", __('Dump table') - ); - $leaf = new RadioPropertyItem("structure_or_data"); - $leaf->setValues( - array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data'), - ) - ); - $dumpWhat->addProperty($leaf); - // add the group to the root group - $exportSpecificOptions->addProperty($dumpWhat); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - $pdf_report_title = $this->_getPdfReportTitle(); - $pdf = $this->_getPdf(); - $pdf->Open(); - - $attr = array('titleFontSize' => 18, 'titleText' => $pdf_report_title); - $pdf->setAttributes($attr); - $pdf->setTopMargin(30); - - return true; - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - $pdf = $this->_getPdf(); - - // instead of $pdf->Output(): - if (!PMA_exportOutputHandler($pdf->getPDFData())) { - return false; - } - - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - return true; - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in NHibernate format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - $pdf = $this->_getPdf(); - $attr = array( - 'currentDb' => $db, - 'currentTable' => $table, - 'dbAlias' => $db_alias, - 'tableAlias' => $table_alias, - 'aliases' => $aliases, - ); - $pdf->setAttributes($attr); - $pdf->purpose = __('Dumping data'); - $pdf->mysqlReport($sql_query); - - return true; - } // end of the 'PMA_exportData()' function - - /** - * Outputs table structure - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $export_mode 'create_table', 'triggers', 'create_view', - * 'stand_in' - * @param string $export_type 'server', 'database', 'table' - * @param bool $do_relation whether to include relation comments - * @param bool $do_comments whether to include the pmadb-style column - * comments as comments in the structure; - * this is deprecated but the parameter is - * left here because export.php calls - * PMA_exportStructure() also for other - * export types which use this parameter - * @param bool $do_mime whether to include mime comments - * @param bool $dates whether to include creation/update/check dates - * @param array $aliases aliases for db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportStructure( - $db, - $table, - $crlf, - $error_url, - $export_mode, - $export_type, - $do_relation = false, - $do_comments = false, - $do_mime = false, - $dates = false, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - $pdf = $this->_getPdf(); - // getting purpose to show at top - switch ($export_mode) { - case 'create_table': - $purpose = __('Table structure'); - break; - case 'triggers': - $purpose = __('Triggers'); - break; - case 'create_view': - $purpose = __('View structure'); - break; - case 'stand_in': - $purpose = __('Stand in'); - } // end switch - - $attr = array( - 'currentDb' => $db, - 'currentTable' => $table, - 'dbAlias' => $db_alias, - 'tableAlias' => $table_alias, - 'aliases' => $aliases, - 'purpose' => $purpose, - ); - $pdf->setAttributes($attr); - /** - * comment display set true as presently in pdf - * format, no option is present to take user input. - */ - $do_comments = true; - switch ($export_mode) { - case 'create_table': - $pdf->getTableDef( - $db, - $table, - $do_relation, - $do_comments, - $do_mime, - false, - $aliases - ); - break; - case 'triggers': - $pdf->getTriggers($db, $table); - break; - case 'create_view': - $pdf->getTableDef( - $db, - $table, - $do_relation, - $do_comments, - $do_mime, - false, - $aliases - ); - break; - case 'stand_in': - /* export a stand-in definition to resolve view dependencies - * Yet to develop this function - * $pdf->getTableDefStandIn($db, $table, $crlf); - */ - } // end switch - - return true; - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the PMA\libraries\plugins\export\PMA_ExportPdf instance - * - * @return PMA_ExportPdf - */ - private function _getPdf() - { - return $this->_pdf; - } - - /** - * Instantiates the PMA\libraries\plugins\export\PMA_ExportPdf class - * - * @param PMA_ExportPdf $pdf The instance - * - * @return void - */ - private function _setPdf($pdf) - { - $this->_pdf = $pdf; - } - - /** - * Gets the PDF report title - * - * @return string - */ - private function _getPdfReportTitle() - { - return $this->_pdfReportTitle; - } - - /** - * Sets the PDF report title - * - * @param string $pdfReportTitle PDF report title - * - * @return void - */ - private function _setPdfReportTitle($pdfReportTitle) - { - $this->_pdfReportTitle = $pdfReportTitle; - } -} diff --git a/#pma/libraries/plugins/export/ExportPhparray.php b/#pma/libraries/plugins/export/ExportPhparray.php deleted file mode 100644 index d04c03ee..00000000 --- a/#pma/libraries/plugins/export/ExportPhparray.php +++ /dev/null @@ -1,255 +0,0 @@ -setProperties(); - } - - /** - * Sets the export PHP Array properties - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('PHP array'); - $exportPluginProperties->setExtension('php'); - $exportPluginProperties->setMimeType('text/plain'); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new HiddenPropertyItem("structure_or_data"); - $generalOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Removes end of comment from a string - * - * @param string $string String to replace - * - * @return string - */ - public function commentString($string) - { - return strtr($string, '*/', '-'); - } - - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - PMA_exportOutputHandler( - 'commentString(PMA\libraries\Util::backquote($db_alias)) - . $GLOBALS['crlf'] . ' */' . $GLOBALS['crlf'] - ); - - return true; - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in PHP array format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - $result = $GLOBALS['dbi']->query( - $sql_query, - null, - PMA\libraries\DatabaseInterface::QUERY_UNBUFFERED - ); - - $columns_cnt = $GLOBALS['dbi']->numFields($result); - $columns = array(); - for ($i = 0; $i < $columns_cnt; $i++) { - $col_as = $GLOBALS['dbi']->fieldName($result, $i); - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $columns[$i] = stripslashes($col_as); - } - - // fix variable names (based on - // https://www.php.net/manual/language.variables.basics.php) - if (!preg_match( - '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', - $table_alias - ) - ) { - // fix invalid characters in variable names by replacing them with - // underscores - $tablefixed = preg_replace( - '/[^a-zA-Z0-9_\x7f-\xff]/', - '_', - $table_alias - ); - - // variable name must not start with a number or dash... - if (preg_match('/^[a-zA-Z_\x7f-\xff]/', $tablefixed) === 0) { - $tablefixed = '_' . $tablefixed; - } - } else { - $tablefixed = $table; - } - - $buffer = ''; - $record_cnt = 0; - // Output table name as comment - $buffer .= $crlf . '/* ' - . $this->commentString(PMA\libraries\Util::backquote($db_alias)) . '.' - . $this->commentString(PMA\libraries\Util::backquote($table_alias)) . ' */' . $crlf; - $buffer .= '$' . $tablefixed . ' = array('; - - while ($record = $GLOBALS['dbi']->fetchRow($result)) { - $record_cnt++; - - if ($record_cnt == 1) { - $buffer .= $crlf . ' array('; - } else { - $buffer .= ',' . $crlf . ' array('; - } - - for ($i = 0; $i < $columns_cnt; $i++) { - $buffer .= var_export($columns[$i], true) - . " => " . var_export($record[$i], true) - . (($i + 1 >= $columns_cnt) ? '' : ','); - } - - $buffer .= ')'; - } - - $buffer .= $crlf . ');' . $crlf; - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - - $GLOBALS['dbi']->freeResult($result); - - return true; - } -} diff --git a/#pma/libraries/plugins/export/ExportSql.php b/#pma/libraries/plugins/export/ExportSql.php deleted file mode 100644 index b44ddc07..00000000 --- a/#pma/libraries/plugins/export/ExportSql.php +++ /dev/null @@ -1,2861 +0,0 @@ -setProperties(); - - // Avoids undefined variables, use NULL so isset() returns false - if (!isset($GLOBALS['sql_backquotes'])) { - $GLOBALS['sql_backquotes'] = null; - } - } - - /** - * Sets the export SQL properties - * - * @return void - */ - protected function setProperties() - { - global $plugin_param; - - $hide_sql = false; - $hide_structure = false; - if ($plugin_param['export_type'] == 'table' - && !$plugin_param['single_table'] - ) { - $hide_structure = true; - $hide_sql = true; - } - - if (!$hide_sql) { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('SQL'); - $exportPluginProperties->setExtension('sql'); - $exportPluginProperties->setMimeType('text/x-sql'); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - - // comments - $subgroup = new OptionsPropertySubgroup("include_comments"); - $leaf = new BoolPropertyItem( - 'include_comments', - __( - 'Display comments (includes info such as export' - . ' timestamp, PHP version, and server version)' - ) - ); - $subgroup->setSubgroupHeader($leaf); - - $leaf = new TextPropertyItem( - 'header_comment', - __('Additional custom header comment (\n splits lines):') - ); - $subgroup->addProperty($leaf); - $leaf = new BoolPropertyItem( - 'dates', - __( - 'Include a timestamp of when databases were created, last' - . ' updated, and last checked' - ) - ); - $subgroup->addProperty($leaf); - if (!empty($GLOBALS['cfgRelation']['relation'])) { - $leaf = new BoolPropertyItem( - 'relation', - __('Display foreign key relationships') - ); - $subgroup->addProperty($leaf); - } - if (!empty($GLOBALS['cfgRelation']['mimework'])) { - $leaf = new BoolPropertyItem( - 'mime', - __('Display MIME types') - ); - $subgroup->addProperty($leaf); - } - $generalOptions->addProperty($subgroup); - - // enclose in a transaction - $leaf = new BoolPropertyItem( - "use_transaction", - __('Enclose export in a transaction') - ); - $leaf->setDoc( - array( - 'programs', - 'mysqldump', - 'option_mysqldump_single-transaction', - ) - ); - $generalOptions->addProperty($leaf); - - // disable foreign key checks - $leaf = new BoolPropertyItem( - "disable_fk", - __('Disable foreign key checks') - ); - $leaf->setDoc( - array( - 'manual_MySQL_Database_Administration', - 'server-system-variables', - 'sysvar_foreign_key_checks', - ) - ); - $generalOptions->addProperty($leaf); - - // export views as tables - $leaf = new BoolPropertyItem( - "views_as_tables", - __('Export views as tables') - ); - $generalOptions->addProperty($leaf); - - // export metadata - $leaf = new BoolPropertyItem( - "metadata", - __('Export metadata') - ); - $generalOptions->addProperty($leaf); - - // compatibility maximization - $compats = $GLOBALS['dbi']->getCompatibilities(); - if (count($compats) > 0) { - $values = array(); - foreach ($compats as $val) { - $values[$val] = $val; - } - - $leaf = new SelectPropertyItem( - "compatibility", - __( - 'Database system or older MySQL server to maximize output' - . ' compatibility with:' - ) - ); - $leaf->setValues($values); - $leaf->setDoc( - array( - 'manual_MySQL_Database_Administration', - 'Server_SQL_mode', - ) - ); - $generalOptions->addProperty($leaf); - - unset($values); - } - - // what to dump (structure/data/both) - $subgroup = new OptionsPropertySubgroup( - "dump_table", __("Dump table") - ); - $leaf = new RadioPropertyItem('structure_or_data'); - $leaf->setValues( - array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data'), - ) - ); - $subgroup->setSubgroupHeader($leaf); - $generalOptions->addProperty($subgroup); - - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // structure options main group - if (!$hide_structure) { - $structureOptions = new OptionsPropertyMainGroup( - "structure", __('Object creation options') - ); - $structureOptions->setForce('data'); - - // begin SQL Statements - $subgroup = new OptionsPropertySubgroup(); - $leaf = new MessageOnlyPropertyItem( - 'add_statements', - __('Add statements:') - ); - $subgroup->setSubgroupHeader($leaf); - - // server export options - if ($plugin_param['export_type'] == 'server') { - $leaf = new BoolPropertyItem( - "drop_database", - sprintf(__('Add %s statement'), 'DROP DATABASE IF EXISTS') - ); - $subgroup->addProperty($leaf); - } - - if ($plugin_param['export_type'] == 'database') { - $create_clause = 'CREATE DATABASE / USE'; - $leaf = new BoolPropertyItem( - 'create_database', - sprintf(__('Add %s statement'), $create_clause) - ); - $subgroup->addProperty($leaf); - } - - if ($plugin_param['export_type'] == 'table') { - $drop_clause = $GLOBALS['dbi']->getTable( - $GLOBALS['db'], - $GLOBALS['table'] - )->isView() - ? 'DROP VIEW' - : 'DROP TABLE'; - } else { - $drop_clause = 'DROP TABLE / VIEW / PROCEDURE' - . ' / FUNCTION / EVENT'; - } - - $drop_clause .= ' / TRIGGER'; - - $leaf = new BoolPropertyItem( - 'drop_table', - sprintf(__('Add %s statement'), $drop_clause) - ); - $subgroup->addProperty($leaf); - - $subgroup_create_table = new OptionsPropertySubgroup(); - - // Add table structure option - $leaf = new BoolPropertyItem( - 'create_table', - sprintf(__('Add %s statement'), 'CREATE TABLE') - ); - $subgroup_create_table->setSubgroupHeader($leaf); - - $leaf = new BoolPropertyItem( - 'if_not_exists', - 'IF NOT EXISTS ' . __( - '(less efficient as indexes will be generated during table ' - . 'creation)' - ) - ); - $subgroup_create_table->addProperty($leaf); - - $leaf = new BoolPropertyItem( - 'auto_increment', - sprintf(__('%s value'), 'AUTO_INCREMENT') - ); - $subgroup_create_table->addProperty($leaf); - - $subgroup->addProperty($subgroup_create_table); - - // Add view option - $leaf = new BoolPropertyItem( - 'create_view', - sprintf(__('Add %s statement'), 'CREATE VIEW') - ); - $subgroup->addProperty($leaf); - - $leaf = new BoolPropertyItem( - 'procedure_function', - sprintf( - __('Add %s statement'), - 'CREATE PROCEDURE / FUNCTION / EVENT' - ) - ); - $subgroup->addProperty($leaf); - - // Add triggers option - $leaf = new BoolPropertyItem( - 'create_trigger', - sprintf(__('Add %s statement'), 'CREATE TRIGGER') - ); - $subgroup->addProperty($leaf); - - $structureOptions->addProperty($subgroup); - - $leaf = new BoolPropertyItem( - "backquotes", - __( - 'Enclose table and column names with backquotes ' - . '(Protects column and table names formed with' - . ' special characters or keywords)' - ) - ); - - $structureOptions->addProperty($leaf); - - // add the main group to the root group - $exportSpecificOptions->addProperty($structureOptions); - } - - // begin Data options - $dataOptions = new OptionsPropertyMainGroup( - "data", __('Data creation options') - ); - $dataOptions->setForce('structure'); - $leaf = new BoolPropertyItem( - "truncate", - __('Truncate table before insert') - ); - $dataOptions->addProperty($leaf); - - // begin SQL Statements - $subgroup = new OptionsPropertySubgroup(); - $leaf = new MessageOnlyPropertyItem( - __('Instead of INSERT statements, use:') - ); - $subgroup->setSubgroupHeader($leaf); - - $leaf = new BoolPropertyItem( - "delayed", - __('INSERT DELAYED statements') - ); - $leaf->setDoc( - array( - 'manual_MySQL_Database_Administration', - 'insert_delayed' - ) - ); - $subgroup->addProperty($leaf); - - $leaf = new BoolPropertyItem( - "ignore", - __('INSERT IGNORE statements') - ); - $leaf->setDoc( - array( - 'manual_MySQL_Database_Administration', - 'insert', - ) - ); - $subgroup->addProperty($leaf); - $dataOptions->addProperty($subgroup); - - // Function to use when dumping dat - $leaf = new SelectPropertyItem( - "type", - __('Function to use when dumping data:') - ); - $leaf->setValues( - array( - 'INSERT' => 'INSERT', - 'UPDATE' => 'UPDATE', - 'REPLACE' => 'REPLACE', - ) - ); - $dataOptions->addProperty($leaf); - - /* Syntax to use when inserting data */ - $subgroup = new OptionsPropertySubgroup(); - $leaf = new MessageOnlyPropertyItem( - null, - __('Syntax to use when inserting data:') - ); - $subgroup->setSubgroupHeader($leaf); - $leaf = new RadioPropertyItem( - "insert_syntax", - __('INSERT IGNORE statements') - ); - $leaf->setValues( - array( - 'complete' => __( - 'include column names in every INSERT statement' - . '
          Example: INSERT INTO' - . ' tbl_name (col_A,col_B,col_C) VALUES (1,2,3)' - ), - 'extended' => __( - 'insert multiple rows in every INSERT statement' - . '
          Example: INSERT INTO' - . ' tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)' - ), - 'both' => __( - 'both of the above
          Example:' - . ' INSERT INTO tbl_name (col_A,col_B,col_C) VALUES' - . ' (1,2,3), (4,5,6), (7,8,9)' - ), - 'none' => __( - 'neither of the above
          Example:' - . ' INSERT INTO tbl_name VALUES (1,2,3)' - ), - ) - ); - $subgroup->addProperty($leaf); - $dataOptions->addProperty($subgroup); - - // Max length of query - $leaf = new NumberPropertyItem( - "max_query_size", - __('Maximal length of created query') - ); - $dataOptions->addProperty($leaf); - - // Dump binary columns in hexadecimal - $leaf = new BoolPropertyItem( - "hex_for_binary", - __( - 'Dump binary columns in hexadecimal notation' - . ' (for example, "abc" becomes 0x616263)' - ) - ); - $dataOptions->addProperty($leaf); - - // Dump time in UTC - $leaf = new BoolPropertyItem( - "utc_time", - __( - 'Dump TIMESTAMP columns in UTC (enables TIMESTAMP columns' - . ' to be dumped and reloaded between servers in different' - . ' time zones)' - ) - ); - $dataOptions->addProperty($leaf); - - // add the main group to the root group - $exportSpecificOptions->addProperty($dataOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - } - - /** - * Generates SQL for routines export - * - * @param string $db Database - * @param array $aliases Aliases of db/table/columns - * @param string $type Type of exported routine - * @param string $name Verbose name of exported routine - * @param array $routines List of routines to export - * @param string $delimiter Delimiter to use in SQL - * - * @return string SQL query - */ - protected function _exportRoutineSQL( - $db, $aliases, $type, $name, $routines, $delimiter - ) { - global $crlf; - - $text = $this->_exportComment() - . $this->_exportComment($name) - . $this->_exportComment(); - - $used_alias = false; - $proc_query = ''; - - foreach ($routines as $routine) { - if (!empty($GLOBALS['sql_drop_table'])) { - $proc_query .= 'DROP ' . $type . ' IF EXISTS ' - . Util::backquote($routine) - . $delimiter . $crlf; - } - $create_query = $this->replaceWithAliases( - $GLOBALS['dbi']->getDefinition($db, $type, $routine), - $aliases, - $db, - '', - $flag - ); - // One warning per database - if ($flag) { - $used_alias = true; - } - $proc_query .= $create_query . $delimiter . $crlf . $crlf; - } - if ($used_alias) { - $text .= $this->_exportComment( - __('It appears your database uses routines;') - ) - . $this->_exportComment( - __('alias export may not work reliably in all cases.') - ) - . $this->_exportComment(); - } - $text .= $proc_query; - - return $text; - } - - /** - * Exports routines (procedures and functions) - * - * @param string $db Database - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportRoutines($db, $aliases = array()) - { - global $crlf; - - $db_alias = $db; - $this->initAlias($aliases, $db_alias); - - $text = ''; - $delimiter = '$$'; - - $procedure_names = $GLOBALS['dbi'] - ->getProceduresOrFunctions($db, 'PROCEDURE'); - $function_names = $GLOBALS['dbi']->getProceduresOrFunctions($db, 'FUNCTION'); - - if ($procedure_names || $function_names) { - $text .= $crlf - . 'DELIMITER ' . $delimiter . $crlf; - - if ($procedure_names) { - $text .= $this->_exportRoutineSQL( - $db, - $aliases, - 'PROCEDURE', - __('Procedures'), - $procedure_names, - $delimiter - ); - } - - if ($function_names) { - $text .= $this->_exportRoutineSQL( - $db, - $aliases, - 'FUNCTION', - __('Functions'), - $function_names, - $delimiter - ); - } - - $text .= 'DELIMITER ;' . $crlf; - } - - if (!empty($text)) { - return PMA_exportOutputHandler($text); - } else { - return false; - } - } - - /** - * Possibly outputs comment - * - * @param string $text Text of comment - * - * @return string The formatted comment - */ - private function _exportComment($text = '') - { - if (isset($GLOBALS['sql_include_comments']) - && $GLOBALS['sql_include_comments'] - ) { - // see https://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html - if (empty($text)) { - return '--' . $GLOBALS['crlf']; - } else { - $lines = preg_split("/\\r\\n|\\r|\\n/", $text); - $result = array(); - foreach ($lines as $line) { - $result[] = '-- ' . $line . $GLOBALS['crlf']; - } - return implode('', $result); - } - } else { - return ''; - } - } - - /** - * Possibly outputs CRLF - * - * @return string $crlf or nothing - */ - private function _possibleCRLF() - { - if (isset($GLOBALS['sql_include_comments']) - && $GLOBALS['sql_include_comments'] - ) { - return $GLOBALS['crlf']; - } else { - return ''; - } - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - global $crlf, $mysql_charset_map; - - $foot = ''; - - if (isset($GLOBALS['sql_disable_fk'])) { - $foot .= 'SET FOREIGN_KEY_CHECKS=1;' . $crlf; - } - - if (isset($GLOBALS['sql_use_transaction'])) { - $foot .= 'COMMIT;' . $crlf; - } - - // restore connection settings - if ($this->_sent_charset) { - $foot .= $crlf - . '/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;' - . $crlf - . '/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;' - . $crlf - . '/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;' - . $crlf; - $this->_sent_charset = false; - } - - /* Restore timezone */ - if (isset($GLOBALS['sql_utc_time']) && $GLOBALS['sql_utc_time']) { - $GLOBALS['dbi']->query('SET time_zone = "' . $GLOBALS['old_tz'] . '"'); - } - - return PMA_exportOutputHandler($foot); - } - - /** - * Outputs export header. It is the first method to be called, so all - * the required variables are initialized here. - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - global $crlf, $cfg; - global $mysql_charset_map; - - if (isset($GLOBALS['sql_compatibility'])) { - $tmp_compat = $GLOBALS['sql_compatibility']; - if ($tmp_compat == 'NONE') { - $tmp_compat = ''; - } - $GLOBALS['dbi']->tryQuery('SET SQL_MODE="' . $tmp_compat . '"'); - unset($tmp_compat); - } - $head = $this->_exportComment('phpMyAdmin SQL Dump') - . $this->_exportComment('version ' . PMA_VERSION) - . $this->_exportComment('https://www.phpmyadmin.net/') - . $this->_exportComment(); - $host_string = __('Host:') . ' ' . $cfg['Server']['host']; - if (!empty($cfg['Server']['port'])) { - $host_string .= ':' . $cfg['Server']['port']; - } - $head .= $this->_exportComment($host_string); - $head .= $this->_exportComment( - __('Generation Time:') . ' ' - . Util::localisedDate() - ) - . $this->_exportComment( - __('Server version:') . ' ' . PMA_MYSQL_STR_VERSION - ) - . $this->_exportComment(__('PHP Version:') . ' ' . phpversion()) - . $this->_possibleCRLF(); - - if (isset($GLOBALS['sql_header_comment']) - && !empty($GLOBALS['sql_header_comment']) - ) { - // '\n' is not a newline (like "\n" would be), it's the characters - // backslash and n, as explained on the export interface - $lines = explode('\n', $GLOBALS['sql_header_comment']); - $head .= $this->_exportComment(); - foreach ($lines as $one_line) { - $head .= $this->_exportComment($one_line); - } - $head .= $this->_exportComment(); - } - - if (isset($GLOBALS['sql_disable_fk'])) { - $head .= 'SET FOREIGN_KEY_CHECKS=0;' . $crlf; - } - - // We want exported AUTO_INCREMENT columns to have still same value, - // do this only for recent MySQL exports - if ((! isset($GLOBALS['sql_compatibility']) - || $GLOBALS['sql_compatibility'] == 'NONE') - ) { - $head .= 'SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";' . $crlf; - } - - if (isset($GLOBALS['sql_use_transaction'])) { - $head .= 'SET AUTOCOMMIT = 0;' . $crlf - . 'START TRANSACTION;' . $crlf; - } - - /* Change timezone if we should export timestamps in UTC */ - if (isset($GLOBALS['sql_utc_time']) && $GLOBALS['sql_utc_time']) { - $head .= 'SET time_zone = "+00:00";' . $crlf; - $GLOBALS['old_tz'] = $GLOBALS['dbi'] - ->fetchValue('SELECT @@session.time_zone'); - $GLOBALS['dbi']->query('SET time_zone = "+00:00"'); - } - - $head .= $this->_possibleCRLF(); - - if (! empty($GLOBALS['asfile'])) { - // we are saving as file, therefore we provide charset information - // so that a utility like the mysql client can interpret - // the file correctly - if (isset($GLOBALS['charset']) - && isset($mysql_charset_map[$GLOBALS['charset']]) - ) { - // we got a charset from the export dialog - $set_names = $mysql_charset_map[$GLOBALS['charset']]; - } else { - // by default we use the connection charset - $set_names = $mysql_charset_map['utf-8']; - } - if ($set_names == 'utf8' && PMA_MYSQL_INT_VERSION > 50503) { - $set_names = 'utf8mb4'; - } - $head .= $crlf - . '/*!40101 SET @OLD_CHARACTER_SET_CLIENT=' - . '@@CHARACTER_SET_CLIENT */;' . $crlf - . '/*!40101 SET @OLD_CHARACTER_SET_RESULTS=' - . '@@CHARACTER_SET_RESULTS */;' . $crlf - . '/*!40101 SET @OLD_COLLATION_CONNECTION=' - . '@@COLLATION_CONNECTION */;' . $crlf - . '/*!40101 SET NAMES ' . $set_names . ' */;' . $crlf . $crlf; - $this->_sent_charset = true; - } - - return PMA_exportOutputHandler($head); - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - global $crlf; - - if (empty($db_alias)) { - $db_alias = $db; - } - if (isset($GLOBALS['sql_compatibility'])) { - $compat = $GLOBALS['sql_compatibility']; - } else { - $compat = 'NONE'; - } - if (isset($GLOBALS['sql_drop_database'])) { - if (!PMA_exportOutputHandler( - 'DROP DATABASE IF EXISTS ' - . Util::backquoteCompat( - $db_alias, - $compat, - isset($GLOBALS['sql_backquotes']) - ) - . ';' . $crlf - ) - ) { - return false; - } - } - if ($export_type == 'database' && !isset($GLOBALS['sql_create_database'])) { - return true; - } - - $create_query = 'CREATE DATABASE IF NOT EXISTS ' - . Util::backquoteCompat( - $db_alias, - $compat, - isset($GLOBALS['sql_backquotes']) - ); - $collation = PMA_getDbCollation($db); - if (mb_strpos($collation, '_')) { - $create_query .= ' DEFAULT CHARACTER SET ' - . mb_substr( - $collation, - 0, - mb_strpos($collation, '_') - ) - . ' COLLATE ' . $collation; - } else { - $create_query .= ' DEFAULT CHARACTER SET ' . $collation; - } - $create_query .= ';' . $crlf; - if (!PMA_exportOutputHandler($create_query)) { - return false; - } - - return $this->_exportUseStatement($db_alias, $compat); - } - - /** - * Outputs USE statement - * - * @param string $db db to use - * @param string $compat sql compatibility - * - * @return bool Whether it succeeded - */ - private function _exportUseStatement($db, $compat) - { - global $crlf; - - if (isset($GLOBALS['sql_compatibility']) - && $GLOBALS['sql_compatibility'] == 'NONE' - ) { - $result = PMA_exportOutputHandler( - 'USE ' - . Util::backquoteCompat( - $db, - $compat, - isset($GLOBALS['sql_backquotes']) - ) - . ';' . $crlf - ); - } else { - $result = PMA_exportOutputHandler('USE ' . $db . ';' . $crlf); - } - - return $result; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Alias of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - if (empty($db_alias)) { - $db_alias = $db; - } - if (isset($GLOBALS['sql_compatibility'])) { - $compat = $GLOBALS['sql_compatibility']; - } else { - $compat = 'NONE'; - } - $head = $this->_exportComment() - . $this->_exportComment( - __('Database:') . ' ' - . Util::backquoteCompat( - $db_alias, - $compat, - isset($GLOBALS['sql_backquotes']) - ) - ) - . $this->_exportComment(); - - return PMA_exportOutputHandler($head); - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - global $crlf; - - $result = true; - - //add indexes to the sql dump file - if (isset($GLOBALS['sql_indexes'])) { - $result = PMA_exportOutputHandler($GLOBALS['sql_indexes']); - unset($GLOBALS['sql_indexes']); - } - //add auto increments to the sql dump file - if (isset($GLOBALS['sql_auto_increments'])) { - $result = PMA_exportOutputHandler($GLOBALS['sql_auto_increments']); - unset($GLOBALS['sql_auto_increments']); - } - //add constraints to the sql dump file - if (isset($GLOBALS['sql_constraints'])) { - $result = PMA_exportOutputHandler($GLOBALS['sql_constraints']); - unset($GLOBALS['sql_constraints']); - } - - return $result; - } - - /** - * Exports events - * - * @param string $db Database - * - * @return bool Whether it succeeded - */ - public function exportEvents($db) - { - global $crlf; - - $text = ''; - $delimiter = '$$'; - - $event_names = $GLOBALS['dbi']->fetchResult( - "SELECT EVENT_NAME FROM information_schema.EVENTS WHERE" - . " EVENT_SCHEMA= '" . $GLOBALS['dbi']->escapeString($db) - . "';" - ); - - if ($event_names) { - $text .= $crlf - . "DELIMITER " . $delimiter . $crlf; - - $text .= $this->_exportComment() - . $this->_exportComment(__('Events')) - . $this->_exportComment(); - - foreach ($event_names as $event_name) { - if (!empty($GLOBALS['sql_drop_table'])) { - $text .= "DROP EVENT " - . Util::backquote($event_name) - . $delimiter . $crlf; - } - $text .= $GLOBALS['dbi']->getDefinition($db, 'EVENT', $event_name) - . $delimiter . $crlf . $crlf; - } - - $text .= "DELIMITER ;" . $crlf; - } - - if (!empty($text)) { - return PMA_exportOutputHandler($text); - } else { - return false; - } - } - - /** - * Exports metadata from Configuration Storage - * - * @param string $db database being exported - * @param string|array $tables table(s) being exported - * @param array $metadataTypes types of metadata to export - * - * @return bool Whether it succeeded - */ - public function exportMetadata( - $db, - $tables, - $metadataTypes - ) { - $cfgRelation = PMA_getRelationsParam(); - if (!isset($cfgRelation['db'])) { - return true; - } - - $comment = $this->_possibleCRLF() - . $this->_possibleCRLF() - . $this->_exportComment() - . $this->_exportComment(__('Metadata')) - . $this->_exportComment(); - if (!PMA_exportOutputHandler($comment)) { - return false; - } - - if (!$this->_exportUseStatement( - $cfgRelation['db'], - $GLOBALS['sql_compatibility'] - ) - ) { - return false; - } - - $r = true; - if (is_array($tables)) { - // export metadata for each table - foreach ($tables as $table) { - $r &= $this->_exportMetadata($db, $table, $metadataTypes); - } - // export metadata for the database - $r &= $this->_exportMetadata($db, null, $metadataTypes); - } else { - // export metadata for single table - $r &= $this->_exportMetadata($db, $tables, $metadataTypes); - } - - return $r; - } - - /** - * Exports metadata from Configuration Storage - * - * @param string $db database being exported - * @param string $table table being exported - * @param array $metadataTypes types of metadata to export - * - * @return bool Whether it succeeded - */ - private function _exportMetadata( - $db, - $table, - $metadataTypes - ) { - $cfgRelation = PMA_getRelationsParam(); - - if (isset($table)) { - $types = array( - 'column_info' => 'db_name', - 'table_uiprefs' => 'db_name', - 'tracking' => 'db_name', - ); - } else { - $types = array( - 'bookmark' => 'dbase', - 'relation' => 'master_db', - 'pdf_pages' => 'db_name', - 'savedsearches' => 'db_name', - 'central_columns' => 'db_name', - ); - } - - $aliases = array(); - - $comment = $this->_possibleCRLF() - . $this->_exportComment(); - - if (isset($table)) { - $comment .= $this->_exportComment( - sprintf( - __('Metadata for table %s'), - $table - ) - ); - } else { - $comment .= $this->_exportComment( - sprintf( - __('Metadata for database %s'), - $db - ) - ); - } - - $comment .= $this->_exportComment(); - - if (!PMA_exportOutputHandler($comment)) { - return false; - } - - foreach ($types as $type => $dbNameColumn) { - if (in_array($type, $metadataTypes) && isset($cfgRelation[$type])) { - - // special case, designer pages and their coordinates - if ($type == 'pdf_pages') { - - $sql_query = "SELECT `page_nr`, `page_descr` FROM " - . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation[$type]) - . " WHERE " . Util::backquote($dbNameColumn) - . " = '" . $GLOBALS['dbi']->escapeString($db) . "'"; - - $result = $GLOBALS['dbi']->fetchResult( - $sql_query, - 'page_nr', - 'page_descr' - ); - - foreach ($result as $page => $name) { - // insert row for pdf_page - $sql_query_row = "SELECT `db_name`, `page_descr` FROM " - . Util::backquote($cfgRelation['db']) - . "." . Util::backquote( - $cfgRelation[$type] - ) - . " WHERE " . Util::backquote( - $dbNameColumn - ) - . " = '" . $GLOBALS['dbi']->escapeString($db) . "'" - . " AND `page_nr` = '" . intval($page) . "'"; - - if (!$this->exportData( - $cfgRelation['db'], - $cfgRelation[$type], - $GLOBALS['crlf'], - '', - $sql_query_row, - $aliases - ) - ) { - return false; - } - - $lastPage = $GLOBALS['crlf'] - . "SET @LAST_PAGE = LAST_INSERT_ID();" - . $GLOBALS['crlf']; - if (!PMA_exportOutputHandler($lastPage)) { - return false; - } - - $sql_query_coords = "SELECT `db_name`, `table_name`, " - . "'@LAST_PAGE' AS `pdf_page_number`, `x`, `y` FROM " - . Util::backquote($cfgRelation['db']) - . "." . Util::backquote( - $cfgRelation['table_coords'] - ) - . " WHERE `pdf_page_number` = '" . $page . "'"; - - $GLOBALS['exporting_metadata'] = true; - if (!$this->exportData( - $cfgRelation['db'], - $cfgRelation['table_coords'], - $GLOBALS['crlf'], - '', - $sql_query_coords, - $aliases - ) - ) { - $GLOBALS['exporting_metadata'] = false; - - return false; - } - $GLOBALS['exporting_metadata'] = false; - } - continue; - } - - // remove auto_incrementing id field for some tables - if ($type == 'bookmark') { - $sql_query = "SELECT `dbase`, `user`, `label`, `query` FROM "; - } elseif ($type == 'column_info') { - $sql_query = "SELECT `db_name`, `table_name`, `column_name`," - . " `comment`, `mimetype`, `transformation`," - . " `transformation_options`, `input_transformation`," - . " `input_transformation_options` FROM"; - } elseif ($type == 'savedsearches') { - $sql_query = "SELECT `username`, `db_name`, `search_name`," - . " `search_data` FROM"; - } else { - $sql_query = "SELECT * FROM "; - } - $sql_query .= Util::backquote($cfgRelation['db']) - . '.' . Util::backquote($cfgRelation[$type]) - . " WHERE " . Util::backquote($dbNameColumn) - . " = '" . $GLOBALS['dbi']->escapeString($db) . "'"; - if (isset($table)) { - $sql_query .= " AND `table_name` = '" - . $GLOBALS['dbi']->escapeString($table) . "'"; - } - - if (!$this->exportData( - $cfgRelation['db'], - $cfgRelation[$type], - $GLOBALS['crlf'], - '', - $sql_query, - $aliases - ) - ) { - return false; - } - } - } - - return true; - } - - /** - * Returns a stand-in CREATE definition to resolve view dependencies - * - * @param string $db the database name - * @param string $view the view name - * @param string $crlf the end of line sequence - * @param array $aliases Aliases of db/table/columns - * - * @return string resulting definition - */ - public function getTableDefStandIn($db, $view, $crlf, $aliases = array()) - { - $db_alias = $db; - $view_alias = $view; - $this->initAlias($aliases, $db_alias, $view_alias); - $create_query = ''; - if (!empty($GLOBALS['sql_drop_table'])) { - $create_query .= 'DROP VIEW IF EXISTS ' - . Util::backquote($view_alias) - . ';' . $crlf; - } - - $create_query .= 'CREATE TABLE '; - - if (isset($GLOBALS['sql_if_not_exists']) - && $GLOBALS['sql_if_not_exists'] - ) { - $create_query .= 'IF NOT EXISTS '; - } - $create_query .= Util::backquote($view_alias) . ' (' . $crlf; - $tmp = array(); - $columns = $GLOBALS['dbi']->getColumnsFull($db, $view); - foreach ($columns as $column_name => $definition) { - $col_alias = $column_name; - if (!empty($aliases[$db]['tables'][$view]['columns'][$col_alias])) { - $col_alias = $aliases[$db]['tables'][$view]['columns'][$col_alias]; - } - $tmp[] = Util::backquote($col_alias) . ' ' . - $definition['Type'] . $crlf; - } - $create_query .= implode(',', $tmp) . ');' . $crlf; - - return ($create_query); - } - - /** - * Returns CREATE definition that matches $view's structure - * - * @param string $db the database name - * @param string $view the view name - * @param string $crlf the end of line sequence - * @param bool $add_semicolon whether to add semicolon and end-of-line at - * the end - * @param array $aliases Aliases of db/table/columns - * - * @return string resulting schema - */ - private function _getTableDefForView( - $db, - $view, - $crlf, - $add_semicolon = true, - $aliases = array() - ) { - $db_alias = $db; - $view_alias = $view; - $this->initAlias($aliases, $db_alias, $view_alias); - $create_query = "CREATE TABLE"; - if (isset($GLOBALS['sql_if_not_exists'])) { - $create_query .= " IF NOT EXISTS "; - } - $create_query .= Util::backquote($view_alias) . "(" . $crlf; - - $columns = $GLOBALS['dbi']->getColumns($db, $view, null, true); - - $firstCol = true; - foreach ($columns as $column) { - $col_alias = $column['Field']; - if (!empty($aliases[$db]['tables'][$view]['columns'][$col_alias])) { - $col_alias = $aliases[$db]['tables'][$view]['columns'][$col_alias]; - } - $extracted_columnspec = Util::extractColumnSpec( - $column['Type'] - ); - - if (!$firstCol) { - $create_query .= "," . $crlf; - } - $create_query .= " " . Util::backquote($col_alias); - $create_query .= " " . $column['Type']; - if ($extracted_columnspec['can_contain_collation'] - && !empty($column['Collation']) - ) { - $create_query .= " COLLATE " . $column['Collation']; - } - if ($column['Null'] == 'NO') { - $create_query .= " NOT NULL"; - } - if (isset($column['Default'])) { - $create_query .= " DEFAULT '" - . $GLOBALS['dbi']->escapeString($column['Default']) . "'"; - } else { - if ($column['Null'] == 'YES') { - $create_query .= " DEFAULT NULL"; - } - } - if (!empty($column['Comment'])) { - $create_query .= " COMMENT '" - . $GLOBALS['dbi']->escapeString($column['Comment']) . "'"; - } - $firstCol = false; - } - $create_query .= $crlf . ")" . ($add_semicolon ? ';' : '') . $crlf; - - if (isset($GLOBALS['sql_compatibility'])) { - $compat = $GLOBALS['sql_compatibility']; - } else { - $compat = 'NONE'; - } - if ($compat == 'MSSQL') { - $create_query = $this->_makeCreateTableMSSQLCompatible( - $create_query - ); - } - - return $create_query; - } - - /** - * Returns $table's CREATE definition - * - * @param string $db the database name - * @param string $table the table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case - * of error - * @param bool $show_dates whether to include creation/ - * update/check dates - * @param bool $add_semicolon whether to add semicolon and - * end-of-line at the end - * @param bool $view whether we're handling a view - * @param bool $update_indexes_increments whether we need to update - * two global variables - * @param array $aliases Aliases of db/table/columns - * - * @return string resulting schema - */ - public function getTableDef( - $db, - $table, - $crlf, - $error_url, - $show_dates = false, - $add_semicolon = true, - $view = false, - $update_indexes_increments = true, - $aliases = array() - ) { - global $sql_drop_table, $sql_backquotes, $sql_constraints, - $sql_constraints_query, $sql_indexes, $sql_indexes_query, - $sql_auto_increments, $sql_drop_foreign_keys; - - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - $schema_create = ''; - $auto_increment = ''; - $new_crlf = $crlf; - - if (isset($GLOBALS['sql_compatibility'])) { - $compat = $GLOBALS['sql_compatibility']; - } else { - $compat = 'NONE'; - } - - // need to use PMA\libraries\DatabaseInterface::QUERY_STORE - // with $GLOBALS['dbi']->numRows() in mysqli - $result = $GLOBALS['dbi']->query( - 'SHOW TABLE STATUS FROM ' . Util::backquote($db) - . ' WHERE Name = \'' . $GLOBALS['dbi']->escapeString($table) . '\'', - null, - DatabaseInterface::QUERY_STORE - ); - if ($result != false) { - if ($GLOBALS['dbi']->numRows($result) > 0) { - $tmpres = $GLOBALS['dbi']->fetchAssoc($result); - - // Here we optionally add the AUTO_INCREMENT next value, - // but starting with MySQL 5.0.24, the clause is already included - // in SHOW CREATE TABLE so we'll remove it below - if (isset($GLOBALS['sql_auto_increment']) - && !empty($tmpres['Auto_increment']) - ) { - $auto_increment .= ' AUTO_INCREMENT=' - . $tmpres['Auto_increment'] . ' '; - } - - if ($show_dates - && isset($tmpres['Create_time']) - && !empty($tmpres['Create_time']) - ) { - $schema_create .= $this->_exportComment( - __('Creation:') . ' ' - . Util::localisedDate( - strtotime($tmpres['Create_time']) - ) - ); - $new_crlf = $this->_exportComment() . $crlf; - } - - if ($show_dates - && isset($tmpres['Update_time']) - && !empty($tmpres['Update_time']) - ) { - $schema_create .= $this->_exportComment( - __('Last update:') . ' ' - . Util::localisedDate( - strtotime($tmpres['Update_time']) - ) - ); - $new_crlf = $this->_exportComment() . $crlf; - } - - if ($show_dates - && isset($tmpres['Check_time']) - && !empty($tmpres['Check_time']) - ) { - $schema_create .= $this->_exportComment( - __('Last check:') . ' ' - . Util::localisedDate( - strtotime($tmpres['Check_time']) - ) - ); - $new_crlf = $this->_exportComment() . $crlf; - } - } - $GLOBALS['dbi']->freeResult($result); - } - - $schema_create .= $new_crlf; - - // no need to generate a DROP VIEW here, it was done earlier - if (!empty($sql_drop_table) - && !$GLOBALS['dbi']->getTable($db, $table)->isView() - ) { - $schema_create .= 'DROP TABLE IF EXISTS ' - . Util::backquote($table_alias, $sql_backquotes) . ';' - . $crlf; - } - - // Complete table dump, - // Whether to quote table and column names or not - if ($sql_backquotes) { - $GLOBALS['dbi']->query('SET SQL_QUOTE_SHOW_CREATE = 1'); - } else { - $GLOBALS['dbi']->query('SET SQL_QUOTE_SHOW_CREATE = 0'); - } - - // I don't see the reason why this unbuffered query could cause problems, - // because SHOW CREATE TABLE returns only one row, and we free the - // results below. Nonetheless, we got 2 user reports about this - // (see bug 1562533) so I removed the unbuffered mode. - // $result = $GLOBALS['dbi']->query('SHOW CREATE TABLE ' . backquote($db) - // . '.' . backquote($table), null, DatabaseInterface::QUERY_UNBUFFERED); - // - // Note: SHOW CREATE TABLE, at least in MySQL 5.1.23, does not - // produce a displayable result for the default value of a BIT - // column, nor does the mysqldump command. See MySQL bug 35796 - $result = $GLOBALS['dbi']->tryQuery( - 'SHOW CREATE TABLE ' . Util::backquote($db) . '.' - . Util::backquote($table) - ); - // an error can happen, for example the table is crashed - $tmp_error = $GLOBALS['dbi']->getError(); - if ($tmp_error) { - return $this->_exportComment(__('in use') . '(' . $tmp_error . ')'); - } - - // Old mode is stored so it can be restored once exporting is done. - $old_mode = Context::$MODE; - - $warning = ''; - if ($result != false && ($row = $GLOBALS['dbi']->fetchRow($result))) { - $create_query = $row[1]; - unset($row); - - // Convert end of line chars to one that we want (note that MySQL - // doesn't return query it will accept in all cases) - if (mb_strpos($create_query, "(\r\n ")) { - $create_query = str_replace("\r\n", $crlf, $create_query); - } elseif (mb_strpos($create_query, "(\n ")) { - $create_query = str_replace("\n", $crlf, $create_query); - } elseif (mb_strpos($create_query, "(\r ")) { - $create_query = str_replace("\r", $crlf, $create_query); - } - - /* - * Drop database name from VIEW creation. - * - * This is a bit tricky, but we need to issue SHOW CREATE TABLE with - * database name, but we don't want name to show up in CREATE VIEW - * statement. - */ - if ($view) { - $create_query = preg_replace( - '/' . preg_quote(Util::backquote($db), '/') . '\./', - '', - $create_query - ); - } - - // Substitute aliases in `CREATE` query. - $create_query = $this->replaceWithAliases( - $create_query, - $aliases, - $db, - $table, - $flag - ); - - // One warning per view. - if ($flag && $view) { - $warning = $this->_exportComment() - . $this->_exportComment( - __('It appears your database uses views;') - ) - . $this->_exportComment( - __('alias export may not work reliably in all cases.') - ) - . $this->_exportComment(); - } - - // Adding IF NOT EXISTS, if required. - if (isset($GLOBALS['sql_if_not_exists'])) { - $create_query = preg_replace( - '/^CREATE TABLE/', - 'CREATE TABLE IF NOT EXISTS', - $create_query - ); - } - - // Making the query MSSQL compatible. - if ($compat == 'MSSQL') { - $create_query = $this->_makeCreateTableMSSQLCompatible( - $create_query - ); - } - - // Views have no constraints, indexes, etc. They do not require any - // analysis. - if (!$view) { - - if (empty($sql_backquotes)) { - // Option "Enclose table and column names with backquotes" - // was checked. - Context::$MODE |= Context::NO_ENCLOSING_QUOTES; - } - - // Using appropriate quotes. - if (($compat === 'MSSQL') || ($sql_backquotes === '"')) { - Context::$MODE |= Context::ANSI_QUOTES; - } - } - - /** - * Parser used for analysis. - * - * @var Parser - */ - $parser = new Parser($create_query); - - /** - * `CREATE TABLE` statement. - * - * @var SelectStatement - */ - $statement = $parser->statements[0]; - - if (!empty($statement->entityOptions)) { - $engine = $statement->entityOptions->has('ENGINE'); - } else { - $engine = ''; - } - - /* Avoid operation on ARCHIVE tables as those can not be altered */ - if (!empty($statement->fields) && (empty($engine) || strtoupper($engine) != 'ARCHIVE')) { - - /** - * Fragments containining definition of each constraint. - * - * @var array - */ - $constraints = array(); - - /** - * Fragments containining definition of each index. - * - * @var array - */ - $indexes = array(); - - /** - * Fragments containining definition of each FULLTEXT index. - * - * @var array - */ - $indexes_fulltext = array(); - - /** - * Fragments containining definition of each foreign key that will - * be dropped. - * - * @var array - */ - $dropped = array(); - - /** - * Fragment containining definition of the `AUTO_INCREMENT`. - * - * @var array - */ - $auto_increment = array(); - - // Scanning each field of the `CREATE` statement to fill the arrays - // above. - // If the field is used in any of the arrays above, it is removed - // from the original definition. - // Also, AUTO_INCREMENT attribute is removed. - /** @var CreateDefinition $field */ - foreach ($statement->fields as $key => $field) { - - if ($field->isConstraint) { - // Creating the parts that add constraints. - $constraints[] = $field::build($field); - unset($statement->fields[$key]); - } elseif (!empty($field->key)) { - // Creating the parts that add indexes (must not be - // constraints). - if ($field->key->type === 'FULLTEXT KEY') { - $indexes_fulltext[] = $field->build($field); - unset($statement->fields[$key]); - } else { - if (empty($GLOBALS['sql_if_not_exists'])) { - $indexes[] = str_replace( - 'COMMENT=\'', 'COMMENT \'', $field::build($field) - ); - unset($statement->fields[$key]); - } - } - } - - // Creating the parts that drop foreign keys. - if (!empty($field->key)) { - if ($field->key->type === 'FOREIGN KEY') { - $dropped[] = 'FOREIGN KEY ' . Context::escape( - $field->name - ); - unset($statement->fields[$key]); - } - } - - // Dropping AUTO_INCREMENT. - if (!empty($field->options)) { - if ($field->options->has('AUTO_INCREMENT') - && empty($GLOBALS['sql_if_not_exists']) - ) { - - $auto_increment[] = $field::build($field); - $field->options->remove('AUTO_INCREMENT'); - } - } - } - - /** - * The header of the `ALTER` statement (`ALTER TABLE tbl`). - * - * @var string - */ - $alter_header = 'ALTER TABLE ' . - Util::backquoteCompat( - $table_alias, - $compat, - $sql_backquotes - ); - - /** - * The footer of the `ALTER` statement (usually ';') - * - * @var string - */ - $alter_footer = ';' . $crlf; - - // Generating constraints-related query. - if (!empty($constraints)) { - $sql_constraints_query = $alter_header . $crlf . ' ADD ' - . implode(',' . $crlf . ' ADD ', $constraints) - . $alter_footer; - - $sql_constraints = $this->generateComment( - $crlf, - $sql_constraints, - __('Constraints for dumped tables'), - __('Constraints for table'), - $table_alias, - $compat - ) . $sql_constraints_query; - } - - // Generating indexes-related query. - $sql_indexes_query = ''; - - if (!empty($indexes)) { - $sql_indexes_query .= $alter_header . $crlf . ' ADD ' - . implode(',' . $crlf . ' ADD ', $indexes) - . $alter_footer; - } - - if (!empty($indexes_fulltext)) { - // InnoDB supports one FULLTEXT index creation at a time. - // So FULLTEXT indexes are created one-by-one after other - // indexes where created. - $sql_indexes_query .= $alter_header . - ' ADD ' . implode( - $alter_footer . $alter_header . ' ADD ', - $indexes_fulltext - ) . $alter_footer; - } - - if ((!empty($indexes)) || (!empty($indexes_fulltext))) { - $sql_indexes = $this->generateComment( - $crlf, - $sql_indexes, - __('Indexes for dumped tables'), - __('Indexes for table'), - $table_alias, - $compat - ) . $sql_indexes_query; - } - - // Generating drop foreign keys-related query. - if (!empty($dropped)) { - $sql_drop_foreign_keys = $alter_header . $crlf . ' DROP ' - . implode(',' . $crlf . ' DROP ', $dropped) - . $alter_footer; - } - - // Generating auto-increment-related query. - if ((! empty($auto_increment)) && ($update_indexes_increments)) { - $sql_auto_increments_query = $alter_header . $crlf . ' MODIFY ' - . implode(',' . $crlf . ' MODIFY ', $auto_increment); - if (isset($GLOBALS['sql_auto_increment']) - && ($statement->entityOptions->has('AUTO_INCREMENT') !== false) - ) { - $sql_auto_increments_query .= ', AUTO_INCREMENT=' - . $statement->entityOptions->has('AUTO_INCREMENT'); - } - $sql_auto_increments_query .= ';'; - - $sql_auto_increments = $this->generateComment( - $crlf, - $sql_auto_increments, - __('AUTO_INCREMENT for dumped tables'), - __('AUTO_INCREMENT for table'), - $table_alias, - $compat - ) . $sql_auto_increments_query; - } - - // Removing the `AUTO_INCREMENT` attribute from the `CREATE TABLE` - // too. - if (!empty($statement->entityOptions) - && (empty($GLOBALS['sql_if_not_exists']) - || empty($GLOBALS['sql_auto_increment'])) - ) { - $statement->entityOptions->remove('AUTO_INCREMENT'); - } - - // Rebuilding the query. - $create_query = $statement->build(); - } - - $schema_create .= $create_query; - } - - $GLOBALS['dbi']->freeResult($result); - - // Restoring old mode. - Context::$MODE = $old_mode; - - return $warning . $schema_create . ($add_semicolon ? ';' . $crlf : ''); - } // end of the 'getTableDef()' function - - /** - * Returns $table's comments, relations etc. - * - * @param string $db database name - * @param string $table table name - * @param string $crlf end of line sequence - * @param bool $do_relation whether to include relation comments - * @param bool $do_mime whether to include mime comments - * @param array $aliases Aliases of db/table/columns - * - * @return string resulting comments - */ - private function _getTableComments( - $db, - $table, - $crlf, - $do_relation = false, - $do_mime = false, - $aliases = array() - ) { - global $cfgRelation, $sql_backquotes; - - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - $schema_create = ''; - - // Check if we can use Relations - list($res_rel, $have_rel) = PMA_getRelationsAndStatus( - $do_relation && !empty($cfgRelation['relation']), - $db, - $table - ); - - if ($do_mime && $cfgRelation['mimework']) { - if (!($mime_map = PMA_getMIME($db, $table, true))) { - unset($mime_map); - } - } - - if (isset($mime_map) && count($mime_map) > 0) { - $schema_create .= $this->_possibleCRLF() - . $this->_exportComment() - . $this->_exportComment( - __('MIME TYPES FOR TABLE') . ' ' - . Util::backquote($table, $sql_backquotes) . ':' - ); - foreach ($mime_map as $mime_field => $mime) { - $schema_create .= $this->_exportComment( - ' ' - . Util::backquote($mime_field, $sql_backquotes) - ) - . $this->_exportComment( - ' ' - . Util::backquote( - $mime['mimetype'], - $sql_backquotes - ) - ); - } - $schema_create .= $this->_exportComment(); - } - - if ($have_rel) { - $schema_create .= $this->_possibleCRLF() - . $this->_exportComment() - . $this->_exportComment( - __('RELATIONS FOR TABLE') . ' ' - . Util::backquote($table_alias, $sql_backquotes) - . ':' - ); - - foreach ($res_rel as $rel_field => $rel) { - if ($rel_field != 'foreign_keys_data') { - $rel_field_alias = !empty( - $aliases[$db]['tables'][$table]['columns'][$rel_field] - ) ? $aliases[$db]['tables'][$table]['columns'][$rel_field] - : $rel_field; - $schema_create .= $this->_exportComment( - ' ' - . Util::backquote( - $rel_field_alias, - $sql_backquotes - ) - ) - . $this->_exportComment( - ' ' - . Util::backquote( - $rel['foreign_table'], - $sql_backquotes - ) - . ' -> ' - . Util::backquote( - $rel['foreign_field'], - $sql_backquotes - ) - ); - } else { - foreach ($rel as $one_key) { - foreach ($one_key['index_list'] as $index => $field) { - $rel_field_alias = !empty( - $aliases[$db]['tables'][$table]['columns'][$field] - ) ? $aliases[$db]['tables'][$table]['columns'][$field] - : $field; - $schema_create .= $this->_exportComment( - ' ' - . Util::backquote( - $rel_field_alias, - $sql_backquotes - ) - ) - . $this->_exportComment( - ' ' - . Util::backquote( - $one_key['ref_table_name'], - $sql_backquotes - ) - . ' -> ' - . Util::backquote( - $one_key['ref_index_list'][$index], - $sql_backquotes - ) - ); - } - } - } - } - $schema_create .= $this->_exportComment(); - } - - return $schema_create; - } // end of the '_getTableComments()' function - - /** - * Outputs table's structure - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $export_mode 'create_table','triggers','create_view', - * 'stand_in' - * @param string $export_type 'server', 'database', 'table' - * @param bool $relation whether to include relation comments - * @param bool $comments whether to include the pmadb-style column - * comments as comments in the structure; this is - * deprecated but the parameter is left here - * because export.php calls exportStructure() - * also for other export types which use this - * parameter - * @param bool $mime whether to include mime comments - * @param bool $dates whether to include creation/update/check dates - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportStructure( - $db, - $table, - $crlf, - $error_url, - $export_mode, - $export_type, - $relation = false, - $comments = false, - $mime = false, - $dates = false, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - if (isset($GLOBALS['sql_compatibility'])) { - $compat = $GLOBALS['sql_compatibility']; - } else { - $compat = 'NONE'; - } - - $formatted_table_name = Util::backquoteCompat( - $table_alias, - $compat, - isset($GLOBALS['sql_backquotes']) - ); - $dump = $this->_possibleCRLF() - . $this->_exportComment(str_repeat('-', 56)) - . $this->_possibleCRLF() - . $this->_exportComment(); - - switch ($export_mode) { - case 'create_table': - $dump .= $this->_exportComment( - __('Table structure for table') . ' ' . $formatted_table_name - ); - $dump .= $this->_exportComment(); - $dump .= $this->getTableDef( - $db, - $table, - $crlf, - $error_url, - $dates, - true, - false, - true, - $aliases - ); - $dump .= $this->_getTableComments( - $db, - $table, - $crlf, - $relation, - $mime, - $aliases - ); - break; - case 'triggers': - $dump = ''; - $delimiter = '$$'; - $triggers = $GLOBALS['dbi']->getTriggers($db, $table, $delimiter); - if ($triggers) { - $dump .= $this->_possibleCRLF() - . $this->_exportComment() - . $this->_exportComment( - __('Triggers') . ' ' . $formatted_table_name - ) - . $this->_exportComment(); - $used_alias = false; - $trigger_query = ''; - foreach ($triggers as $trigger) { - if (!empty($GLOBALS['sql_drop_table'])) { - $trigger_query .= $trigger['drop'] . ';' . $crlf; - } - - $trigger_query .= 'DELIMITER ' . $delimiter . $crlf; - $trigger_query .= $this->replaceWithAliases( - $trigger['create'], - $aliases, - $db, - $table, - $flag - ); - if ($flag) { - $used_alias = true; - } - $trigger_query .= 'DELIMITER ;' . $crlf; - } - // One warning per table. - if ($used_alias) { - $dump .= $this->_exportComment( - __('It appears your table uses triggers;') - ) - . $this->_exportComment( - __('alias export may not work reliably in all cases.') - ) - . $this->_exportComment(); - } - $dump .= $trigger_query; - } - break; - case 'create_view': - if (empty($GLOBALS['sql_views_as_tables'])) { - $dump .= $this->_exportComment( - __('Structure for view') - . ' ' - . $formatted_table_name - ) - . $this->_exportComment(); - // delete the stand-in table previously created (if any) - if ($export_type != 'table') { - $dump .= 'DROP TABLE IF EXISTS ' - . Util::backquote($table_alias) . ';' . $crlf; - } - $dump .= $this->getTableDef( - $db, - $table, - $crlf, - $error_url, - $dates, - true, - true, - true, - $aliases - ); - } else { - $dump .= $this->_exportComment( - sprintf( - __('Structure for view %s exported as a table'), - $formatted_table_name - ) - ) - . $this->_exportComment(); - // delete the stand-in table previously created (if any) - if ($export_type != 'table') { - $dump .= 'DROP TABLE IF EXISTS ' - . Util::backquote($table_alias) . ';' . $crlf; - } - $dump .= $this->_getTableDefForView( - $db, - $table, - $crlf, - true, - $aliases - ); - } - break; - case 'stand_in': - $dump .= $this->_exportComment( - __('Stand-in structure for view') . ' ' . $formatted_table_name - ) - . $this->_exportComment( - __('(See below for the actual view)') - ) - . $this->_exportComment(); - // export a stand-in definition to resolve view dependencies - $dump .= $this->getTableDefStandIn($db, $table, $crlf, $aliases); - } // end switch - - // this one is built by getTableDef() to use in table copy/move - // but not in the case of export - unset($GLOBALS['sql_constraints_query']); - - return PMA_exportOutputHandler($dump); - } - - /** - * Outputs the content of a table in SQL format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - global $current_row, $sql_backquotes; - - // Do not export data for merge tables - if ($GLOBALS['dbi']->getTable($db, $table)->isMerge()) { - return true; - } - - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - if (isset($GLOBALS['sql_compatibility'])) { - $compat = $GLOBALS['sql_compatibility']; - } else { - $compat = 'NONE'; - } - - $formatted_table_name = Util::backquoteCompat( - $table_alias, - $compat, - $sql_backquotes - ); - - // Do not export data for a VIEW, unless asked to export the view as a table - // (For a VIEW, this is called only when exporting a single VIEW) - if ($GLOBALS['dbi']->getTable($db, $table)->isView() - && empty($GLOBALS['sql_views_as_tables']) - ) { - $head = $this->_possibleCRLF() - . $this->_exportComment() - . $this->_exportComment('VIEW ' . ' ' . $formatted_table_name) - . $this->_exportComment(__('Data:') . ' ' . __('None')) - . $this->_exportComment() - . $this->_possibleCRLF(); - - if (!PMA_exportOutputHandler($head)) { - return false; - } - - return true; - } - - $result = $GLOBALS['dbi']->tryQuery( - $sql_query, - null, - DatabaseInterface::QUERY_UNBUFFERED - ); - // a possible error: the table has crashed - $tmp_error = $GLOBALS['dbi']->getError(); - if ($tmp_error) { - return PMA_exportOutputHandler( - $this->_exportComment( - __('Error reading data:') . ' (' . $tmp_error . ')' - ) - ); - } - - if ($result == false) { - $GLOBALS['dbi']->freeResult($result); - - return true; - } - - $fields_cnt = $GLOBALS['dbi']->numFields($result); - - // Get field information - $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); - $field_flags = array(); - for ($j = 0; $j < $fields_cnt; $j++) { - $field_flags[$j] = $GLOBALS['dbi']->fieldFlags($result, $j); - } - - $field_set = array(); - for ($j = 0; $j < $fields_cnt; $j++) { - $col_as = $fields_meta[$j]->name; - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $field_set[$j] = Util::backquoteCompat( - $col_as, - $compat, - $sql_backquotes - ); - } - - if (isset($GLOBALS['sql_type']) - && $GLOBALS['sql_type'] == 'UPDATE' - ) { - // update - $schema_insert = 'UPDATE '; - if (isset($GLOBALS['sql_ignore'])) { - $schema_insert .= 'IGNORE '; - } - // avoid EOL blank - $schema_insert .= Util::backquoteCompat( - $table_alias, - $compat, - $sql_backquotes - ) . ' SET'; - } else { - // insert or replace - if (isset($GLOBALS['sql_type']) - && $GLOBALS['sql_type'] == 'REPLACE' - ) { - $sql_command = 'REPLACE'; - } else { - $sql_command = 'INSERT'; - } - - // delayed inserts? - if (isset($GLOBALS['sql_delayed'])) { - $insert_delayed = ' DELAYED'; - } else { - $insert_delayed = ''; - } - - // insert ignore? - if (isset($GLOBALS['sql_type']) - && $GLOBALS['sql_type'] == 'INSERT' - && isset($GLOBALS['sql_ignore']) - ) { - $insert_delayed .= ' IGNORE'; - } - //truncate table before insert - if (isset($GLOBALS['sql_truncate']) - && $GLOBALS['sql_truncate'] - && $sql_command == 'INSERT' - ) { - $truncate = 'TRUNCATE TABLE ' - . Util::backquoteCompat( - $table_alias, - $compat, - $sql_backquotes - ) . ";"; - $truncatehead = $this->_possibleCRLF() - . $this->_exportComment() - . $this->_exportComment( - __('Truncate table before insert') . ' ' - . $formatted_table_name - ) - . $this->_exportComment() - . $crlf; - PMA_exportOutputHandler($truncatehead); - PMA_exportOutputHandler($truncate); - } - - // scheme for inserting fields - if ($GLOBALS['sql_insert_syntax'] == 'complete' - || $GLOBALS['sql_insert_syntax'] == 'both' - ) { - $fields = implode(', ', $field_set); - $schema_insert = $sql_command . $insert_delayed . ' INTO ' - . Util::backquoteCompat( - $table_alias, - $compat, - $sql_backquotes - ) - // avoid EOL blank - . ' (' . $fields . ') VALUES'; - } else { - $schema_insert = $sql_command . $insert_delayed . ' INTO ' - . Util::backquoteCompat( - $table_alias, - $compat, - $sql_backquotes - ) - . ' VALUES'; - } - } - - //\x08\\x09, not required - $current_row = 0; - $query_size = 0; - if (($GLOBALS['sql_insert_syntax'] == 'extended' - || $GLOBALS['sql_insert_syntax'] == 'both') - && (!isset($GLOBALS['sql_type']) - || $GLOBALS['sql_type'] != 'UPDATE') - ) { - $separator = ','; - $schema_insert .= $crlf; - } else { - $separator = ';'; - } - - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - if ($current_row == 0) { - $head = $this->_possibleCRLF() - . $this->_exportComment() - . $this->_exportComment( - __('Dumping data for table') . ' ' - . $formatted_table_name - ) - . $this->_exportComment() - . $crlf; - if (!PMA_exportOutputHandler($head)) { - return false; - } - } - // We need to SET IDENTITY_INSERT ON for MSSQL - if (isset($GLOBALS['sql_compatibility']) - && $GLOBALS['sql_compatibility'] == 'MSSQL' - && $current_row == 0 - ) { - if (!PMA_exportOutputHandler( - 'SET IDENTITY_INSERT ' - . Util::backquoteCompat( - $table_alias, - $compat, - $sql_backquotes - ) - . ' ON ;' . $crlf - ) - ) { - return false; - } - } - $current_row++; - $values = array(); - for ($j = 0; $j < $fields_cnt; $j++) { - // NULL - if (!isset($row[$j]) || is_null($row[$j])) { - $values[] = 'NULL'; - } elseif ($fields_meta[$j]->numeric - && $fields_meta[$j]->type != 'timestamp' - && !$fields_meta[$j]->blob - ) { - // a number - // timestamp is numeric on some MySQL 4.1, BLOBs are - // sometimes numeric - $values[] = $row[$j]; - } elseif (stristr($field_flags[$j], 'BINARY') !== false - && isset($GLOBALS['sql_hex_for_binary']) - ) { - // a true BLOB - // - mysqldump only generates hex data when the --hex-blob - // option is used, for fields having the binary attribute - // no hex is generated - // - a TEXT field returns type blob but a real blob - // returns also the 'binary' flag - - // empty blobs need to be different, but '0' is also empty - // :-( - if (empty($row[$j]) && $row[$j] != '0') { - $values[] = '\'\''; - } else { - $values[] = '0x' . bin2hex($row[$j]); - } - } elseif ($fields_meta[$j]->type == 'bit') { - // detection of 'bit' works only on mysqli extension - $values[] = "b'" . $GLOBALS['dbi']->escapeString( - Util::printableBitValue( - $row[$j], - $fields_meta[$j]->length - ) - ) - . "'"; - } elseif (!empty($GLOBALS['exporting_metadata']) - && $row[$j] == '@LAST_PAGE' - ) { - $values[] = '@LAST_PAGE'; - } else { - // something else -> treat as a string - $values[] = '\'' - . $GLOBALS['dbi']->escapeString($row[$j]) - . '\''; - } // end if - } // end for - - // should we make update? - if (isset($GLOBALS['sql_type']) - && $GLOBALS['sql_type'] == 'UPDATE' - ) { - - $insert_line = $schema_insert; - for ($i = 0; $i < $fields_cnt; $i++) { - if (0 == $i) { - $insert_line .= ' '; - } - if ($i > 0) { - // avoid EOL blank - $insert_line .= ','; - } - $insert_line .= $field_set[$i] . ' = ' . $values[$i]; - } - - list($tmp_unique_condition, $tmp_clause_is_unique) - = Util::getUniqueCondition( - $result, // handle - $fields_cnt, // fields_cnt - $fields_meta, // fields_meta - $row, // row - false, // force_unique - false, // restrict_to_table - null // analyzed_sql_results - ); - $insert_line .= ' WHERE ' . $tmp_unique_condition; - unset($tmp_unique_condition, $tmp_clause_is_unique); - } else { - - // Extended inserts case - if ($GLOBALS['sql_insert_syntax'] == 'extended' - || $GLOBALS['sql_insert_syntax'] == 'both' - ) { - if ($current_row == 1) { - $insert_line = $schema_insert . '(' - . implode(', ', $values) . ')'; - } else { - $insert_line = '(' . implode(', ', $values) . ')'; - $insertLineSize = mb_strlen($insert_line); - $sql_max_size = $GLOBALS['sql_max_query_size']; - if (isset($sql_max_size) - && $sql_max_size > 0 - && $query_size + $insertLineSize > $sql_max_size - ) { - if (!PMA_exportOutputHandler(';' . $crlf)) { - return false; - } - $query_size = 0; - $current_row = 1; - $insert_line = $schema_insert . $insert_line; - } - } - $query_size += mb_strlen($insert_line); - // Other inserts case - } else { - $insert_line = $schema_insert - . '(' . implode(', ', $values) . ')'; - } - } - unset($values); - - if (!PMA_exportOutputHandler( - ($current_row == 1 ? '' : $separator . $crlf) - . $insert_line - ) - ) { - return false; - } - } // end while - - if ($current_row > 0) { - if (!PMA_exportOutputHandler(';' . $crlf)) { - return false; - } - } - - // We need to SET IDENTITY_INSERT OFF for MSSQL - if (isset($GLOBALS['sql_compatibility']) - && $GLOBALS['sql_compatibility'] == 'MSSQL' - && $current_row > 0 - ) { - $outputSucceeded = PMA_exportOutputHandler( - $crlf . 'SET IDENTITY_INSERT ' - . Util::backquoteCompat( - $table_alias, - $compat, - $sql_backquotes - ) - . ' OFF;' . $crlf - ); - if (!$outputSucceeded) { - return false; - } - } - - $GLOBALS['dbi']->freeResult($result); - - return true; - } // end of the 'exportData()' function - - /** - * Make a create table statement compatible with MSSQL - * - * @param string $create_query MySQL create table statement - * - * @return string MSSQL compatible create table statement - */ - private function _makeCreateTableMSSQLCompatible($create_query) - { - // In MSSQL - // 1. No 'IF NOT EXISTS' in CREATE TABLE - // 2. DATE field doesn't exists, we will use DATETIME instead - // 3. UNSIGNED attribute doesn't exist - // 4. No length on INT, TINYINT, SMALLINT, BIGINT and no precision on - // FLOAT fields - // 5. No KEY and INDEX inside CREATE TABLE - // 6. DOUBLE field doesn't exists, we will use FLOAT instead - - $create_query = preg_replace( - "/^CREATE TABLE IF NOT EXISTS/", - 'CREATE TABLE', - $create_query - ); - // first we need to replace all lines ended with '" DATE ...,\n' - // last preg_replace preserve us from situation with date text - // inside DEFAULT field value - $create_query = preg_replace( - "/\" date DEFAULT NULL(,)?\n/", - '" datetime DEFAULT NULL$1' . "\n", - $create_query - ); - $create_query = preg_replace( - "/\" date NOT NULL(,)?\n/", - '" datetime NOT NULL$1' . "\n", - $create_query - ); - $create_query = preg_replace( - '/" date NOT NULL DEFAULT \'([^\'])/', - '" datetime NOT NULL DEFAULT \'$1', - $create_query - ); - - // next we need to replace all lines ended with ') UNSIGNED ...,' - // last preg_replace preserve us from situation with unsigned text - // inside DEFAULT field value - $create_query = preg_replace( - "/\) unsigned NOT NULL(,)?\n/", - ') NOT NULL$1' . "\n", - $create_query - ); - $create_query = preg_replace( - "/\) unsigned DEFAULT NULL(,)?\n/", - ') DEFAULT NULL$1' . "\n", - $create_query - ); - $create_query = preg_replace( - '/\) unsigned NOT NULL DEFAULT \'([^\'])/', - ') NOT NULL DEFAULT \'$1', - $create_query - ); - - // we need to replace all lines ended with - // '" INT|TINYINT([0-9]{1,}) ...,' last preg_replace preserve us - // from situation with int([0-9]{1,}) text inside DEFAULT field - // value - $create_query = preg_replace( - '/" (int|tinyint|smallint|bigint)\([0-9]+\) DEFAULT NULL(,)?\n/', - '" $1 DEFAULT NULL$2' . "\n", - $create_query - ); - $create_query = preg_replace( - '/" (int|tinyint|smallint|bigint)\([0-9]+\) NOT NULL(,)?\n/', - '" $1 NOT NULL$2' . "\n", - $create_query - ); - $create_query = preg_replace( - '/" (int|tinyint|smallint|bigint)\([0-9]+\) NOT NULL DEFAULT \'([^\'])/', - '" $1 NOT NULL DEFAULT \'$2', - $create_query - ); - - // we need to replace all lines ended with - // '" FLOAT|DOUBLE([0-9,]{1,}) ...,' - // last preg_replace preserve us from situation with - // float([0-9,]{1,}) text inside DEFAULT field value - $create_query = preg_replace( - '/" (float|double)(\([0-9]+,[0-9,]+\))? DEFAULT NULL(,)?\n/', - '" float DEFAULT NULL$3' . "\n", - $create_query - ); - $create_query = preg_replace( - '/" (float|double)(\([0-9,]+,[0-9,]+\))? NOT NULL(,)?\n/', - '" float NOT NULL$3' . "\n", - $create_query - ); - $create_query = preg_replace( - '/" (float|double)(\([0-9,]+,[0-9,]+\))? NOT NULL DEFAULT \'([^\'])/', - '" float NOT NULL DEFAULT \'$3', - $create_query - ); - - // @todo remove indexes from CREATE TABLE - - return $create_query; - } - - /** - * replaces db/table/column names with their aliases - * - * @param string $sql_query SQL query in which aliases are to be substituted - * @param array $aliases Alias information for db/table/column - * @param string $db the database name - * @param string $table the tablename - * @param string &$flag the flag denoting whether any replacement was done - * - * @return string query replaced with aliases - */ - public function replaceWithAliases( - $sql_query, - $aliases, - $db, - $table = '', - &$flag = null - ) { - $flag = false; - - /** - * The parser of this query. - * - * @var Parser $parser - */ - $parser = new Parser($sql_query); - - if (empty($parser->statements[0])) { - return $sql_query; - } - - /** - * The statement that represents the query. - * - * @var \SqlParser\Statements\CreateStatement $statement - */ - $statement = $parser->statements[0]; - - /** - * Old database name. - * - * @var string $old_database - */ - $old_database = $db; - - // Replacing aliases in `CREATE TABLE` statement. - if ($statement->options->has('TABLE')) { - - // Extracting the name of the old database and table from the - // statement to make sure the parameters are corect. - if (!empty($statement->name->database)) { - $old_database = $statement->name->database; - } - - /** - * Old table name. - * - * @var string $old_table - */ - $old_table = $statement->name->table; - - // Finding the aliased database name. - // The database might be empty so we have to add a few checks. - $new_database = null; - if (!empty($statement->name->database)) { - $new_database = $statement->name->database; - if (!empty($aliases[$old_database]['alias'])) { - $new_database = $aliases[$old_database]['alias']; - } - } - - // Finding the aliases table name. - $new_table = $old_table; - if (!empty($aliases[$old_database]['tables'][$old_table]['alias'])) { - $new_table = $aliases[$old_database]['tables'][$old_table]['alias']; - } - - // Replacing new values. - if (($statement->name->database !== $new_database) - || ($statement->name->table !== $new_table) - ) { - $statement->name->database = $new_database; - $statement->name->table = $new_table; - $statement->name->expr = null; // Force rebuild. - $flag = true; - } - - foreach ($statement->fields as $field) { - - // Column name. - if (!empty($field->type)) { - if (!empty($aliases[$old_database]['tables'][$old_table]['columns'][$field->name])) { - $field->name = $aliases[$old_database]['tables'] - [$old_table]['columns'][$field->name]; - $flag = true; - } - } - - // Key's columns. - if (!empty($field->key)) { - foreach ($field->key->columns as $key => $column) { - if (!empty($aliases[$old_database]['tables'][$old_table]['columns'][$column['name']])) { - $field->key->columns[$key]['name'] = $aliases[$old_database] - ['tables'][$old_table]['columns'][$column['name']]; - $flag = true; - } - } - } - - // References. - if (!empty($field->references)) { - $ref_table = $field->references->table->table; - // Replacing table. - if (!empty($aliases[$old_database]['tables'][$ref_table]['alias'])) { - $field->references->table->table - = $aliases[$old_database]['tables'][$ref_table]['alias']; - $field->references->table->expr = null; - $flag = true; - } - // Replacing column names. - foreach ($field->references->columns as $key => $column) { - if (!empty($aliases[$old_database]['tables'][$ref_table]['columns'][$column])) { - $field->references->columns[$key] - = $aliases[$old_database]['tables'][$ref_table]['columns'][$column]; - $flag = true; - } - } - } - } - } elseif ($statement->options->has('TRIGGER')) { - - // Extracting the name of the old database and table from the - // statement to make sure the parameters are corect. - if (!empty($statement->table->database)) { - $old_database = $statement->table->database; - } - - /** - * Old table name. - * - * @var string $old_table - */ - $old_table = $statement->table->table; - - if (!empty($aliases[$old_database]['tables'][$old_table]['alias'])) { - $statement->table->table - = $aliases[$old_database]['tables'][$old_table]['alias']; - $statement->table->expr = null; // Force rebuild. - $flag = true; - } - } - - if (($statement->options->has('TRIGGER')) - || ($statement->options->has('PROCEDURE')) - || ($statement->options->has('FUNCTION')) - || ($statement->options->has('VIEW')) - ) { - - // Repalcing the body. - for ($i = 0, $count = count($statement->body); $i < $count; ++$i) { - - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $statement->body[$i]; - - // Replacing only symbols (that are not variables) and unknown - // identifiers. - if ((($token->type === Token::TYPE_SYMBOL) - && (!($token->flags & Token::FLAG_SYMBOL_VARIABLE))) - || ((($token->type === Token::TYPE_KEYWORD) - && (!($token->flags & Token::FLAG_KEYWORD_RESERVED))) - || ($token->type === Token::TYPE_NONE)) - ) { - $alias = $this->getAlias($aliases, $token->value); - if (!empty($alias)) { - // Replacing the token. - $token->token = Context::escape($alias); - $flag = true; - } - } - } - } - - return $statement->build(); - } - - /** - * Generate comment - * - * @param string $crlf Carriage return character - * @param string $sql_statement SQL statement - * @param string $comment1 Comment for dumped table - * @param string $comment2 Comment for current table - * @param string $table_alias Table alias - * @param string $compat Compatibility mode - * - * @return string - */ - protected function generateComment( - $crlf, - $sql_statement, - $comment1, - $comment2, - $table_alias, - $compat - ) { - if (!isset($sql_statement)) { - if (isset($GLOBALS['no_constraints_comments'])) { - $sql_statement = ''; - } else { - $sql_statement = $crlf - . $this->_exportComment() - . $this->_exportComment($comment1) - . $this->_exportComment(); - } - } - - // comments for current table - if (!isset($GLOBALS['no_constraints_comments'])) { - $sql_statement .= $crlf - . $this->_exportComment() - . $this->_exportComment( - $comment2 . ' ' . Util::backquoteCompat( - $table_alias, - $compat, - isset($GLOBALS['sql_backquotes']) - ) - ) - . $this->_exportComment(); - } - - return $sql_statement; - } -} diff --git a/#pma/libraries/plugins/export/ExportTexytext.php b/#pma/libraries/plugins/export/ExportTexytext.php deleted file mode 100644 index 93f96bdc..00000000 --- a/#pma/libraries/plugins/export/ExportTexytext.php +++ /dev/null @@ -1,616 +0,0 @@ -setProperties(); - } - - /** - * Sets the export Texy! text properties - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('Texy! text'); - $exportPluginProperties->setExtension('txt'); - $exportPluginProperties->setMimeType('text/plain'); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // what to dump (structure/data/both) main group - $dumpWhat = new OptionsPropertyMainGroup( - "general_opts", __('Dump table') - ); - // create primary items and add them to the group - $leaf = new RadioPropertyItem("structure_or_data"); - $leaf->setValues( - array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data'), - ) - ); - $dumpWhat->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($dumpWhat); - - // data options main group - $dataOptions = new OptionsPropertyMainGroup( - "data", __('Data dump options') - ); - $dataOptions->setForce('structure'); - // create primary items and add them to the group - $leaf = new BoolPropertyItem( - "columns", - __('Put columns names in the first row') - ); - $dataOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - 'null', - __('Replace NULL with:') - ); - $dataOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($dataOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - return true; - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Alias of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - if (empty($db_alias)) { - $db_alias = $db; - } - - return PMA_exportOutputHandler( - '===' . __('Database') . ' ' . $db_alias . "\n\n" - ); - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in NHibernate format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - global $what; - - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - - if (!PMA_exportOutputHandler( - '== ' . __('Dumping data for table') . ' ' . $table_alias . "\n\n" - ) - ) { - return false; - } - - // Gets the data from the database - $result = $GLOBALS['dbi']->query( - $sql_query, - null, - DatabaseInterface::QUERY_UNBUFFERED - ); - $fields_cnt = $GLOBALS['dbi']->numFields($result); - - // If required, get fields name at the first line - if (isset($GLOBALS[$what . '_columns'])) { - $text_output = "|------\n"; - for ($i = 0; $i < $fields_cnt; $i++) { - $col_as = $GLOBALS['dbi']->fieldName($result, $i); - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $text_output .= '|' - . htmlspecialchars(stripslashes($col_as)); - } // end for - $text_output .= "\n|------\n"; - if (!PMA_exportOutputHandler($text_output)) { - return false; - } - } // end if - - // Format the data - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $text_output = ''; - for ($j = 0; $j < $fields_cnt; $j++) { - if (!isset($row[$j]) || is_null($row[$j])) { - $value = $GLOBALS[$what . '_null']; - } elseif ($row[$j] == '0' || $row[$j] != '') { - $value = $row[$j]; - } else { - $value = ' '; - } - $text_output .= '|' - . str_replace( - '|', - '|', - htmlspecialchars($value) - ); - } // end for - $text_output .= "\n"; - if (!PMA_exportOutputHandler($text_output)) { - return false; - } - } // end while - $GLOBALS['dbi']->freeResult($result); - - return true; - } - - /** - * Returns a stand-in CREATE definition to resolve view dependencies - * - * @param string $db the database name - * @param string $view the view name - * @param string $crlf the end of line sequence - * @param array $aliases Aliases of db/table/columns - * - * @return string resulting definition - */ - public function getTableDefStandIn($db, $view, $crlf, $aliases = array()) - { - $text_output = ''; - - /** - * Get the unique keys in the table - */ - $unique_keys = array(); - $keys = $GLOBALS['dbi']->getTableIndexes($db, $view); - foreach ($keys as $key) { - if ($key['Non_unique'] == 0) { - $unique_keys[] = $key['Column_name']; - } - } - - /** - * Gets fields properties - */ - $GLOBALS['dbi']->selectDb($db); - - /** - * Displays the table structure - */ - - $text_output .= "|------\n" - . '|' . __('Column') - . '|' . __('Type') - . '|' . __('Null') - . '|' . __('Default') - . "\n|------\n"; - - $columns = $GLOBALS['dbi']->getColumns($db, $view); - foreach ($columns as $column) { - $col_as = $column['Field']; - if (!empty($aliases[$db]['tables'][$view]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$view]['columns'][$col_as]; - } - $text_output .= $this->formatOneColumnDefinition( - $column, - $unique_keys, - $col_as - ); - $text_output .= "\n"; - } // end foreach - - return $text_output; - } - - /** - * Returns $table's CREATE definition - * - * @param string $db the database name - * @param string $table the table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param bool $do_relation whether to include relation comments - * @param bool $do_comments whether to include the pmadb-style column - * comments as comments in the structure; - * this is deprecated but the parameter is - * left here because export.php calls - * $this->exportStructure() also for other - * export types which use this parameter - * @param bool $do_mime whether to include mime comments - * @param bool $show_dates whether to include creation/update/check dates - * @param bool $add_semicolon whether to add semicolon and end-of-line - * at the end - * @param bool $view whether we're handling a view - * @param array $aliases Aliases of db/table/columns - * - * @return string resulting schema - */ - public function getTableDef( - $db, - $table, - $crlf, - $error_url, - $do_relation, - $do_comments, - $do_mime, - $show_dates = false, - $add_semicolon = true, - $view = false, - $aliases = array() - ) { - global $cfgRelation; - - $text_output = ''; - - /** - * Get the unique keys in the table - */ - $unique_keys = array(); - $keys = $GLOBALS['dbi']->getTableIndexes($db, $table); - foreach ($keys as $key) { - if ($key['Non_unique'] == 0) { - $unique_keys[] = $key['Column_name']; - } - } - - /** - * Gets fields properties - */ - $GLOBALS['dbi']->selectDb($db); - - // Check if we can use Relations - list($res_rel, $have_rel) = PMA_getRelationsAndStatus( - $do_relation && !empty($cfgRelation['relation']), - $db, - $table - ); - - /** - * Displays the table structure - */ - - $text_output .= "|------\n"; - $text_output .= '|' . __('Column'); - $text_output .= '|' . __('Type'); - $text_output .= '|' . __('Null'); - $text_output .= '|' . __('Default'); - if ($do_relation && $have_rel) { - $text_output .= '|' . __('Links to'); - } - if ($do_comments) { - $text_output .= '|' . __('Comments'); - $comments = PMA_getComments($db, $table); - } - if ($do_mime && $cfgRelation['mimework']) { - $text_output .= '|' . htmlspecialchars('MIME'); - $mime_map = PMA_getMIME($db, $table, true); - } - $text_output .= "\n|------\n"; - - $columns = $GLOBALS['dbi']->getColumns($db, $table); - foreach ($columns as $column) { - $col_as = $column['Field']; - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $text_output .= $this->formatOneColumnDefinition( - $column, - $unique_keys, - $col_as - ); - $field_name = $column['Field']; - if ($do_relation && $have_rel) { - $text_output .= '|' . htmlspecialchars( - $this->getRelationString( - $res_rel, - $field_name, - $db, - $aliases - ) - ); - } - if ($do_comments && $cfgRelation['commwork']) { - $text_output .= '|' - . (isset($comments[$field_name]) - ? htmlspecialchars($comments[$field_name]) - : ''); - } - if ($do_mime && $cfgRelation['mimework']) { - $text_output .= '|' - . (isset($mime_map[$field_name]) - ? htmlspecialchars( - str_replace('_', '/', $mime_map[$field_name]['mimetype']) - ) - : ''); - } - - $text_output .= "\n"; - } // end foreach - - return $text_output; - } // end of the '$this->getTableDef()' function - - /** - * Outputs triggers - * - * @param string $db database name - * @param string $table table name - * - * @return string Formatted triggers list - */ - public function getTriggers($db, $table) - { - $dump = "|------\n"; - $dump .= '|' . __('Name'); - $dump .= '|' . __('Time'); - $dump .= '|' . __('Event'); - $dump .= '|' . __('Definition'); - $dump .= "\n|------\n"; - - $triggers = $GLOBALS['dbi']->getTriggers($db, $table); - - foreach ($triggers as $trigger) { - $dump .= '|' . $trigger['name']; - $dump .= '|' . $trigger['action_timing']; - $dump .= '|' . $trigger['event_manipulation']; - $dump .= '|' . - str_replace( - '|', - '|', - htmlspecialchars($trigger['definition']) - ); - $dump .= "\n"; - } - - return $dump; - } - - /** - * Outputs table's structure - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $export_mode 'create_table', 'triggers', 'create_view', - * 'stand_in' - * @param string $export_type 'server', 'database', 'table' - * @param bool $do_relation whether to include relation comments - * @param bool $do_comments whether to include the pmadb-style column - * comments as comments in the structure; - * this is deprecated but the parameter is - * left here because export.php calls - * $this->exportStructure() also for other - * export types which use this parameter - * @param bool $do_mime whether to include mime comments - * @param bool $dates whether to include creation/update/check dates - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportStructure( - $db, - $table, - $crlf, - $error_url, - $export_mode, - $export_type, - $do_relation = false, - $do_comments = false, - $do_mime = false, - $dates = false, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - $dump = ''; - - switch ($export_mode) { - case 'create_table': - $dump .= '== ' . __('Table structure for table') . ' ' - . $table_alias . "\n\n"; - $dump .= $this->getTableDef( - $db, - $table, - $crlf, - $error_url, - $do_relation, - $do_comments, - $do_mime, - $dates, - true, - false, - $aliases - ); - break; - case 'triggers': - $dump = ''; - $triggers = $GLOBALS['dbi']->getTriggers($db, $table); - if ($triggers) { - $dump .= '== ' . __('Triggers') . ' ' . $table_alias . "\n\n"; - $dump .= $this->getTriggers($db, $table); - } - break; - case 'create_view': - $dump .= '== ' . __('Structure for view') . ' ' . $table_alias . "\n\n"; - $dump .= $this->getTableDef( - $db, - $table, - $crlf, - $error_url, - $do_relation, - $do_comments, - $do_mime, - $dates, - true, - true, - $aliases - ); - break; - case 'stand_in': - $dump .= '== ' . __('Stand-in structure for view') - . ' ' . $table . "\n\n"; - // export a stand-in definition to resolve view dependencies - $dump .= $this->getTableDefStandIn($db, $table, $crlf, $aliases); - } // end switch - - return PMA_exportOutputHandler($dump); - } - - /** - * Formats the definition for one column - * - * @param array $column info about this column - * @param array $unique_keys unique keys for this table - * @param string $col_alias Column Alias - * - * @return string Formatted column definition - */ - public function formatOneColumnDefinition( - $column, - $unique_keys, - $col_alias = '' - ) { - if (empty($col_alias)) { - $col_alias = $column['Field']; - } - $extracted_columnspec - = Util::extractColumnSpec($column['Type']); - $type = $extracted_columnspec['print_type']; - if (empty($type)) { - $type = ' '; - } - - if (!isset($column['Default'])) { - if ($column['Null'] != 'NO') { - $column['Default'] = 'NULL'; - } - } - - $fmt_pre = ''; - $fmt_post = ''; - if (in_array($column['Field'], $unique_keys)) { - $fmt_pre = '**' . $fmt_pre; - $fmt_post = $fmt_post . '**'; - } - if ($column['Key'] == 'PRI') { - $fmt_pre = '//' . $fmt_pre; - $fmt_post = $fmt_post . '//'; - } - $definition = '|' - . $fmt_pre . htmlspecialchars($col_alias) . $fmt_post; - $definition .= '|' . htmlspecialchars($type); - $definition .= '|' - . (($column['Null'] == '' || $column['Null'] == 'NO') - ? __('No') : __('Yes')); - $definition .= '|' - . htmlspecialchars( - isset($column['Default']) ? $column['Default'] : '' - ); - - return $definition; - } -} diff --git a/#pma/libraries/plugins/export/ExportXml.php b/#pma/libraries/plugins/export/ExportXml.php deleted file mode 100644 index 3878b33a..00000000 --- a/#pma/libraries/plugins/export/ExportXml.php +++ /dev/null @@ -1,577 +0,0 @@ -setProperties(); - } - - /** - * Initialize the local variables that are used for export PDF - * - * @return void - */ - protected function initSpecificVariables() - { - global $table, $tables; - $this->_setTable($table); - $this->_setTables($tables); - } - - /** - * Sets the export XML properties - * - * @return void - */ - protected function setProperties() - { - // create the export plugin property item - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('XML'); - $exportPluginProperties->setExtension('xml'); - $exportPluginProperties->setMimeType('text/xml'); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new HiddenPropertyItem("structure_or_data"); - $generalOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // export structure main group - $structure = new OptionsPropertyMainGroup( - "structure", __('Object creation options (all are recommended)') - ); - - // create primary items and add them to the group - $leaf = new BoolPropertyItem( - "export_events", - __('Events') - ); - $structure->addProperty($leaf); - $leaf = new BoolPropertyItem( - "export_functions", - __('Functions') - ); - $structure->addProperty($leaf); - $leaf = new BoolPropertyItem( - "export_procedures", - __('Procedures') - ); - $structure->addProperty($leaf); - $leaf = new BoolPropertyItem( - "export_tables", - __('Tables') - ); - $structure->addProperty($leaf); - $leaf = new BoolPropertyItem( - "export_triggers", - __('Triggers') - ); - $structure->addProperty($leaf); - $leaf = new BoolPropertyItem( - "export_views", - __('Views') - ); - $structure->addProperty($leaf); - $exportSpecificOptions->addProperty($structure); - - // data main group - $data = new OptionsPropertyMainGroup( - "data", __('Data dump options') - ); - // create primary items and add them to the group - $leaf = new BoolPropertyItem( - "export_contents", - __('Export contents') - ); - $data->addProperty($leaf); - $exportSpecificOptions->addProperty($data); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Generates output for SQL defintions of routines - * - * @param string $db Database name - * @param string $type Item type to be used in XML output - * @param string $dbitype Item type used in DBI qieries - * - * @return string XML with definitions - */ - private function _exportRoutines($db, $type, $dbitype) - { - // Export routines - $routines = $GLOBALS['dbi']->getProceduresOrFunctions( - $db, - $dbitype - ); - return $this->_exportDefinitions($db, $type, $dbitype, $routines); - } - - /** - * Generates output for SQL defintions - * - * @param string $db Database name - * @param string $type Item type to be used in XML output - * @param string $dbitype Item type used in DBI qieries - * @param array $names Names of items to export - * - * @return string XML with definitions - */ - private function _exportDefinitions($db, $type, $dbitype, $names) - { - global $crlf; - - $head = ''; - - if ($names) { - foreach ($names as $name) { - $head .= ' ' . $crlf; - - // Do some formatting - $sql = $GLOBALS['dbi']->getDefinition($db, $dbitype, $name); - $sql = htmlspecialchars(rtrim($sql)); - $sql = str_replace("\n", "\n ", $sql); - - $head .= " " . $sql . $crlf; - $head .= ' ' . $crlf; - } - } - - return $head; - } - - /** - * Outputs export header. It is the first method to be called, so all - * the required variables are initialized here. - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - $this->initSpecificVariables(); - global $crlf, $cfg, $db; - $table = $this->_getTable(); - $tables = $this->_getTables(); - - $export_struct = isset($GLOBALS['xml_export_functions']) - || isset($GLOBALS['xml_export_procedures']) - || isset($GLOBALS['xml_export_tables']) - || isset($GLOBALS['xml_export_triggers']) - || isset($GLOBALS['xml_export_views']); - $export_data = isset($GLOBALS['xml_export_contents']) ? true : false; - - if ($GLOBALS['output_charset_conversion']) { - $charset = $GLOBALS['charset']; - } else { - $charset = 'utf-8'; - } - - $head = '' . $crlf - . '' . $crlf . $crlf; - - $head .= '' . $crlf; - - if ($export_struct) { - $result = $GLOBALS['dbi']->fetchResult( - 'SELECT `DEFAULT_CHARACTER_SET_NAME`, `DEFAULT_COLLATION_NAME`' - . ' FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME`' - . ' = \'' . $GLOBALS['dbi']->escapeString($db) . '\' LIMIT 1' - ); - $db_collation = $result[0]['DEFAULT_COLLATION_NAME']; - $db_charset = $result[0]['DEFAULT_CHARACTER_SET_NAME']; - - $head .= ' ' . $crlf; - $head .= ' ' . $crlf; - $head .= ' ' . $crlf; - - if (count($tables) == 0) { - $tables[] = $table; - } - - foreach ($tables as $table) { - // Export tables and views - $result = $GLOBALS['dbi']->fetchResult( - 'SHOW CREATE TABLE ' . Util::backquote($db) . '.' - . Util::backquote($table), - 0 - ); - $tbl = $result[$table][1]; - - $is_view = $GLOBALS['dbi']->getTable($db, $table) - ->isView(); - - if ($is_view) { - $type = 'view'; - } else { - $type = 'table'; - } - - if ($is_view && !isset($GLOBALS['xml_export_views'])) { - continue; - } - - if (!$is_view && !isset($GLOBALS['xml_export_tables'])) { - continue; - } - - $head .= ' ' - . $crlf; - - $tbl = " " . htmlspecialchars($tbl); - $tbl = str_replace("\n", "\n ", $tbl); - - $head .= $tbl . ';' . $crlf; - $head .= ' ' . $crlf; - - if (isset($GLOBALS['xml_export_triggers']) - && $GLOBALS['xml_export_triggers'] - ) { - // Export triggers - $triggers = $GLOBALS['dbi']->getTriggers($db, $table); - if ($triggers) { - foreach ($triggers as $trigger) { - $code = $trigger['create']; - $head .= ' ' . $crlf; - - // Do some formatting - $code = mb_substr(rtrim($code), 0, -3); - $code = " " . htmlspecialchars($code); - $code = str_replace("\n", "\n ", $code); - - $head .= $code . $crlf; - $head .= ' ' . $crlf; - } - - unset($trigger); - unset($triggers); - } - } - } - - if (isset($GLOBALS['xml_export_functions']) - && $GLOBALS['xml_export_functions'] - ) { - $head .= $this->_exportRoutines($db, 'function', 'FUNCTION'); - } - - if (isset($GLOBALS['xml_export_procedures']) - && $GLOBALS['xml_export_procedures'] - ) { - $head .= $this->_exportRoutines($db, 'procedure', 'PROCEDURE'); - } - - if (isset($GLOBALS['xml_export_events']) - && $GLOBALS['xml_export_events'] - ) { - // Export events - $events = $GLOBALS['dbi']->fetchResult( - "SELECT EVENT_NAME FROM information_schema.EVENTS " - . "WHERE EVENT_SCHEMA='" . $GLOBALS['dbi']->escapeString($db) - . "'" - ); - $head .= $this->_exportDefinitions( - $db, 'event', 'EVENT', $events - ); - } - - unset($result); - - $head .= ' ' . $crlf; - $head .= ' ' . $crlf; - - if ($export_data) { - $head .= $crlf; - } - } - - return PMA_exportOutputHandler($head); - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - $foot = ''; - - return PMA_exportOutputHandler($foot); - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - global $crlf; - - if (empty($db_alias)) { - $db_alias = $db; - } - if (isset($GLOBALS['xml_export_contents']) - && $GLOBALS['xml_export_contents'] - ) { - $head = ' ' . $crlf . ' ' . $crlf; - - return PMA_exportOutputHandler($head); - } else { - return true; - } - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - global $crlf; - - if (isset($GLOBALS['xml_export_contents']) - && $GLOBALS['xml_export_contents'] - ) { - return PMA_exportOutputHandler(' ' . $crlf); - } else { - return true; - } - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in XML format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - // Do not export data for merge tables - if ($GLOBALS['dbi']->getTable($db, $table)->isMerge()) { - return true; - } - - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - if (isset($GLOBALS['xml_export_contents']) - && $GLOBALS['xml_export_contents'] - ) { - $result = $GLOBALS['dbi']->query( - $sql_query, - null, - DatabaseInterface::QUERY_UNBUFFERED - ); - - $columns_cnt = $GLOBALS['dbi']->numFields($result); - $columns = array(); - for ($i = 0; $i < $columns_cnt; $i++) { - $columns[$i] = stripslashes($GLOBALS['dbi']->fieldName($result, $i)); - } - unset($i); - - $buffer = ' ' . $crlf; - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - - while ($record = $GLOBALS['dbi']->fetchRow($result)) { - $buffer = ' ' . $crlf; - for ($i = 0; $i < $columns_cnt; $i++) { - $col_as = $columns[$i]; - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as]) - ) { - $col_as - = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - // If a cell is NULL, still export it to preserve - // the XML structure - if (!isset($record[$i]) || is_null($record[$i])) { - $record[$i] = 'NULL'; - } - $buffer .= ' ' - . htmlspecialchars((string)$record[$i]) - . '' . $crlf; - } - $buffer .= '
    ' . $crlf; - - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - } - $GLOBALS['dbi']->freeResult($result); - } - - return true; - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the table name - * - * @return string - */ - private function _getTable() - { - return $this->_table; - } - - /** - * Sets the table name - * - * @param string $table table name - * - * @return void - */ - private function _setTable($table) - { - $this->_table = $table; - } - - /** - * Gets the table names - * - * @return array - */ - private function _getTables() - { - return $this->_tables; - } - - /** - * Sets the table names - * - * @param array $tables table names - * - * @return void - */ - private function _setTables($tables) - { - $this->_tables = $tables; - } -} diff --git a/#pma/libraries/plugins/export/ExportYaml.php b/#pma/libraries/plugins/export/ExportYaml.php deleted file mode 100644 index 6689b864..00000000 --- a/#pma/libraries/plugins/export/ExportYaml.php +++ /dev/null @@ -1,217 +0,0 @@ -setProperties(); - } - - /** - * Sets the export YAML properties - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new ExportPluginProperties(); - $exportPluginProperties->setText('YAML'); - $exportPluginProperties->setExtension('yml'); - $exportPluginProperties->setMimeType('text/yaml'); - $exportPluginProperties->setForceFile(true); - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new HiddenPropertyItem("structure_or_data"); - $generalOptions->addProperty($leaf); - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader() - { - PMA_exportOutputHandler( - '%YAML 1.1' . $GLOBALS['crlf'] . '---' . $GLOBALS['crlf'] - ); - - return true; - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter() - { - PMA_exportOutputHandler('...' . $GLOBALS['crlf']); - - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader($db, $db_alias = '') - { - return true; - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter($db) - { - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $export_type 'server', 'database', 'table' - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $export_type, $db_alias = '') - { - return true; - } - - /** - * Outputs the content of a table in JSON format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, - $table, - $crlf, - $error_url, - $sql_query, - $aliases = array() - ) { - $db_alias = $db; - $table_alias = $table; - $this->initAlias($aliases, $db_alias, $table_alias); - $result = $GLOBALS['dbi']->query( - $sql_query, - null, - PMA\libraries\DatabaseInterface::QUERY_UNBUFFERED - ); - - $columns_cnt = $GLOBALS['dbi']->numFields($result); - $columns = array(); - for ($i = 0; $i < $columns_cnt; $i++) { - $col_as = $GLOBALS['dbi']->fieldName($result, $i); - if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $columns[$i] = stripslashes($col_as); - } - - $buffer = ''; - $record_cnt = 0; - while ($record = $GLOBALS['dbi']->fetchRow($result)) { - $record_cnt++; - - // Output table name as comment if this is the first record of the table - if ($record_cnt == 1) { - $buffer = '# ' . $db_alias . '.' . $table_alias . $crlf; - $buffer .= '-' . $crlf; - } else { - $buffer = '-' . $crlf; - } - - for ($i = 0; $i < $columns_cnt; $i++) { - if (!isset($record[$i])) { - continue; - } - - if (is_null($record[$i])) { - $buffer .= ' ' . $columns[$i] . ': null' . $crlf; - continue; - } - - if (is_numeric($record[$i])) { - $buffer .= ' ' . $columns[$i] . ': ' . $record[$i] . $crlf; - continue; - } - - $record[$i] = str_replace( - array('\\', '"', "\n", "\r"), - array('\\\\', '\"', '\n', '\r'), - $record[$i] - ); - $buffer .= ' ' . $columns[$i] . ': "' . $record[$i] . '"' . $crlf; - } - - if (!PMA_exportOutputHandler($buffer)) { - return false; - } - } - $GLOBALS['dbi']->freeResult($result); - - return true; - } // end getTableYAML -} diff --git a/#pma/libraries/plugins/export/PMA_ExportPdf.php b/#pma/libraries/plugins/export/PMA_ExportPdf.php deleted file mode 100644 index c553be62..00000000 --- a/#pma/libraries/plugins/export/PMA_ExportPdf.php +++ /dev/null @@ -1,811 +0,0 @@ -y; - } - $current_page = $this->page; - if ((($y + $h) > $this->PageBreakTrigger) - && (!$this->InFooter) - && ($this->AcceptPageBreak()) - ) { - if ($addpage) { - //Automatic page break - $x = $this->x; - $this->AddPage($this->CurOrientation); - $this->y = $this->dataY; - $oldpage = $this->page - 1; - - $this_page_orm = $this->pagedim[$this->page]['orm']; - $old_page_orm = $this->pagedim[$oldpage]['orm']; - $this_page_olm = $this->pagedim[$this->page]['olm']; - $old_page_olm = $this->pagedim[$oldpage]['olm']; - if ($this->rtl) { - if ($this_page_orm != $old_page_orm) { - $this->x = $x - ($this_page_orm - $old_page_orm); - } else { - $this->x = $x; - } - } else { - if ($this_page_olm != $old_page_olm) { - $this->x = $x + ($this_page_olm - $old_page_olm); - } else { - $this->x = $x; - } - } - } - - return true; - } - if ($current_page != $this->page) { - // account for columns mode - return true; - } - - return false; - } - - /** - * This method is used to render the page header. - * - * @return void - */ - public function Header() - { - global $maxY; - // We don't want automatic page breaks while generating header - // as this can lead to infinite recursion as auto generated page - // will want header as well causing another page break - // FIXME: Better approach might be to try to compact the content - $this->SetAutoPageBreak(false); - // Check if header for this page already exists - if (!isset($this->headerset[$this->page])) { - $fullwidth = 0; - foreach ($this->tablewidths as $width) { - $fullwidth += $width; - } - $this->SetY(($this->tMargin) - ($this->FontSizePt / $this->k) * 5); - $this->cellFontSize = $this->FontSizePt; - $this->SetFont( - PDF::PMA_PDF_FONT, - '', - ($this->titleFontSize - ? $this->titleFontSize - : $this->FontSizePt) - ); - $this->Cell(0, $this->FontSizePt, $this->titleText, 0, 1, 'C'); - $this->SetFont(PDF::PMA_PDF_FONT, '', $this->cellFontSize); - $this->SetY(($this->tMargin) - ($this->FontSizePt / $this->k) * 2.5); - $this->Cell( - 0, - $this->FontSizePt, - __('Database:') . ' ' . $this->dbAlias . ', ' - . __('Table:') . ' ' . $this->tableAlias . ', ' - . __('Purpose:') . ' ' . $this->purpose, - 0, - 1, - 'L' - ); - $l = ($this->lMargin); - foreach ($this->colTitles as $col => $txt) { - $this->SetXY($l, ($this->tMargin)); - $this->MultiCell( - $this->tablewidths[$col], - $this->FontSizePt, - $txt - ); - $l += $this->tablewidths[$col]; - $maxY = ($maxY < $this->getY()) ? $this->getY() : $maxY; - } - $this->SetXY($this->lMargin, $this->tMargin); - $this->setFillColor(200, 200, 200); - $l = ($this->lMargin); - foreach ($this->colTitles as $col => $txt) { - $this->SetXY($l, $this->tMargin); - $this->cell( - $this->tablewidths[$col], - $maxY - ($this->tMargin), - '', - 1, - 0, - 'L', - 1 - ); - $this->SetXY($l, $this->tMargin); - $this->MultiCell( - $this->tablewidths[$col], - $this->FontSizePt, - $txt, - 0, - 'C' - ); - $l += $this->tablewidths[$col]; - } - $this->setFillColor(255, 255, 255); - // set headerset - $this->headerset[$this->page] = 1; - } - - $this->dataY = $maxY; - $this->SetAutoPageBreak(true); - } - - /** - * Generate table - * - * @param int $lineheight Height of line - * - * @return void - */ - public function morepagestable($lineheight = 8) - { - // some things to set and 'remember' - $l = $this->lMargin; - $startheight = $h = $this->dataY; - $startpage = $currpage = $this->page; - - // calculate the whole width - $fullwidth = 0; - foreach ($this->tablewidths as $width) { - $fullwidth += $width; - } - - // Now let's start to write the table - $row = 0; - $tmpheight = array(); - $maxpage = $this->page; - - while ($data = $GLOBALS['dbi']->fetchRow($this->results)) { - $this->page = $currpage; - // write the horizontal borders - $this->Line($l, $h, $fullwidth + $l, $h); - // write the content and remember the height of the highest col - foreach ($data as $col => $txt) { - $this->page = $currpage; - $this->SetXY($l, $h); - if ($this->tablewidths[$col] > 0) { - $this->MultiCell( - $this->tablewidths[$col], - $lineheight, - $txt, - 0, - $this->colAlign[$col] - ); - $l += $this->tablewidths[$col]; - } - - if (!isset($tmpheight[$row . '-' . $this->page])) { - $tmpheight[$row . '-' . $this->page] = 0; - } - if ($tmpheight[$row . '-' . $this->page] < $this->GetY()) { - $tmpheight[$row . '-' . $this->page] = $this->GetY(); - } - if ($this->page > $maxpage) { - $maxpage = $this->page; - } - unset($data[$col]); - } - - // get the height we were in the last used page - $h = $tmpheight[$row . '-' . $maxpage]; - // set the "pointer" to the left margin - $l = $this->lMargin; - // set the $currpage to the last page - $currpage = $maxpage; - unset($data[$row]); - $row++; - } - // draw the borders - // we start adding a horizontal line on the last page - $this->page = $maxpage; - $this->Line($l, $h, $fullwidth + $l, $h); - // now we start at the top of the document and walk down - for ($i = $startpage; $i <= $maxpage; $i++) { - $this->page = $i; - $l = $this->lMargin; - $t = ($i == $startpage) ? $startheight : $this->tMargin; - $lh = ($i == $maxpage) ? $h : $this->h - $this->bMargin; - $this->Line($l, $t, $l, $lh); - foreach ($this->tablewidths as $width) { - $l += $width; - $this->Line($l, $t, $l, $lh); - } - } - // set it to the last page, if not it'll cause some problems - $this->page = $maxpage; - } - - /** - * Sets a set of attributes. - * - * @param array $attr array containing the attributes - * - * @return void - */ - public function setAttributes($attr = array()) - { - foreach ($attr as $key => $val) { - $this->$key = $val; - } - } - - /** - * Defines the top margin. - * The method can be called before creating the first page. - * - * @param float $topMargin the margin - * - * @return void - */ - public function setTopMargin($topMargin) - { - $this->tMargin = $topMargin; - } - - /** - * Prints triggers - * - * @param string $db database name - * @param string $table table name - * - * @return void - */ - public function getTriggers($db, $table) - { - $i = 0; - $triggers = $GLOBALS['dbi']->getTriggers($db, $table); - foreach ($triggers as $trigger) { - $i++; - break; - } - if ($i == 0) { - return; //prevents printing blank trigger list for any table - } - - unset($this->tablewidths); - unset($this->colTitles); - unset($this->titleWidth); - unset($this->colFits); - unset($this->display_column); - unset($this->colAlign); - - /** - * Making table heading - * Keeping column width constant - */ - $this->colTitles[0] = __('Name'); - $this->tablewidths[0] = 90; - $this->colTitles[1] = __('Time'); - $this->tablewidths[1] = 80; - $this->colTitles[2] = __('Event'); - $this->tablewidths[2] = 40; - $this->colTitles[3] = __('Definition'); - $this->tablewidths[3] = 240; - - for ($columns_cnt = 0; $columns_cnt < 4; $columns_cnt++) { - $this->colAlign[$columns_cnt] = 'L'; - $this->display_column[$columns_cnt] = true; - } - - // Starting to fill table with required info - - $this->setY($this->tMargin); - $this->AddPage(); - $this->SetFont(PDF::PMA_PDF_FONT, '', 9); - - $l = $this->lMargin; - $startheight = $h = $this->dataY; - $startpage = $currpage = $this->page; - - // calculate the whole width - $fullwidth = 0; - foreach ($this->tablewidths as $width) { - $fullwidth += $width; - } - - $row = 0; - $tmpheight = array(); - $maxpage = $this->page; - $data = array(); - - $triggers = $GLOBALS['dbi']->getTriggers($db, $table); - - foreach ($triggers as $trigger) { - $data[] = $trigger['name']; - $data[] = $trigger['action_timing']; - $data[] = $trigger['event_manipulation']; - $data[] = $trigger['definition']; - $this->page = $currpage; - // write the horizontal borders - $this->Line($l, $h, $fullwidth + $l, $h); - // write the content and remember the height of the highest col - foreach ($data as $col => $txt) { - $this->page = $currpage; - $this->SetXY($l, $h); - if ($this->tablewidths[$col] > 0) { - $this->MultiCell( - $this->tablewidths[$col], - $this->FontSizePt, - $txt, - 0, - $this->colAlign[$col] - ); - $l += $this->tablewidths[$col]; - } - - if (!isset($tmpheight[$row . '-' . $this->page])) { - $tmpheight[$row . '-' . $this->page] = 0; - } - if ($tmpheight[$row . '-' . $this->page] < $this->GetY()) { - $tmpheight[$row . '-' . $this->page] = $this->GetY(); - } - if ($this->page > $maxpage) { - $maxpage = $this->page; - } - } - // get the height we were in the last used page - $h = $tmpheight[$row . '-' . $maxpage]; - // set the "pointer" to the left margin - $l = $this->lMargin; - // set the $currpage to the last page - $currpage = $maxpage; - unset($data); - $row++; - } - // draw the borders - // we start adding a horizontal line on the last page - $this->page = $maxpage; - $this->Line($l, $h, $fullwidth + $l, $h); - // now we start at the top of the document and walk down - for ($i = $startpage; $i <= $maxpage; $i++) { - $this->page = $i; - $l = $this->lMargin; - $t = ($i == $startpage) ? $startheight : $this->tMargin; - $lh = ($i == $maxpage) ? $h : $this->h - $this->bMargin; - $this->Line($l, $t, $l, $lh); - foreach ($this->tablewidths as $width) { - $l += $width; - $this->Line($l, $t, $l, $lh); - } - } - // set it to the last page, if not it'll cause some problems - $this->page = $maxpage; - } - - /** - * Print $table's CREATE definition - * - * @param string $db the database name - * @param string $table the table name - * @param bool $do_relation whether to include relation comments - * @param bool $do_comments whether to include the pmadb-style column - * comments as comments in the structure; - * this is deprecated but the parameter is - * left here because export.php calls - * PMA_exportStructure() also for other - * export types which use this parameter - * @param bool $do_mime whether to include mime comments - * @param bool $view whether we're handling a view - * @param array $aliases aliases of db/table/columns - * - * @return void - */ - public function getTableDef( - $db, - $table, - $do_relation, - $do_comments, - $do_mime, - $view = false, - $aliases = array() - ) { - // set $cfgRelation here, because there is a chance that it's modified - // since the class initialization - global $cfgRelation; - - unset($this->tablewidths); - unset($this->colTitles); - unset($this->titleWidth); - unset($this->colFits); - unset($this->display_column); - unset($this->colAlign); - - /** - * Gets fields properties - */ - $GLOBALS['dbi']->selectDb($db); - - /** - * All these three checks do_relation, do_comment and do_mime is - * not required. As presently all are set true by default. - * But when, methods to take user input will be developed, - * it will be of use - */ - // Check if we can use Relations - if ($do_relation) { - // Find which tables are related with the current one and write it in - // an array - $res_rel = PMA_getForeigners($db, $table); - $have_rel = !empty($res_rel); - } else { - $have_rel = false; - } // end if - - //column count and table heading - - $this->colTitles[0] = __('Column'); - $this->tablewidths[0] = 90; - $this->colTitles[1] = __('Type'); - $this->tablewidths[1] = 80; - $this->colTitles[2] = __('Null'); - $this->tablewidths[2] = 40; - $this->colTitles[3] = __('Default'); - $this->tablewidths[3] = 120; - - for ($columns_cnt = 0; $columns_cnt < 4; $columns_cnt++) { - $this->colAlign[$columns_cnt] = 'L'; - $this->display_column[$columns_cnt] = true; - } - - if ($do_relation && $have_rel) { - $this->colTitles[$columns_cnt] = __('Links to'); - $this->display_column[$columns_cnt] = true; - $this->colAlign[$columns_cnt] = 'L'; - $this->tablewidths[$columns_cnt] = 120; - $columns_cnt++; - } - if ($do_comments /*&& $cfgRelation['commwork']*/) { - $this->colTitles[$columns_cnt] = __('Comments'); - $this->display_column[$columns_cnt] = true; - $this->colAlign[$columns_cnt] = 'L'; - $this->tablewidths[$columns_cnt] = 120; - $columns_cnt++; - } - if ($do_mime && $cfgRelation['mimework']) { - $this->colTitles[$columns_cnt] = __('MIME'); - $this->display_column[$columns_cnt] = true; - $this->colAlign[$columns_cnt] = 'L'; - $this->tablewidths[$columns_cnt] = 120; - $columns_cnt++; - } - - // Starting to fill table with required info - - $this->setY($this->tMargin); - $this->AddPage(); - $this->SetFont(PDF::PMA_PDF_FONT, '', 9); - - // Now let's start to write the table structure - - if ($do_comments) { - $comments = PMA_getComments($db, $table); - } - if ($do_mime && $cfgRelation['mimework']) { - $mime_map = PMA_getMIME($db, $table, true); - } - - $columns = $GLOBALS['dbi']->getColumns($db, $table); - /** - * Get the unique keys in the table. - * Presently, this information is not used. We will have to find out - * way of displaying it. - */ - $unique_keys = array(); - $keys = $GLOBALS['dbi']->getTableIndexes($db, $table); - foreach ($keys as $key) { - if ($key['Non_unique'] == 0) { - $unique_keys[] = $key['Column_name']; - } - } - - // some things to set and 'remember' - $l = $this->lMargin; - $startheight = $h = $this->dataY; - $startpage = $currpage = $this->page; - // calculate the whole width - $fullwidth = 0; - foreach ($this->tablewidths as $width) { - $fullwidth += $width; - } - - $row = 0; - $tmpheight = array(); - $maxpage = $this->page; - $data = array(); - - // fun begin - foreach ($columns as $column) { - $extracted_columnspec - = Util::extractColumnSpec($column['Type']); - - $type = $extracted_columnspec['print_type']; - if (empty($type)) { - $type = ' '; - } - - if (!isset($column['Default'])) { - if ($column['Null'] != 'NO') { - $column['Default'] = 'NULL'; - } - } - $data [] = $column['Field']; - $data [] = $type; - $data [] = ($column['Null'] == '' || $column['Null'] == 'NO') - ? 'No' - : 'Yes'; - $data [] = isset($column['Default']) ? $column['Default'] : ''; - - $field_name = $column['Field']; - - if ($do_relation && $have_rel) { - $data [] = isset($res_rel[$field_name]) - ? $res_rel[$field_name]['foreign_table'] - . ' (' . $res_rel[$field_name]['foreign_field'] - . ')' - : ''; - } - if ($do_comments) { - $data [] = isset($comments[$field_name]) - ? $comments[$field_name] - : ''; - } - if ($do_mime) { - $data [] = isset($mime_map[$field_name]) - ? $mime_map[$field_name]['mimetype'] - : ''; - } - - $this->page = $currpage; - // write the horizontal borders - $this->Line($l, $h, $fullwidth + $l, $h); - // write the content and remember the height of the highest col - foreach ($data as $col => $txt) { - $this->page = $currpage; - $this->SetXY($l, $h); - if ($this->tablewidths[$col] > 0) { - $this->MultiCell( - $this->tablewidths[$col], - $this->FontSizePt, - $txt, - 0, - $this->colAlign[$col] - ); - $l += $this->tablewidths[$col]; - } - - if (!isset($tmpheight[$row . '-' . $this->page])) { - $tmpheight[$row . '-' . $this->page] = 0; - } - if ($tmpheight[$row . '-' . $this->page] < $this->GetY()) { - $tmpheight[$row . '-' . $this->page] = $this->GetY(); - } - if ($this->page > $maxpage) { - $maxpage = $this->page; - } - } - - // get the height we were in the last used page - $h = $tmpheight[$row . '-' . $maxpage]; - // set the "pointer" to the left margin - $l = $this->lMargin; - // set the $currpage to the last page - $currpage = $maxpage; - unset($data); - $row++; - } - // draw the borders - // we start adding a horizontal line on the last page - $this->page = $maxpage; - $this->Line($l, $h, $fullwidth + $l, $h); - // now we start at the top of the document and walk down - for ($i = $startpage; $i <= $maxpage; $i++) { - $this->page = $i; - $l = $this->lMargin; - $t = ($i == $startpage) ? $startheight : $this->tMargin; - $lh = ($i == $maxpage) ? $h : $this->h - $this->bMargin; - $this->Line($l, $t, $l, $lh); - foreach ($this->tablewidths as $width) { - $l += $width; - $this->Line($l, $t, $l, $lh); - } - } - // set it to the last page, if not it'll cause some problems - $this->page = $maxpage; - } - - /** - * MySQL report - * - * @param string $query Query to execute - * - * @return void - */ - public function mysqlReport($query) - { - unset($this->tablewidths); - unset($this->colTitles); - unset($this->titleWidth); - unset($this->colFits); - unset($this->display_column); - unset($this->colAlign); - - /** - * Pass 1 for column widths - */ - $this->results = $GLOBALS['dbi']->query( - $query, - null, - DatabaseInterface::QUERY_UNBUFFERED - ); - $this->numFields = $GLOBALS['dbi']->numFields($this->results); - $this->fields = $GLOBALS['dbi']->getFieldsMeta($this->results); - - // sColWidth = starting col width (an average size width) - $availableWidth = $this->w - $this->lMargin - $this->rMargin; - $this->sColWidth = $availableWidth / $this->numFields; - $totalTitleWidth = 0; - - // loop through results header and set initial - // col widths/ titles/ alignment - // if a col title is less than the starting col width, - // reduce that column size - $colFits = array(); - $titleWidth = array(); - for ($i = 0; $i < $this->numFields; $i++) { - $col_as = $this->fields[$i]->name; - $db = $this->currentDb; - $table = $this->currentTable; - if (!empty($this->aliases[$db]['tables'][$table]['columns'][$col_as])) { - $col_as = $this->aliases[$db]['tables'][$table]['columns'][$col_as]; - } - $stringWidth = $this->getstringwidth($col_as) + 6; - // save the real title's width - $titleWidth[$i] = $stringWidth; - $totalTitleWidth += $stringWidth; - - // set any column titles less than the start width to - // the column title width - if ($stringWidth < $this->sColWidth) { - $colFits[$i] = $stringWidth; - } - $this->colTitles[$i] = $col_as; - $this->display_column[$i] = true; - - switch ($this->fields[$i]->type) { - case 'int': - $this->colAlign[$i] = 'R'; - break; - case 'blob': - case 'tinyblob': - case 'mediumblob': - case 'longblob': - /** - * @todo do not deactivate completely the display - * but show the field's name and [BLOB] - */ - if (stristr($this->fields[$i]->flags, 'BINARY')) { - $this->display_column[$i] = false; - unset($this->colTitles[$i]); - } - $this->colAlign[$i] = 'L'; - break; - default: - $this->colAlign[$i] = 'L'; - } - } - - // title width verification - if ($totalTitleWidth > $availableWidth) { - $adjustingMode = true; - } else { - $adjustingMode = false; - // we have enough space for all the titles at their - // original width so use the true title's width - foreach ($titleWidth as $key => $val) { - $colFits[$key] = $val; - } - } - - // loop through the data; any column whose contents - // is greater than the column size is resized - /** - * @todo force here a LIMIT to avoid reading all rows - */ - while ($row = $GLOBALS['dbi']->fetchRow($this->results)) { - foreach ($colFits as $key => $val) { - $stringWidth = $this->getstringwidth($row[$key]) + 6; - if ($adjustingMode && ($stringWidth > $this->sColWidth)) { - // any column whose data's width is bigger than - // the start width is now discarded - unset($colFits[$key]); - } else { - // if data's width is bigger than the current column width, - // enlarge the column (but avoid enlarging it if the - // data's width is very big) - if ($stringWidth > $val - && $stringWidth < ($this->sColWidth * 3) - ) { - $colFits[$key] = $stringWidth; - } - } - } - } - - $totAlreadyFitted = 0; - foreach ($colFits as $key => $val) { - // set fitted columns to smallest size - $this->tablewidths[$key] = $val; - // to work out how much (if any) space has been freed up - $totAlreadyFitted += $val; - } - - if ($adjustingMode) { - $surplus = (sizeof($colFits) * $this->sColWidth) - $totAlreadyFitted; - $surplusToAdd = $surplus / ($this->numFields - sizeof($colFits)); - } else { - $surplusToAdd = 0; - } - - for ($i = 0; $i < $this->numFields; $i++) { - if (!in_array($i, array_keys($colFits))) { - $this->tablewidths[$i] = $this->sColWidth + $surplusToAdd; - } - if ($this->display_column[$i] == false) { - $this->tablewidths[$i] = 0; - } - } - - ksort($this->tablewidths); - - $GLOBALS['dbi']->freeResult($this->results); - - // Pass 2 - - $this->results = $GLOBALS['dbi']->query( - $query, - null, - DatabaseInterface::QUERY_UNBUFFERED - ); - $this->setY($this->tMargin); - $this->AddPage(); - $this->SetFont(PDF::PMA_PDF_FONT, '', 9); - $this->morepagestable($this->FontSizePt); - $GLOBALS['dbi']->freeResult($this->results); - } // end of mysqlReport function -} // end of PMA_Export_PDF class diff --git a/#pma/libraries/plugins/export/README b/#pma/libraries/plugins/export/README deleted file mode 100644 index 1bb8843c..00000000 --- a/#pma/libraries/plugins/export/README +++ /dev/null @@ -1,257 +0,0 @@ -This directory holds export plugins for phpMyAdmin. Any new plugin should -basically follow the structure presented here. Official plugins need to -have str* messages with their definition in language files, but if you build -some plugins for your use, you can directly use texts in plugin. - -setProperties(); - } - - // optional - declare global variables and use getters later - /** - * Initialize the local variables that are used specific for export SQL - * - * @global type $global_variable_name - * [..] - * - * @return void - */ - protected function initSpecificVariables() - { - global $global_variable_name; - $this->_setGlobalVariableName($global_variable_name); - } - - /** - * Sets the export plugin properties. - * Called in the constructor. - * - * @return void - */ - protected function setProperties() - { - $exportPluginProperties = new PMA\libraries\properties\plugins\ExportPluginProperties(); - $exportPluginProperties->setText('[name]'); // the name of your plug-in - $exportPluginProperties->setExtension('[ext]'); // extension this plug-in can handle - $exportPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $exportPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new PMA\libraries\properties\options\groups\OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new PMA\libraries\properties\options\groups\OptionsPropertyMainGroup( - "general_opts" - ); - - // optional : - // create primary items and add them to the group - // type - one of the classes listed in libraries/properties/options/items/ - // name - form element name - // text - description in GUI - // size - size of text element - // len - maximal size of input - // values - possible values of the item - $leaf = new PMA\libraries\properties\options\items\RadioPropertyItem( - "structure_or_data" - ); - $leaf->setValues( - array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data') - ) - ); - $generalOptions->addProperty($leaf); - - // add the main group to the root group - $exportSpecificOptions->addProperty($generalOptions); - - // set the options for the export plugin property item - $exportPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $exportPluginProperties; - } - - /** - * Outputs export header - * - * @return bool Whether it succeeded - */ - public function exportHeader () - { - // implementation - return true; - } - - /** - * Outputs export footer - * - * @return bool Whether it succeeded - */ - public function exportFooter () - { - // implementation - return true; - } - - /** - * Outputs database header - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBHeader ($db, $db_alias = '') - { - // implementation - return true; - } - - /** - * Outputs database footer - * - * @param string $db Database name - * - * @return bool Whether it succeeded - */ - public function exportDBFooter ($db) - { - // implementation - return true; - } - - /** - * Outputs CREATE DATABASE statement - * - * @param string $db Database name - * @param string $db_alias Aliases of db - * - * @return bool Whether it succeeded - */ - public function exportDBCreate($db, $db_alias = '') - { - // implementation - return true; - } - - /** - * Outputs the content of a table in [Name] format - * - * @param string $db database name - * @param string $table table name - * @param string $crlf the end of line sequence - * @param string $error_url the url to go back in case of error - * @param string $sql_query SQL query for obtaining data - * @param array $aliases Aliases of db/table/columns - * - * @return bool Whether it succeeded - */ - public function exportData( - $db, $table, $crlf, $error_url, $sql_query, $aliases = array() - ) { - // implementation; - return true; - } - - // optional - implement other methods defined in PMA\libraries\plugins\ExportPlugin.class.php: - // - exportRoutines() - // - exportStructure() - // - getTableDefStandIn() - // - getTriggers() - - // optional - implement other private methods in order to avoid - // having huge methods or avoid duplicate code. Make use of them - // as well as of the getters and setters declared both here - // and in the PMA\libraries\plugins\ExportPlugin class - - - // optional: - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - - /** - * Getter description - * - * @return type - */ - private function _getMyOptionalVariable() - { - return $this->_myOptionalVariable; - } - - /** - * Setter description - * - * @param type $my_optional_variable description - * - * @return void - */ - private function _setMyOptionalVariable($my_optional_variable) - { - $this->_myOptionalVariable = $my_optional_variable; - } - - /** - * Getter description - * - * @return type - */ - private function _getGlobalVariableName() - { - return $this->_globalVariableName; - } - - /** - * Setter description - * - * @param type $global_variable_name description - * - * @return void - */ - private function _setGlobalVariableName($global_variable_name) - { - $this->_globalVariableName = $global_variable_name; - } -} -?> diff --git a/#pma/libraries/plugins/export/TableProperty.php b/#pma/libraries/plugins/export/TableProperty.php deleted file mode 100644 index d76baa62..00000000 --- a/#pma/libraries/plugins/export/TableProperty.php +++ /dev/null @@ -1,283 +0,0 @@ -name = trim($row[0]); - $this->type = trim($row[1]); - $this->nullable = trim($row[2]); - $this->key = trim($row[3]); - $this->defaultValue = trim($row[4]); - $this->ext = trim($row[5]); - } - - /** - * Gets the pure type - * - * @return string type - */ - public function getPureType() - { - $pos = mb_strpos($this->type, "("); - if ($pos > 0) { - return mb_substr($this->type, 0, $pos); - } - return $this->type; - } - - /** - * Tells whether the key is null or not - * - * @return bool true if the key is not null, false otherwise - */ - public function isNotNull() - { - return $this->nullable == "NO" ? "true" : "false"; - } - - /** - * Tells whether the key is unique or not - * - * @return bool true if the key is unique, false otherwise - */ - public function isUnique() - { - return $this->key == "PRI" || $this->key == "UNI" ? "true" : "false"; - } - - /** - * Gets the .NET primitive type - * - * @return string type - */ - public function getDotNetPrimitiveType() - { - if (mb_strpos($this->type, "int") === 0) { - return "int"; - } - if (mb_strpos($this->type, "longtext") === 0) { - return "string"; - } - if (mb_strpos($this->type, "long") === 0) { - return "long"; - } - if (mb_strpos($this->type, "char") === 0) { - return "string"; - } - if (mb_strpos($this->type, "varchar") === 0) { - return "string"; - } - if (mb_strpos($this->type, "text") === 0) { - return "string"; - } - if (mb_strpos($this->type, "tinyint") === 0) { - return "bool"; - } - if (mb_strpos($this->type, "datetime") === 0) { - return "DateTime"; - } - return "unknown"; - } - - /** - * Gets the .NET object type - * - * @return string type - */ - public function getDotNetObjectType() - { - if (mb_strpos($this->type, "int") === 0) { - return "Int32"; - } - if (mb_strpos($this->type, "longtext") === 0) { - return "String"; - } - if (mb_strpos($this->type, "long") === 0) { - return "Long"; - } - if (mb_strpos($this->type, "char") === 0) { - return "String"; - } - if (mb_strpos($this->type, "varchar") === 0) { - return "String"; - } - if (mb_strpos($this->type, "text") === 0) { - return "String"; - } - if (mb_strpos($this->type, "tinyint") === 0) { - return "Boolean"; - } - if (mb_strpos($this->type, "datetime") === 0) { - return "DateTime"; - } - return "Unknown"; - } - - /** - * Gets the index name - * - * @return string containing the name of the index - */ - public function getIndexName() - { - if (mb_strlen($this->key) > 0) { - return "index=\"" - . htmlspecialchars($this->name, ENT_COMPAT, 'UTF-8') - . "\""; - } - return ""; - } - - /** - * Tells whether the key is primary or not - * - * @return bool true if the key is primary, false otherwise - */ - public function isPK() - { - return $this->key == "PRI"; - } - - /** - * Formats a string for C# - * - * @param string $text string to be formatted - * - * @return string formatted text - */ - public function formatCs($text) - { - $text = str_replace( - "#name#", - ExportCodegen::cgMakeIdentifier($this->name, false), - $text - ); - return $this->format($text); - } - - /** - * Formats a string for XML - * - * @param string $text string to be formatted - * - * @return string formatted text - */ - public function formatXml($text) - { - $text = str_replace( - "#name#", - htmlspecialchars($this->name, ENT_COMPAT, 'UTF-8'), - $text - ); - $text = str_replace( - "#indexName#", - $this->getIndexName(), - $text - ); - return $this->format($text); - } - - /** - * Formats a string - * - * @param string $text string to be formatted - * - * @return string formatted text - */ - public function format($text) - { - $text = str_replace( - "#ucfirstName#", - ExportCodegen::cgMakeIdentifier($this->name), - $text - ); - $text = str_replace( - "#dotNetPrimitiveType#", - $this->getDotNetPrimitiveType(), - $text - ); - $text = str_replace( - "#dotNetObjectType#", - $this->getDotNetObjectType(), - $text - ); - $text = str_replace( - "#type#", - $this->getPureType(), - $text - ); - $text = str_replace( - "#notNull#", - $this->isNotNull(), - $text - ); - $text = str_replace( - "#unique#", - $this->isUnique(), - $text - ); - return $text; - } -} diff --git a/#pma/libraries/plugins/import/AbstractImportCsv.php b/#pma/libraries/plugins/import/AbstractImportCsv.php deleted file mode 100644 index 96489075..00000000 --- a/#pma/libraries/plugins/import/AbstractImportCsv.php +++ /dev/null @@ -1,92 +0,0 @@ -setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $importPluginProperties - // this will be shown as "Format specific options" - $importSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - - // create common items and add them to the group - $leaf = new BoolPropertyItem( - "replace", - __( - 'Update data when duplicate keys found on import (add ON DUPLICATE ' - . 'KEY UPDATE)' - ) - ); - $generalOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "terminated", - __('Columns separated with:') - ); - $leaf->setSize(2); - $generalOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "enclosed", - __('Columns enclosed with:') - ); - $leaf->setSize(2); - $leaf->setLen(2); - $generalOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "escaped", - __('Columns escaped with:') - ); - $leaf->setSize(2); - $leaf->setLen(2); - $generalOptions->addProperty($leaf); - $leaf = new TextPropertyItem( - "new_line", - __('Lines terminated with:') - ); - $leaf->setSize(2); - $generalOptions->addProperty($leaf); - - // add the main group to the root group - $importSpecificOptions->addProperty($generalOptions); - - // set the options for the import plugin property item - $importPluginProperties->setOptions($importSpecificOptions); - $this->properties = $importPluginProperties; - - return $generalOptions; - } -} diff --git a/#pma/libraries/plugins/import/ImportCsv.php b/#pma/libraries/plugins/import/ImportCsv.php deleted file mode 100644 index f0dc96eb..00000000 --- a/#pma/libraries/plugins/import/ImportCsv.php +++ /dev/null @@ -1,716 +0,0 @@ -setProperties(); - } - - /** - * Sets the import plugin properties. - * Called in the constructor. - * - * @return void - */ - protected function setProperties() - { - $this->_setAnalyze(false); - - if ($GLOBALS['plugin_param'] !== 'table') { - $this->_setAnalyze(true); - } - - $generalOptions = parent::setProperties(); - $this->properties->setText('CSV'); - $this->properties->setExtension('csv'); - - if ($GLOBALS['plugin_param'] !== 'table') { - $leaf = new BoolPropertyItem( - "col_names", - __( - 'The first line of the file contains the table column names' - . ' (if this is unchecked, the first line will become part' - . ' of the data)' - ) - ); - $generalOptions->addProperty($leaf); - } else { - $hint = new PMA\libraries\Message( - __( - 'If the data in each row of the file is not' - . ' in the same order as in the database, list the corresponding' - . ' column names here. Column names must be separated by commas' - . ' and not enclosed in quotations.' - ) - ); - $leaf = new TextPropertyItem( - "columns", - __('Column names: ') . PMA\libraries\Util::showHint($hint) - ); - $generalOptions->addProperty($leaf); - } - - $leaf = new BoolPropertyItem( - "ignore", - __('Do not abort on INSERT error') - ); - $generalOptions->addProperty($leaf); - } - - /** - * Handles the whole import logic - * - * @param array &$sql_data 2-element array with sql data - * - * @return void - */ - public function doImport(&$sql_data = array()) - { - global $db, $table, $csv_terminated, $csv_enclosed, $csv_escaped, - $csv_new_line, $csv_columns, $err_url; - // $csv_replace and $csv_ignore should have been here, - // but we use directly from $_POST - global $error, $timeout_passed, $finished, $message; - - $replacements = array( - '\\n' => "\n", - '\\t' => "\t", - '\\r' => "\r", - ); - $csv_terminated = strtr($csv_terminated, $replacements); - $csv_enclosed = strtr($csv_enclosed, $replacements); - $csv_escaped = strtr($csv_escaped, $replacements); - $csv_new_line = strtr($csv_new_line, $replacements); - - $param_error = false; - if (mb_strlen($csv_terminated) < 1) { - $message = PMA\libraries\Message::error( - __('Invalid parameter for CSV import: %s') - ); - $message->addParam(__('Columns terminated with'), false); - $error = true; - $param_error = true; - // The default dialog of MS Excel when generating a CSV produces a - // semi-colon-separated file with no chance of specifying the - // enclosing character. Thus, users who want to import this file - // tend to remove the enclosing character on the Import dialog. - // I could not find a test case where having no enclosing characters - // confuses this script. - // But the parser won't work correctly with strings so we allow just - // one character. - } elseif (mb_strlen($csv_enclosed) > 1) { - $message = PMA\libraries\Message::error( - __('Invalid parameter for CSV import: %s') - ); - $message->addParam(__('Columns enclosed with'), false); - $error = true; - $param_error = true; - // I could not find a test case where having no escaping characters - // confuses this script. - // But the parser won't work correctly with strings so we allow just - // one character. - } elseif (mb_strlen($csv_escaped) > 1) { - $message = PMA\libraries\Message::error( - __('Invalid parameter for CSV import: %s') - ); - $message->addParam(__('Columns escaped with'), false); - $error = true; - $param_error = true; - } elseif (mb_strlen($csv_new_line) != 1 - && $csv_new_line != 'auto' - ) { - $message = PMA\libraries\Message::error( - __('Invalid parameter for CSV import: %s') - ); - $message->addParam(__('Lines terminated with'), false); - $error = true; - $param_error = true; - } - - // If there is an error in the parameters entered, - // indicate that immediately. - if ($param_error) { - PMA\libraries\Util::mysqlDie( - $message->getMessage(), - '', - false, - $err_url - ); - } - - $buffer = ''; - $required_fields = 0; - - if (!$this->_getAnalyze()) { - $sql_template = 'INSERT'; - if (isset($_POST['csv_ignore'])) { - $sql_template .= ' IGNORE'; - } - $sql_template .= ' INTO ' . PMA\libraries\Util::backquote($table); - - $tmp_fields = $GLOBALS['dbi']->getColumns($db, $table); - - if (empty($csv_columns)) { - $fields = $tmp_fields; - } else { - $sql_template .= ' ('; - $fields = array(); - $tmp = preg_split('/,( ?)/', $csv_columns); - foreach ($tmp as $key => $val) { - if (count($fields) > 0) { - $sql_template .= ', '; - } - /* Trim also `, if user already included backquoted fields */ - $val = trim($val, " \t\r\n\0\x0B`"); - $found = false; - foreach ($tmp_fields as $field) { - if ($field['Field'] == $val) { - $found = true; - break; - } - } - if (!$found) { - $message = PMA\libraries\Message::error( - __( - 'Invalid column (%s) specified! Ensure that columns' - . ' names are spelled correctly, separated by commas' - . ', and not enclosed in quotes.' - ) - ); - $message->addParam($val); - $error = true; - break; - } - $fields[] = $field; - $sql_template .= PMA\libraries\Util::backquote($val); - } - $sql_template .= ') '; - } - - $required_fields = count($fields); - - $sql_template .= ' VALUES ('; - } - - // Defaults for parser - $i = 0; - $len = 0; - $lastlen = null; - $line = 1; - $lasti = -1; - $values = array(); - $csv_finish = false; - - $tempRow = array(); - $rows = array(); - $col_names = array(); - $tables = array(); - - $col_count = 0; - $max_cols = 0; - $csv_terminated_len = mb_strlen($csv_terminated); - while (!($finished && $i >= $len) && !$error && !$timeout_passed) { - $data = PMA_importGetNextChunk(); - if ($data === false) { - // subtract data we didn't handle yet and stop processing - $GLOBALS['offset'] -= strlen($buffer); - break; - } elseif ($data === true) { - // Handle rest of buffer - } else { - // Append new data to buffer - $buffer .= $data; - unset($data); - - // Force a trailing new line at EOF to prevent parsing problems - if ($finished && $buffer) { - $finalch = mb_substr($buffer, -1); - if ($csv_new_line == 'auto' - && $finalch != "\r" - && $finalch != "\n" - ) { - $buffer .= "\n"; - } elseif ($csv_new_line != 'auto' - && $finalch != $csv_new_line - ) { - $buffer .= $csv_new_line; - } - } - - // Do not parse string when we're not at the end - // and don't have new line inside - if (($csv_new_line == 'auto' - && mb_strpos($buffer, "\r") === false - && mb_strpos($buffer, "\n") === false) - || ($csv_new_line != 'auto' - && mb_strpos($buffer, $csv_new_line) === false) - ) { - continue; - } - } - - // Current length of our buffer - $len = mb_strlen($buffer); - // Currently parsed char - - $ch = mb_substr($buffer, $i, 1); - if ($csv_terminated_len > 1 && $ch == $csv_terminated[0]) { - $ch = $this->readCsvTerminatedString( - $buffer, - $ch, - $i, - $csv_terminated_len - ); - $i += $csv_terminated_len - 1; - } - while ($i < $len) { - // Deadlock protection - if ($lasti == $i && $lastlen == $len) { - $message = PMA\libraries\Message::error( - __('Invalid format of CSV input on line %d.') - ); - $message->addParam($line); - $error = true; - break; - } - $lasti = $i; - $lastlen = $len; - - // This can happen with auto EOL and \r at the end of buffer - if (!$csv_finish) { - // Grab empty field - if ($ch == $csv_terminated) { - if ($i == $len - 1) { - break; - } - $values[] = ''; - $i++; - $ch = mb_substr($buffer, $i, 1); - if ($csv_terminated_len > 1 && $ch == $csv_terminated[0]) { - $ch = $this->readCsvTerminatedString( - $buffer, - $ch, - $i, - $csv_terminated_len - ); - $i += $csv_terminated_len - 1; - } - continue; - } - - // Grab one field - $fallbacki = $i; - if ($ch == $csv_enclosed) { - if ($i == $len - 1) { - break; - } - $need_end = true; - $i++; - $ch = mb_substr($buffer, $i, 1); - if ($csv_terminated_len > 1 && $ch == $csv_terminated[0]) { - $ch = $this->readCsvTerminatedString( - $buffer, - $ch, - $i, - $csv_terminated_len - ); - $i += $csv_terminated_len - 1; - } - } else { - $need_end = false; - } - $fail = false; - $value = ''; - while (($need_end - && ($ch != $csv_enclosed - || $csv_enclosed == $csv_escaped)) - || (!$need_end - && !($ch == $csv_terminated - || $ch == $csv_new_line - || ($csv_new_line == 'auto' - && ($ch == "\r" || $ch == "\n")))) - ) { - if ($ch == $csv_escaped) { - if ($i == $len - 1) { - $fail = true; - break; - } - $i++; - $ch = mb_substr($buffer, $i, 1); - if ($csv_terminated_len > 1 - && $ch == $csv_terminated[0] - ) { - $ch = $this->readCsvTerminatedString( - $buffer, - $ch, - $i, - $csv_terminated_len - ); - $i += $csv_terminated_len - 1; - } - if ($csv_enclosed == $csv_escaped - && ($ch == $csv_terminated - || $ch == $csv_new_line - || ($csv_new_line == 'auto' - && ($ch == "\r" || $ch == "\n"))) - ) { - break; - } - } - $value .= $ch; - if ($i == $len - 1) { - if (!$finished) { - $fail = true; - } - break; - } - $i++; - $ch = mb_substr($buffer, $i, 1); - if ($csv_terminated_len > 1 && $ch == $csv_terminated[0]) { - $ch = $this->readCsvTerminatedString( - $buffer, - $ch, - $i, - $csv_terminated_len - ); - $i += $csv_terminated_len - 1; - } - } - - // unquoted NULL string - if (false === $need_end && $value === 'NULL') { - $value = null; - } - - if ($fail) { - $i = $fallbacki; - $ch = mb_substr($buffer, $i, 1); - if ($csv_terminated_len > 1 && $ch == $csv_terminated[0]) { - $i += $csv_terminated_len - 1; - } - break; - } - // Need to strip trailing enclosing char? - if ($need_end && $ch == $csv_enclosed) { - if ($finished && $i == $len - 1) { - $ch = null; - } elseif ($i == $len - 1) { - $i = $fallbacki; - $ch = mb_substr($buffer, $i, 1); - if ($csv_terminated_len > 1 - && $ch == $csv_terminated[0] - ) { - $i += $csv_terminated_len - 1; - } - break; - } else { - $i++; - $ch = mb_substr($buffer, $i, 1); - if ($csv_terminated_len > 1 - && $ch == $csv_terminated[0] - ) { - $ch = $this->readCsvTerminatedString( - $buffer, - $ch, - $i, - $csv_terminated_len - ); - $i += $csv_terminated_len - 1; - } - } - } - // Are we at the end? - if ($ch == $csv_new_line - || ($csv_new_line == 'auto' && ($ch == "\r" || $ch == "\n")) - || ($finished && $i == $len - 1) - ) { - $csv_finish = true; - } - // Go to next char - if ($ch == $csv_terminated) { - if ($i == $len - 1) { - $i = $fallbacki; - $ch = mb_substr($buffer, $i, 1); - if ($csv_terminated_len > 1 - && $ch == $csv_terminated[0] - ) { - $i += $csv_terminated_len - 1; - } - break; - } - $i++; - $ch = mb_substr($buffer, $i, 1); - if ($csv_terminated_len > 1 - && $ch == $csv_terminated[0] - ) { - $ch = $this->readCsvTerminatedString( - $buffer, - $ch, - $i, - $csv_terminated_len - ); - $i += $csv_terminated_len - 1; - } - } - // If everything went okay, store value - $values[] = $value; - } - - // End of line - if ($csv_finish - || $ch == $csv_new_line - || ($csv_new_line == 'auto' && ($ch == "\r" || $ch == "\n")) - ) { - if ($csv_new_line == 'auto' && $ch == "\r") { // Handle "\r\n" - if ($i >= ($len - 2) && !$finished) { - break; // We need more data to decide new line - } - if (mb_substr($buffer, $i + 1, 1) == "\n") { - $i++; - } - } - // We didn't parse value till the end of line, so there was - // empty one - if (!$csv_finish) { - $values[] = ''; - } - - if ($this->_getAnalyze()) { - foreach ($values as $val) { - $tempRow[] = $val; - ++$col_count; - } - - if ($col_count > $max_cols) { - $max_cols = $col_count; - } - $col_count = 0; - - $rows[] = $tempRow; - $tempRow = array(); - } else { - // Do we have correct count of values? - if (count($values) != $required_fields) { - - // Hack for excel - if ($values[count($values) - 1] == ';') { - unset($values[count($values) - 1]); - } else { - $message = PMA\libraries\Message::error( - __( - 'Invalid column count in CSV input' - . ' on line %d.' - ) - ); - $message->addParam($line); - $error = true; - break; - } - } - - $first = true; - $sql = $sql_template; - foreach ($values as $key => $val) { - if (!$first) { - $sql .= ', '; - } - if ($val === null) { - $sql .= 'NULL'; - } else { - $sql .= '\'' - . $GLOBALS['dbi']->escapeString($val) - . '\''; - } - - $first = false; - } - $sql .= ')'; - if (isset($_POST['csv_replace'])) { - $sql .= " ON DUPLICATE KEY UPDATE "; - foreach ($fields as $field) { - $fieldName = PMA\libraries\Util::backquote( - $field['Field'] - ); - $sql .= $fieldName . " = VALUES(" . $fieldName - . "), "; - } - $sql = rtrim($sql, ', '); - } - - /** - * @todo maybe we could add original line to verbose - * SQL in comment - */ - PMA_importRunQuery($sql, $sql, $sql_data); - } - - $line++; - $csv_finish = false; - $values = array(); - $buffer = mb_substr($buffer, $i + 1); - $len = mb_strlen($buffer); - $i = 0; - $lasti = -1; - $ch = mb_substr($buffer, 0, 1); - } - } // End of parser loop - } // End of import loop - - if ($this->_getAnalyze()) { - /* Fill out all rows */ - $num_rows = count($rows); - for ($i = 0; $i < $num_rows; ++$i) { - for ($j = count($rows[$i]); $j < $max_cols; ++$j) { - $rows[$i][] = 'NULL'; - } - } - - if (isset($_REQUEST['csv_col_names'])) { - $col_names = array_splice($rows, 0, 1); - $col_names = $col_names[0]; - // MySQL column names can't end with a space character. - foreach ($col_names as $key => $col_name) { - $col_names[$key] = rtrim($col_name); - } - } - - if ((isset($col_names) && count($col_names) != $max_cols) - || !isset($col_names) - ) { - // Fill out column names - for ($i = 0; $i < $max_cols; ++$i) { - $col_names[] = 'COL ' . ($i + 1); - } - } - - if (mb_strlen($db)) { - $result = $GLOBALS['dbi']->fetchResult('SHOW TABLES'); - $tbl_name = 'TABLE ' . (count($result) + 1); - } else { - $tbl_name = 'TBL_NAME'; - } - - $tables[] = array($tbl_name, $col_names, $rows); - - /* Obtain the best-fit MySQL types for each column */ - $analyses = array(); - $analyses[] = PMA_analyzeTable($tables[0]); - - /** - * string $db_name (no backquotes) - * - * array $table = array(table_name, array() column_names, array()() rows) - * array $tables = array of "$table"s - * - * array $analysis = array(array() column_types, array() column_sizes) - * array $analyses = array of "$analysis"s - * - * array $create = array of SQL strings - * - * array $options = an associative array of options - */ - - /* Set database name to the currently selected one, if applicable */ - list($db_name, $options) = $this->getDbnameAndOptions($db, 'CSV_DB'); - - /* Non-applicable parameters */ - $create = null; - - /* Created and execute necessary SQL statements from data */ - PMA_buildSQL($db_name, $tables, $analyses, $create, $options, $sql_data); - - unset($tables); - unset($analyses); - } - - // Commit any possible data in buffers - PMA_importRunQuery('', '', $sql_data); - - if (count($values) != 0 && !$error) { - $message = PMA\libraries\Message::error( - __('Invalid format of CSV input on line %d.') - ); - $message->addParam($line); - $error = true; - } - } - - /** - * Read the expected column_separated_with String of length - * $csv_terminated_len from the $buffer - * into variable $ch and return the read string $ch - * - * @param string $buffer The original string buffer read from - * csv file - * @param string $ch Partially read "column Separated with" - * string, also used to return after - * reading length equal $csv_terminated_len - * @param int $i Current read counter of buffer string - * @param int $csv_terminated_len The length of "column separated with" - * String - * - * @return string - */ - public function readCsvTerminatedString($buffer, $ch, $i, $csv_terminated_len) - { - for ($j = 0; $j < $csv_terminated_len - 1; $j++) { - $i++; - $ch .= mb_substr($buffer, $i, 1); - } - - return $ch; - } - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Returns true if the table should be analyzed, false otherwise - * - * @return bool - */ - private function _getAnalyze() - { - return $this->_analyze; - } - - /** - * Sets to true if the table should be analyzed, false otherwise - * - * @param bool $analyze status - * - * @return void - */ - private function _setAnalyze($analyze) - { - $this->_analyze = $analyze; - } -} diff --git a/#pma/libraries/plugins/import/ImportLdi.php b/#pma/libraries/plugins/import/ImportLdi.php deleted file mode 100644 index c1d8540e..00000000 --- a/#pma/libraries/plugins/import/ImportLdi.php +++ /dev/null @@ -1,173 +0,0 @@ -setProperties(); - } - - /** - * Sets the import plugin properties. - * Called in the constructor. - * - * @return void - */ - protected function setProperties() - { - if ($GLOBALS['cfg']['Import']['ldi_local_option'] == 'auto') { - $GLOBALS['cfg']['Import']['ldi_local_option'] = false; - - $result = $GLOBALS['dbi']->tryQuery( - 'SELECT @@local_infile;' - ); - if ($result != false && $GLOBALS['dbi']->numRows($result) > 0) { - $tmp = $GLOBALS['dbi']->fetchRow($result); - if ($tmp[0] == 'ON') { - $GLOBALS['cfg']['Import']['ldi_local_option'] = true; - } - } - $GLOBALS['dbi']->freeResult($result); - unset($result); - } - - $generalOptions = parent::setProperties(); - $this->properties->setText('CSV using LOAD DATA'); - $this->properties->setExtension('ldi'); - - $leaf = new TextPropertyItem( - "columns", - __('Column names: ') - ); - $generalOptions->addProperty($leaf); - - $leaf = new BoolPropertyItem( - "ignore", - __('Do not abort on INSERT error') - ); - $generalOptions->addProperty($leaf); - - $leaf = new BoolPropertyItem( - "local_option", - __('Use LOCAL keyword') - ); - $generalOptions->addProperty($leaf); - } - - /** - * Handles the whole import logic - * - * @param array &$sql_data 2-element array with sql data - * - * @return void - */ - public function doImport(&$sql_data = array()) - { - global $finished, $import_file, $compression, $charset_conversion, $table; - global $ldi_local_option, $ldi_replace, $ldi_ignore, $ldi_terminated, - $ldi_enclosed, $ldi_escaped, $ldi_new_line, $skip_queries, $ldi_columns; - - if ($import_file == 'none' - || $compression != 'none' - || $charset_conversion - ) { - // We handle only some kind of data! - $GLOBALS['message'] = PMA\libraries\Message::error( - __('This plugin does not support compressed imports!') - ); - $GLOBALS['error'] = true; - - return; - } - - $sql = 'LOAD DATA'; - if (isset($ldi_local_option)) { - $sql .= ' LOCAL'; - } - $sql .= ' INFILE \'' . $GLOBALS['dbi']->escapeString($import_file) - . '\''; - if (isset($ldi_replace)) { - $sql .= ' REPLACE'; - } elseif (isset($ldi_ignore)) { - $sql .= ' IGNORE'; - } - $sql .= ' INTO TABLE ' . PMA\libraries\Util::backquote($table); - - if (strlen($ldi_terminated) > 0) { - $sql .= ' FIELDS TERMINATED BY \'' . $ldi_terminated . '\''; - } - if (strlen($ldi_enclosed) > 0) { - $sql .= ' ENCLOSED BY \'' - . $GLOBALS['dbi']->escapeString($ldi_enclosed) . '\''; - } - if (strlen($ldi_escaped) > 0) { - $sql .= ' ESCAPED BY \'' - . $GLOBALS['dbi']->escapeString($ldi_escaped) . '\''; - } - if (strlen($ldi_new_line) > 0) { - if ($ldi_new_line == 'auto') { - $ldi_new_line - = (PMA\libraries\Util::whichCrlf() == "\n") - ? '\n' - : '\r\n'; - } - $sql .= ' LINES TERMINATED BY \'' . $ldi_new_line . '\''; - } - if ($skip_queries > 0) { - $sql .= ' IGNORE ' . $skip_queries . ' LINES'; - $skip_queries = 0; - } - if (strlen($ldi_columns) > 0) { - $sql .= ' ('; - $tmp = preg_split('/,( ?)/', $ldi_columns); - $cnt_tmp = count($tmp); - for ($i = 0; $i < $cnt_tmp; $i++) { - if ($i > 0) { - $sql .= ', '; - } - /* Trim also `, if user already included backquoted fields */ - $sql .= PMA\libraries\Util::backquote( - trim($tmp[$i], " \t\r\n\0\x0B`") - ); - } // end for - $sql .= ')'; - } - - PMA_importRunQuery($sql, $sql, $sql_data); - PMA_importRunQuery('', '', $sql_data); - $finished = true; - } -} diff --git a/#pma/libraries/plugins/import/ImportMediawiki.php b/#pma/libraries/plugins/import/ImportMediawiki.php deleted file mode 100644 index fce1c868..00000000 --- a/#pma/libraries/plugins/import/ImportMediawiki.php +++ /dev/null @@ -1,598 +0,0 @@ -setProperties(); - } - - /** - * Sets the import plugin properties. - * Called in the constructor. - * - * @return void - */ - protected function setProperties() - { - $this->_setAnalyze(false); - if ($GLOBALS['plugin_param'] !== 'table') { - $this->_setAnalyze(true); - } - - $importPluginProperties = new ImportPluginProperties(); - $importPluginProperties->setText(__('MediaWiki Table')); - $importPluginProperties->setExtension('txt'); - $importPluginProperties->setMimeType('text/plain'); - $importPluginProperties->setOptions(array()); - $importPluginProperties->setOptionsText(__('Options')); - - $this->properties = $importPluginProperties; - } - - /** - * Handles the whole import logic - * - * @param array &$sql_data 2-element array with sql data - * - * @return void - */ - public function doImport(&$sql_data = array()) - { - global $error, $timeout_passed, $finished; - - // Defaults for parser - - // The buffer that will be used to store chunks read from the imported file - $buffer = ''; - - // Used as storage for the last part of the current chunk data - // Will be appended to the first line of the next chunk, if there is one - $last_chunk_line = ''; - - // Remembers whether the current buffer line is part of a comment - $inside_comment = false; - // Remembers whether the current buffer line is part of a data comment - $inside_data_comment = false; - // Remembers whether the current buffer line is part of a structure comment - $inside_structure_comment = false; - - // MediaWiki only accepts "\n" as row terminator - $mediawiki_new_line = "\n"; - - // Initialize the name of the current table - $cur_table_name = ""; - - while (!$finished && !$error && !$timeout_passed) { - $data = PMA_importGetNextChunk(); - - if ($data === false) { - // Subtract data we didn't handle yet and stop processing - $GLOBALS['offset'] -= mb_strlen($buffer); - break; - } elseif ($data === true) { - // Handle rest of buffer - } else { - // Append new data to buffer - $buffer = $data; - unset($data); - // Don't parse string if we're not at the end - // and don't have a new line inside - if (mb_strpos($buffer, $mediawiki_new_line) === false) { - continue; - } - } - - // Because of reading chunk by chunk, the first line from the buffer - // contains only a portion of an actual line from the imported file. - // Therefore, we have to append it to the last line from the previous - // chunk. If we are at the first chunk, $last_chunk_line should be empty. - $buffer = $last_chunk_line . $buffer; - - // Process the buffer line by line - $buffer_lines = explode($mediawiki_new_line, $buffer); - - $full_buffer_lines_count = count($buffer_lines); - // If the reading is not finalised, the final line of the current chunk - // will not be complete - if (! $finished) { - $last_chunk_line = $buffer_lines[--$full_buffer_lines_count]; - } - - for ($line_nr = 0; $line_nr < $full_buffer_lines_count; ++$line_nr) { - $cur_buffer_line = trim($buffer_lines[$line_nr]); - - // If the line is empty, go to the next one - if ($cur_buffer_line === '') { - continue; - } - - $first_character = $cur_buffer_line[0]; - $matches = array(); - - // Check beginning of comment - if (!strcmp(mb_substr($cur_buffer_line, 0, 4), "") - ) { - // Only data comments are closed. The structure comments - // will be closed when a data comment begins (in order to - // skip structure tables) - if ($inside_data_comment) { - $inside_data_comment = false; - } - - // End comments that are not related to table structure - if (!$inside_structure_comment) { - $inside_comment = false; - } - } else { - // Check table name - $match_table_name = array(); - if (preg_match( - "/^Table data for `(.*)`$/", - $cur_buffer_line, - $match_table_name - ) - ) { - $cur_table_name = $match_table_name[1]; - $inside_data_comment = true; - - $inside_structure_comment - = $this->_mngInsideStructComm( - $inside_structure_comment - ); - } elseif (preg_match( - "/^Table structure for `(.*)`$/", - $cur_buffer_line, - $match_table_name - ) - ) { - // The structure comments will be ignored - $inside_structure_comment = true; - } - } - continue; - } elseif (preg_match('/^\{\|(.*)$/', $cur_buffer_line, $matches)) { - // Check start of table - - // This will store all the column info on all rows from - // the current table read from the buffer - $cur_temp_table = array(); - - // Will be used as storage for the current row in the buffer - // Once all its columns are read, it will be added to - // $cur_temp_table and then it will be emptied - $cur_temp_line = array(); - - // Helps us differentiate the header columns - // from the normal columns - $in_table_header = false; - // End processing because the current line does not - // contain any column information - } elseif (mb_substr($cur_buffer_line, 0, 2) === '|-' - || mb_substr($cur_buffer_line, 0, 2) === '|+' - || mb_substr($cur_buffer_line, 0, 2) === '|}' - ) { - // Check begin row or end table - - // Add current line to the values storage - if (!empty($cur_temp_line)) { - // If the current line contains header cells - // ( marked with '!' ), - // it will be marked as table header - if ($in_table_header) { - // Set the header columns - $cur_temp_table_headers = $cur_temp_line; - } else { - // Normal line, add it to the table - $cur_temp_table [] = $cur_temp_line; - } - } - - // Empty the temporary buffer - $cur_temp_line = array(); - - // No more processing required at the end of the table - if (mb_substr($cur_buffer_line, 0, 2) === '|}') { - $current_table = array( - $cur_table_name, - $cur_temp_table_headers, - $cur_temp_table, - ); - - // Import the current table data into the database - $this->_importDataOneTable($current_table, $sql_data); - - // Reset table name - $cur_table_name = ""; - } - // What's after the row tag is now only attributes - - } elseif (($first_character === '|') || ($first_character === '!')) { - // Check cell elements - - // Header cells - if ($first_character === '!') { - // Mark as table header, but treat as normal row - $cur_buffer_line = str_replace('!!', '||', $cur_buffer_line); - // Will be used to set $cur_temp_line as table header - $in_table_header = true; - } else { - $in_table_header = false; - } - - // Loop through each table cell - $cells = $this->_explodeMarkup($cur_buffer_line); - foreach ($cells as $cell) { - $cell = $this->_getCellData($cell); - - // Delete the beginning of the column, if there is one - $cell = trim($cell); - $col_start_chars = array("|", "!"); - foreach ($col_start_chars as $col_start_char) { - $cell = $this->_getCellContent($cell, $col_start_char); - } - - // Add the cell to the row - $cur_temp_line [] = $cell; - } // foreach $cells - } else { - // If it's none of the above, then the current line has a bad - // format - $message = PMA\libraries\Message::error( - __('Invalid format of mediawiki input on line:
    %s.') - ); - $message->addParam($cur_buffer_line); - $error = true; - } - } // End treating full buffer lines - } // while - finished parsing buffer - } - - /** - * Imports data from a single table - * - * @param array $table containing all table info: - * - * $table[0] - string containing table name - * $table[1] - array[] of table headers - * $table[2] - array[][] of table content rows - * - * - * @param array &$sql_data 2-element array with sql data - * - * @global bool $analyze whether to scan for column types - * - * @return void - */ - private function _importDataOneTable($table, &$sql_data) - { - $analyze = $this->_getAnalyze(); - if ($analyze) { - // Set the table name - $this->_setTableName($table[0]); - - // Set generic names for table headers if they don't exist - $this->_setTableHeaders($table[1], $table[2][0]); - - // Create the tables array to be used in PMA_buildSQL() - $tables = array(); - $tables [] = array($table[0], $table[1], $table[2]); - - // Obtain the best-fit MySQL types for each column - $analyses = array(); - $analyses [] = PMA_analyzeTable($tables[0]); - - $this->_executeImportTables($tables, $analyses, $sql_data); - } - - // Commit any possible data in buffers - PMA_importRunQuery('', '', $sql_data); - } - - /** - * Sets the table name - * - * @param string &$table_name reference to the name of the table - * - * @return void - */ - private function _setTableName(&$table_name) - { - if (empty($table_name)) { - $result = $GLOBALS['dbi']->fetchResult('SHOW TABLES'); - // todo check if the name below already exists - $table_name = 'TABLE ' . (count($result) + 1); - } - } - - /** - * Set generic names for table headers, if they don't exist - * - * @param array &$table_headers reference to the array containing the headers - * of a table - * @param array $table_row array containing the first content row - * - * @return void - */ - private function _setTableHeaders(&$table_headers, $table_row) - { - if (empty($table_headers)) { - // The first table row should contain the number of columns - // If they are not set, generic names will be given (COL 1, COL 2, etc) - $num_cols = count($table_row); - for ($i = 0; $i < $num_cols; ++$i) { - $table_headers [$i] = 'COL ' . ($i + 1); - } - } - } - - /** - * Sets the database name and additional options and calls PMA_buildSQL() - * Used in PMA_importDataAllTables() and $this->_importDataOneTable() - * - * @param array &$tables structure: - * array( - * array(table_name, array() column_names, array()() - * rows) - * ) - * @param array &$analyses structure: - * $analyses = array( - * array(array() column_types, array() column_sizes) - * ) - * @param array &$sql_data 2-element array with sql data - * - * @global string $db name of the database to import in - * - * @return void - */ - private function _executeImportTables(&$tables, &$analyses, &$sql_data) - { - global $db; - - // $db_name : The currently selected database name, if applicable - // No backquotes - // $options : An associative array of options - list($db_name, $options) = $this->getDbnameAndOptions($db, 'mediawiki_DB'); - - // Array of SQL strings - // Non-applicable parameters - $create = null; - - // Create and execute necessary SQL statements from data - PMA_buildSQL($db_name, $tables, $analyses, $create, $options, $sql_data); - - unset($tables); - unset($analyses); - } - - /** - * Replaces all instances of the '||' separator between delimiters - * in a given string - * - * @param string $replace the string to be replaced with - * @param string $subject the text to be replaced - * - * @return string with replacements - */ - private function _delimiterReplace($replace, $subject) - { - // String that will be returned - $cleaned = ""; - // Possible states of current character - $inside_tag = false; - $inside_attribute = false; - // Attributes can be declared with either " or ' - $start_attribute_character = false; - - // The full separator is "||"; - // This remembers if the previous character was '|' - $partial_separator = false; - - // Parse text char by char - for ($i = 0; $i < strlen($subject); $i++) { - $cur_char = $subject[$i]; - // Check for separators - if ($cur_char == '|') { - // If we're not inside a tag, then this is part of a real separator, - // so we append it to the current segment - if (!$inside_attribute) { - $cleaned .= $cur_char; - if ($partial_separator) { - $inside_tag = false; - $inside_attribute = false; - } - } elseif ($partial_separator) { - // If we are inside a tag, we replace the current char with - // the placeholder and append that to the current segment - $cleaned .= $replace; - } - - // If the previous character was also '|', then this ends a - // full separator. If not, this may be the beginning of one - $partial_separator = !$partial_separator; - } else { - // If we're inside a tag attribute and the current character is - // not '|', but the previous one was, it means that the single '|' - // was not appended, so we append it now - if ($partial_separator && $inside_attribute) { - $cleaned .= "|"; - } - // If the char is different from "|", no separator can be formed - $partial_separator = false; - - // any other character should be appended to the current segment - $cleaned .= $cur_char; - - if ($cur_char == '<' && !$inside_attribute) { - // start of a tag - $inside_tag = true; - } elseif ($cur_char == '>' && !$inside_attribute) { - // end of a tag - $inside_tag = false; - } elseif (($cur_char == '"' || $cur_char == "'") && $inside_tag) { - // start or end of an attribute - if (!$inside_attribute) { - $inside_attribute = true; - // remember the attribute`s declaration character (" or ') - $start_attribute_character = $cur_char; - } else { - if ($cur_char == $start_attribute_character) { - $inside_attribute = false; - // unset attribute declaration character - $start_attribute_character = false; - } - } - } - } - } // end for each character in $subject - - return $cleaned; - } - - /** - * Separates a string into items, similarly to explode - * Uses the '||' separator (which is standard in the mediawiki format) - * and ignores any instances of it inside markup tags - * Used in parsing buffer lines containing data cells - * - * @param string $text text to be split - * - * @return array - */ - private function _explodeMarkup($text) - { - $separator = "||"; - $placeholder = "\x00"; - - // Remove placeholder instances - $text = str_replace($placeholder, '', $text); - - // Replace instances of the separator inside HTML-like - // tags with the placeholder - $cleaned = $this->_delimiterReplace($placeholder, $text); - // Explode, then put the replaced separators back in - $items = explode($separator, $cleaned); - foreach ($items as $i => $str) { - $items[$i] = str_replace($placeholder, $separator, $str); - } - - return $items; - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Returns true if the table should be analyzed, false otherwise - * - * @return bool - */ - private function _getAnalyze() - { - return $this->_analyze; - } - - /** - * Sets to true if the table should be analyzed, false otherwise - * - * @param bool $analyze status - * - * @return void - */ - private function _setAnalyze($analyze) - { - $this->_analyze = $analyze; - } - - /** - * Get cell - * - * @param string $cell Cell - * - * @return mixed - */ - private function _getCellData($cell) - { - // A cell could contain both parameters and data - $cell_data = explode('|', $cell, 2); - - // A '|' inside an invalid link should not - // be mistaken as delimiting cell parameters - if (mb_strpos($cell_data[0], '[[') === false) { - return $cell; - } - - if (count($cell_data) == 1) { - return $cell_data[0]; - } - - return $cell_data[1]; - } - - /** - * Manage $inside_structure_comment - * - * @param boolean $inside_structure_comment Value to test - * - * @return bool - */ - private function _mngInsideStructComm($inside_structure_comment) - { - // End ignoring structure rows - if ($inside_structure_comment) { - $inside_structure_comment = false; - } - - return $inside_structure_comment; - } - - /** - * Get cell content - * - * @param string $cell Cell - * @param string $col_start_char Start char - * - * @return string - */ - private function _getCellContent($cell, $col_start_char) - { - if (mb_strpos($cell, $col_start_char) === 0) { - $cell = trim(mb_substr($cell, 1)); - } - - return $cell; - } -} diff --git a/#pma/libraries/plugins/import/ImportOds.php b/#pma/libraries/plugins/import/ImportOds.php deleted file mode 100644 index 7e06ae5d..00000000 --- a/#pma/libraries/plugins/import/ImportOds.php +++ /dev/null @@ -1,430 +0,0 @@ -setProperties(); - } - - /** - * Sets the import plugin properties. - * Called in the constructor. - * - * @return void - */ - protected function setProperties() - { - $importPluginProperties = new ImportPluginProperties(); - $importPluginProperties->setText('OpenDocument Spreadsheet'); - $importPluginProperties->setExtension('ods'); - $importPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $importPluginProperties - // this will be shown as "Format specific options" - $importSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new BoolPropertyItem( - "col_names", - __( - 'The first line of the file contains the table column names' - . ' (if this is unchecked, the first line will become part' - . ' of the data)' - ) - ); - $generalOptions->addProperty($leaf); - $leaf = new BoolPropertyItem( - "empty_rows", - __('Do not import empty rows') - ); - $generalOptions->addProperty($leaf); - $leaf = new BoolPropertyItem( - "recognize_percentages", - __( - 'Import percentages as proper decimals (ex. 12.00% to .12)' - ) - ); - $generalOptions->addProperty($leaf); - $leaf = new BoolPropertyItem( - "recognize_currency", - __('Import currencies (ex. $5.00 to 5.00)') - ); - $generalOptions->addProperty($leaf); - - // add the main group to the root group - $importSpecificOptions->addProperty($generalOptions); - - // set the options for the import plugin property item - $importPluginProperties->setOptions($importSpecificOptions); - $this->properties = $importPluginProperties; - } - - /** - * Handles the whole import logic - * - * @param array &$sql_data 2-element array with sql data - * - * @return void - */ - public function doImport(&$sql_data = array()) - { - global $db, $error, $timeout_passed, $finished; - - $i = 0; - $len = 0; - $buffer = ""; - - /** - * Read in the file via PMA_importGetNextChunk so that - * it can process compressed files - */ - while (!($finished && $i >= $len) && !$error && !$timeout_passed) { - $data = PMA_importGetNextChunk(); - if ($data === false) { - /* subtract data we didn't handle yet and stop processing */ - $GLOBALS['offset'] -= strlen($buffer); - break; - } elseif ($data === true) { - /* Handle rest of buffer */ - } else { - /* Append new data to buffer */ - $buffer .= $data; - unset($data); - } - } - - unset($data); - - /** - * Disable loading of external XML entities. - */ - libxml_disable_entity_loader(); - - /** - * Load the XML string - * - * The option LIBXML_COMPACT is specified because it can - * result in increased performance without the need to - * alter the code in any way. It's basically a freebee. - */ - $xml = @simplexml_load_string($buffer, "SimpleXMLElement", LIBXML_COMPACT); - - unset($buffer); - - if ($xml === false) { - $sheets = array(); - $GLOBALS['message'] = PMA\libraries\Message::error( - __( - 'The XML file specified was either malformed or incomplete.' - . ' Please correct the issue and try again.' - ) - ); - $GLOBALS['error'] = true; - } else { - /** @var SimpleXMLElement $root */ - $root = $xml->children('office', true)->{'body'}->{'spreadsheet'}; - if (empty($root)) { - $sheets = array(); - $GLOBALS['message'] = PMA\libraries\Message::error( - __('Could not parse OpenDocument Spreadsheet!') - ); - $GLOBALS['error'] = true; - } else { - $sheets = $root->children('table', true); - } - } - - $tables = array(); - - $max_cols = 0; - - $col_count = 0; - $col_names = array(); - - $tempRow = array(); - $tempRows = array(); - $rows = array(); - - /* Iterate over tables */ - /** @var SimpleXMLElement $sheet */ - foreach ($sheets as $sheet) { - $col_names_in_first_row = isset($_REQUEST['ods_col_names']); - - /* Iterate over rows */ - /** @var SimpleXMLElement $row */ - foreach ($sheet as $row) { - $type = $row->getName(); - if (strcmp('table-row', $type)) { - continue; - } - /* Iterate over columns */ - $cellCount = count($row); - $a = 0; - /** @var SimpleXMLElement $cell */ - foreach ($row as $cell) { - $a++; - $text = $cell->children('text', true); - $cell_attrs = $cell->attributes('office', true); - - if (count($text) != 0) { - $attr = $cell->attributes('table', true); - $num_repeat = (int)$attr['number-columns-repeated']; - $num_iterations = $num_repeat ? $num_repeat : 1; - - for ($k = 0; $k < $num_iterations; $k++) { - $value = $this->getValue($cell_attrs, $text); - if (!$col_names_in_first_row) { - $tempRow[] = $value; - } else { - // MySQL column names can't end with a space - // character. - $col_names[] = rtrim($value); - } - - ++$col_count; - } - continue; - } - - // skip empty repeats in the last row - if ($a == $cellCount) { - continue; - } - - $attr = $cell->attributes('table', true); - $num_null = (int)$attr['number-columns-repeated']; - - if ($num_null) { - if (!$col_names_in_first_row) { - for ($i = 0; $i < $num_null; ++$i) { - $tempRow[] = 'NULL'; - ++$col_count; - } - } else { - for ($i = 0; $i < $num_null; ++$i) { - $col_names[] = PMA_getColumnAlphaName( - $col_count + 1 - ); - ++$col_count; - } - } - } else { - if (!$col_names_in_first_row) { - $tempRow[] = 'NULL'; - } else { - $col_names[] = PMA_getColumnAlphaName( - $col_count + 1 - ); - } - - ++$col_count; - } - } //Endforeach - - /* Find the widest row */ - if ($col_count > $max_cols) { - $max_cols = $col_count; - } - - /* Don't include a row that is full of NULL values */ - if (!$col_names_in_first_row) { - if ($_REQUEST['ods_empty_rows']) { - foreach ($tempRow as $cell) { - if (strcmp('NULL', $cell)) { - $tempRows[] = $tempRow; - break; - } - } - } else { - $tempRows[] = $tempRow; - } - } - - $col_count = 0; - $col_names_in_first_row = false; - $tempRow = array(); - } - - /* Skip over empty sheets */ - if (count($tempRows) == 0 || count($tempRows[0]) == 0) { - $col_names = array(); - $tempRow = array(); - $tempRows = array(); - continue; - } - - /** - * Fill out each row as necessary to make - * every one exactly as wide as the widest - * row. This included column names. - */ - - /* Fill out column names */ - for ($i = count($col_names); $i < $max_cols; ++$i) { - $col_names[] = PMA_getColumnAlphaName($i + 1); - } - - /* Fill out all rows */ - $num_rows = count($tempRows); - for ($i = 0; $i < $num_rows; ++$i) { - for ($j = count($tempRows[$i]); $j < $max_cols; ++$j) { - $tempRows[$i][] = 'NULL'; - } - } - - /* Store the table name so we know where to place the row set */ - $tbl_attr = $sheet->attributes('table', true); - $tables[] = array((string)$tbl_attr['name']); - - /* Store the current sheet in the accumulator */ - $rows[] = array((string)$tbl_attr['name'], $col_names, $tempRows); - $tempRows = array(); - $col_names = array(); - $max_cols = 0; - } - - unset($tempRow); - unset($tempRows); - unset($col_names); - unset($sheets); - unset($xml); - - /** - * Bring accumulated rows into the corresponding table - */ - $num_tables = count($tables); - for ($i = 0; $i < $num_tables; ++$i) { - $num_rows = count($rows); - for ($j = 0; $j < $num_rows; ++$j) { - if (strcmp($tables[$i][TBL_NAME], $rows[$j][TBL_NAME])) { - continue; - } - - if (!isset($tables[$i][COL_NAMES])) { - $tables[$i][] = $rows[$j][COL_NAMES]; - } - - $tables[$i][ROWS] = $rows[$j][ROWS]; - } - } - - /* No longer needed */ - unset($rows); - - /* Obtain the best-fit MySQL types for each column */ - $analyses = array(); - - $len = count($tables); - for ($i = 0; $i < $len; ++$i) { - $analyses[] = PMA_analyzeTable($tables[$i]); - } - - /** - * string $db_name (no backquotes) - * - * array $table = array(table_name, array() column_names, array()() rows) - * array $tables = array of "$table"s - * - * array $analysis = array(array() column_types, array() column_sizes) - * array $analyses = array of "$analysis"s - * - * array $create = array of SQL strings - * - * array $options = an associative array of options - */ - - /* Set database name to the currently selected one, if applicable */ - list($db_name, $options) = $this->getDbnameAndOptions($db, 'ODS_DB'); - - /* Non-applicable parameters */ - $create = null; - - /* Created and execute necessary SQL statements from data */ - PMA_buildSQL($db_name, $tables, $analyses, $create, $options, $sql_data); - - unset($tables); - unset($analyses); - - /* Commit any possible data in buffers */ - PMA_importRunQuery('', '', $sql_data); - } - - /** - * Get value - * - * @param array $cell_attrs Cell attributes - * @param array $text Texts - * - * @return float|string - */ - protected function getValue($cell_attrs, $text) - { - if ($_REQUEST['ods_recognize_percentages'] - && !strcmp( - 'percentage', - $cell_attrs['value-type'] - ) - ) { - $value = (double)$cell_attrs['value']; - - return $value; - } elseif ($_REQUEST['ods_recognize_currency'] - && !strcmp('currency', $cell_attrs['value-type']) - ) { - $value = (double)$cell_attrs['value']; - - return $value; - } else { - /* We need to concatenate all paragraphs */ - $values = array(); - foreach ($text as $paragraph) { - $values[] = (string)$paragraph; - } - $value = implode("\n", $values); - - return $value; - } - } -} diff --git a/#pma/libraries/plugins/import/ImportShp.php b/#pma/libraries/plugins/import/ImportShp.php deleted file mode 100644 index cdfe1a6c..00000000 --- a/#pma/libraries/plugins/import/ImportShp.php +++ /dev/null @@ -1,333 +0,0 @@ -setProperties(); - } - - /** - * Sets the import plugin properties. - * Called in the constructor. - * - * @return void - */ - protected function setProperties() - { - $importPluginProperties = new ImportPluginProperties(); - $importPluginProperties->setText(__('ESRI Shape File')); - $importPluginProperties->setExtension('shp'); - $importPluginProperties->setOptions(array()); - $importPluginProperties->setOptionsText(__('Options')); - - $this->properties = $importPluginProperties; - } - - /** - * Handles the whole import logic - * - * @param array &$sql_data 2-element array with sql data - * - * @return void - */ - public function doImport(&$sql_data = array()) - { - global $db, $error, $finished, $compression, - $import_file, $local_import_file, $message; - - $GLOBALS['finished'] = false; - - $shp = new ShapeFile(1); - // If the zip archive has more than one file, - // get the correct content to the buffer from .shp file. - if ($compression == 'application/zip' - && PMA_getNoOfFilesInZip($import_file) > 1 - ) { - $zip_content = PMA_getZipContents($import_file, '/^.*\.shp$/i'); - $GLOBALS['import_text'] = $zip_content['data']; - } - - $temp_dbf_file = false; - // We need dbase extension to handle .dbf file - if (extension_loaded('dbase')) { - // If we can extract the zip archive to 'TempDir' - // and use the files in it for import - if ($compression == 'application/zip' - && !empty($GLOBALS['cfg']['TempDir']) - && @is_writable($GLOBALS['cfg']['TempDir']) - ) { - $dbf_file_name = PMA_findFileFromZipArchive( - '/^.*\.dbf$/i', - $import_file - ); - // If the corresponding .dbf file is in the zip archive - if ($dbf_file_name) { - // Extract the .dbf file and point to it. - $extracted = PMA_zipExtract( - $import_file, - $dbf_file_name - ); - if ($extracted !== false) { - $dbf_file_path = realpath($GLOBALS['cfg']['TempDir']) - . (PMA_IS_WINDOWS ? '\\' : '/') - . PMA_sanitizeFilename($dbf_file_name, true); - $handle = fopen($dbf_file_path, 'wb'); - if ($handle !== false) { - fwrite($handle, $extracted); - fclose($handle); - $temp_dbf_file = true; - // Replace the .dbf with .*, as required - // by the bsShapeFiles library. - $file_name = substr( - $dbf_file_path, 0, strlen($dbf_file_path) - 4 - ) . '.*'; - $shp->FileName = $file_name; - } - } - } - } elseif (!empty($local_import_file) - && !empty($GLOBALS['cfg']['UploadDir']) - && $compression == 'none' - ) { - // If file is in UploadDir, use .dbf file in the same UploadDir - // to load extra data. - // Replace the .shp with .*, - // so the bsShapeFiles library correctly locates .dbf file. - $file_name = mb_substr( - $import_file, - 0, - mb_strlen($import_file) - 4 - ) . '.*'; - $shp->FileName = $file_name; - } - } - - // Delete the .dbf file extracted to 'TempDir' - if ($temp_dbf_file - && isset($dbf_file_path) - && file_exists($dbf_file_path) - ) { - unlink($dbf_file_path); - } - - // Load data - $shp->loadFromFile(''); - if ($shp->lastError != "") { - $error = true; - $message = PMA\libraries\Message::error( - __('There was an error importing the ESRI shape file: "%s".') - ); - $message->addParam($shp->lastError); - - return; - } - - $esri_types = array( - 0 => 'Null Shape', - 1 => 'Point', - 3 => 'PolyLine', - 5 => 'Polygon', - 8 => 'MultiPoint', - 11 => 'PointZ', - 13 => 'PolyLineZ', - 15 => 'PolygonZ', - 18 => 'MultiPointZ', - 21 => 'PointM', - 23 => 'PolyLineM', - 25 => 'PolygonM', - 28 => 'MultiPointM', - 31 => 'MultiPatch', - ); - - switch ($shp->shapeType) { - // ESRI Null Shape - case 0: - break; - // ESRI Point - case 1: - $gis_type = 'point'; - break; - // ESRI PolyLine - case 3: - $gis_type = 'multilinestring'; - break; - // ESRI Polygon - case 5: - $gis_type = 'multipolygon'; - break; - // ESRI MultiPoint - case 8: - $gis_type = 'multipoint'; - break; - default: - $error = true; - if (!isset($esri_types[$shp->shapeType])) { - $message = PMA\libraries\Message::error( - __( - 'You tried to import an invalid file or the imported file' - . ' contains invalid data!' - ) - ); - } else { - $message = PMA\libraries\Message::error( - __('MySQL Spatial Extension does not support ESRI type "%s".') - ); - $message->addParam($esri_types[$shp->shapeType]); - } - - return; - } - - if (isset($gis_type)) { - /** @var GISMultilinestring|\PMA\libraries\gis\GISMultipoint|\PMA\libraries\gis\GISPoint|GISPolygon $gis_obj */ - $gis_obj = GISFactory::factory($gis_type); - } else { - $gis_obj = null; - } - - $num_rows = count($shp->records); - // If .dbf file is loaded, the number of extra data columns - $num_data_cols = isset($shp->DBFHeader) ? count($shp->DBFHeader) : 0; - - $rows = array(); - $col_names = array(); - if ($num_rows != 0) { - foreach ($shp->records as $record) { - $tempRow = array(); - if ($gis_obj == null) { - $tempRow[] = null; - } else { - $tempRow[] = "GeomFromText('" - . $gis_obj->getShape($record->SHPData) . "')"; - } - - if (isset($shp->DBFHeader)) { - foreach ($shp->DBFHeader as $c) { - $cell = trim($record->DBFData[$c[0]]); - - if (!strcmp($cell, '')) { - $cell = 'NULL'; - } - - $tempRow[] = $cell; - } - } - $rows[] = $tempRow; - } - } - - if (count($rows) == 0) { - $error = true; - $message = PMA\libraries\Message::error( - __('The imported file does not contain any data!') - ); - - return; - } - - // Column names for spatial column and the rest of the columns, - // if they are available - $col_names[] = 'SPATIAL'; - for ($n = 0; $n < $num_data_cols; $n++) { - $col_names[] = $shp->DBFHeader[$n][0]; - } - - // Set table name based on the number of tables - if (mb_strlen($db)) { - $result = $GLOBALS['dbi']->fetchResult('SHOW TABLES'); - $table_name = 'TABLE ' . (count($result) + 1); - } else { - $table_name = 'TBL_NAME'; - } - $tables = array(array($table_name, $col_names, $rows)); - - // Use data from shape file to chose best-fit MySQL types for each column - $analyses = array(); - $analyses[] = PMA_analyzeTable($tables[0]); - - $table_no = 0; - $spatial_col = 0; - $analyses[$table_no][TYPES][$spatial_col] = GEOMETRY; - $analyses[$table_no][FORMATTEDSQL][$spatial_col] = true; - - // Set database name to the currently selected one, if applicable - if (mb_strlen($db)) { - $db_name = $db; - $options = array('create_db' => false); - } else { - $db_name = 'SHP_DB'; - $options = null; - } - - // Created and execute necessary SQL statements from data - $null_param = null; - PMA_buildSQL($db_name, $tables, $analyses, $null_param, $options, $sql_data); - - unset($tables); - unset($analyses); - - $finished = true; - $error = false; - - // Commit any possible data in buffers - PMA_importRunQuery('', '', $sql_data); - } - - /** - * Returns specified number of bytes from the buffer. - * Buffer automatically fetches next chunk of data when the buffer - * falls short. - * Sets $eof when $GLOBALS['finished'] is set and the buffer falls short. - * - * @param int $length number of bytes - * - * @return string - */ - public static function readFromBuffer($length) - { - global $buffer, $eof; - - if (strlen($buffer) < $length) { - if ($GLOBALS['finished']) { - $eof = true; - } else { - $buffer .= PMA_importGetNextChunk(); - } - } - $result = substr($buffer, 0, $length); - $buffer = substr($buffer, $length); - - return $result; - } -} diff --git a/#pma/libraries/plugins/import/ImportSql.php b/#pma/libraries/plugins/import/ImportSql.php deleted file mode 100644 index 8926830e..00000000 --- a/#pma/libraries/plugins/import/ImportSql.php +++ /dev/null @@ -1,198 +0,0 @@ -setProperties(); - } - - /** - * Sets the import plugin properties. - * Called in the constructor. - * - * @return void - */ - protected function setProperties() - { - $importPluginProperties = new ImportPluginProperties(); - $importPluginProperties->setText('SQL'); - $importPluginProperties->setExtension('sql'); - $importPluginProperties->setOptionsText(__('Options')); - - $compats = $GLOBALS['dbi']->getCompatibilities(); - if (count($compats) > 0) { - $values = array(); - foreach ($compats as $val) { - $values[$val] = $val; - } - - // create the root group that will be the options field for - // $importPluginProperties - // this will be shown as "Format specific options" - $importSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); - // create primary items and add them to the group - $leaf = new SelectPropertyItem( - "compatibility", - __('SQL compatibility mode:') - ); - $leaf->setValues($values); - $leaf->setDoc( - array( - 'manual_MySQL_Database_Administration', - 'Server_SQL_mode', - ) - ); - $generalOptions->addProperty($leaf); - $leaf = new BoolPropertyItem( - "no_auto_value_on_zero", - __('Do not use AUTO_INCREMENT for zero values') - ); - $leaf->setDoc( - array( - 'manual_MySQL_Database_Administration', - 'Server_SQL_mode', - 'sqlmode_no_auto_value_on_zero', - ) - ); - $generalOptions->addProperty($leaf); - - // add the main group to the root group - $importSpecificOptions->addProperty($generalOptions); - // set the options for the import plugin property item - $importPluginProperties->setOptions($importSpecificOptions); - } - - $this->properties = $importPluginProperties; - } - - /** - * Handles the whole import logic - * - * @param array &$sql_data 2-element array with sql data - * - * @return void - */ - public function doImport(&$sql_data = array()) - { - global $error, $timeout_passed; - - // Handle compatibility options. - $this->_setSQLMode($GLOBALS['dbi'], $_REQUEST); - - $bq = new SqlParser\Utils\BufferedQuery(); - if (isset($_POST['sql_delimiter'])) { - $bq->setDelimiter($_POST['sql_delimiter']); - } - - /** - * Will be set in PMA_importGetNextChunk(). - * - * @global bool $GLOBALS ['finished'] - */ - $GLOBALS['finished'] = false; - - while ((!$error) && (!$timeout_passed)) { - - // Getting the first statement, the remaining data and the last - // delimiter. - $statement = $bq->extract(); - - // If there is no full statement, we are looking for more data. - if (empty($statement)) { - - // Importing new data. - $newData = PMA_importGetNextChunk(); - - // Subtract data we didn't handle yet and stop processing. - if ($newData === false) { - $GLOBALS['offset'] -= mb_strlen($bq->query); - break; - } - - // Checking if the input buffer has finished. - if ($newData === true) { - $GLOBALS['finished'] = true; - break; - } - - // Convert CR (but not CRLF) to LF otherwise all queries may - // not get executed on some platforms. - $bq->query .= preg_replace("/\r($|[^\n])/", "\n$1", $newData); - - continue; - } - - // Executing the query. - PMA_importRunQuery($statement, $statement, $sql_data); - } - - // Extracting remaining statements. - while ((!$error) && (!$timeout_passed) && (!empty($bq->query))) { - $statement = $bq->extract(true); - if (!empty($statement)) { - PMA_importRunQuery($statement, $statement, $sql_data); - } - } - - // Finishing. - PMA_importRunQuery('', '', $sql_data); - } - - /** - * Handle compatibility options - * - * @param PMA\libraries\DatabaseInterface $dbi Database interface - * @param array $request Request array - * - * @return void - */ - private function _setSQLMode($dbi, $request) - { - $sql_modes = array(); - if (isset($request['sql_compatibility']) - && 'NONE' != $request['sql_compatibility'] - ) { - $sql_modes[] = $request['sql_compatibility']; - } - if (isset($request['sql_no_auto_value_on_zero'])) { - $sql_modes[] = 'NO_AUTO_VALUE_ON_ZERO'; - } - if (count($sql_modes) > 0) { - $dbi->tryQuery( - 'SET SQL_MODE="' . implode(',', $sql_modes) . '"' - ); - } - } -} diff --git a/#pma/libraries/plugins/import/ImportXml.php b/#pma/libraries/plugins/import/ImportXml.php deleted file mode 100644 index 5dba74b8..00000000 --- a/#pma/libraries/plugins/import/ImportXml.php +++ /dev/null @@ -1,378 +0,0 @@ -setProperties(); - } - - /** - * Sets the import plugin properties. - * Called in the constructor. - * - * @return void - */ - protected function setProperties() - { - $importPluginProperties = new ImportPluginProperties(); - $importPluginProperties->setText(__('XML')); - $importPluginProperties->setExtension('xml'); - $importPluginProperties->setMimeType('text/xml'); - $importPluginProperties->setOptions(array()); - $importPluginProperties->setOptionsText(__('Options')); - - $this->properties = $importPluginProperties; - } - - /** - * Handles the whole import logic - * - * @param array &$sql_data 2-element array with sql data - * - * @return void - */ - public function doImport(&$sql_data = array()) - { - global $error, $timeout_passed, $finished, $db; - - $i = 0; - $len = 0; - $buffer = ""; - - /** - * Read in the file via PMA_importGetNextChunk so that - * it can process compressed files - */ - while (!($finished && $i >= $len) && !$error && !$timeout_passed) { - $data = PMA_importGetNextChunk(); - if ($data === false) { - /* subtract data we didn't handle yet and stop processing */ - $GLOBALS['offset'] -= strlen($buffer); - break; - } elseif ($data === true) { - /* Handle rest of buffer */ - } else { - /* Append new data to buffer */ - $buffer .= $data; - unset($data); - } - } - - unset($data); - - /** - * Disable loading of external XML entities. - */ - libxml_disable_entity_loader(); - - /** - * Load the XML string - * - * The option LIBXML_COMPACT is specified because it can - * result in increased performance without the need to - * alter the code in any way. It's basically a freebee. - */ - $xml = @simplexml_load_string($buffer, "SimpleXMLElement", LIBXML_COMPACT); - - unset($buffer); - - /** - * The XML was malformed - */ - if ($xml === false) { - PMA\libraries\Message::error( - __( - 'The XML file specified was either malformed or incomplete.' - . ' Please correct the issue and try again.' - ) - ) - ->display(); - unset($xml); - $GLOBALS['finished'] = false; - - return; - } - - /** - * Table accumulator - */ - $tables = array(); - /** - * Row accumulator - */ - $rows = array(); - - /** - * Temp arrays - */ - $tempRow = array(); - $tempCells = array(); - - /** - * CREATE code included (by default: no) - */ - $struct_present = false; - - /** - * Analyze the data in each table - */ - $namespaces = $xml->getNameSpaces(true); - - /** - * Get the database name, collation and charset - */ - $db_attr = $xml->children($namespaces['pma']) - ->{'structure_schemas'}->{'database'}; - - if ($db_attr instanceof SimpleXMLElement) { - $db_attr = $db_attr->attributes(); - $db_name = (string)$db_attr['name']; - $collation = (string)$db_attr['collation']; - $charset = (string)$db_attr['charset']; - } else { - /** - * If the structure section is not present - * get the database name from the data section - */ - $db_attr = $xml->children() - ->attributes(); - $db_name = (string)$db_attr['name']; - $collation = null; - $charset = null; - } - - /** - * The XML was malformed - */ - if ($db_name === null) { - PMA\libraries\Message::error( - __( - 'The XML file specified was either malformed or incomplete.' - . ' Please correct the issue and try again.' - ) - ) - ->display(); - unset($xml); - $GLOBALS['finished'] = false; - - return; - } - - /** - * Retrieve the structure information - */ - if (isset($namespaces['pma'])) { - /** - * Get structures for all tables - * - * @var SimpleXMLElement $struct - */ - $struct = $xml->children($namespaces['pma']); - - $create = array(); - - /** @var SimpleXMLElement $val1 */ - foreach ($struct as $val1) { - /** @var SimpleXMLElement $val2 */ - foreach ($val1 as $val2) { - // Need to select the correct database for the creation of - // tables, views, triggers, etc. - /** - * @todo Generating a USE here blocks importing of a table - * into another database. - */ - $attrs = $val2->attributes(); - $create[] = "USE " - . PMA\libraries\Util::backquote( - $attrs["name"] - ); - - foreach ($val2 as $val3) { - /** - * Remove the extra cosmetic spacing - */ - $val3 = str_replace(" ", "", (string)$val3); - $create[] = $val3; - } - } - } - - $struct_present = true; - } - - /** - * Move down the XML tree to the actual data - */ - $xml = $xml->children() - ->children(); - - $data_present = false; - - /** - * Only attempt to analyze/collect data if there is data present - */ - if ($xml && @count($xml->children())) { - $data_present = true; - - /** - * Process all database content - */ - foreach ($xml as $v1) { - $tbl_attr = $v1->attributes(); - - $isInTables = false; - $num_tables = count($tables); - for ($i = 0; $i < $num_tables; ++$i) { - if (!strcmp($tables[$i][TBL_NAME], (string)$tbl_attr['name'])) { - $isInTables = true; - break; - } - } - - if (!$isInTables) { - $tables[] = array((string)$tbl_attr['name']); - } - - foreach ($v1 as $v2) { - $row_attr = $v2->attributes(); - if (!array_search((string)$row_attr['name'], $tempRow)) { - $tempRow[] = (string)$row_attr['name']; - } - $tempCells[] = (string)$v2; - } - - $rows[] = array((string)$tbl_attr['name'], $tempRow, $tempCells); - - $tempRow = array(); - $tempCells = array(); - } - - unset($tempRow); - unset($tempCells); - unset($xml); - - /** - * Bring accumulated rows into the corresponding table - */ - $num_tables = count($tables); - for ($i = 0; $i < $num_tables; ++$i) { - $num_rows = count($rows); - for ($j = 0; $j < $num_rows; ++$j) { - if (!strcmp($tables[$i][TBL_NAME], $rows[$j][TBL_NAME])) { - if (!isset($tables[$i][COL_NAMES])) { - $tables[$i][] = $rows[$j][COL_NAMES]; - } - - $tables[$i][ROWS][] = $rows[$j][ROWS]; - } - } - } - - unset($rows); - - if (!$struct_present) { - $analyses = array(); - - $len = count($tables); - for ($i = 0; $i < $len; ++$i) { - $analyses[] = PMA_analyzeTable($tables[$i]); - } - } - } - - unset($xml); - unset($tempCells); - unset($rows); - - /** - * Only build SQL from data if there is data present - */ - if ($data_present) { - /** - * Set values to NULL if they were not present - * to maintain PMA_buildSQL() call integrity - */ - if (!isset($analyses)) { - $analyses = null; - if (!$struct_present) { - $create = null; - } - } - } - - /** - * string $db_name (no backquotes) - * - * array $table = array(table_name, array() column_names, array()() rows) - * array $tables = array of "$table"s - * - * array $analysis = array(array() column_types, array() column_sizes) - * array $analyses = array of "$analysis"s - * - * array $create = array of SQL strings - * - * array $options = an associative array of options - */ - - /* Set database name to the currently selected one, if applicable */ - if (strlen($db)) { - /* Override the database name in the XML file, if one is selected */ - $db_name = $db; - $options = array('create_db' => false); - } else { - if ($db_name === null) { - $db_name = 'XML_DB'; - } - - /* Set database collation/charset */ - $options = array( - 'db_collation' => $collation, - 'db_charset' => $charset, - ); - } - - /* Created and execute necessary SQL statements from data */ - PMA_buildSQL($db_name, $tables, $analyses, $create, $options, $sql_data); - - unset($analyses); - unset($tables); - unset($create); - - /* Commit any possible data in buffers */ - PMA_importRunQuery('', '', $sql_data); - } -} diff --git a/#pma/libraries/plugins/import/README b/#pma/libraries/plugins/import/README deleted file mode 100644 index a7e60dd1..00000000 --- a/#pma/libraries/plugins/import/README +++ /dev/null @@ -1,155 +0,0 @@ -This directory holds import plugins for phpMyAdmin. Any new plugin should -basically follow the structure presented here. The messages must use our -gettext mechanism, see https://wiki.phpmyadmin.net/pma/Gettext_for_developers. - -setProperties(); - } - - /** - * Sets the import plugin properties. - * Called in the constructor. - * - * @return void - */ - protected function setProperties() - { - $importPluginProperties = new PMA\libraries\properties\plugins\ImportPluginProperties(); - $importPluginProperties->setText('[name]'); // the name of your plug-in - $importPluginProperties->setExtension('[ext]'); // extension this plug-in can handle - $importPluginProperties->setOptionsText(__('Options')); - - // create the root group that will be the options field for - // $importPluginProperties - // this will be shown as "Format specific options" - $importSpecificOptions = new - PMA\libraries\properties\options\groups\OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // general options main group - $generalOptions = new PMA\libraries\properties\options\groups\OptionsPropertyMainGroup( - "general_opts" - ); - - // optional : - // create primary items and add them to the group - // type - one of the classes listed in libraries/properties/options/items/ - // name - form element name - // text - description in GUI - // size - size of text element - // len - maximal size of input - // values - possible values of the item - $leaf = new PMA\libraries\properties\options\items\RadioPropertyItem( - "structure_or_data" - ); - $leaf->setValues( - array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data') - ) - ); - $generalOptions->addProperty($leaf); - - // add the main group to the root group - $importSpecificOptions->addProperty($generalOptions); - - // set the options for the import plugin property item - $importPluginProperties->setOptions($importSpecificOptions); - $this->properties = $importPluginProperties; - } - - /** - * Handles the whole import logic - * - * @param array &$sql_data 2-element array with sql data - * - * @return void - */ - public function doImport(&$sql_data = array()) - { - // get globals (others are optional) - global $error, $timeout_passed, $finished; - - $buffer = ''; - while (! ($finished && $i >= $len) && ! $error && ! $timeout_passed) { - $data = PMA_importGetNextChunk(); - if ($data === false) { - // subtract data we didn't handle yet and stop processing - $GLOBALS['offset'] -= strlen($buffer); - break; - } elseif ($data === true) { - // Handle rest of buffer - } else { - // Append new data to buffer - $buffer .= $data; - } - // PARSE $buffer here, post sql queries using: - PMA_importRunQuery($sql, $verbose_sql_with_comments, $sql_data); - } // End of import loop - // Commit any possible data in buffers - PMA_importRunQuery('', '', $sql_data); - } - - - // optional: - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - - /** - * Getter description - * - * @return type - */ - private function _getMyOptionalVariable() - { - return $this->_myOptionalVariable; - } - - /** - * Setter description - * - * @param type $my_optional_variable description - * - * @return void - */ - private function _setMyOptionalVariable($my_optional_variable) - { - $this->_myOptionalVariable = $my_optional_variable; - } -} -?> diff --git a/#pma/libraries/plugins/import/ShapeFile.php b/#pma/libraries/plugins/import/ShapeFile.php deleted file mode 100644 index 350458f6..00000000 --- a/#pma/libraries/plugins/import/ShapeFile.php +++ /dev/null @@ -1,100 +0,0 @@ -_loadHeaders(); - $this->_loadRecords(); - if ($this->_isDbaseLoaded()) { - $this->_closeDBFFile(); - } - } - - /** - * Loads metadata from the ESRI shape file header - * - * @return void - * @see ShapeFile::_loadHeaders() - */ - public function _loadHeaders() - { - ImportShp::readFromBuffer(24); - $this->fileLength = loadData("N", ImportShp::readFromBuffer(4)); - - ImportShp::readFromBuffer(4); - $this->shapeType = loadData("V", ImportShp::readFromBuffer(4)); - - $this->boundingBox = array(); - $this->boundingBox["xmin"] = loadData("d", ImportShp::readFromBuffer(8)); - $this->boundingBox["ymin"] = loadData("d", ImportShp::readFromBuffer(8)); - $this->boundingBox["xmax"] = loadData("d", ImportShp::readFromBuffer(8)); - $this->boundingBox["ymax"] = loadData("d", ImportShp::readFromBuffer(8)); - - if ($this->_isDbaseLoaded() && $this->_openDBFFile()) { - $this->DBFHeader = $this->_loadDBFHeader(); - } - } - - /** - * Loads geometry data from the ESRI shape file - * - * @return boolean|void - * @see ShapeFile::_loadRecords() - */ - public function _loadRecords() - { - global $eof; - ImportShp::readFromBuffer(32); - while (true) { - $record = new ShapeRecord(-1); - $record->loadFromFile($this->SHPFile, $this->DBFFile); - if ($record->lastError != "") { - return false; - } - if ($eof) { - break; - } - - $this->records[] = $record; - } - } -} diff --git a/#pma/libraries/plugins/import/ShapeRecord.php b/#pma/libraries/plugins/import/ShapeRecord.php deleted file mode 100644 index b496bcad..00000000 --- a/#pma/libraries/plugins/import/ShapeRecord.php +++ /dev/null @@ -1,159 +0,0 @@ -DBFFile = $DBFFile; - $this->_loadHeaders(); - - switch ($this->shapeType) { - case 0: - $this->_loadNullRecord(); - break; - case 1: - $this->_loadPointRecord(); - break; - case 3: - $this->_loadPolyLineRecord(); - break; - case 5: - $this->_loadPolygonRecord(); - break; - case 8: - $this->_loadMultiPointRecord(); - break; - default: - $this->setError( - sprintf( - __("Geometry type '%s' is not supported by MySQL."), - $this->shapeType - ) - ); - break; - } - if (extension_loaded('dbase') && isset($this->DBFFile)) { - $this->_loadDBFData(); - } - } - - /** - * Loads metadata from the ESRI shape record header - * - * @return void - * @see ShapeRecord::_loadHeaders() - */ - public function _loadHeaders() - { - $this->recordNumber = loadData("N", ImportShp::readFromBuffer(4)); - ImportShp::readFromBuffer(4); - $this->shapeType = loadData("V", ImportShp::readFromBuffer(4)); - } - - /** - * Loads data from a point record - * - * @return array - * @see ShapeRecord::_loadPoint() - */ - public function _loadPoint() - { - $data = array(); - - $data["x"] = loadData("d", ImportShp::readFromBuffer(8)); - $data["y"] = loadData("d", ImportShp::readFromBuffer(8)); - - return $data; - } - - /** - * Loads data from a multipoint record - * - * @return void - * @see ShapeRecord::_loadMultiPointRecord() - */ - public function _loadMultiPointRecord() - { - $this->SHPData = array(); - $this->SHPData["xmin"] = loadData("d", ImportShp::readFromBuffer(8)); - $this->SHPData["ymin"] = loadData("d", ImportShp::readFromBuffer(8)); - $this->SHPData["xmax"] = loadData("d", ImportShp::readFromBuffer(8)); - $this->SHPData["ymax"] = loadData("d", ImportShp::readFromBuffer(8)); - - $this->SHPData["numpoints"] = loadData("V", ImportShp::readFromBuffer(4)); - - for ($i = 0; $i <= $this->SHPData["numpoints"]; $i++) { - $this->SHPData["points"][] = $this->_loadPoint(); - } - } - - /** - * Loads data from a polyline record - * - * @return void - * @see ShapeRecord::_loadPolyLineRecord() - */ - public function _loadPolyLineRecord() - { - $this->SHPData = array(); - $this->SHPData["xmin"] = loadData("d", ImportShp::readFromBuffer(8)); - $this->SHPData["ymin"] = loadData("d", ImportShp::readFromBuffer(8)); - $this->SHPData["xmax"] = loadData("d", ImportShp::readFromBuffer(8)); - $this->SHPData["ymax"] = loadData("d", ImportShp::readFromBuffer(8)); - - $this->SHPData["numparts"] = loadData("V", ImportShp::readFromBuffer(4)); - $this->SHPData["numpoints"] = loadData("V", ImportShp::readFromBuffer(4)); - - for ($i = 0; $i < $this->SHPData["numparts"]; $i++) { - $this->SHPData["parts"][$i] = loadData( - "V", - ImportShp::readFromBuffer(4) - ); - } - - $readPoints = 0; - foreach ($this->SHPData["parts"] as &$partData) { - if (!isset($partData["points"]) - || !is_array($partData["points"]) - ) { - $partData = array( - 'points' => array() - ); - } - while (!in_array($readPoints, $this->SHPData["parts"]) - && ($readPoints < ($this->SHPData["numpoints"])) - ) { - $partData["points"][] = $this->_loadPoint(); - $readPoints++; - } - } - } -} diff --git a/#pma/libraries/plugins/import/upload/UploadApc.php b/#pma/libraries/plugins/import/upload/UploadApc.php deleted file mode 100644 index 95e8c6af..00000000 --- a/#pma/libraries/plugins/import/upload/UploadApc.php +++ /dev/null @@ -1,80 +0,0 @@ - $id, - 'finished' => false, - 'percent' => 0, - 'total' => 0, - 'complete' => 0, - 'plugin' => UploadApc::getIdKey(), - ); - } - $ret = $_SESSION[$SESSION_KEY][$id]; - - if (!PMA_Import_apcCheck() || $ret['finished']) { - return $ret; - } - $status = apc_fetch('upload_' . $id); - - if ($status) { - $ret['finished'] = (bool)$status['done']; - $ret['total'] = $status['total']; - $ret['complete'] = $status['current']; - - if ($ret['total'] > 0) { - $ret['percent'] = $ret['complete'] / $ret['total'] * 100; - } - - if ($ret['percent'] == 100) { - $ret['finished'] = (bool)true; - } - - $_SESSION[$SESSION_KEY][$id] = $ret; - } - - return $ret; - } -} diff --git a/#pma/libraries/plugins/import/upload/UploadNoplugin.php b/#pma/libraries/plugins/import/upload/UploadNoplugin.php deleted file mode 100644 index 2bc67cbd..00000000 --- a/#pma/libraries/plugins/import/upload/UploadNoplugin.php +++ /dev/null @@ -1,60 +0,0 @@ - $id, - 'finished' => false, - 'percent' => 0, - 'total' => 0, - 'complete' => 0, - 'plugin' => UploadNoplugin::getIdKey(), - ); - } - $ret = $_SESSION[$SESSION_KEY][$id]; - - return $ret; - } -} diff --git a/#pma/libraries/plugins/import/upload/UploadProgress.php b/#pma/libraries/plugins/import/upload/UploadProgress.php deleted file mode 100644 index 9b3ac319..00000000 --- a/#pma/libraries/plugins/import/upload/UploadProgress.php +++ /dev/null @@ -1,91 +0,0 @@ - $id, - 'finished' => false, - 'percent' => 0, - 'total' => 0, - 'complete' => 0, - 'plugin' => UploadProgress::getIdKey(), - ); - } - $ret = $_SESSION[$SESSION_KEY][$id]; - - if (!PMA_Import_progressCheck() || $ret['finished']) { - return $ret; - } - - $status = uploadprogress_get_info($id); - - if ($status) { - if ($status['bytes_uploaded'] == $status['bytes_total']) { - $ret['finished'] = true; - } else { - $ret['finished'] = false; - } - $ret['total'] = $status['bytes_total']; - $ret['complete'] = $status['bytes_uploaded']; - - if ($ret['total'] > 0) { - $ret['percent'] = $ret['complete'] / $ret['total'] * 100; - } - } else { - $ret = array( - 'id' => $id, - 'finished' => true, - 'percent' => 100, - 'total' => $ret['total'], - 'complete' => $ret['total'], - 'plugin' => UploadProgress::getIdKey(), - ); - } - - $_SESSION[$SESSION_KEY][$id] = $ret; - - return $ret; - } -} diff --git a/#pma/libraries/plugins/import/upload/UploadSession.php b/#pma/libraries/plugins/import/upload/UploadSession.php deleted file mode 100644 index 0891bdf0..00000000 --- a/#pma/libraries/plugins/import/upload/UploadSession.php +++ /dev/null @@ -1,92 +0,0 @@ - $id, - 'finished' => false, - 'percent' => 0, - 'total' => 0, - 'complete' => 0, - 'plugin' => UploadSession::getIdKey(), - ); - } - $ret = $_SESSION[$SESSION_KEY][$id]; - - if (!PMA_Import_sessionCheck() || $ret['finished']) { - return $ret; - } - - $status = false; - $sessionkey = ini_get('session.upload_progress.prefix') . $id; - - if (isset($_SESSION[$sessionkey])) { - $status = $_SESSION[$sessionkey]; - } - - if ($status) { - $ret['finished'] = $status['done']; - $ret['total'] = $status['content_length']; - $ret['complete'] = $status['bytes_processed']; - - if ($ret['total'] > 0) { - $ret['percent'] = $ret['complete'] / $ret['total'] * 100; - } - } else { - $ret = array( - 'id' => $id, - 'finished' => true, - 'percent' => 100, - 'total' => $ret['total'], - 'complete' => $ret['total'], - 'plugin' => UploadSession::getIdKey(), - ); - } - - $_SESSION[$SESSION_KEY][$id] = $ret; - - return $ret; - } -} diff --git a/#pma/libraries/plugins/schema/ExportRelationSchema.php b/#pma/libraries/plugins/schema/ExportRelationSchema.php deleted file mode 100644 index 228af6c6..00000000 --- a/#pma/libraries/plugins/schema/ExportRelationSchema.php +++ /dev/null @@ -1,301 +0,0 @@ -db = $db; - $this->diagram = $diagram; - $this->setPageNumber($_REQUEST['page_number']); - $this->setOffline(isset($_REQUEST['offline_export'])); - } - - protected $db; - protected $diagram; - protected $showColor; - protected $tableDimension; - protected $sameWide; - protected $showKeys; - protected $orientation; - protected $paper; - protected $pageNumber; - protected $offline; - - /** - * Set Page Number - * - * @param integer $value Page Number of the document to be created - * - * @return void - */ - public function setPageNumber($value) - { - $this->pageNumber = intval($value); - } - - /** - * Returns the schema page number - * - * @return integer schema page number - */ - public function getPageNumber() - { - return $this->pageNumber; - } - - /** - * Sets showColor - * - * @param boolean $value whether to show colors - * - * @return void - */ - public function setShowColor($value) - { - $this->showColor = $value; - } - - /** - * Returns whether to show colors - * - * @return boolean whether to show colors - */ - public function isShowColor() - { - return $this->showColor; - } - - /** - * Set Table Dimension - * - * @param boolean $value show table co-ordinates or not - * - * @return void - */ - public function setTableDimension($value) - { - $this->tableDimension = $value; - } - - /** - * Returns whether to show table dimensions - * - * @return boolean whether to show table dimensions - */ - public function isTableDimension() - { - return $this->tableDimension; - } - - /** - * Set same width of All Tables - * - * @param boolean $value set same width of all tables or not - * - * @return void - */ - public function setAllTablesSameWidth($value) - { - $this->sameWide = $value; - } - - /** - * Returns whether to use same width for all tables or not - * - * @return boolean whether to use same width for all tables or not - */ - public function isAllTableSameWidth() - { - return $this->sameWide; - } - - /** - * Set Show only keys - * - * @param boolean $value show only keys or not - * - * @return void - * - * @access public - */ - public function setShowKeys($value) - { - $this->showKeys = $value; - } - - /** - * Returns whether to show keys - * - * @return boolean whether to show keys - */ - public function isShowKeys() - { - return $this->showKeys; - } - - /** - * Set Orientation - * - * @param string $value Orientation will be portrait or landscape - * - * @return void - * - * @access public - */ - public function setOrientation($value) - { - $this->orientation = ($value == 'P') ? 'P' : 'L'; - } - - /** - * Returns orientation - * - * @return string orientation - */ - public function getOrientation() - { - return $this->orientation; - } - - /** - * Set type of paper - * - * @param string $value paper type can be A4 etc - * - * @return void - * - * @access public - */ - public function setPaper($value) - { - $this->paper = $value; - } - - /** - * Returns the paper size - * - * @return string paper size - */ - public function getPaper() - { - return $this->paper; - } - - /** - * Set whether the document is generated from client side DB - * - * @param boolean $value offline or not - * - * @return void - * - * @access public - */ - public function setOffline($value) - { - $this->offline = $value; - } - - /** - * Returns whether the client side database is used - * - * @return boolean - * - * @access public - */ - public function isOffline() - { - return $this->offline; - } - - /** - * Get the table names from the request - * - * @return array an array of table names - */ - protected function getTablesFromRequest() - { - $tables = array(); - $dbLength = mb_strlen($this->db); - foreach ($_REQUEST['t_h'] as $key => $value) { - if ($value) { - $tables[] = mb_substr($key, $dbLength + 1); - } - } - - return $tables; - } - - /** - * Returns the file name - * - * @param String $extension file extension - * - * @return string file name - */ - protected function getFileName($extension) - { - $filename = $this->db . $extension; - // Get the name of this page to use as filename - if ($this->pageNumber != -1 && !$this->offline) { - $_name_sql = 'SELECT page_descr FROM ' - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['pdf_pages']) - . ' WHERE page_nr = ' . $this->pageNumber; - $_name_rs = PMA_queryAsControlUser($_name_sql); - $_name_row = $GLOBALS['dbi']->fetchRow($_name_rs); - $filename = $_name_row[0] . $extension; - } - - return $filename; - } - - /** - * Displays an error message - * - * @param integer $pageNumber ID of the chosen page - * @param string $type Schema Type - * @param string $error_message The error message - * - * @access public - * - * @return void - */ - public static function dieSchema($pageNumber, $type = '', $error_message = '') - { - echo "

    " , __("SCHEMA ERROR: ") , $type , "

    " , "\n"; - if (!empty($error_message)) { - $error_message = htmlspecialchars($error_message); - } - echo '

    ' , "\n"; - echo ' ' , $error_message , "\n"; - echo '

    ' , "\n"; - echo '' , __('Back') , ''; - echo "\n"; - exit; - } -} diff --git a/#pma/libraries/plugins/schema/RelationStats.php b/#pma/libraries/plugins/schema/RelationStats.php deleted file mode 100644 index d22b1805..00000000 --- a/#pma/libraries/plugins/schema/RelationStats.php +++ /dev/null @@ -1,114 +0,0 @@ -diagram = $diagram; - - $src_pos = $this->_getXy($master_table, $master_field); - $dest_pos = $this->_getXy($foreign_table, $foreign_field); - /* - * [0] is x-left - * [1] is x-right - * [2] is y - */ - $src_left = $src_pos[0] - $this->wTick; - $src_right = $src_pos[1] + $this->wTick; - $dest_left = $dest_pos[0] - $this->wTick; - $dest_right = $dest_pos[1] + $this->wTick; - - $d1 = abs($src_left - $dest_left); - $d2 = abs($src_right - $dest_left); - $d3 = abs($src_left - $dest_right); - $d4 = abs($src_right - $dest_right); - $d = min($d1, $d2, $d3, $d4); - - if ($d == $d1) { - $this->xSrc = $src_pos[0]; - $this->srcDir = -1; - $this->xDest = $dest_pos[0]; - $this->destDir = -1; - } elseif ($d == $d2) { - $this->xSrc = $src_pos[1]; - $this->srcDir = 1; - $this->xDest = $dest_pos[0]; - $this->destDir = -1; - } elseif ($d == $d3) { - $this->xSrc = $src_pos[0]; - $this->srcDir = -1; - $this->xDest = $dest_pos[1]; - $this->destDir = 1; - } else { - $this->xSrc = $src_pos[1]; - $this->srcDir = 1; - $this->xDest = $dest_pos[1]; - $this->destDir = 1; - } - $this->ySrc = $src_pos[2]; - $this->yDest = $dest_pos[2]; - } - - /** - * Gets arrows coordinates - * - * @param string $table The current table name - * @param string $column The relation column name - * - * @return array Arrows coordinates - * - * @access private - */ - private function _getXy($table, $column) - { - $pos = array_search($column, $table->fields); - - // x_left, x_right, y - return array( - $table->x, - $table->x + $table->width, - $table->y + ($pos + 1.5) * $table->heightCell, - ); - } -} diff --git a/#pma/libraries/plugins/schema/SchemaDia.php b/#pma/libraries/plugins/schema/SchemaDia.php deleted file mode 100644 index 01606574..00000000 --- a/#pma/libraries/plugins/schema/SchemaDia.php +++ /dev/null @@ -1,97 +0,0 @@ -setProperties(); - } - - /** - * Sets the schema export Dia properties - * - * @return void - */ - protected function setProperties() - { - $schemaPluginProperties = new SchemaPluginProperties(); - $schemaPluginProperties->setText('Dia'); - $schemaPluginProperties->setExtension('dia'); - $schemaPluginProperties->setMimeType('application/dia'); - - // create the root group that will be the options field for - // $schemaPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // specific options main group - $specificOptions = new OptionsPropertyMainGroup("general_opts"); - // add options common to all plugins - $this->addCommonOptions($specificOptions); - - $leaf = new SelectPropertyItem( - "orientation", - __('Orientation') - ); - $leaf->setValues( - array( - 'L' => __('Landscape'), - 'P' => __('Portrait'), - ) - ); - $specificOptions->addProperty($leaf); - - $leaf = new SelectPropertyItem( - "paper", - __('Paper size') - ); - $leaf->setValues($this->getPaperSizeArray()); - $specificOptions->addProperty($leaf); - - // add the main group to the root group - $exportSpecificOptions->addProperty($specificOptions); - - // set the options for the schema export plugin property item - $schemaPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $schemaPluginProperties; - } - - /** - * Exports the schema into DIA format. - * - * @param string $db database name - * - * @return bool Whether it succeeded - */ - public function exportSchema($db) - { - $export = new DiaRelationSchema($db); - $export->showOutput(); - } -} diff --git a/#pma/libraries/plugins/schema/SchemaEps.php b/#pma/libraries/plugins/schema/SchemaEps.php deleted file mode 100644 index 59ce7466..00000000 --- a/#pma/libraries/plugins/schema/SchemaEps.php +++ /dev/null @@ -1,98 +0,0 @@ -setProperties(); - } - - /** - * Sets the schema export EPS properties - * - * @return void - */ - protected function setProperties() - { - $schemaPluginProperties = new SchemaPluginProperties(); - $schemaPluginProperties->setText('EPS'); - $schemaPluginProperties->setExtension('eps'); - $schemaPluginProperties->setMimeType('application/eps'); - - // create the root group that will be the options field for - // $schemaPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // specific options main group - $specificOptions = new OptionsPropertyMainGroup("general_opts"); - // add options common to all plugins - $this->addCommonOptions($specificOptions); - - // create leaf items and add them to the group - $leaf = new BoolPropertyItem( - 'all_tables_same_width', - __('Same width for all tables') - ); - $specificOptions->addProperty($leaf); - - $leaf = new SelectPropertyItem( - "orientation", - __('Orientation') - ); - $leaf->setValues( - array( - 'L' => __('Landscape'), - 'P' => __('Portrait'), - ) - ); - $specificOptions->addProperty($leaf); - - // add the main group to the root group - $exportSpecificOptions->addProperty($specificOptions); - - // set the options for the schema export plugin property item - $schemaPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $schemaPluginProperties; - } - - /** - * Exports the schema into EPS format. - * - * @param string $db database name - * - * @return bool Whether it succeeded - */ - public function exportSchema($db) - { - $export = new EpsRelationSchema($db); - $export->showOutput(); - } -} diff --git a/#pma/libraries/plugins/schema/SchemaPdf.php b/#pma/libraries/plugins/schema/SchemaPdf.php deleted file mode 100644 index f900ab61..00000000 --- a/#pma/libraries/plugins/schema/SchemaPdf.php +++ /dev/null @@ -1,130 +0,0 @@ -setProperties(); - } - - /** - * Sets the schema export PDF properties - * - * @return void - */ - protected function setProperties() - { - $schemaPluginProperties = new SchemaPluginProperties(); - $schemaPluginProperties->setText('PDF'); - $schemaPluginProperties->setExtension('pdf'); - $schemaPluginProperties->setMimeType('application/pdf'); - - // create the root group that will be the options field for - // $schemaPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // specific options main group - $specificOptions = new OptionsPropertyMainGroup("general_opts"); - // add options common to all plugins - $this->addCommonOptions($specificOptions); - - // create leaf items and add them to the group - $leaf = new BoolPropertyItem( - 'all_tables_same_width', - __('Same width for all tables') - ); - $specificOptions->addProperty($leaf); - - $leaf = new SelectPropertyItem( - "orientation", - __('Orientation') - ); - $leaf->setValues( - array( - 'L' => __('Landscape'), - 'P' => __('Portrait'), - ) - ); - $specificOptions->addProperty($leaf); - - $leaf = new SelectPropertyItem( - "paper", - __('Paper size') - ); - $leaf->setValues($this->getPaperSizeArray()); - $specificOptions->addProperty($leaf); - - $leaf = new BoolPropertyItem( - 'show_grid', - __('Show grid') - ); - $specificOptions->addProperty($leaf); - - $leaf = new BoolPropertyItem( - 'with_doc', - __('Data dictionary') - ); - $specificOptions->addProperty($leaf); - - $leaf = new SelectPropertyItem( - "table_order", - __('Order of the tables') - ); - $leaf->setValues( - array( - '' => __('None'), - 'name_asc' => __('Name (Ascending)'), - 'name_desc' => __('Name (Descending)'), - ) - ); - $specificOptions->addProperty($leaf); - - // add the main group to the root group - $exportSpecificOptions->addProperty($specificOptions); - - // set the options for the schema export plugin property item - $schemaPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $schemaPluginProperties; - } - - /** - * Exports the schema into PDF format. - * - * @param string $db database name - * - * @return bool Whether it succeeded - */ - public function exportSchema($db) - { - $export = new PdfRelationSchema($db); - $export->showOutput(); - } -} diff --git a/#pma/libraries/plugins/schema/SchemaSvg.php b/#pma/libraries/plugins/schema/SchemaSvg.php deleted file mode 100644 index df875484..00000000 --- a/#pma/libraries/plugins/schema/SchemaSvg.php +++ /dev/null @@ -1,85 +0,0 @@ -setProperties(); - } - - /** - * Sets the schema export SVG properties - * - * @return void - */ - protected function setProperties() - { - $schemaPluginProperties = new SchemaPluginProperties(); - $schemaPluginProperties->setText('SVG'); - $schemaPluginProperties->setExtension('svg'); - $schemaPluginProperties->setMimeType('application/svg'); - - // create the root group that will be the options field for - // $schemaPluginProperties - // this will be shown as "Format specific options" - $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" - ); - - // specific options main group - $specificOptions = new OptionsPropertyMainGroup("general_opts"); - // add options common to all plugins - $this->addCommonOptions($specificOptions); - - // create leaf items and add them to the group - $leaf = new BoolPropertyItem( - 'all_tables_same_width', - __('Same width for all tables') - ); - $specificOptions->addProperty($leaf); - - // add the main group to the root group - $exportSpecificOptions->addProperty($specificOptions); - - // set the options for the schema export plugin property item - $schemaPluginProperties->setOptions($exportSpecificOptions); - $this->properties = $schemaPluginProperties; - } - - /** - * Exports the schema into SVG format. - * - * @param string $db database name - * - * @return bool Whether it succeeded - */ - public function exportSchema($db) - { - $export = new SvgRelationSchema($db); - $export->showOutput(); - } -} diff --git a/#pma/libraries/plugins/schema/TableStats.php b/#pma/libraries/plugins/schema/TableStats.php deleted file mode 100644 index 69fea396..00000000 --- a/#pma/libraries/plugins/schema/TableStats.php +++ /dev/null @@ -1,174 +0,0 @@ -diagram = $diagram; - $this->db = $db; - $this->pageNumber = $pageNumber; - $this->tableName = $tableName; - - $this->showKeys = $showKeys; - $this->tableDimension = $tableDimension; - - $this->offline = $offline; - - // checks whether the table exists - // and loads fields - $this->validateTableAndLoadFields(); - // load table coordinates - $this->loadCoordinates(); - // loads display field - $this->loadDisplayField(); - // loads primary keys - $this->loadPrimaryKey(); - } - - /** - * Validate whether the table exists. - * - * @return void - */ - protected function validateTableAndLoadFields() - { - $sql = 'DESCRIBE ' . PMA\libraries\Util::backquote($this->tableName); - $result = $GLOBALS['dbi']->tryQuery( - $sql, null, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - if (! $result || ! $GLOBALS['dbi']->numRows($result)) { - $this->showMissingTableError(); - } - - if ($this->showKeys) { - $indexes = PMA\libraries\Index::getFromTable($this->tableName, $this->db); - $all_columns = array(); - foreach ($indexes as $index) { - $all_columns = array_merge( - $all_columns, - array_flip(array_keys($index->getColumns())) - ); - } - $this->fields = array_keys($all_columns); - } else { - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $this->fields[] = $row[0]; - } - } - } - - /** - * Displays an error when the table cannot be found. - * - * @return void - * @abstract - */ - protected abstract function showMissingTableError(); - - /** - * Loads coordinates of a table - * - * @return void - */ - protected function loadCoordinates() - { - foreach ($_REQUEST['t_h'] as $key => $value) { - if ($this->db . '.' . $this->tableName == $key) { - $this->x = (double) $_REQUEST['t_x'][$key]; - $this->y = (double) $_REQUEST['t_y'][$key]; - break; - } - } - } - - /** - * Loads the table's display field - * - * @return void - */ - protected function loadDisplayField() - { - $this->displayfield = PMA_getDisplayField($this->db, $this->tableName); - } - - /** - * Loads the PRIMARY key. - * - * @return void - */ - protected function loadPrimaryKey() - { - $result = $GLOBALS['dbi']->query( - 'SHOW INDEX FROM ' . PMA\libraries\Util::backquote($this->tableName) . ';', - null, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - if ($GLOBALS['dbi']->numRows($result) > 0) { - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - if ($row['Key_name'] == 'PRIMARY') { - $this->primary[] = $row['Column_name']; - } - } - } - } - - /** - * Returns title of the current table, - * title can have the dimensions/co-ordinates of the table - * - * @return string title of the current table - */ - protected function getTitle() - { - return ($this->tableDimension - ? sprintf('%.0fx%0.f', $this->width, $this->heightCell) - : '' - ) - . ' ' . $this->tableName; - } -} diff --git a/#pma/libraries/plugins/schema/dia/Dia.php b/#pma/libraries/plugins/schema/dia/Dia.php deleted file mode 100644 index 4aad6e06..00000000 --- a/#pma/libraries/plugins/schema/dia/Dia.php +++ /dev/null @@ -1,188 +0,0 @@ -openMemory(); - /* - * Set indenting using three spaces, - * so output is formatted - */ - $this->setIndent(true); - $this->setIndentString(' '); - /* - * Create the XML document - */ - $this->startDocument('1.0', 'UTF-8'); - } - - /** - * Starts Dia Document - * - * dia document starts by first initializing dia:diagram tag - * then dia:diagramdata contains all the attributes that needed - * to define the document, then finally a Layer starts which - * holds all the objects. - * - * @param string $paper the size of the paper/document - * @param float $topMargin top margin of the paper/document in cm - * @param float $bottomMargin bottom margin of the paper/document in cm - * @param float $leftMargin left margin of the paper/document in cm - * @param float $rightMargin right margin of the paper/document in cm - * @param string $orientation orientation of the document, portrait or landscape - * - * @return void - * - * @access public - * @see XMLWriter::startElement(),XMLWriter::writeAttribute(), - * XMLWriter::writeRaw() - */ - public function startDiaDoc( - $paper, - $topMargin, - $bottomMargin, - $leftMargin, - $rightMargin, - $orientation - ) { - if ($orientation == 'P') { - $isPortrait = 'true'; - } else { - $isPortrait = 'false'; - } - $this->startElement('dia:diagram'); - $this->writeAttribute('xmlns:dia', 'http://www.lysator.liu.se/~alla/dia/'); - $this->startElement('dia:diagramdata'); - $this->writeRaw( - ' - - - - - - - - - #' . $paper . '# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' - ); - $this->endElement(); - $this->startElement('dia:layer'); - $this->writeAttribute('name', 'Background'); - $this->writeAttribute('visible', 'true'); - $this->writeAttribute('active', 'true'); - } - - /** - * Ends Dia Document - * - * @return void - * @access public - * @see XMLWriter::endElement(),XMLWriter::endDocument() - */ - public function endDiaDoc() - { - $this->endElement(); - $this->endDocument(); - } - - /** - * Output Dia Document for download - * - * @param string $fileName name of the dia document - * - * @return void - * @access public - * @see XMLWriter::flush() - */ - public function showOutput($fileName) - { - if (ob_get_clean()) { - ob_end_clean(); - } - $output = $this->flush(); - PMA\libraries\Response::getInstance() - ->disable(); - PMA_downloadHeader( - $fileName, - 'application/x-dia-diagram', - strlen($output) - ); - print $output; - } -} diff --git a/#pma/libraries/plugins/schema/dia/DiaRelationSchema.php b/#pma/libraries/plugins/schema/dia/DiaRelationSchema.php deleted file mode 100644 index 01a0249f..00000000 --- a/#pma/libraries/plugins/schema/dia/DiaRelationSchema.php +++ /dev/null @@ -1,227 +0,0 @@ -setShowColor(isset($_REQUEST['dia_show_color'])); - $this->setShowKeys(isset($_REQUEST['dia_show_keys'])); - $this->setOrientation($_REQUEST['dia_orientation']); - $this->setPaper($_REQUEST['dia_paper']); - - $this->diagram->startDiaDoc( - $this->paper, - $this->_topMargin, - $this->_bottomMargin, - $this->_leftMargin, - $this->_rightMargin, - $this->orientation - ); - - $alltables = $this->getTablesFromRequest(); - - foreach ($alltables as $table) { - if (!isset($this->tables[$table])) { - $this->_tables[$table] = new TableStatsDia( - $this->diagram, $this->db, $table, $this->pageNumber, - $this->showKeys, $this->offline - ); - } - } - - $seen_a_relation = false; - foreach ($alltables as $one_table) { - $exist_rel = PMA_getForeigners($this->db, $one_table, '', 'both'); - if (!$exist_rel) { - continue; - } - - $seen_a_relation = true; - foreach ($exist_rel as $master_field => $rel) { - /* put the foreign table on the schema only if selected - * by the user - * (do not use array_search() because we would have to - * to do a === false and this is not PHP3 compatible) - */ - if ($master_field != 'foreign_keys_data') { - if (in_array($rel['foreign_table'], $alltables)) { - $this->_addRelation( - $one_table, - $master_field, - $rel['foreign_table'], - $rel['foreign_field'], - $this->showKeys - ); - } - continue; - } - - foreach ($rel as $one_key) { - if (!in_array($one_key['ref_table_name'], $alltables)) { - continue; - } - - foreach ($one_key['index_list'] as $index => $one_field) { - $this->_addRelation( - $one_table, - $one_field, - $one_key['ref_table_name'], - $one_key['ref_index_list'][$index], - $this->showKeys - ); - } - } - } - } - $this->_drawTables(); - - if ($seen_a_relation) { - $this->_drawRelations(); - } - $this->diagram->endDiaDoc(); - } - - /** - * Output Dia Document for download - * - * @return void - * @access public - */ - public function showOutput() - { - $this->diagram->showOutput($this->getFileName('.dia')); - } - - /** - * Defines relation objects - * - * @param string $masterTable The master table name - * @param string $masterField The relation field in the master table - * @param string $foreignTable The foreign table name - * @param string $foreignField The relation field in the foreign table - * @param bool $showKeys Whether to display ONLY keys or not - * - * @return void - * - * @access private - * @see TableStatsDia::__construct(),RelationStatsDia::__construct() - */ - private function _addRelation( - $masterTable, - $masterField, - $foreignTable, - $foreignField, - $showKeys - ) { - if (!isset($this->_tables[$masterTable])) { - $this->_tables[$masterTable] = new TableStatsDia( - $this->diagram, $this->db, $masterTable, $this->pageNumber, $showKeys - ); - } - if (!isset($this->_tables[$foreignTable])) { - $this->_tables[$foreignTable] = new TableStatsDia( - $this->diagram, - $this->db, - $foreignTable, - $this->pageNumber, - $showKeys - ); - } - $this->_relations[] = new RelationStatsDia( - $this->diagram, - $this->_tables[$masterTable], - $masterField, - $this->_tables[$foreignTable], - $foreignField - ); - } - - /** - * Draws relation references - * - * connects master table's master field to - * foreign table's foreign field using Dia object - * type Database - Reference - * - * @return void - * - * @access private - * @see RelationStatsDia::relationDraw() - */ - private function _drawRelations() - { - foreach ($this->_relations as $relation) { - $relation->relationDraw($this->showColor); - } - } - - /** - * Draws tables - * - * Tables are generated using Dia object type Database - Table - * primary fields are underlined and bold in tables - * - * @return void - * - * @access private - * @see TableStatsDia::tableDraw() - */ - private function _drawTables() - { - foreach ($this->_tables as $table) { - $table->tableDraw($this->showColor); - } - } -} diff --git a/#pma/libraries/plugins/schema/dia/RelationStatsDia.php b/#pma/libraries/plugins/schema/dia/RelationStatsDia.php deleted file mode 100644 index f40ec225..00000000 --- a/#pma/libraries/plugins/schema/dia/RelationStatsDia.php +++ /dev/null @@ -1,214 +0,0 @@ -diagram = $diagram; - $src_pos = $this->_getXy($master_table, $master_field); - $dest_pos = $this->_getXy($foreign_table, $foreign_field); - $this->srcConnPointsLeft = $src_pos[0]; - $this->srcConnPointsRight = $src_pos[1]; - $this->destConnPointsLeft = $dest_pos[0]; - $this->destConnPointsRight = $dest_pos[1]; - $this->masterTablePos = $src_pos[2]; - $this->foreignTablePos = $dest_pos[2]; - $this->masterTableId = $master_table->tableId; - $this->foreignTableId = $foreign_table->tableId; - } - - /** - * Each Table object have connection points - * which is used to connect to other objects in Dia - * we detect the position of key in fields and - * then determines its left and right connection - * points. - * - * @param string $table The current table name - * @param string $column The relation column name - * - * @return array Table right,left connection points and key position - * - * @access private - */ - private function _getXy($table, $column) - { - $pos = array_search($column, $table->fields); - // left, right, position - $value = 12; - if ($pos != 0) { - return array($pos + $value + $pos, $pos + $value + $pos + 1, $pos); - } - return array($pos + $value , $pos + $value + 1, $pos); - } - - /** - * Draws relation references - * - * connects master table's master field to foreign table's - * foreign field using Dia object type Database - Reference - * Dia object is used to generate the XML of Dia Document. - * Database reference Object and their attributes are involved - * in the combination of displaying Database - reference on Dia Document. - * - * @param boolean $showColor Whether to use one color per relation or not - * if showColor is true then an array of $listOfColors - * will be used to choose the random colors for - * references lines. we can change/add more colors to - * this - * - * @return boolean|void - * - * @access public - * @see PDF - */ - public function relationDraw($showColor) - { - ++DiaRelationSchema::$objectId; - /* - * if source connection points and destination connection - * points are same then return it false and don't draw that - * relation - */ - if ($this->srcConnPointsRight == $this->destConnPointsRight) { - if ($this->srcConnPointsLeft == $this->destConnPointsLeft) { - return false; - } - } - - if ($showColor) { - $listOfColors = array( - 'FF0000', - '000099', - '00FF00', - ); - shuffle($listOfColors); - $this->referenceColor = '#' . $listOfColors[0] . ''; - } else { - $this->referenceColor = '#000000'; - } - - $this->diagram->writeRaw( - ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - #n# - - - - - - - - - - - - ' - ); - } -} diff --git a/#pma/libraries/plugins/schema/dia/TableStatsDia.php b/#pma/libraries/plugins/schema/dia/TableStatsDia.php deleted file mode 100644 index 883af32e..00000000 --- a/#pma/libraries/plugins/schema/dia/TableStatsDia.php +++ /dev/null @@ -1,229 +0,0 @@ -tableId = ++DiaRelationSchema::$objectId; - } - - /** - * Displays an error when the table cannot be found. - * - * @return void - */ - protected function showMissingTableError() - { - ExportRelationSchema::dieSchema( - $this->pageNumber, - "DIA", - sprintf(__('The %s table doesn\'t exist!'), $this->tableName) - ); - } - - /** - * Do draw the table - * - * Tables are generated using object type Database - Table - * primary fields are underlined in tables. Dia object - * is used to generate the XML of Dia Document. Database Table - * Object and their attributes are involved in the combination - * of displaying Database - Table on Dia Document. - * - * @param boolean $showColor Whether to show color for tables text or not - * if showColor is true then an array of $listOfColors - * will be used to choose the random colors for tables - * text we can change/add more colors to this array - * - * @return void - * - * @access public - * @see Dia - */ - public function tableDraw($showColor) - { - if ($showColor) { - $listOfColors = array( - 'FF0000', - '000099', - '00FF00' - ); - shuffle($listOfColors); - $this->tableColor = '#' . $listOfColors[0] . ''; - } else { - $this->tableColor = '#000000'; - } - - $factor = 0.1; - - $this->diagram->startElement('dia:object'); - $this->diagram->writeAttribute('type', 'Database - Table'); - $this->diagram->writeAttribute('version', '0'); - $this->diagram->writeAttribute('id', '' . $this->tableId . ''); - $this->diagram->writeRaw( - ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #' . $this->tableName . '# - - - ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' - ); - - $this->diagram->startElement('dia:attribute'); - $this->diagram->writeAttribute('name', 'attributes'); - - foreach ($this->fields as $field) { - $this->diagram->writeRaw( - ' - - #' . $field . '# - - - ## - - - ## - ' - ); - unset($pm); - $pm = 'false'; - if (in_array($field, $this->primary)) { - $pm = 'true'; - } - if ($field == $this->displayfield) { - $pm = 'false'; - } - $this->diagram->writeRaw( - ' - - - - - - - - - ' - ); - } - $this->diagram->endElement(); - $this->diagram->endElement(); - } -} diff --git a/#pma/libraries/plugins/schema/eps/Eps.php b/#pma/libraries/plugins/schema/eps/Eps.php deleted file mode 100644 index de39521d..00000000 --- a/#pma/libraries/plugins/schema/eps/Eps.php +++ /dev/null @@ -1,277 +0,0 @@ -stringCommands = ""; - $this->stringCommands .= "%!PS-Adobe-3.0 EPSF-3.0 \n"; - } - - /** - * Set document title - * - * @param string $value sets the title text - * - * @return void - */ - public function setTitle($value) - { - $this->stringCommands .= '%%Title: ' . $value . "\n"; - } - - /** - * Set document author - * - * @param string $value sets the author - * - * @return void - */ - public function setAuthor($value) - { - $this->stringCommands .= '%%Creator: ' . $value . "\n"; - } - - /** - * Set document creation date - * - * @param string $value sets the date - * - * @return void - */ - public function setDate($value) - { - $this->stringCommands .= '%%CreationDate: ' . $value . "\n"; - } - - /** - * Set document orientation - * - * @param string $orientation sets the orientation - * - * @return void - */ - public function setOrientation($orientation) - { - $this->stringCommands .= "%%PageOrder: Ascend \n"; - if ($orientation == "L") { - $orientation = "Landscape"; - $this->stringCommands .= '%%Orientation: ' . $orientation . "\n"; - } else { - $orientation = "Portrait"; - $this->stringCommands .= '%%Orientation: ' . $orientation . "\n"; - } - $this->stringCommands .= "%%EndComments \n"; - $this->stringCommands .= "%%Pages 1 \n"; - $this->stringCommands .= "%%BoundingBox: 72 150 144 170 \n"; - } - - /** - * Set the font and size - * - * font can be set whenever needed in EPS - * - * @param string $value sets the font name e.g Arial - * @param integer $size sets the size of the font e.g 10 - * - * @return void - */ - public function setFont($value, $size) - { - $this->font = $value; - $this->fontSize = $size; - $this->stringCommands .= "/" . $value . " findfont % Get the basic font\n"; - $this->stringCommands .= "" - . $size . " scalefont % Scale the font to $size points\n"; - $this->stringCommands - .= "setfont % Make it the current font\n"; - } - - /** - * Get the font - * - * @return string return the font name e.g Arial - */ - public function getFont() - { - return $this->font; - } - - /** - * Get the font Size - * - * @return string return the size of the font e.g 10 - */ - public function getFontSize() - { - return $this->fontSize; - } - - /** - * Draw the line - * - * drawing the lines from x,y source to x,y destination and set the - * width of the line. lines helps in showing relationships of tables - * - * @param integer $x_from The x_from attribute defines the start - * left position of the element - * @param integer $y_from The y_from attribute defines the start - * right position of the element - * @param integer $x_to The x_to attribute defines the end - * left position of the element - * @param integer $y_to The y_to attribute defines the end - * right position of the element - * @param integer $lineWidth Sets the width of the line e.g 2 - * - * @return void - */ - public function line( - $x_from = 0, - $y_from = 0, - $x_to = 0, - $y_to = 0, - $lineWidth = 0 - ) { - $this->stringCommands .= $lineWidth . " setlinewidth \n"; - $this->stringCommands .= $x_from . ' ' . $y_from . " moveto \n"; - $this->stringCommands .= $x_to . ' ' . $y_to . " lineto \n"; - $this->stringCommands .= "stroke \n"; - } - - /** - * Draw the rectangle - * - * drawing the rectangle from x,y source to x,y destination and set the - * width of the line. rectangles drawn around the text shown of fields - * - * @param integer $x_from The x_from attribute defines the start - * left position of the element - * @param integer $y_from The y_from attribute defines the start - * right position of the element - * @param integer $x_to The x_to attribute defines the end - * left position of the element - * @param integer $y_to The y_to attribute defines the end - * right position of the element - * @param integer $lineWidth Sets the width of the line e.g 2 - * - * @return void - */ - public function rect($x_from, $y_from, $x_to, $y_to, $lineWidth) - { - $this->stringCommands .= $lineWidth . " setlinewidth \n"; - $this->stringCommands .= "newpath \n"; - $this->stringCommands .= $x_from . " " . $y_from . " moveto \n"; - $this->stringCommands .= "0 " . $y_to . " rlineto \n"; - $this->stringCommands .= $x_to . " 0 rlineto \n"; - $this->stringCommands .= "0 -" . $y_to . " rlineto \n"; - $this->stringCommands .= "closepath \n"; - $this->stringCommands .= "stroke \n"; - } - - /** - * Set the current point - * - * The moveto operator takes two numbers off the stack and treats - * them as x and y coordinates to which to move. The coordinates - * specified become the current point. - * - * @param integer $x The x attribute defines the left position of the element - * @param integer $y The y attribute defines the right position of the element - * - * @return void - */ - public function moveTo($x, $y) - { - $this->stringCommands .= $x . ' ' . $y . " moveto \n"; - } - - /** - * Output/Display the text - * - * @param string $text The string to be displayed - * - * @return void - */ - public function show($text) - { - $this->stringCommands .= '(' . $text . ") show \n"; - } - - /** - * Output the text at specified co-ordinates - * - * @param string $text String to be displayed - * @param integer $x X attribute defines the left position of the element - * @param integer $y Y attribute defines the right position of the element - * - * @return void - */ - public function showXY($text, $x, $y) - { - $this->moveTo($x, $y); - $this->show($text); - } - - /** - * Ends EPS Document - * - * @return void - */ - public function endEpsDoc() - { - $this->stringCommands .= "showpage \n"; - } - - /** - * Output EPS Document for download - * - * @param string $fileName name of the eps document - * - * @return void - */ - public function showOutput($fileName) - { - // if(ob_get_clean()){ - //ob_end_clean(); - //} - $output = $this->stringCommands; - Response::getInstance() - ->disable(); - PMA_downloadHeader( - $fileName, - 'image/x-eps', - strlen($output) - ); - print $output; - } -} diff --git a/#pma/libraries/plugins/schema/eps/EpsRelationSchema.php b/#pma/libraries/plugins/schema/eps/EpsRelationSchema.php deleted file mode 100644 index 5caed6da..00000000 --- a/#pma/libraries/plugins/schema/eps/EpsRelationSchema.php +++ /dev/null @@ -1,223 +0,0 @@ -setShowColor(isset($_REQUEST['eps_show_color'])); - $this->setShowKeys(isset($_REQUEST['eps_show_keys'])); - $this->setTableDimension(isset($_REQUEST['eps_show_table_dimension'])); - $this->setAllTablesSameWidth(isset($_REQUEST['eps_all_tables_same_width'])); - $this->setOrientation($_REQUEST['eps_orientation']); - - $this->diagram->setTitle( - sprintf( - __('Schema of the %s database - Page %s'), - $this->db, - $this->pageNumber - ) - ); - $this->diagram->setAuthor('phpMyAdmin ' . PMA_VERSION); - $this->diagram->setDate(date("j F Y, g:i a")); - $this->diagram->setOrientation($this->orientation); - $this->diagram->setFont('Verdana', '10'); - - $alltables = $this->getTablesFromRequest(); - - foreach ($alltables as $table) { - if (! isset($this->_tables[$table])) { - $this->_tables[$table] = new TableStatsEps( - $this->diagram, $this->db, - $table, $this->diagram->getFont(), - $this->diagram->getFontSize(), $this->pageNumber, - $this->_tablewidth, $this->showKeys, - $this->tableDimension, $this->offline - ); - } - - if ($this->sameWide) { - $this->_tables[$table]->width = $this->_tablewidth; - } - } - - $seen_a_relation = false; - foreach ($alltables as $one_table) { - $exist_rel = PMA_getForeigners($this->db, $one_table, '', 'both'); - if (!$exist_rel) { - continue; - } - - $seen_a_relation = true; - foreach ($exist_rel as $master_field => $rel) { - /* put the foreign table on the schema only if selected - * by the user - * (do not use array_search() because we would have to - * to do a === false and this is not PHP3 compatible) - */ - if ($master_field != 'foreign_keys_data') { - if (in_array($rel['foreign_table'], $alltables)) { - $this->_addRelation( - $one_table, $this->diagram->getFont(), $this->diagram->getFontSize(), - $master_field, $rel['foreign_table'], - $rel['foreign_field'], $this->tableDimension - ); - } - continue; - } - - foreach ($rel as $one_key) { - if (!in_array($one_key['ref_table_name'], $alltables)) { - continue; - } - - foreach ($one_key['index_list'] - as $index => $one_field - ) { - $this->_addRelation( - $one_table, $this->diagram->getFont(), - $this->diagram->getFontSize(), - $one_field, $one_key['ref_table_name'], - $one_key['ref_index_list'][$index], - $this->tableDimension - ); - } - } - } - } - if ($seen_a_relation) { - $this->_drawRelations(); - } - - $this->_drawTables(); - $this->diagram->endEpsDoc(); - } - - /** - * Output Eps Document for download - * - * @return void - */ - public function showOutput() - { - $this->diagram->showOutput($this->getFileName('.eps')); - } - - /** - * Defines relation objects - * - * @param string $masterTable The master table name - * @param string $font The font - * @param int $fontSize The font size - * @param string $masterField The relation field in the master table - * @param string $foreignTable The foreign table name - * @param string $foreignField The relation field in the foreign table - * @param boolean $tableDimension Whether to display table position or not - * - * @return void - * - * @see _setMinMax,Table_Stats_Eps::__construct(), - * PMA\libraries\plugins\schema\eps\RelationStatsEps::__construct() - */ - private function _addRelation( - $masterTable, $font, $fontSize, $masterField, - $foreignTable, $foreignField, $tableDimension - ) { - if (! isset($this->_tables[$masterTable])) { - $this->_tables[$masterTable] = new TableStatsEps( - $this->diagram, $this->db, $masterTable, $font, $fontSize, - $this->pageNumber, $this->_tablewidth, false, $tableDimension - ); - } - if (! isset($this->_tables[$foreignTable])) { - $this->_tables[$foreignTable] = new TableStatsEps( - $this->diagram, $this->db, $foreignTable, $font, $fontSize, - $this->pageNumber, $this->_tablewidth, false, $tableDimension - ); - } - $this->_relations[] = new RelationStatsEps( - $this->diagram, - $this->_tables[$masterTable], - $masterField, - $this->_tables[$foreignTable], - $foreignField - ); - } - - /** - * Draws relation arrows and lines connects master table's master field to - * foreign table's foreign field - * - * @return void - * - * @see Relation_Stats_Eps::relationDraw() - */ - private function _drawRelations() - { - foreach ($this->_relations as $relation) { - $relation->relationDraw(); - } - } - - /** - * Draws tables - * - * @return void - * - * @see Table_Stats_Eps::Table_Stats_tableDraw() - */ - private function _drawTables() - { - foreach ($this->_tables as $table) { - $table->tableDraw($this->showColor); - } - } -} diff --git a/#pma/libraries/plugins/schema/eps/RelationStatsEps.php b/#pma/libraries/plugins/schema/eps/RelationStatsEps.php deleted file mode 100644 index 23824000..00000000 --- a/#pma/libraries/plugins/schema/eps/RelationStatsEps.php +++ /dev/null @@ -1,110 +0,0 @@ -wTick = 10; - parent::__construct( - $diagram, $master_table, $master_field, $foreign_table, $foreign_field - ); - $this->ySrc += 10; - $this->yDest += 10; - } - - /** - * draws relation links and arrows - * shows foreign key relations - * - * @see PMA_EPS - * - * @return void - */ - public function relationDraw() - { - // draw a line like -- to foreign field - $this->diagram->line( - $this->xSrc, - $this->ySrc, - $this->xSrc + $this->srcDir * $this->wTick, - $this->ySrc, - 1 - ); - // draw a line like -- to master field - $this->diagram->line( - $this->xDest + $this->destDir * $this->wTick, - $this->yDest, - $this->xDest, - $this->yDest, - 1 - ); - // draw a line that connects to master field line and foreign field line - $this->diagram->line( - $this->xSrc + $this->srcDir * $this->wTick, - $this->ySrc, - $this->xDest + $this->destDir * $this->wTick, - $this->yDest, - 1 - ); - $root2 = 2 * sqrt(2); - $this->diagram->line( - $this->xSrc + $this->srcDir * $this->wTick * 0.75, - $this->ySrc, - $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, - $this->ySrc + $this->wTick / $root2, - 1 - ); - $this->diagram->line( - $this->xSrc + $this->srcDir * $this->wTick * 0.75, - $this->ySrc, - $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, - $this->ySrc - $this->wTick / $root2, - 1 - ); - $this->diagram->line( - $this->xDest + $this->destDir * $this->wTick / 2, - $this->yDest, - $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, - $this->yDest + $this->wTick / $root2, - 1 - ); - $this->diagram->line( - $this->xDest + $this->destDir * $this->wTick / 2, - $this->yDest, - $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, - $this->yDest - $this->wTick / $root2, - 1 - ); - } -} diff --git a/#pma/libraries/plugins/schema/eps/TableStatsEps.php b/#pma/libraries/plugins/schema/eps/TableStatsEps.php deleted file mode 100644 index c53cb883..00000000 --- a/#pma/libraries/plugins/schema/eps/TableStatsEps.php +++ /dev/null @@ -1,182 +0,0 @@ -_setHeightTable($fontSize); - // setWidth must me after setHeight, because title - // can include table height which changes table width - $this->_setWidthTable($font, $fontSize); - if ($same_wide_width < $this->width) { - $same_wide_width = $this->width; - } - } - - /** - * Displays an error when the table cannot be found. - * - * @return void - */ - protected function showMissingTableError() - { - ExportRelationSchema::dieSchema( - $this->pageNumber, - "EPS", - sprintf(__('The %s table doesn\'t exist!'), $this->tableName) - ); - } - - /** - * Sets the width of the table - * - * @param string $font The font name - * @param integer $fontSize The font size - * - * @return void - * - * @see PMA_EPS - */ - private function _setWidthTable($font, $fontSize) - { - foreach ($this->fields as $field) { - $this->width = max( - $this->width, - PMA\libraries\Font::getStringWidth($field, $font, $fontSize) - ); - } - $this->width += PMA\libraries\Font::getStringWidth( - ' ', - $font, - $fontSize - ); - /* - * it is unknown what value must be added, because - * table title is affected by the table width value - */ - while ($this->width - < PMA\libraries\Font::getStringWidth( - $this->getTitle(), - $font, - $fontSize - )) { - $this->width += 7; - } - } - - /** - * Sets the height of the table - * - * @param integer $fontSize The font size - * - * @return void - */ - private function _setHeightTable($fontSize) - { - $this->heightCell = $fontSize + 4; - $this->height = (count($this->fields) + 1) * $this->heightCell; - } - - /** - * Draw the table - * - * @param boolean $showColor Whether to display color - * - * @return void - * - * @see PMA_EPS,PMA_EPS::line,PMA_EPS::rect - */ - public function tableDraw($showColor) - { - //echo $this->tableName.'
    '; - $this->diagram->rect( - $this->x, - $this->y + 12, - $this->width, - $this->heightCell, - 1 - ); - $this->diagram->showXY($this->getTitle(), $this->x + 5, $this->y + 14); - foreach ($this->fields as $field) { - $this->currentCell += $this->heightCell; - $this->diagram->rect( - $this->x, - $this->y + 12 + $this->currentCell, - $this->width, - $this->heightCell, - 1 - ); - $this->diagram->showXY( - $field, - $this->x + 5, - $this->y + 14 + $this->currentCell - ); - } - } -} diff --git a/#pma/libraries/plugins/schema/pdf/Pdf.php b/#pma/libraries/plugins/schema/pdf/Pdf.php deleted file mode 100644 index 19a35626..00000000 --- a/#pma/libraries/plugins/schema/pdf/Pdf.php +++ /dev/null @@ -1,396 +0,0 @@ -_pageNumber = $pageNumber; - $this->_withDoc = $withDoc; - $this->_db = $db; - } - - /** - * Sets the value for margins - * - * @param float $c_margin margin - * - * @return void - */ - public function setCMargin($c_margin) - { - $this->cMargin = $c_margin; - } - - /** - * Sets the scaling factor, defines minimum coordinates and margins - * - * @param float|int $scale The scaling factor - * @param float|int $xMin The minimum X coordinate - * @param float|int $yMin The minimum Y coordinate - * @param float|int $leftMargin The left margin - * @param float|int $topMargin The top margin - * - * @return void - */ - public function setScale($scale = 1, $xMin = 0, $yMin = 0, - $leftMargin = -1, $topMargin = -1 - ) { - $this->scale = $scale; - $this->_xMin = $xMin; - $this->_yMin = $yMin; - if ($this->leftMargin != -1) { - $this->leftMargin = $leftMargin; - } - if ($this->topMargin != -1) { - $this->topMargin = $topMargin; - } - } - - /** - * Outputs a scaled cell - * - * @param float|int $w The cell width - * @param float|int $h The cell height - * @param string $txt The text to output - * @param mixed $border Whether to add borders or not - * @param integer $ln Where to put the cursor once the output is done - * @param string $align Align mode - * @param integer $fill Whether to fill the cell with a color or not - * @param string $link Link - * - * @return void - * - * @see TCPDF::Cell() - */ - public function cellScale($w, $h = 0, $txt = '', $border = 0, $ln = 0, - $align = '', $fill = 0, $link = '' - ) { - $h = $h / $this->scale; - $w = $w / $this->scale; - $this->Cell($w, $h, $txt, $border, $ln, $align, $fill, $link); - } - - /** - * Draws a scaled line - * - * @param float $x1 The horizontal position of the starting point - * @param float $y1 The vertical position of the starting point - * @param float $x2 The horizontal position of the ending point - * @param float $y2 The vertical position of the ending point - * - * @return void - * - * @see TCPDF::Line() - */ - public function lineScale($x1, $y1, $x2, $y2) - { - $x1 = ($x1 - $this->_xMin) / $this->scale + $this->leftMargin; - $y1 = ($y1 - $this->_yMin) / $this->scale + $this->topMargin; - $x2 = ($x2 - $this->_xMin) / $this->scale + $this->leftMargin; - $y2 = ($y2 - $this->_yMin) / $this->scale + $this->topMargin; - $this->Line($x1, $y1, $x2, $y2); - } - - /** - * Sets x and y scaled positions - * - * @param float $x The x position - * @param float $y The y position - * - * @return void - * - * @see TCPDF::SetXY() - */ - public function setXyScale($x, $y) - { - $x = ($x - $this->_xMin) / $this->scale + $this->leftMargin; - $y = ($y - $this->_yMin) / $this->scale + $this->topMargin; - $this->SetXY($x, $y); - } - - /** - * Sets the X scaled positions - * - * @param float $x The x position - * - * @return void - * - * @see TCPDF::SetX() - */ - public function setXScale($x) - { - $x = ($x - $this->_xMin) / $this->scale + $this->leftMargin; - $this->SetX($x); - } - - /** - * Sets the scaled font size - * - * @param float $size The font size (in points) - * - * @return void - * - * @see TCPDF::SetFontSize() - */ - public function setFontSizeScale($size) - { - // Set font size in points - $size = $size / $this->scale; - $this->SetFontSize($size); - } - - /** - * Sets the scaled line width - * - * @param float $width The line width - * - * @return void - * - * @see TCPDF::SetLineWidth() - */ - public function setLineWidthScale($width) - { - $width = $width / $this->scale; - $this->SetLineWidth($width); - } - - /** - * This method is used to render the page header. - * - * @return void - * - * @see TCPDF::Header() - */ - public function Header() - { - // We only show this if we find something in the new pdf_pages table - - // This function must be named "Header" to work with the TCPDF library - if ($this->_withDoc) { - if ($this->_offline || $this->_pageNumber == -1) { - $pg_name = __("PDF export page"); - } else { - $test_query = 'SELECT * FROM ' - . Util::backquote($GLOBALS['cfgRelation']['db']) . '.' - . Util::backquote($GLOBALS['cfgRelation']['pdf_pages']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($this->_db) - . '\' AND page_nr = \'' . $this->_pageNumber . '\''; - $test_rs = PMA_queryAsControlUser($test_query); - $pages = @$GLOBALS['dbi']->fetchAssoc($test_rs); - $pg_name = ucfirst($pages['page_descr']); - } - - $this->SetFont($this->_ff, 'B', 14); - $this->Cell(0, 6, $pg_name, 'B', 1, 'C'); - $this->SetFont($this->_ff, ''); - $this->Ln(); - } - } - - /** - * This function must be named "Footer" to work with the TCPDF library - * - * @return void - * - * @see PDF::Footer() - */ - public function Footer() - { - if ($this->_withDoc) { - parent::Footer(); - } - } - - /** - * Sets widths - * - * @param array $w array of widths - * - * @return void - */ - public function SetWidths($w) - { - // column widths - $this->widths = $w; - } - - /** - * Generates table row. - * - * @param array $data Data for table - * @param array $links Links for table cells - * - * @return void - */ - public function Row($data, $links) - { - // line height - $nb = 0; - $data_cnt = count($data); - for ($i = 0;$i < $data_cnt;$i++) { - $nb = max($nb, $this->NbLines($this->widths[$i], $data[$i])); - } - $il = $this->FontSize; - $h = ($il + 1) * $nb; - // page break if necessary - $this->CheckPageBreak($h); - // draw the cells - $data_cnt = count($data); - for ($i = 0;$i < $data_cnt;$i++) { - $w = $this->widths[$i]; - // save current position - $x = $this->GetX(); - $y = $this->GetY(); - // draw the border - $this->Rect($x, $y, $w, $h); - if (isset($links[$i])) { - $this->Link($x, $y, $w, $h, $links[$i]); - } - // print text - $this->MultiCell($w, $il + 1, $data[$i], 0, 'L'); - // go to right side - $this->SetXY($x + $w, $y); - } - // go to line - $this->Ln($h); - } - - /** - * Compute number of lines used by a multicell of width w - * - * @param int $w width - * @param string $txt text - * - * @return int - */ - public function NbLines($w, $txt) - { - $cw = &$this->CurrentFont['cw']; - if ($w == 0) { - $w = $this->w - $this->rMargin - $this->x; - } - $wmax = ($w-2 * $this->cMargin) * 1000 / $this->FontSize; - $s = str_replace("\r", '', $txt); - $nb = mb_strlen($s); - if ($nb > 0 && $s[$nb-1] == "\n") { - $nb--; - } - $sep = -1; - $i = 0; - $j = 0; - $l = 0; - $nl = 1; - while ($i < $nb) { - $c = $s[$i]; - if ($c == "\n") { - $i++; - $sep = -1; - $j = $i; - $l = 0; - $nl++; - continue; - } - if ($c == ' ') { - $sep = $i; - } - $l += isset($cw[mb_ord($c)])?$cw[mb_ord($c)]:0 ; - if ($l > $wmax) { - if ($sep == -1) { - if ($i == $j) { - $i++; - } - } else { - $i = $sep + 1; - } - $sep = -1; - $j = $i; - $l = 0; - $nl++; - } else { - $i++; - } - } - return $nl; - } - - /** - * Set whether the document is generated from client side DB - * - * @param string $value whether offline - * - * @return void - * - * @access private - */ - public function setOffline($value) - { - $this->_offline = $value; - } -} diff --git a/#pma/libraries/plugins/schema/pdf/PdfRelationSchema.php b/#pma/libraries/plugins/schema/pdf/PdfRelationSchema.php deleted file mode 100644 index 809da775..00000000 --- a/#pma/libraries/plugins/schema/pdf/PdfRelationSchema.php +++ /dev/null @@ -1,732 +0,0 @@ -setShowGrid(isset($_REQUEST['pdf_show_grid'])); - $this->setShowColor(isset($_REQUEST['pdf_show_color'])); - $this->setShowKeys(isset($_REQUEST['pdf_show_keys'])); - $this->setTableDimension(isset($_REQUEST['pdf_show_table_dimension'])); - $this->setAllTablesSameWidth(isset($_REQUEST['pdf_all_tables_same_width'])); - $this->setWithDataDictionary(isset($_REQUEST['pdf_with_doc'])); - $this->setTableOrder($_REQUEST['pdf_table_order']); - $this->setOrientation($_REQUEST['pdf_orientation']); - $this->setPaper($_REQUEST['pdf_paper']); - - // Initializes a new document - parent::__construct( - $db, - new Pdf( - $this->orientation, 'mm', $this->paper, - $this->pageNumber, $this->_withDoc, $db - ) - ); - $this->diagram->SetTitle( - sprintf( - __('Schema of the %s database'), - $this->db - ) - ); - $this->diagram->setCMargin(0); - $this->diagram->Open(); - $this->diagram->SetAutoPageBreak('auto'); - $this->diagram->setOffline($this->offline); - - $alltables = $this->getTablesFromRequest(); - if ($this->getTableOrder() == 'name_asc') { - sort($alltables); - } else if ($this->getTableOrder() == 'name_desc') { - rsort($alltables); - } - - if ($this->_withDoc) { - $this->diagram->SetAutoPageBreak('auto', 15); - $this->diagram->setCMargin(1); - $this->dataDictionaryDoc($alltables); - $this->diagram->SetAutoPageBreak('auto'); - $this->diagram->setCMargin(0); - } - - $this->diagram->Addpage(); - - if ($this->_withDoc) { - $this->diagram->SetLink($this->diagram->PMA_links['RT']['-'], -1); - $this->diagram->Bookmark(__('Relational schema')); - $this->diagram->SetAlias('{00}', $this->diagram->PageNo()); - $this->_topMargin = 28; - $this->_bottomMargin = 28; - } - - /* snip */ - foreach ($alltables as $table) { - if (! isset($this->_tables[$table])) { - $this->_tables[$table] = new TableStatsPdf( - $this->diagram, - $this->db, - $table, - null, - $this->pageNumber, - $this->_tablewidth, - $this->showKeys, - $this->tableDimension, - $this->offline - ); - } - if ($this->sameWide) { - $this->_tables[$table]->width = $this->_tablewidth; - } - $this->_setMinMax($this->_tables[$table]); - } - - // Defines the scale factor - $innerWidth = $this->diagram->getPageWidth() - $this->_rightMargin - - $this->_leftMargin; - $innerHeight = $this->diagram->getPageHeight() - $this->_topMargin - - $this->_bottomMargin; - $this->_scale = ceil( - max( - ($this->_xMax - $this->_xMin) / $innerWidth, - ($this->_yMax - $this->_yMin) / $innerHeight - ) * 100 - ) / 100; - - $this->diagram->setScale( - $this->_scale, - $this->_xMin, - $this->_yMin, - $this->_leftMargin, - $this->_topMargin - ); - // Builds and save the PDF document - $this->diagram->setLineWidthScale(0.1); - - if ($this->_showGrid) { - $this->diagram->SetFontSize(10); - $this->_strokeGrid(); - } - $this->diagram->setFontSizeScale(14); - // previous logic was checking master tables and foreign tables - // but I think that looping on every table of the pdf page as a master - // and finding its foreigns is OK (then we can support innodb) - $seen_a_relation = false; - foreach ($alltables as $one_table) { - $exist_rel = PMA_getForeigners($this->db, $one_table, '', 'both'); - if (!$exist_rel) { - continue; - } - - $seen_a_relation = true; - foreach ($exist_rel as $master_field => $rel) { - // put the foreign table on the schema only if selected - // by the user - // (do not use array_search() because we would have to - // to do a === false and this is not PHP3 compatible) - if ($master_field != 'foreign_keys_data') { - if (in_array($rel['foreign_table'], $alltables)) { - $this->_addRelation( - $one_table, - $master_field, - $rel['foreign_table'], - $rel['foreign_field'] - ); - } - continue; - } - - foreach ($rel as $one_key) { - if (!in_array($one_key['ref_table_name'], $alltables)) { - continue; - } - - foreach ($one_key['index_list'] - as $index => $one_field - ) { - $this->_addRelation( - $one_table, - $one_field, - $one_key['ref_table_name'], - $one_key['ref_index_list'][$index] - ); - } - } - } // end while - } // end while - - if ($seen_a_relation) { - $this->_drawRelations(); - } - $this->_drawTables(); - } - - /** - * Set Show Grid - * - * @param boolean $value show grid of the document or not - * - * @return void - */ - public function setShowGrid($value) - { - $this->_showGrid = $value; - } - - /** - * Returns whether to show grid - * - * @return boolean whether to show grid - */ - public function isShowGrid() - { - return $this->_showGrid; - } - - /** - * Set Data Dictionary - * - * @param boolean $value show selected database data dictionary or not - * - * @return void - */ - public function setWithDataDictionary($value) - { - $this->_withDoc = $value; - } - - /** - * Return whether to show selected database data dictionary or not - * - * @return boolean whether to show selected database data dictionary or not - */ - public function isWithDataDictionary() - { - return $this->_withDoc; - } - - /** - * Sets the order of the table in data dictionary - * - * @param string $value table order - * - * @return void - */ - public function setTableOrder($value) - { - $this->_tableOrder = $value; - } - - /** - * Returns the order of the table in data dictionary - * - * @return string table order - */ - public function getTableOrder() - { - return $this->_tableOrder; - } - - /** - * Output Pdf Document for download - * - * @return void - */ - public function showOutput() - { - $this->diagram->Download($this->getFileName('.pdf')); - } - - /** - * Sets X and Y minimum and maximum for a table cell - * - * @param TableStatsPdf $table The table name of which sets XY co-ordinates - * - * @return void - */ - private function _setMinMax($table) - { - $this->_xMax = max($this->_xMax, $table->x + $table->width); - $this->_yMax = max($this->_yMax, $table->y + $table->height); - $this->_xMin = min($this->_xMin, $table->x); - $this->_yMin = min($this->_yMin, $table->y); - } - - /** - * Defines relation objects - * - * @param string $masterTable The master table name - * @param string $masterField The relation field in the master table - * @param string $foreignTable The foreign table name - * @param string $foreignField The relation field in the foreign table - * - * @return void - * - * @see _setMinMax - */ - private function _addRelation($masterTable, $masterField, $foreignTable, - $foreignField - ) { - if (! isset($this->_tables[$masterTable])) { - $this->_tables[$masterTable] = new TableStatsPdf( - $this->diagram, - $this->db, - $masterTable, - null, - $this->pageNumber, - $this->_tablewidth, - $this->showKeys, - $this->tableDimension - ); - $this->_setMinMax($this->_tables[$masterTable]); - } - if (! isset($this->_tables[$foreignTable])) { - $this->_tables[$foreignTable] = new TableStatsPdf( - $this->diagram, - $this->db, - $foreignTable, - null, - $this->pageNumber, - $this->_tablewidth, - $this->showKeys, - $this->tableDimension - ); - $this->_setMinMax($this->_tables[$foreignTable]); - } - $this->relations[] = new RelationStatsPdf( - $this->diagram, - $this->_tables[$masterTable], - $masterField, - $this->_tables[$foreignTable], - $foreignField - ); - } - - /** - * Draws the grid - * - * @return void - * - * @see PMA_Schema_PDF - */ - private function _strokeGrid() - { - $gridSize = 10; - $labelHeight = 4; - $labelWidth = 5; - if ($this->_withDoc) { - $topSpace = 6; - $bottomSpace = 15; - } else { - $topSpace = 0; - $bottomSpace = 0; - } - - $this->diagram->SetMargins(0, 0); - $this->diagram->SetDrawColor(200, 200, 200); - // Draws horizontal lines - $innerHeight = $this->diagram->getPageHeight() - $topSpace - $bottomSpace; - for ($l = 0, - $size = intval($innerHeight / $gridSize); - $l <= $size; - $l++ - ) { - $this->diagram->line( - 0, $l * $gridSize + $topSpace, - $this->diagram->getPageWidth(), $l * $gridSize + $topSpace - ); - // Avoid duplicates - if ($l > 0 - && $l <= intval(($innerHeight - $labelHeight) / $gridSize) - ) { - $this->diagram->SetXY(0, $l * $gridSize + $topSpace); - $label = (string) sprintf( - '%.0f', - ($l * $gridSize + $topSpace - $this->_topMargin) - * $this->_scale + $this->_yMin - ); - $this->diagram->Cell($labelWidth, $labelHeight, ' ' . $label); - } // end if - } // end for - // Draws vertical lines - for ( - $j = 0, $size = intval($this->diagram->getPageWidth() / $gridSize); - $j <= $size; - $j++ - ) { - $this->diagram->line( - $j * $gridSize, - $topSpace, - $j * $gridSize, - $this->diagram->getPageHeight() - $bottomSpace - ); - $this->diagram->SetXY($j * $gridSize, $topSpace); - $label = (string) sprintf( - '%.0f', - ($j * $gridSize - $this->_leftMargin) * $this->_scale + $this->_xMin - ); - $this->diagram->Cell($labelWidth, $labelHeight, $label); - } - } - - /** - * Draws relation arrows - * - * @return void - * - * @see Relation_Stats_Pdf::relationdraw() - */ - private function _drawRelations() - { - $i = 0; - foreach ($this->relations as $relation) { - $relation->relationDraw($this->showColor, $i); - $i++; - } - } - - /** - * Draws tables - * - * @return void - * - * @see Table_Stats_Pdf::tableDraw() - */ - private function _drawTables() - { - foreach ($this->_tables as $table) { - $table->tableDraw(null, $this->_withDoc, $this->showColor); - } - } - - /** - * Generates data dictionary pages. - * - * @param array $alltables Tables to document. - * - * @return void - */ - public function dataDictionaryDoc($alltables) - { - // TOC - $this->diagram->addpage($this->orientation); - $this->diagram->Cell(0, 9, __('Table of contents'), 1, 0, 'C'); - $this->diagram->Ln(15); - $i = 1; - foreach ($alltables as $table) { - $this->diagram->PMA_links['doc'][$table]['-'] - = $this->diagram->AddLink(); - $this->diagram->SetX(10); - // $this->diagram->Ln(1); - $this->diagram->Cell( - 0, 6, __('Page number:') . ' {' . sprintf("%02d", $i) . '}', 0, 0, - 'R', 0, $this->diagram->PMA_links['doc'][$table]['-'] - ); - $this->diagram->SetX(10); - $this->diagram->Cell( - 0, 6, $i . ' ' . $table, 0, 1, - 'L', 0, $this->diagram->PMA_links['doc'][$table]['-'] - ); - // $this->diagram->Ln(1); - $fields = $GLOBALS['dbi']->getColumns($this->db, $table); - foreach ($fields as $row) { - $this->diagram->SetX(20); - $field_name = $row['Field']; - $this->diagram->PMA_links['doc'][$table][$field_name] - = $this->diagram->AddLink(); - //$this->diagram->Cell( - // 0, 6, $field_name, 0, 1, - // 'L', 0, $this->diagram->PMA_links['doc'][$table][$field_name] - //); - } - $i++; - } - $this->diagram->PMA_links['RT']['-'] = $this->diagram->AddLink(); - $this->diagram->SetX(10); - $this->diagram->Cell( - 0, 6, __('Page number:') . ' {00}', 0, 0, - 'R', 0, $this->diagram->PMA_links['RT']['-'] - ); - $this->diagram->SetX(10); - $this->diagram->Cell( - 0, 6, $i . ' ' . __('Relational schema'), 0, 1, - 'L', 0, $this->diagram->PMA_links['RT']['-'] - ); - $z = 0; - foreach ($alltables as $table) { - $z++; - $this->diagram->SetAutoPageBreak(true, 15); - $this->diagram->addpage($this->orientation); - $this->diagram->Bookmark($table); - $this->diagram->SetAlias( - '{' . sprintf("%02d", $z) . '}', $this->diagram->PageNo() - ); - $this->diagram->PMA_links['RT'][$table]['-'] - = $this->diagram->AddLink(); - $this->diagram->SetLink( - $this->diagram->PMA_links['doc'][$table]['-'], -1 - ); - $this->diagram->SetFont($this->_ff, 'B', 18); - $this->diagram->Cell( - 0, 8, $z . ' ' . $table, 1, 1, - 'C', 0, $this->diagram->PMA_links['RT'][$table]['-'] - ); - $this->diagram->SetFont($this->_ff, '', 8); - $this->diagram->ln(); - - $cfgRelation = PMA_getRelationsParam(); - $comments = PMA_getComments($this->db, $table); - if ($cfgRelation['mimework']) { - $mime_map = PMA_getMIME($this->db, $table, true); - } - - /** - * Gets table information - */ - $showtable = $GLOBALS['dbi']->getTable($this->db, $table) - ->getStatusInfo(); - $show_comment = isset($showtable['Comment']) - ? $showtable['Comment'] - : ''; - $create_time = isset($showtable['Create_time']) - ? Util::localisedDate( - strtotime($showtable['Create_time']) - ) - : ''; - $update_time = isset($showtable['Update_time']) - ? Util::localisedDate( - strtotime($showtable['Update_time']) - ) - : ''; - $check_time = isset($showtable['Check_time']) - ? Util::localisedDate( - strtotime($showtable['Check_time']) - ) - : ''; - - /** - * Gets fields properties - */ - $columns = $GLOBALS['dbi']->getColumns($this->db, $table); - - // Find which tables are related with the current one and write it in - // an array - $res_rel = PMA_getForeigners($this->db, $table); - - /** - * Displays the comments of the table if MySQL >= 3.23 - */ - - $break = false; - if (! empty($show_comment)) { - $this->diagram->Cell( - 0, 3, __('Table comments:') . ' ' . $show_comment, 0, 1 - ); - $break = true; - } - - if (! empty($create_time)) { - $this->diagram->Cell( - 0, 3, __('Creation:') . ' ' . $create_time, 0, 1 - ); - $break = true; - } - - if (! empty($update_time)) { - $this->diagram->Cell( - 0, 3, __('Last update:') . ' ' . $update_time, 0, 1 - ); - $break = true; - } - - if (! empty($check_time)) { - $this->diagram->Cell( - 0, 3, __('Last check:') . ' ' . $check_time, 0, 1 - ); - $break = true; - } - - if ($break == true) { - $this->diagram->Cell(0, 3, '', 0, 1); - $this->diagram->Ln(); - } - - $this->diagram->SetFont($this->_ff, 'B'); - if (isset($this->orientation) && $this->orientation == 'L') { - $this->diagram->Cell(25, 8, __('Column'), 1, 0, 'C'); - $this->diagram->Cell(20, 8, __('Type'), 1, 0, 'C'); - $this->diagram->Cell(20, 8, __('Attributes'), 1, 0, 'C'); - $this->diagram->Cell(10, 8, __('Null'), 1, 0, 'C'); - $this->diagram->Cell(20, 8, __('Default'), 1, 0, 'C'); - $this->diagram->Cell(25, 8, __('Extra'), 1, 0, 'C'); - $this->diagram->Cell(45, 8, __('Links to'), 1, 0, 'C'); - - if ($this->paper == 'A4') { - $comments_width = 67; - } else { - // this is really intended for 'letter' - /** - * @todo find optimal width for all formats - */ - $comments_width = 50; - } - $this->diagram->Cell($comments_width, 8, __('Comments'), 1, 0, 'C'); - $this->diagram->Cell(45, 8, 'MIME', 1, 1, 'C'); - $this->diagram->SetWidths( - array(25, 20, 20, 10, 20, 25, 45, $comments_width, 45) - ); - } else { - $this->diagram->Cell(20, 8, __('Column'), 1, 0, 'C'); - $this->diagram->Cell(20, 8, __('Type'), 1, 0, 'C'); - $this->diagram->Cell(20, 8, __('Attributes'), 1, 0, 'C'); - $this->diagram->Cell(10, 8, __('Null'), 1, 0, 'C'); - $this->diagram->Cell(15, 8, __('Default'), 1, 0, 'C'); - $this->diagram->Cell(15, 8, __('Extra'), 1, 0, 'C'); - $this->diagram->Cell(30, 8, __('Links to'), 1, 0, 'C'); - $this->diagram->Cell(30, 8, __('Comments'), 1, 0, 'C'); - $this->diagram->Cell(30, 8, 'MIME', 1, 1, 'C'); - $this->diagram->SetWidths(array(20, 20, 20, 10, 15, 15, 30, 30, 30)); - } - $this->diagram->SetFont($this->_ff, ''); - - foreach ($columns as $row) { - $extracted_columnspec - = Util::extractColumnSpec($row['Type']); - $type = $extracted_columnspec['print_type']; - $attribute = $extracted_columnspec['attribute']; - if (! isset($row['Default'])) { - if ($row['Null'] != '' && $row['Null'] != 'NO') { - $row['Default'] = 'NULL'; - } - } - $field_name = $row['Field']; - // $this->diagram->Ln(); - $this->diagram->PMA_links['RT'][$table][$field_name] - = $this->diagram->AddLink(); - $this->diagram->Bookmark($field_name, 1, -1); - $this->diagram->SetLink( - $this->diagram->PMA_links['doc'][$table][$field_name], -1 - ); - $foreigner = PMA_searchColumnInForeigners($res_rel, $field_name); - - $linksTo = ''; - if ($foreigner) { - $linksTo = '-> '; - if ($foreigner['foreign_db'] != $this->db) { - $linksTo .= $foreigner['foreign_db'] . '.'; - } - $linksTo .= $foreigner['foreign_table'] - . '.' . $foreigner['foreign_field']; - - if (isset($foreigner['on_update'])) { // not set for internal - $linksTo .= "\n" . 'ON UPDATE ' . $foreigner['on_update']; - $linksTo .= "\n" . 'ON DELETE ' . $foreigner['on_delete']; - } - } - - $this->diagram_row = array( - $field_name, - $type, - $attribute, - (($row['Null'] == '' || $row['Null'] == 'NO') - ? __('No') - : __('Yes')), - (isset($row['Default']) ? $row['Default'] : ''), - $row['Extra'], - $linksTo, - (isset($comments[$field_name]) - ? $comments[$field_name] - : ''), - (isset($mime_map) && isset($mime_map[$field_name]) - ? str_replace('_', '/', $mime_map[$field_name]['mimetype']) - : '') - ); - $links = array(); - $links[0] = $this->diagram->PMA_links['RT'][$table][$field_name]; - if ($foreigner - && isset($this->diagram->PMA_links['doc'][$foreigner['foreign_table']][$foreigner['foreign_field']]) - ) { - $links[6] = $this->diagram->PMA_links['doc'] - [$foreigner['foreign_table']][$foreigner['foreign_field']]; - } else { - unset($links[6]); - } - $this->diagram->Row($this->diagram_row, $links); - } // end foreach - $this->diagram->SetFont($this->_ff, '', 14); - } //end each - } -} diff --git a/#pma/libraries/plugins/schema/pdf/RelationStatsPdf.php b/#pma/libraries/plugins/schema/pdf/RelationStatsPdf.php deleted file mode 100644 index 06be9c2d..00000000 --- a/#pma/libraries/plugins/schema/pdf/RelationStatsPdf.php +++ /dev/null @@ -1,130 +0,0 @@ -wTick = 5; - parent::__construct( - $diagram, $master_table, $master_field, $foreign_table, $foreign_field - ); - } - - /** - * draws relation links and arrows shows foreign key relations - * - * @param boolean $showColor Whether to use one color per relation or not - * @param integer $i The id of the link to draw - * - * @access public - * - * @return void - * - * @see Pdf - */ - public function relationDraw($showColor, $i) - { - if ($showColor) { - $d = $i % 6; - $j = ($i - $d) / 6; - $j = $j % 4; - $j++; - $case = array( - array(1, 0, 0), - array(0, 1, 0), - array(0, 0, 1), - array(1, 1, 0), - array(1, 0, 1), - array(0, 1, 1) - ); - list ($a, $b, $c) = $case[$d]; - $e = (1 - ($j - 1) / 6); - $this->diagram->SetDrawColor($a * 255 * $e, $b * 255 * $e, $c * 255 * $e); - } else { - $this->diagram->SetDrawColor(0); - } - $this->diagram->setLineWidthScale(0.2); - $this->diagram->lineScale( - $this->xSrc, - $this->ySrc, - $this->xSrc + $this->srcDir * $this->wTick, - $this->ySrc - ); - $this->diagram->lineScale( - $this->xDest + $this->destDir * $this->wTick, - $this->yDest, - $this->xDest, - $this->yDest - ); - $this->diagram->setLineWidthScale(0.1); - $this->diagram->lineScale( - $this->xSrc + $this->srcDir * $this->wTick, - $this->ySrc, - $this->xDest + $this->destDir * $this->wTick, - $this->yDest - ); - /* - * Draws arrows -> - */ - $root2 = 2 * sqrt(2); - $this->diagram->lineScale( - $this->xSrc + $this->srcDir * $this->wTick * 0.75, - $this->ySrc, - $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, - $this->ySrc + $this->wTick / $root2 - ); - $this->diagram->lineScale( - $this->xSrc + $this->srcDir * $this->wTick * 0.75, - $this->ySrc, - $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, - $this->ySrc - $this->wTick / $root2 - ); - - $this->diagram->lineScale( - $this->xDest + $this->destDir * $this->wTick / 2, - $this->yDest, - $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, - $this->yDest + $this->wTick / $root2 - ); - $this->diagram->lineScale( - $this->xDest + $this->destDir * $this->wTick / 2, - $this->yDest, - $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, - $this->yDest - $this->wTick / $root2 - ); - $this->diagram->SetDrawColor(0); - } -} diff --git a/#pma/libraries/plugins/schema/pdf/TableStatsPdf.php b/#pma/libraries/plugins/schema/pdf/TableStatsPdf.php deleted file mode 100644 index f8349c79..00000000 --- a/#pma/libraries/plugins/schema/pdf/TableStatsPdf.php +++ /dev/null @@ -1,232 +0,0 @@ -heightCell = 6; - $this->_setHeight(); - /* - * setWidth must me after setHeight, because title - * can include table height which changes table width - */ - $this->_setWidth($fontSize); - if ($sameWideWidth < $this->width) { - $sameWideWidth = $this->width; - } - } - - /** - * Displays an error when the table cannot be found. - * - * @return void - */ - protected function showMissingTableError() - { - ExportRelationSchema::dieSchema( - $this->pageNumber, - "PDF", - sprintf(__('The %s table doesn\'t exist!'), $this->tableName) - ); - } - - /** - * Returns title of the current table, - * title can have the dimensions of the table - * - * @return string - */ - protected function getTitle() - { - $ret = ''; - if ($this->tableDimension) { - $ret = sprintf('%.0fx%0.f', $this->width, $this->height); - } - - return $ret . ' ' . $this->tableName; - } - - /** - * Sets the width of the table - * - * @param integer $fontSize The font size - * - * @access private - * - * @return void - * - * @see PMA_Schema_PDF - */ - private function _setWidth($fontSize) - { - foreach ($this->fields as $field) { - $this->width = max($this->width, $this->diagram->GetStringWidth($field)); - } - $this->width += $this->diagram->GetStringWidth(' '); - $this->diagram->SetFont($this->_ff, 'B', $fontSize); - /* - * it is unknown what value must be added, because - * table title is affected by the table width value - */ - while ($this->width < $this->diagram->GetStringWidth($this->getTitle())) { - $this->width += 5; - } - $this->diagram->SetFont($this->_ff, '', $fontSize); - } - - /** - * Sets the height of the table - * - * @return void - * - * @access private - */ - private function _setHeight() - { - $this->height = (count($this->fields) + 1) * $this->heightCell; - } - - /** - * Do draw the table - * - * @param integer $fontSize The font size - * @param boolean $withDoc Whether to include links to documentation - * @param boolean|integer $setColor Whether to display color - * - * @access public - * - * @return void - * - * @see PMA_Schema_PDF - */ - public function tableDraw($fontSize, $withDoc, $setColor = 0) - { - $this->diagram->setXyScale($this->x, $this->y); - $this->diagram->SetFont($this->_ff, 'B', $fontSize); - if ($setColor) { - $this->diagram->SetTextColor(200); - $this->diagram->SetFillColor(0, 0, 128); - } - if ($withDoc) { - $this->diagram->SetLink( - $this->diagram->PMA_links['RT'][$this->tableName]['-'], - -1 - ); - } else { - $this->diagram->PMA_links['doc'][$this->tableName]['-'] = ''; - } - - $this->diagram->cellScale( - $this->width, - $this->heightCell, - $this->getTitle(), - 1, - 1, - 'C', - $setColor, - $this->diagram->PMA_links['doc'][$this->tableName]['-'] - ); - $this->diagram->setXScale($this->x); - $this->diagram->SetFont($this->_ff, '', $fontSize); - $this->diagram->SetTextColor(0); - $this->diagram->SetFillColor(255); - - foreach ($this->fields as $field) { - if ($setColor) { - if (in_array($field, $this->primary)) { - $this->diagram->SetFillColor(215, 121, 123); - } - if ($field == $this->displayfield) { - $this->diagram->SetFillColor(142, 159, 224); - } - } - if ($withDoc) { - $this->diagram->SetLink( - $this->diagram->PMA_links['RT'][$this->tableName][$field], - -1 - ); - } else { - $this->diagram->PMA_links['doc'][$this->tableName][$field] = ''; - } - - $this->diagram->cellScale( - $this->width, - $this->heightCell, - ' ' . $field, - 1, - 1, - 'L', - $setColor, - $this->diagram->PMA_links['doc'][$this->tableName][$field] - ); - $this->diagram->setXScale($this->x); - $this->diagram->SetFillColor(255); - } - } -} - diff --git a/#pma/libraries/plugins/schema/svg/RelationStatsSvg.php b/#pma/libraries/plugins/schema/svg/RelationStatsSvg.php deleted file mode 100644 index b3ee1e36..00000000 --- a/#pma/libraries/plugins/schema/svg/RelationStatsSvg.php +++ /dev/null @@ -1,138 +0,0 @@ -wTick = 10; - parent::__construct( - $diagram, - $master_table, - $master_field, - $foreign_table, - $foreign_field - ); - } - - /** - * draws relation links and arrows shows foreign key relations - * - * @param boolean $showColor Whether to use one color per relation or not - * - * @return void - * @access public - * - * @see PMA_SVG - */ - public function relationDraw($showColor) - { - if ($showColor) { - $listOfColors = array( - '#c00', - '#bbb', - '#333', - '#cb0', - '#0b0', - '#0bf', - '#b0b', - ); - shuffle($listOfColors); - $color = $listOfColors[0]; - } else { - $color = '#333'; - } - - $this->diagram->printElementLine( - 'line', - $this->xSrc, - $this->ySrc, - $this->xSrc + $this->srcDir * $this->wTick, - $this->ySrc, - 'stroke:' . $color . ';stroke-width:1;' - ); - $this->diagram->printElementLine( - 'line', - $this->xDest + $this->destDir * $this->wTick, - $this->yDest, - $this->xDest, - $this->yDest, - 'stroke:' . $color . ';stroke-width:1;' - ); - $this->diagram->printElementLine( - 'line', - $this->xSrc + $this->srcDir * $this->wTick, - $this->ySrc, - $this->xDest + $this->destDir * $this->wTick, - $this->yDest, - 'stroke:' . $color . ';stroke-width:1;' - ); - $root2 = 2 * sqrt(2); - $this->diagram->printElementLine( - 'line', - $this->xSrc + $this->srcDir * $this->wTick * 0.75, - $this->ySrc, - $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, - $this->ySrc + $this->wTick / $root2, - 'stroke:' . $color . ';stroke-width:2;' - ); - $this->diagram->printElementLine( - 'line', - $this->xSrc + $this->srcDir * $this->wTick * 0.75, - $this->ySrc, - $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, - $this->ySrc - $this->wTick / $root2, - 'stroke:' . $color . ';stroke-width:2;' - ); - $this->diagram->printElementLine( - 'line', - $this->xDest + $this->destDir * $this->wTick / 2, - $this->yDest, - $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, - $this->yDest + $this->wTick / $root2, - 'stroke:' . $color . ';stroke-width:2;' - ); - $this->diagram->printElementLine( - 'line', - $this->xDest + $this->destDir * $this->wTick / 2, - $this->yDest, - $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, - $this->yDest - $this->wTick / $root2, - 'stroke:' . $color . ';stroke-width:2;' - ); - } -} diff --git a/#pma/libraries/plugins/schema/svg/Svg.php b/#pma/libraries/plugins/schema/svg/Svg.php deleted file mode 100644 index 0ea3c90a..00000000 --- a/#pma/libraries/plugins/schema/svg/Svg.php +++ /dev/null @@ -1,279 +0,0 @@ -openMemory(); - /* - * Set indenting using three spaces, - * so output is formatted - */ - - $this->setIndent(true); - $this->setIndentString(' '); - /* - * Create the XML document - */ - - $this->startDocument('1.0', 'UTF-8'); - $this->startDtd( - 'svg', - '-//W3C//DTD SVG 1.1//EN', - 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' - ); - $this->endDtd(); - } - - /** - * Set document title - * - * @param string $value sets the title text - * - * @return void - */ - public function setTitle($value) - { - $this->title = $value; - } - - /** - * Set document author - * - * @param string $value sets the author - * - * @return void - */ - public function setAuthor($value) - { - $this->author = $value; - } - - /** - * Set document font - * - * @param string $value sets the font e.g Arial, Sans-serif etc - * - * @return void - */ - public function setFont($value) - { - $this->font = $value; - } - - /** - * Get document font - * - * @return string returns the font name - */ - public function getFont() - { - return $this->font; - } - - /** - * Set document font size - * - * @param string $value sets the font size in pixels - * - * @return void - */ - public function setFontSize($value) - { - $this->fontSize = $value; - } - - /** - * Get document font size - * - * @return string returns the font size - */ - public function getFontSize() - { - return $this->fontSize; - } - - /** - * Starts RelationStatsSvg Document - * - * svg document starts by first initializing svg tag - * which contains all the attributes and namespace that needed - * to define the svg document - * - * @param integer $width total width of the RelationStatsSvg document - * @param integer $height total height of the RelationStatsSvg document - * @param integer $x min-x of the view box - * @param integer $y min-y of the view box - * - * @return void - * - * @see XMLWriter::startElement(),XMLWriter::writeAttribute() - */ - public function startSvgDoc($width, $height, $x = 0, $y = 0) - { - $this->startElement('svg'); - - if (!is_int($width)) { - $width = intval($width); - } - - if (!is_int($height)) { - $height = intval($height); - } - - if ($x != 0 || $y != 0) { - $this->writeAttribute('viewBox', "$x $y $width $height"); - } - $this->writeAttribute('width', ($width - $x) . 'px'); - $this->writeAttribute('height', ($height - $y) . 'px'); - $this->writeAttribute('xmlns', 'http://www.w3.org/2000/svg'); - $this->writeAttribute('version', '1.1'); - } - - /** - * Ends RelationStatsSvg Document - * - * @return void - * @see XMLWriter::endElement(),XMLWriter::endDocument() - */ - public function endSvgDoc() - { - $this->endElement(); - $this->endDocument(); - } - - /** - * output RelationStatsSvg Document - * - * svg document prompted to the user for download - * RelationStatsSvg document saved in .svg extension and can be - * easily changeable by using any svg IDE - * - * @param string $fileName file name - * - * @return void - * @see XMLWriter::startElement(),XMLWriter::writeAttribute() - */ - public function showOutput($fileName) - { - //ob_get_clean(); - $output = $this->flush(); - PMA\libraries\Response::getInstance() - ->disable(); - PMA_downloadHeader( - $fileName, - 'image/svg+xml', - strlen($output) - ); - print $output; - } - - /** - * Draws RelationStatsSvg elements - * - * SVG has some predefined shape elements like rectangle & text - * and other elements who have x,y co-ordinates are drawn. - * specify their width and height and can give styles too. - * - * @param string $name RelationStatsSvg element name - * @param int $x The x attr defines the left position of the element - * (e.g. x="0" places the element 0 pixels from the - * left of the browser window) - * @param integer $y The y attribute defines the top position of the - * element (e.g. y="0" places the element 0 pixels - * from the top of the browser window) - * @param int|string $width The width attribute defines the width the element - * @param int|string $height The height attribute defines the height the element - * @param string $text The text attribute defines the text the element - * @param string $styles The style attribute defines the style the element - * styles can be defined like CSS styles - * - * @return void - * - * @see XMLWriter::startElement(), XMLWriter::writeAttribute(), - * XMLWriter::text(), XMLWriter::endElement() - */ - public function printElement( - $name, - $x, - $y, - $width = '', - $height = '', - $text = '', - $styles = '' - ) { - $this->startElement($name); - $this->writeAttribute('width', $width); - $this->writeAttribute('height', $height); - $this->writeAttribute('x', $x); - $this->writeAttribute('y', $y); - $this->writeAttribute('style', $styles); - if (isset($text)) { - $this->writeAttribute('font-family', $this->font); - $this->writeAttribute('font-size', $this->fontSize); - $this->text($text); - } - $this->endElement(); - } - - /** - * Draws RelationStatsSvg Line element - * - * RelationStatsSvg line element is drawn for connecting the tables. - * arrows are also drawn by specify its start and ending - * co-ordinates - * - * @param string $name RelationStatsSvg element name i.e line - * @param integer $x1 Defines the start of the line on the x-axis - * @param integer $y1 Defines the start of the line on the y-axis - * @param integer $x2 Defines the end of the line on the x-axis - * @param integer $y2 Defines the end of the line on the y-axis - * @param string $styles The style attribute defines the style the element - * styles can be defined like CSS styles - * - * @return void - * - * @see XMLWriter::startElement(), XMLWriter::writeAttribute(), - * XMLWriter::endElement() - */ - public function printElementLine($name, $x1, $y1, $x2, $y2, $styles) - { - $this->startElement($name); - $this->writeAttribute('x1', $x1); - $this->writeAttribute('y1', $y1); - $this->writeAttribute('x2', $x2); - $this->writeAttribute('y2', $y2); - $this->writeAttribute('style', $styles); - $this->endElement(); - } -} diff --git a/#pma/libraries/plugins/schema/svg/SvgRelationSchema.php b/#pma/libraries/plugins/schema/svg/SvgRelationSchema.php deleted file mode 100644 index 2ba33514..00000000 --- a/#pma/libraries/plugins/schema/svg/SvgRelationSchema.php +++ /dev/null @@ -1,267 +0,0 @@ -setShowColor(isset($_REQUEST['svg_show_color'])); - $this->setShowKeys(isset($_REQUEST['svg_show_keys'])); - $this->setTableDimension(isset($_REQUEST['svg_show_table_dimension'])); - $this->setAllTablesSameWidth(isset($_REQUEST['svg_all_tables_same_width'])); - - $this->diagram->setTitle( - sprintf( - __('Schema of the %s database - Page %s'), - $this->db, - $this->pageNumber - ) - ); - $this->diagram->SetAuthor('phpMyAdmin ' . PMA_VERSION); - $this->diagram->setFont('Arial'); - $this->diagram->setFontSize('16px'); - - $alltables = $this->getTablesFromRequest(); - - foreach ($alltables as $table) { - if (!isset($this->_tables[$table])) { - $this->_tables[$table] = new TableStatsSvg( - $this->diagram, $this->db, - $table, $this->diagram->getFont(), - $this->diagram->getFontSize(), $this->pageNumber, - $this->_tablewidth, $this->showKeys, $this->tableDimension, - $this->offline - ); - } - - if ($this->sameWide) { - $this->_tables[$table]->width = &$this->_tablewidth; - } - $this->_setMinMax($this->_tables[$table]); - } - - $border = 15; - $this->diagram->startSvgDoc( - $this->_xMax + $border, - $this->_yMax + $border, - $this->_xMin - $border, - $this->_yMin - $border - ); - - $seen_a_relation = false; - foreach ($alltables as $one_table) { - $exist_rel = PMA_getForeigners($this->db, $one_table, '', 'both'); - if (!$exist_rel) { - continue; - } - - $seen_a_relation = true; - foreach ($exist_rel as $master_field => $rel) { - /* put the foreign table on the schema only if selected - * by the user - * (do not use array_search() because we would have to - * to do a === false and this is not PHP3 compatible) - */ - if ($master_field != 'foreign_keys_data') { - if (in_array($rel['foreign_table'], $alltables)) { - $this->_addRelation( - $one_table, - $this->diagram->getFont(), - $this->diagram->getFontSize(), - $master_field, - $rel['foreign_table'], - $rel['foreign_field'], - $this->tableDimension - ); - } - continue; - } - - foreach ($rel as $one_key) { - if (!in_array($one_key['ref_table_name'], $alltables)) { - continue; - } - - foreach ( - $one_key['index_list'] - as $index => $one_field - ) { - $this->_addRelation( - $one_table, - $this->diagram->getFont(), - $this->diagram->getFontSize(), - $one_field, - $one_key['ref_table_name'], - $one_key['ref_index_list'][$index], - $this->tableDimension - ); - } - } - } - } - if ($seen_a_relation) { - $this->_drawRelations(); - } - - $this->_drawTables(); - $this->diagram->endSvgDoc(); - } - - /** - * Output RelationStatsSvg Document for download - * - * @return void - */ - public function showOutput() - { - $this->diagram->showOutput($this->getFileName('.svg')); - } - - /** - * Sets X and Y minimum and maximum for a table cell - * - * @param string $table The table name - * - * @return void - */ - private function _setMinMax($table) - { - $this->_xMax = max($this->_xMax, $table->x + $table->width); - $this->_yMax = max($this->_yMax, $table->y + $table->height); - $this->_xMin = min($this->_xMin, $table->x); - $this->_yMin = min($this->_yMin, $table->y); - } - - /** - * Defines relation objects - * - * @param string $masterTable The master table name - * @param string $font The font face - * @param int $fontSize Font size - * @param string $masterField The relation field in the master table - * @param string $foreignTable The foreign table name - * @param string $foreignField The relation field in the foreign table - * @param boolean $tableDimension Whether to display table position or not - * - * @return void - * - * @see _setMinMax,Table_Stats_Svg::__construct(), - * PMA\libraries\plugins\schema\svg\RelationStatsSvg::__construct() - */ - private function _addRelation( - $masterTable, - $font, - $fontSize, - $masterField, - $foreignTable, - $foreignField, - $tableDimension - ) { - if (!isset($this->_tables[$masterTable])) { - $this->_tables[$masterTable] = new TableStatsSvg( - $this->diagram, $this->db, - $masterTable, $font, $fontSize, $this->pageNumber, - $this->_tablewidth, false, $tableDimension - ); - $this->_setMinMax($this->_tables[$masterTable]); - } - if (!isset($this->_tables[$foreignTable])) { - $this->_tables[$foreignTable] = new TableStatsSvg( - $this->diagram, $this->db, - $foreignTable, $font, $fontSize, $this->pageNumber, - $this->_tablewidth, false, $tableDimension - ); - $this->_setMinMax($this->_tables[$foreignTable]); - } - $this->_relations[] = new RelationStatsSvg( - $this->diagram, - $this->_tables[$masterTable], - $masterField, - $this->_tables[$foreignTable], - $foreignField - ); - } - - /** - * Draws relation arrows and lines - * connects master table's master field to - * foreign table's foreign field - * - * @return void - * - * @see Relation_Stats_Svg::relationDraw() - */ - private function _drawRelations() - { - foreach ($this->_relations as $relation) { - $relation->relationDraw($this->showColor); - } - } - - /** - * Draws tables - * - * @return void - * - * @see Table_Stats_Svg::Table_Stats_tableDraw() - */ - private function _drawTables() - { - foreach ($this->_tables as $table) { - $table->tableDraw($this->showColor); - } - } -} \ No newline at end of file diff --git a/#pma/libraries/plugins/schema/svg/TableStatsSvg.php b/#pma/libraries/plugins/schema/svg/TableStatsSvg.php deleted file mode 100644 index 7675d5ba..00000000 --- a/#pma/libraries/plugins/schema/svg/TableStatsSvg.php +++ /dev/null @@ -1,202 +0,0 @@ -_setHeightTable($fontSize); - // setWidth must me after setHeight, because title - // can include table height which changes table width - $this->_setWidthTable($font, $fontSize); - if ($same_wide_width < $this->width) { - $same_wide_width = $this->width; - } - } - - /** - * Displays an error when the table cannot be found. - * - * @return void - */ - protected function showMissingTableError() - { - ExportRelationSchema::dieSchema( - $this->pageNumber, - "SVG", - sprintf(__('The %s table doesn\'t exist!'), $this->tableName) - ); - } - - /** - * Sets the width of the table - * - * @param string $font The font size - * @param integer $fontSize The font size - * - * @return void - * @access private - * - * @see PMA_SVG - */ - private function _setWidthTable($font, $fontSize) - { - foreach ($this->fields as $field) { - $this->width = max( - $this->width, - PMA\libraries\Font::getStringWidth($field, $font, $fontSize) - ); - } - $this->width += PMA\libraries\Font::getStringWidth(' ', $font, $fontSize); - - /* - * it is unknown what value must be added, because - * table title is affected by the table width value - */ - while ($this->width - < PMA\libraries\Font::getStringWidth($this->getTitle(), $font, $fontSize) - ) { - $this->width += 7; - } - } - - /** - * Sets the height of the table - * - * @param integer $fontSize font size - * - * @return void - */ - private function _setHeightTable($fontSize) - { - $this->heightCell = $fontSize + 4; - $this->height = (count($this->fields) + 1) * $this->heightCell; - } - - /** - * draw the table - * - * @param boolean $showColor Whether to display color - * - * @access public - * @return void - * - * @see PMA_SVG,PMA_SVG::printElement - */ - public function tableDraw($showColor) - { - $this->diagram->printElement( - 'rect', - $this->x, - $this->y, - $this->width, - $this->heightCell, - null, - 'fill:#007;stroke:black;' - ); - $this->diagram->printElement( - 'text', - $this->x + 5, - $this->y + 14, - $this->width, - $this->heightCell, - $this->getTitle(), - 'fill:#fff;' - ); - foreach ($this->fields as $field) { - $this->currentCell += $this->heightCell; - $fillColor = 'none'; - if ($showColor) { - if (in_array($field, $this->primary)) { - $fillColor = '#aea'; - } - if ($field == $this->displayfield) { - $fillColor = 'none'; - } - } - $this->diagram->printElement( - 'rect', - $this->x, - $this->y + $this->currentCell, - $this->width, - $this->heightCell, - null, - 'fill:' . $fillColor . ';stroke:black;' - ); - $this->diagram->printElement( - 'text', - $this->x + 5, - $this->y + 14 + $this->currentCell, - $this->width, - $this->heightCell, - $field, - 'fill:black;' - ); - } - } -} diff --git a/#pma/libraries/plugins/transformations/README b/#pma/libraries/plugins/transformations/README deleted file mode 100644 index 7d7a1255..00000000 --- a/#pma/libraries/plugins/transformations/README +++ /dev/null @@ -1,4 +0,0 @@ -TRANSFORMATION USAGE (Garvin Hicking, ) -==================== - -See the documentation for complete instructions on how to use transformation plugins. diff --git a/#pma/libraries/plugins/transformations/TEMPLATE b/#pma/libraries/plugins/transformations/TEMPLATE deleted file mode 100644 index 12f09443..00000000 --- a/#pma/libraries/plugins/transformations/TEMPLATE +++ /dev/null @@ -1,47 +0,0 @@ - diff --git a/#pma/libraries/plugins/transformations/TEMPLATE_ABSTRACT b/#pma/libraries/plugins/transformations/TEMPLATE_ABSTRACT deleted file mode 100644 index 5ea9bc0d..00000000 --- a/#pma/libraries/plugins/transformations/TEMPLATE_ABSTRACT +++ /dev/null @@ -1,74 +0,0 @@ -mimetype contains the original MimeType of the field (i.e. 'text/plain', 'image/jpeg' etc.) - - return $buffer; - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - - /** - * Gets the TransformationName of the specific plugin - * - * @return string - */ - public static function getName() - { - return "[TransformationName]"; - } -} -?> diff --git a/#pma/libraries/plugins/transformations/Text_Plain_Link.php b/#pma/libraries/plugins/transformations/Text_Plain_Link.php deleted file mode 100644 index 769435e8..00000000 --- a/#pma/libraries/plugins/transformations/Text_Plain_Link.php +++ /dev/null @@ -1,40 +0,0 @@ -getOptions($options, array('T', 'F')); - - if ($buffer == '0') { - return $options[1]; // return false label - } - - return $options[0]; // or true one if nonzero - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Bool2Text"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/CodeMirrorEditorTransformationPlugin.php b/#pma/libraries/plugins/transformations/abs/CodeMirrorEditorTransformationPlugin.php deleted file mode 100644 index 54ab6ed9..00000000 --- a/#pma/libraries/plugins/transformations/abs/CodeMirrorEditorTransformationPlugin.php +++ /dev/null @@ -1,72 +0,0 @@ -'; - } - $class = 'transform_' . strtolower(static::getName()) . '_editor'; - $html .= ''; - - return $html; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/DateFormatTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/DateFormatTransformationsPlugin.php deleted file mode 100644 index 7a7e0cee..00000000 --- a/#pma/libraries/plugins/transformations/abs/DateFormatTransformationsPlugin.php +++ /dev/null @@ -1,168 +0,0 @@ -type == 'int') { - $timestamp = $buffer; - - // Detect TIMESTAMP(6 | 8 | 10 | 12 | 14) - // TIMESTAMP (2 | 4) not supported here. - // (Note: prior to MySQL 4.1, TIMESTAMP has a display size - // for example TIMESTAMP(8) means YYYYMMDD) - } else { - if (preg_match('/^(\d{2}){3,7}$/', $buffer)) { - - if (mb_strlen($buffer) == 14 || mb_strlen($buffer) == 8) { - $offset = 4; - } else { - $offset = 2; - } - - $aDate = array(); - $aDate['year'] = (int) - mb_substr($buffer, 0, $offset); - $aDate['month'] = (int) - mb_substr($buffer, $offset, 2); - $aDate['day'] = (int) - mb_substr($buffer, $offset + 2, 2); - $aDate['hour'] = (int) - mb_substr($buffer, $offset + 4, 2); - $aDate['minute'] = (int) - mb_substr($buffer, $offset + 6, 2); - $aDate['second'] = (int) - mb_substr($buffer, $offset + 8, 2); - - if (checkdate($aDate['month'], $aDate['day'], $aDate['year'])) { - $timestamp = mktime( - $aDate['hour'], - $aDate['minute'], - $aDate['second'], - $aDate['month'], - $aDate['day'], - $aDate['year'] - ); - } - // If all fails, assume one of the dozens of valid strtime() syntaxes - // (http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html) - } else { - if (preg_match('/^[0-9]\d{1,9}$/', $buffer)) { - $timestamp = (int)$buffer; - } else { - $timestamp = strtotime($buffer); - } - } - } - - // If all above failed, maybe it's a Unix timestamp already? - if ($timestamp < 0 && preg_match('/^[1-9]\d{1,9}$/', $buffer)) { - $timestamp = $buffer; - } - - // Reformat a valid timestamp - if ($timestamp >= 0) { - $timestamp -= $options[0] * 60 * 60; - $source = $buffer; - if ($options[2] == 'local') { - $text = PMA\libraries\Util::localisedDate( - $timestamp, - $options[1] - ); - } elseif ($options[2] == 'utc') { - $text = gmdate($options[1], $timestamp); - } else { - $text = 'INVALID DATE TYPE'; - } - return '' . htmlspecialchars($text) . ''; - } else { - return htmlspecialchars($buffer); - } - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Date Format"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/DownloadTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/DownloadTransformationsPlugin.php deleted file mode 100644 index 51525749..00000000 --- a/#pma/libraries/plugins/transformations/abs/DownloadTransformationsPlugin.php +++ /dev/null @@ -1,90 +0,0 @@ - $val) { - if ($val->name == $options[1]) { - $pos = $key; - break; - } - } - if (isset($pos)) { - $cn = $row[$pos]; - } - } - if (empty($cn)) { - $cn = 'binary_file.dat'; - } - } - - return sprintf( - '%s', - $options['wrapper_link'], - htmlspecialchars(urlencode($cn)), - htmlspecialchars($cn), - htmlspecialchars($cn) - ); - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Download"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/ExternalTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/ExternalTransformationsPlugin.php deleted file mode 100644 index ae618ce0..00000000 --- a/#pma/libraries/plugins/transformations/abs/ExternalTransformationsPlugin.php +++ /dev/null @@ -1,150 +0,0 @@ -getOptions( - $options, - array(0, '-f /dev/null -i -wrap -q', 1, 1) - ); - - if (isset($allowed_programs[$options[0]])) { - $program = $allowed_programs[$options[0]]; - } else { - $program = $allowed_programs[0]; - } - - // needs PHP >= 4.3.0 - $newstring = ''; - $descriptorspec = array( - 0 => array("pipe", "r"), - 1 => array("pipe", "w"), - ); - $process = proc_open($program . ' ' . $options[1], $descriptorspec, $pipes); - if (is_resource($process)) { - fwrite($pipes[0], $buffer); - fclose($pipes[0]); - - while (!feof($pipes[1])) { - $newstring .= fgets($pipes[1], 1024); - } - fclose($pipes[1]); - // we don't currently use the return value - proc_close($process); - } - - if ($options[2] == 1 || $options[2] == '2') { - $retstring = htmlspecialchars($newstring); - } else { - $retstring = $newstring; - } - - return $retstring; - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "External"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/FormattedTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/FormattedTransformationsPlugin.php deleted file mode 100644 index d71842af..00000000 --- a/#pma/libraries/plugins/transformations/abs/FormattedTransformationsPlugin.php +++ /dev/null @@ -1,62 +0,0 @@ -'; - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Formatted"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/HexTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/HexTransformationsPlugin.php deleted file mode 100644 index f2bab93f..00000000 --- a/#pma/libraries/plugins/transformations/abs/HexTransformationsPlugin.php +++ /dev/null @@ -1,67 +0,0 @@ -getOptions($options, array('2')); - $options[0] = intval($options[0]); - - if ($options[0] < 1) { - return bin2hex($buffer); - } else { - return chunk_split(bin2hex($buffer), $options[0], ' '); - } - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Hex"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/ImageLinkTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/ImageLinkTransformationsPlugin.php deleted file mode 100644 index 429b5cfd..00000000 --- a/#pma/libraries/plugins/transformations/abs/ImageLinkTransformationsPlugin.php +++ /dev/null @@ -1,67 +0,0 @@ -[BLOB]'; - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "ImageLink"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/ImageUploadTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/ImageUploadTransformationsPlugin.php deleted file mode 100644 index 44638161..00000000 --- a/#pma/libraries/plugins/transformations/abs/ImageUploadTransformationsPlugin.php +++ /dev/null @@ -1,118 +0,0 @@ -'; - $html .= ''; - $src = 'transformation_wrapper.php' . $options['wrapper_link']; - } - $html .= ''
-            . __('Image preview here') . ''; - $html .= '
    '; - - return $html; - } - - /** - * Returns the array of scripts (filename) required for plugin - * initialization and handling - * - * @return array javascripts to be included - */ - public function getScripts() - { - return array( - 'transformations/image_upload.js', - ); - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Image upload"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/InlineTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/InlineTransformationsPlugin.php deleted file mode 100644 index ac9134a3..00000000 --- a/#pma/libraries/plugins/transformations/abs/InlineTransformationsPlugin.php +++ /dev/null @@ -1,79 +0,0 @@ -[' . htmlspecialchars($buffer) . ']'; - } else { - return '[' . htmlspecialchars($buffer) . ']'; - } - } - - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Inline"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/LongToIPv4TransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/LongToIPv4TransformationsPlugin.php deleted file mode 100644 index 234a4925..00000000 --- a/#pma/libraries/plugins/transformations/abs/LongToIPv4TransformationsPlugin.php +++ /dev/null @@ -1,63 +0,0 @@ - 4294967295) { - return htmlspecialchars($buffer); - } - - return long2ip($buffer); - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Long To IPv4"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/PreApPendTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/PreApPendTransformationsPlugin.php deleted file mode 100644 index 7247ce13..00000000 --- a/#pma/libraries/plugins/transformations/abs/PreApPendTransformationsPlugin.php +++ /dev/null @@ -1,64 +0,0 @@ -getOptions($options, array('', '')); - - //just prepend and/or append the options to the original text - return htmlspecialchars($options[0]) . htmlspecialchars($buffer) - . htmlspecialchars($options[1]); - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "PreApPend"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/RegexValidationTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/RegexValidationTransformationsPlugin.php deleted file mode 100644 index caf54039..00000000 --- a/#pma/libraries/plugins/transformations/abs/RegexValidationTransformationsPlugin.php +++ /dev/null @@ -1,71 +0,0 @@ -reset(); - if (!empty($options[0]) && !preg_match($options[0], $buffer)) { - $this->success = false; - $this->error = sprintf( - __('Validation failed for the input string %s.'), - htmlspecialchars($buffer) - ); - } - - return $buffer; - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Regex Validation"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/SQLTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/SQLTransformationsPlugin.php deleted file mode 100644 index ae054e40..00000000 --- a/#pma/libraries/plugins/transformations/abs/SQLTransformationsPlugin.php +++ /dev/null @@ -1,62 +0,0 @@ -getOptions($options, array(0, 'all', '…')); - - if ($options[1] != 'all') { - $newtext = mb_substr( - $buffer, - $options[0], - $options[1] - ); - } else { - $newtext = mb_substr($buffer, $options[0]); - } - - $length = mb_strlen($newtext); - $baselength = mb_strlen($buffer); - if ($length != $baselength) { - if ($options[0] != 0) { - $newtext = $options[2] . $newtext; - } - - if (($length + $options[0]) != $baselength) { - $newtext .= $options[2]; - } - } - - return htmlspecialchars($newtext); - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Substring"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/TextFileUploadTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/TextFileUploadTransformationsPlugin.php deleted file mode 100644 index 41142437..00000000 --- a/#pma/libraries/plugins/transformations/abs/TextFileUploadTransformationsPlugin.php +++ /dev/null @@ -1,100 +0,0 @@ -'; - $html .= ''; - } - $html .= ''; - - return $html; - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Text file upload"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/TextImageLinkTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/TextImageLinkTransformationsPlugin.php deleted file mode 100644 index 219c70b9..00000000 --- a/#pma/libraries/plugins/transformations/abs/TextImageLinkTransformationsPlugin.php +++ /dev/null @@ -1,73 +0,0 @@ -' - . htmlspecialchars($buffer) . ''; - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "Image Link"; - } -} diff --git a/#pma/libraries/plugins/transformations/abs/TextLinkTransformationsPlugin.php b/#pma/libraries/plugins/transformations/abs/TextLinkTransformationsPlugin.php deleted file mode 100644 index ff92d406..00000000 --- a/#pma/libraries/plugins/transformations/abs/TextLinkTransformationsPlugin.php +++ /dev/null @@ -1,75 +0,0 @@ -' - . htmlspecialchars(isset($options[1]) ? $options[1] : $buffer) - . ''; - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "TextLink"; - } -} diff --git a/#pma/libraries/plugins/transformations/input/Image_JPEG_Upload.php b/#pma/libraries/plugins/transformations/input/Image_JPEG_Upload.php deleted file mode 100644 index 9f87cf4e..00000000 --- a/#pma/libraries/plugins/transformations/input/Image_JPEG_Upload.php +++ /dev/null @@ -1,41 +0,0 @@ -'; - } - $class = 'transform_IPToBin'; - $html .= '' - . ''; - - return $html; - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the plugin - * - * @return string - */ - public static function getName() - { - return "IPv4/IPv6 To Binary"; - } - - /** - * Gets the plugin`s MIME type - * - * @return string - */ - public static function getMIMEType() - { - return "Text"; - } - - /** - * Gets the plugin`s MIME subtype - * - * @return string - */ - public static function getMIMESubtype() - { - return "Plain"; - } -} diff --git a/#pma/libraries/plugins/transformations/input/Text_Plain_JsonEditor.php b/#pma/libraries/plugins/transformations/input/Text_Plain_JsonEditor.php deleted file mode 100644 index 6122c41f..00000000 --- a/#pma/libraries/plugins/transformations/input/Text_Plain_JsonEditor.php +++ /dev/null @@ -1,82 +0,0 @@ -getHeader() - ->getScripts(); - $scripts->addFile('codemirror/lib/codemirror.js'); - $scripts->addFile('codemirror/mode/javascript/javascript.js'); - $scripts->addFile('codemirror/addon/runmode/runmode.js'); - $scripts->addFile('transformations/json.js'); - } - } - - /** - * Gets the transformation description of the specific plugin - * - * @return string - */ - public static function getInfo() - { - return __( - 'Formats text as JSON with syntax highlighting.' - ); - } - - /** - * Does the actual work of each specific transformations plugin. - * - * @param string $buffer text to be transformed - * @param array $options transformation options - * @param string $meta meta information - * - * @return string - */ - public function applyTransformation($buffer, $options = array(), $meta = '') - { - return '
    ' . "\n"
    -        . htmlspecialchars($buffer) . "\n"
    -        . '
    '; - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the plugin`s MIME type - * - * @return string - */ - public static function getMIMEType() - { - return "Text"; - } - - /** - * Gets the plugin`s MIME subtype - * - * @return string - */ - public static function getMIMESubtype() - { - return "Plain"; - } - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "JSON"; - } -} diff --git a/#pma/libraries/plugins/transformations/output/Text_Plain_Sql.php b/#pma/libraries/plugins/transformations/output/Text_Plain_Sql.php deleted file mode 100644 index 71b1b5d8..00000000 --- a/#pma/libraries/plugins/transformations/output/Text_Plain_Sql.php +++ /dev/null @@ -1,57 +0,0 @@ -getHeader() - ->getScripts(); - $scripts->addFile('codemirror/lib/codemirror.js'); - $scripts->addFile('codemirror/mode/sql/sql.js'); - $scripts->addFile('codemirror/addon/runmode/runmode.js'); - $scripts->addFile('function.js'); - } - } - - /** - * Gets the plugin`s MIME type - * - * @return string - */ - public static function getMIMEType() - { - return "Text"; - } - - /** - * Gets the plugin`s MIME subtype - * - * @return string - */ - public static function getMIMESubtype() - { - return "Plain"; - } -} diff --git a/#pma/libraries/plugins/transformations/output/Text_Plain_Xml.php b/#pma/libraries/plugins/transformations/output/Text_Plain_Xml.php deleted file mode 100644 index c6702714..00000000 --- a/#pma/libraries/plugins/transformations/output/Text_Plain_Xml.php +++ /dev/null @@ -1,98 +0,0 @@ -getHeader() - ->getScripts(); - $scripts->addFile('codemirror/lib/codemirror.js'); - $scripts->addFile('codemirror/mode/xml/xml.js'); - $scripts->addFile('codemirror/addon/runmode/runmode.js'); - $scripts->addFile('transformations/xml.js'); - } - } - - /** - * Gets the transformation description of the specific plugin - * - * @return string - */ - public static function getInfo() - { - return __( - 'Formats text as XML with syntax highlighting.' - ); - } - - /** - * Does the actual work of each specific transformations plugin. - * - * @param string $buffer text to be transformed - * @param array $options transformation options - * @param string $meta meta information - * - * @return string - */ - public function applyTransformation($buffer, $options = array(), $meta = '') - { - return '
    ' . "\n"
    -        . htmlspecialchars($buffer) . "\n"
    -        . '
    '; - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the plugin`s MIME type - * - * @return string - */ - public static function getMIMEType() - { - return "Text"; - } - - /** - * Gets the plugin`s MIME subtype - * - * @return string - */ - public static function getMIMESubtype() - { - return "Plain"; - } - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "XML"; - } -} diff --git a/#pma/libraries/pmd_common.php b/#pma/libraries/pmd_common.php deleted file mode 100644 index f390f8cc..00000000 --- a/#pma/libraries/pmd_common.php +++ /dev/null @@ -1,775 +0,0 @@ -getTablesFull($GLOBALS['db']); - // seems to be needed later - $GLOBALS['dbi']->selectDb($GLOBALS['db']); - $i = 0; - foreach ($tables as $one_table) { - $GLOBALS['PMD']['TABLE_NAME'][$i] - = $GLOBALS['db'] . "." . $one_table['TABLE_NAME']; - $GLOBALS['PMD']['OWNER'][$i] = $GLOBALS['db']; - $GLOBALS['PMD']['TABLE_NAME_SMALL'][$i] = $one_table['TABLE_NAME']; - - $GLOBALS['PMD_URL']['TABLE_NAME'][$i] - = $GLOBALS['db'] . "." . $one_table['TABLE_NAME']; - $GLOBALS['PMD_URL']['OWNER'][$i] = $GLOBALS['db']; - $GLOBALS['PMD_URL']['TABLE_NAME_SMALL'][$i] - = $one_table['TABLE_NAME']; - - $GLOBALS['PMD_OUT']['TABLE_NAME'][$i] = htmlspecialchars( - $GLOBALS['db'] . "." . $one_table['TABLE_NAME'], ENT_QUOTES - ); - $GLOBALS['PMD_OUT']['OWNER'][$i] = htmlspecialchars( - $GLOBALS['db'], ENT_QUOTES - ); - $GLOBALS['PMD_OUT']['TABLE_NAME_SMALL'][$i] = htmlspecialchars( - $one_table['TABLE_NAME'], ENT_QUOTES - ); - - $GLOBALS['PMD']['TABLE_TYPE'][$i] = mb_strtoupper( - $one_table['ENGINE'] - ); - - $DF = PMA_getDisplayField($GLOBALS['db'], $one_table['TABLE_NAME']); - if ($DF != '') { - $retval[$GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]] = $DF; - } - - $i++; - } - - return $retval; -} - -/** - * Retrieves table column info - * - * @return array table column nfo - */ -function PMA_getColumnsInfo() -{ - $GLOBALS['dbi']->selectDb($GLOBALS['db']); - $tab_column = array(); - for ($i = 0, $cnt = count($GLOBALS['PMD']["TABLE_NAME"]); $i < $cnt; $i++) { - $fields_rs = $GLOBALS['dbi']->query( - $GLOBALS['dbi']->getColumnsSql( - $GLOBALS['db'], - $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i], - null, - true - ), - null, - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - $tbl_name_i = $GLOBALS['PMD']['TABLE_NAME'][$i]; - $j = 0; - while ($row = $GLOBALS['dbi']->fetchAssoc($fields_rs)) { - $tab_column[$tbl_name_i]['COLUMN_ID'][$j] = $j; - $tab_column[$tbl_name_i]['COLUMN_NAME'][$j] = $row['Field']; - $tab_column[$tbl_name_i]['TYPE'][$j] = $row['Type']; - $tab_column[$tbl_name_i]['NULLABLE'][$j] = $row['Null']; - $j++; - } - } - return $tab_column; -} - -/** - * Returns JavaScript code for initializing vars - * - * @return string JavaScript code - */ -function PMA_getScriptContr() -{ - $GLOBALS['dbi']->selectDb($GLOBALS['db']); - $con = array(); - $con["C_NAME"] = array(); - $i = 0; - $alltab_rs = $GLOBALS['dbi']->query( - 'SHOW TABLES FROM ' . PMA\libraries\Util::backquote($GLOBALS['db']), - null, - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - while ($val = @$GLOBALS['dbi']->fetchRow($alltab_rs)) { - $row = PMA_getForeigners($GLOBALS['db'], $val[0], '', 'internal'); - - if ($row !== false) { - foreach ($row as $field => $value) { - $con['C_NAME'][$i] = ''; - $con['DTN'][$i] = urlencode($GLOBALS['db'] . "." . $val[0]); - $con['DCN'][$i] = urlencode($field); - $con['STN'][$i] = urlencode( - $value['foreign_db'] . "." . $value['foreign_table'] - ); - $con['SCN'][$i] = urlencode($value['foreign_field']); - $i++; - } - } - $row = PMA_getForeigners($GLOBALS['db'], $val[0], '', 'foreign'); - - if ($row !== false) { - foreach ($row['foreign_keys_data'] as $one_key) { - foreach ($one_key['index_list'] as $index => $one_field) { - $con['C_NAME'][$i] = $one_key['constraint']; - $con['DTN'][$i] = urlencode($GLOBALS['db'] . "." . $val[0]); - $con['DCN'][$i] = urlencode($one_field); - $con['STN'][$i] = urlencode( - (isset($one_key['ref_db_name']) ? - $one_key['ref_db_name'] : $GLOBALS['db']) - . "." . $one_key['ref_table_name'] - ); - $con['SCN'][$i] = urlencode($one_key['ref_index_list'][$index]); - $i++; - } - } - } - } - - $ti = 0; - $retval = array(); - for ($i = 0, $cnt = count($con["C_NAME"]); $i < $cnt; $i++) { - $c_name_i = $con['C_NAME'][$i]; - $dtn_i = $con['DTN'][$i]; - $retval[$ti] = array(); - $retval[$ti][$c_name_i] = array(); - if (in_array($dtn_i, $GLOBALS['PMD_URL']["TABLE_NAME"]) - && in_array($con['STN'][$i], $GLOBALS['PMD_URL']["TABLE_NAME"]) - ) { - $retval[$ti][$c_name_i][$dtn_i] = array(); - $retval[$ti][$c_name_i][$dtn_i][$con['DCN'][$i]] = array( - 0 => $con['STN'][$i], - 1 => $con['SCN'][$i] - ); - } - $ti++; - } - return $retval; -} - -/** - * Returns UNIQUE and PRIMARY indices - * - * @return array unique or primary indices - */ -function PMA_getPKOrUniqueKeys() -{ - return PMA_getAllKeys(true); -} - -/** - * Returns all indices - * - * @param bool $unique_only whether to include only unique ones - * - * @return array indices - */ -function PMA_getAllKeys($unique_only = false) -{ - $keys = array(); - - foreach ($GLOBALS['PMD']['TABLE_NAME_SMALL'] as $I => $table) { - $schema = $GLOBALS['PMD']['OWNER'][$I]; - // for now, take into account only the first index segment - foreach (PMA\libraries\Index::getFromTable($table, $schema) as $index) { - if ($unique_only && ! $index->isUnique()) { - continue; - } - $columns = $index->getColumns(); - foreach ($columns as $column_name => $dummy) { - $keys[$schema . '.' . $table . '.' . $column_name] = 1; - } - } - } - return $keys; -} - -/** - * Return script to create j_tab and h_tab arrays - * - * @return string - */ -function PMA_getScriptTabs() -{ - $retval = array( - 'j_tabs' => array(), - 'h_tabs' => array() - ); - - for ($i = 0, $cnt = count($GLOBALS['PMD']['TABLE_NAME']); $i < $cnt; $i++) { - $j = 0; - if (PMA\libraries\Util::isForeignKeySupported($GLOBALS['PMD']['TABLE_TYPE'][$i])) { - $j = 1; - } - $retval['j_tabs'][$GLOBALS['PMD_URL']['TABLE_NAME'][$i]] = $j; - $retval['h_tabs'][$GLOBALS['PMD_URL']['TABLE_NAME'][$i]] = 1; - } - return $retval; -} - -/** - * Returns table positions of a given pdf page - * - * @param int $pg pdf page id - * - * @return array of table positions - */ -function PMA_getTablePositions($pg) -{ - $cfgRelation = PMA_getRelationsParam(); - if (! $cfgRelation['pdfwork']) { - return null; - } - - $query = " - SELECT CONCAT_WS('.', `db_name`, `table_name`) AS `name`, - `x` AS `X`, - `y` AS `Y`, - 1 AS `V`, - 1 AS `H` - FROM " . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['table_coords']) . " - WHERE pdf_page_number = " . intval($pg); - - $tab_pos = $GLOBALS['dbi']->fetchResult( - $query, - 'name', - null, - $GLOBALS['controllink'], - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - return $tab_pos; -} - -/** - * Returns page name of a given pdf page - * - * @param int $pg pdf page id - * - * @return String table name - */ -function PMA_getPageName($pg) -{ - $cfgRelation = PMA_getRelationsParam(); - if (! $cfgRelation['pdfwork']) { - return null; - } - - $query = "SELECT `page_descr`" - . " FROM " . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['pdf_pages']) - . " WHERE " . PMA\libraries\Util::backquote('page_nr') . " = " . intval($pg); - $page_name = $GLOBALS['dbi']->fetchResult( - $query, - null, - null, - $GLOBALS['controllink'], - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - return count($page_name) ? $page_name[0] : null; -} - -/** - * Deletes a given pdf page and its corresponding coordinates - * - * @param int $pg page id - * - * @return boolean success/failure - */ -function PMA_deletePage($pg) -{ - $cfgRelation = PMA_getRelationsParam(); - if (! $cfgRelation['pdfwork']) { - return false; - } - - $query = "DELETE FROM " . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['table_coords']) - . " WHERE " . PMA\libraries\Util::backquote('pdf_page_number') . " = " . intval($pg); - $success = PMA_queryAsControlUser( - $query, true, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - if ($success) { - $query = "DELETE FROM " . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['pdf_pages']) - . " WHERE " . PMA\libraries\Util::backquote('page_nr') . " = " . intval($pg); - $success = PMA_queryAsControlUser( - $query, true, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - } - - return (boolean) $success; -} - -/** - * Returns the id of the default pdf page of the database. - * Default page is the one which has the same name as the database. - * - * @param string $db database - * - * @return int id of the default pdf page for the database - */ -function PMA_getDefaultPage($db) -{ - $cfgRelation = PMA_getRelationsParam(); - if (! $cfgRelation['pdfwork']) { - return null; - } - - $query = "SELECT `page_nr`" - . " FROM " . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['pdf_pages']) - . " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($db) . "'" - . " AND `page_descr` = '" . $GLOBALS['dbi']->escapeString($db) . "'"; - - $default_page_no = $GLOBALS['dbi']->fetchResult( - $query, - null, - null, - $GLOBALS['controllink'], - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - if (count($default_page_no)) { - return intval($default_page_no[0]); - } - return -1; -} - -/** - * Get the id of the page to load. If a default page exists it will be returned. - * If no such exists, returns the id of the first page of the database. - * - * @param string $db database - * - * @return int id of the page to load - */ -function PMA_getLoadingPage($db) -{ - $cfgRelation = PMA_getRelationsParam(); - if (! $cfgRelation['pdfwork']) { - return null; - } - - $page_no = -1; - - $default_page_no = PMA_getDefaultPage($db); - if ($default_page_no != -1) { - $page_no = $default_page_no; - } else { - $query = "SELECT MIN(`page_nr`)" - . " FROM " . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['pdf_pages']) - . " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($db) . "'"; - - $min_page_no = $GLOBALS['dbi']->fetchResult( - $query, - null, - null, - $GLOBALS['controllink'], - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - if (count($min_page_no[0])) { - $page_no = $min_page_no[0]; - } - } - return intval($page_no); -} - -/** - * Creates a new page and returns its auto-incrementing id - * - * @param string $pageName name of the page - * @param string $db name of the database - * - * @return int|null - */ -function PMA_createNewPage($pageName, $db) -{ - $cfgRelation = PMA_getRelationsParam(); - if ($cfgRelation['pdfwork']) { - $pageNumber = PMA_REL_createPage( - $pageName, - $cfgRelation, - $db - ); - return $pageNumber; - } - return null; -} - -/** - * Saves positions of table(s) of a given pdf page - * - * @param int $pg pdf page id - * - * @return boolean success/failure - */ -function PMA_saveTablePositions($pg) -{ - $cfgRelation = PMA_getRelationsParam(); - if (! $cfgRelation['pdfwork']) { - return false; - } - - $query = "DELETE FROM " - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['db']) - . "." . PMA\libraries\Util::backquote( - $GLOBALS['cfgRelation']['table_coords'] - ) - . " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($_REQUEST['db']) - . "'" - . " AND `pdf_page_number` = '" . $GLOBALS['dbi']->escapeString($pg) - . "'"; - - $res = PMA_queryAsControlUser( - $query, - true, - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - if (!$res) { - return (boolean)$res; - } - - foreach ($_REQUEST['t_h'] as $key => $value) { - list($DB, $TAB) = explode(".", $key); - if (!$value) { - continue; - } - - $query = "INSERT INTO " - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['db']) . "." - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['table_coords']) - . " (`db_name`, `table_name`, `pdf_page_number`, `x`, `y`)" - . " VALUES (" - . "'" . $GLOBALS['dbi']->escapeString($DB) . "', " - . "'" . $GLOBALS['dbi']->escapeString($TAB) . "', " - . "'" . $GLOBALS['dbi']->escapeString($pg) . "', " - . "'" . $GLOBALS['dbi']->escapeString($_REQUEST['t_x'][$key]) . "', " - . "'" . $GLOBALS['dbi']->escapeString($_REQUEST['t_y'][$key]) . "')"; - - $res = PMA_queryAsControlUser( - $query, true, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - } - - return (boolean) $res; -} - -/** - * Saves the display field for a table. - * - * @param string $db database name - * @param string $table table name - * @param string $field display field name - * - * @return boolean - */ -function PMA_saveDisplayField($db, $table, $field) -{ - $cfgRelation = PMA_getRelationsParam(); - if (!$cfgRelation['displaywork']) { - return false; - } - - $disp = PMA_getDisplayField($db, $table); - if ($disp && $disp === $field) { - $field = ''; - } - - $upd_query = new Table($table, $db, $GLOBALS['dbi']); - $upd_query->updateDisplayField($disp, $field, $cfgRelation); - - return true; -} - -/** - * Adds a new foreign relation - * - * @param string $db database name - * @param string $T1 foreign table - * @param string $F1 foreign field - * @param string $T2 master table - * @param string $F2 master field - * @param string $on_delete on delete action - * @param string $on_update on update action - * - * @return array array of success/failure and message - */ -function PMA_addNewRelation($db, $T1, $F1, $T2, $F2, $on_delete, $on_update) -{ - $tables = $GLOBALS['dbi']->getTablesFull($db, $T1); - $type_T1 = mb_strtoupper($tables[$T1]['ENGINE']); - $tables = $GLOBALS['dbi']->getTablesFull($db, $T2); - $type_T2 = mb_strtoupper($tables[$T2]['ENGINE']); - - // native foreign key - if (PMA\libraries\Util::isForeignKeySupported($type_T1) - && PMA\libraries\Util::isForeignKeySupported($type_T2) - && $type_T1 == $type_T2 - ) { - // relation exists? - $existrel_foreign = PMA_getForeigners($db, $T2, '', 'foreign'); - $foreigner = PMA_searchColumnInForeigners($existrel_foreign, $F2); - if ($foreigner - && isset($foreigner['constraint']) - ) { - return array(false, __('Error: relation already exists.')); - } - // note: in InnoDB, the index does not requires to be on a PRIMARY - // or UNIQUE key - // improve: check all other requirements for InnoDB relations - $result = $GLOBALS['dbi']->query( - 'SHOW INDEX FROM ' . PMA\libraries\Util::backquote($db) - . '.' . PMA\libraries\Util::backquote($T1) . ';' - ); - - // will be use to emphasis prim. keys in the table view - $index_array1 = array(); - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $index_array1[$row['Column_name']] = 1; - } - $GLOBALS['dbi']->freeResult($result); - - $result = $GLOBALS['dbi']->query( - 'SHOW INDEX FROM ' . PMA\libraries\Util::backquote($db) - . '.' . PMA\libraries\Util::backquote($T2) . ';' - ); - // will be used to emphasis prim. keys in the table view - $index_array2 = array(); - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $index_array2[$row['Column_name']] = 1; - } - $GLOBALS['dbi']->freeResult($result); - - if (! empty($index_array1[$F1]) && ! empty($index_array2[$F2])) { - $upd_query = 'ALTER TABLE ' . PMA\libraries\Util::backquote($db) - . '.' . PMA\libraries\Util::backquote($T2) - . ' ADD FOREIGN KEY (' - . PMA\libraries\Util::backquote($F2) . ')' - . ' REFERENCES ' - . PMA\libraries\Util::backquote($db) . '.' - . PMA\libraries\Util::backquote($T1) . '(' - . PMA\libraries\Util::backquote($F1) . ')'; - - if ($on_delete != 'nix') { - $upd_query .= ' ON DELETE ' . $on_delete; - } - if ($on_update != 'nix') { - $upd_query .= ' ON UPDATE ' . $on_update; - } - $upd_query .= ';'; - if ($GLOBALS['dbi']->tryQuery($upd_query)) { - return array(true, __('FOREIGN KEY relation has been added.')); - } - - $error = $GLOBALS['dbi']->getError(); - return array( - false, - __('Error: FOREIGN KEY relation could not be added!') - . "
    " . $error - ); - } - - return array(false, __('Error: Missing index on column(s).')); - } - - // internal (pmadb) relation - if ($GLOBALS['cfgRelation']['relwork'] == false) { - return array(false, __('Error: Relational features are disabled!')); - } - - // no need to recheck if the keys are primary or unique at this point, - // this was checked on the interface part - - $q = "INSERT INTO " - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['db']) - . "." - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['relation']) - . "(master_db, master_table, master_field, " - . "foreign_db, foreign_table, foreign_field)" - . " values(" - . "'" . $GLOBALS['dbi']->escapeString($db) . "', " - . "'" . $GLOBALS['dbi']->escapeString($T2) . "', " - . "'" . $GLOBALS['dbi']->escapeString($F2) . "', " - . "'" . $GLOBALS['dbi']->escapeString($db) . "', " - . "'" . $GLOBALS['dbi']->escapeString($T1) . "', " - . "'" . $GLOBALS['dbi']->escapeString($F1) . "')"; - - if (PMA_queryAsControlUser($q, false, PMA\libraries\DatabaseInterface::QUERY_STORE) - ) { - return array(true, __('Internal relation has been added.')); - } - - $error = $GLOBALS['dbi']->getError($GLOBALS['controllink']); - return array( - false, - __('Error: Internal relation could not be added!') - . "
    " . $error - ); -} - -/** - * Removes a foreign relation - * - * @param string $T1 foreign db.table - * @param string $F1 foreign field - * @param string $T2 master db.table - * @param string $F2 master field - * - * @return array array of success/failure and message - */ -function PMA_removeRelation($T1, $F1, $T2, $F2) -{ - list($DB1, $T1) = explode(".", $T1); - list($DB2, $T2) = explode(".", $T2); - - $tables = $GLOBALS['dbi']->getTablesFull($DB1, $T1); - $type_T1 = mb_strtoupper($tables[$T1]['ENGINE']); - $tables = $GLOBALS['dbi']->getTablesFull($DB2, $T2); - $type_T2 = mb_strtoupper($tables[$T2]['ENGINE']); - - if (PMA\libraries\Util::isForeignKeySupported($type_T1) - && PMA\libraries\Util::isForeignKeySupported($type_T2) - && $type_T1 == $type_T2 - ) { - // InnoDB - $existrel_foreign = PMA_getForeigners($DB2, $T2, '', 'foreign'); - $foreigner = PMA_searchColumnInForeigners($existrel_foreign, $F2); - - if (isset($foreigner['constraint'])) { - $upd_query = 'ALTER TABLE ' . PMA\libraries\Util::backquote($DB2) - . '.' . PMA\libraries\Util::backquote($T2) . ' DROP FOREIGN KEY ' - . PMA\libraries\Util::backquote($foreigner['constraint']) . ';'; - if ($GLOBALS['dbi']->query($upd_query)) { - return array(true, __('FOREIGN KEY relation has been removed.')); - } - - $error = $GLOBALS['dbi']->getError(); - return array( - false, - __('Error: FOREIGN KEY relation could not be removed!') - . "
    " . $error - ); - } - } - - // internal relations - $delete_query = "DELETE FROM " - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['db']) . "." - . $GLOBALS['cfgRelation']['relation'] . " WHERE " - . "master_db = '" . $GLOBALS['dbi']->escapeString($DB2) . "'" - . " AND master_table = '" . $GLOBALS['dbi']->escapeString($T2) . "'" - . " AND master_field = '" . $GLOBALS['dbi']->escapeString($F2) . "'" - . " AND foreign_db = '" . $GLOBALS['dbi']->escapeString($DB1) . "'" - . " AND foreign_table = '" . $GLOBALS['dbi']->escapeString($T1) . "'" - . " AND foreign_field = '" . $GLOBALS['dbi']->escapeString($F1) . "'"; - - $result = PMA_queryAsControlUser( - $delete_query, - false, - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - if (!$result) { - $error = $GLOBALS['dbi']->getError($GLOBALS['controllink']); - return array( - false, - __('Error: Internal relation could not be removed!') . "
    " . $error - ); - } - - return array(true, __('Internal relation has been removed.')); -} - -/** - * Save value for a designer setting - * - * @param string $index setting - * @param string $value value - * - * @return bool whether the operation succeeded - */ -function PMA_saveDesignerSetting($index, $value) -{ - $cfgRelation = PMA_getRelationsParam(); - $cfgDesigner = array( - 'user' => $GLOBALS['cfg']['Server']['user'], - 'db' => $cfgRelation['db'], - 'table' => $cfgRelation['designer_settings'] - ); - - $success = true; - if ($GLOBALS['cfgRelation']['designersettingswork']) { - - $orig_data_query = "SELECT settings_data" - . " FROM " . PMA\libraries\Util::backquote($cfgDesigner['db']) - . "." . PMA\libraries\Util::backquote($cfgDesigner['table']) - . " WHERE username = '" - . $GLOBALS['dbi']->escapeString($cfgDesigner['user']) . "';"; - - $orig_data = $GLOBALS['dbi']->fetchSingleRow( - $orig_data_query, 'ASSOC', $GLOBALS['controllink'] - ); - - if (! empty($orig_data)) { - $orig_data = json_decode($orig_data['settings_data'], true); - $orig_data[$index] = $value; - $orig_data = json_encode($orig_data); - - $save_query = "UPDATE " - . PMA\libraries\Util::backquote($cfgDesigner['db']) - . "." . PMA\libraries\Util::backquote($cfgDesigner['table']) - . " SET settings_data = '" . $orig_data . "'" - . " WHERE username = '" - . $GLOBALS['dbi']->escapeString($cfgDesigner['user']) . "';"; - - $success = PMA_queryAsControlUser($save_query); - } else { - $save_data = array($index => $value); - - $query = "INSERT INTO " - . PMA\libraries\Util::backquote($cfgDesigner['db']) - . "." . PMA\libraries\Util::backquote($cfgDesigner['table']) - . " (username, settings_data)" - . " VALUES('" . $cfgDesigner['user'] . "'," - . " '" . json_encode($save_data) . "');"; - - $success = PMA_queryAsControlUser($query); - } - } - - return (bool) $success; -} diff --git a/#pma/libraries/properties/PropertyItem.php b/#pma/libraries/properties/PropertyItem.php deleted file mode 100644 index 40f910ce..00000000 --- a/#pma/libraries/properties/PropertyItem.php +++ /dev/null @@ -1,46 +0,0 @@ -getProperties() == null - && in_array($property, $this->getProperties(), true) - ) { - return; - } - $this->_properties [] = $property; - } - - /** - * Removes a property from the group of properties - * - * @param OptionsPropertyItem $property the property instance to be removed - * from the group - * - * @return void - */ - public function removeProperty($property) - { - $this->_properties = array_diff( - $this->getProperties(), - array($property) - ); - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the instance of the class - * - * @return array - */ - public function getGroup() - { - return $this; - } - - /** - * Gets the group of properties - * - * @return array - */ - public function getProperties() - { - return $this->_properties; - } - - /** - * Gets the number of properties - * - * @return int - */ - public function getNrOfProperties() - { - return count($this->_properties); - } -} diff --git a/#pma/libraries/properties/options/OptionsPropertyItem.php b/#pma/libraries/properties/options/OptionsPropertyItem.php deleted file mode 100644 index 5841c83c..00000000 --- a/#pma/libraries/properties/options/OptionsPropertyItem.php +++ /dev/null @@ -1,134 +0,0 @@ -_name = $name; - } - if ($text) { - $this->_text = $text; - } - } - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the name - * - * @return string - */ - public function getName() - { - return $this->_name; - } - - /** - * Sets the name - * - * @param string $name name - * - * @return void - */ - public function setName($name) - { - $this->_name = $name; - } - - /** - * Gets the text - * - * @return string - */ - public function getText() - { - return $this->_text; - } - - /** - * Sets the text - * - * @param string $text text - * - * @return void - */ - public function setText($text) - { - $this->_text = $text; - } - - /** - * Gets the force parameter - * - * @return string - */ - public function getForce() - { - return $this->_force; - } - - /** - * Sets the force parameter - * - * @param string $force force parameter - * - * @return void - */ - public function setForce($force) - { - $this->_force = $force; - } - - /** - * Returns the property type ( either "options", or "plugin" ). - * - * @return string - */ - public function getPropertyType() - { - return "options"; - } -} diff --git a/#pma/libraries/properties/options/OptionsPropertyOneItem.php b/#pma/libraries/properties/options/OptionsPropertyOneItem.php deleted file mode 100644 index ef08c0dd..00000000 --- a/#pma/libraries/properties/options/OptionsPropertyOneItem.php +++ /dev/null @@ -1,159 +0,0 @@ -_force_one; - } - - /** - * Sets the force parameter - * - * @param bool $force force parameter - * - * @return void - */ - public function setForce($force) - { - $this->_force_one = $force; - } - - /** - * Gets the values - * - * @return string - */ - public function getValues() - { - return $this->_values; - } - - /** - * Sets the values - * - * @param array $values values - * - * @return void - */ - public function setValues($values) - { - $this->_values = $values; - } - - /** - * Gets MySQL documentation pointer - * - * @return array - */ - public function getDoc() - { - return $this->_doc; - } - - /** - * Sets the doc - * - * @param array $doc MySQL documentation pointer - * - * @return void - */ - public function setDoc($doc) - { - $this->_doc = $doc; - } - - /** - * Gets the length - * - * @return int - */ - public function getLen() - { - return $this->_len; - } - - /** - * Sets the length - * - * @param int $len length - * - * @return void - */ - public function setLen($len) - { - $this->_len = $len; - } - - /** - * Gets the size - * - * @return int - */ - public function getSize() - { - return $this->_size; - } - - /** - * Sets the size - * - * @param int $size size - * - * @return void - */ - public function setSize($size) - { - $this->_size = $size; - } -} diff --git a/#pma/libraries/properties/options/groups/OptionsPropertyMainGroup.php b/#pma/libraries/properties/options/groups/OptionsPropertyMainGroup.php deleted file mode 100644 index 0ff6124c..00000000 --- a/#pma/libraries/properties/options/groups/OptionsPropertyMainGroup.php +++ /dev/null @@ -1,33 +0,0 @@ -_subgroupHeader; - } - - /** - * Sets the subgroup header - * - * @param \PMA\libraries\properties\PropertyItem $subgroupHeader subgroup header - * - * @return void - */ - public function setSubgroupHeader($subgroupHeader) - { - $this->_subgroupHeader = $subgroupHeader; - } -} diff --git a/#pma/libraries/properties/options/items/BoolPropertyItem.php b/#pma/libraries/properties/options/items/BoolPropertyItem.php deleted file mode 100644 index c4315a8f..00000000 --- a/#pma/libraries/properties/options/items/BoolPropertyItem.php +++ /dev/null @@ -1,33 +0,0 @@ -_forceFile; - } - - /** - * Sets the force file parameter - * - * @param bool $forceFile the force file parameter - * - * @return void - */ - public function setForceFile($forceFile) - { - $this->_forceFile = $forceFile; - } -} diff --git a/#pma/libraries/properties/plugins/ImportPluginProperties.php b/#pma/libraries/properties/plugins/ImportPluginProperties.php deleted file mode 100644 index afb82e1d..00000000 --- a/#pma/libraries/properties/plugins/ImportPluginProperties.php +++ /dev/null @@ -1,31 +0,0 @@ -_text; - } - - /** - * Sets the text - * - * @param string $text text - * - * @return void - */ - public function setText($text) - { - $this->_text = $text; - } - - /** - * Gets the extension - * - * @return string - */ - public function getExtension() - { - return $this->_extension; - } - - /** - * Sets the extension - * - * @param string $extension extension - * - * @return void - */ - public function setExtension($extension) - { - $this->_extension = $extension; - } - - /** - * Gets the options - * - * @return OptionsPropertyRootGroup - */ - public function getOptions() - { - return $this->_options; - } - - /** - * Sets the options - * - * @param OptionsPropertyRootGroup $options options - * - * @return void - */ - public function setOptions($options) - { - $this->_options = $options; - } - - /** - * Gets the options text - * - * @return string - */ - public function getOptionsText() - { - return $this->_optionsText; - } - - /** - * Sets the options text - * - * @param string $optionsText optionsText - * - * @return void - */ - public function setOptionsText($optionsText) - { - $this->_optionsText = $optionsText; - } - - /** - * Gets the MIME type - * - * @return string - */ - public function getMimeType() - { - return $this->_mimeType; - } - - /** - * Sets the MIME type - * - * @param string $mimeType MIME type - * - * @return void - */ - public function setMimeType($mimeType) - { - $this->_mimeType = $mimeType; - } - - /** - * Returns the property type ( either "options", or "plugin" ). - * - * @return string - */ - public function getPropertyType() - { - return "plugin"; - } -} diff --git a/#pma/libraries/properties/plugins/SchemaPluginProperties.php b/#pma/libraries/properties/plugins/SchemaPluginProperties.php deleted file mode 100644 index 7aba43c4..00000000 --- a/#pma/libraries/properties/plugins/SchemaPluginProperties.php +++ /dev/null @@ -1,44 +0,0 @@ -query( - $sql, - $GLOBALS['controllink'], - $options, - $cache_affected_rows - ); - } else { - $result = @$GLOBALS['dbi']->tryQuery( - $sql, - $GLOBALS['controllink'], - $options, - $cache_affected_rows - ); - } // end if... else... - - if ($result) { - return $result; - } else { - return false; - } -} // end of the "PMA_queryAsControlUser()" function - -/** - * Returns current relation parameters - * - * @return array $cfgRelation - */ -function PMA_getRelationsParam() -{ - if (empty($_SESSION['relation'][$GLOBALS['server']]) - || (empty($_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION'])) - || $_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION'] != PMA_VERSION - ) { - $_SESSION['relation'][$GLOBALS['server']] = PMA_checkRelationsParam(); - } - - // just for BC but needs to be before PMA_getRelationsParamDiagnostic() - // which uses it - $GLOBALS['cfgRelation'] = $_SESSION['relation'][$GLOBALS['server']]; - - return $_SESSION['relation'][$GLOBALS['server']]; -} - -/** - * prints out diagnostic info for pma relation feature - * - * @param array $cfgRelation Relation configuration - * - * @return string - */ -function PMA_getRelationsParamDiagnostic($cfgRelation) -{ - $retval = '
    '; - - $messages = array(); - $messages['error'] = '' - . __('not OK') - . ''; - - $messages['ok'] = '' - . _pgettext('Correctly working', 'OK') - . ''; - - $messages['enabled'] = '' . __('Enabled') . ''; - $messages['disabled'] = '' . __('Disabled') . ''; - - if (empty($cfgRelation['db'])) { - $retval .= __('Configuration of pmadb…') . ' ' - . $messages['error'] - . PMA\libraries\Util::showDocu('setup', 'linked-tables') - . '
    ' . "\n" - . __('General relation features') - . ' ' . __('Disabled') - . '' . "\n"; - if ($GLOBALS['cfg']['ZeroConf']) { - if (empty($GLOBALS['db'])) { - $retval .= PMA_getHtmlFixPMATables(true, true); - } else { - $retval .= PMA_getHtmlFixPMATables(true); - } - } - } else { - $retval .= '' . "\n"; - - if (! $cfgRelation['allworks'] - && $GLOBALS['cfg']['ZeroConf'] - // Avoid showing a "Create missing tables" link if it's a - // problem of missing definition - && PMA_arePmadbTablesDefined() - ) { - $retval .= PMA_getHtmlFixPMATables(false); - $retval .= '
    '; - } - - $retval .= PMA_getDiagMessageForParameter( - 'pmadb', - $cfgRelation['db'], - $messages, - 'pmadb' - ); - $retval .= PMA_getDiagMessageForParameter( - 'relation', - isset($cfgRelation['relation']), - $messages, - 'relation' - ); - $retval .= PMA_getDiagMessageForFeature( - __('General relation features'), - 'relwork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'table_info', - isset($cfgRelation['table_info']), - $messages, - 'table_info' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Display Features'), - 'displaywork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'table_coords', - isset($cfgRelation['table_coords']), - $messages, - 'table_coords' - ); - $retval .= PMA_getDiagMessageForParameter( - 'pdf_pages', - isset($cfgRelation['pdf_pages']), - $messages, - 'pdf_pages' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Designer and creation of PDFs'), - 'pdfwork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'column_info', - isset($cfgRelation['column_info']), - $messages, - 'column_info' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Displaying Column Comments'), - 'commwork', - $messages, - false - ); - $retval .= PMA_getDiagMessageForFeature( - __('Browser transformation'), - 'mimework', - $messages - ); - if ($cfgRelation['commwork'] && ! $cfgRelation['mimework']) { - $retval .= ''; - } - $retval .= PMA_getDiagMessageForParameter( - 'bookmarktable', - isset($cfgRelation['bookmark']), - $messages, - 'bookmark' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Bookmarked SQL query'), - 'bookmarkwork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'history', - isset($cfgRelation['history']), - $messages, - 'history' - ); - $retval .= PMA_getDiagMessageForFeature( - __('SQL history'), - 'historywork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'recent', - isset($cfgRelation['recent']), - $messages, - 'recent' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Persistent recently used tables'), - 'recentwork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'favorite', - isset($cfgRelation['favorite']), - $messages, - 'favorite' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Persistent favorite tables'), - 'favoritework', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'table_uiprefs', - isset($cfgRelation['table_uiprefs']), - $messages, - 'table_uiprefs' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Persistent tables\' UI preferences'), - 'uiprefswork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'tracking', - isset($cfgRelation['tracking']), - $messages, - 'tracking' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Tracking'), - 'trackingwork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'userconfig', - isset($cfgRelation['userconfig']), - $messages, - 'userconfig' - ); - $retval .= PMA_getDiagMessageForFeature( - __('User preferences'), - 'userconfigwork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'users', - isset($cfgRelation['users']), - $messages, - 'users' - ); - $retval .= PMA_getDiagMessageForParameter( - 'usergroups', - isset($cfgRelation['usergroups']), - $messages, - 'usergroups' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Configurable menus'), - 'menuswork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'navigationhiding', - isset($cfgRelation['navigationhiding']), - $messages, - 'navigationhiding' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Hide/show navigation items'), - 'navwork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'savedsearches', - isset($cfgRelation['savedsearches']), - $messages, - 'savedsearches' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Saving Query-By-Example searches'), - 'savedsearcheswork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'central_columns', - isset($cfgRelation['central_columns']), - $messages, - 'central_columns' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Managing Central list of columns'), - 'centralcolumnswork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'designer_settings', - isset($cfgRelation['designer_settings']), - $messages, - 'designer_settings' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Remembering Designer Settings'), - 'designersettingswork', - $messages - ); - $retval .= PMA_getDiagMessageForParameter( - 'export_templates', - isset($cfgRelation['export_templates']), - $messages, - 'export_templates' - ); - $retval .= PMA_getDiagMessageForFeature( - __('Saving export templates'), - 'exporttemplateswork', - $messages - ); - $retval .= '
    '; - $retval .= __( - 'Please see the documentation on how to' - . ' update your column_info table. ' - ); - $retval .= PMA\libraries\Util::showDocu( - 'config', - 'cfg_Servers_column_info' - ); - $retval .= '
    ' . "\n"; - - if (! $cfgRelation['allworks']) { - - $retval .= '

    ' . __('Quick steps to set up advanced features:') - . '

    '; - - $items = array(); - $items[] = sprintf( - __( - 'Create the needed tables with the ' - . '%screate_tables.sql.' - ), - htmlspecialchars(SQL_DIR) - ) . ' ' . PMA\libraries\Util::showDocu('setup', 'linked-tables'); - $items[] = __('Create a pma user and give access to these tables.') . ' ' - . PMA\libraries\Util::showDocu('config', 'cfg_Servers_controluser'); - $items[] = __( - 'Enable advanced features in configuration file ' - . '(config.inc.php), for example by ' - . 'starting from config.sample.inc.php.' - ) . ' ' . PMA\libraries\Util::showDocu('setup', 'quick-install'); - $items[] = __( - 'Re-login to phpMyAdmin to load the updated configuration file.' - ); - - $retval .= PMA\libraries\Template::get('list/unordered')->render( - array('items' => $items,) - ); - } - } - - return $retval; -} - -/** - * prints out one diagnostic message for a feature - * - * @param string $feature_name feature name in a message string - * @param string $relation_parameter the $GLOBALS['cfgRelation'] parameter to check - * @param array $messages utility messages - * @param boolean $skip_line whether to skip a line after the message - * - * @return string - */ -function PMA_getDiagMessageForFeature($feature_name, - $relation_parameter, $messages, $skip_line = true -) { - $retval = ' ' . $feature_name . ': '; - if (isset($GLOBALS['cfgRelation'][$relation_parameter]) - && $GLOBALS['cfgRelation'][$relation_parameter] - ) { - $retval .= $messages['enabled']; - } else { - $retval .= $messages['disabled']; - } - $retval .= ''; - if ($skip_line) { - $retval .= ' '; - } - return $retval; -} - -/** - * prints out one diagnostic message for a configuration parameter - * - * @param string $parameter config parameter name to display - * @param boolean $relationParameterSet whether this parameter is set - * @param array $messages utility messages - * @param string $docAnchor anchor in documentation - * - * @return string - */ -function PMA_getDiagMessageForParameter($parameter, - $relationParameterSet, $messages, $docAnchor -) { - $retval = ''; - $retval .= '$cfg[\'Servers\'][$i][\'' . $parameter . '\'] ... '; - $retval .= ''; - if ($relationParameterSet) { - $retval .= $messages['ok']; - } else { - $retval .= sprintf( - $messages['error'], - PMA\libraries\Util::getDocuLink('config', 'cfg_Servers_' . $docAnchor) - ); - } - $retval .= '' . "\n"; - return $retval; -} - - -/** - * Defines the relation parameters for the current user - * just a copy of the functions used for relations ;-) - * but added some stuff to check what will work - * - * @access protected - * @return array the relation parameters for the current user - */ -function PMA_checkRelationsParam() -{ - $cfgRelation = array(); - $cfgRelation['PMA_VERSION'] = PMA_VERSION; - - $workToTable = array( - 'relwork' => 'relation', - 'displaywork' => array('relation', 'table_info'), - 'bookmarkwork' => 'bookmarktable', - 'pdfwork' => array('table_coords', 'pdf_pages'), - 'commwork' => 'column_info', - 'mimework' => 'column_info', - 'historywork' => 'history', - 'recentwork' => 'recent', - 'favoritework' => 'favorite', - 'uiprefswork' => 'table_uiprefs', - 'trackingwork' => 'tracking', - 'userconfigwork' => 'userconfig', - 'menuswork' => array('users', 'usergroups'), - 'navwork' => 'navigationhiding', - 'savedsearcheswork' => 'savedsearches', - 'centralcolumnswork' => 'central_columns', - 'designersettingswork' => 'designer_settings', - 'exporttemplateswork' => 'export_templates', - ); - - foreach ($workToTable as $work => $table) { - $cfgRelation[$work] = false; - } - $cfgRelation['allworks'] = false; - $cfgRelation['user'] = null; - $cfgRelation['db'] = null; - - if ($GLOBALS['server'] == 0 - || empty($GLOBALS['cfg']['Server']['pmadb']) - || empty($GLOBALS['controllink']) - || ! $GLOBALS['dbi']->selectDb( - $GLOBALS['cfg']['Server']['pmadb'], $GLOBALS['controllink'] - ) - ) { - // No server selected -> no bookmark table - // we return the array with the falses in it, - // to avoid some 'Uninitialized string offset' errors later - $GLOBALS['cfg']['Server']['pmadb'] = false; - return $cfgRelation; - } - - $cfgRelation['user'] = $GLOBALS['cfg']['Server']['user']; - $cfgRelation['db'] = $GLOBALS['cfg']['Server']['pmadb']; - - // Now I just check if all tables that i need are present so I can for - // example enable relations but not pdf... - // I was thinking of checking if they have all required columns but I - // fear it might be too slow - - $tab_query = 'SHOW TABLES FROM ' - . PMA\libraries\Util::backquote( - $GLOBALS['cfg']['Server']['pmadb'] - ); - $tab_rs = PMA_queryAsControlUser( - $tab_query, false, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - if (! $tab_rs) { - // query failed ... ? - //$GLOBALS['cfg']['Server']['pmadb'] = false; - return $cfgRelation; - } - - while ($curr_table = @$GLOBALS['dbi']->fetchRow($tab_rs)) { - if ($curr_table[0] == $GLOBALS['cfg']['Server']['bookmarktable']) { - $cfgRelation['bookmark'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['relation']) { - $cfgRelation['relation'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['table_info']) { - $cfgRelation['table_info'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['table_coords']) { - $cfgRelation['table_coords'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['column_info']) { - $cfgRelation['column_info'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['pdf_pages']) { - $cfgRelation['pdf_pages'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['history']) { - $cfgRelation['history'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['recent']) { - $cfgRelation['recent'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['favorite']) { - $cfgRelation['favorite'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['table_uiprefs']) { - $cfgRelation['table_uiprefs'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['tracking']) { - $cfgRelation['tracking'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['userconfig']) { - $cfgRelation['userconfig'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['users']) { - $cfgRelation['users'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['usergroups']) { - $cfgRelation['usergroups'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['navigationhiding']) { - $cfgRelation['navigationhiding'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['savedsearches']) { - $cfgRelation['savedsearches'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['central_columns']) { - $cfgRelation['central_columns'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['designer_settings']) { - $cfgRelation['designer_settings'] = $curr_table[0]; - } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['export_templates']) { - $cfgRelation['export_templates'] = $curr_table[0]; - } - } // end while - $GLOBALS['dbi']->freeResult($tab_rs); - - if (isset($cfgRelation['relation'])) { - $cfgRelation['relwork'] = true; - } - - if (isset($cfgRelation['relation']) && isset($cfgRelation['table_info'])) { - $cfgRelation['displaywork'] = true; - } - - if (isset($cfgRelation['table_coords']) && isset($cfgRelation['pdf_pages'])) { - $cfgRelation['pdfwork'] = true; - } - - if (isset($cfgRelation['column_info'])) { - $cfgRelation['commwork'] = true; - // phpMyAdmin 4.3+ - // Check for input transformations upgrade. - $cfgRelation['mimework'] = PMA_tryUpgradeTransformations(); - } - - if (isset($cfgRelation['history'])) { - $cfgRelation['historywork'] = true; - } - - if (isset($cfgRelation['recent'])) { - $cfgRelation['recentwork'] = true; - } - - if (isset($cfgRelation['favorite'])) { - $cfgRelation['favoritework'] = true; - } - - if (isset($cfgRelation['table_uiprefs'])) { - $cfgRelation['uiprefswork'] = true; - } - - if (isset($cfgRelation['tracking'])) { - $cfgRelation['trackingwork'] = true; - } - - if (isset($cfgRelation['userconfig'])) { - $cfgRelation['userconfigwork'] = true; - } - - if (isset($cfgRelation['bookmark'])) { - $cfgRelation['bookmarkwork'] = true; - } - - if (isset($cfgRelation['users']) && isset($cfgRelation['usergroups'])) { - $cfgRelation['menuswork'] = true; - } - - if (isset($cfgRelation['navigationhiding'])) { - $cfgRelation['navwork'] = true; - } - - if (isset($cfgRelation['savedsearches'])) { - $cfgRelation['savedsearcheswork'] = true; - } - - if (isset($cfgRelation['central_columns'])) { - $cfgRelation['centralcolumnswork'] = true; - } - - if (isset($cfgRelation['designer_settings'])) { - $cfgRelation['designersettingswork'] = true; - } - - if (isset($cfgRelation['export_templates'])) { - $cfgRelation['exporttemplateswork'] = true; - } - - $allWorks = true; - foreach ($workToTable as $work => $table) { - if (! $cfgRelation[$work]) { - if (is_string($table)) { - if (isset($GLOBALS['cfg']['Server'][$table]) - && $GLOBALS['cfg']['Server'][$table] !== false - ) { - $allWorks = false; - break; - } - } else if (is_array($table)) { - $oneNull = false; - foreach ($table as $t) { - if (isset($GLOBALS['cfg']['Server'][$t]) - && $GLOBALS['cfg']['Server'][$t] === false - ) { - $oneNull = true; - break; - } - } - if (! $oneNull) { - $allWorks = false; - break; - } - } - } - } - $cfgRelation['allworks'] = $allWorks; - - return $cfgRelation; -} // end of the 'PMA_checkRelationsParam()' function - -/** - * Check whether column_info table input transformation - * upgrade is required and try to upgrade silently - * - * @return bool false if upgrade failed - * - * @access public - */ -function PMA_tryUpgradeTransformations() -{ - // From 4.3, new input oriented transformation feature was introduced. - // Check whether column_info table has input transformation columns - $new_cols = array( - "input_transformation", - "input_transformation_options" - ); - $query = 'SHOW COLUMNS FROM ' - . PMA\libraries\Util::backquote($GLOBALS['cfg']['Server']['pmadb']) - . '.' . PMA\libraries\Util::backquote( - $GLOBALS['cfg']['Server']['column_info'] - ) - . ' WHERE Field IN (\'' . implode('\', \'', $new_cols) . '\')'; - $result = PMA_queryAsControlUser( - $query, false, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - if ($result) { - $rows = $GLOBALS['dbi']->numRows($result); - $GLOBALS['dbi']->freeResult($result); - // input transformations are present - // no need to upgrade - if ($rows === 2) { - return true; - // try silent upgrade without disturbing the user - } else { - // read upgrade query file - $query = @file_get_contents(SQL_DIR . 'upgrade_column_info_4_3_0+.sql'); - // replace database name from query to with set in config.inc.php - $query = str_replace( - '`phpmyadmin`', - PMA\libraries\Util::backquote($GLOBALS['cfg']['Server']['pmadb']), - $query - ); - // replace pma__column_info table name from query - // to with set in config.inc.php - $query = str_replace( - '`pma__column_info`', - PMA\libraries\Util::backquote( - $GLOBALS['cfg']['Server']['column_info'] - ), - $query - ); - $GLOBALS['dbi']->tryMultiQuery($query, $GLOBALS['controllink']); - // skips result sets of query as we are not interested in it - while ($GLOBALS['dbi']->moreResults($GLOBALS['controllink']) - && $GLOBALS['dbi']->nextResult($GLOBALS['controllink']) - ) { - } - $error = $GLOBALS['dbi']->getError($GLOBALS['controllink']); - // return true if no error exists otherwise false - return empty($error); - } - } - // some failure, either in upgrading or something else - // make some noise, time to wake up user. - return false; -} - -/** - * Gets all Relations to foreign tables for a given table or - * optionally a given column in a table - * - * @param string $db the name of the db to check for - * @param string $table the name of the table to check for - * @param string $column the name of the column to check for - * @param string $source the source for foreign key information - * - * @return array db,table,column - * - * @access public - */ -function PMA_getForeigners($db, $table, $column = '', $source = 'both') -{ - $cfgRelation = PMA_getRelationsParam(); - $foreign = array(); - - if ($cfgRelation['relwork'] && ($source == 'both' || $source == 'internal')) { - $rel_query = ' - SELECT `master_field`, - `foreign_db`, - `foreign_table`, - `foreign_field` - FROM ' . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['relation']) . ' - WHERE `master_db` = \'' . $GLOBALS['dbi']->escapeString($db) . '\' - AND `master_table` = \'' . $GLOBALS['dbi']->escapeString($table) - . '\' '; - if (mb_strlen($column)) { - $rel_query .= ' AND `master_field` = ' - . '\'' . $GLOBALS['dbi']->escapeString($column) . '\''; - } - $foreign = $GLOBALS['dbi']->fetchResult( - $rel_query, 'master_field', null, $GLOBALS['controllink'] - ); - } - - if (($source == 'both' || $source == 'foreign') && mb_strlen($table) - ) { - $tableObj = new Table($table, $db); - $show_create_table = $tableObj->showCreate(); - if ($show_create_table) { - $parser = new SqlParser\Parser($show_create_table); - /** - * @var CreateStatement $stmt - */ - $stmt = $parser->statements[0]; - $foreign['foreign_keys_data'] = SqlParser\Utils\Table::getForeignKeys( - $stmt - ); - } - } - - /** - * Emulating relations for some information_schema tables - */ - $isInformationSchema = mb_strtolower($db) == 'information_schema'; - $isMysql = mb_strtolower($db) == 'mysql'; - if (($isInformationSchema || $isMysql) - && ($source == 'internal' || $source == 'both') - ) { - if ($isInformationSchema) { - $relations_key = 'information_schema_relations'; - include_once './libraries/information_schema_relations.lib.php'; - } else { - $relations_key = 'mysql_relations'; - include_once './libraries/mysql_relations.lib.php'; - } - if (isset($GLOBALS[$relations_key][$table])) { - foreach ($GLOBALS[$relations_key][$table] as $field => $relations) { - if ((! mb_strlen($column) || $column == $field) - && (! isset($foreign[$field]) - || ! mb_strlen($foreign[$field])) - ) { - $foreign[$field] = $relations; - } - } - } - } - - return $foreign; -} // end of the 'PMA_getForeigners()' function - -/** - * Gets the display field of a table - * - * @param string $db the name of the db to check for - * @param string $table the name of the table to check for - * - * @return string field name - * - * @access public - */ -function PMA_getDisplayField($db, $table) -{ - $cfgRelation = PMA_getRelationsParam(); - - /** - * Try to fetch the display field from DB. - */ - if ($cfgRelation['displaywork']) { - $disp_query = ' - SELECT `display_field` - FROM ' . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['table_info']) . ' - WHERE `db_name` = \'' . $GLOBALS['dbi']->escapeString($db) . '\' - AND `table_name` = \'' . $GLOBALS['dbi']->escapeString($table) - . '\''; - - $row = $GLOBALS['dbi']->fetchSingleRow( - $disp_query, 'ASSOC', $GLOBALS['controllink'] - ); - if (isset($row['display_field'])) { - return $row['display_field']; - } - } - - /** - * Emulating the display field for some information_schema tables. - */ - if ($db == 'information_schema') { - switch ($table) { - case 'CHARACTER_SETS': - return 'DESCRIPTION'; - case 'TABLES': - return 'TABLE_COMMENT'; - } - } - - /** - * No Luck... - */ - return false; - -} // end of the 'PMA_getDisplayField()' function - -/** - * Gets the comments for all columns of a table or the db itself - * - * @param string $db the name of the db to check for - * @param string $table the name of the table to check for - * - * @return array [column_name] = comment - * - * @access public - */ -function PMA_getComments($db, $table = '') -{ - $comments = array(); - - if ($table != '') { - // MySQL native column comments - $columns = $GLOBALS['dbi']->getColumns($db, $table, null, true); - if ($columns) { - foreach ($columns as $column) { - if (! empty($column['Comment'])) { - $comments[$column['Field']] = $column['Comment']; - } - } - } - } else { - $comments[] = PMA_getDbComment($db); - } - - return $comments; -} // end of the 'PMA_getComments()' function - -/** - * Gets the comment for a db - * - * @param string $db the name of the db to check for - * - * @return string comment - * - * @access public - */ -function PMA_getDbComment($db) -{ - $cfgRelation = PMA_getRelationsParam(); - $comment = ''; - - if ($cfgRelation['commwork']) { - // pmadb internal db comment - $com_qry = " - SELECT `comment` - FROM " . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['column_info']) - . " - WHERE db_name = '" . $GLOBALS['dbi']->escapeString($db) . "' - AND table_name = '' - AND column_name = '(db_comment)'"; - $com_rs = PMA_queryAsControlUser( - $com_qry, true, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - if ($com_rs && $GLOBALS['dbi']->numRows($com_rs) > 0) { - $row = $GLOBALS['dbi']->fetchAssoc($com_rs); - $comment = $row['comment']; - } - $GLOBALS['dbi']->freeResult($com_rs); - } - - return $comment; -} // end of the 'PMA_getDbComment()' function - -/** - * Gets the comment for a db - * - * @access public - * - * @return string comment - */ -function PMA_getDbComments() -{ - $cfgRelation = PMA_getRelationsParam(); - $comments = array(); - - if ($cfgRelation['commwork']) { - // pmadb internal db comment - $com_qry = " - SELECT `db_name`, `comment` - FROM " . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['column_info']) - . " - WHERE `column_name` = '(db_comment)'"; - $com_rs = PMA_queryAsControlUser( - $com_qry, true, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - if ($com_rs && $GLOBALS['dbi']->numRows($com_rs) > 0) { - while ($row = $GLOBALS['dbi']->fetchAssoc($com_rs)) { - $comments[$row['db_name']] = $row['comment']; - } - } - $GLOBALS['dbi']->freeResult($com_rs); - } - - return $comments; -} // end of the 'PMA_getDbComments()' function - -/** - * Set a database comment to a certain value. - * - * @param string $db the name of the db - * @param string $comment the value of the column - * - * @return boolean true, if comment-query was made. - * - * @access public - */ -function PMA_setDbComment($db, $comment = '') -{ - $cfgRelation = PMA_getRelationsParam(); - - if (! $cfgRelation['commwork']) { - return false; - } - - if (mb_strlen($comment)) { - $upd_query = 'INSERT INTO ' - . PMA\libraries\Util::backquote($cfgRelation['db']) . '.' - . PMA\libraries\Util::backquote($cfgRelation['column_info']) - . ' (`db_name`, `table_name`, `column_name`, `comment`)' - . ' VALUES (\'' - . $GLOBALS['dbi']->escapeString($db) - . "', '', '(db_comment)', '" - . $GLOBALS['dbi']->escapeString($comment) - . "') " - . ' ON DUPLICATE KEY UPDATE ' - . "`comment` = '" . $GLOBALS['dbi']->escapeString($comment) . "'"; - } else { - $upd_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) . '.' - . PMA\libraries\Util::backquote($cfgRelation['column_info']) - . ' WHERE `db_name` = \'' . $GLOBALS['dbi']->escapeString($db) - . '\' - AND `table_name` = \'\' - AND `column_name` = \'(db_comment)\''; - } - - if (isset($upd_query)) { - return PMA_queryAsControlUser($upd_query); - } - - return false; -} // end of 'PMA_setDbComment()' function - -/** - * Set a SQL history entry - * - * @param string $db the name of the db - * @param string $table the name of the table - * @param string $username the username - * @param string $sqlquery the sql query - * - * @return void - * - * @access public - */ -function PMA_setHistory($db, $table, $username, $sqlquery) -{ - $maxCharactersInDisplayedSQL = $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']; - // Prevent to run this automatically on Footer class destroying in testsuite - if (defined('TESTSUITE') - || mb_strlen($sqlquery) > $maxCharactersInDisplayedSQL - ) { - return; - } - - $cfgRelation = PMA_getRelationsParam(); - - if (! isset($_SESSION['sql_history'])) { - $_SESSION['sql_history'] = array(); - } - - $_SESSION['sql_history'][] = array( - 'db' => $db, - 'table' => $table, - 'sqlquery' => $sqlquery, - ); - - if (count($_SESSION['sql_history']) > $GLOBALS['cfg']['QueryHistoryMax']) { - // history should not exceed a maximum count - array_shift($_SESSION['sql_history']); - } - - if (! $cfgRelation['historywork'] || ! $GLOBALS['cfg']['QueryHistoryDB']) { - return; - } - - PMA_queryAsControlUser( - 'INSERT INTO ' - . PMA\libraries\Util::backquote($cfgRelation['db']) . '.' - . PMA\libraries\Util::backquote($cfgRelation['history']) . ' - (`username`, - `db`, - `table`, - `timevalue`, - `sqlquery`) - VALUES - (\'' . $GLOBALS['dbi']->escapeString($username) . '\', - \'' . $GLOBALS['dbi']->escapeString($db) . '\', - \'' . $GLOBALS['dbi']->escapeString($table) . '\', - NOW(), - \'' . $GLOBALS['dbi']->escapeString($sqlquery) . '\')' - ); - - PMA_purgeHistory($username); - -} // end of 'PMA_setHistory()' function - -/** - * Gets a SQL history entry - * - * @param string $username the username - * - * @return array list of history items - * - * @access public - */ -function PMA_getHistory($username) -{ - $cfgRelation = PMA_getRelationsParam(); - - if (! $cfgRelation['historywork']) { - return false; - } - - /** - * if db-based history is disabled but there exists a session-based - * history, use it - */ - if (! $GLOBALS['cfg']['QueryHistoryDB']) { - if (isset($_SESSION['sql_history'])) { - return array_reverse($_SESSION['sql_history']); - } - return false; - } - - $hist_query = ' - SELECT `db`, - `table`, - `sqlquery`, - `timevalue` - FROM ' . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['history']) . ' - WHERE `username` = \'' . $GLOBALS['dbi']->escapeString($username) . '\' - ORDER BY `id` DESC'; - - return $GLOBALS['dbi']->fetchResult( - $hist_query, null, null, $GLOBALS['controllink'] - ); -} // end of 'PMA_getHistory()' function - -/** - * purges SQL history - * - * deletes entries that exceeds $cfg['QueryHistoryMax'], oldest first, for the - * given user - * - * @param string $username the username - * - * @return void - * - * @access public - */ -function PMA_purgeHistory($username) -{ - $cfgRelation = PMA_getRelationsParam(); - if (! $GLOBALS['cfg']['QueryHistoryDB'] || ! $cfgRelation['historywork']) { - return; - } - - if (! $cfgRelation['historywork']) { - return; - } - - $search_query = ' - SELECT `timevalue` - FROM ' . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['history']) . ' - WHERE `username` = \'' . $GLOBALS['dbi']->escapeString($username) . '\' - ORDER BY `timevalue` DESC - LIMIT ' . $GLOBALS['cfg']['QueryHistoryMax'] . ', 1'; - - if ($max_time = $GLOBALS['dbi']->fetchValue( - $search_query, 0, 0, $GLOBALS['controllink'] - )) { - PMA_queryAsControlUser( - 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) . '.' - . PMA\libraries\Util::backquote($cfgRelation['history']) . ' - WHERE `username` = \'' . $GLOBALS['dbi']->escapeString($username) - . '\' - AND `timevalue` <= \'' . $max_time . '\'' - ); - } -} // end of 'PMA_purgeHistory()' function - -/** - * Prepares the dropdown for one mode - * - * @param array $foreign the keys and values for foreigns - * @param string $data the current data of the dropdown - * @param string $mode the needed mode - * - * @return array the '; - } elseif ($mode == 'id-content') { - $reloptions[] = $reloption . '>' - . htmlspecialchars($key) . ' - ' . $value . ''; - } elseif ($mode == 'id-only') { - $reloptions[] = $reloption . '>' - . htmlspecialchars($key) . ''; - } - } // end foreach - - return $reloptions; -} // end of 'PMA_buildForeignDropdown' function - -/** - * Outputs dropdown with values of foreign fields - * - * @param array $disp_row array of the displayed row - * @param string $foreign_field the foreign field - * @param string $foreign_display the foreign field to display - * @param string $data the current data of the dropdown (field in row) - * @param int $max maximum number of items in the dropdown - * - * @return string the '; - $top_count = count($top); - if ($max == -1 || $top_count < $max) { - $ret .= implode('', $top); - if ($foreign_display && $top_count > 0) { - // this empty option is to visually mark the beginning of the - // second series of values (bottom) - $ret .= ''; - } - } - if ($foreign_display) { - $ret .= implode('', $bottom); - } - - return $ret; -} // end of 'PMA_foreignDropdown()' function - -/** - * Gets foreign keys in preparation for a drop-down selector - * - * @param array|boolean $foreigners array of the foreign keys - * @param string $field the foreign field name - * @param bool $override_total whether to override the total - * @param string $foreign_filter a possible filter - * @param string $foreign_limit a possible LIMIT clause - * @param bool $get_total optional, whether to get total num of rows - * in $foreignData['the_total;] - * (has an effect of performance) - * - * @return array data about the foreign keys - * - * @access public - */ -function PMA_getForeignData( - $foreigners, $field, $override_total, - $foreign_filter, $foreign_limit, $get_total=false -) { - // we always show the foreign field in the drop-down; if a display - // field is defined, we show it besides the foreign field - $foreign_link = false; - do { - if (! $foreigners) { - break; - } - $foreigner = PMA_searchColumnInForeigners($foreigners, $field); - if ($foreigner != false) { - $foreign_db = $foreigner['foreign_db']; - $foreign_table = $foreigner['foreign_table']; - $foreign_field = $foreigner['foreign_field']; - } else { - break; - } - - // Count number of rows in the foreign table. Currently we do - // not use a drop-down if more than ForeignKeyMaxLimit rows in the - // foreign table, - // for speed reasons and because we need a better interface for this. - // - // We could also do the SELECT anyway, with a LIMIT, and ensure that - // the current value of the field is one of the choices. - - // Check if table has more rows than specified by - // $GLOBALS['cfg']['ForeignKeyMaxLimit'] - $moreThanLimit = $GLOBALS['dbi']->getTable($foreign_db, $foreign_table) - ->checkIfMinRecordsExist($GLOBALS['cfg']['ForeignKeyMaxLimit']); - - if ($override_total == true - || !$moreThanLimit - ) { - // foreign_display can be false if no display field defined: - $foreign_display = PMA_getDisplayField($foreign_db, $foreign_table); - - $f_query_main = 'SELECT ' . PMA\libraries\Util::backquote($foreign_field) - . ( - ($foreign_display == false) - ? '' - : ', ' . PMA\libraries\Util::backquote($foreign_display) - ); - $f_query_from = ' FROM ' . PMA\libraries\Util::backquote($foreign_db) - . '.' . PMA\libraries\Util::backquote($foreign_table); - $f_query_filter = empty($foreign_filter) ? '' : ' WHERE ' - . PMA\libraries\Util::backquote($foreign_field) - . ' LIKE "%' . $GLOBALS['dbi']->escapeString($foreign_filter) . '%"' - . ( - ($foreign_display == false) - ? '' - : ' OR ' . PMA\libraries\Util::backquote($foreign_display) - . ' LIKE "%' . $GLOBALS['dbi']->escapeString($foreign_filter) - . '%"' - ); - $f_query_order = ($foreign_display == false) ? '' :' ORDER BY ' - . PMA\libraries\Util::backquote($foreign_table) . '.' - . PMA\libraries\Util::backquote($foreign_display); - - $f_query_limit = ! empty($foreign_limit) ? ($foreign_limit) : ''; - - if (!empty($foreign_filter)) { - $the_total = $GLOBALS['dbi']->fetchValue( - 'SELECT COUNT(*)' . $f_query_from . $f_query_filter - ); - if ($the_total === false) { - $the_total = 0; - } - } - - $disp = $GLOBALS['dbi']->tryQuery( - $f_query_main . $f_query_from . $f_query_filter - . $f_query_order . $f_query_limit - ); - if ($disp && $GLOBALS['dbi']->numRows($disp) > 0) { - // If a resultset has been created, pre-cache it in the $disp_row - // array. This helps us from not needing to use mysql_data_seek by - // accessing a pre-cached PHP array. Usually those resultsets are - // not that big, so a performance hit should not be expected. - $disp_row = array(); - while ($single_disp_row = @$GLOBALS['dbi']->fetchAssoc($disp)) { - $disp_row[] = $single_disp_row; - } - @$GLOBALS['dbi']->freeResult($disp); - } else { - // Either no data in the foreign table or - // user does not have select permission to foreign table/field - // Show an input field with a 'Browse foreign values' link - $disp_row = null; - $foreign_link = true; - } - } else { - $disp_row = null; - $foreign_link = true; - } - } while (false); - - if ($get_total) { - $the_total = $GLOBALS['dbi']->getTable($foreign_db, $foreign_table) - ->countRecords(true); - } - - $foreignData = array(); - $foreignData['foreign_link'] = $foreign_link; - $foreignData['the_total'] = isset($the_total) ? $the_total : null; - $foreignData['foreign_display'] = ( - isset($foreign_display) ? $foreign_display : null - ); - $foreignData['disp_row'] = isset($disp_row) ? $disp_row : null; - $foreignData['foreign_field'] = isset($foreign_field) ? $foreign_field : null; - - return $foreignData; -} // end of 'PMA_getForeignData()' function - -/** - * Rename a field in relation tables - * - * usually called after a column in a table was renamed - * - * @param string $db database name - * @param string $table table name - * @param string $field old field name - * @param string $new_name new field name - * - * @return void - */ -function PMA_REL_renameField($db, $table, $field, $new_name) -{ - $cfgRelation = PMA_getRelationsParam(); - - if ($cfgRelation['displaywork']) { - $table_query = 'UPDATE ' - . PMA\libraries\Util::backquote($cfgRelation['db']) . '.' - . PMA\libraries\Util::backquote($cfgRelation['table_info']) - . ' SET display_field = \'' . $GLOBALS['dbi']->escapeString( - $new_name - ) . '\'' - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) - . '\'' - . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) - . '\'' - . ' AND display_field = \'' . $GLOBALS['dbi']->escapeString($field) - . '\''; - PMA_queryAsControlUser($table_query); - } - - if ($cfgRelation['relwork']) { - $table_query = 'UPDATE ' - . PMA\libraries\Util::backquote($cfgRelation['db']) . '.' - . PMA\libraries\Util::backquote($cfgRelation['relation']) - . ' SET master_field = \'' . $GLOBALS['dbi']->escapeString( - $new_name - ) . '\'' - . ' WHERE master_db = \'' . $GLOBALS['dbi']->escapeString($db) - . '\'' - . ' AND master_table = \'' . $GLOBALS['dbi']->escapeString($table) - . '\'' - . ' AND master_field = \'' . $GLOBALS['dbi']->escapeString($field) - . '\''; - PMA_queryAsControlUser($table_query); - - $table_query = 'UPDATE ' - . PMA\libraries\Util::backquote($cfgRelation['db']) . '.' - . PMA\libraries\Util::backquote($cfgRelation['relation']) - . ' SET foreign_field = \'' . $GLOBALS['dbi']->escapeString( - $new_name - ) . '\'' - . ' WHERE foreign_db = \'' . $GLOBALS['dbi']->escapeString($db) - . '\'' - . ' AND foreign_table = \'' . $GLOBALS['dbi']->escapeString($table) - . '\'' - . ' AND foreign_field = \'' . $GLOBALS['dbi']->escapeString($field) - . '\''; - PMA_queryAsControlUser($table_query); - - } // end if relwork -} - - -/** - * Performs SQL query used for renaming table. - * - * @param string $table Relation table to use - * @param string $source_db Source database name - * @param string $target_db Target database name - * @param string $source_table Source table name - * @param string $target_table Target table name - * @param string $db_field Name of database field - * @param string $table_field Name of table field - * - * @return void - */ -function PMA_REL_renameSingleTable($table, - $source_db, $target_db, - $source_table, $target_table, - $db_field, $table_field -) { - $query = 'UPDATE ' - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation'][$table]) - . ' SET ' - . $db_field . ' = \'' . $GLOBALS['dbi']->escapeString($target_db) - . '\', ' - . $table_field . ' = \'' . $GLOBALS['dbi']->escapeString($target_table) - . '\'' - . ' WHERE ' - . $db_field . ' = \'' . $GLOBALS['dbi']->escapeString($source_db) . '\'' - . ' AND ' - . $table_field . ' = \'' . $GLOBALS['dbi']->escapeString($source_table) - . '\''; - PMA_queryAsControlUser($query); -} - - -/** - * Rename a table in relation tables - * - * usually called after table has been moved - * - * @param string $source_db Source database name - * @param string $target_db Target database name - * @param string $source_table Source table name - * @param string $target_table Target table name - * - * @return void - */ -function PMA_REL_renameTable($source_db, $target_db, $source_table, $target_table) -{ - // Move old entries from PMA-DBs to new table - if ($GLOBALS['cfgRelation']['commwork']) { - PMA_REL_renameSingleTable( - 'column_info', - $source_db, $target_db, - $source_table, $target_table, - 'db_name', 'table_name' - ); - } - - // updating bookmarks is not possible since only a single table is - // moved, and not the whole DB. - - if ($GLOBALS['cfgRelation']['displaywork']) { - PMA_REL_renameSingleTable( - 'table_info', - $source_db, $target_db, - $source_table, $target_table, - 'db_name', 'table_name' - ); - } - - if ($GLOBALS['cfgRelation']['relwork']) { - PMA_REL_renameSingleTable( - 'relation', - $source_db, $target_db, - $source_table, $target_table, - 'foreign_db', 'foreign_table' - ); - - PMA_REL_renameSingleTable( - 'relation', - $source_db, $target_db, - $source_table, $target_table, - 'master_db', 'master_table' - ); - } - - if ($GLOBALS['cfgRelation']['pdfwork']) { - if ($source_db == $target_db) { - // rename within the database can be handled - PMA_REL_renameSingleTable( - 'table_coords', - $source_db, $target_db, - $source_table, $target_table, - 'db_name', 'table_name' - ); - } else { - // if the table is moved out of the database we can no loger keep the - // record for table coordinate - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['db']) . "." - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['table_coords']) - . " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($source_db) . "'" - . " AND table_name = '" . $GLOBALS['dbi']->escapeString($source_table) - . "'"; - PMA_queryAsControlUser($remove_query); - } - } - - if ($GLOBALS['cfgRelation']['uiprefswork']) { - PMA_REL_renameSingleTable( - 'table_uiprefs', - $source_db, $target_db, - $source_table, $target_table, - 'db_name', 'table_name' - ); - } - - if ($GLOBALS['cfgRelation']['navwork']) { - // update hidden items inside table - PMA_REL_renameSingleTable( - 'navigationhiding', - $source_db, $target_db, - $source_table, $target_table, - 'db_name', 'table_name' - ); - - // update data for hidden table - $query = "UPDATE " - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['db']) . "." - . PMA\libraries\Util::backquote( - $GLOBALS['cfgRelation']['navigationhiding'] - ) - . " SET db_name = '" . $GLOBALS['dbi']->escapeString($target_db) - . "'," - . " item_name = '" . $GLOBALS['dbi']->escapeString($target_table) - . "'" - . " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($source_db) - . "'" - . " AND item_name = '" . $GLOBALS['dbi']->escapeString($source_table) - . "'" - . " AND item_type = 'table'"; - PMA_queryAsControlUser($query); - } -} - -/** - * Create a PDF page - * - * @param string $newpage name of the new PDF page - * @param array $cfgRelation Relation configuration - * @param string $db database name - * - * @return int $pdf_page_number - */ -function PMA_REL_createPage($newpage, $cfgRelation, $db) -{ - if (! isset($newpage) || $newpage == '') { - $newpage = __('no description'); - } - $ins_query = 'INSERT INTO ' - . PMA\libraries\Util::backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA\libraries\Util::backquote($cfgRelation['pdf_pages']) - . ' (db_name, page_descr)' - . ' VALUES (\'' - . $GLOBALS['dbi']->escapeString($db) . '\', \'' - . $GLOBALS['dbi']->escapeString($newpage) . '\')'; - PMA_queryAsControlUser($ins_query, false); - - return $GLOBALS['dbi']->insertId( - isset($GLOBALS['controllink']) ? $GLOBALS['controllink'] : '' - ); -} - -/** - * Get child table references for a table column. - * This works only if 'DisableIS' is false. An empty array is returned otherwise. - * - * @param string $db name of master table db. - * @param string $table name of master table. - * @param string $column name of master table column. - * - * @return array $child_references - */ -function PMA_getChildReferences($db, $table, $column = '') -{ - $child_references = array(); - if (! $GLOBALS['cfg']['Server']['DisableIS']) { - $rel_query = "SELECT `column_name`, `table_name`," - . " `table_schema`, `referenced_column_name`" - . " FROM `information_schema`.`key_column_usage`" - . " WHERE `referenced_table_name` = '" - . $GLOBALS['dbi']->escapeString($table) . "'" - . " AND `referenced_table_schema` = '" - . $GLOBALS['dbi']->escapeString($db) . "'"; - if ($column) { - $rel_query .= " AND `referenced_column_name` = '" - . $GLOBALS['dbi']->escapeString($column) . "'"; - } - - $child_references = $GLOBALS['dbi']->fetchResult( - $rel_query, array('referenced_column_name', null) - ); - } - return $child_references; -} - -/** - * Check child table references and foreign key for a table column. - * - * @param string $db name of master table db. - * @param string $table name of master table. - * @param string $column name of master table column. - * @param array $foreigners_full foreiners array for the whole table. - * @param array $child_references_full child references for the whole table. - * - * @return array $column_status telling about references if foreign key. - */ -function PMA_checkChildForeignReferences( - $db, $table, $column, $foreigners_full = null, $child_references_full = null -) { - $column_status = array(); - $column_status['isEditable'] = false; - $column_status['isReferenced'] = false; - $column_status['isForeignKey'] = false; - $column_status['references'] = array(); - - $foreigners = array(); - if ($foreigners_full !== null) { - if (isset($foreigners_full[$column])) { - $foreigners[$column] = $foreigners_full[$column]; - } - if (isset($foreigners_full['foreign_keys_data'])) { - $foreigners['foreign_keys_data'] = $foreigners_full['foreign_keys_data']; - } - } else { - $foreigners = PMA_getForeigners($db, $table, $column, 'foreign'); - } - $foreigner = PMA_searchColumnInForeigners($foreigners, $column); - - $child_references = array(); - if ($child_references_full !== null) { - if (isset($child_references_full[$column])) { - $child_references = $child_references_full[$column]; - } - } else { - $child_references = PMA_getChildReferences($db, $table, $column); - } - - if (sizeof($child_references, 0) > 0 - || $foreigner - ) { - if (sizeof($child_references, 0) > 0) { - $column_status['isReferenced'] = true; - foreach ($child_references as $columns) { - array_push( - $column_status['references'], - PMA\libraries\Util::backquote($columns['table_schema']) - . '.' . PMA\libraries\Util::backquote($columns['table_name']) - ); - } - } - - if ($foreigner) { - $column_status['isForeignKey'] = true; - } - } else { - $column_status['isEditable'] = true; - } - - return $column_status; -} - -/** - * Search a table column in foreign data. - * - * @param array $foreigners Table Foreign data - * @param string $column Column name - * - * @return bool|array - */ -function PMA_searchColumnInForeigners($foreigners, $column) -{ - if (isset($foreigners[$column])) { - return $foreigners[$column]; - } else { - $foreigner = array(); - foreach ($foreigners['foreign_keys_data'] as $one_key) { - $column_index = array_search($column, $one_key['index_list']); - if ($column_index !== false) { - $foreigner['foreign_field'] - = $one_key['ref_index_list'][$column_index]; - $foreigner['foreign_db'] = isset($one_key['ref_db_name']) - ? $one_key['ref_db_name'] - : $GLOBALS['db']; - $foreigner['foreign_table'] = $one_key['ref_table_name']; - $foreigner['constraint'] = $one_key['constraint']; - $foreigner['on_update'] = isset($one_key['on_update']) - ? $one_key['on_update'] - : 'RESTRICT'; - $foreigner['on_delete'] = isset($one_key['on_delete']) - ? $one_key['on_delete'] - : 'RESTRICT'; - - return $foreigner; - } - } - } - - return false; -} - -/** - * Returns default PMA table names and their create queries. - * - * @return array table name, create query - */ -function PMA_getDefaultPMATableNames() -{ - $pma_tables = array(); - $create_tables_file = file_get_contents( - SQL_DIR . 'create_tables.sql' - ); - - $queries = explode(';', $create_tables_file); - - foreach ($queries as $query) { - if (preg_match( - '/CREATE TABLE IF NOT EXISTS `(.*)` \(/', - $query, - $table - ) - ) { - $pma_tables[$table[1]] = $query . ';'; - } - } - - return $pma_tables; -} - -/** - * Create a table named phpmyadmin to be used as configuration storage - * - * @return bool - */ -function PMA_createPMADatabase() -{ - $GLOBALS['dbi']->tryQuery("CREATE DATABASE IF NOT EXISTS `phpmyadmin`"); - if ($error = $GLOBALS['dbi']->getError()) { - if ($GLOBALS['errno'] == 1044) { - $GLOBALS['message'] = __( - 'You do not have necessary privileges to create a database named' - . ' \'phpmyadmin\'. You may go to \'Operations\' tab of any' - . ' database to set up the phpMyAdmin configuration storage there.' - ); - } else { - $GLOBALS['message'] = $error; - } - return false; - } - return true; -} - -/** - * Creates PMA tables in the given db, updates if already exists. - * - * @param string $db database - * @param boolean $create whether to create tables if they don't exist. - * - * @return void - */ -function PMA_fixPMATables($db, $create = true) -{ - $tablesToFeatures = array( - 'pma__bookmark' => 'bookmarktable', - 'pma__relation' => 'relation', - 'pma__table_info' => 'table_info', - 'pma__table_coords' => 'table_coords', - 'pma__pdf_pages' => 'pdf_pages', - 'pma__column_info' => 'column_info', - 'pma__history' => 'history', - 'pma__recent' => 'recent', - 'pma__favorite' => 'favorite', - 'pma__table_uiprefs' => 'table_uiprefs', - 'pma__tracking' => 'tracking', - 'pma__userconfig' => 'userconfig', - 'pma__users' => 'users', - 'pma__usergroups' => 'usergroups', - 'pma__navigationhiding' => 'navigationhiding', - 'pma__savedsearches' => 'savedsearches', - 'pma__central_columns' => 'central_columns', - 'pma__designer_settings' => 'designer_settings', - 'pma__export_templates' => 'export_templates', - ); - - $existingTables = $GLOBALS['dbi']->getTables($db, $GLOBALS['controllink']); - - $createQueries = null; - $foundOne = false; - foreach ($tablesToFeatures as $table => $feature) { - if (! in_array($table, $existingTables)) { - if ($create) { - if ($createQueries == null) { // first create - $createQueries = PMA_getDefaultPMATableNames(); - $GLOBALS['dbi']->selectDb($db); - } - $GLOBALS['dbi']->tryQuery($createQueries[$table]); - if ($error = $GLOBALS['dbi']->getError()) { - $GLOBALS['message'] = $error; - return; - } - $foundOne = true; - $GLOBALS['cfg']['Server'][$feature] = $table; - } - } else { - $foundOne = true; - $GLOBALS['cfg']['Server'][$feature] = $table; - } - } - - if (! $foundOne) { - return; - } - $GLOBALS['cfg']['Server']['pmadb'] = $db; - $_SESSION['relation'][$GLOBALS['server']] = PMA_checkRelationsParam(); - - $cfgRelation = PMA_getRelationsParam(); - if ($cfgRelation['recentwork'] || $cfgRelation['favoritework']) { - // Since configuration storage is updated, we need to - // re-initialize the favorite and recent tables stored in the - // session from the current configuration storage. - if ($cfgRelation['favoritework']) { - $fav_tables = RecentFavoriteTable::getInstance('favorite'); - $_SESSION['tmpval']['favorite_tables'][$GLOBALS['server']] - = $fav_tables->getFromDb(); - } - - if ($cfgRelation['recentwork']) { - $recent_tables = RecentFavoriteTable::getInstance('recent'); - $_SESSION['tmpval']['recent_tables'][$GLOBALS['server']] - = $recent_tables->getFromDb(); - } - - // Reload navi panel to update the recent/favorite lists. - $GLOBALS['reload'] = true; - } -} - -/** - * Get Html for PMA tables fixing anchor. - * - * @param boolean $allTables whether to create all tables - * @param boolean $createDb whether to create the pmadb also - * - * @return string Html - */ -function PMA_getHtmlFixPMATables($allTables, $createDb = false) -{ - $retval = ''; - - $url_query = PMA_URL_getCommon(array('db' => $GLOBALS['db'])); - if ($allTables) { - if ($createDb) { - $url_query .= '&goto=db_operations.php&create_pmadb=1'; - $message = Message::notice( - __( - '%sCreate%s a database named \'phpmyadmin\' and setup ' - . 'the phpMyAdmin configuration storage there.' - ) - ); - } else { - $url_query .= '&goto=db_operations.php&fixall_pmadb=1'; - $message = Message::notice( - __( - '%sCreate%s the phpMyAdmin configuration storage in the ' - . 'current database.' - ) - ); - } - } else { - $url_query .= '&goto=db_operations.php&fix_pmadb=1'; - $message = Message::notice( - __('%sCreate%s missing phpMyAdmin configuration storage tables.') - ); - } - $message->addParam( - '', - false - ); - $message->addParam('', false); - - $retval .= $message->getDisplay(); - - return $retval; -} - -/** - * Gets the relations info and status, depending on the condition - * - * @param boolean $condition whether to look for foreigners or not - * @param string $db database name - * @param string $table table name - * - * @return array ($res_rel, $have_rel) - */ -function PMA_getRelationsAndStatus($condition, $db, $table) -{ - if ($condition) { - // Find which tables are related with the current one and write it in - // an array - $res_rel = PMA_getForeigners($db, $table); - - if (count($res_rel) > 0) { - $have_rel = true; - } else { - $have_rel = false; - } - } else { - $have_rel = false; - $res_rel = array(); - } // end if - return(array($res_rel, $have_rel)); -} - -/** - * Verifies if all the pmadb tables are defined - * - * @return boolean - */ -function PMA_arePmadbTablesDefined() -{ - if (empty($GLOBALS['cfg']['Server']['bookmarktable']) - || empty($GLOBALS['cfg']['Server']['relation']) - || empty($GLOBALS['cfg']['Server']['table_info']) - || empty($GLOBALS['cfg']['Server']['table_coords']) - || empty($GLOBALS['cfg']['Server']['column_info']) - || empty($GLOBALS['cfg']['Server']['pdf_pages']) - || empty($GLOBALS['cfg']['Server']['history']) - || empty($GLOBALS['cfg']['Server']['recent']) - || empty($GLOBALS['cfg']['Server']['favorite']) - || empty($GLOBALS['cfg']['Server']['table_uiprefs']) - || empty($GLOBALS['cfg']['Server']['tracking']) - || empty($GLOBALS['cfg']['Server']['userconfig']) - || empty($GLOBALS['cfg']['Server']['users']) - || empty($GLOBALS['cfg']['Server']['usergroups']) - || empty($GLOBALS['cfg']['Server']['navigationhiding']) - || empty($GLOBALS['cfg']['Server']['savedsearches']) - || empty($GLOBALS['cfg']['Server']['central_columns']) - || empty($GLOBALS['cfg']['Server']['designer_settings']) - || empty($GLOBALS['cfg']['Server']['export_templates']) - ) { - return false; - } else { - return true; - } -} diff --git a/#pma/libraries/relation_cleanup.lib.php b/#pma/libraries/relation_cleanup.lib.php deleted file mode 100644 index ac4a94cd..00000000 --- a/#pma/libraries/relation_cleanup.lib.php +++ /dev/null @@ -1,356 +0,0 @@ -escapeString($db) . '\'' - . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) - . '\'' - . ' AND column_name = \'' . $GLOBALS['dbi']->escapeString($column) - . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['displaywork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['table_info']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' - . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) - . '\'' - . ' AND display_field = \'' . $GLOBALS['dbi']->escapeString($column) - . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['relwork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['relation']) - . ' WHERE master_db = \'' . $GLOBALS['dbi']->escapeString($db) - . '\'' - . ' AND master_table = \'' . $GLOBALS['dbi']->escapeString($table) - . '\'' - . ' AND master_field = \'' . $GLOBALS['dbi']->escapeString($column) - . '\''; - PMA_queryAsControlUser($remove_query); - - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['relation']) - . ' WHERE foreign_db = \'' . $GLOBALS['dbi']->escapeString($db) - . '\'' - . ' AND foreign_table = \'' . $GLOBALS['dbi']->escapeString($table) - . '\'' - . ' AND foreign_field = \'' . $GLOBALS['dbi']->escapeString($column) - . '\''; - PMA_queryAsControlUser($remove_query); - } -} - -/** - * Cleanup table related relation stuff - * - * @param string $db database name - * @param string $table table name - * - * @return void - */ -function PMA_relationsCleanupTable($db, $table) -{ - $cfgRelation = PMA_getRelationsParam(); - - if ($cfgRelation['commwork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['column_info']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' - . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) - . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['displaywork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['table_info']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' - . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) - . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['pdfwork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['table_coords']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' - . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) - . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['relwork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['relation']) - . ' WHERE master_db = \'' . $GLOBALS['dbi']->escapeString($db) - . '\'' - . ' AND master_table = \'' . $GLOBALS['dbi']->escapeString($table) - . '\''; - PMA_queryAsControlUser($remove_query); - - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['relation']) - . ' WHERE foreign_db = \'' . $GLOBALS['dbi']->escapeString($db) - . '\'' - . ' AND foreign_table = \'' . $GLOBALS['dbi']->escapeString($table) - . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['uiprefswork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['table_uiprefs']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' - . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) - . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['navwork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['navigationhiding']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' - . ' AND (table_name = \'' . $GLOBALS['dbi']->escapeString($table) - . '\'' - . ' OR (item_name = \'' . $GLOBALS['dbi']->escapeString($table) - . '\'' - . ' AND item_type = \'table\'))'; - PMA_queryAsControlUser($remove_query); - } -} - -/** - * Cleanup database related relation stuff - * - * @param string $db database name - * - * @return void - */ -function PMA_relationsCleanupDatabase($db) -{ - $cfgRelation = PMA_getRelationsParam(); - - if ($cfgRelation['commwork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['column_info']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['bookmarkwork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['bookmark']) - . ' WHERE dbase = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['displaywork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['table_info']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['pdfwork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['pdf_pages']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; - PMA_queryAsControlUser($remove_query); - - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['table_coords']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['relwork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['relation']) - . ' WHERE master_db = \'' - . $GLOBALS['dbi']->escapeString($db) . '\''; - PMA_queryAsControlUser($remove_query); - - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['relation']) - . ' WHERE foreign_db = \'' . $GLOBALS['dbi']->escapeString($db) - . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['uiprefswork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['table_uiprefs']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['navwork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['navigationhiding']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['savedsearcheswork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['savedsearches']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['centralcolumnswork']) { - $remove_query = 'DELETE FROM ' - . PMA\libraries\Util::backquote($cfgRelation['db']) - . '.' . PMA\libraries\Util::backquote($cfgRelation['central_columns']) - . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; - PMA_queryAsControlUser($remove_query); - } -} - -/** - * Cleanup user related relation stuff - * - * @param string $username username - * - * @return void - */ -function PMA_relationsCleanupUser($username) -{ - $cfgRelation = PMA_getRelationsParam(); - - if ($cfgRelation['bookmarkwork']) { - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['bookmark']) - . " WHERE `user` = '" . $GLOBALS['dbi']->escapeString($username) - . "'"; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['historywork']) { - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['history']) - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) - . "'"; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['recentwork']) { - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['recent']) - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) - . "'"; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['favoritework']) { - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['favorite']) - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) - . "'"; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['uiprefswork']) { - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['table_uiprefs']) - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) - . "'"; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['userconfigwork']) { - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['userconfig']) - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) - . "'"; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['menuswork']) { - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['users']) - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) - . "'"; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['navwork']) { - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['navigationhiding']) - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) - . "'"; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['savedsearcheswork']) { - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['savedsearches']) - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) - . "'"; - PMA_queryAsControlUser($remove_query); - } - - if ($cfgRelation['designersettingswork']) { - $remove_query = "DELETE FROM " - . PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['designer_settings']) - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) - . "'"; - PMA_queryAsControlUser($remove_query); - } -} - diff --git a/#pma/libraries/replication.inc.php b/#pma/libraries/replication.inc.php deleted file mode 100644 index f10bbfaf..00000000 --- a/#pma/libraries/replication.inc.php +++ /dev/null @@ -1,322 +0,0 @@ -fetchResult('SHOW MASTER STATUS'); - -/** - * set selected master server - */ -if (! empty($_REQUEST['master_connection'])) { - /** - * check for multi-master replication functionality - */ - $server_slave_multi_replication = $GLOBALS['dbi']->fetchResult( - 'SHOW ALL SLAVES STATUS' - ); - if ($server_slave_multi_replication) { - $GLOBALS['dbi']->query( - "SET @@default_master_connection = '" - . $GLOBALS['dbi']->escapeString( - $_REQUEST['master_connection'] - ) . "'" - ); - $GLOBALS['url_params']['master_connection'] = $_REQUEST['master_connection']; - } -} - -/** - * get slave replication from server - */ -$server_slave_replication = $GLOBALS['dbi']->fetchResult('SHOW SLAVE STATUS'); - -/** - * replication types - */ -$replication_types = array('master', 'slave'); - - -/** - * define variables for master status - */ -$master_variables = array( - 'File', - 'Position', - 'Binlog_Do_DB', - 'Binlog_Ignore_DB', -); - -/** - * Define variables for slave status - */ -$slave_variables = array( - 'Slave_IO_State', - 'Master_Host', - 'Master_User', - 'Master_Port', - 'Connect_Retry', - 'Master_Log_File', - 'Read_Master_Log_Pos', - 'Relay_Log_File', - 'Relay_Log_Pos', - 'Relay_Master_Log_File', - 'Slave_IO_Running', - 'Slave_SQL_Running', - 'Replicate_Do_DB', - 'Replicate_Ignore_DB', - 'Replicate_Do_Table', - 'Replicate_Ignore_Table', - 'Replicate_Wild_Do_Table', - 'Replicate_Wild_Ignore_Table', - 'Last_Errno', - 'Last_Error', - 'Skip_Counter', - 'Exec_Master_Log_Pos', - 'Relay_Log_Space', - 'Until_Condition', - 'Until_Log_File', - 'Until_Log_Pos', - 'Master_SSL_Allowed', - 'Master_SSL_CA_File', - 'Master_SSL_CA_Path', - 'Master_SSL_Cert', - 'Master_SSL_Cipher', - 'Master_SSL_Key', - 'Seconds_Behind_Master', -); -/** - * define important variables, which need to be watched for - * correct running of replication in slave mode - * - * @usedby PMA_getHtmlForReplicationStatusTable() - */ -// TODO change to regexp or something, to allow for negative match. -// To e.g. highlight 'Last_Error' -// -$slave_variables_alerts = array( - 'Slave_IO_Running' => 'No', - 'Slave_SQL_Running' => 'No', -); -$slave_variables_oks = array( - 'Slave_IO_Running' => 'Yes', - 'Slave_SQL_Running' => 'Yes', -); - -// check which replication is available and -// set $server_{master/slave}_status and assign values - -// replication info is more easily passed to functions -$GLOBALS['replication_info'] = array(); - -foreach ($replication_types as $type) { - if (count(${"server_{$type}_replication"}) > 0) { - $GLOBALS['replication_info'][$type]['status'] = true; - } else { - $GLOBALS['replication_info'][$type]['status'] = false; - } - if ($GLOBALS['replication_info'][$type]['status']) { - if ($type == "master") { - PMA_fillReplicationInfo( - $type, 'Do_DB', $server_master_replication[0], - 'Binlog_Do_DB' - ); - - PMA_fillReplicationInfo( - $type, 'Ignore_DB', $server_master_replication[0], - 'Binlog_Ignore_DB' - ); - } elseif ($type == "slave") { - PMA_fillReplicationInfo( - $type, 'Do_DB', $server_slave_replication[0], - 'Replicate_Do_DB' - ); - - PMA_fillReplicationInfo( - $type, 'Ignore_DB', $server_slave_replication[0], - 'Replicate_Ignore_DB' - ); - - PMA_fillReplicationInfo( - $type, 'Do_Table', $server_slave_replication[0], - 'Replicate_Do_Table' - ); - - PMA_fillReplicationInfo( - $type, 'Ignore_Table', $server_slave_replication[0], - 'Replicate_Ignore_Table' - ); - - PMA_fillReplicationInfo( - $type, 'Wild_Do_Table', $server_slave_replication[0], - 'Replicate_Wild_Do_Table' - ); - - PMA_fillReplicationInfo( - $type, 'Wild_Ignore_Table', $server_slave_replication[0], - 'Replicate_Wild_Ignore_Table' - ); - } - } -} - -/** - * Fill global replication_info variable. - * - * @param string $type Type: master, slave - * @param string $replicationInfoKey Key in replication_info variable - * @param array $mysqlInfo MySQL data about replication - * @param string $mysqlKey MySQL key - * - * @return array - */ -function PMA_fillReplicationInfo( - $type, $replicationInfoKey, $mysqlInfo, $mysqlKey -) { - $GLOBALS['replication_info'][$type][$replicationInfoKey] - = empty($mysqlInfo[$mysqlKey]) - ? array() - : explode( - ",", - $mysqlInfo[$mysqlKey] - ); - - return $GLOBALS['replication_info'][$type][$replicationInfoKey]; -} - -/** - * Extracts database or table name from string - * - * @param string $string contains "dbname.tablename" - * @param string $what what to extract (db|table) - * - * @return string the extracted part - */ -function PMA_extractDbOrTable($string, $what = 'db') -{ - $list = explode(".", $string); - if ('db' == $what) { - return $list[0]; - } else { - return $list[1]; - } -} - -/** - * Configures replication slave - * - * @param string $action possible values: START or STOP - * @param string $control default: null, - * possible values: SQL_THREAD or IO_THREAD or null. - * If it is set to null, it controls both - * SQL_THREAD and IO_THREAD - * @param mixed $link mysql link - * - * @return mixed output of DatabaseInterface::tryQuery - */ -function PMA_Replication_Slave_control($action, $control = null, $link = null) -{ - $action = mb_strtoupper($action); - $control = mb_strtoupper($control); - - if ($action != "START" && $action != "STOP") { - return -1; - } - if ($control != "SQL_THREAD" && $control != "IO_THREAD" && $control != null) { - return -1; - } - - return $GLOBALS['dbi']->tryQuery($action . " SLAVE " . $control . ";", $link); -} - -/** - * Changes master for replication slave - * - * @param string $user replication user on master - * @param string $password password for the user - * @param string $host master's hostname or IP - * @param int $port port, where mysql is running - * @param array $pos position of mysql replication, - * array should contain fields File and Position - * @param bool $stop shall we stop slave? - * @param bool $start shall we start slave? - * @param mixed $link mysql link - * - * @return string output of CHANGE MASTER mysql command - */ -function PMA_Replication_Slave_changeMaster($user, $password, $host, $port, - $pos, $stop = true, $start = true, $link = null -) { - if ($stop) { - PMA_Replication_Slave_control("STOP", null, $link); - } - - $out = $GLOBALS['dbi']->tryQuery( - 'CHANGE MASTER TO ' . - 'MASTER_HOST=\'' . $host . '\',' . - 'MASTER_PORT=' . ($port * 1) . ',' . - 'MASTER_USER=\'' . $user . '\',' . - 'MASTER_PASSWORD=\'' . $password . '\',' . - 'MASTER_LOG_FILE=\'' . $pos["File"] . '\',' . - 'MASTER_LOG_POS=' . $pos["Position"] . ';', $link - ); - - if ($start) { - PMA_Replication_Slave_control("START", null, $link); - } - - return $out; -} - -/** - * This function provides connection to remote mysql server - * - * @param string $user mysql username - * @param string $password password for the user - * @param string $host mysql server's hostname or IP - * @param int $port mysql remote port - * @param string $socket path to unix socket - * - * @return mixed $link mysql link on success - */ -function PMA_Replication_connectToMaster( - $user, $password, $host = null, $port = null, $socket = null -) { - $server = array(); - $server["host"] = PMA_sanitizeMySQLHost($host); - $server["port"] = $port; - $server["socket"] = $socket; - - // 5th parameter set to true means that it's an auxiliary connection - // and we must not go back to login page if it fails - return $GLOBALS['dbi']->connect($user, $password, false, $server, true); -} -/** - * Fetches position and file of current binary log on master - * - * @param mixed $link mysql link - * - * @return array an array containing File and Position in MySQL replication - * on master server, useful for PMA_Replication_Slave_changeMaster - */ -function PMA_Replication_Slave_binLogMaster($link = null) -{ - $data = $GLOBALS['dbi']->fetchResult('SHOW MASTER STATUS', null, null, $link); - $output = array(); - - if (! empty($data)) { - $output["File"] = $data[0]["File"]; - $output["Position"] = $data[0]["Position"]; - } - return $output; -} diff --git a/#pma/libraries/replication_gui.lib.php b/#pma/libraries/replication_gui.lib.php deleted file mode 100644 index 82620916..00000000 --- a/#pma/libraries/replication_gui.lib.php +++ /dev/null @@ -1,1081 +0,0 @@ -getDisplay(); - $_SESSION['replication']['sr_action_status'] = 'unknown'; - } elseif ($_SESSION['replication']['sr_action_status'] == 'success') { - $success_message = $_SESSION['replication']['sr_action_info']; - $html .= Message::success($success_message)->getDisplay(); - $_SESSION['replication']['sr_action_status'] = 'unknown'; - } - } - return $html; -} - -/** - * returns HTML for master replication - * - * @return String HTML code - */ -function PMA_getHtmlForMasterReplication() -{ - $html = ''; - if (! isset($_REQUEST['repl_clear_scr'])) { - $html .= '
    '; - $html .= '' . __('Master replication') . ''; - $html .= __('This server is configured as master in a replication process.'); - $html .= '
      '; - $html .= '
    • '; - $html .= __('Show master status') . ''; - $html .= PMA_getHtmlForReplicationStatusTable('master', true, false); - $html .= '
    • '; - - $html .= '
    • '; - $html .= __('Show connected slaves') . ''; - $html .= PMA_getHtmlForReplicationSlavesTable(true); - $html .= '
    • '; - - $_url_params = $GLOBALS['url_params']; - $_url_params['mr_adduser'] = true; - $_url_params['repl_clear_scr'] = true; - - $html .= '
    • '; - $html .= __('Add slave replication user') . '
    • '; - } - - // Display 'Add replication slave user' form - if (isset($_REQUEST['mr_adduser'])) { - $html .= PMA_getHtmlForReplicationMasterAddSlaveuser(); - } elseif (! isset($_REQUEST['repl_clear_scr'])) { - $html .= "
    "; - $html .= "
    "; - } - - return $html; -} - -/** - * returns HTML for master replication configuration - * - * @return String HTML code - */ -function PMA_getHtmlForMasterConfiguration() -{ - $html = '
    '; - $html .= '' . __('Master configuration') . ''; - $html .= __( - 'This server is not configured as a master server in a ' - . 'replication process. You can choose from either replicating ' - . 'all databases and ignoring some of them (useful if you want to ' - . 'replicate a majority of the databases) or you can choose to ignore ' - . 'all databases by default and allow only certain databases to be ' - . 'replicated. Please select the mode:' - ) . '

    '; - - $html .= ''; - $html .= '

    '; - $html .= __('Please select databases:') . '
    '; - $html .= PMA_getHtmlForReplicationDbMultibox(); - $html .= '

    '; - $html .= __( - 'Now, add the following lines at the end of [mysqld] section' - . ' in your my.cnf and please restart the MySQL server afterwards.' - ) . '
    '; - $html .= '
    ';
    -    $html .= __(
    -        'Once you restarted MySQL server, please click on Go button. '
    -        . 'Afterwards, you should see a message informing you, that this server'
    -        . ' is configured as master.'
    -    );
    -    $html .= '
    '; - $html .= '
    '; - $html .= '
    '; - $html .= PMA_URL_getHiddenInputs('', ''); - $html .= ' '; - $html .= '
    '; - $html .= '
    '; - - return $html; -} - -/** - * returns HTML for slave replication configuration - * - * @param bool $server_slave_status Whether it is Master or Slave - * @param array $server_slave_replication Slave replication - * - * @return String HTML code - */ -function PMA_getHtmlForSlaveConfiguration( - $server_slave_status, $server_slave_replication -) { - $html = '
    '; - $html .= '' . __('Slave replication') . ''; - /** - * check for multi-master replication functionality - */ - $server_slave_multi_replication = $GLOBALS['dbi']->fetchResult( - 'SHOW ALL SLAVES STATUS' - ); - if ($server_slave_multi_replication) { - $html .= __('Master connection:'); - $html .= '
    '; - $html .= PMA_URL_getHiddenInputs($GLOBALS['url_params']); - $html .= ' '; - $html .= ' '; - $html .= '
    '; - $html .= '

    '; - } - if ($server_slave_status) { - $html .= '
    '; - - $_url_params = $GLOBALS['url_params']; - $_url_params['sr_take_action'] = true; - $_url_params['sr_slave_server_control'] = true; - - if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') { - $_url_params['sr_slave_action'] = 'start'; - } else { - $_url_params['sr_slave_action'] = 'stop'; - } - - $_url_params['sr_slave_control_parm'] = 'IO_THREAD'; - $slave_control_io_link = 'server_replication.php' - . PMA_URL_getCommon($_url_params); - - if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') { - $_url_params['sr_slave_action'] = 'start'; - } else { - $_url_params['sr_slave_action'] = 'stop'; - } - - $_url_params['sr_slave_control_parm'] = 'SQL_THREAD'; - $slave_control_sql_link = 'server_replication.php' - . PMA_URL_getCommon($_url_params); - - if ($server_slave_replication[0]['Slave_IO_Running'] == 'No' - || $server_slave_replication[0]['Slave_SQL_Running'] == 'No' - ) { - $_url_params['sr_slave_action'] = 'start'; - } else { - $_url_params['sr_slave_action'] = 'stop'; - } - - $_url_params['sr_slave_control_parm'] = null; - $slave_control_full_link = 'server_replication.php' - . PMA_URL_getCommon($_url_params); - - $_url_params['sr_slave_action'] = 'reset'; - $slave_control_reset_link = 'server_replication.php' - . PMA_URL_getCommon($_url_params); - - $_url_params = $GLOBALS['url_params']; - $_url_params['sr_take_action'] = true; - $_url_params['sr_slave_skip_error'] = true; - $slave_skip_error_link = 'server_replication.php' - . PMA_URL_getCommon($_url_params); - - if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') { - $html .= Message::error( - __('Slave SQL Thread not running!') - )->getDisplay(); - } - if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') { - $html .= Message::error( - __('Slave IO Thread not running!') - )->getDisplay(); - } - - $_url_params = $GLOBALS['url_params']; - $_url_params['sl_configure'] = true; - $_url_params['repl_clear_scr'] = true; - - $reconfiguremaster_link = 'server_replication.php' - . PMA_URL_getCommon($_url_params); - - $html .= __( - 'Server is configured as slave in a replication process. Would you ' . - 'like to:' - ); - $html .= '
    '; - $html .= ''; - $html .= '
    '; - - } elseif (! isset($_REQUEST['sl_configure'])) { - $_url_params = $GLOBALS['url_params']; - $_url_params['sl_configure'] = true; - $_url_params['repl_clear_scr'] = true; - - $html .= sprintf( - __( - 'This server is not configured as slave in a replication process. ' - . 'Would you like to configure it?' - ), - 'server_replication.php' . PMA_URL_getCommon($_url_params) - ); - } - $html .= '
    '; - - return $html; -} - -/** - * returns HTML for Slave Error Management - * - * @param String $slave_skip_error_link error link - * - * @return String HTML code - */ -function PMA_getHtmlForSlaveErrorManagement($slave_skip_error_link) -{ - $html = ''; - $html .= __('Error management:') . ''; - $html .= ' '; - return $html; -} - -/** - * returns HTML for not configure for a server replication - * - * @return String HTML code - */ -function PMA_getHtmlForNotServerReplication() -{ - $_url_params = $GLOBALS['url_params']; - $_url_params['mr_configure'] = true; - - $html = '
    '; - $html .= '' . __('Master replication') . ''; - $html .= sprintf( - __( - 'This server is not configured as master in a replication process. ' - . 'Would you like to configure it?' - ), - 'server_replication.php' . PMA_URL_getCommon($_url_params) - ); - $html .= '
    '; - return $html; -} - -/** - * returns HTML code for selecting databases - * - * @return String HTML code - */ -function PMA_getHtmlForReplicationDbMultibox() -{ - $multi_values = ''; - $multi_values .= '
    '; - $multi_values .= '' . __('Select all') . ''; - $multi_values .= ' / '; - $multi_values .= '' . __('Unselect all') . ''; - - return $multi_values; -} - -/** - * returns HTML for changing master - * - * @param String $submitname - submit button name - * - * @return String HTML code - */ -function PMA_getHtmlForReplicationChangeMaster($submitname) -{ - $html = ''; - list($username_length, $hostname_length) - = PMA_replicationGetUsernameHostnameLength(); - - $html .= '
    '; - $html .= PMA_URL_getHiddenInputs('', ''); - $html .= '
    '; - $html .= ' ' . __('Slave configuration'); - $html .= ' - ' . __('Change or reconfigure master server') . ''; - $html .= __( - 'Make sure, you have unique server-id in your configuration file (my.cnf). ' - . 'If not, please add the following line into [mysqld] section:' - ); - $html .= '
    '; - $html .= '
    server-id=' . time() . '
    '; - - $html .= PMA_getHtmlForAddUserInputDiv( - array('text'=>__('User name:'), 'for'=>"text_username"), - array( - 'type'=>'text', - 'name'=>'username', - 'id'=>'text_username', - 'maxlength'=>$username_length, - 'title'=>__('User name'), - 'required'=>'required' - ) - ); - - $html .= PMA_getHtmlForAddUserInputDiv( - array('text'=>__('Password:'), 'for'=>"text_pma_pw"), - array( - 'type'=>'password', - 'name'=>'pma_pw', - 'id'=>'text_pma_pw', - 'title'=>__('Password'), - 'required'=>'required' - ) - ); - - $html .= PMA_getHtmlForAddUserInputDiv( - array('text'=>__('Host:'), 'for'=>"text_hostname"), - array( - 'type'=>'text', - 'name'=>'hostname', - 'id'=>'text_hostname', - 'maxlength'=>$hostname_length, - 'value'=>'', - 'required'=>'required' - ) - ); - - $html .= PMA_getHtmlForAddUserInputDiv( - array('text'=>__('Port:'), 'for'=>"text_port"), - array( - 'type'=>'number', - 'name'=>'text_port', - 'id'=>'text_port', - 'maxlength'=>6, - 'value'=>'3306', - 'required'=>'required' - ) - ); - - $html .= '
    '; - $html .= ' '; - $html .= '
    '; - - return $html; -} - -/** - * returns HTML code for Add user input div - * - * @param array $label_array label tag elements - * @param array $input_array input tag elements - * - * @return String HTML code - */ -function PMA_getHtmlForAddUserInputDiv($label_array, $input_array) -{ - $html = '
    '; - $html .= ' '; - - $html .= ' $value) { - $html .= ' ' . $key . '="' . $value . '" '; - } - $html .= ' />'; - $html .= '
    '; - return $html; -} - -/** - * This function returns html code for table with replication status. - * - * @param string $type either master or slave - * @param boolean $hidden if true, then default style is set to hidden, - * default value false - * @param boolean $title if true, then title is displayed, default true - * - * @return String HTML code - */ -function PMA_getHtmlForReplicationStatusTable($type, $hidden = false, $title = true) -{ - global ${"{$type}_variables"}; - global ${"{$type}_variables_alerts"}; - global ${"{$type}_variables_oks"}; - global ${"server_{$type}_replication"}; - global ${"strReplicationStatus_{$type}"}; - - $html = ''; - - // TODO check the Masters server id? - // seems to default to '1' when queried via SHOW VARIABLES , - // but resulted in error on the master when slave connects - // [ERROR] Error reading packet from server: Misconfigured master - // - server id was not set ( server_errno=1236) - // [ERROR] Got fatal error 1236: 'Misconfigured master - // - server id was not set' from master when reading data from binary log - // - //$server_id = $GLOBALS['dbi']->fetchValue( - // "SHOW VARIABLES LIKE 'server_id'", 0, 1 - //); - - $html .= '
    '; - - if ($title) { - if ($type == 'master') { - $html .= '

    '; - $html .= __('Master status') . '

    '; - } else { - $html .= '

    '; - $html .= __('Slave status') . '

    '; - } - } else { - $html .= '
    '; - } - - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - - $odd_row = true; - foreach (${"{$type}_variables"} as $variable) { - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - - $odd_row = ! $odd_row; - } - - $html .= ' '; - $html .= '
    ' . __('Variable') . '' . __('Value') . '
    '; - $html .= htmlspecialchars($variable); - $html .= ' '; - - // TODO change to regexp or something, to allow for negative match - if (isset(${"{$type}_variables_alerts"}[$variable]) - && ${"{$type}_variables_alerts"}[$variable] == ${"server_{$type}_replication"}[0][$variable] - ) { - $html .= ''; - - } elseif (isset(${"{$type}_variables_oks"}[$variable]) - && ${"{$type}_variables_oks"}[$variable] == ${"server_{$type}_replication"}[0][$variable] - ) { - $html .= ''; - } else { - $html .= ''; - } - // allow wrapping long table lists into multiple lines - static $variables_wrap = array( - 'Replicate_Do_DB', 'Replicate_Ignore_DB', - 'Replicate_Do_Table', 'Replicate_Ignore_Table', - 'Replicate_Wild_Do_Table', 'Replicate_Wild_Ignore_Table'); - if (in_array($variable, $variables_wrap)) { - $html .= htmlspecialchars(str_replace( - ',', - ', ', - ${"server_{$type}_replication"}[0][$variable] - )); - } else { - $html .= htmlspecialchars(${"server_{$type}_replication"}[0][$variable]); - } - $html .= ''; - - $html .= '
    '; - $html .= '
    '; - $html .= '
    '; - - return $html; -} - -/** - * returns html code for table with slave users connected to this master - * - * @param boolean $hidden - if true, then default style is set to hidden, - * - default value false - * - * @return string - */ -function PMA_getHtmlForReplicationSlavesTable($hidden = false) -{ - $html = ''; - // Fetch data - $data = $GLOBALS['dbi']->fetchResult('SHOW SLAVE HOSTS', null, null); - - $html .= '
    '; - $html .= '
    '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - - $odd_row = true; - foreach ($data as $slave) { - $html .= ' '; - $html .= ' '; - $html .= ' '; - $html .= ' '; - - $odd_row = ! $odd_row; - } - - $html .= ' '; - $html .= '
    ' . __('Server ID') . '' . __('Host') . '
    ' . $slave['Server_id'] . '' . $slave['Host'] . '
    '; - $html .= '
    '; - $html .= Message::notice( - __( - 'Only slaves started with the ' - . '--report-host=host_name option are visible in this list.' - ) - )->getDisplay(); - $html .= '
    '; - $html .= '
    '; - - return $html; -} - -/** - * get the correct username and hostname lengths for this MySQL server - * - * @return array username length, hostname length - */ -function PMA_replicationGetUsernameHostnameLength() -{ - $fields_info = $GLOBALS['dbi']->getColumns('mysql', 'user'); - $username_length = 16; - $hostname_length = 41; - foreach ($fields_info as $val) { - if ($val['Field'] == 'User') { - strtok($val['Type'], '()'); - $v = strtok('()'); - if (is_int($v)) { - $username_length = $v; - } - } elseif ($val['Field'] == 'Host') { - strtok($val['Type'], '()'); - $v = strtok('()'); - if (is_int($v)) { - $hostname_length = $v; - } - } - } - return array($username_length, $hostname_length); -} - -/** - * returns html code to add a replication slave user to the master - * - * @return String HTML code - */ -function PMA_getHtmlForReplicationMasterAddSlaveuser() -{ - $html = ''; - list($username_length, $hostname_length) - = PMA_replicationGetUsernameHostnameLength(); - - if (isset($_REQUEST['username']) - && mb_strlen($_REQUEST['username']) === 0 - ) { - $GLOBALS['pred_username'] = 'any'; - } - $html .= '
    '; - $html .= '
    ' . __('Add slave replication user') . '' - . PMA_getHtmlForAddUserLoginForm($username_length) - . '
    ' - . '' - . '' - . ' ' - . '' - . '' - . ' ' - . '' - . '
    ' - . '' - . '' - . ' ' - . '' - . '' - . '
    '; - - return $html; -} - -/** - * returns HTML for TableInfoForm - * - * @param int $hostname_length Selected hostname length - * - * @return String HTML code - */ -function PMA_getHtmlForTableInfoForm($hostname_length) -{ - $html = ' ' - . ' ' - . ' ' - . '
    ' - . '' - . PMA\libraries\Util::showHint( - __( - 'When Host table is used, this field is ignored ' - . 'and values stored in Host table are used instead.' - ) - ) - . '
    ' - . '
    ' - . '' - . '' - . ' ' - . '' - . '' - . '
    ' - . '
    ' - . '' - . ' ' - . '' - . '
    ' - . '
    ' - . '' - . '' - . ' ' - . '' - . '' - . '
    ' - . ''; - $html .= ''; - return $html; -} - -/** - * handle control requests - * - * @return NULL - */ -function PMA_handleControlRequest() -{ - if (isset($_REQUEST['sr_take_action'])) { - $refresh = false; - $result = false; - $messageSuccess = null; - $messageError = null; - - if (isset($_REQUEST['slave_changemaster'])) { - $result = PMA_handleRequestForSlaveChangeMaster(); - } elseif (isset($_REQUEST['sr_slave_server_control'])) { - $result = PMA_handleRequestForSlaveServerControl(); - $refresh = true; - - switch ($_REQUEST['sr_slave_action']) { - case 'start': - $messageSuccess = __('Replication started successfully.'); - $messageError = __('Error starting replication.'); - break; - case 'stop': - $messageSuccess = __('Replication stopped successfully.'); - $messageError = __('Error stopping replication.'); - break; - case 'reset': - $messageSuccess = __('Replication resetting successfully.'); - $messageError = __('Error resetting replication.'); - break; - default: - $messageSuccess = __('Success.'); - $messageError = __('Error.'); - break; - } - } elseif (isset($_REQUEST['sr_slave_skip_error'])) { - $result = PMA_handleRequestForSlaveSkipError(); - } - - if ($refresh) { - $response = PMA\libraries\Response::getInstance(); - if ($response->isAjax()) { - $response->setRequestStatus($result); - $response->addJSON( - 'message', - $result - ? Message::success($messageSuccess) - : Message::error($messageError) - ); - } else { - PMA_sendHeaderLocation( - './server_replication.php' - . PMA_URL_getCommon($GLOBALS['url_params'], 'text') - ); - } - } - unset($refresh); - } -} -/** - * handle control requests for Slave Change Master - * - * @return boolean - */ -function PMA_handleRequestForSlaveChangeMaster() -{ - $sr = array(); - $_SESSION['replication']['m_username'] = $sr['username'] - = $GLOBALS['dbi']->escapeString($_REQUEST['username']); - $_SESSION['replication']['m_password'] = $sr['pma_pw'] - = $GLOBALS['dbi']->escapeString($_REQUEST['pma_pw']); - $_SESSION['replication']['m_hostname'] = $sr['hostname'] - = $GLOBALS['dbi']->escapeString($_REQUEST['hostname']); - $_SESSION['replication']['m_port'] = $sr['port'] - = $GLOBALS['dbi']->escapeString($_REQUEST['text_port']); - $_SESSION['replication']['m_correct'] = ''; - $_SESSION['replication']['sr_action_status'] = 'error'; - $_SESSION['replication']['sr_action_info'] = __('Unknown error'); - - // Attempt to connect to the new master server - $link_to_master = PMA_Replication_connectToMaster( - $sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port'] - ); - - if (! $link_to_master) { - $_SESSION['replication']['sr_action_status'] = 'error'; - $_SESSION['replication']['sr_action_info'] = sprintf( - __('Unable to connect to master %s.'), - htmlspecialchars($sr['hostname']) - ); - } else { - // Read the current master position - $position = PMA_Replication_Slave_binLogMaster($link_to_master); - - if (empty($position)) { - $_SESSION['replication']['sr_action_status'] = 'error'; - $_SESSION['replication']['sr_action_info'] - = __( - 'Unable to read master log position. ' - . 'Possible privilege problem on master.' - ); - } else { - $_SESSION['replication']['m_correct'] = true; - - if (! PMA_Replication_Slave_changeMaster( - $sr['username'], - $sr['pma_pw'], - $sr['hostname'], - $sr['port'], - $position, - true, - false - ) - ) { - $_SESSION['replication']['sr_action_status'] = 'error'; - $_SESSION['replication']['sr_action_info'] - = __('Unable to change master!'); - } else { - $_SESSION['replication']['sr_action_status'] = 'success'; - $_SESSION['replication']['sr_action_info'] = sprintf( - __('Master server changed successfully to %s.'), - htmlspecialchars($sr['hostname']) - ); - } - } - } - - return $_SESSION['replication']['sr_action_status'] === 'success'; -} - -/** - * handle control requests for Slave Server Control - * - * @return boolean - */ -function PMA_handleRequestForSlaveServerControl() -{ - if (empty($_REQUEST['sr_slave_control_parm'])) { - $_REQUEST['sr_slave_control_parm'] = null; - } - if ($_REQUEST['sr_slave_action'] == 'reset') { - $qStop = PMA_Replication_Slave_control("STOP"); - $qReset = $GLOBALS['dbi']->tryQuery("RESET SLAVE;"); - $qStart = PMA_Replication_Slave_control("START"); - - $result = ($qStop !== false && $qStop !== -1 && - $qReset !== false && $qReset !== -1 && - $qStart !== false && $qStart !== -1); - } else { - $qControl = PMA_Replication_Slave_control( - $_REQUEST['sr_slave_action'], - $_REQUEST['sr_slave_control_parm'] - ); - - $result = ($qControl !== false && $qControl !== -1); - } - - return $result; -} - -/** - * handle control requests for Slave Skip Error - * - * @return boolean - */ -function PMA_handleRequestForSlaveSkipError() -{ - $count = 1; - if (isset($_REQUEST['sr_skip_errors_count'])) { - $count = $_REQUEST['sr_skip_errors_count'] * 1; - } - - $qStop = PMA_Replication_Slave_control("STOP"); - $qSkip = $GLOBALS['dbi']->tryQuery( - "SET GLOBAL SQL_SLAVE_SKIP_COUNTER = " . $count . ";" - ); - $qStart = PMA_Replication_Slave_control("START"); - - $result = ($qStop !== false && $qStop !== -1 && - $qSkip !== false && $qSkip !== -1 && - $qStart !== false && $qStart !== -1); - - return $result; -} diff --git a/#pma/libraries/rte/rte_events.lib.php b/#pma/libraries/rte/rte_events.lib.php deleted file mode 100644 index f2507e9f..00000000 --- a/#pma/libraries/rte/rte_events.lib.php +++ /dev/null @@ -1,612 +0,0 @@ - array('ENABLE', - 'DISABLE', - 'DISABLE ON SLAVE'), - 'display' => array('ENABLED', - 'DISABLED', - 'SLAVESIDE_DISABLED') - ); - $event_type = array('RECURRING', - 'ONE TIME'); - $event_interval = array('YEAR', - 'QUARTER', - 'MONTH', - 'DAY', - 'HOUR', - 'MINUTE', - 'WEEK', - 'SECOND', - 'YEAR_MONTH', - 'DAY_HOUR', - 'DAY_MINUTE', - 'DAY_SECOND', - 'HOUR_MINUTE', - 'HOUR_SECOND', - 'MINUTE_SECOND'); -} - -/** - * Main function for the events functionality - * - * @return void - */ -function PMA_EVN_main() -{ - global $db; - - PMA_EVN_setGlobals(); - /** - * Process all requests - */ - PMA_EVN_handleEditor(); - PMA_EVN_handleExport(); - /** - * Display a list of available events - */ - $items = $GLOBALS['dbi']->getEvents($db); - echo PMA_RTE_getList('event', $items); - /** - * Display a link for adding a new event, if - * the user has the privileges and a link to - * toggle the state of the event scheduler. - */ - echo PMA_EVN_getFooterLinks(); -} // end PMA_EVN_main() - -/** - * Handles editor requests for adding or editing an item - * - * @return void - */ -function PMA_EVN_handleEditor() -{ - global $_REQUEST, $_POST, $errors, $db; - - if (! empty($_REQUEST['editor_process_add']) - || ! empty($_REQUEST['editor_process_edit']) - ) { - $sql_query = ''; - - $item_query = PMA_EVN_getQueryFromRequest(); - - if (! count($errors)) { // set by PMA_RTN_getQueryFromRequest() - // Execute the created query - if (! empty($_REQUEST['editor_process_edit'])) { - // Backup the old trigger, in case something goes wrong - $create_item = $GLOBALS['dbi']->getDefinition( - $db, - 'EVENT', - $_REQUEST['item_original_name'] - ); - $drop_item = "DROP EVENT " - . PMA\libraries\Util::backquote($_REQUEST['item_original_name']) - . ";\n"; - $result = $GLOBALS['dbi']->tryQuery($drop_item); - if (! $result) { - $errors[] = sprintf( - __('The following query has failed: "%s"'), - htmlspecialchars($drop_item) - ) - . '
    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); - } else { - $result = $GLOBALS['dbi']->tryQuery($item_query); - if (! $result) { - $errors[] = sprintf( - __('The following query has failed: "%s"'), - htmlspecialchars($item_query) - ) - . '
    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); - // We dropped the old item, but were unable to create - // the new one. Try to restore the backup query - $result = $GLOBALS['dbi']->tryQuery($create_item); - $errors = checkResult( - $result, - __( - 'Sorry, we failed to restore the dropped event.' - ), - $create_item, - $errors - ); - } else { - $message = PMA\libraries\Message::success( - __('Event %1$s has been modified.') - ); - $message->addParam( - PMA\libraries\Util::backquote($_REQUEST['item_name']) - ); - $sql_query = $drop_item . $item_query; - } - } - } else { - // 'Add a new item' mode - $result = $GLOBALS['dbi']->tryQuery($item_query); - if (! $result) { - $errors[] = sprintf( - __('The following query has failed: "%s"'), - htmlspecialchars($item_query) - ) - . '

    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); - } else { - $message = PMA\libraries\Message::success( - __('Event %1$s has been created.') - ); - $message->addParam( - PMA\libraries\Util::backquote($_REQUEST['item_name']) - ); - $sql_query = $item_query; - } - } - } - - if (count($errors)) { - $message = PMA\libraries\Message::error( - '' - . __( - 'One or more errors have occurred while processing your request:' - ) - . '' - ); - $message->addString('
      '); - foreach ($errors as $string) { - $message->addString('
    • ' . $string . '
    • '); - } - $message->addString('
    '); - } - - $output = PMA\libraries\Util::getMessage($message, $sql_query); - if ($GLOBALS['is_ajax_request']) { - $response = PMA\libraries\Response::getInstance(); - if ($message->isSuccess()) { - $events = $GLOBALS['dbi']->getEvents($db, $_REQUEST['item_name']); - $event = $events[0]; - $response->addJSON( - 'name', - htmlspecialchars( - mb_strtoupper($_REQUEST['item_name']) - ) - ); - $response->addJSON('new_row', PMA_EVN_getRowForList($event)); - $response->addJSON('insert', ! empty($event)); - $response->addJSON('message', $output); - } else { - $response->setRequestStatus(false); - $response->addJSON('message', $message); - } - exit; - } - } - /** - * Display a form used to add/edit a trigger, if necessary - */ - if (count($errors) - || (empty($_REQUEST['editor_process_add']) - && empty($_REQUEST['editor_process_edit']) - && (! empty($_REQUEST['add_item']) - || ! empty($_REQUEST['edit_item']) - || ! empty($_REQUEST['item_changetype']))) - ) { // FIXME: this must be simpler than that - $operation = ''; - if (! empty($_REQUEST['item_changetype'])) { - $operation = 'change'; - } - // Get the data for the form (if any) - if (! empty($_REQUEST['add_item'])) { - $title = PMA_RTE_getWord('add'); - $item = PMA_EVN_getDataFromRequest(); - $mode = 'add'; - } else if (! empty($_REQUEST['edit_item'])) { - $title = __("Edit event"); - if (! empty($_REQUEST['item_name']) - && empty($_REQUEST['editor_process_edit']) - && empty($_REQUEST['item_changetype']) - ) { - $item = PMA_EVN_getDataFromName($_REQUEST['item_name']); - if ($item !== false) { - $item['item_original_name'] = $item['item_name']; - } - } else { - $item = PMA_EVN_getDataFromRequest(); - } - $mode = 'edit'; - } - PMA_RTE_sendEditor('EVN', $mode, $item, $title, $db, $operation); - } -} // end PMA_EVN_handleEditor() - -/** - * This function will generate the values that are required to for the editor - * - * @return array Data necessary to create the editor. - */ -function PMA_EVN_getDataFromRequest() -{ - $retval = array(); - $indices = array('item_name', - 'item_original_name', - 'item_status', - 'item_execute_at', - 'item_interval_value', - 'item_interval_field', - 'item_starts', - 'item_ends', - 'item_definition', - 'item_preserve', - 'item_comment', - 'item_definer'); - foreach ($indices as $index) { - $retval[$index] = isset($_REQUEST[$index]) ? $_REQUEST[$index] : ''; - } - $retval['item_type'] = 'ONE TIME'; - $retval['item_type_toggle'] = 'RECURRING'; - if (isset($_REQUEST['item_type']) && $_REQUEST['item_type'] == 'RECURRING') { - $retval['item_type'] = 'RECURRING'; - $retval['item_type_toggle'] = 'ONE TIME'; - } - return $retval; -} // end PMA_EVN_getDataFromRequest() - -/** - * This function will generate the values that are required to complete - * the "Edit event" form given the name of a event. - * - * @param string $name The name of the event. - * - * @return array Data necessary to create the editor. - */ -function PMA_EVN_getDataFromName($name) -{ - global $db; - - $retval = array(); - $columns = "`EVENT_NAME`, `STATUS`, `EVENT_TYPE`, `EXECUTE_AT`, " - . "`INTERVAL_VALUE`, `INTERVAL_FIELD`, `STARTS`, `ENDS`, " - . "`EVENT_DEFINITION`, `ON_COMPLETION`, `DEFINER`, `EVENT_COMMENT`"; - $where = "EVENT_SCHEMA " . PMA\libraries\Util::getCollateForIS() . "=" - . "'" . $GLOBALS['dbi']->escapeString($db) . "' " - . "AND EVENT_NAME='" . $GLOBALS['dbi']->escapeString($name) . "'"; - $query = "SELECT $columns FROM `INFORMATION_SCHEMA`.`EVENTS` WHERE $where;"; - $item = $GLOBALS['dbi']->fetchSingleRow($query); - if (! $item) { - return false; - } - $retval['item_name'] = $item['EVENT_NAME']; - $retval['item_status'] = $item['STATUS']; - $retval['item_type'] = $item['EVENT_TYPE']; - if ($retval['item_type'] == 'RECURRING') { - $retval['item_type_toggle'] = 'ONE TIME'; - } else { - $retval['item_type_toggle'] = 'RECURRING'; - } - $retval['item_execute_at'] = $item['EXECUTE_AT']; - $retval['item_interval_value'] = $item['INTERVAL_VALUE']; - $retval['item_interval_field'] = $item['INTERVAL_FIELD']; - $retval['item_starts'] = $item['STARTS']; - $retval['item_ends'] = $item['ENDS']; - $retval['item_preserve'] = ''; - if ($item['ON_COMPLETION'] == 'PRESERVE') { - $retval['item_preserve'] = " checked='checked'"; - } - $retval['item_definition'] = $item['EVENT_DEFINITION']; - $retval['item_definer'] = $item['DEFINER']; - $retval['item_comment'] = $item['EVENT_COMMENT']; - - return $retval; -} // end PMA_EVN_getDataFromName() - -/** - * Displays a form used to add/edit an event - * - * @param string $mode If the editor will be used to edit an event - * or add a new one: 'edit' or 'add'. - * @param string $operation If the editor was previously invoked with - * JS turned off, this will hold the name of - * the current operation - * @param array $item Data for the event returned by - * PMA_EVN_getDataFromRequest() or - * PMA_EVN_getDataFromName() - * - * @return string HTML code for the editor. - */ -function PMA_EVN_getEditorForm($mode, $operation, $item) -{ - global $db, $table, $event_status, $event_type, $event_interval; - - $modeToUpper = mb_strtoupper($mode); - - // Escape special characters - $need_escape = array( - 'item_original_name', - 'item_name', - 'item_type', - 'item_execute_at', - 'item_interval_value', - 'item_starts', - 'item_ends', - 'item_definition', - 'item_definer', - 'item_comment' - ); - foreach ($need_escape as $index) { - $item[$index] = htmlentities($item[$index], ENT_QUOTES); - } - $original_data = ''; - if ($mode == 'edit') { - $original_data = "\n"; - } - // Handle some logic first - if ($operation == 'change') { - if ($item['item_type'] == 'RECURRING') { - $item['item_type'] = 'ONE TIME'; - $item['item_type_toggle'] = 'RECURRING'; - } else { - $item['item_type'] = 'RECURRING'; - $item['item_type_toggle'] = 'ONE TIME'; - } - } - if ($item['item_type'] == 'ONE TIME') { - $isrecurring_class = ' hide'; - $isonetime_class = ''; - } else { - $isrecurring_class = ''; - $isonetime_class = ' hide'; - } - // Create the output - $retval = ""; - $retval .= "\n\n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= $original_data; - $retval .= PMA_URL_getHiddenInputs($db, $table) . "\n"; - $retval .= "
    \n"; - $retval .= "" . __('Details') . "\n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "\n"; - - $retval .= "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - - return $retval; -} // end PMA_RTN_getRowForList() - -/** - * Creates the contents for a row in the list of triggers - * - * @param array $trigger An array of routine data - * @param string $rowclass Empty or one of ['even'|'odd'] - * - * @return string HTML code of a cell for the list of triggers - */ -function PMA_TRI_getRowForList($trigger, $rowclass = '') -{ - global $ajax_class, $url_query, $db, $table, $titles; - - $retval = " \n"; - $retval .= " \n"; - $retval .= " \n"; - if (empty($table)) { - $retval .= " \n"; - } - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - - return $retval; -} // end PMA_TRI_getRowForList() - -/** - * Creates the contents for a row in the list of events - * - * @param array $event An array of routine data - * @param string $rowclass Empty or one of ['even'|'odd'] - * - * @return string HTML code of a cell for the list of events - */ -function PMA_EVN_getRowForList($event, $rowclass = '') -{ - global $ajax_class, $url_query, $db, $titles; - - $sql_drop = sprintf( - 'DROP EVENT IF EXISTS %s', - PMA\libraries\Util::backquote($event['name']) - ); - - $retval = " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - - return $retval; -} // end PMA_EVN_getRowForList() - diff --git a/#pma/libraries/rte/rte_main.inc.php b/#pma/libraries/rte/rte_main.inc.php deleted file mode 100644 index 5c45255c..00000000 --- a/#pma/libraries/rte/rte_main.inc.php +++ /dev/null @@ -1,104 +0,0 @@ -getTables($db))) { - include_once './libraries/tbl_common.inc.php'; - } else { - $table = ''; - include_once './libraries/db_common.inc.php'; - - list( - $tables, - $num_tables, - $total_num_tables, - $sub_part, - $is_show_stats, - $db_is_system_schema, - $tooltip_truename, - $tooltip_aliasname, - $pos - ) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); - } -} else { - /** - * Since we did not include some libraries, we need - * to manually select the required database and - * create the missing $url_query variable - */ - if (mb_strlen($db)) { - $GLOBALS['dbi']->selectDb($db); - if (! isset($url_query)) { - $url_query = PMA_URL_getCommon( - array( - 'db' => $db, 'table' => $table - ) - ); - } - } -} - -/** - * Generate the conditional classes that will - * be used to attach jQuery events to links - */ -$ajax_class = array( - 'add' => 'class="ajax add_anchor"', - 'edit' => 'class="ajax edit_anchor"', - 'exec' => 'class="ajax exec_anchor"', - 'drop' => 'class="ajax drop_anchor"', - 'export' => 'class="ajax export_anchor"' -); - -/** - * Create labels for the list - */ -$titles = PMA\libraries\Util::buildActionTitles(); - -/** - * Keep a list of errors that occurred while - * processing an 'Add' or 'Edit' operation. - */ -$errors = array(); - - -/** - * Call the appropriate main function - */ -switch ($_PMA_RTE) { -case 'RTN': - $type = null; - if (isset($_REQUEST['type'])) { - $type = $_REQUEST['type']; - } - PMA_RTN_main($type); - break; -case 'TRI': - PMA_TRI_main(); - break; -case 'EVN': - PMA_EVN_main(); - break; -} - diff --git a/#pma/libraries/rte/rte_routines.lib.php b/#pma/libraries/rte/rte_routines.lib.php deleted file mode 100644 index c1e69854..00000000 --- a/#pma/libraries/rte/rte_routines.lib.php +++ /dev/null @@ -1,1711 +0,0 @@ -getRoutines($db, $type); - echo PMA_RTE_getList('routine', $items); - /** - * Display the form for adding a new routine, if the user has the privileges. - */ - echo PMA_RTN_getFooterLinks(); - /** - * Display a warning for users with PHP's old "mysql" extension. - */ - if (! PMA\libraries\DatabaseInterface::checkDbExtension('mysqli')) { - trigger_error( - __( - 'You are using PHP\'s deprecated \'mysql\' extension, ' - . 'which is not capable of handling multi queries. ' - . '[strong]The execution of some stored routines may fail![/strong] ' - . 'Please use the improved \'mysqli\' extension to ' - . 'avoid any problems.' - ), - E_USER_WARNING - ); - } -} // end PMA_RTN_main() - -/** - * Handles editor requests for adding or editing an item - * - * @return void - */ -function PMA_RTN_handleEditor() -{ - global $_GET, $_POST, $_REQUEST, $GLOBALS, $db, $errors; - - $errors = PMA_RTN_handleRequestCreateOrEdit($errors, $db); - - /** - * Display a form used to add/edit a routine, if necessary - */ - // FIXME: this must be simpler than that - if (count($errors) - || ( empty($_REQUEST['editor_process_add']) - && empty($_REQUEST['editor_process_edit']) - && (! empty($_REQUEST['add_item']) || ! empty($_REQUEST['edit_item']) - || ! empty($_REQUEST['routine_addparameter']) - || ! empty($_REQUEST['routine_removeparameter']) - || ! empty($_REQUEST['routine_changetype']))) - ) { - // Handle requests to add/remove parameters and changing routine type - // This is necessary when JS is disabled - $operation = ''; - if (! empty($_REQUEST['routine_addparameter'])) { - $operation = 'add'; - } else if (! empty($_REQUEST['routine_removeparameter'])) { - $operation = 'remove'; - } else if (! empty($_REQUEST['routine_changetype'])) { - $operation = 'change'; - } - // Get the data for the form (if any) - if (! empty($_REQUEST['add_item'])) { - $title = PMA_RTE_getWord('add'); - $routine = PMA_RTN_getDataFromRequest(); - $mode = 'add'; - } else if (! empty($_REQUEST['edit_item'])) { - $title = __("Edit routine"); - if (! $operation && ! empty($_REQUEST['item_name']) - && empty($_REQUEST['editor_process_edit']) - ) { - $routine = PMA_RTN_getDataFromName( - $_REQUEST['item_name'], $_REQUEST['item_type'] - ); - if ($routine !== false) { - $routine['item_original_name'] = $routine['item_name']; - $routine['item_original_type'] = $routine['item_type']; - } - } else { - $routine = PMA_RTN_getDataFromRequest(); - } - $mode = 'edit'; - } - if ($routine !== false) { - // Show form - $editor = PMA_RTN_getEditorForm($mode, $operation, $routine); - if ($GLOBALS['is_ajax_request']) { - $response = PMA\libraries\Response::getInstance(); - $response->addJSON('message', $editor); - $response->addJSON('title', $title); - $response->addJSON('param_template', PMA_RTN_getParameterRow()); - $response->addJSON('type', $routine['item_type']); - } else { - echo "\n\n

    $title

    \n\n$editor"; - } - exit; - } else { - $message = __('Error in processing request:') . ' '; - $message .= sprintf( - PMA_RTE_getWord('no_edit'), - htmlspecialchars( - PMA\libraries\Util::backquote($_REQUEST['item_name']) - ), - htmlspecialchars(PMA\libraries\Util::backquote($db)) - ); - - $message = Message::error($message); - if ($GLOBALS['is_ajax_request']) { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus(false); - $response->addJSON('message', $message); - exit; - } else { - $message->display(); - } - } - } -} - -/** - * Handle request to create or edit a routine - * - * @param array $errors Errors - * @param string $db DB name - * - * @return array - */ -function PMA_RTN_handleRequestCreateOrEdit($errors, $db) -{ - if (empty($_REQUEST['editor_process_add']) - && empty($_REQUEST['editor_process_edit']) - ) { - return $errors; - } - - $sql_query = ''; - $routine_query = PMA_RTN_getQueryFromRequest(); - if (!count($errors)) { // set by PMA_RTN_getQueryFromRequest() - // Execute the created query - if (!empty($_REQUEST['editor_process_edit'])) { - $isProcOrFunc = in_array( - $_REQUEST['item_original_type'], - array('PROCEDURE', 'FUNCTION') - ); - - if (!$isProcOrFunc) { - $errors[] = sprintf( - __('Invalid routine type: "%s"'), - htmlspecialchars($_REQUEST['item_original_type']) - ); - } else { - // Backup the old routine, in case something goes wrong - $create_routine = $GLOBALS['dbi']->getDefinition( - $db, - $_REQUEST['item_original_type'], - $_REQUEST['item_original_name'] - ); - - $privilegesBackup = PMA_RTN_backupPrivileges(); - - $drop_routine = "DROP {$_REQUEST['item_original_type']} " - . PMA\libraries\Util::backquote($_REQUEST['item_original_name']) - . ";\n"; - $result = $GLOBALS['dbi']->tryQuery($drop_routine); - if (!$result) { - $errors[] = sprintf( - __('The following query has failed: "%s"'), - htmlspecialchars($drop_routine) - ) - . '
    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); - } else { - list($newErrors, $message) = PMA_RTN_createRoutine( - $routine_query, - $create_routine, - $privilegesBackup - ); - if (empty($newErrors)) { - $sql_query = $drop_routine . $routine_query; - } else { - $errors = array_merge($errors, $newErrors); - } - unset($newErrors); - if (null === $message) { - unset($message); - } - } - } - } else { - // 'Add a new routine' mode - $result = $GLOBALS['dbi']->tryQuery($routine_query); - if (!$result) { - $errors[] = sprintf( - __('The following query has failed: "%s"'), - htmlspecialchars($routine_query) - ) - . '

    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); - } else { - $message = PMA\libraries\Message::success( - __('Routine %1$s has been created.') - ); - $message->addParam( - PMA\libraries\Util::backquote($_REQUEST['item_name']) - ); - $sql_query = $routine_query; - } - } - } - - if (count($errors)) { - $message = PMA\libraries\Message::error( - __( - 'One or more errors have occurred while' - . ' processing your request:' - ) - ); - $message->addString('
      '); - foreach ($errors as $string) { - $message->addString('
    • ' . $string . '
    • '); - } - $message->addString('
    '); - } - - $output = PMA\libraries\Util::getMessage($message, $sql_query); - if (!$GLOBALS['is_ajax_request']) { - return $errors; - } - - $response = PMA\libraries\Response::getInstance(); - if (!$message->isSuccess()) { - $response->setRequestStatus(false); - $response->addJSON('message', $output); - exit; - } - - $routines = $GLOBALS['dbi']->getRoutines( - $db, - $_REQUEST['item_type'], - $_REQUEST['item_name'] - ); - $routine = $routines[0]; - $response->addJSON( - 'name', - htmlspecialchars( - mb_strtoupper($_REQUEST['item_name']) - ) - ); - $response->addJSON('new_row', PMA_RTN_getRowForList($routine)); - $response->addJSON('insert', !empty($routine)); - $response->addJSON('message', $output); - exit; -} - -/** - * Backup the privileges - * - * @return array - */ -function PMA_RTN_backupPrivileges() -{ - if (! $GLOBALS['proc_priv'] || ! $GLOBALS['is_reload_priv']) { - return array(); - } - - // Backup the Old Privileges before dropping - // if $_REQUEST['item_adjust_privileges'] set - if (! isset($_REQUEST['item_adjust_privileges']) - || empty($_REQUEST['item_adjust_privileges']) - ) { - return array(); - } - - $privilegesBackupQuery = 'SELECT * FROM ' . PMA\libraries\Util::backquote( - 'mysql' - ) - . '.' . PMA\libraries\Util::backquote('procs_priv') - . ' where Routine_name = "' . $_REQUEST['item_original_name'] - . '" AND Routine_type = "' . $_REQUEST['item_original_type'] - . '";'; - - $privilegesBackup = $GLOBALS['dbi']->fetchResult( - $privilegesBackupQuery, - 0 - ); - - return $privilegesBackup; -} - -/** - * Create the routine - * - * @param string $routine_query Query to create routine - * @param string $create_routine Query to restore routine - * @param array $privilegesBackup Privileges backup - * - * @return array - */ -function PMA_RTN_createRoutine( - $routine_query, - $create_routine, - $privilegesBackup -) { - $result = $GLOBALS['dbi']->tryQuery($routine_query); - if (!$result) { - $errors = array(); - $errors[] = sprintf( - __('The following query has failed: "%s"'), - htmlspecialchars($routine_query) - ) - . '
    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); - // We dropped the old routine, - // but were unable to create the new one - // Try to restore the backup query - $result = $GLOBALS['dbi']->tryQuery($create_routine); - $errors = checkResult( - $result, - __( - 'Sorry, we failed to restore' - . ' the dropped routine.' - ), - $create_routine, - $errors - ); - - return array($errors, null); - } - - // Default value - $resultAdjust = false; - - if ($GLOBALS['proc_priv'] - && $GLOBALS['is_reload_priv'] - ) { - // Insert all the previous privileges - // but with the new name and the new type - foreach ($privilegesBackup as $priv) { - $adjustProcPrivilege = 'INSERT INTO ' - . Util::backquote('mysql') . '.' - . Util::backquote('procs_priv') - . ' VALUES("' . $priv[0] . '", "' - . $priv[1] . '", "' . $priv[2] . '", "' - . $_REQUEST['item_name'] . '", "' - . $_REQUEST['item_type'] . '", "' - . $priv[5] . '", "' - . $priv[6] . '", "' - . $priv[7] . '");'; - $resultAdjust = $GLOBALS['dbi']->query( - $adjustProcPrivilege - ); - } - } - - $message = PMA_RTN_flushPrivileges($resultAdjust); - - return array(array(), $message); -} - -/** - * Flush privileges and get message - * - * @param bool $flushPrivileges Flush privileges - * - * @return PMA\libraries\Message - */ -function PMA_RTN_flushPrivileges($flushPrivileges) -{ - if ($flushPrivileges) { - // Flush the Privileges - $flushPrivQuery = 'FLUSH PRIVILEGES;'; - $GLOBALS['dbi']->query($flushPrivQuery); - - $message = PMA\libraries\Message::success( - __( - 'Routine %1$s has been modified. Privileges have been adjusted.' - ) - ); - } else { - $message = PMA\libraries\Message::success( - __('Routine %1$s has been modified.') - ); - } - $message->addParam( - PMA\libraries\Util::backquote($_REQUEST['item_name']) - ); - - return $message; -} // end PMA_RTN_handleEditor() - -/** - * This function will generate the values that are required to - * complete the editor form. It is especially necessary to handle - * the 'Add another parameter', 'Remove last parameter' and - * 'Change routine type' functionalities when JS is disabled. - * - * @return array Data necessary to create the routine editor. - */ -function PMA_RTN_getDataFromRequest() -{ - global $_REQUEST, $param_directions, $param_sqldataaccess; - - $retval = array(); - $indices = array('item_name', - 'item_original_name', - 'item_returnlength', - 'item_returnopts_num', - 'item_returnopts_text', - 'item_definition', - 'item_comment', - 'item_definer'); - foreach ($indices as $index) { - $retval[$index] = isset($_REQUEST[$index]) ? $_REQUEST[$index] : ''; - } - - $retval['item_type'] = 'PROCEDURE'; - $retval['item_type_toggle'] = 'FUNCTION'; - if (isset($_REQUEST['item_type']) && $_REQUEST['item_type'] == 'FUNCTION') { - $retval['item_type'] = 'FUNCTION'; - $retval['item_type_toggle'] = 'PROCEDURE'; - } - $retval['item_original_type'] = 'PROCEDURE'; - if (isset($_REQUEST['item_original_type']) - && $_REQUEST['item_original_type'] == 'FUNCTION' - ) { - $retval['item_original_type'] = 'FUNCTION'; - } - $retval['item_num_params'] = 0; - $retval['item_param_dir'] = array(); - $retval['item_param_name'] = array(); - $retval['item_param_type'] = array(); - $retval['item_param_length'] = array(); - $retval['item_param_opts_num'] = array(); - $retval['item_param_opts_text'] = array(); - if (isset($_REQUEST['item_param_name']) - && isset($_REQUEST['item_param_type']) - && isset($_REQUEST['item_param_length']) - && isset($_REQUEST['item_param_opts_num']) - && isset($_REQUEST['item_param_opts_text']) - && is_array($_REQUEST['item_param_name']) - && is_array($_REQUEST['item_param_type']) - && is_array($_REQUEST['item_param_length']) - && is_array($_REQUEST['item_param_opts_num']) - && is_array($_REQUEST['item_param_opts_text']) - ) { - if ($_REQUEST['item_type'] == 'PROCEDURE') { - $retval['item_param_dir'] = $_REQUEST['item_param_dir']; - foreach ($retval['item_param_dir'] as $key => $value) { - if (! in_array($value, $param_directions, true)) { - $retval['item_param_dir'][$key] = ''; - } - } - } - $retval['item_param_name'] = $_REQUEST['item_param_name']; - $retval['item_param_type'] = $_REQUEST['item_param_type']; - foreach ($retval['item_param_type'] as $key => $value) { - if (! in_array($value, PMA\libraries\Util::getSupportedDatatypes(), true)) { - $retval['item_param_type'][$key] = ''; - } - } - $retval['item_param_length'] = $_REQUEST['item_param_length']; - $retval['item_param_opts_num'] = $_REQUEST['item_param_opts_num']; - $retval['item_param_opts_text'] = $_REQUEST['item_param_opts_text']; - $retval['item_num_params'] = max( - count($retval['item_param_name']), - count($retval['item_param_type']), - count($retval['item_param_length']), - count($retval['item_param_opts_num']), - count($retval['item_param_opts_text']) - ); - } - $retval['item_returntype'] = ''; - if (isset($_REQUEST['item_returntype']) - && in_array($_REQUEST['item_returntype'], PMA\libraries\Util::getSupportedDatatypes()) - ) { - $retval['item_returntype'] = $_REQUEST['item_returntype']; - } - - $retval['item_isdeterministic'] = ''; - if (isset($_REQUEST['item_isdeterministic']) - && mb_strtolower($_REQUEST['item_isdeterministic']) == 'on' - ) { - $retval['item_isdeterministic'] = " checked='checked'"; - } - $retval['item_securitytype_definer'] = ''; - $retval['item_securitytype_invoker'] = ''; - if (isset($_REQUEST['item_securitytype'])) { - if ($_REQUEST['item_securitytype'] === 'DEFINER') { - $retval['item_securitytype_definer'] = " selected='selected'"; - } else if ($_REQUEST['item_securitytype'] === 'INVOKER') { - $retval['item_securitytype_invoker'] = " selected='selected'"; - } - } - $retval['item_sqldataaccess'] = ''; - if (isset($_REQUEST['item_sqldataaccess']) - && in_array($_REQUEST['item_sqldataaccess'], $param_sqldataaccess, true) - ) { - $retval['item_sqldataaccess'] = $_REQUEST['item_sqldataaccess']; - } - - return $retval; -} // end function PMA_RTN_getDataFromRequest() - -/** - * This function will generate the values that are required to complete - * the "Edit routine" form given the name of a routine. - * - * @param string $name The name of the routine. - * @param string $type Type of routine (ROUTINE|PROCEDURE) - * @param bool $all Whether to return all data or just - * the info about parameters. - * @param bool $control Where to use Controllink to query for - * routine information - * - * @return array Data necessary to create the routine editor. - */ -function PMA_RTN_getDataFromName($name, $type, $all = true, $control = false) -{ - global $db; - $link = null; - - if ($control) { - $link = $GLOBALS['controllink']; - } - - $retval = array(); - - // Build and execute the query - $fields = "SPECIFIC_NAME, ROUTINE_TYPE, DTD_IDENTIFIER, " - . "ROUTINE_DEFINITION, IS_DETERMINISTIC, SQL_DATA_ACCESS, " - . "ROUTINE_COMMENT, SECURITY_TYPE"; - $where = "ROUTINE_SCHEMA " . PMA\libraries\Util::getCollateForIS() . "=" - . "'" . $GLOBALS['dbi']->escapeString($db) . "' " - . "AND SPECIFIC_NAME='" . $GLOBALS['dbi']->escapeString($name) . "'" - . "AND ROUTINE_TYPE='" . $GLOBALS['dbi']->escapeString($type) . "'"; - $query = "SELECT $fields FROM INFORMATION_SCHEMA.ROUTINES WHERE $where;"; - - $routine = $GLOBALS['dbi']->fetchSingleRow($query, 'ASSOC', $link); - - if (! $routine) { - return false; - } - - // Get required data - $retval['item_name'] = $routine['SPECIFIC_NAME']; - $retval['item_type'] = $routine['ROUTINE_TYPE']; - - $definition - = $GLOBALS['dbi']->getDefinition( - $db, - $routine['ROUTINE_TYPE'], - $routine['SPECIFIC_NAME'], - $link - ); - - if ($definition == NULL) { - return false; - } - - $parser = new SqlParser\Parser($definition); - - /** - * @var CreateStatement $stmt - */ - $stmt = $parser->statements[0]; - - $params = SqlParser\Utils\Routine::getParameters($stmt); - $retval['item_num_params'] = $params['num']; - $retval['item_param_dir'] = $params['dir']; - $retval['item_param_name'] = $params['name']; - $retval['item_param_type'] = $params['type']; - $retval['item_param_length'] = $params['length']; - $retval['item_param_length_arr'] = $params['length_arr']; - $retval['item_param_opts_num'] = $params['opts']; - $retval['item_param_opts_text'] = $params['opts']; - - // Get extra data - if (!$all) { - return $retval; - } - - if ($retval['item_type'] == 'FUNCTION') { - $retval['item_type_toggle'] = 'PROCEDURE'; - } else { - $retval['item_type_toggle'] = 'FUNCTION'; - } - $retval['item_returntype'] = ''; - $retval['item_returnlength'] = ''; - $retval['item_returnopts_num'] = ''; - $retval['item_returnopts_text'] = ''; - - if (! empty($routine['DTD_IDENTIFIER'])) { - $options = array(); - foreach ($stmt->return->options->options as $opt) { - $options[] = is_string($opt) ? $opt : $opt['value']; - } - - $retval['item_returntype'] = $stmt->return->name; - $retval['item_returnlength'] = implode(',', $stmt->return->parameters); - $retval['item_returnopts_num'] = implode(' ', $options); - $retval['item_returnopts_text'] = implode(' ', $options); - } - - $retval['item_definer'] = $stmt->options->has('DEFINER'); - $retval['item_definition'] = $routine['ROUTINE_DEFINITION']; - $retval['item_isdeterministic'] = ''; - if ($routine['IS_DETERMINISTIC'] == 'YES') { - $retval['item_isdeterministic'] = " checked='checked'"; - } - $retval['item_securitytype_definer'] = ''; - $retval['item_securitytype_invoker'] = ''; - if ($routine['SECURITY_TYPE'] == 'DEFINER') { - $retval['item_securitytype_definer'] = " selected='selected'"; - } else if ($routine['SECURITY_TYPE'] == 'INVOKER') { - $retval['item_securitytype_invoker'] = " selected='selected'"; - } - $retval['item_sqldataaccess'] = $routine['SQL_DATA_ACCESS']; - $retval['item_comment'] = $routine['ROUTINE_COMMENT']; - - return $retval; -} // PMA_RTN_getDataFromName() - -/** - * Creates one row for the parameter table used in the routine editor. - * - * @param array $routine Data for the routine returned by - * PMA_RTN_getDataFromRequest() or - * PMA_RTN_getDataFromName() - * @param mixed $index Either a numeric index of the row being processed - * or NULL to create a template row for AJAX request - * @param string $class Class used to hide the direction column, if the - * row is for a stored function. - * - * @return string HTML code of one row of parameter table for the editor. - */ -function PMA_RTN_getParameterRow($routine = array(), $index = null, $class = '') -{ - global $param_directions, $param_opts_num, $titles; - - if ($index === null) { - // template row for AJAX request - $i = 0; - $index = '%s'; - $drop_class = ''; - $routine = array( - 'item_param_dir' => array(0 => ''), - 'item_param_name' => array(0 => ''), - 'item_param_type' => array(0 => ''), - 'item_param_length' => array(0 => ''), - 'item_param_opts_num' => array(0 => ''), - 'item_param_opts_text' => array(0 => '') - ); - } else if (! empty($routine)) { - // regular row for routine editor - $drop_class = ' hide'; - $i = $index; - } else { - // No input data. This shouldn't happen, - // but better be safe than sorry. - return ''; - } - - // Create the output - $retval = ""; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - - return $retval; -} // end PMA_RTN_getParameterRow() - -/** - * Displays a form used to add/edit a routine - * - * @param string $mode If the editor will be used to edit a routine - * or add a new one: 'edit' or 'add'. - * @param string $operation If the editor was previously invoked with - * JS turned off, this will hold the name of - * the current operation - * @param array $routine Data for the routine returned by - * PMA_RTN_getDataFromRequest() or - * PMA_RTN_getDataFromName() - * - * @return string HTML code for the editor. - */ -function PMA_RTN_getEditorForm($mode, $operation, $routine) -{ - global $db, $errors, $param_sqldataaccess, $param_opts_num; - - // Escape special characters - $need_escape = array( - 'item_original_name', - 'item_name', - 'item_returnlength', - 'item_definition', - 'item_definer', - 'item_comment' - ); - foreach ($need_escape as $key => $index) { - $routine[$index] = htmlentities($routine[$index], ENT_QUOTES, 'UTF-8'); - } - for ($i = 0; $i < $routine['item_num_params']; $i++) { - $routine['item_param_name'][$i] = htmlentities( - $routine['item_param_name'][$i], - ENT_QUOTES - ); - $routine['item_param_length'][$i] = htmlentities( - $routine['item_param_length'][$i], - ENT_QUOTES - ); - } - - // Handle some logic first - if ($operation == 'change') { - if ($routine['item_type'] == 'PROCEDURE') { - $routine['item_type'] = 'FUNCTION'; - $routine['item_type_toggle'] = 'PROCEDURE'; - } else { - $routine['item_type'] = 'PROCEDURE'; - $routine['item_type_toggle'] = 'FUNCTION'; - } - } else if ($operation == 'add' - || ($routine['item_num_params'] == 0 && $mode == 'add' && ! $errors) - ) { - $routine['item_param_dir'][] = ''; - $routine['item_param_name'][] = ''; - $routine['item_param_type'][] = ''; - $routine['item_param_length'][] = ''; - $routine['item_param_opts_num'][] = ''; - $routine['item_param_opts_text'][] = ''; - $routine['item_num_params']++; - } else if ($operation == 'remove') { - unset($routine['item_param_dir'][$routine['item_num_params'] - 1]); - unset($routine['item_param_name'][$routine['item_num_params'] - 1]); - unset($routine['item_param_type'][$routine['item_num_params'] - 1]); - unset($routine['item_param_length'][$routine['item_num_params'] - 1]); - unset($routine['item_param_opts_num'][$routine['item_num_params'] - 1]); - unset($routine['item_param_opts_text'][$routine['item_num_params'] - 1]); - $routine['item_num_params']--; - } - $disableRemoveParam = ''; - if (! $routine['item_num_params']) { - $disableRemoveParam = " color: gray;' disabled='disabled"; - } - $original_routine = ''; - if ($mode == 'edit') { - $original_routine = "\n" - . "\n"; - } - $isfunction_class = ''; - $isprocedure_class = ''; - $isfunction_select = ''; - $isprocedure_select = ''; - if ($routine['item_type'] == 'PROCEDURE') { - $isfunction_class = ' hide'; - $isprocedure_select = " selected='selected'"; - } else { - $isprocedure_class = ' hide'; - $isfunction_select = " selected='selected'"; - } - - // Create the output - $retval = ""; - $retval .= "\n\n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= $original_routine; - $retval .= PMA_URL_getHiddenInputs($db) . "\n"; - $retval .= "
    \n"; - $retval .= "" . __('Details') . "\n"; - $retval .= "
    " . __('Event name') . "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "
    " . __('Event type') . "\n"; - if ($GLOBALS['is_ajax_request']) { - $retval .= " \n"; - } else { - $retval .= " \n"; - $retval .= " {$item['item_type']}\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " $value) { - $selected = ""; - if (! empty($item['item_interval_field']) - && $item['item_interval_field'] == $value - ) { - $selected = " selected='selected'"; - } - $retval .= "$value"; - } - $retval .= " \n"; - $retval .= "
    " . _pgettext('Start of recurring event', 'Start'); - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "
    " . __('On completion preserve') . "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "\n"; - } - $retval .= "\n\n"; - $retval .= "\n\n"; - - return $retval; -} // end PMA_EVN_getEditorForm() - -/** - * Composes the query necessary to create an event from an HTTP request. - * - * @return string The CREATE EVENT query. - */ -function PMA_EVN_getQueryFromRequest() -{ - global $_REQUEST, $errors, $event_status, $event_type, $event_interval; - - $query = 'CREATE '; - if (! empty($_REQUEST['item_definer'])) { - if (mb_strpos($_REQUEST['item_definer'], '@') !== false - ) { - $arr = explode('@', $_REQUEST['item_definer']); - $query .= 'DEFINER=' . PMA\libraries\Util::backquote($arr[0]); - $query .= '@' . PMA\libraries\Util::backquote($arr[1]) . ' '; - } else { - $errors[] = __('The definer must be in the "username@hostname" format!'); - } - } - $query .= 'EVENT '; - if (! empty($_REQUEST['item_name'])) { - $query .= PMA\libraries\Util::backquote($_REQUEST['item_name']) . ' '; - } else { - $errors[] = __('You must provide an event name!'); - } - $query .= 'ON SCHEDULE '; - if (! empty($_REQUEST['item_type']) - && in_array($_REQUEST['item_type'], $event_type) - ) { - if ($_REQUEST['item_type'] == 'RECURRING') { - if (! empty($_REQUEST['item_interval_value']) - && !empty($_REQUEST['item_interval_field']) - && in_array($_REQUEST['item_interval_field'], $event_interval) - ) { - $query .= 'EVERY ' . intval($_REQUEST['item_interval_value']) . ' '; - $query .= $_REQUEST['item_interval_field'] . ' '; - } else { - $errors[] - = __('You must provide a valid interval value for the event.'); - } - if (! empty($_REQUEST['item_starts'])) { - $query .= "STARTS '" - . $GLOBALS['dbi']->escapeString($_REQUEST['item_starts']) - . "' "; - } - if (! empty($_REQUEST['item_ends'])) { - $query .= "ENDS '" - . $GLOBALS['dbi']->escapeString($_REQUEST['item_ends']) - . "' "; - } - } else { - if (! empty($_REQUEST['item_execute_at'])) { - $query .= "AT '" - . $GLOBALS['dbi']->escapeString($_REQUEST['item_execute_at']) - . "' "; - } else { - $errors[] - = __('You must provide a valid execution time for the event.'); - } - } - } else { - $errors[] = __('You must provide a valid type for the event.'); - } - $query .= 'ON COMPLETION '; - if (empty($_REQUEST['item_preserve'])) { - $query .= 'NOT '; - } - $query .= 'PRESERVE '; - if (! empty($_REQUEST['item_status'])) { - foreach ($event_status['display'] as $key => $value) { - if ($value == $_REQUEST['item_status']) { - $query .= $event_status['query'][$key] . ' '; - break; - } - } - } - if (! empty($_REQUEST['item_comment'])) { - $query .= "COMMENT '" . $GLOBALS['dbi']->escapeString( - $_REQUEST['item_comment'] - ) . "' "; - } - $query .= 'DO '; - if (! empty($_REQUEST['item_definition'])) { - $query .= $_REQUEST['item_definition']; - } else { - $errors[] = __('You must provide an event definition.'); - } - - return $query; -} // end PMA_EVN_getQueryFromRequest() - diff --git a/#pma/libraries/rte/rte_export.lib.php b/#pma/libraries/rte/rte_export.lib.php deleted file mode 100644 index 94b59ff5..00000000 --- a/#pma/libraries/rte/rte_export.lib.php +++ /dev/null @@ -1,137 +0,0 @@ -addJSON('message', $export_data); - $response->addJSON('title', $title); - exit; - } else { - $export_data = ''; - echo "
    \n" - , "$title\n" - , $export_data - , "
    \n"; - } - } else { - $_db = htmlspecialchars(PMA\libraries\Util::backquote($db)); - $message = __('Error in processing request:') . ' ' - . sprintf(PMA_RTE_getWord('no_view'), $item_name, $_db); - $message = Message::error($message); - - if ($GLOBALS['is_ajax_request'] == true) { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus(false); - $response->addJSON('message', $message); - exit; - } else { - $message->display(); - } - } -} // end PMA_RTE_handleExport() - -/** - * If necessary, prepares event information and passes - * it to PMA_RTE_handleExport() for the actual export. - * - * @return void - */ -function PMA_EVN_handleExport() -{ - global $_GET, $db; - - if (! empty($_GET['export_item']) && ! empty($_GET['item_name'])) { - $item_name = $_GET['item_name']; - $export_data = $GLOBALS['dbi']->getDefinition($db, 'EVENT', $item_name); - if (! $export_data) { - $export_data = false; - } - PMA_RTE_handleExport($export_data); - } -} // end PMA_EVN_handleExport() - -/** - * If necessary, prepares routine information and passes - * it to PMA_RTE_handleExport() for the actual export. - * - * @return void - */ -function PMA_RTN_handleExport() -{ - global $_GET, $db; - - if (! empty($_GET['export_item']) - && ! empty($_GET['item_name']) - && ! empty($_GET['item_type']) - ) { - if ($_GET['item_type'] == 'FUNCTION' || $_GET['item_type'] == 'PROCEDURE') { - $rtn_definition - = $GLOBALS['dbi']->getDefinition( - $db, - $_GET['item_type'], - $_GET['item_name'] - ); - if (! $rtn_definition) { - $export_data = false; - } else { - $export_data = "DELIMITER $$\n" - . $rtn_definition - . "$$\nDELIMITER ;\n"; - } - - PMA_RTE_handleExport($export_data); - } - } -} // end PMA_RTN_handleExport() - -/** - * If necessary, prepares trigger information and passes - * it to PMA_RTE_handleExport() for the actual export. - * - * @return void - */ -function PMA_TRI_handleExport() -{ - global $_GET, $db, $table; - - if (! empty($_GET['export_item']) && ! empty($_GET['item_name'])) { - $item_name = $_GET['item_name']; - $triggers = $GLOBALS['dbi']->getTriggers($db, $table, ''); - $export_data = false; - foreach ($triggers as $trigger) { - if ($trigger['name'] === $item_name) { - $export_data = $trigger['create']; - break; - } - } - PMA_RTE_handleExport($export_data); - } -} // end PMA_TRI_handleExport() diff --git a/#pma/libraries/rte/rte_footer.lib.php b/#pma/libraries/rte/rte_footer.lib.php deleted file mode 100644 index c3252a2d..00000000 --- a/#pma/libraries/rte/rte_footer.lib.php +++ /dev/null @@ -1,129 +0,0 @@ -\n"; - $retval .= "
    \n"; - $retval .= "" . _pgettext('Create new procedure', 'New') . "\n"; - $retval .= " \n"; - $retval .= "
    \n"; - $retval .= "\n\n"; - - return $retval; -} // end PMA_RTE_getFooterLinks() - -/** - * Creates a fieldset for adding a new routine, if the user has the privileges. - * - * @return string HTML code with containing the footer fieldset - */ -function PMA_RTN_getFooterLinks() -{ - return PMA_RTE_getFooterLinks('CREATE_PROCEDURE', 'CREATE ROUTINE', 'ROUTINE'); -}// end PMA_RTN_getFooterLinks() - -/** - * Creates a fieldset for adding a new trigger, if the user has the privileges. - * - * @return string HTML code with containing the footer fieldset - */ -function PMA_TRI_getFooterLinks() -{ - return PMA_RTE_getFooterLinks('CREATE_TRIGGER', 'TRIGGER', 'TRIGGER'); -} // end PMA_TRI_getFooterLinks() - -/** - * Creates a fieldset for adding a new event, if the user has the privileges. - * - * @return string HTML code with containing the footer fieldset - */ -function PMA_EVN_getFooterLinks() -{ - global $db, $url_query; - - /** - * For events, we show the usual 'Add event' form and also - * a form for toggling the state of the event scheduler - */ - // Init options for the event scheduler toggle functionality - $es_state = $GLOBALS['dbi']->fetchValue( - "SHOW GLOBAL VARIABLES LIKE 'event_scheduler'", - 0, - 1 - ); - $es_state = mb_strtolower($es_state); - $options = array( - 0 => array( - 'label' => __('OFF'), - 'value' => "SET GLOBAL event_scheduler=\"OFF\"", - 'selected' => ($es_state != 'on') - ), - 1 => array( - 'label' => __('ON'), - 'value' => "SET GLOBAL event_scheduler=\"ON\"", - 'selected' => ($es_state == 'on') - ) - ); - // Generate output - $retval = "\n"; - $retval .= "
    \n"; - // show the usual footer - $retval .= PMA_RTE_getFooterLinks('CREATE_EVENT', 'EVENT', 'EVENT'); - $retval .= "
    \n"; - $retval .= " \n"; - $retval .= " " . __('Event scheduler status') . "\n"; - $retval .= " \n"; - $retval .= "
    \n"; - // show the toggle button - $retval .= PMA\libraries\Util::toggleButton( - "sql.php$url_query&goto=db_events.php" . urlencode("?db=$db"), - 'sql_query', - $options, - 'PMA_slidingMessage(data.sql_query);' - ); - $retval .= "
    \n"; - $retval .= "
    \n"; - $retval .= "
    \n"; - $retval .= "
    "; - $retval .= "\n"; - - return $retval; -} // end PMA_EVN_getFooterLinks() - diff --git a/#pma/libraries/rte/rte_general.lib.php b/#pma/libraries/rte/rte_general.lib.php deleted file mode 100644 index b07ca128..00000000 --- a/#pma/libraries/rte/rte_general.lib.php +++ /dev/null @@ -1,91 +0,0 @@ -' - . __('The backed up query was:') - . "\"" . htmlspecialchars($createStatement) . "\"" . '
    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); - - return $errors; -} - -/** - * Send TRI or EVN editor via ajax or by echoing. - * - * @param string $type TRI or EVN - * @param string $mode Editor mode 'add' or 'edit' - * @param array $item Data necessary to create the editor - * @param string $title Title of the editor - * @param string $db Database - * @param string $operation Operation 'change' or '' - * - * @return void - */ -function PMA_RTE_sendEditor($type, $mode, $item, $title, $db, $operation = null) -{ - if ($item !== false) { - // Show form - if ($type == 'TRI') { - $editor = PMA_TRI_getEditorForm($mode, $item); - } else { // EVN - $editor = PMA_EVN_getEditorForm($mode, $operation, $item); - } - if ($GLOBALS['is_ajax_request']) { - $response = PMA\libraries\Response::getInstance(); - $response->addJSON('message', $editor); - $response->addJSON('title', $title); - } else { - echo "\n\n

    $title

    \n\n$editor"; - unset($_POST); - } - exit; - } else { - $message = __('Error in processing request:') . ' '; - $message .= sprintf( - PMA_RTE_getWord('not_found'), - htmlspecialchars(PMA\libraries\Util::backquote($_REQUEST['item_name'])), - htmlspecialchars(PMA\libraries\Util::backquote($db)) - ); - $message = Message::error($message); - if ($GLOBALS['is_ajax_request']) { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus(false); - $response->addJSON('message', $message); - exit; - } else { - $message->display(); - } - } -} diff --git a/#pma/libraries/rte/rte_list.lib.php b/#pma/libraries/rte/rte_list.lib.php deleted file mode 100644 index 83d546e7..00000000 --- a/#pma/libraries/rte/rte_list.lib.php +++ /dev/null @@ -1,473 +0,0 @@ -\n"; - $retval .= '
    '; - $retval .= PMA_URL_getHiddenInputs($GLOBALS['db'], $GLOBALS['table']); - $retval .= "
    \n"; - $retval .= " \n"; - $retval .= " " . PMA_RTE_getWord('title') . "\n"; - $retval .= " " - . PMA\libraries\Util::showMySQLDocu(PMA_RTE_getWord('docu')) . "\n"; - $retval .= " \n"; - $retval .= "
    \n"; - $retval .= " " . PMA_RTE_getWord('nothing') . "\n"; - $retval .= "
    \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - // th cells with a colspan need corresponding td cells, according to W3C - switch ($type) { - case 'routine': - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; // see comment above - for ($i = 0; $i < 7; $i++) { - $retval .= " \n"; - } - break; - case 'trigger': - $retval .= " \n"; - $retval .= " \n"; - if (empty($table)) { - $retval .= " \n"; - } - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; // see comment above - for ($i = 0; $i < (empty($table) ? 7 : 6); $i++) { - $retval .= " \n"; - } - break; - case 'event': - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; // see comment above - for ($i = 0; $i < 6; $i++) { - $retval .= " \n"; - } - break; - default: - break; - } - $retval .= " \n"; - $retval .= " \n"; - $count = 0; - foreach ($items as $item) { - $rowclass = ($count % 2 == 0) ? 'odd' : 'even'; - if ($GLOBALS['is_ajax_request'] && empty($_REQUEST['ajax_page_request'])) { - $rowclass .= ' ajaxInsert hide'; - } - // Get each row from the correct function - switch ($type) { - case 'routine': - $retval .= PMA_RTN_getRowForList($item, $rowclass); - break; - case 'trigger': - $retval .= PMA_TRI_getRowForList($item, $rowclass); - break; - case 'event': - $retval .= PMA_EVN_getRowForList($item, $rowclass); - break; - default: - break; - } - $count++; - } - $retval .= "
    " . __('Name') . "" . __('Action') . "" . __('Type') . "" . __('Returns') . "
    " . __('Name') . "" . __('Table') . "" . __('Action') . "" . __('Time') . "" . __('Event') . "
    " . __('Name') . "" . __('Status') . "" . __('Action') . "" . __('Type') . "
    \n"; - - if (count($items)) { - $retval .= '
    '; - $retval .= PMA\libraries\Util::getWithSelected( - $GLOBALS['pmaThemeImage'], $GLOBALS['text_dir'], 'rteListForm' - ); - $retval .= PMA\libraries\Util::getButtonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_export', - __('Export'), 'b_export.png', 'export' - ); - $retval .= PMA\libraries\Util::getButtonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_drop', - __('Drop'), 'b_drop.png', 'drop' - ); - $retval .= '
    '; - } - - $retval .= "
    \n"; - $retval .= "
    \n"; - $retval .= "\n"; - - return $retval; -} // end PMA_RTE_getList() - -/** - * Creates the contents for a row in the list of routines - * - * @param array $routine An array of routine data - * @param string $rowclass Empty or one of ['even'|'odd'] - * - * @return string HTML code of a row for the list of routines - */ -function PMA_RTN_getRowForList($routine, $rowclass = '') -{ - global $ajax_class, $url_query, $db, $titles; - - $sql_drop = sprintf( - 'DROP %s IF EXISTS %s', - $routine['type'], - PMA\libraries\Util::backquote($routine['name']) - ); - $type_link = "item_type={$routine['type']}"; - - $retval = "
    \n"; - $retval .= ' '; - $retval .= " \n"; - $retval .= " " - . htmlspecialchars($sql_drop) . "\n"; - $retval .= " \n"; - $retval .= " " - . htmlspecialchars($routine['name']) . "\n"; - $retval .= " \n"; - $retval .= " \n"; - - // this is for our purpose to decide whether to - // show the edit link or not, so we need the DEFINER for the routine - $where = "ROUTINE_SCHEMA " . PMA\libraries\Util::getCollateForIS() . "=" - . "'" . $GLOBALS['dbi']->escapeString($db) . "' " - . "AND SPECIFIC_NAME='" . $GLOBALS['dbi']->escapeString($routine['name']) . "'" - . "AND ROUTINE_TYPE='" . $GLOBALS['dbi']->escapeString($routine['type']) . "'"; - $query = "SELECT `DEFINER` FROM INFORMATION_SCHEMA.ROUTINES WHERE $where;"; - $routine_definer = $GLOBALS['dbi']->fetchValue($query, 0, 0, $GLOBALS['controllink']); - - $curr_user = $GLOBALS['dbi']->getCurrentUser(); - - // Since editing a procedure involved dropping and recreating, check also for - // CREATE ROUTINE privilege to avoid lost procedures. - if ((PMA\libraries\Util::currentUserHasPrivilege('CREATE ROUTINE', $db) - && $curr_user == $routine_definer) - || $GLOBALS['is_superuser'] - ) { - $retval .= ' ' . $titles['Edit'] . "\n"; - } else { - $retval .= " {$titles['NoEdit']}\n"; - } - $retval .= " \n"; - - // There is a problem with PMA\libraries\Util::currentUserHasPrivilege(): - // it does not detect all kinds of privileges, for example - // a direct privilege on a specific routine. So, at this point, - // we show the Execute link, hoping that the user has the correct rights. - // Also, information_schema might be hiding the ROUTINE_DEFINITION - // but a routine with no input parameters can be nonetheless executed. - - // Check if the routine has any input parameters. If it does, - // we will show a dialog to get values for these parameters, - // otherwise we can execute it directly. - - $definition = $GLOBALS['dbi']->getDefinition( - $db, $routine['type'], $routine['name'], $GLOBALS['controllink'] - ); - if ($definition !== false) { - $parser = new SqlParser\Parser($definition); - - /** - * @var CreateStatement $stmt - */ - $stmt = $parser->statements[0]; - - $params = SqlParser\Utils\Routine::getParameters($stmt); - - if (PMA\libraries\Util::currentUserHasPrivilege('EXECUTE', $db)) { - $execute_action = 'execute_routine'; - for ($i = 0; $i < $params['num']; $i++) { - if ($routine['type'] == 'PROCEDURE' - && $params['dir'][$i] == 'OUT' - ) { - continue; - } - $execute_action = 'execute_dialog'; - break; - } - $retval .= ' ' . $titles['Execute'] . "\n"; - } else { - $retval .= " {$titles['NoExecute']}\n"; - } - } - - $retval .= " \n"; - if ((PMA\libraries\Util::currentUserHasPrivilege('CREATE ROUTINE', $db) - && $curr_user == $routine_definer) - || $GLOBALS['is_superuser'] - ) { - $retval .= ' ' . $titles['Export'] . "\n"; - } else { - $retval .= " {$titles['NoExport']}\n"; - } - $retval .= " \n"; - $retval .= ' ' . $titles['Drop'] . "\n"; - $retval .= " \n"; - $retval .= " {$routine['type']}\n"; - $retval .= " \n"; - $retval .= " " - . htmlspecialchars($routine['returns']) . "\n"; - $retval .= "
    \n"; - $retval .= ' '; - $retval .= " \n"; - $retval .= " " - . htmlspecialchars($trigger['drop']) . "\n"; - $retval .= " \n"; - $retval .= " " . htmlspecialchars($trigger['name']) . "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "" - . urlencode($trigger['table']) . ""; - $retval .= " \n"; - if (PMA\libraries\Util::currentUserHasPrivilege('TRIGGER', $db, $table)) { - $retval .= ' ' . $titles['Edit'] . "\n"; - } else { - $retval .= " {$titles['NoEdit']}\n"; - } - $retval .= " \n"; - $retval .= ' ' . $titles['Export'] . "\n"; - $retval .= " \n"; - if (PMA\libraries\Util::currentUserHasPrivilege('TRIGGER', $db)) { - $retval .= ' ' . $titles['Drop'] . "\n"; - } else { - $retval .= " {$titles['NoDrop']}\n"; - } - $retval .= " \n"; - $retval .= " {$trigger['action_timing']}\n"; - $retval .= " \n"; - $retval .= " {$trigger['event_manipulation']}\n"; - $retval .= "
    \n"; - $retval .= ' '; - $retval .= " \n"; - $retval .= " " - . htmlspecialchars($sql_drop) . "\n"; - $retval .= " \n"; - $retval .= " " - . htmlspecialchars($event['name']) . "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " {$event['status']}\n"; - $retval .= " \n"; - if (PMA\libraries\Util::currentUserHasPrivilege('EVENT', $db)) { - $retval .= ' ' . $titles['Edit'] . "\n"; - } else { - $retval .= " {$titles['NoEdit']}\n"; - } - $retval .= " \n"; - $retval .= ' ' . $titles['Export'] . "\n"; - $retval .= " \n"; - if (PMA\libraries\Util::currentUserHasPrivilege('EVENT', $db)) { - $retval .= ' ' . $titles['Drop'] . "\n"; - } else { - $retval .= " {$titles['NoDrop']}\n"; - } - $retval .= " \n"; - $retval .= " {$event['type']}\n"; - $retval .= "
    " - . "" - . "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " ---\n"; - $retval .= PMA_generateCharsetDropdownBox( - PMA_CSDROPDOWN_CHARSET, - "item_param_opts_text[$index]", - null, - $routine['item_param_opts_text'][$i] - ); - $retval .= " ---\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " {$titles['Drop']}\n"; - $retval .= " \n"; - $retval .= "
    \n"; - $retval .= "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= " \n"; - $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " "; - $retval .= " "; - $retval .= ""; - // parameter handling end - $retval .= ""; - $retval .= " "; - $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " "; - $retval .= " "; - $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " "; - $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " "; - $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " "; - $retval .= " "; - $retval .= ""; - if (isset($_REQUEST['edit_item']) - && ! empty($_REQUEST['edit_item']) - ) { - $retval .= ""; - $retval .= " "; - if ($GLOBALS['proc_priv'] - && $GLOBALS['is_reload_priv'] - ) { - $retval .= " "; - } else { - $retval .= " "; - } - $retval .= ""; - } - - $retval .= ""; - $retval .= " "; - $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " "; - $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " "; - $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " "; - $retval .= " "; - $retval .= ""; - $retval .= "
    " . __('Routine name') . "\n"; - $retval .= " \n"; - if ($GLOBALS['is_ajax_request']) { - $retval .= " \n"; - } else { - $retval .= "\n" - . "
    \n" - . $routine['item_type'] . "\n" - . "
    \n" - . "\n"; - } - $retval .= "
    " . __('Parameters') . "\n"; - // parameter handling start - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " "; - $retval .= " \n"; - $retval .= " \n"; - for ($i = 0; $i < $routine['item_num_params']; $i++) { // each parameter - $retval .= PMA_RTN_getParameterRow($routine, $i, $isprocedure_class); - } - $retval .= " \n"; - $retval .= "
    " - . __('Direction') . "" . __('Name') . "" . __('Type') . "" . __('Length/Values') . "" . __('Options') . " 
    "; - $retval .= "
     "; - $retval .= " "; - $retval .= " "; - $retval .= "
    " . __('Return type') . "
    " . __('Return length/values') . "---
    " . __('Return options') . "
    "; - $retval .= PMA_generateCharsetDropdownBox( - PMA_CSDROPDOWN_CHARSET, - "item_returnopts_text", - null, - $routine['item_returnopts_text'] - ); - $retval .= "
    "; - $retval .= "
    "; - $retval .= "
    ---
    "; - $retval .= "
    " . __('Definition') . "
    " . __('Is deterministic') . "
    " . __('Adjust privileges'); - $retval .= PMA\libraries\Util::showDocu('faq', 'faq6-39'); - $retval .= "
    " . __('Definer') . "
    " . __('Security type') . "
    " . __('SQL data access') . "
    " . __('Comment') . "
    "; - $retval .= "
    "; - if ($GLOBALS['is_ajax_request']) { - $retval .= ""; - $retval .= ""; - } - $retval .= ""; - $retval .= ""; - - return $retval; -} // end PMA_RTN_getEditorForm() - -/** - * Composes the query necessary to create a routine from an HTTP request. - * - * @return string The CREATE [ROUTINE | PROCEDURE] query. - */ -function PMA_RTN_getQueryFromRequest() -{ - global $_REQUEST, $errors, $param_sqldataaccess, $param_directions, $PMA_Types; - - $_REQUEST['item_type'] = isset($_REQUEST['item_type']) - ? $_REQUEST['item_type'] : ''; - - $query = 'CREATE '; - if (! empty($_REQUEST['item_definer'])) { - if (mb_strpos($_REQUEST['item_definer'], '@') !== false) { - $arr = explode('@', $_REQUEST['item_definer']); - - $do_backquote = true; - if (substr($arr[0], 0, 1) === "`" - && substr($arr[0], -1) === "`" - ) { - $do_backquote = false; - } - $query .= 'DEFINER=' . PMA\libraries\Util::backquote($arr[0], $do_backquote); - - $do_backquote = true; - if (substr($arr[1], 0, 1) === "`" - && substr($arr[1], -1) === "`" - ) { - $do_backquote = false; - } - $query .= '@' . PMA\libraries\Util::backquote($arr[1], $do_backquote) . ' '; - } else { - $errors[] = __('The definer must be in the "username@hostname" format!'); - } - } - if ($_REQUEST['item_type'] == 'FUNCTION' - || $_REQUEST['item_type'] == 'PROCEDURE' - ) { - $query .= $_REQUEST['item_type'] . ' '; - } else { - $errors[] = sprintf( - __('Invalid routine type: "%s"'), - htmlspecialchars($_REQUEST['item_type']) - ); - } - if (! empty($_REQUEST['item_name'])) { - $query .= PMA\libraries\Util::backquote($_REQUEST['item_name']); - } else { - $errors[] = __('You must provide a routine name!'); - } - $params = ''; - $warned_about_dir = false; - $warned_about_length = false; - - if (! empty($_REQUEST['item_param_name']) - && ! empty($_REQUEST['item_param_type']) - && ! empty($_REQUEST['item_param_length']) - && is_array($_REQUEST['item_param_name']) - && is_array($_REQUEST['item_param_type']) - && is_array($_REQUEST['item_param_length']) - ) { - $item_param_name = $_REQUEST['item_param_name']; - $item_param_type = $_REQUEST['item_param_type']; - $item_param_length = $_REQUEST['item_param_length']; - - for ($i=0, $nb = count($item_param_name); $i < $nb; $i++) { - if (! empty($item_param_name[$i]) - && ! empty($item_param_type[$i]) - ) { - if ($_REQUEST['item_type'] == 'PROCEDURE' - && ! empty($_REQUEST['item_param_dir'][$i]) - && in_array($_REQUEST['item_param_dir'][$i], $param_directions) - ) { - $params .= $_REQUEST['item_param_dir'][$i] . " " - . PMA\libraries\Util::backquote($item_param_name[$i]) - . " " . $item_param_type[$i]; - } else if ($_REQUEST['item_type'] == 'FUNCTION') { - $params .= PMA\libraries\Util::backquote($item_param_name[$i]) - . " " . $item_param_type[$i]; - } else if (! $warned_about_dir) { - $warned_about_dir = true; - $errors[] = sprintf( - __('Invalid direction "%s" given for parameter.'), - htmlspecialchars($_REQUEST['item_param_dir'][$i]) - ); - } - if ($item_param_length[$i] != '' - && !preg_match( - '@^(DATE|DATETIME|TIME|TINYBLOB|TINYTEXT|BLOB|TEXT|' - . 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|' - . 'SERIAL|BOOLEAN)$@i', - $item_param_type[$i] - ) - ) { - $params .= "(" . $item_param_length[$i] . ")"; - } else if ($item_param_length[$i] == '' - && preg_match( - '@^(ENUM|SET|VARCHAR|VARBINARY)$@i', - $item_param_type[$i] - ) - ) { - if (! $warned_about_length) { - $warned_about_length = true; - $errors[] = __( - 'You must provide length/values for routine parameters' - . ' of type ENUM, SET, VARCHAR and VARBINARY.' - ); - } - } - if (! empty($_REQUEST['item_param_opts_text'][$i])) { - if ($PMA_Types->getTypeClass($item_param_type[$i]) == 'CHAR') { - $params .= ' CHARSET ' - . mb_strtolower( - $_REQUEST['item_param_opts_text'][$i] - ); - } - } - if (! empty($_REQUEST['item_param_opts_num'][$i])) { - if ($PMA_Types->getTypeClass($item_param_type[$i]) == 'NUMBER') { - $params .= ' ' - . mb_strtoupper( - $_REQUEST['item_param_opts_num'][$i] - ); - } - } - if ($i != (count($item_param_name) - 1)) { - $params .= ", "; - } - } else { - $errors[] = __( - 'You must provide a name and a type for each routine parameter.' - ); - break; - } - } - } - $query .= "(" . $params . ") "; - if ($_REQUEST['item_type'] == 'FUNCTION') { - $item_returntype = isset($_REQUEST['item_returntype']) - ? $_REQUEST['item_returntype'] - : null; - - if (! empty($item_returntype) - && in_array( - $item_returntype, PMA\libraries\Util::getSupportedDatatypes() - ) - ) { - $query .= "RETURNS " . $item_returntype; - } else { - $errors[] = __('You must provide a valid return type for the routine.'); - } - if (! empty($_REQUEST['item_returnlength']) - && !preg_match( - '@^(DATE|DATETIME|TIME|TINYBLOB|TINYTEXT|BLOB|TEXT|' - . 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN)$@i', - $item_returntype - ) - ) { - $query .= "(" . $_REQUEST['item_returnlength'] . ")"; - } else if (empty($_REQUEST['item_returnlength']) - && preg_match( - '@^(ENUM|SET|VARCHAR|VARBINARY)$@i', $item_returntype - ) - ) { - if (! $warned_about_length) { - $errors[] = __( - 'You must provide length/values for routine parameters' - . ' of type ENUM, SET, VARCHAR and VARBINARY.' - ); - } - } - if (! empty($_REQUEST['item_returnopts_text'])) { - if ($PMA_Types->getTypeClass($item_returntype) == 'CHAR') { - $query .= ' CHARSET ' - . mb_strtolower($_REQUEST['item_returnopts_text']); - } - } - if (! empty($_REQUEST['item_returnopts_num'])) { - if ($PMA_Types->getTypeClass($item_returntype) == 'NUMBER') { - $query .= ' ' - . mb_strtoupper($_REQUEST['item_returnopts_num']); - } - } - $query .= ' '; - } - if (! empty($_REQUEST['item_comment'])) { - $query .= "COMMENT '" . $GLOBALS['dbi']->escapeString($_REQUEST['item_comment']) - . "' "; - } - if (isset($_REQUEST['item_isdeterministic'])) { - $query .= 'DETERMINISTIC '; - } else { - $query .= 'NOT DETERMINISTIC '; - } - if (! empty($_REQUEST['item_sqldataaccess']) - && in_array($_REQUEST['item_sqldataaccess'], $param_sqldataaccess) - ) { - $query .= $_REQUEST['item_sqldataaccess'] . ' '; - } - if (! empty($_REQUEST['item_securitytype'])) { - if ($_REQUEST['item_securitytype'] == 'DEFINER' - || $_REQUEST['item_securitytype'] == 'INVOKER' - ) { - $query .= 'SQL SECURITY ' . $_REQUEST['item_securitytype'] . ' '; - } - } - if (! empty($_REQUEST['item_definition'])) { - $query .= $_REQUEST['item_definition']; - } else { - $errors[] = __('You must provide a routine definition.'); - } - - return $query; -} // end PMA_RTN_getQueryFromRequest() - -/** - * Handles requests for executing a routine - * - * @return void - */ -function PMA_RTN_handleExecute() -{ - global $_GET, $_POST, $_REQUEST, $GLOBALS, $db; - - /** - * Handle all user requests other than the default of listing routines - */ - if (! empty($_REQUEST['execute_routine']) && ! empty($_REQUEST['item_name'])) { - // Build the queries - $routine = PMA_RTN_getDataFromName( - $_REQUEST['item_name'], $_REQUEST['item_type'], false, true - ); - if ($routine === false) { - $message = __('Error in processing request:') . ' '; - $message .= sprintf( - PMA_RTE_getWord('not_found'), - htmlspecialchars(PMA\libraries\Util::backquote($_REQUEST['item_name'])), - htmlspecialchars(PMA\libraries\Util::backquote($db)) - ); - $message = Message::error($message); - if ($GLOBALS['is_ajax_request']) { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus(false); - $response->addJSON('message', $message); - exit; - } else { - echo $message->getDisplay(); - unset($_POST); - } - } - - $queries = array(); - $end_query = array(); - $args = array(); - $all_functions = $GLOBALS['PMA_Types']->getAllFunctions(); - for ($i = 0; $i < $routine['item_num_params']; $i++) { - if (isset($_REQUEST['params'][$routine['item_param_name'][$i]])) { - $value = $_REQUEST['params'][$routine['item_param_name'][$i]]; - if (is_array($value)) { // is SET type - $value = implode(',', $value); - } - $value = $GLOBALS['dbi']->escapeString($value); - if (! empty($_REQUEST['funcs'][$routine['item_param_name'][$i]]) - && in_array( - $_REQUEST['funcs'][$routine['item_param_name'][$i]], - $all_functions - ) - ) { - $queries[] = "SET @p$i=" - . $_REQUEST['funcs'][$routine['item_param_name'][$i]] - . "('$value');\n"; - } else { - $queries[] = "SET @p$i='$value';\n"; - } - $args[] = "@p$i"; - } else { - $args[] = "@p$i"; - } - if ($routine['item_type'] == 'PROCEDURE') { - if ($routine['item_param_dir'][$i] == 'OUT' - || $routine['item_param_dir'][$i] == 'INOUT' - ) { - $end_query[] = "@p$i AS " - . PMA\libraries\Util::backquote($routine['item_param_name'][$i]); - } - } - } - if ($routine['item_type'] == 'PROCEDURE') { - $queries[] = "CALL " . PMA\libraries\Util::backquote($routine['item_name']) - . "(" . implode(', ', $args) . ");\n"; - if (count($end_query)) { - $queries[] = "SELECT " . implode(', ', $end_query) . ";\n"; - } - } else { - $queries[] = "SELECT " . PMA\libraries\Util::backquote($routine['item_name']) - . "(" . implode(', ', $args) . ") " - . "AS " . PMA\libraries\Util::backquote($routine['item_name']) - . ";\n"; - } - - // Get all the queries as one SQL statement - $multiple_query = implode("", $queries); - - $outcome = true; - $affected = 0; - - // Execute query - if (! $GLOBALS['dbi']->tryMultiQuery($multiple_query)) { - $outcome = false; - } - - // Generate output - if ($outcome) { - - // Pass the SQL queries through the "pretty printer" - $output = PMA\libraries\Util::formatSql(implode($queries, "\n")); - - // Display results - $output .= "
    "; - $output .= sprintf( - __('Execution results of routine %s'), - PMA\libraries\Util::backquote(htmlspecialchars($routine['item_name'])) - ); - $output .= ""; - - $nbResultsetToDisplay = 0; - - do { - - $result = $GLOBALS['dbi']->storeResult(); - $num_rows = $GLOBALS['dbi']->numRows($result); - - if (($result !== false) && ($num_rows > 0)) { - - $output .= ""; - foreach ($GLOBALS['dbi']->getFieldsMeta($result) as $field) { - $output .= ""; - } - $output .= ""; - - $color_class = 'odd'; - - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $output .= "" . browseRow($row, $color_class) . ""; - $color_class = ($color_class == 'odd') ? 'even' : 'odd'; - } - - $output .= "
    "; - $output .= htmlspecialchars($field->name); - $output .= "
    "; - $nbResultsetToDisplay++; - $affected = $num_rows; - - } - - if (! $GLOBALS['dbi']->moreResults()) { - break; - } - - $output .= "
    "; - - $GLOBALS['dbi']->freeResult($result); - - } while ($GLOBALS['dbi']->nextResult()); - - $output .= "
    "; - - $message = __('Your SQL query has been executed successfully.'); - if ($routine['item_type'] == 'PROCEDURE') { - $message .= '
    '; - - // TODO : message need to be modified according to the - // output from the routine - $message .= sprintf( - _ngettext( - '%d row affected by the last statement inside the ' - . 'procedure.', - '%d rows affected by the last statement inside the ' - . 'procedure.', - $affected - ), - $affected - ); - } - $message = Message::success($message); - - if ($nbResultsetToDisplay == 0) { - $notice = __( - 'MySQL returned an empty result set (i.e. zero rows).' - ); - $output .= Message::notice($notice)->getDisplay(); - } - - } else { - $output = ''; - $message = Message::error( - sprintf( - __('The following query has failed: "%s"'), - htmlspecialchars($multiple_query) - ) - . '

    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null) - ); - } - - // Print/send output - if ($GLOBALS['is_ajax_request']) { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus($message->isSuccess()); - $response->addJSON('message', $message->getDisplay() . $output); - $response->addJSON('dialog', false); - exit; - } else { - echo $message->getDisplay() , $output; - if ($message->isError()) { - // At least one query has failed, so shouldn't - // execute any more queries, so we quit. - exit; - } - unset($_POST); - // Now deliberately fall through to displaying the routines list - } - return; - } else if (! empty($_GET['execute_dialog']) && ! empty($_GET['item_name'])) { - /** - * Display the execute form for a routine. - */ - $routine = PMA_RTN_getDataFromName( - $_GET['item_name'], $_GET['item_type'], true, true - ); - if ($routine !== false) { - $form = PMA_RTN_getExecuteForm($routine); - if ($GLOBALS['is_ajax_request'] == true) { - $title = __("Execute routine") . " " . PMA\libraries\Util::backquote( - htmlentities($_GET['item_name'], ENT_QUOTES) - ); - $response = PMA\libraries\Response::getInstance(); - $response->addJSON('message', $form); - $response->addJSON('title', $title); - $response->addJSON('dialog', true); - } else { - echo "\n\n

    " . __("Execute routine") . "

    \n\n"; - echo $form; - } - exit; - } else if (($GLOBALS['is_ajax_request'] == true)) { - $message = __('Error in processing request:') . ' '; - $message .= sprintf( - PMA_RTE_getWord('not_found'), - htmlspecialchars(PMA\libraries\Util::backquote($_REQUEST['item_name'])), - htmlspecialchars(PMA\libraries\Util::backquote($db)) - ); - $message = Message::error($message); - - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus(false); - $response->addJSON('message', $message); - exit; - } - } -} - -/** - * Browse row array - * - * @param array $row Columns - * @param string $color_class CSS class - * - * @return string - */ -function browseRow($row, $color_class) -{ - $output = null; - foreach ($row as $value) { - if ($value === null) { - $value = 'NULL'; - } else { - $value = htmlspecialchars($value); - } - $output .= "" . $value . ""; - } - return $output; -} - -/** - * Creates the HTML code that shows the routine execution dialog. - * - * @param array $routine Data for the routine returned by - * PMA_RTN_getDataFromName() - * - * @return string HTML code for the routine execution dialog. - */ -function PMA_RTN_getExecuteForm($routine) -{ - global $db, $cfg; - - // Escape special characters - $routine['item_name'] = htmlentities($routine['item_name'], ENT_QUOTES); - for ($i = 0; $i < $routine['item_num_params']; $i++) { - $routine['item_param_name'][$i] = htmlentities( - $routine['item_param_name'][$i], - ENT_QUOTES - ); - } - - // Create the output - $retval = ""; - $retval .= "\n\n"; - $retval .= "
    \n"; - $retval .= "\n"; - } - $retval .= "\n"; - $retval .= "\n"; - $retval .= "\n"; - if ($cfg['ShowFunctionFields']) { - $retval .= "\n"; - } - $retval .= "\n"; - $retval .= "\n"; - // Get a list of data types that are not yet supported. - $no_support_types = PMA\libraries\Util::unsupportedDatatypes(); - for ($i = 0; $i < $routine['item_num_params']; $i++) { // Each parameter - if ($routine['item_type'] == 'PROCEDURE' - && $routine['item_param_dir'][$i] == 'OUT' - ) { - continue; - } - $rowclass = ($i % 2 == 0) ? 'even' : 'odd'; - $retval .= "\n\n"; - $retval .= "\n"; - $retval .= "\n"; - if ($cfg['ShowFunctionFields']) { - $retval .= "\n"; - } - // Append a class to date/time fields so that - // jQuery can attach a datepicker to them - $class = ''; - if ($routine['item_param_type'][$i] == 'DATETIME' - || $routine['item_param_type'][$i] == 'TIMESTAMP' - ) { - $class = 'datetimefield'; - } else if ($routine['item_param_type'][$i] == 'DATE') { - $class = 'datefield'; - } - $retval .= "\n"; - $retval .= "\n"; - } - $retval .= "\n
    " . __('Name') . "" . __('Type') . "" . __('Function') . "" . __('Value') . "
    {$routine['item_param_name'][$i]}{$routine['item_param_type'][$i]}\n"; - if (stristr($routine['item_param_type'][$i], 'enum') - || stristr($routine['item_param_type'][$i], 'set') - || in_array( - mb_strtolower($routine['item_param_type'][$i]), - $no_support_types - ) - ) { - $retval .= "--\n"; - } else { - $field = array( - 'True_Type' => mb_strtolower( - $routine['item_param_type'][$i] - ), - 'Type' => '', - 'Key' => '', - 'Field' => '', - 'Default' => '', - 'first_timestamp' => false - ); - $retval .= ""; - } - $retval .= "\n"; - if (in_array($routine['item_param_type'][$i], array('ENUM', 'SET'))) { - if ($routine['item_param_type'][$i] == 'ENUM') { - $input_type = 'radio'; - } else { - $input_type = 'checkbox'; - } - foreach ($routine['item_param_length_arr'][$i] as $value) { - $value = htmlentities(PMA\libraries\Util::unquote($value), ENT_QUOTES); - $retval .= "" - . $value . "
    \n"; - } - } else if (in_array( - mb_strtolower($routine['item_param_type'][$i]), - $no_support_types - )) { - $retval .= "\n"; - } else { - $retval .= "\n"; - } - $retval .= "
    \n"; - if ($GLOBALS['is_ajax_request'] != true) { - $retval .= "\n\n"; - $retval .= "
    \n"; - $retval .= " \n"; - $retval .= "
    \n"; - } else { - $retval .= ""; - $retval .= ""; - } - $retval .= "
    \n\n"; - $retval .= "\n\n"; - - return $retval; -} // end PMA_RTN_getExecuteForm() - diff --git a/#pma/libraries/rte/rte_triggers.lib.php b/#pma/libraries/rte/rte_triggers.lib.php deleted file mode 100644 index c28aab88..00000000 --- a/#pma/libraries/rte/rte_triggers.lib.php +++ /dev/null @@ -1,464 +0,0 @@ -getTriggers($db, $table); - echo PMA_RTE_getList('trigger', $items); - /** - * Display a link for adding a new trigger, - * if the user has the necessary privileges - */ - echo PMA_TRI_getFooterLinks(); -} // end PMA_TRI_main() - -/** - * Handles editor requests for adding or editing an item - * - * @return void - */ -function PMA_TRI_handleEditor() -{ - global $_REQUEST, $_POST, $errors, $db, $table; - - if (! empty($_REQUEST['editor_process_add']) - || ! empty($_REQUEST['editor_process_edit']) - ) { - $sql_query = ''; - - $item_query = PMA_TRI_getQueryFromRequest(); - - if (! count($errors)) { // set by PMA_RTN_getQueryFromRequest() - // Execute the created query - if (! empty($_REQUEST['editor_process_edit'])) { - // Backup the old trigger, in case something goes wrong - $trigger = PMA_TRI_getDataFromName($_REQUEST['item_original_name']); - $create_item = $trigger['create']; - $drop_item = $trigger['drop'] . ';'; - $result = $GLOBALS['dbi']->tryQuery($drop_item); - if (! $result) { - $errors[] = sprintf( - __('The following query has failed: "%s"'), - htmlspecialchars($drop_item) - ) - . '
    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); - } else { - $result = $GLOBALS['dbi']->tryQuery($item_query); - if (! $result) { - $errors[] = sprintf( - __('The following query has failed: "%s"'), - htmlspecialchars($item_query) - ) - . '
    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); - // We dropped the old item, but were unable to create the - // new one. Try to restore the backup query. - $result = $GLOBALS['dbi']->tryQuery($create_item); - - $errors = checkResult( - $result, - __( - 'Sorry, we failed to restore the dropped trigger.' - ), - $create_item, - $errors - ); - } else { - $message = PMA\libraries\Message::success( - __('Trigger %1$s has been modified.') - ); - $message->addParam( - PMA\libraries\Util::backquote($_REQUEST['item_name']) - ); - $sql_query = $drop_item . $item_query; - } - } - } else { - // 'Add a new item' mode - $result = $GLOBALS['dbi']->tryQuery($item_query); - if (! $result) { - $errors[] = sprintf( - __('The following query has failed: "%s"'), - htmlspecialchars($item_query) - ) - . '

    ' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); - } else { - $message = PMA\libraries\Message::success( - __('Trigger %1$s has been created.') - ); - $message->addParam( - PMA\libraries\Util::backquote($_REQUEST['item_name']) - ); - $sql_query = $item_query; - } - } - } - - if (count($errors)) { - $message = PMA\libraries\Message::error( - '' - . __( - 'One or more errors have occurred while processing your request:' - ) - . '' - ); - $message->addString('
      '); - foreach ($errors as $string) { - $message->addString('
    • ' . $string . '
    • '); - } - $message->addString('
    '); - } - - $output = PMA\libraries\Util::getMessage($message, $sql_query); - if ($GLOBALS['is_ajax_request']) { - $response = PMA\libraries\Response::getInstance(); - if ($message->isSuccess()) { - $items = $GLOBALS['dbi']->getTriggers($db, $table, ''); - $trigger = false; - foreach ($items as $value) { - if ($value['name'] == $_REQUEST['item_name']) { - $trigger = $value; - } - } - $insert = false; - if (empty($table) - || ($trigger !== false && $table == $trigger['table']) - ) { - $insert = true; - $response->addJSON('new_row', PMA_TRI_getRowForList($trigger)); - $response->addJSON( - 'name', - htmlspecialchars( - mb_strtoupper( - $_REQUEST['item_name'] - ) - ) - ); - } - $response->addJSON('insert', $insert); - $response->addJSON('message', $output); - } else { - $response->addJSON('message', $message); - $response->setRequestStatus(false); - } - exit; - } - } - - /** - * Display a form used to add/edit a trigger, if necessary - */ - if (count($errors) - || (empty($_REQUEST['editor_process_add']) - && empty($_REQUEST['editor_process_edit']) - && (! empty($_REQUEST['add_item']) - || ! empty($_REQUEST['edit_item']))) // FIXME: this must be simpler than that - ) { - // Get the data for the form (if any) - if (! empty($_REQUEST['add_item'])) { - $title = PMA_RTE_getWord('add'); - $item = PMA_TRI_getDataFromRequest(); - $mode = 'add'; - } else if (! empty($_REQUEST['edit_item'])) { - $title = __("Edit trigger"); - if (! empty($_REQUEST['item_name']) - && empty($_REQUEST['editor_process_edit']) - ) { - $item = PMA_TRI_getDataFromName($_REQUEST['item_name']); - if ($item !== false) { - $item['item_original_name'] = $item['item_name']; - } - } else { - $item = PMA_TRI_getDataFromRequest(); - } - $mode = 'edit'; - } - PMA_RTE_sendEditor('TRI', $mode, $item, $title, $db); - } -} // end PMA_TRI_handleEditor() - -/** - * This function will generate the values that are required to for the editor - * - * @return array Data necessary to create the editor. - */ -function PMA_TRI_getDataFromRequest() -{ - $retval = array(); - $indices = array('item_name', - 'item_table', - 'item_original_name', - 'item_action_timing', - 'item_event_manipulation', - 'item_definition', - 'item_definer'); - foreach ($indices as $index) { - $retval[$index] = isset($_REQUEST[$index]) ? $_REQUEST[$index] : ''; - } - return $retval; -} // end PMA_TRI_getDataFromRequest() - -/** - * This function will generate the values that are required to complete - * the "Edit trigger" form given the name of a trigger. - * - * @param string $name The name of the trigger. - * - * @return array Data necessary to create the editor. - */ -function PMA_TRI_getDataFromName($name) -{ - global $db, $table, $_REQUEST; - - $temp = array(); - $items = $GLOBALS['dbi']->getTriggers($db, $table, ''); - foreach ($items as $value) { - if ($value['name'] == $name) { - $temp = $value; - } - } - if (empty($temp)) { - return false; - } else { - $retval = array(); - $retval['create'] = $temp['create']; - $retval['drop'] = $temp['drop']; - $retval['item_name'] = $temp['name']; - $retval['item_table'] = $temp['table']; - $retval['item_action_timing'] = $temp['action_timing']; - $retval['item_event_manipulation'] = $temp['event_manipulation']; - $retval['item_definition'] = $temp['definition']; - $retval['item_definer'] = $temp['definer']; - return $retval; - } -} // end PMA_TRI_getDataFromName() - -/** - * Displays a form used to add/edit a trigger - * - * @param string $mode If the editor will be used to edit a trigger - * or add a new one: 'edit' or 'add'. - * @param array $item Data for the trigger returned by PMA_TRI_getDataFromRequest() - * or PMA_TRI_getDataFromName() - * - * @return string HTML code for the editor. - */ -function PMA_TRI_getEditorForm($mode, $item) -{ - global $db, $table, $event_manipulations, $action_timings; - - $modeToUpper = mb_strtoupper($mode); - - // Escape special characters - $need_escape = array( - 'item_original_name', - 'item_name', - 'item_definition', - 'item_definer' - ); - foreach ($need_escape as $key => $index) { - $item[$index] = htmlentities($item[$index], ENT_QUOTES, 'UTF-8'); - } - $original_data = ''; - if ($mode == 'edit') { - $original_data = "\n"; - } - $query = "SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`TABLES` "; - $query .= "WHERE `TABLE_SCHEMA`='" . $GLOBALS['dbi']->escapeString($db) . "' "; - $query .= "AND `TABLE_TYPE`='BASE TABLE'"; - $tables = $GLOBALS['dbi']->fetchResult($query); - - // Create the output - $retval = ""; - $retval .= "\n\n"; - $retval .= "
    \n"; - $retval .= "\n"; - $retval .= $original_data; - $retval .= PMA_URL_getHiddenInputs($db, $table) . "\n"; - $retval .= "
    \n"; - $retval .= "" . __('Details') . "\n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "\n"; - $retval .= "\n"; - $retval .= " \n"; - $retval .= " '; - - $html_output .= ''; - - $html_output .= '' - . '' - . '' - . '' - . ''; - $current_user = $row['User']; - $current_host = $row['Host']; - $routine = $row['Routine_name']; - $html_output .= ''; - - $html_output .= ''; - $odd_row = !$odd_row; - - } - return $html_output; -} - -/** - * Get the HTML for user form and check the privileges for a particular database. - * - * @param string $db database name - * - * @return string $html_output - */ -function PMA_getHtmlForSpecificDbPrivileges($db) -{ - $html_output = ''; - if ($GLOBALS['is_superuser']) { - // check the privileges for a particular database. - $html_output = ''; - $html_output .= PMA_URL_getHiddenInputs($db); - $html_output .= '
    '; - $html_output .= '' . "\n" - . Util::getIcon('b_usrcheck.png') - . ' ' - . sprintf( - __('Users having access to "%s"'), - '' - . htmlspecialchars($db) - . '' - ) - . "\n" - . '' . "\n"; - - $html_output .= '
    " . __('Trigger name') . "\n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= "
    " . _pgettext('Trigger action time', 'Time') . "
    " . __('Event') . "
    " . __('Definition') . "
    " . __('Definer') . "\n"; - $retval .= "\n"; - } - $retval .= "\n\n"; - $retval .= "\n\n"; - - return $retval; -} // end PMA_TRI_getEditorForm() - -/** - * Composes the query necessary to create a trigger from an HTTP request. - * - * @return string The CREATE TRIGGER query. - */ -function PMA_TRI_getQueryFromRequest() -{ - global $_REQUEST, $db, $errors, $action_timings, $event_manipulations; - - $query = 'CREATE '; - if (! empty($_REQUEST['item_definer'])) { - if (mb_strpos($_REQUEST['item_definer'], '@') !== false - ) { - $arr = explode('@', $_REQUEST['item_definer']); - $query .= 'DEFINER=' . PMA\libraries\Util::backquote($arr[0]); - $query .= '@' . PMA\libraries\Util::backquote($arr[1]) . ' '; - } else { - $errors[] = __('The definer must be in the "username@hostname" format!'); - } - } - $query .= 'TRIGGER '; - if (! empty($_REQUEST['item_name'])) { - $query .= PMA\libraries\Util::backquote($_REQUEST['item_name']) . ' '; - } else { - $errors[] = __('You must provide a trigger name!'); - } - if (! empty($_REQUEST['item_timing']) - && in_array($_REQUEST['item_timing'], $action_timings) - ) { - $query .= $_REQUEST['item_timing'] . ' '; - } else { - $errors[] = __('You must provide a valid timing for the trigger!'); - } - if (! empty($_REQUEST['item_event']) - && in_array($_REQUEST['item_event'], $event_manipulations) - ) { - $query .= $_REQUEST['item_event'] . ' '; - } else { - $errors[] = __('You must provide a valid event for the trigger!'); - } - $query .= 'ON '; - if (! empty($_REQUEST['item_table']) - && in_array($_REQUEST['item_table'], $GLOBALS['dbi']->getTables($db)) - ) { - $query .= PMA\libraries\Util::backquote($_REQUEST['item_table']); - } else { - $errors[] = __('You must provide a valid table name!'); - } - $query .= ' FOR EACH ROW '; - if (! empty($_REQUEST['item_definition'])) { - $query .= $_REQUEST['item_definition']; - } else { - $errors[] = __('You must provide a trigger definition.'); - } - - return $query; -} // end PMA_TRI_getQueryFromRequest() - diff --git a/#pma/libraries/rte/rte_words.lib.php b/#pma/libraries/rte/rte_words.lib.php deleted file mode 100644 index 95fc5a10..00000000 --- a/#pma/libraries/rte/rte_words.lib.php +++ /dev/null @@ -1,82 +0,0 @@ - __('Add routine'), - 'docu' => 'STORED_ROUTINES', - 'export' => __('Export of routine %s'), - 'human' => __('routine'), - 'no_create' => __( - 'You do not have the necessary privileges to create a routine.' - ), - 'no_edit' => __( - 'No routine with name %1$s found in database %2$s. ' - . 'You might be lacking the necessary privileges to edit this routine.' - ), - 'no_view' => __( - 'No routine with name %1$s found in database %2$s. ' - . 'You might be lacking the necessary privileges to view/export this routine.' - ), - 'not_found' => __('No routine with name %1$s found in database %2$s.'), - 'nothing' => __('There are no routines to display.'), - 'title' => __('Routines'), - ); - break; - case 'TRI': - $words = array( - 'add' => __('Add trigger'), - 'docu' => 'TRIGGERS', - 'export' => __('Export of trigger %s'), - 'human' => __('trigger'), - 'no_create' => __( - 'You do not have the necessary privileges to create a trigger.' - ), - 'not_found' => __('No trigger with name %1$s found in database %2$s.'), - 'nothing' => __('There are no triggers to display.'), - 'title' => __('Triggers'), - ); - break; - case 'EVN': - $words = array( - 'add' => __('Add event'), - 'docu' => 'EVENTS', - 'export' => __('Export of event %s'), - 'human' => __('event'), - 'no_create' => __( - 'You do not have the necessary privileges to create an event.' - ), - 'not_found' => __('No event with name %1$s found in database %2$s.'), - 'nothing' => __('There are no events to display.'), - 'title' => __('Events'), - ); - break; - default: - $words = array(); - break; - } - - return isset($words[$index]) ? $words[$index] : ''; -} // end PMA_RTE_getWord() - diff --git a/#pma/libraries/sanitizing.lib.php b/#pma/libraries/sanitizing.lib.php deleted file mode 100644 index e5c1c42e..00000000 --- a/#pma/libraries/sanitizing.lib.php +++ /dev/null @@ -1,233 +0,0 @@ - $value) { - if (substr($value, 0, 2) === './') { - $valid_starts[$key] = '.' . $value; - } - } - } - if ($other) { - $valid_starts[] = 'mailto:'; - $valid_starts[] = 'ftp://'; - } - if ($http) { - $valid_starts[] = 'http://'; - } - if (defined('PMA_SETUP')) { - $valid_starts[] = '?page=form&'; - $valid_starts[] = '?page=servers&'; - } - foreach ($valid_starts as $val) { - if (substr($url, 0, strlen($val)) == $val) { - return true; - } - } - return false; -} - -/** - * Callback function for replacing [a@link@target] links in bb code. - * - * @param array $found Array of preg matches - * - * @return string Replaced string - */ -function PMA_replaceBBLink($found) -{ - /* Check for valid link */ - if (! PMA_checkLink($found[1])) { - return $found[0]; - } - /* a-z and _ allowed in target */ - if (! empty($found[3]) && preg_match('/[^a-z_]+/i', $found[3])) { - return $found[0]; - } - - /* Construct target */ - $target = ''; - if (! empty($found[3])) { - $target = ' target="' . $found[3] . '"'; - if ($found[3] == '_blank') { - $target .= ' rel="noopener noreferrer"'; - } - } - - /* Construct url */ - if (substr($found[1], 0, 4) == 'http') { - $url = PMA_linkURL($found[1]); - } else { - $url = $found[1]; - } - - return ''; -} - -/** - * Callback function for replacing [doc@anchor] links in bb code. - * - * @param array $found Array of preg matches - * - * @return string Replaced string - */ -function PMA_replaceDocLink($found) -{ - if (count($found) >= 4) { - $page = $found[1]; - $anchor = $found[3]; - } else { - $anchor = $found[1]; - if (strncmp('faq', $anchor, 3) == 0) { - $page = 'faq'; - } else if (strncmp('cfg', $anchor, 3) == 0) { - $page = 'config'; - } else { - /* Guess */ - $page = 'setup'; - } - } - $link = PMA\libraries\Util::getDocuLink($page, $anchor); - return ''; -} - -/** - * Sanitizes $message, taking into account our special codes - * for formatting. - * - * If you want to include result in element attribute, you should escape it. - * - * Examples: - * - *

    - * - *
    bar - * - * @param string $message the message - * @param boolean $escape whether to escape html in result - * @param boolean $safe whether string is safe (can keep < and > chars) - * - * @return string the sanitized message - */ -function PMA_sanitize($message, $escape = false, $safe = false) -{ - if (!$safe) { - $message = strtr($message, array('<' => '<', '>' => '>')); - } - - /* Interpret bb code */ - $replace_pairs = array( - '[em]' => '', - '[/em]' => '', - '[strong]' => '', - '[/strong]' => '', - '[code]' => '', - '[/code]' => '', - '[kbd]' => '', - '[/kbd]' => '', - '[br]' => '
    ', - '[/a]' => '', - '[/doc]' => '', - '[sup]' => '', - '[/sup]' => '', - // used in common.inc.php: - '[conferr]' => '', - // used in libraries/Util.php - '[dochelpicon]' => PMA\libraries\Util::getImage('b_help.png', __('Documentation')), - ); - - $message = strtr($message, $replace_pairs); - - /* Match links in bb code ([a@url@target], where @target is options) */ - $pattern = '/\[a@([^]"@]*)(@([^]"]*))?\]/'; - - /* Find and replace all links */ - $message = preg_replace_callback($pattern, 'PMA_replaceBBLink', $message); - - /* Replace documentation links */ - $message = preg_replace_callback( - '/\[doc@([a-zA-Z0-9_-]+)(@([a-zA-Z0-9_-]*))?\]/', - 'PMA_replaceDocLink', - $message - ); - - /* Possibly escape result */ - if ($escape) { - $message = htmlspecialchars($message); - } - - return $message; -} - - -/** - * Sanitize a filename by removing anything besides legit characters - * - * Intended usecase: - * When using a filename in a Content-Disposition header - * the value should not contain ; or " - * - * When exporting, avoiding generation of an unexpected double-extension file - * - * @param string $filename The filename - * @param boolean $replaceDots Whether to also replace dots - * - * @return string the sanitized filename - * - */ -function PMA_sanitizeFilename($filename, $replaceDots = false) -{ - $pattern = '/[^A-Za-z0-9_'; - // if we don't have to replace dots - if (! $replaceDots) { - // then add the dot to the list of legit characters - $pattern .= '.'; - } - $pattern .= '-]/'; - $filename = preg_replace($pattern, '_', $filename); - return $filename; -} - diff --git a/#pma/libraries/select_server.lib.php b/#pma/libraries/select_server.lib.php deleted file mode 100644 index 63e1a690..00000000 --- a/#pma/libraries/select_server.lib.php +++ /dev/null @@ -1,111 +0,0 @@ -'; - - if (! $omit_fieldset) { - $retval .= '
    '; - } - $retval .= ' '; - - $retval .= ''; - if (! $omit_fieldset) { - $retval .= '
    '; - } - $retval .= ''; - } elseif ($list) { - $retval .= ''; - } - - return $retval; -} diff --git a/#pma/libraries/server_common.inc.php b/#pma/libraries/server_common.inc.php deleted file mode 100644 index 8661fb2f..00000000 --- a/#pma/libraries/server_common.inc.php +++ /dev/null @@ -1,52 +0,0 @@ - $db)); - -/** - * Defines the urls to return to in case of error in a sql statement - */ -$err_url = 'index.php' . $GLOBALS['url_query']; - -/** - * @global boolean Checks for superuser privileges - */ -$GLOBALS['is_superuser'] = $GLOBALS['dbi']->isSuperuser(); -$GLOBALS['is_grantuser'] = $GLOBALS['dbi']->isUserType('grant'); -$GLOBALS['is_createuser'] = $GLOBALS['dbi']->isUserType('create'); - -// now, select the mysql db -if ($GLOBALS['is_superuser']) { - $GLOBALS['dbi']->selectDb('mysql', $GLOBALS['userlink']); -} - -PMA\libraries\Util::checkParameters( - array('is_superuser', 'url_query'), false -); - -/** - * shared functions for server page - */ -require_once './libraries/server_common.lib.php'; - diff --git a/#pma/libraries/server_common.lib.php b/#pma/libraries/server_common.lib.php deleted file mode 100644 index 7e3a2ca9..00000000 --- a/#pma/libraries/server_common.lib.php +++ /dev/null @@ -1,63 +0,0 @@ -' . "\n" - . PMA\libraries\Util::getImage($header[$type]['image']) - . ' ' . $header[$type]['text'] . "\n" - . $link . '' . "\n"; - } else { - $html = '

    ' . "\n" - . PMA\libraries\Util::getIcon($header[$type]['image']) - . ' ' . $header[$type]['text'] . "\n" - . $link . '

    ' . "\n"; - } - return $html; -} - diff --git a/#pma/libraries/server_privileges.lib.php b/#pma/libraries/server_privileges.lib.php deleted file mode 100644 index c328dd49..00000000 --- a/#pma/libraries/server_privileges.lib.php +++ /dev/null @@ -1,5485 +0,0 @@ -addJSON('message', $dialog); - exit; - } else { - $html .= $dialog; - } - } - - return $html; -} - -/** - * Escapes wildcard in a database+table specification - * before using it in a GRANT statement. - * - * Escaping a wildcard character in a GRANT is only accepted at the global - * or database level, not at table level; this is why I remove - * the escaping character. Internally, in mysql.tables_priv.Db there are - * no escaping (for example test_db) but in mysql.db you'll see test\_db - * for a db-specific privilege. - * - * @param string $dbname Database name - * @param string $tablename Table name - * - * @return string the escaped (if necessary) database.table - */ -function PMA_wildcardEscapeForGrant($dbname, $tablename) -{ - if (!mb_strlen($dbname)) { - $db_and_table = '*.*'; - } else { - if (mb_strlen($tablename)) { - $db_and_table = Util::backquote( - Util::unescapeMysqlWildcards($dbname) - ) - . '.' . Util::backquote($tablename); - } else { - $db_and_table = Util::backquote($dbname) . '.*'; - } - } - return $db_and_table; -} - -/** - * Generates a condition on the user name - * - * @param string $initial the user's initial - * - * @return string the generated condition - */ -function PMA_rangeOfUsers($initial = '') -{ - // strtolower() is used because the User field - // might be BINARY, so LIKE would be case sensitive - if ($initial === null || $initial === '') { - return ''; - } - - $ret = " WHERE `User` LIKE '" - . $GLOBALS['dbi']->escapeString($initial) . "%'" - . " OR `User` LIKE '" - . $GLOBALS['dbi']->escapeString(mb_strtolower($initial)) - . "%'"; - return $ret; -} // end function - -/** - * Formats privilege name for a display - * - * @param array $privilege Privilege information - * @param boolean $html Whether to use HTML - * - * @return string - */ -function PMA_formatPrivilege($privilege, $html) -{ - if ($html) { - return '' - . $privilege[1] . ''; - } else { - return $privilege[1]; - } -} - -/** - * Parses privileges into an array, it modifies the array - * - * @param array &$row Results row from - * - * @return void - */ -function PMA_fillInTablePrivileges(&$row) -{ - $row1 = $GLOBALS['dbi']->fetchSingleRow( - 'SHOW COLUMNS FROM `mysql`.`tables_priv` LIKE \'Table_priv\';', - 'ASSOC', $GLOBALS['userlink'] - ); - // note: in MySQL 5.0.3 we get "Create View', 'Show view'; - // the View for Create is spelled with uppercase V - // the view for Show is spelled with lowercase v - // and there is a space between the words - - $av_grants = explode( - '\',\'', - mb_substr( - $row1['Type'], - mb_strpos($row1['Type'], '(') + 2, - mb_strpos($row1['Type'], ')') - - mb_strpos($row1['Type'], '(') - 3 - ) - ); - - $users_grants = explode(',', $row['Table_priv']); - - foreach ($av_grants as $current_grant) { - $row[$current_grant . '_priv'] - = in_array($current_grant, $users_grants) ? 'Y' : 'N'; - } - unset($row['Table_priv']); -} - - -/** - * Extracts the privilege information of a priv table row - * - * @param array|null $row the row - * @param boolean $enableHTML add tag with tooltips - * @param boolean $tablePrivs whether row contains table privileges - * - * @global resource $user_link the database connection - * - * @return array - */ -function PMA_extractPrivInfo($row = null, $enableHTML = false, $tablePrivs = false) -{ - if ($tablePrivs) { - $grants = PMA_getTableGrantsArray(); - } else { - $grants = PMA_getGrantsArray(); - } - - if (! is_null($row) && isset($row['Table_priv'])) { - PMA_fillInTablePrivileges($row); - } - - $privs = array(); - $allPrivileges = true; - foreach ($grants as $current_grant) { - if ((! is_null($row) && isset($row[$current_grant[0]])) - || (is_null($row) && isset($GLOBALS[$current_grant[0]])) - ) { - if ((! is_null($row) && $row[$current_grant[0]] == 'Y') - || (is_null($row) - && ($GLOBALS[$current_grant[0]] == 'Y' - || (is_array($GLOBALS[$current_grant[0]]) - && count($GLOBALS[$current_grant[0]]) == $_REQUEST['column_count'] - && empty($GLOBALS[$current_grant[0] . '_none'])))) - ) { - $privs[] = PMA_formatPrivilege($current_grant, $enableHTML); - } elseif (! empty($GLOBALS[$current_grant[0]]) - && is_array($GLOBALS[$current_grant[0]]) - && empty($GLOBALS[$current_grant[0] . '_none']) - ) { - // Required for proper escaping of ` (backtick) in a column name - $grant_cols = array_map( - function($val) { - return Util::backquote($val); - }, - $GLOBALS[$current_grant[0]] - ); - - $privs[] = PMA_formatPrivilege($current_grant, $enableHTML) - . ' (' . join(', ', $grant_cols) . ')'; - } else { - $allPrivileges = false; - } - } - } - if (empty($privs)) { - if ($enableHTML) { - $privs[] = 'USAGE'; - } else { - $privs[] = 'USAGE'; - } - } elseif ($allPrivileges - && (! isset($_POST['grant_count']) || count($privs) == $_POST['grant_count']) - ) { - if ($enableHTML) { - $privs = array('ALL PRIVILEGES' - ); - } else { - $privs = array('ALL PRIVILEGES'); - } - } - return $privs; -} // end of the 'PMA_extractPrivInfo()' function - -/** - * Returns an array of table grants and their descriptions - * - * @return array array of table grants - */ -function PMA_getTableGrantsArray() -{ - return array( - array( - 'Delete', - 'DELETE', - $GLOBALS['strPrivDescDelete'] - ), - array( - 'Create', - 'CREATE', - $GLOBALS['strPrivDescCreateTbl'] - ), - array( - 'Drop', - 'DROP', - $GLOBALS['strPrivDescDropTbl'] - ), - array( - 'Index', - 'INDEX', - $GLOBALS['strPrivDescIndex'] - ), - array( - 'Alter', - 'ALTER', - $GLOBALS['strPrivDescAlter'] - ), - array( - 'Create View', - 'CREATE_VIEW', - $GLOBALS['strPrivDescCreateView'] - ), - array( - 'Show view', - 'SHOW_VIEW', - $GLOBALS['strPrivDescShowView'] - ), - array( - 'Trigger', - 'TRIGGER', - $GLOBALS['strPrivDescTrigger'] - ), - ); -} - -/** - * Get the grants array which contains all the privilege types - * and relevant grant messages - * - * @return array - */ -function PMA_getGrantsArray() -{ - return array( - array( - 'Select_priv', - 'SELECT', - __('Allows reading data.') - ), - array( - 'Insert_priv', - 'INSERT', - __('Allows inserting and replacing data.') - ), - array( - 'Update_priv', - 'UPDATE', - __('Allows changing data.') - ), - array( - 'Delete_priv', - 'DELETE', - __('Allows deleting data.') - ), - array( - 'Create_priv', - 'CREATE', - __('Allows creating new databases and tables.') - ), - array( - 'Drop_priv', - 'DROP', - __('Allows dropping databases and tables.') - ), - array( - 'Reload_priv', - 'RELOAD', - __('Allows reloading server settings and flushing the server\'s caches.') - ), - array( - 'Shutdown_priv', - 'SHUTDOWN', - __('Allows shutting down the server.') - ), - array( - 'Process_priv', - 'PROCESS', - __('Allows viewing processes of all users.') - ), - array( - 'File_priv', - 'FILE', - __('Allows importing data from and exporting data into files.') - ), - array( - 'References_priv', - 'REFERENCES', - __('Has no effect in this MySQL version.') - ), - array( - 'Index_priv', - 'INDEX', - __('Allows creating and dropping indexes.') - ), - array( - 'Alter_priv', - 'ALTER', - __('Allows altering the structure of existing tables.') - ), - array( - 'Show_db_priv', - 'SHOW DATABASES', - __('Gives access to the complete list of databases.') - ), - array( - 'Super_priv', - 'SUPER', - __( - 'Allows connecting, even if maximum number of connections ' - . 'is reached; required for most administrative operations ' - . 'like setting global variables or killing threads of other users.' - ) - ), - array( - 'Create_tmp_table_priv', - 'CREATE TEMPORARY TABLES', - __('Allows creating temporary tables.') - ), - array( - 'Lock_tables_priv', - 'LOCK TABLES', - __('Allows locking tables for the current thread.') - ), - array( - 'Repl_slave_priv', - 'REPLICATION SLAVE', - __('Needed for the replication slaves.') - ), - array( - 'Repl_client_priv', - 'REPLICATION CLIENT', - __('Allows the user to ask where the slaves / masters are.') - ), - array( - 'Create_view_priv', - 'CREATE VIEW', - __('Allows creating new views.') - ), - array( - 'Event_priv', - 'EVENT', - __('Allows to set up events for the event scheduler.') - ), - array( - 'Trigger_priv', - 'TRIGGER', - __('Allows creating and dropping triggers.') - ), - // for table privs: - array( - 'Create View_priv', - 'CREATE VIEW', - __('Allows creating new views.') - ), - array( - 'Show_view_priv', - 'SHOW VIEW', - __('Allows performing SHOW CREATE VIEW queries.') - ), - // for table privs: - array( - 'Show view_priv', - 'SHOW VIEW', - __('Allows performing SHOW CREATE VIEW queries.') - ), - array( - 'Create_routine_priv', - 'CREATE ROUTINE', - __('Allows creating stored routines.') - ), - array( - 'Alter_routine_priv', - 'ALTER ROUTINE', - __('Allows altering and dropping stored routines.') - ), - array( - 'Create_user_priv', - 'CREATE USER', - __('Allows creating, dropping and renaming user accounts.') - ), - array( - 'Execute_priv', - 'EXECUTE', - __('Allows executing stored routines.') - ), - ); -} - -/** - * Displays on which column(s) a table-specific privilege is granted - * - * @param array $columns columns array - * @param array $row first row from result or boolean false - * @param string $name_for_select privilege types - Select_priv, Insert_priv - * Update_priv, References_priv - * @param string $priv_for_header privilege for header - * @param string $name privilege name: insert, select, update, references - * @param string $name_for_dfn name for dfn - * @param string $name_for_current name for current - * - * @return string $html_output html snippet - */ -function PMA_getHtmlForColumnPrivileges($columns, $row, $name_for_select, - $priv_for_header, $name, $name_for_dfn, $name_for_current -) { - $html_output = '
    ' . "\n" - . '
    ' . "\n" - . '' . "\n" - . '' . __('Or') . '' . "\n" - . '' . "\n" - . '
    ' . "\n"; - return $html_output; -} // end function - -/** - * Get sql query for display privileges table - * - * @param string $db the database - * @param string $table the table - * @param string $username username for database connection - * @param string $hostname hostname for database connection - * - * @return string sql query - */ -function PMA_getSqlQueryForDisplayPrivTable($db, $table, $username, $hostname) -{ - if ($db == '*') { - return "SELECT * FROM `mysql`.`user`" - . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" - . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "';"; - } elseif ($table == '*') { - return "SELECT * FROM `mysql`.`db`" - . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" - . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "'" - . " AND '" . $GLOBALS['dbi']->escapeString(Util::unescapeMysqlWildcards($db)) . "'" - . " LIKE `Db`;"; - } - return "SELECT `Table_priv`" - . " FROM `mysql`.`tables_priv`" - . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" - . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "'" - . " AND `Db` = '" . $GLOBALS['dbi']->escapeString(Util::unescapeMysqlWildcards($db)) . "'" - . " AND `Table_name` = '" . $GLOBALS['dbi']->escapeString($table) . "';"; -} - -/** - * Displays a dropdown to select the user group - * with menu items configured to each of them. - * - * @param string $username username - * - * @return string html to select the user group - */ -function PMA_getHtmlToChooseUserGroup($username) -{ - $html_output = '
    '; - $params = array('username' => $username); - $html_output .= PMA_URL_getHiddenInputs($params); - $html_output .= '
    '; - $html_output .= '' . __('User group') . ''; - - $cfgRelation = PMA_getRelationsParam(); - $groupTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['usergroups']); - $userTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['users']); - - $userGroups = array(); - $sql_query = "SELECT DISTINCT `usergroup` FROM " . $groupTable; - $result = PMA_queryAsControlUser($sql_query, false); - if ($result) { - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $userGroups[] = $row[0]; - } - } - $GLOBALS['dbi']->freeResult($result); - - $userGroup = ''; - if (isset($GLOBALS['username'])) { - $sql_query = "SELECT `usergroup` FROM " . $userTable - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) . "'"; - $userGroup = $GLOBALS['dbi']->fetchValue( - $sql_query, 0, 0, $GLOBALS['controllink'] - ); - } - - $html_output .= __('User group') . ': '; - $html_output .= ''; - $html_output .= ''; - $html_output .= '
    '; - $html_output .= '
    '; - return $html_output; -} - -/** - * Sets the user group from request values - * - * @param string $username username - * @param string $userGroup user group to set - * - * @return void - */ -function PMA_setUserGroup($username, $userGroup) -{ - $cfgRelation = PMA_getRelationsParam(); - $userTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['users']); - - $sql_query = "SELECT `usergroup` FROM " . $userTable - . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) . "'"; - $oldUserGroup = $GLOBALS['dbi']->fetchValue( - $sql_query, 0, 0, $GLOBALS['controllink'] - ); - - if ($oldUserGroup === false) { - $upd_query = "INSERT INTO " . $userTable . "(`username`, `usergroup`)" - . " VALUES ('" . $GLOBALS['dbi']->escapeString($username) . "', " - . "'" . $GLOBALS['dbi']->escapeString($userGroup) . "')"; - } else { - if (empty($userGroup)) { - $upd_query = "DELETE FROM " . $userTable - . " WHERE `username`='" . $GLOBALS['dbi']->escapeString($username) . "'"; - } elseif ($oldUserGroup != $userGroup) { - $upd_query = "UPDATE " . $userTable - . " SET `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) . "'" - . " WHERE `username`='" . $GLOBALS['dbi']->escapeString($username) . "'"; - } - } - if (isset($upd_query)) { - PMA_queryAsControlUser($upd_query); - } -} - -/** - * Displays the privileges form table - * - * @param string $db the database - * @param string $table the table - * @param boolean $submit whether to display the submit button or not - * - * @global array $cfg the phpMyAdmin configuration - * @global resource $user_link the database connection - * - * @return string html snippet - */ -function PMA_getHtmlToDisplayPrivilegesTable($db = '*', - $table = '*', $submit = true -) { - $html_output = ''; - $sql_query = ''; - - if ($db == '*') { - $table = '*'; - } - - if (isset($GLOBALS['username'])) { - $username = $GLOBALS['username']; - $hostname = $GLOBALS['hostname']; - $sql_query = PMA_getSqlQueryForDisplayPrivTable( - $db, $table, $username, $hostname - ); - $row = $GLOBALS['dbi']->fetchSingleRow($sql_query); - } - if (empty($row)) { - if ($table == '*' && $GLOBALS['is_superuser']) { - if ($db == '*') { - $sql_query = 'SHOW COLUMNS FROM `mysql`.`user`;'; - } elseif ($table == '*') { - $sql_query = 'SHOW COLUMNS FROM `mysql`.`db`;'; - } - $res = $GLOBALS['dbi']->query($sql_query); - while ($row1 = $GLOBALS['dbi']->fetchRow($res)) { - if (mb_substr($row1[0], 0, 4) == 'max_') { - $row[$row1[0]] = 0; - } elseif (mb_substr($row1[0], 0, 5) == 'x509_' - || mb_substr($row1[0], 0, 4) == 'ssl_' - ) { - $row[$row1[0]] = ''; - } else { - $row[$row1[0]] = 'N'; - } - } - $GLOBALS['dbi']->freeResult($res); - } elseif ($table == '*') { - $row = array(); - } else { - $row = array('Table_priv' => ''); - } - } - if (isset($row['Table_priv'])) { - PMA_fillInTablePrivileges($row); - - // get columns - $res = $GLOBALS['dbi']->tryQuery( - 'SHOW COLUMNS FROM ' - . Util::backquote( - Util::unescapeMysqlWildcards($db) - ) - . '.' . Util::backquote($table) . ';' - ); - $columns = array(); - if ($res) { - while ($row1 = $GLOBALS['dbi']->fetchRow($res)) { - $columns[$row1[0]] = array( - 'Select' => false, - 'Insert' => false, - 'Update' => false, - 'References' => false - ); - } - $GLOBALS['dbi']->freeResult($res); - } - unset($res, $row1); - } - // table-specific privileges - if (! empty($columns)) { - $html_output .= PMA_getHtmlForTableSpecificPrivileges( - $username, $hostname, $db, $table, $columns, $row - ); - } else { - // global or db-specific - $html_output .= PMA_getHtmlForGlobalOrDbSpecificPrivs($db, $table, $row); - } - $html_output .= '' . "\n"; - if ($submit) { - $html_output .= '' . "\n"; - } - return $html_output; -} // end of the 'PMA_displayPrivTable()' function - -/** - * Get HTML for "Require" - * - * @param array $row privilege array - * - * @return string html snippet - */ -function PMA_getHtmlForRequires($row) -{ - $html_output = '
    '; - $html_output .= 'SSL'; - - $html_output .= '
    '; - - // REQUIRE NONE - $html_output .= '
    '; - $html_output .= ''; - - $html_output .= ''; - $html_output .= '
    '; - - // REQUIRE SSL - $html_output .= '
    '; - $html_output .= ''; - - $html_output .= ''; - $html_output .= '
    '; - - // REQUIRE X509 - $html_output .= '
    '; - $html_output .= ''; - - $html_output .= ''; - $html_output .= '
    '; - - // Specified - $specified = (isset($row['ssl_type']) && $row['ssl_type'] == 'SPECIFIED'); - $html_output .= '
    '; - $html_output .= ''; - - $html_output .= ''; - $html_output .= '
    '; - - $html_output .= '
    '; - - // REQUIRE CIPHER - $html_output .= '
    '; - $html_output .= ''; - $html_output .= ''; - $html_output .= '
    '; - - // REQUIRE ISSUER - $html_output .= '
    '; - $html_output .= ''; - $html_output .= ''; - $html_output .= '
    '; - - // REQUIRE SUBJECT - $html_output .= '
    '; - $html_output .= ''; - $html_output .= ''; - $html_output .= '
    '; - - $html_output .= '
    '; - - $html_output .= '
    '; - $html_output .= '
    '; - - return $html_output; -} - -/** - * Get HTML for "Resource limits" - * - * @param array $row first row from result or boolean false - * - * @return string html snippet - */ -function PMA_getHtmlForResourceLimits($row) -{ - $html_output = '
    ' . "\n" - . '' . __('Resource limits') . '' . "\n" - . '

    ' - . '' . __('Note: Setting these options to 0 (zero) removes the limit.') - . '

    ' . "\n"; - - $html_output .= '
    ' . "\n" - . '' . "\n" - . '' . "\n" - . '
    ' . "\n"; - - $html_output .= '
    ' . "\n" - . '' . "\n" - . '' . "\n" - . '
    ' . "\n"; - - $html_output .= '
    ' . "\n" - . '' . "\n" - . '' . "\n" - . '
    ' . "\n"; - - $html_output .= '
    ' . "\n" - . '' . "\n" - . '' . "\n" - . '
    ' . "\n"; - - $html_output .= '
    ' . "\n"; - - return $html_output; -} - -/** - * Get the HTML snippet for routine specific privileges - * - * @param string $username username for database connection - * @param string $hostname hostname for database connection - * @param string $db the database - * @param string $routine the routine - * @param string $url_dbname url encoded db name - * - * @return string $html_output - */ -function PMA_getHtmlForRoutineSpecificPrivilges( - $username, $hostname, $db, $routine, $url_dbname -) { - $header = PMA_getHtmlHeaderForUserProperties( - false, $url_dbname, $db, $username, $hostname, - $routine, 'routine' - ); - - $sql = "SELECT `Proc_priv`" - . " FROM `mysql`.`procs_priv`" - . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" - . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "'" - . " AND `Db` = '" - . $GLOBALS['dbi']->escapeString(Util::unescapeMysqlWildcards($db)) . "'" - . " AND `Routine_name` LIKE '" . $GLOBALS['dbi']->escapeString($routine) . "';"; - $res = $GLOBALS['dbi']->fetchValue($sql); - - $privs = array( - 'Alter_routine_priv' => 'N', - 'Execute_priv' => 'N', - 'Grant_priv' => 'N', - ); - foreach (explode(',', $res) as $priv) { - if ($priv == 'Alter Routine') { - $privs['Alter_routine_priv'] = 'Y'; - } else { - $privs[$priv . '_priv'] = 'Y'; - } - } - - $routineArray = array(PMA_getTriggerPrivilegeTable()); - $privTableNames = array(__('Routine')); - $privCheckboxes = PMA_getHtmlForGlobalPrivTableWithCheckboxes( - $routineArray, $privTableNames, $privs - ); - - $data = array( - 'username' => $username, - 'hostname' => $hostname, - 'database' => $db, - 'routine' => $routine, - 'grantCount' => count($privs), - 'privCheckboxes' => $privCheckboxes, - 'header' => $header, - ); - $html_output = Template::get('privileges/edit_routine_privileges') - ->render($data); - - return $html_output; -} - -/** - * Get routine privilege table as an array - * - * @return privilege type array - */ -function PMA_getTriggerPrivilegeTable() -{ - $routinePrivTable = array( - array( - 'Grant', - 'GRANT', - __( - 'Allows user to give to other users or remove from other users ' - . 'privileges that user possess on this routine.' - ) - ), - array( - 'Alter_routine', - 'ALTER ROUTINE', - __('Allows altering and dropping this routine.') - ), - array( - 'Execute', - 'EXECUTE', - __('Allows executing this routine.') - ) - ); - return $routinePrivTable; -} - -/** - * Get the HTML snippet for table specific privileges - * - * @param string $username username for database connection - * @param string $hostname hostname for database connection - * @param string $db the database - * @param string $table the table - * @param array $columns columns array - * @param array $row current privileges row - * - * @return string $html_output - */ -function PMA_getHtmlForTableSpecificPrivileges( - $username, $hostname, $db, $table, $columns, $row -) { - $res = $GLOBALS['dbi']->query( - 'SELECT `Column_name`, `Column_priv`' - . ' FROM `mysql`.`columns_priv`' - . ' WHERE `User`' - . ' = \'' . $GLOBALS['dbi']->escapeString($username) . "'" - . ' AND `Host`' - . ' = \'' . $GLOBALS['dbi']->escapeString($hostname) . "'" - . ' AND `Db`' - . ' = \'' . $GLOBALS['dbi']->escapeString( - Util::unescapeMysqlWildcards($db) - ) . "'" - . ' AND `Table_name`' - . ' = \'' . $GLOBALS['dbi']->escapeString($table) . '\';' - ); - - while ($row1 = $GLOBALS['dbi']->fetchRow($res)) { - $row1[1] = explode(',', $row1[1]); - foreach ($row1[1] as $current) { - $columns[$row1[0]][$current] = true; - } - } - $GLOBALS['dbi']->freeResult($res); - unset($res, $row1, $current); - - $html_output = '' . "\n" - . '' . "\n" - . '
    ' . "\n" - . '' . __('Table-specific privileges') - . '' - . '

    ' - . __('Note: MySQL privilege names are expressed in English.') - . '

    '; - - // privs that are attached to a specific column - $html_output .= PMA_getHtmlForAttachedPrivilegesToTableSpecificColumn( - $columns, $row - ); - - // privs that are not attached to a specific column - $html_output .= '
    ' . "\n" - . PMA_getHtmlForNotAttachedPrivilegesToTableSpecificColumn($row) - . '
    ' . "\n"; - - // for Safari 2.0.2 - $html_output .= '
    ' . "\n"; - - return $html_output; -} - -/** - * Get HTML snippet for privileges that are attached to a specific column - * - * @param array $columns columns array - * @param array $row first row from result or boolean false - * - * @return string $html_output - */ -function PMA_getHtmlForAttachedPrivilegesToTableSpecificColumn($columns, $row) -{ - $html_output = PMA_getHtmlForColumnPrivileges( - $columns, $row, 'Select_priv', 'SELECT', - 'select', __('Allows reading data.'), 'Select' - ); - - $html_output .= PMA_getHtmlForColumnPrivileges( - $columns, $row, 'Insert_priv', 'INSERT', - 'insert', __('Allows inserting and replacing data.'), 'Insert' - ); - - $html_output .= PMA_getHtmlForColumnPrivileges( - $columns, $row, 'Update_priv', 'UPDATE', - 'update', __('Allows changing data.'), 'Update' - ); - - $html_output .= PMA_getHtmlForColumnPrivileges( - $columns, $row, 'References_priv', 'REFERENCES', 'references', - __('Has no effect in this MySQL version.'), 'References' - ); - return $html_output; -} - -/** - * Get HTML for privileges that are not attached to a specific column - * - * @param array $row first row from result or boolean false - * - * @return string $html_output - */ -function PMA_getHtmlForNotAttachedPrivilegesToTableSpecificColumn($row) -{ - $html_output = ''; - - foreach ($row as $current_grant => $current_grant_value) { - $grant_type = substr($current_grant, 0, -5); - if (in_array($grant_type, array('Select', 'Insert', 'Update', 'References')) - ) { - continue; - } - // make a substitution to match the messages variables; - // also we must substitute the grant we get, because we can't generate - // a form variable containing blanks (those would get changed to - // an underscore when receiving the POST) - if ($current_grant == 'Create View_priv') { - $tmp_current_grant = 'CreateView_priv'; - $current_grant = 'Create_view_priv'; - } elseif ($current_grant == 'Show view_priv') { - $tmp_current_grant = 'ShowView_priv'; - $current_grant = 'Show_view_priv'; - } else { - $tmp_current_grant = $current_grant; - } - - $html_output .= '
    ' . "\n" - . '' . "\n"; - - $privGlobalName1 = 'strPrivDesc' - . mb_substr( - $tmp_current_grant, - 0, - - 5 - ); - $html_output .= '' . "\n" - . '
    ' . "\n"; - } // end foreach () - return $html_output; -} - -/** - * Get HTML for global or database specific privileges - * - * @param string $db the database - * @param string $table the table - * @param array $row first row from result or boolean false - * - * @return string $html_output - */ -function PMA_getHtmlForGlobalOrDbSpecificPrivs($db, $table, $row) -{ - $privTable_names = array(0 => __('Data'), - 1 => __('Structure'), - 2 => __('Administration') - ); - $privTable = array(); - // d a t a - $privTable[0] = PMA_getDataPrivilegeTable($db); - - // s t r u c t u r e - $privTable[1] = PMA_getStructurePrivilegeTable($table, $row); - - // a d m i n i s t r a t i o n - $privTable[2] = PMA_getAdministrationPrivilegeTable($db); - - $html_output = ''; - if ($db == '*') { - $legend = __('Global privileges'); - $menu_label = __('Global'); - } else if ($table == '*') { - $legend = __('Database-specific privileges'); - $menu_label = __('Database'); - } else { - $legend = __('Table-specific privileges'); - $menu_label = __('Table'); - } - $html_output .= '
    ' - . '' . $legend - . ' ' - . ' ' - . '' - . '

    ' - . __('Note: MySQL privilege names are expressed in English.') - . '

    '; - - // Output the Global privilege tables with checkboxes - $html_output .= PMA_getHtmlForGlobalPrivTableWithCheckboxes( - $privTable, $privTable_names, $row - ); - - // The "Resource limits" box is not displayed for db-specific privs - if ($db == '*') { - $html_output .= PMA_getHtmlForResourceLimits($row); - $html_output .= PMA_getHtmlForRequires($row); - } - // for Safari 2.0.2 - $html_output .= '
    '; - - return $html_output; -} - -/** - * Get data privilege table as an array - * - * @param string $db the database - * - * @return string data privilege table - */ -function PMA_getDataPrivilegeTable($db) -{ - $data_privTable = array( - array('Select', 'SELECT', __('Allows reading data.')), - array('Insert', 'INSERT', __('Allows inserting and replacing data.')), - array('Update', 'UPDATE', __('Allows changing data.')), - array('Delete', 'DELETE', __('Allows deleting data.')) - ); - if ($db == '*') { - $data_privTable[] - = array('File', - 'FILE', - __('Allows importing data from and exporting data into files.') - ); - } - return $data_privTable; -} - -/** - * Get structure privilege table as an array - * - * @param string $table the table - * @param array $row first row from result or boolean false - * - * @return string structure privilege table - */ -function PMA_getStructurePrivilegeTable($table, $row) -{ - $structure_privTable = array( - array('Create', - 'CREATE', - ($table == '*' - ? __('Allows creating new databases and tables.') - : __('Allows creating new tables.') - ) - ), - array('Alter', - 'ALTER', - __('Allows altering the structure of existing tables.') - ), - array('Index', 'INDEX', __('Allows creating and dropping indexes.')), - array('Drop', - 'DROP', - ($table == '*' - ? __('Allows dropping databases and tables.') - : __('Allows dropping tables.') - ) - ), - array('Create_tmp_table', - 'CREATE TEMPORARY TABLES', - __('Allows creating temporary tables.') - ), - array('Show_view', - 'SHOW VIEW', - __('Allows performing SHOW CREATE VIEW queries.') - ), - array('Create_routine', - 'CREATE ROUTINE', - __('Allows creating stored routines.') - ), - array('Alter_routine', - 'ALTER ROUTINE', - __('Allows altering and dropping stored routines.') - ), - array('Execute', 'EXECUTE', __('Allows executing stored routines.')), - ); - // this one is for a db-specific priv: Create_view_priv - if (isset($row['Create_view_priv'])) { - $structure_privTable[] = array('Create_view', - 'CREATE VIEW', - __('Allows creating new views.') - ); - } - // this one is for a table-specific priv: Create View_priv - if (isset($row['Create View_priv'])) { - $structure_privTable[] = array('Create View', - 'CREATE VIEW', - __('Allows creating new views.') - ); - } - if (isset($row['Event_priv'])) { - // MySQL 5.1.6 - $structure_privTable[] = array('Event', - 'EVENT', - __('Allows to set up events for the event scheduler.') - ); - $structure_privTable[] = array('Trigger', - 'TRIGGER', - __('Allows creating and dropping triggers.') - ); - } - return $structure_privTable; -} - -/** - * Get administration privilege table as an array - * - * @param string $db the table - * - * @return string administration privilege table - */ -function PMA_getAdministrationPrivilegeTable($db) -{ - if ($db == '*') { - $adminPrivTable = array( - array('Grant', - 'GRANT', - __( - 'Allows adding users and privileges ' - . 'without reloading the privilege tables.' - ) - ), - ); - $adminPrivTable[] = array('Super', - 'SUPER', - __( - 'Allows connecting, even if maximum number ' - . 'of connections is reached; required for ' - . 'most administrative operations like ' - . 'setting global variables or killing threads of other users.' - ) - ); - $adminPrivTable[] = array('Process', - 'PROCESS', - __('Allows viewing processes of all users.') - ); - $adminPrivTable[] = array('Reload', - 'RELOAD', - __('Allows reloading server settings and flushing the server\'s caches.') - ); - $adminPrivTable[] = array('Shutdown', - 'SHUTDOWN', - __('Allows shutting down the server.') - ); - $adminPrivTable[] = array('Show_db', - 'SHOW DATABASES', - __('Gives access to the complete list of databases.') - ); - } - else { - $adminPrivTable = array( - array('Grant', - 'GRANT', - __( - 'Allows user to give to other users or remove from other' - . ' users the privileges that user possess yourself.' - ) - ), - ); - } - $adminPrivTable[] = array('Lock_tables', - 'LOCK TABLES', - __('Allows locking tables for the current thread.') - ); - $adminPrivTable[] = array('References', - 'REFERENCES', - __('Has no effect in this MySQL version.') - ); - if ($db == '*') { - $adminPrivTable[] = array('Repl_client', - 'REPLICATION CLIENT', - __('Allows the user to ask where the slaves / masters are.') - ); - $adminPrivTable[] = array('Repl_slave', - 'REPLICATION SLAVE', - __('Needed for the replication slaves.') - ); - $adminPrivTable[] = array('Create_user', - 'CREATE USER', - __('Allows creating, dropping and renaming user accounts.') - ); - } - return $adminPrivTable; -} - -/** - * Get HTML snippet for global privileges table with check boxes - * - * @param array $privTable privileges table array - * @param array $privTable_names names of the privilege tables - * (Data, Structure, Administration) - * @param array $row first row from result or boolean false - * - * @return string $html_output - */ -function PMA_getHtmlForGlobalPrivTableWithCheckboxes( - $privTable, $privTable_names, $row -) { - $html_output = ''; - foreach ($privTable as $i => $table) { - $html_output .= '
    ' . "\n" - . '' . "\n" - . '' - . '' . "\n" - . '' . "\n"; - foreach ($table as $priv) { - $html_output .= '
    ' . "\n" - . '' . "\n" - . '' . "\n" - . '
    ' . "\n"; - } - $html_output .= '
    ' . "\n"; - } - return $html_output; -} - -/** - * Gets the currently active authentication plugins - * - * @param string $orig_auth_plugin Default Authentication plugin - * @param string $mode are we creating a new user or are we just - * changing one? - * (allowed values: 'new', 'edit', 'change_pw') - * @param string $versions Is MySQL version newer or older than 5.5.7 - * - * @return string $html_output - */ -function PMA_getHtmlForAuthPluginsDropdown( - $orig_auth_plugin, - $mode = 'new', - $versions = 'new' -) { - $html_output = ''; - } else { - $html_output .= '' - . ''; - } - - return $html_output; -} -/** - * Gets the currently active authentication plugins - * - * @return array $result array of plugin names and descriptions - */ -function PMA_getActiveAuthPlugins() -{ - $get_plugins_query = "SELECT `PLUGIN_NAME`, `PLUGIN_DESCRIPTION`" - . " FROM `information_schema`.`PLUGINS` " - . "WHERE `PLUGIN_TYPE` = 'AUTHENTICATION';"; - $resultset = $GLOBALS['dbi']->query($get_plugins_query); - - $result = array(); - - while ($row = $GLOBALS['dbi']->fetchAssoc($resultset)) { - $result[] = $row; - } - - return $result; -} - -/** - * Displays the fields used by the "new user" form as well as the - * "change login information / copy user" form. - * - * @param string $mode are we creating a new user or are we just - * changing one? (allowed values: 'new', 'change') - * @param string $username User name - * @param string $hostname Host name - * - * @global array $cfg the phpMyAdmin configuration - * @global resource $user_link the database connection - * - * @return string $html_output a HTML snippet - */ -function PMA_getHtmlForLoginInformationFields( - $mode = 'new', - $username = null, - $hostname = null -) { - list($username_length, $hostname_length) = PMA_getUsernameAndHostnameLength(); - - if (isset($GLOBALS['username']) - && mb_strlen($GLOBALS['username']) === 0 - ) { - $GLOBALS['pred_username'] = 'any'; - } - $html_output = '
    ' . "\n" - . '' . __('Login Information') . '' . "\n" - . '
    ' . "\n" - . '' . "\n" - . '' . "\n"; - - $html_output .= '' . "\n" - . '' . "\n"; - - $html_output .= '' . "\n"; - - $html_output .= ''; - $html_output .= '
    '; - - $html_output .= '
    ' . "\n" - . '' . "\n"; - - $html_output .= '' . "\n" - . ' ' . "\n" - . '' . "\n"; - - $html_output .= '' . "\n" - . Util::showHint( - __( - 'When Host table is used, this field is ignored ' - . 'and values stored in Host table are used instead.' - ) - ) - . '
    ' . "\n"; - - $html_output .= '
    ' . "\n" - . '' . "\n" - . '' . "\n" - . '' . "\n" - . '' . "\n" - . '' . "\n" - . '
    ' . "\n"; - - $html_output .= '
    ' . "\n" - . '' . "\n" - . ' ' . "\n" - . '' . "\n" - . '
    ' . "\n" - . '
    ' - . ' ' . "\n"; - - $auth_plugin_dropdown = PMA_getHtmlForAuthPluginsDropdown( - $orig_auth_plugin, $mode, 'new' - ); - } else { - $html_output .= __('Password Hashing Method') - . ' ' . "\n"; - $auth_plugin_dropdown = PMA_getHtmlForAuthPluginsDropdown( - $orig_auth_plugin, $mode, 'old' - ); - } - $html_output .= $auth_plugin_dropdown; - - $html_output .= '
    ' - . Message::notice( - __( - 'This method requires using an \'SSL connection\' ' - . 'or an \'unencrypted connection that encrypts the password ' - . 'using RSA\'; while connecting to the server.' - ) - . Util::showMySQLDocu('sha256-authentication-plugin') - ) - ->getDisplay() - . '
    '; - - $html_output .= '
    ' . "\n" - // Generate password added here via jQuery - . '
    ' . "\n"; - - return $html_output; -} // end of the 'PMA_getHtmlForLoginInformationFields()' function - -/** - * Get username and hostname length - * - * @return array username length and hostname length - */ -function PMA_getUsernameAndHostnameLength() -{ - /* Fallback values */ - $username_length = 16; - $hostname_length = 41; - - /* Try to get real lengths from the database */ - $fields_info = $GLOBALS['dbi']->fetchResult( - 'SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH ' - . 'FROM information_schema.columns ' - . "WHERE table_schema = 'mysql' AND table_name = 'user' " - . "AND COLUMN_NAME IN ('User', 'Host')" - ); - foreach ($fields_info as $val) { - if ($val['COLUMN_NAME'] == 'User') { - $username_length = $val['CHARACTER_MAXIMUM_LENGTH']; - } elseif ($val['COLUMN_NAME'] == 'Host') { - $hostname_length = $val['CHARACTER_MAXIMUM_LENGTH']; - } - } - return array($username_length, $hostname_length); -} - -/** - * Get current authentication plugin in use - for a user or globally - * - * @param string $mode are we creating a new user or are we just - * changing one? (allowed values: 'new', 'change') - * @param string $username User name - * @param string $hostname Host name - * - * @return string authentication plugin in use - */ -function PMA_getCurrentAuthenticationPlugin( - $mode = 'new', - $username = null, - $hostname = null -) { - /* Fallback (standard) value */ - $authentication_plugin = 'mysql_native_password'; - - if (isset($username) && isset($hostname) - && $mode == 'change' - ) { - $row = $GLOBALS['dbi']->fetchSingleRow( - 'SELECT `plugin` FROM `mysql`.`user` WHERE ' - . '`User` = "' . $username . '" AND `Host` = "' . $hostname . '" LIMIT 1' - ); - // Table 'mysql'.'user' may not exist for some previous - // versions of MySQL - in that case consider fallback value - if (isset($row) && $row) { - $authentication_plugin = $row['plugin']; - } - } elseif ($mode == 'change') { - $row = $GLOBALS['dbi']->fetchSingleRow( - 'SELECT CURRENT_USER() as user;' - ); - if (isset($row) && $row) { - list($username, $hostname) = explode('@', $row['user']); - } - - $row = $GLOBALS['dbi']->fetchSingleRow( - 'SELECT `plugin` FROM `mysql`.`user` WHERE ' - . '`User` = "' . $username . '" AND `Host` = "' . $hostname . '"' - ); - if (isset($row) && $row && ! empty($row['plugin'])) { - $authentication_plugin = $row['plugin']; - } - } elseif (PMA_MYSQL_INT_VERSION >= 50702) { - $row = $GLOBALS['dbi']->fetchSingleRow( - 'SELECT @@default_authentication_plugin' - ); - $authentication_plugin = $row['@@default_authentication_plugin']; - } - - return $authentication_plugin; -} - -/** - * Returns all the grants for a certain user on a certain host - * Used in the export privileges for all users section - * - * @param string $user User name - * @param string $host Host name - * - * @return string containing all the grants text - */ -function PMA_getGrants($user, $host) -{ - $grants = $GLOBALS['dbi']->fetchResult( - "SHOW GRANTS FOR '" - . $GLOBALS['dbi']->escapeString($user) . "'@'" - . $GLOBALS['dbi']->escapeString($host) . "'" - ); - $response = ''; - foreach ($grants as $one_grant) { - $response .= $one_grant . ";\n\n"; - } - return $response; -} // end of the 'PMA_getGrants()' function - -/** - * Update password and get message for password updating - * - * @param string $err_url error url - * @param string $username username - * @param string $hostname hostname - * - * @return string $message success or error message after updating password - */ -function PMA_updatePassword($err_url, $username, $hostname) -{ - // similar logic in user_password.php - $message = ''; - $is_superuser = $GLOBALS['dbi']->isSuperuser(); - - if (empty($_REQUEST['nopass']) - && isset($_POST['pma_pw']) - && isset($_POST['pma_pw2']) - ) { - if ($_POST['pma_pw'] != $_POST['pma_pw2']) { - $message = Message::error(__('The passwords aren\'t the same!')); - } elseif (empty($_POST['pma_pw']) || empty($_POST['pma_pw2'])) { - $message = Message::error(__('The password is empty!')); - } - } - - // here $nopass could be == 1 - if (empty($message)) { - $hashing_function = 'PASSWORD'; - $serverType = Util::getServerType(); - $authentication_plugin - = (isset($_REQUEST['authentication_plugin']) - ? $_REQUEST['authentication_plugin'] - : PMA_getCurrentAuthenticationPlugin( - 'change', - $username, - $hostname - )); - - // Use 'ALTER USER ...' syntax for MySQL 5.7.6+ - if ($serverType == 'MySQL' - && PMA_MYSQL_INT_VERSION >= 50706 - ) { - if ($authentication_plugin != 'mysql_old_password') { - $query_prefix = "ALTER USER '" - . $GLOBALS['dbi']->escapeString($username) - . "'@'" . $GLOBALS['dbi']->escapeString($hostname) . "'" - . " IDENTIFIED WITH " - . $authentication_plugin - . " BY '"; - } else { - $query_prefix = "ALTER USER '" - . $GLOBALS['dbi']->escapeString($username) - . "'@'" . $GLOBALS['dbi']->escapeString($hostname) . "'" - . " IDENTIFIED BY '"; - } - - // in $sql_query which will be displayed, hide the password - $sql_query = $query_prefix . "*'"; - - $local_query = $query_prefix - . $GLOBALS['dbi']->escapeString($_POST['pma_pw']) . "'"; - } else if ($serverType == 'MariaDB' - && PMA_MYSQL_INT_VERSION >= 50200 - && $is_superuser - ) { - // Use 'UPDATE `mysql`.`user` ...' Syntax for MariaDB 5.2+ - if ($authentication_plugin == 'mysql_native_password') { - // Set the hashing method used by PASSWORD() - // to be 'mysql_native_password' type - $GLOBALS['dbi']->tryQuery('SET old_passwords = 0;'); - - } else if ($authentication_plugin == 'sha256_password') { - // Set the hashing method used by PASSWORD() - // to be 'sha256_password' type - $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 2;'); - } - - $hashedPassword = PMA_getHashedPassword($_POST['pma_pw']); - - $sql_query = 'SET PASSWORD FOR \'' - . $GLOBALS['dbi']->escapeString($username) - . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\' = ' - . (($_POST['pma_pw'] == '') - ? '\'\'' - : $hashing_function . '(\'' - . preg_replace('@.@s', '*', $_POST['pma_pw']) . '\')'); - - $local_query = "UPDATE `mysql`.`user` SET " - . " `authentication_string` = '" . $hashedPassword - . "', `Password` = '', " - . " `plugin` = '" . $authentication_plugin . "'" - . " WHERE `User` = '" . $username . "' AND Host = '" - . $hostname . "';"; - } else { - // USE 'SET PASSWORD ...' syntax for rest of the versions - // Backup the old value, to be reset later - $row = $GLOBALS['dbi']->fetchSingleRow( - 'SELECT @@old_passwords;' - ); - $orig_value = $row['@@old_passwords']; - $update_plugin_query = "UPDATE `mysql`.`user` SET" - . " `plugin` = '" . $authentication_plugin . "'" - . " WHERE `User` = '" . $username . "' AND Host = '" - . $hostname . "';"; - - // Update the plugin for the user - if (!($GLOBALS['dbi']->tryQuery($update_plugin_query))) { - Util::mysqlDie( - $GLOBALS['dbi']->getError(), - $update_plugin_query, - false, $err_url - ); - } - $GLOBALS['dbi']->tryQuery("FLUSH PRIVILEGES;"); - - if ($authentication_plugin == 'mysql_native_password') { - // Set the hashing method used by PASSWORD() - // to be 'mysql_native_password' type - $GLOBALS['dbi']->tryQuery('SET old_passwords = 0;'); - } else if ($authentication_plugin == 'sha256_password') { - // Set the hashing method used by PASSWORD() - // to be 'sha256_password' type - $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 2;'); - } - $sql_query = 'SET PASSWORD FOR \'' - . $GLOBALS['dbi']->escapeString($username) - . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\' = ' - . (($_POST['pma_pw'] == '') - ? '\'\'' - : $hashing_function . '(\'' - . preg_replace('@.@s', '*', $_POST['pma_pw']) . '\')'); - - $local_query = 'SET PASSWORD FOR \'' - . $GLOBALS['dbi']->escapeString($username) - . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\' = ' - . (($_POST['pma_pw'] == '') ? '\'\'' : $hashing_function - . '(\'' . $GLOBALS['dbi']->escapeString($_POST['pma_pw']) . '\')'); - } - - if (!($GLOBALS['dbi']->tryQuery($local_query))) { - Util::mysqlDie( - $GLOBALS['dbi']->getError(), $sql_query, false, $err_url - ); - } - // Flush privileges after successful password change - $GLOBALS['dbi']->tryQuery("FLUSH PRIVILEGES;"); - - $message = Message::success( - __('The password for %s was changed successfully.') - ); - $message->addParam( - '\'' . htmlspecialchars($username) - . '\'@\'' . htmlspecialchars($hostname) . '\'' - ); - if (isset($orig_value)) { - $GLOBALS['dbi']->tryQuery( - 'SET `old_passwords` = ' . $orig_value . ';' - ); - } - } - return $message; -} - -/** - * Revokes privileges and get message and SQL query for privileges revokes - * - * @param string $dbname database name - * @param string $tablename table name - * @param string $username username - * @param string $hostname host name - * @param string $itemType item type - * - * @return array ($message, $sql_query) - */ -function PMA_getMessageAndSqlQueryForPrivilegesRevoke($dbname, - $tablename, $username, $hostname, $itemType -) { - $db_and_table = PMA_wildcardEscapeForGrant($dbname, $tablename); - - $sql_query0 = 'REVOKE ALL PRIVILEGES ON ' . $itemType . ' ' . $db_and_table - . ' FROM \'' - . $GLOBALS['dbi']->escapeString($username) . '\'@\'' - . $GLOBALS['dbi']->escapeString($hostname) . '\';'; - - $sql_query1 = 'REVOKE GRANT OPTION ON ' . $itemType . ' ' . $db_and_table - . ' FROM \'' . $GLOBALS['dbi']->escapeString($username) . '\'@\'' - . $GLOBALS['dbi']->escapeString($hostname) . '\';'; - - $GLOBALS['dbi']->query($sql_query0); - if (! $GLOBALS['dbi']->tryQuery($sql_query1)) { - // this one may fail, too... - $sql_query1 = ''; - } - $sql_query = $sql_query0 . ' ' . $sql_query1; - $message = Message::success( - __('You have revoked the privileges for %s.') - ); - $message->addParam( - '\'' . htmlspecialchars($username) - . '\'@\'' . htmlspecialchars($hostname) . '\'' - ); - - return array($message, $sql_query); -} - -/** - * Get REQUIRE cluase - * - * @return string REQUIRE clause - */ -function PMA_getRequireClause() -{ - $arr = isset($_POST['ssl_type']) ? $_POST : $GLOBALS; - if (isset($arr['ssl_type']) && $arr['ssl_type'] == 'SPECIFIED') { - $require = array(); - if (! empty($arr['ssl_cipher'])) { - $require[] = "CIPHER '" - . $GLOBALS['dbi']->escapeString($arr['ssl_cipher']) . "'"; - } - if (! empty($arr['x509_issuer'])) { - $require[] = "ISSUER '" - . $GLOBALS['dbi']->escapeString($arr['x509_issuer']) . "'"; - } - if (! empty($arr['x509_subject'])) { - $require[] = "SUBJECT '" - . $GLOBALS['dbi']->escapeString($arr['x509_subject']) . "'"; - } - if (count($require)) { - $require_clause = " REQUIRE " . implode(" AND ", $require); - } else { - $require_clause = " REQUIRE NONE"; - } - } elseif (isset($arr['ssl_type']) && $arr['ssl_type'] == 'X509') { - $require_clause = " REQUIRE X509"; - } elseif (isset($arr['ssl_type']) && $arr['ssl_type'] == 'ANY') { - $require_clause = " REQUIRE SSL"; - } else { - $require_clause = " REQUIRE NONE"; - } - - return $require_clause; -} - -/** - * Get a WITH clause for 'update privileges' and 'add user' - * - * @return string $sql_query - */ -function PMA_getWithClauseForAddUserAndUpdatePrivs() -{ - $sql_query = ''; - if ((isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y') - || (isset($GLOBALS['Grant_priv']) && $GLOBALS['Grant_priv'] == 'Y') - ) { - $sql_query .= ' GRANT OPTION'; - } - if (isset($_POST['max_questions']) || isset($GLOBALS['max_questions'])) { - $max_questions = isset($_POST['max_questions']) - ? (int)$_POST['max_questions'] : (int)$GLOBALS['max_questions']; - $max_questions = max(0, $max_questions); - $sql_query .= ' MAX_QUERIES_PER_HOUR ' . $max_questions; - } - if (isset($_POST['max_connections']) || isset($GLOBALS['max_connections'])) { - $max_connections = isset($_POST['max_connections']) - ? (int)$_POST['max_connections'] : (int)$GLOBALS['max_connections']; - $max_connections = max(0, $max_connections); - $sql_query .= ' MAX_CONNECTIONS_PER_HOUR ' . $max_connections; - } - if (isset($_POST['max_updates']) || isset($GLOBALS['max_updates'])) { - $max_updates = isset($_POST['max_updates']) - ? (int)$_POST['max_updates'] : (int)$GLOBALS['max_updates']; - $max_updates = max(0, $max_updates); - $sql_query .= ' MAX_UPDATES_PER_HOUR ' . $max_updates; - } - if (isset($_POST['max_user_connections']) - || isset($GLOBALS['max_user_connections']) - ) { - $max_user_connections = isset($_POST['max_user_connections']) - ? (int)$_POST['max_user_connections'] - : (int)$GLOBALS['max_user_connections']; - $max_user_connections = max(0, $max_user_connections); - $sql_query .= ' MAX_USER_CONNECTIONS ' . $max_user_connections; - } - return ((!empty($sql_query)) ? ' WITH' . $sql_query : ''); -} - -/** - * Get HTML for addUsersForm, This function call if isset($_REQUEST['adduser']) - * - * @param string $dbname database name - * - * @return string HTML for addUserForm - */ -function PMA_getHtmlForAddUser($dbname) -{ - $html_output = '

    ' . "\n" - . Util::getIcon('b_usradd.png') . __('Add user account') . "\n" - . '

    ' . "\n" - . '
    ' . "\n" - . PMA_URL_getHiddenInputs('', '') - . PMA_getHtmlForLoginInformationFields('new'); - - $html_output .= '
    ' . "\n" - . '' . __('Database for user account') . '' . "\n"; - - $html_output .= Util::getCheckbox( - 'createdb-1', - __('Create database with same name and grant all privileges.'), - false, false, 'createdb-1' - ); - $html_output .= '
    ' . "\n"; - $html_output .= Util::getCheckbox( - 'createdb-2', - __('Grant all privileges on wildcard name (username\\_%).'), - false, false, 'createdb-2' - ); - $html_output .= '
    ' . "\n"; - - if (! empty($dbname) ) { - $html_output .= Util::getCheckbox( - 'createdb-3', - sprintf( - __('Grant all privileges on database "%s".'), - htmlspecialchars($dbname) - ), - true, - false, - 'createdb-3' - ); - $html_output .= '' . "\n"; - $html_output .= '
    ' . "\n"; - } - - $html_output .= '
    ' . "\n"; - if ($GLOBALS['is_grantuser']) { - $html_output .= PMA_getHtmlToDisplayPrivilegesTable('*', '*', false); - } - $html_output .= '' . "\n" - . '
    ' . "\n"; - - return $html_output; -} - -/** - * Get the list of privileges and list of compared privileges as strings - * and return a array that contains both strings - * - * @return array $list_of_privileges, $list_of_compared_privileges - */ -function PMA_getListOfPrivilegesAndComparedPrivileges() -{ - $list_of_privileges - = '`User`, ' - . '`Host`, ' - . '`Select_priv`, ' - . '`Insert_priv`, ' - . '`Update_priv`, ' - . '`Delete_priv`, ' - . '`Create_priv`, ' - . '`Drop_priv`, ' - . '`Grant_priv`, ' - . '`Index_priv`, ' - . '`Alter_priv`, ' - . '`References_priv`, ' - . '`Create_tmp_table_priv`, ' - . '`Lock_tables_priv`, ' - . '`Create_view_priv`, ' - . '`Show_view_priv`, ' - . '`Create_routine_priv`, ' - . '`Alter_routine_priv`, ' - . '`Execute_priv`'; - - $listOfComparedPrivs - = '`Select_priv` = \'N\'' - . ' AND `Insert_priv` = \'N\'' - . ' AND `Update_priv` = \'N\'' - . ' AND `Delete_priv` = \'N\'' - . ' AND `Create_priv` = \'N\'' - . ' AND `Drop_priv` = \'N\'' - . ' AND `Grant_priv` = \'N\'' - . ' AND `References_priv` = \'N\'' - . ' AND `Create_tmp_table_priv` = \'N\'' - . ' AND `Lock_tables_priv` = \'N\'' - . ' AND `Create_view_priv` = \'N\'' - . ' AND `Show_view_priv` = \'N\'' - . ' AND `Create_routine_priv` = \'N\'' - . ' AND `Alter_routine_priv` = \'N\'' - . ' AND `Execute_priv` = \'N\''; - - $list_of_privileges .= - ', `Event_priv`, ' - . '`Trigger_priv`'; - $listOfComparedPrivs .= - ' AND `Event_priv` = \'N\'' - . ' AND `Trigger_priv` = \'N\''; - return array($list_of_privileges, $listOfComparedPrivs); -} - -/** - * Get the HTML for routine based privileges - * - * @param string $db database name - * @param string $odd_row row styling - * @param string $index_checkbox starting index for rows to be added - * - * @return string $html_output - */ -function PMA_getHtmlTableBodyForSpecificDbRoutinePrivs($db, $odd_row, $index_checkbox) -{ - $sql_query = 'SELECT * FROM `mysql`.`procs_priv` WHERE Db = \'' . $GLOBALS['dbi']->escapeString($db) . '\';'; - $res = $GLOBALS['dbi']->query($sql_query); - $html_output = ''; - while ($row = $GLOBALS['dbi']->fetchAssoc($res)) { - - $html_output .= '
    ' . htmlspecialchars($row['User']) - . '' . htmlspecialchars($row['Host']) - . '' . 'routine' - . '' . '' . htmlspecialchars($row['Routine_name']) . '' - . '' . 'Yes' - . ''; - if ($GLOBALS['is_grantuser']) { - $specific_db = (isset($row['Db']) && $row['Db'] != '*') - ? $row['Db'] : ''; - $specific_table = (isset($row['Table_name']) - && $row['Table_name'] != '*') - ? $row['Table_name'] : ''; - $html_output .= PMA_getUserLink( - 'edit', - $current_user, - $current_host, - $specific_db, - $specific_table, - $routine - ); - } - $html_output .= '
    '; - $html_output .= PMA_getHtmlForPrivsTableHead(); - $privMap = PMA_getPrivMap($db); - $html_output .= PMA_getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db); - $html_output .= '
    '; - - $html_output .= '
    '; - $html_output .= Util::getWithSelected( - $GLOBALS['pmaThemeImage'], $GLOBALS['text_dir'], "usersForm" - ); - $html_output .= Util::getButtonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_export', - __('Export'), 'b_tblexport.png', 'export' - ); - - $html_output .= '
    '; - $html_output .= ''; - } else { - $html_output .= PMA_getHtmlForViewUsersError(); - } - - if ($GLOBALS['is_ajax_request'] == true - && empty($_REQUEST['ajax_page_request']) - ) { - $message = Message::success(__('User has been added.')); - $response = PMA\libraries\Response::getInstance(); - $response->addJSON('message', $message); - $response->addJSON('user_form', $html_output); - exit; - } else { - // Offer to create a new user for the current database - $html_output .= PMA_getAddUserHtmlFieldset($db); - } - return $html_output; -} - -/** - * Get the HTML for user form and check the privileges for a particular table. - * - * @param string $db database name - * @param string $table table name - * - * @return string $html_output - */ -function PMA_getHtmlForSpecificTablePrivileges($db, $table) -{ - $html_output = ''; - if ($GLOBALS['is_superuser']) { - // check the privileges for a particular table. - $html_output = '
    '; - $html_output .= PMA_URL_getHiddenInputs($db, $table); - $html_output .= '
    '; - $html_output .= '' - . Util::getIcon('b_usrcheck.png') - . sprintf( - __('Users having access to "%s"'), - '' - . htmlspecialchars($db) . '.' . htmlspecialchars($table) - . '' - ) - . ''; - - $html_output .= ''; - $html_output .= PMA_getHtmlForPrivsTableHead(); - $privMap = PMA_getPrivMap($db); - $sql_query = "SELECT `User`, `Host`, `Db`," - . " 't' AS `Type`, `Table_name`, `Table_priv`" - . " FROM `mysql`.`tables_priv`" - . " WHERE '" . $GLOBALS['dbi']->escapeString($db) . "' LIKE `Db`" - . " AND '" . $GLOBALS['dbi']->escapeString($table) . "' LIKE `Table_name`" - . " AND NOT (`Table_priv` = '' AND Column_priv = '')" - . " ORDER BY `User` ASC, `Host` ASC, `Db` ASC, `Table_priv` ASC;"; - $res = $GLOBALS['dbi']->query($sql_query); - PMA_mergePrivMapFromResult($privMap, $res); - $html_output .= PMA_getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db); - $html_output .= '
    '; - - $html_output .= '
    '; - $html_output .= Util::getWithSelected( - $GLOBALS['pmaThemeImage'], $GLOBALS['text_dir'], "usersForm" - ); - $html_output .= Util::getButtonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_export', - __('Export'), 'b_tblexport.png', 'export' - ); - - $html_output .= '
    '; - $html_output .= '
    '; - } else { - $html_output .= PMA_getHtmlForViewUsersError(); - } - // Offer to create a new user for the current database - $html_output .= PMA_getAddUserHtmlFieldset($db, $table); - return $html_output; -} - -/** - * gets privilege map - * - * @param string $db the database - * - * @return array $privMap the privilege map - */ -function PMA_getPrivMap($db) -{ - list($listOfPrivs, $listOfComparedPrivs) - = PMA_getListOfPrivilegesAndComparedPrivileges(); - $sql_query - = "(" - . " SELECT " . $listOfPrivs . ", '*' AS `Db`, 'g' AS `Type`" - . " FROM `mysql`.`user`" - . " WHERE NOT (" . $listOfComparedPrivs . ")" - . ")" - . " UNION " - . "(" - . " SELECT " . $listOfPrivs . ", `Db`, 'd' AS `Type`" - . " FROM `mysql`.`db`" - . " WHERE '" . $GLOBALS['dbi']->escapeString($db) . "' LIKE `Db`" - . " AND NOT (" . $listOfComparedPrivs . ")" - . ")" - . " ORDER BY `User` ASC, `Host` ASC, `Db` ASC;"; - $res = $GLOBALS['dbi']->query($sql_query); - $privMap = array(); - PMA_mergePrivMapFromResult($privMap, $res); - return $privMap; -} - -/** - * merge privilege map and rows from resultset - * - * @param array &$privMap the privilege map reference - * @param object $result the resultset of query - * - * @return void - */ -function PMA_mergePrivMapFromResult(&$privMap, $result) -{ - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $user = $row['User']; - $host = $row['Host']; - if (! isset($privMap[$user])) { - $privMap[$user] = array(); - } - if (! isset($privMap[$user][$host])) { - $privMap[$user][$host] = array(); - } - $privMap[$user][$host][] = $row; - } -} - -/** - * Get HTML snippet for privileges table head - * - * @return string $html_output - */ -function PMA_getHtmlForPrivsTableHead() -{ - return '' - . '' - . '' - . '' . __('User name') . '' - . '' . __('Host name') . '' - . '' . __('Type') . '' - . '' . __('Privileges') . '' - . '' . __('Grant') . '' - . '' . __('Action') . '' - . '' - . ''; -} - -/** - * Get HTML error for View Users form - * For non superusers such as grant/create users - * - * @return string $html_output - */ -function PMA_getHtmlForViewUsersError() -{ - return Message::error( - __('Not enough privilege to view users.') - )->getDisplay(); -} - -/** - * Get HTML snippet for table body of specific database or table privileges - * - * @param array $privMap privilege map - * @param string $db database - * - * @return string $html_output - */ -function PMA_getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db) -{ - $html_output = ''; - $index_checkbox = 0; - $odd_row = true; - if (empty($privMap)) { - $html_output .= '' - . '' - . __('No user found.') - . '' - . '' - . ''; - return $html_output; - } - - foreach ($privMap as $current_user => $val) { - foreach ($val as $current_host => $current_privileges) { - $nbPrivileges = count($current_privileges); - $html_output .= ''; - - $value = htmlspecialchars($current_user . '&#27;' . $current_host); - $html_output .= ' 1) { - $html_output .= ' rowspan="' . $nbPrivileges . '"'; - } - $html_output .= '>'; - $html_output .= '' . "\n"; - - // user - $html_output .= ' 1) { - $html_output .= ' rowspan="' . $nbPrivileges . '"'; - } - $html_output .= '>'; - if (empty($current_user)) { - $html_output .= '' - . __('Any') . ''; - } else { - $html_output .= htmlspecialchars($current_user); - } - $html_output .= ''; - - // host - $html_output .= ' 1) { - $html_output .= ' rowspan="' . $nbPrivileges . '"'; - } - $html_output .= '>'; - $html_output .= htmlspecialchars($current_host); - $html_output .= ''; - - $html_output .= PMA_getHtmlListOfPrivs( - $db, $current_privileges, $current_user, - $current_host, $odd_row - ); - - $odd_row = ! $odd_row; - } - } - - //For fetching routine based privileges - $html_output .= PMA_getHtmlTableBodyForSpecificDbRoutinePrivs($db, $odd_row, $index_checkbox); - $html_output .= ''; - - return $html_output; -} - -/** - * Get HTML to display privileges - * - * @param string $db Database name - * @param array $current_privileges List of privileges - * @param string $current_user Current user - * @param string $current_host Current host - * @param boolean $odd_row Current row is odd - * - * @return string HTML to display privileges - */ -function PMA_getHtmlListOfPrivs( - $db, $current_privileges, $current_user, - $current_host, $odd_row -) { - $nbPrivileges = count($current_privileges); - $html_output = null; - for ($i = 0; $i < $nbPrivileges; $i++) { - $current = $current_privileges[$i]; - - // type - $html_output .= ''; - if ($current['Type'] == 'g') { - $html_output .= __('global'); - } elseif ($current['Type'] == 'd') { - if ($current['Db'] == Util::escapeMysqlWildcards($db)) { - $html_output .= __('database-specific'); - } else { - $html_output .= __('wildcard') . ': ' - . '' - . htmlspecialchars($current['Db']) - . ''; - } - } elseif ($current['Type'] == 't') { - $html_output .= __('table-specific'); - } - $html_output .= ''; - - // privileges - $html_output .= ''; - if (isset($current['Table_name'])) { - $privList = explode(',', $current['Table_priv']); - $privs = array(); - $grantsArr = PMA_getTableGrantsArray(); - foreach ($grantsArr as $grant) { - $privs[$grant[0]] = 'N'; - foreach ($privList as $priv) { - if ($grant[0] == $priv) { - $privs[$grant[0]] = 'Y'; - } - } - } - $html_output .= '' - . join( - ',', - PMA_extractPrivInfo($privs, true, true) - ) - . ''; - } else { - $html_output .= '' - . join( - ',', - PMA_extractPrivInfo($current, true, false) - ) - . ''; - } - $html_output .= ''; - - // grant - $html_output .= ''; - $containsGrant = false; - if (isset($current['Table_name'])) { - $privList = explode(',', $current['Table_priv']); - foreach ($privList as $priv) { - if ($priv == 'Grant') { - $containsGrant = true; - } - } - } else { - $containsGrant = $current['Grant_priv'] == 'Y'; - } - $html_output .= ($containsGrant ? __('Yes') : __('No')); - $html_output .= ''; - - // action - $html_output .= ''; - if ($GLOBALS['is_grantuser']) { - $specific_db = (isset($current['Db']) && $current['Db'] != '*') - ? $current['Db'] : ''; - $specific_table = (isset($current['Table_name']) - && $current['Table_name'] != '*') - ? $current['Table_name'] : ''; - $html_output .= PMA_getUserLink( - 'edit', - $current_user, - $current_host, - $specific_db, - $specific_table - ); - } - $html_output .= ''; - - $html_output .= ''; - if (($i + 1) < $nbPrivileges) { - $html_output .= ''; - } - } - return $html_output; -} - -/** - * Returns edit, revoke or export link for a user. - * - * @param string $linktype The link type (edit | revoke | export) - * @param string $username User name - * @param string $hostname Host name - * @param string $dbname Database name - * @param string $tablename Table name - * @param string $routinename Routine name - * @param string $initial Initial value - * - * @return string HTML code with link - */ -function PMA_getUserLink( - $linktype, $username, $hostname, $dbname = '', - $tablename = '', $routinename = '', $initial = '' -) { - $html = ' $username, - 'hostname' => $hostname - ); - switch($linktype) { - case 'edit': - $params['dbname'] = $dbname; - $params['tablename'] = $tablename; - $params['routinename'] = $routinename; - break; - case 'revoke': - $params['dbname'] = $dbname; - $params['tablename'] = $tablename; - $params['routinename'] = $routinename; - $params['revokeall'] = 1; - break; - case 'export': - $params['initial'] = $initial; - $params['export'] = 1; - break; - } - - $html .= ' href="server_privileges.php' - . PMA_URL_getCommon($params) - . '">'; - - switch($linktype) { - case 'edit': - $html .= Util::getIcon('b_usredit.png', __('Edit privileges')); - break; - case 'revoke': - $html .= Util::getIcon('b_usrdrop.png', __('Revoke')); - break; - case 'export': - $html .= Util::getIcon('b_tblexport.png', __('Export')); - break; - } - $html .= ''; - - return $html; -} - -/** - * Returns user group edit link - * - * @param string $username User name - * - * @return string HTML code with link - */ -function PMA_getUserGroupEditLink($username) -{ - return '' - . Util::getIcon('b_usrlist.png', __('Edit user group')) - . ''; -} - -/** - * Returns number of defined user groups - * - * @return integer $user_group_count - */ -function PMA_getUserGroupCount() -{ - $cfgRelation = PMA_getRelationsParam(); - $user_group_table = Util::backquote($cfgRelation['db']) - . '.' . Util::backquote($cfgRelation['usergroups']); - $sql_query = 'SELECT COUNT(*) FROM ' . $user_group_table; - $user_group_count = $GLOBALS['dbi']->fetchValue( - $sql_query, 0, 0, $GLOBALS['controllink'] - ); - - return $user_group_count; -} - -/** - * Returns name of user group that user is part of - * - * @param string $username User name - * - * @return mixed usergroup if found or null if not found - */ -function PMA_getUserGroupForUser($username) -{ - $cfgRelation = PMA_getRelationsParam(); - - if (! isset($cfgRelation['db']) - || ! isset($cfgRelation['users']) - ) { - return null; - } - - $user_table = Util::backquote($cfgRelation['db']) - . '.' . Util::backquote($cfgRelation['users']); - $sql_query = 'SELECT `usergroup` FROM ' . $user_table - . ' WHERE `username` = \'' . $username . '\'' - . ' LIMIT 1'; - - $usergroup = $GLOBALS['dbi']->fetchValue( - $sql_query, 0, 0, $GLOBALS['controllink'] - ); - - if ($usergroup === false) { - return null; - } - - return $usergroup; -} - -/** - * This function return the extra data array for the ajax behavior - * - * @param string $password password - * @param string $sql_query sql query - * @param string $hostname hostname - * @param string $username username - * - * @return array $extra_data - */ -function PMA_getExtraDataForAjaxBehavior( - $password, $sql_query, $hostname, $username -) { - if (isset($GLOBALS['dbname'])) { - //if (preg_match('/\\\\(?:_|%)/i', $dbname)) { - if (preg_match('/(?' . "\n" - . ' ' - . '' . "\n" - . '' . "\n" - . '' . htmlspecialchars($hostname) . '' . "\n"; - - $new_user_string .= ''; - - if (! empty($password) || isset($_POST['pma_pw'])) { - $new_user_string .= __('Yes'); - } else { - $new_user_string .= '' - . __('No') - . ''; - }; - - $new_user_string .= '' . "\n"; - $new_user_string .= '' - . '' . join(', ', PMA_extractPrivInfo(null, true)) . '' - . ''; //Fill in privileges here - - // if $cfg['Servers'][$i]['users'] and $cfg['Servers'][$i]['usergroups'] are - // enabled - $cfgRelation = PMA_getRelationsParam(); - if (isset($cfgRelation['users']) && isset($cfgRelation['usergroups'])) { - $new_user_string .= ''; - } - - $new_user_string .= ''; - if ((isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y')) { - $new_user_string .= __('Yes'); - } else { - $new_user_string .= __('No'); - } - $new_user_string .=''; - - if ($GLOBALS['is_grantuser']) { - $new_user_string .= '' - . PMA_getUserLink('edit', $username, $hostname) - . '' . "\n"; - } - - if ($cfgRelation['menuswork'] && $user_group_count > 0) { - $new_user_string .= '' - . PMA_getUserGroupEditLink($username) - . '' . "\n"; - } - - $new_user_string .= '' - . PMA_getUserLink( - 'export', - $username, - $hostname, - '', - '', - '', - isset($_GET['initial']) ? $_GET['initial'] : '' - ) - . '' . "\n"; - - $new_user_string .= ''; - - $extra_data['new_user_string'] = $new_user_string; - - /** - * Generate the string for this alphabet's initial, to update the user - * pagination - */ - $new_user_initial = mb_strtoupper( - mb_substr($username, 0, 1) - ); - $newUserInitialString = '' - . $new_user_initial . ''; - $extra_data['new_user_initial'] = $new_user_initial; - $extra_data['new_user_initial_string'] = $newUserInitialString; - } - - if (isset($_POST['update_privs'])) { - $extra_data['db_specific_privs'] = false; - $extra_data['db_wildcard_privs'] = false; - if (isset($dbname_is_wildcard)) { - $extra_data['db_specific_privs'] = ! $dbname_is_wildcard; - $extra_data['db_wildcard_privs'] = $dbname_is_wildcard; - } - $new_privileges = join(', ', PMA_extractPrivInfo(null, true)); - - $extra_data['new_privileges'] = $new_privileges; - } - - if (isset($_REQUEST['validate_username'])) { - $sql_query = "SELECT * FROM `mysql`.`user` WHERE `User` = '" - . $_REQUEST['username'] . "';"; - $res = $GLOBALS['dbi']->query($sql_query); - $row = $GLOBALS['dbi']->fetchRow($res); - if (empty($row)) { - $extra_data['user_exists'] = false; - } else { - $extra_data['user_exists'] = true; - } - } - - return $extra_data; -} - -/** - * Get the HTML snippet for change user login information - * - * @param string $username username - * @param string $hostname host name - * - * @return string HTML snippet - */ -function PMA_getChangeLoginInformationHtmlForm($username, $hostname) -{ - $choices = array( - '4' => __('… keep the old one.'), - '1' => __('… delete the old one from the user tables.'), - '2' => __( - '… revoke all active privileges from ' - . 'the old one and delete it afterwards.' - ), - '3' => __( - '… delete the old one from the user tables ' - . 'and reload the privileges afterwards.' - ) - ); - - $html_output = '' . "\n"; - - return $html_output; -} - -/** - * Provide a line with links to the relevant database and table - * - * @param string $url_dbname url database name that urlencode() string - * @param string $dbname database name - * @param string $tablename table name - * - * @return string HTML snippet - */ -function PMA_getLinkToDbAndTable($url_dbname, $dbname, $tablename) -{ - $html_output = '[ ' . __('Database') - . ' ' - . htmlspecialchars($dbname) . ': ' - . Util::getTitleForTarget( - $GLOBALS['cfg']['DefaultTabDatabase'] - ) - . " ]\n"; - - if (mb_strlen($tablename)) { - $html_output .= ' [ ' . __('Table') . ' ' . htmlspecialchars($tablename) . ': ' - . Util::getTitleForTarget( - $GLOBALS['cfg']['DefaultTabTable'] - ) - . " ]\n"; - } - return $html_output; -} - -/** - * no db name given, so we want all privs for the given user - * db name was given, so we want all user specific rights for this db - * So this function returns user rights as an array - * - * @param string $username username - * @param string $hostname host name - * @param string $type database or table - * @param string $dbname database name - * - * @return array $db_rights database rights - */ -function PMA_getUserSpecificRights($username, $hostname, $type, $dbname = '') -{ - $user_host_condition = " WHERE `User`" - . " = '" . $GLOBALS['dbi']->escapeString($username) . "'" - . " AND `Host`" - . " = '" . $GLOBALS['dbi']->escapeString($hostname) . "'"; - - if ($type == 'database') { - $tables_to_search_for_users = array( - 'tables_priv', 'columns_priv', 'procs_priv' - ); - $dbOrTableName = 'Db'; - } elseif ($type == 'table') { - $user_host_condition .= " AND `Db` LIKE '" - . $GLOBALS['dbi']->escapeString($dbname) . "'"; - $tables_to_search_for_users = array('columns_priv',); - $dbOrTableName = 'Table_name'; - } else { // routine - $user_host_condition .= " AND `Db` LIKE '" - . $GLOBALS['dbi']->escapeString($dbname) . "'"; - $tables_to_search_for_users = array('procs_priv',); - $dbOrTableName = 'Routine_name'; - } - - // we also want privileges for this user not in table `db` but in other table - $tables = $GLOBALS['dbi']->fetchResult('SHOW TABLES FROM `mysql`;'); - - $db_rights_sqls = array(); - foreach ($tables_to_search_for_users as $table_search_in) { - if (in_array($table_search_in, $tables)) { - $db_rights_sqls[] = ' - SELECT DISTINCT `' . $dbOrTableName . '` - FROM `mysql`.' . Util::backquote($table_search_in) - . $user_host_condition; - } - } - - $user_defaults = array( - $dbOrTableName => '', - 'Grant_priv' => 'N', - 'privs' => array('USAGE'), - 'Column_priv' => true, - ); - - // for the rights - $db_rights = array(); - - $db_rights_sql = '(' . implode(') UNION (', $db_rights_sqls) . ')' - . ' ORDER BY `' . $dbOrTableName . '` ASC'; - - $db_rights_result = $GLOBALS['dbi']->query($db_rights_sql); - - while ($db_rights_row = $GLOBALS['dbi']->fetchAssoc($db_rights_result)) { - $db_rights_row = array_merge($user_defaults, $db_rights_row); - if ($type == 'database') { - // only Db names in the table `mysql`.`db` uses wildcards - // as we are in the db specific rights display we want - // all db names escaped, also from other sources - $db_rights_row['Db'] = Util::escapeMysqlWildcards( - $db_rights_row['Db'] - ); - } - $db_rights[$db_rights_row[$dbOrTableName]] = $db_rights_row; - } - - $GLOBALS['dbi']->freeResult($db_rights_result); - - if ($type == 'database') { - $sql_query = 'SELECT * FROM `mysql`.`db`' - . $user_host_condition . ' ORDER BY `Db` ASC'; - } elseif ($type == 'table') { - $sql_query = 'SELECT `Table_name`,' - . ' `Table_priv`,' - . ' IF(`Column_priv` = _latin1 \'\', 0, 1)' - . ' AS \'Column_priv\'' - . ' FROM `mysql`.`tables_priv`' - . $user_host_condition - . ' ORDER BY `Table_name` ASC;'; - } else { - $sql_query = "SELECT `Routine_name`, `Proc_priv`" - . " FROM `mysql`.`procs_priv`" - . $user_host_condition - . " ORDER BY `Routine_name`"; - - } - - $result = $GLOBALS['dbi']->query($sql_query); - - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - if (isset($db_rights[$row[$dbOrTableName]])) { - $db_rights[$row[$dbOrTableName]] - = array_merge($db_rights[$row[$dbOrTableName]], $row); - } else { - $db_rights[$row[$dbOrTableName]] = $row; - } - if ($type == 'database') { - // there are db specific rights for this user - // so we can drop this db rights - $db_rights[$row['Db']]['can_delete'] = true; - } - } - $GLOBALS['dbi']->freeResult($result); - return $db_rights; -} - -/** - * Get a HTML table for display user's tabel specific or database specific rights - * - * @param string $username username - * @param string $hostname host name - * @param string $type database, table or routine - * @param string $dbname database name - * - * @return array $html_output - */ -function PMA_getHtmlForAllTableSpecificRights( - $username, $hostname, $type, $dbname = '' -) { - $uiData = array( - 'database' => array( - 'formId' => 'database_specific_priv', - 'subMenuLabel' => __('Database'), - 'legend' => __('Database-specific privileges'), - 'typeLabel' => __('Database'), - ), - 'table' => array( - 'formId' => 'table_specific_priv', - 'subMenuLabel' => __('Table'), - 'legend' => __('Table-specific privileges'), - 'typeLabel' => __('Table'), - ), - 'routine' => array( - 'formId' => 'routine_specific_priv', - 'subMenuLabel' => __('Routine'), - 'legend' => __('Routine-specific privileges'), - 'typeLabel' => __('Routine'), - ), - ); - - /** - * no db name given, so we want all privs for the given user - * db name was given, so we want all user specific rights for this db - */ - $db_rights = PMA_getUserSpecificRights($username, $hostname, $type, $dbname); - ksort($db_rights); - - $foundRows = array(); - $privileges = array(); - foreach ($db_rights as $row) { - $onePrivilege = array(); - - $paramTableName = ''; - $paramRoutineName = ''; - - if ($type == 'database') { - $name = $row['Db']; - $onePrivilege['grant'] = $row['Grant_priv'] == 'Y'; - $onePrivilege['tablePrivs'] = ! empty($row['Table_priv']) - || ! empty($row['Column_priv']); - $onePrivilege['privileges'] = join(',', PMA_extractPrivInfo($row, true)); - - $paramDbName = $row['Db']; - - } elseif ($type == 'table') { - $name = $row['Table_name']; - $onePrivilege['grant'] = in_array( - 'Grant', - explode(',', $row['Table_priv']) - ); - $onePrivilege['columnPrivs'] = ! empty($row['Column_priv']); - $onePrivilege['privileges'] = join(',', PMA_extractPrivInfo($row, true)); - - $paramDbName = $dbname; - $paramTableName = $row['Table_name']; - - } else { // routine - $name = $row['Routine_name']; - $onePrivilege['grant'] = in_array( - 'Grant', - explode(',', $row['Proc_priv']) - ); - - $privs = array( - 'Alter_routine_priv' => 'N', - 'Execute_priv' => 'N', - 'Grant_priv' => 'N', - ); - foreach (explode(',', $row['Proc_priv']) as $priv) { - if ($priv == 'Alter Routine') { - $privs['Alter_routine_priv'] = 'Y'; - } else { - $privs[$priv . '_priv'] = 'Y'; - } - } - $onePrivilege['privileges'] = join( - ',', - PMA_extractPrivInfo($privs, true) - ); - - $paramDbName = $dbname; - $paramRoutineName = $row['Routine_name']; - } - - $foundRows[] = $name; - $onePrivilege['name'] = $name; - - $onePrivilege['editLink'] = ''; - if ($GLOBALS['is_grantuser']) { - $onePrivilege['editLink'] = PMA_getUserLink( - 'edit', - $username, - $hostname, - $paramDbName, - $paramTableName, - $paramRoutineName - ); - } - - $onePrivilege['revokeLink'] = ''; - if ($type != 'database' || ! empty($row['can_delete'])) { - $onePrivilege['revokeLink'] = PMA_getUserLink( - 'revoke', - $username, - $hostname, - $paramDbName, - $paramTableName, - $paramRoutineName - ); - } - - $privileges[] = $onePrivilege; - } - - $data = $uiData[$type]; - $data['privileges'] = $privileges; - $data['userName'] = $username; - $data['hostName'] = $hostname; - $data['database'] = $dbname; - $data['type'] = $type; - - if ($type == 'database') { - - // we already have the list of databases from libraries/common.inc.php - // via $pma = new PMA; - $pred_db_array = $GLOBALS['dblist']->databases; - $databases_to_skip = array('information_schema', 'performance_schema'); - - $databases = array(); - if (! empty($pred_db_array)) { - foreach ($pred_db_array as $current_db) { - if (in_array($current_db, $databases_to_skip)) { - continue; - } - $current_db_escaped = Util::escapeMysqlWildcards($current_db); - // cannot use array_diff() once, outside of the loop, - // because the list of databases has special characters - // already escaped in $foundRows, - // contrary to the output of SHOW DATABASES - if (! in_array($current_db_escaped, $foundRows)) { - $databases[] = $current_db; - } - } - } - $data['databases'] = $databases; - - } elseif ($type == 'table') { - $result = @$GLOBALS['dbi']->tryQuery( - "SHOW TABLES FROM " . Util::backquote($dbname), - null, - DatabaseInterface::QUERY_STORE - ); - - $tables = array(); - if ($result) { - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - if (! in_array($row[0], $foundRows)) { - $tables[] = $row[0]; - } - } - $GLOBALS['dbi']->freeResult($result); - } - $data['tables'] = $tables; - - } else { // routine - $routineData = $GLOBALS['dbi']->getRoutines($dbname); - - $routines = array(); - foreach ($routineData as $routine) { - if (! in_array($routine['name'], $foundRows)) { - $routines[] = $routine['name']; - } - } - $data['routines'] = $routines; - } - - $html_output = Template::get('privileges/privileges_summary') - ->render($data); - - return $html_output; -} - -/** - * Get HTML for display the users overview - * (if less than 50 users, display them immediately) - * - * @param array $result ran sql query - * @param array $db_rights user's database rights array - * @param string $pmaThemeImage a image source link - * @param string $text_dir text directory - * - * @return string HTML snippet - */ -function PMA_getUsersOverview($result, $db_rights, $pmaThemeImage, $text_dir) -{ - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $row['privs'] = PMA_extractPrivInfo($row, true); - $db_rights[$row['User']][$row['Host']] = $row; - } - @$GLOBALS['dbi']->freeResult($result); - $user_group_count = 0; - if ($GLOBALS['cfgRelation']['menuswork']) { - $user_group_count = PMA_getUserGroupCount(); - } - - $html_output - = '
    ' . "\n" - . PMA_URL_getHiddenInputs('', '') - . '' . "\n" - . '' . "\n" - . '' . "\n" - . '' . "\n" - . '' . "\n" - . '' . "\n" - . '' . "\n"; - if ($GLOBALS['cfgRelation']['menuswork']) { - $html_output .= '' . "\n"; - } - $html_output .= '' . "\n" - . '' . "\n" - . '' . "\n" - . '' . "\n"; - - $html_output .= '' . "\n"; - $html_output .= PMA_getHtmlTableBodyForUserRights($db_rights); - $html_output .= '' - . '
    ' . __('User name') . '' . __('Host name') . '' . __('Password') . '' . __('Global privileges') . ' ' - . Util::showHint( - __('Note: MySQL privilege names are expressed in English.') - ) - . '' . __('User group') . '' . __('Grant') . '' - . __('Action') . '
    ' . "\n"; - - $html_output .= '
    ' - . Util::getWithSelected($pmaThemeImage, $text_dir, "usersForm") . "\n"; - - $html_output .= Util::getButtonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_export', - __('Export'), 'b_tblexport.png', 'export' - ); - $html_output .= ''; - $html_output .= '
    ' - . '
    '; - - // add/delete user fieldset - $html_output .= PMA_getFieldsetForAddDeleteUser(); - $html_output .= '
    ' . "\n"; - - return $html_output; -} - -/** - * Get table body for 'tableuserrights' table in userform - * - * @param array $db_rights user's database rights array - * - * @return string HTML snippet - */ -function PMA_getHtmlTableBodyForUserRights($db_rights) -{ - $cfgRelation = PMA_getRelationsParam(); - if ($cfgRelation['menuswork']) { - $users_table = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['users']); - $sql_query = 'SELECT * FROM ' . $users_table; - $result = PMA_queryAsControlUser($sql_query, false); - $group_assignment = array(); - if ($result) { - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $group_assignment[$row['username']] = $row['usergroup']; - } - } - $GLOBALS['dbi']->freeResult($result); - - $user_group_count = PMA_getUserGroupCount(); - } - - $odd_row = true; - $index_checkbox = 0; - $html_output = ''; - foreach ($db_rights as $user) { - ksort($user); - foreach ($user as $host) { - $index_checkbox++; - $html_output .= '' - . "\n"; - $html_output .= '' - . '' . "\n"; - - $html_output .= '' . "\n" - . '' . htmlspecialchars($host['Host']) . '' . "\n"; - - $html_output .= ''; - - $password_column = 'Password'; - - $check_plugin_query = "SELECT * FROM `mysql`.`user` WHERE " - . "`User` = '" . $host['User'] . "' AND `Host` = '" - . $host['Host'] . "'"; - $res = $GLOBALS['dbi']->fetchSingleRow($check_plugin_query); - - if ((isset($res['authentication_string']) - && ! empty($res['authentication_string'])) - || (isset($res['Password']) - && ! empty($res['Password'])) - ) { - $host[$password_column] = 'Y'; - } else { - $host[$password_column] = 'N'; - } - - switch ($host[$password_column]) { - case 'Y': - $html_output .= __('Yes'); - break; - case 'N': - $html_output .= '' . __('No') - . ''; - break; - // this happens if this is a definition not coming from mysql.user - default: - $html_output .= '--'; // in future version, replace by "not present" - break; - } // end switch - - $html_output .= '' . "\n"; - - $html_output .= '' . "\n" - . '' . implode(',' . "\n" . ' ', $host['privs']) . "\n" - . '' . "\n"; - if ($cfgRelation['menuswork']) { - $html_output .= '' . "\n" - . (isset($group_assignment[$host['User']]) - ? htmlspecialchars($group_assignment[$host['User']]) - : '' - ) - . '' . "\n"; - } - $html_output .= '' - . ($host['Grant_priv'] == 'Y' ? __('Yes') : __('No')) - . '' . "\n"; - - if ($GLOBALS['is_grantuser']) { - $html_output .= '' - . PMA_getUserLink( - 'edit', - $host['User'], - $host['Host'] - ) - . ''; - } - if ($cfgRelation['menuswork'] && $user_group_count > 0) { - if (empty($host['User'])) { - $html_output .= ''; - } else { - $html_output .= '' - . PMA_getUserGroupEditLink($host['User']) - . ''; - } - } - $html_output .= '' - . PMA_getUserLink( - 'export', - $host['User'], - $host['Host'], - '', - '', - '', - isset($_GET['initial']) ? $_GET['initial'] : '' - ) - . ''; - $html_output .= ''; - $odd_row = ! $odd_row; - } - } - return $html_output; -} - -/** - * Get HTML fieldset for Add/Delete user - * - * @return string HTML snippet - */ -function PMA_getFieldsetForAddDeleteUser() -{ - $html_output = PMA_getAddUserHtmlFieldset(); - $html_output .= '
    ' - . '' . "\n" - . Util::getIcon('b_usrdrop.png') - . ' ' . __('Remove selected user accounts') . '' . "\n" - . '' . "\n"; - - $html_output .= '' . "\n" - . '(' - . __( - 'Revoke all active privileges from the users ' - . 'and delete them afterwards.' - ) - . ')' - . '
    ' . "\n"; - - $html_output .= '' . "\n"; - - $html_output .= '' . "\n" - . '
    ' . "\n"; - - $html_output .= '' . "\n"; - - return $html_output; -} - -/** - * Get HTML for Displays the initials - * - * @param array $array_initials array for all initials, even non A-Z - * - * @return string HTML snippet - */ -function PMA_getHtmlForInitials($array_initials) -{ - // initialize to false the letters A-Z - for ($letter_counter = 1; $letter_counter < 27; $letter_counter++) { - if (! isset($array_initials[mb_chr($letter_counter + 64)])) { - $array_initials[mb_chr($letter_counter + 64)] = false; - } - } - - $initials = $GLOBALS['dbi']->tryQuery( - 'SELECT DISTINCT UPPER(LEFT(`User`,1)) FROM `user`' - . ' ORDER BY UPPER(LEFT(`User`,1)) ASC', - null, - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - if ($initials) { - while (list($tmp_initial) = $GLOBALS['dbi']->fetchRow($initials)) { - $array_initials[$tmp_initial] = true; - } - } - - // Display the initials, which can be any characters, not - // just letters. For letters A-Z, we add the non-used letters - // as greyed out. - - uksort($array_initials, "strnatcasecmp"); - - $html_output = '' - . ''; - foreach ($array_initials as $tmp_initial => $initial_was_found) { - if ($tmp_initial === null) { - continue; - } - - if (!$initial_was_found) { - $html_output .= ''; - continue; - } - - $html_output .= '' . "\n"; - } - $html_output .= '' . "\n"; - $html_output .= '
    ' . $tmp_initial . '' - . '' . $tmp_initial - . '' - . '' - . '' . __('Show all') . '
    '; - - return $html_output; -} - -/** - * Get the database rights array for Display user overview - * - * @return array $db_rights database rights array - */ -function PMA_getDbRightsForUserOverview() -{ - // we also want users not in table `user` but in other table - $tables = $GLOBALS['dbi']->fetchResult('SHOW TABLES FROM `mysql`;'); - - $tablesSearchForUsers = array( - 'user', 'db', 'tables_priv', 'columns_priv', 'procs_priv', - ); - - $db_rights_sqls = array(); - foreach ($tablesSearchForUsers as $table_search_in) { - if (in_array($table_search_in, $tables)) { - $db_rights_sqls[] = 'SELECT DISTINCT `User`, `Host` FROM `mysql`.`' - . $table_search_in . '` ' - . (isset($_GET['initial']) - ? PMA_rangeOfUsers($_GET['initial']) - : ''); - } - } - $user_defaults = array( - 'User' => '', - 'Host' => '%', - 'Password' => '?', - 'Grant_priv' => 'N', - 'privs' => array('USAGE'), - ); - - // for the rights - $db_rights = array(); - - $db_rights_sql = '(' . implode(') UNION (', $db_rights_sqls) . ')' - . ' ORDER BY `User` ASC, `Host` ASC'; - - $db_rights_result = $GLOBALS['dbi']->query($db_rights_sql); - - while ($db_rights_row = $GLOBALS['dbi']->fetchAssoc($db_rights_result)) { - $db_rights_row = array_merge($user_defaults, $db_rights_row); - $db_rights[$db_rights_row['User']][$db_rights_row['Host']] - = $db_rights_row; - } - $GLOBALS['dbi']->freeResult($db_rights_result); - ksort($db_rights); - - return $db_rights; -} - -/** - * Delete user and get message and sql query for delete user in privileges - * - * @param array $queries queries - * - * @return array Message - */ -function PMA_deleteUser($queries) -{ - $sql_query = ''; - if (empty($queries)) { - $message = Message::error(__('No users selected for deleting!')); - } else { - if ($_REQUEST['mode'] == 3) { - $queries[] = '# ' . __('Reloading the privileges') . ' …'; - $queries[] = 'FLUSH PRIVILEGES;'; - } - $drop_user_error = ''; - foreach ($queries as $sql_query) { - if ($sql_query{0} != '#') { - if (! $GLOBALS['dbi']->tryQuery($sql_query, $GLOBALS['userlink'])) { - $drop_user_error .= $GLOBALS['dbi']->getError() . "\n"; - } - } - } - // tracking sets this, causing the deleted db to be shown in navi - unset($GLOBALS['db']); - - $sql_query = join("\n", $queries); - if (! empty($drop_user_error)) { - $message = Message::rawError($drop_user_error); - } else { - $message = Message::success( - __('The selected users have been deleted successfully.') - ); - } - } - return array($sql_query, $message); -} - -/** - * Update the privileges and return the success or error message - * - * @param string $username username - * @param string $hostname host name - * @param string $tablename table name - * @param string $dbname database name - * @param string $itemType item type - * - * @return Message success message or error message for update - */ -function PMA_updatePrivileges($username, $hostname, $tablename, $dbname, $itemType) -{ - $db_and_table = PMA_wildcardEscapeForGrant($dbname, $tablename); - - $sql_query0 = 'REVOKE ALL PRIVILEGES ON ' . $itemType . ' ' . $db_and_table - . ' FROM \'' . $GLOBALS['dbi']->escapeString($username) - . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\';'; - - if (! isset($_POST['Grant_priv']) || $_POST['Grant_priv'] != 'Y') { - $sql_query1 = 'REVOKE GRANT OPTION ON ' . $itemType . ' ' . $db_and_table - . ' FROM \'' . $GLOBALS['dbi']->escapeString($username) . '\'@\'' - . $GLOBALS['dbi']->escapeString($hostname) . '\';'; - } else { - $sql_query1 = ''; - } - - // Should not do a GRANT USAGE for a table-specific privilege, it - // causes problems later (cannot revoke it) - if (! (mb_strlen($tablename) - && 'USAGE' == implode('', PMA_extractPrivInfo())) - ) { - $sql_query2 = 'GRANT ' . join(', ', PMA_extractPrivInfo()) - . ' ON ' . $itemType . ' ' . $db_and_table - . ' TO \'' . $GLOBALS['dbi']->escapeString($username) . '\'@\'' - . $GLOBALS['dbi']->escapeString($hostname) . '\''; - - if (! mb_strlen($dbname)) { - // add REQUIRE clause - $sql_query2 .= PMA_getRequireClause(); - } - - if ((isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y') - || (! mb_strlen($dbname) - && (isset($_POST['max_questions']) || isset($_POST['max_connections']) - || isset($_POST['max_updates']) - || isset($_POST['max_user_connections']))) - ) { - $sql_query2 .= PMA_getWithClauseForAddUserAndUpdatePrivs(); - } - $sql_query2 .= ';'; - } - if (! $GLOBALS['dbi']->tryQuery($sql_query0)) { - // This might fail when the executing user does not have - // ALL PRIVILEGES himself. - // See https://sourceforge.net/p/phpmyadmin/bugs/3270/ - $sql_query0 = ''; - } - if (! empty($sql_query1) && ! $GLOBALS['dbi']->tryQuery($sql_query1)) { - // this one may fail, too... - $sql_query1 = ''; - } - if (! empty($sql_query2)) { - $GLOBALS['dbi']->query($sql_query2); - } else { - $sql_query2 = ''; - } - $sql_query = $sql_query0 . ' ' . $sql_query1 . ' ' . $sql_query2; - $message = Message::success(__('You have updated the privileges for %s.')); - $message->addParam( - '\'' . htmlspecialchars($username) - . '\'@\'' . htmlspecialchars($hostname) . '\'' - ); - - return array($sql_query, $message); -} - -/** - * Get List of information: Changes / copies a user - * - * @return array - */ -function PMA_getDataForChangeOrCopyUser() -{ - $queries = null; - $password = null; - - if (isset($_REQUEST['change_copy'])) { - $user_host_condition = ' WHERE `User` = ' - . "'" . $GLOBALS['dbi']->escapeString($_REQUEST['old_username']) . "'" - . ' AND `Host` = ' - . "'" . $GLOBALS['dbi']->escapeString($_REQUEST['old_hostname']) . "';"; - $row = $GLOBALS['dbi']->fetchSingleRow( - 'SELECT * FROM `mysql`.`user` ' . $user_host_condition - ); - if (! $row) { - $response = PMA\libraries\Response::getInstance(); - $response->addHTML( - Message::notice(__('No user found.'))->getDisplay() - ); - unset($_REQUEST['change_copy']); - } else { - extract($row, EXTR_OVERWRITE); - foreach ($row as $key => $value) { - $GLOBALS[$key] = $value; - } - // Recent MySQL versions have the field "Password" in mysql.user, - // so the previous extract creates $Password but this script - // uses $password - if (! isset($password) && isset($Password)) { - $password = $Password; - } - if (Util::getServerType() == 'MySQL' - && PMA_MYSQL_INT_VERSION >= 50606 - && PMA_MYSQL_INT_VERSION < 50706 - && ((isset($authentication_string) - && empty($password)) - || (isset($plugin) - && $plugin == 'sha256_password')) - ) { - $password = $authentication_string; - } - - if (Util::getServerType() == 'MariaDB' - && PMA_MYSQL_INT_VERSION >= 50500 - && isset($authentication_string) - && empty($password) - ) { - $password = $authentication_string; - } - - // Always use 'authentication_string' column - // for MySQL 5.7.6+ since it does not have - // the 'password' column at all - if (Util::getServerType() == 'MySQL' - && PMA_MYSQL_INT_VERSION >= 50706 - && isset($authentication_string) - ) { - $password = $authentication_string; - } - - $queries = array(); - } - } - - return array($queries, $password); -} - -/** - * Update Data for information: Deletes users - * - * @param array $queries queries array - * - * @return array - */ -function PMA_getDataForDeleteUsers($queries) -{ - if (isset($_REQUEST['change_copy'])) { - $selected_usr = array( - $_REQUEST['old_username'] . '&#27;' . $_REQUEST['old_hostname'] - ); - } else { - $selected_usr = $_REQUEST['selected_usr']; - $queries = array(); - } - - // this happens, was seen in https://reports.phpmyadmin.net/reports/view/17146 - if (! is_array($selected_usr)) { - return array(); - } - - foreach ($selected_usr as $each_user) { - list($this_user, $this_host) = explode('&#27;', $each_user); - $queries[] = '# ' - . sprintf( - __('Deleting %s'), - '\'' . $this_user . '\'@\'' . $this_host . '\'' - ) - . ' ...'; - $queries[] = 'DROP USER \'' - . $GLOBALS['dbi']->escapeString($this_user) - . '\'@\'' . $GLOBALS['dbi']->escapeString($this_host) . '\';'; - PMA_relationsCleanupUser($this_user); - - if (isset($_REQUEST['drop_users_db'])) { - $queries[] = 'DROP DATABASE IF EXISTS ' - . Util::backquote($this_user) . ';'; - $GLOBALS['reload'] = true; - } - } - return $queries; -} - -/** - * update Message For Reload - * - * @return array - */ -function PMA_updateMessageForReload() -{ - $message = null; - if (isset($_REQUEST['flush_privileges'])) { - $sql_query = 'FLUSH PRIVILEGES;'; - $GLOBALS['dbi']->query($sql_query); - $message = Message::success( - __('The privileges were reloaded successfully.') - ); - } - - if (isset($_REQUEST['validate_username'])) { - $message = Message::success(); - } - - return $message; -} - -/** - * update Data For Queries from queries_for_display - * - * @param array $queries queries array - * @param array|null $queries_for_display queries array for display - * - * @return null - */ -function PMA_getDataForQueries($queries, $queries_for_display) -{ - $tmp_count = 0; - foreach ($queries as $sql_query) { - if ($sql_query{0} != '#') { - $GLOBALS['dbi']->query($sql_query); - } - // when there is a query containing a hidden password, take it - // instead of the real query sent - if (isset($queries_for_display[$tmp_count])) { - $queries[$tmp_count] = $queries_for_display[$tmp_count]; - } - $tmp_count++; - } - - return $queries; -} - -/** - * update Data for information: Adds a user - * - * @param string $dbname db name - * @param string $username user name - * @param string $hostname host name - * @param string $password password - * @param bool $is_menuwork is_menuwork set? - * - * @return array - */ -function PMA_addUser( - $dbname, $username, $hostname, - $password, $is_menuwork -) { - $_add_user_error = false; - $message = null; - $queries = null; - $queries_for_display = null; - $sql_query = null; - - if (!isset($_REQUEST['adduser_submit']) && !isset($_REQUEST['change_copy'])) { - return array( - $message, $queries, $queries_for_display, $sql_query, $_add_user_error - ); - } - - $sql_query = ''; - if ($_POST['pred_username'] == 'any') { - $username = ''; - } - switch ($_POST['pred_hostname']) { - case 'any': - $hostname = '%'; - break; - case 'localhost': - $hostname = 'localhost'; - break; - case 'hosttable': - $hostname = ''; - break; - case 'thishost': - $_user_name = $GLOBALS['dbi']->fetchValue('SELECT USER()'); - $hostname = mb_substr( - $_user_name, - (mb_strrpos($_user_name, '@') + 1) - ); - unset($_user_name); - break; - } - $sql = "SELECT '1' FROM `mysql`.`user`" - . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" - . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "';"; - if ($GLOBALS['dbi']->fetchValue($sql) == 1) { - $message = Message::error(__('The user %s already exists!')); - $message->addParam( - '[em]\'' . $username . '\'@\'' . $hostname . '\'[/em]' - ); - $_REQUEST['adduser'] = true; - $_add_user_error = true; - - return array( - $message, - $queries, - $queries_for_display, - $sql_query, - $_add_user_error - ); - } - - list( - $create_user_real, $create_user_show, $real_sql_query, $sql_query, - $password_set_real, $password_set_show - ) = PMA_getSqlQueriesForDisplayAndAddUser( - $username, $hostname, (isset($password) ? $password : '') - ); - - if (empty($_REQUEST['change_copy'])) { - $_error = false; - - if (isset($create_user_real)) { - if (!$GLOBALS['dbi']->tryQuery($create_user_real)) { - $_error = true; - } - if (isset($password_set_real) && !empty($password_set_real) - && isset($_REQUEST['authentication_plugin']) - ) { - PMA_setProperPasswordHashing( - $_REQUEST['authentication_plugin'] - ); - if ($GLOBALS['dbi']->tryQuery($password_set_real)) { - $sql_query .= $password_set_show; - } - } - $sql_query = $create_user_show . $sql_query; - } - - list($sql_query, $message) = PMA_addUserAndCreateDatabase( - $_error, - $real_sql_query, - $sql_query, - $username, - $hostname, - isset($dbname) ? $dbname : null - ); - if (!empty($_REQUEST['userGroup']) && $is_menuwork) { - PMA_setUserGroup($GLOBALS['username'], $_REQUEST['userGroup']); - } - - return array( - $message, - $queries, - $queries_for_display, - $sql_query, - $_add_user_error - ); - } - - // Copy the user group while copying a user - $old_usergroup = - $_REQUEST['old_usergroup'] ? $_REQUEST['old_usergroup'] : null; - PMA_setUserGroup($_REQUEST['username'], $old_usergroup); - - - if (isset($create_user_real)) { - $queries[] = $create_user_real; - } - $queries[] = $real_sql_query; - - if (isset($password_set_real) && ! empty($password_set_real) - && isset($_REQUEST['authentication_plugin']) - ) { - PMA_setProperPasswordHashing( - $_REQUEST['authentication_plugin'] - ); - - $queries[] = $password_set_real; - } - // we put the query containing the hidden password in - // $queries_for_display, at the same position occupied - // by the real query in $queries - $tmp_count = count($queries); - if (isset($create_user_real)) { - $queries_for_display[$tmp_count - 2] = $create_user_show; - } - if (isset($password_set_real) && ! empty($password_set_real)) { - $queries_for_display[$tmp_count - 3] = $create_user_show; - $queries_for_display[$tmp_count - 2] = $sql_query; - $queries_for_display[$tmp_count - 1] = $password_set_show; - } else { - $queries_for_display[$tmp_count - 1] = $sql_query; - } - - return array( - $message, $queries, $queries_for_display, $sql_query, $_add_user_error - ); -} - -/** - * Sets proper value of `old_passwords` according to - * the authentication plugin selected - * - * @param string $auth_plugin authentication plugin selected - * - * @return void - */ -function PMA_setProperPasswordHashing($auth_plugin) -{ - // Set the hashing method used by PASSWORD() - // to be of type depending upon $authentication_plugin - if ($auth_plugin == 'sha256_password') { - $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 2'); - } else if ($auth_plugin == 'mysql_old_password') { - $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 1'); - } else { - $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 0'); - } -} - -/** - * Update DB information: DB, Table, isWildcard - * - * @return array - */ -function PMA_getDataForDBInfo() -{ - $username = null; - $hostname = null; - $dbname = null; - $tablename = null; - $routinename = null; - $dbname_is_wildcard = null; - - if (isset($_REQUEST['username'])) { - $username = $_REQUEST['username']; - } - if (isset($_REQUEST['hostname'])) { - $hostname = $_REQUEST['hostname']; - } - /** - * Checks if a dropdown box has been used for selecting a database / table - */ - if (PMA_isValid($_REQUEST['pred_tablename'])) { - $tablename = $_REQUEST['pred_tablename']; - } elseif (PMA_isValid($_REQUEST['tablename'])) { - $tablename = $_REQUEST['tablename']; - } else { - unset($tablename); - } - - if (PMA_isValid($_REQUEST['pred_routinename'])) { - $routinename = $_REQUEST['pred_routinename']; - } elseif (PMA_isValid($_REQUEST['routinename'])) { - $routinename = $_REQUEST['routinename']; - } else { - unset($routinename); - } - - if (isset($_REQUEST['pred_dbname'])) { - $is_valid_pred_dbname = true; - foreach ($_REQUEST['pred_dbname'] as $key => $db_name) { - if (! PMA_isValid($db_name)) { - $is_valid_pred_dbname = false; - break; - } - } - } - - if (isset($_REQUEST['dbname'])) { - $is_valid_dbname = true; - if (is_array($_REQUEST['dbname'])) { - foreach ($_REQUEST['dbname'] as $key => $db_name) { - if (! PMA_isValid($db_name)) { - $is_valid_dbname = false; - break; - } - } - } else { - if (! PMA_isValid($_REQUEST['dbname'])) { - $is_valid_dbname = false; - } - } - } - - if (isset($is_valid_pred_dbname) && $is_valid_pred_dbname) { - $dbname = $_REQUEST['pred_dbname']; - // If dbname contains only one database. - if (count($dbname) == 1) { - $dbname = $dbname[0]; - } - } elseif (isset($is_valid_dbname) && $is_valid_dbname) { - $dbname = $_REQUEST['dbname']; - } else { - unset($dbname); - unset($tablename); - } - - if (isset($dbname)) { - if (is_array($dbname)) { - $db_and_table = $dbname; - foreach ($db_and_table as $key => $db_name) { - $db_and_table[$key] .= '.'; - } - } else { - $unescaped_db = Util::unescapeMysqlWildcards($dbname); - $db_and_table = Util::backquote($unescaped_db) . '.'; - } - if (isset($tablename)) { - $db_and_table .= Util::backquote($tablename); - } else { - if (is_array($db_and_table)) { - foreach ($db_and_table as $key => $db_name) { - $db_and_table[$key] .= '*'; - } - } else { - $db_and_table .= '*'; - } - } - } else { - $db_and_table = '*.*'; - } - - // check if given $dbname is a wildcard or not - if (isset($dbname)) { - //if (preg_match('/\\\\(?:_|%)/i', $dbname)) { - if (! is_array($dbname) && preg_match('/(?'; - - if (isset($_REQUEST['selected_usr'])) { - // export privileges for selected users - $title = __('Privileges'); - - //For removing duplicate entries of users - $_REQUEST['selected_usr'] = array_unique($_REQUEST['selected_usr']); - - foreach ($_REQUEST['selected_usr'] as $export_user) { - $export_username = mb_substr( - $export_user, 0, mb_strpos($export_user, '&') - ); - $export_hostname = mb_substr( - $export_user, mb_strrpos($export_user, ';') + 1 - ); - $export .= '# ' - . sprintf( - __('Privileges for %s'), - '`' . htmlspecialchars($export_username) - . '`@`' . htmlspecialchars($export_hostname) . '`' - ) - . "\n\n"; - $export .= PMA_getGrants($export_username, $export_hostname) . "\n"; - } - } else { - // export privileges for a single user - $title = __('User') . ' `' . htmlspecialchars($username) - . '`@`' . htmlspecialchars($hostname) . '`'; - $export .= PMA_getGrants($username, $hostname); - } - // remove trailing whitespace - $export = trim($export); - - $export .= ''; - - return array($title, $export); -} - -/** - * Get HTML for display Add userfieldset - * - * @param string $db the database - * @param string $table the table name - * - * @return string html output - */ -function PMA_getAddUserHtmlFieldset($db = '', $table = '') -{ - if (!$GLOBALS['is_createuser']) { - return ''; - } - $rel_params = array(); - $url_params = array( - 'adduser' => 1 - ); - if (!empty($db)) { - $url_params['dbname'] - = $rel_params['checkprivsdb'] - = $db; - } - if (!empty($table)) { - $url_params['tablename'] - = $rel_params['checkprivstable'] - = $table; - } - - return '
    ' . "\n" - . '' . _pgettext('Create new user', 'New') . '' - . '' . "\n" - . Util::getIcon('b_usradd.png') - . ' ' . __('Add user account') . '' . "\n" - . '
    ' . "\n"; -} - -/** - * Get HTML header for display User's properties - * - * @param boolean $dbname_is_wildcard whether database name is wildcard or not - * @param string $url_dbname url database name that urlencode() string - * @param string $dbname database name - * @param string $username username - * @param string $hostname host name - * @param string $entity_name entity (table or routine) name - * @param string $entity_type optional, type of entity ('table' or 'routine') - * - * @return string $html_output - */ -function PMA_getHtmlHeaderForUserProperties( - $dbname_is_wildcard, $url_dbname, $dbname, - $username, $hostname, $entity_name, $entity_type='table' -) { - $html_output = '

    ' . "\n" - . Util::getIcon('b_usredit.png') - . __('Edit privileges:') . ' ' - . __('User account'); - - if (! empty($dbname)) { - $html_output .= ' \'' . htmlspecialchars($username) - . '\'@\'' . htmlspecialchars($hostname) - . '\'' . "\n"; - - $html_output .= ' - '; - $html_output .= ($dbname_is_wildcard - || is_array($dbname) && count($dbname) > 1) - ? __('Databases') : __('Database'); - if (! empty($entity_name) && $entity_type === 'table') { - $html_output .= ' ' . htmlspecialchars($dbname) - . ''; - - $html_output .= ' - ' . __('Table') - . ' ' . htmlspecialchars($entity_name) . ''; - } elseif (! empty($entity_name)) { - $html_output .= ' ' . htmlspecialchars($dbname) - . ''; - - $html_output .= ' - ' . __('Routine') - . ' ' . htmlspecialchars($entity_name) . ''; - } else { - if (! is_array($dbname)) { - $dbname = array($dbname); - } - $html_output .= ' ' - . htmlspecialchars(implode(', ', $dbname)) - . ''; - } - - } else { - $html_output .= ' \'' . htmlspecialchars($username) - . '\'@\'' . htmlspecialchars($hostname) - . '\'' . "\n"; - - } - $html_output .= '

    ' . "\n"; - $cur_user = htmlspecialchars($GLOBALS['dbi']->getCurrentUser()); - $user = htmlspecialchars($username . '@' . $hostname); - // Add a short notice for the user - // to remind him that he is editing his own privileges - if ($user === $cur_user) { - $html_output .= Message::notice( - __( - 'Note: You are attempting to edit privileges of the ' - . 'user with which you are currently logged in.' - ) - )->getDisplay(); - } - return $html_output; -} - -/** - * Get HTML snippet for display user overview page - * - * @param string $pmaThemeImage a image source link - * @param string $text_dir text directory - * - * @return string $html_output - */ -function PMA_getHtmlForUserOverview($pmaThemeImage, $text_dir) -{ - $html_output = '

    ' . "\n" - . Util::getIcon('b_usrlist.png') - . __('User accounts overview') . "\n" - . '

    ' . "\n"; - - $password_column = 'Password'; - $server_type = Util::getServerType(); - if (($server_type == 'MySQL' || $server_type == 'Percona Server') - && PMA_MYSQL_INT_VERSION >= 50706 - ) { - $password_column = 'authentication_string'; - } - // $sql_query is for the initial-filtered, - // $sql_query_all is for counting the total no. of users - - $sql_query = $sql_query_all = 'SELECT *,' . - " IF(`" . $password_column . "` = _latin1 '', 'N', 'Y') AS 'Password'" . - ' FROM `mysql`.`user`'; - - $sql_query .= (isset($_REQUEST['initial']) - ? PMA_rangeOfUsers($_REQUEST['initial']) - : ''); - - $sql_query .= ' ORDER BY `User` ASC, `Host` ASC;'; - $sql_query_all .= ' ;'; - - $res = $GLOBALS['dbi']->tryQuery( - $sql_query, null, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - $res_all = $GLOBALS['dbi']->tryQuery( - $sql_query_all, null, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - if (! $res) { - // the query failed! This may have two reasons: - // - the user does not have enough privileges - // - the privilege tables use a structure of an earlier version. - // so let's try a more simple query - - $GLOBALS['dbi']->freeResult($res); - $GLOBALS['dbi']->freeResult($res_all); - $sql_query = 'SELECT * FROM `mysql`.`user`'; - $res = $GLOBALS['dbi']->tryQuery( - $sql_query, null, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - if (! $res) { - $html_output .= PMA_getHtmlForViewUsersError(); - $html_output .= PMA_getAddUserHtmlFieldset(); - } else { - // This message is hardcoded because I will replace it by - // a automatic repair feature soon. - $raw = 'Your privilege table structure seems to be older than' - . ' this MySQL version!
    ' - . 'Please run the mysql_upgrade command' - . '(mysql_fix_privilege_tables on older systems)' - . ' that should be included in your MySQL server distribution' - . ' to solve this problem!'; - $html_output .= Message::rawError($raw)->getDisplay(); - } - $GLOBALS['dbi']->freeResult($res); - } else { - $db_rights = PMA_getDbRightsForUserOverview(); - // for all initials, even non A-Z - $array_initials = array(); - - foreach ($db_rights as $right) { - foreach ($right as $account) { - if (empty($account['User']) && $account['Host'] == 'localhost') { - $html_output .= Message::notice( - __( - 'A user account allowing any user from localhost to ' - . 'connect is present. This will prevent other users ' - . 'from connecting if the host part of their account ' - . 'allows a connection from any (%) host.' - ) - . Util::showMySQLDocu('problems-connecting') - )->getDisplay(); - break 2; - } - } - } - - /** - * Displays the initials - * Also not necessary if there is less than 20 privileges - */ - if ($GLOBALS['dbi']->numRows($res_all) > 20) { - $html_output .= PMA_getHtmlForInitials($array_initials); - } - - /** - * Display the user overview - * (if less than 50 users, display them immediately) - */ - if (isset($_REQUEST['initial']) - || isset($_REQUEST['showall']) - || $GLOBALS['dbi']->numRows($res) < 50 - ) { - $html_output .= PMA_getUsersOverview( - $res, $db_rights, $pmaThemeImage, $text_dir - ); - } else { - $html_output .= PMA_getAddUserHtmlFieldset(); - } // end if (display overview) - - if (! $GLOBALS['is_ajax_request'] - || ! empty($_REQUEST['ajax_page_request']) - ) { - if ($GLOBALS['is_reload_priv']) { - $flushnote = new Message( - __( - 'Note: phpMyAdmin gets the users\' privileges directly ' - . 'from MySQL\'s privilege tables. The content of these ' - . 'tables may differ from the privileges the server uses, ' - . 'if they have been changed manually. In this case, ' - . 'you should %sreload the privileges%s before you continue.' - ), - Message::NOTICE - ); - $flushLink = ''; - $flushnote->addParam( - $flushLink, - false - ); - $flushnote->addParam('', false); - } else { - $flushnote = new Message( - __( - 'Note: phpMyAdmin gets the users\' privileges directly ' - . 'from MySQL\'s privilege tables. The content of these ' - . 'tables may differ from the privileges the server uses, ' - . 'if they have been changed manually. In this case, ' - . 'the privileges have to be reloaded but currently, you ' - . 'don\'t have the RELOAD privilege.' - ) - . Util::showMySQLDocu( - 'privileges-provided', - false, - 'priv_reload' - ), - Message::NOTICE - ); - } - $html_output .= $flushnote->getDisplay(); - } - } - - return $html_output; -} - -/** - * Get HTML snippet for display user properties - * - * @param boolean $dbname_is_wildcard whether database name is wildcard or not - * @param string $url_dbname url database name that urlencode() string - * @param string $username username - * @param string $hostname host name - * @param string $dbname database name - * @param string $tablename table name - * - * @return string $html_output - */ -function PMA_getHtmlForUserProperties($dbname_is_wildcard,$url_dbname, - $username, $hostname, $dbname, $tablename -) { - $html_output = '
    '; - $html_output .= PMA_getHtmlHeaderForUserProperties( - $dbname_is_wildcard, $url_dbname, $dbname, $username, $hostname, - $tablename, 'table' - ); - - $sql = "SELECT '1' FROM `mysql`.`user`" - . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" - . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "';"; - - $user_does_not_exists = (bool) ! $GLOBALS['dbi']->fetchValue($sql); - - if ($user_does_not_exists) { - $html_output .= Message::error( - __('The selected user was not found in the privilege table.') - )->getDisplay(); - $html_output .= PMA_getHtmlForLoginInformationFields(); - } - - $_params = array( - 'username' => $username, - 'hostname' => $hostname, - ); - if (! is_array($dbname) && mb_strlen($dbname)) { - $_params['dbname'] = $dbname; - if (mb_strlen($tablename)) { - $_params['tablename'] = $tablename; - } - } else { - $_params['dbname'] = $dbname; - } - - $html_output .= '' . "\n"; - - if (! is_array($dbname) && ! mb_strlen($tablename) - && empty($dbname_is_wildcard) - ) { - // no table name was given, display all table specific rights - // but only if $dbname contains no wildcards - if (! mb_strlen($dbname)) { - $html_output .= PMA_getHtmlForAllTableSpecificRights( - $username, $hostname, 'database' - ); - } else { - // unescape wildcards in dbname at table level - $unescaped_db = Util::unescapeMysqlWildcards($dbname); - - $html_output .= PMA_getHtmlForAllTableSpecificRights( - $username, $hostname, 'table', $unescaped_db - ); - $html_output .= PMA_getHtmlForAllTableSpecificRights( - $username, $hostname, 'routine', $unescaped_db - ); - } - } - - // Provide a line with links to the relevant database and table - if (! is_array($dbname) && mb_strlen($dbname) - && empty($dbname_is_wildcard) - ) { - $html_output .= PMA_getLinkToDbAndTable($url_dbname, $dbname, $tablename); - - } - - if (! is_array($dbname) && ! mb_strlen($dbname) - && ! $user_does_not_exists - ) { - //change login information - $html_output .= PMA_getHtmlForChangePassword( - 'edit_other', - $username, - $hostname - ); - $html_output .= PMA_getChangeLoginInformationHtmlForm($username, $hostname); - } - $html_output .= '
    '; - - return $html_output; -} - -/** - * Get queries for Table privileges to change or copy user - * - * @param string $user_host_condition user host condition to - * select relevant table privileges - * @param array $queries queries array - * @param string $username username - * @param string $hostname host name - * - * @return array $queries - */ -function PMA_getTablePrivsQueriesForChangeOrCopyUser($user_host_condition, - $queries, $username, $hostname -) { - $res = $GLOBALS['dbi']->query( - 'SELECT `Db`, `Table_name`, `Table_priv` FROM `mysql`.`tables_priv`' - . $user_host_condition, - $GLOBALS['userlink'], - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - while ($row = $GLOBALS['dbi']->fetchAssoc($res)) { - - $res2 = $GLOBALS['dbi']->query( - 'SELECT `Column_name`, `Column_priv`' - . ' FROM `mysql`.`columns_priv`' - . ' WHERE `User`' - . ' = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['old_username']) . "'" - . ' AND `Host`' - . ' = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['old_username']) . '\'' - . ' AND `Db`' - . ' = \'' . $GLOBALS['dbi']->escapeString($row['Db']) . "'" - . ' AND `Table_name`' - . ' = \'' . $GLOBALS['dbi']->escapeString($row['Table_name']) . "'" - . ';', - null, - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - $tmp_privs1 = PMA_extractPrivInfo($row); - $tmp_privs2 = array( - 'Select' => array(), - 'Insert' => array(), - 'Update' => array(), - 'References' => array() - ); - - while ($row2 = $GLOBALS['dbi']->fetchAssoc($res2)) { - $tmp_array = explode(',', $row2['Column_priv']); - if (in_array('Select', $tmp_array)) { - $tmp_privs2['Select'][] = $row2['Column_name']; - } - if (in_array('Insert', $tmp_array)) { - $tmp_privs2['Insert'][] = $row2['Column_name']; - } - if (in_array('Update', $tmp_array)) { - $tmp_privs2['Update'][] = $row2['Column_name']; - } - if (in_array('References', $tmp_array)) { - $tmp_privs2['References'][] = $row2['Column_name']; - } - } - if (count($tmp_privs2['Select']) > 0 && ! in_array('SELECT', $tmp_privs1)) { - $tmp_privs1[] = 'SELECT (`' . join('`, `', $tmp_privs2['Select']) . '`)'; - } - if (count($tmp_privs2['Insert']) > 0 && ! in_array('INSERT', $tmp_privs1)) { - $tmp_privs1[] = 'INSERT (`' . join('`, `', $tmp_privs2['Insert']) . '`)'; - } - if (count($tmp_privs2['Update']) > 0 && ! in_array('UPDATE', $tmp_privs1)) { - $tmp_privs1[] = 'UPDATE (`' . join('`, `', $tmp_privs2['Update']) . '`)'; - } - if (count($tmp_privs2['References']) > 0 - && ! in_array('REFERENCES', $tmp_privs1) - ) { - $tmp_privs1[] - = 'REFERENCES (`' . join('`, `', $tmp_privs2['References']) . '`)'; - } - - $queries[] = 'GRANT ' . join(', ', $tmp_privs1) - . ' ON ' . Util::backquote($row['Db']) . '.' - . Util::backquote($row['Table_name']) - . ' TO \'' . $GLOBALS['dbi']->escapeString($username) - . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\'' - . (in_array('Grant', explode(',', $row['Table_priv'])) - ? ' WITH GRANT OPTION;' - : ';'); - } - return $queries; -} - -/** - * Get queries for database specific privileges for change or copy user - * - * @param array $queries queries array with string - * @param string $username username - * @param string $hostname host name - * - * @return array $queries - */ -function PMA_getDbSpecificPrivsQueriesForChangeOrCopyUser( - $queries, $username, $hostname -) { - $user_host_condition = ' WHERE `User`' - . ' = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['old_username']) . "'" - . ' AND `Host`' - . ' = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['old_hostname']) . '\';'; - - $res = $GLOBALS['dbi']->query( - 'SELECT * FROM `mysql`.`db`' . $user_host_condition - ); - - while ($row = $GLOBALS['dbi']->fetchAssoc($res)) { - $queries[] = 'GRANT ' . join(', ', PMA_extractPrivInfo($row)) - . ' ON ' . Util::backquote($row['Db']) . '.*' - . ' TO \'' . $GLOBALS['dbi']->escapeString($username) - . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\'' - . ($row['Grant_priv'] == 'Y' ? ' WITH GRANT OPTION;' : ';'); - } - $GLOBALS['dbi']->freeResult($res); - - $queries = PMA_getTablePrivsQueriesForChangeOrCopyUser( - $user_host_condition, $queries, $username, $hostname - ); - - return $queries; -} - -/** - * Prepares queries for adding users and - * also create database and return query and message - * - * @param boolean $_error whether user create or not - * @param string $real_sql_query SQL query for add a user - * @param string $sql_query SQL query to be displayed - * @param string $username username - * @param string $hostname host name - * @param string $dbname database name - * - * @return array $sql_query, $message - */ -function PMA_addUserAndCreateDatabase($_error, $real_sql_query, $sql_query, - $username, $hostname, $dbname -) { - if ($_error || (!empty($real_sql_query) - && !$GLOBALS['dbi']->tryQuery($real_sql_query)) - ) { - $_REQUEST['createdb-1'] = $_REQUEST['createdb-2'] - = $_REQUEST['createdb-3'] = null; - $message = Message::rawError($GLOBALS['dbi']->getError()); - } else { - $message = Message::success(__('You have added a new user.')); - } - - if (isset($_REQUEST['createdb-1'])) { - // Create database with same name and grant all privileges - $q = 'CREATE DATABASE IF NOT EXISTS ' - . Util::backquote( - $GLOBALS['dbi']->escapeString($username) - ) . ';'; - $sql_query .= $q; - if (! $GLOBALS['dbi']->tryQuery($q)) { - $message = Message::rawError($GLOBALS['dbi']->getError()); - } - - /** - * Reload the navigation - */ - $GLOBALS['reload'] = true; - $GLOBALS['db'] = $username; - - $q = 'GRANT ALL PRIVILEGES ON ' - . Util::backquote( - Util::escapeMysqlWildcards( - $GLOBALS['dbi']->escapeString($username) - ) - ) . '.* TO \'' - . $GLOBALS['dbi']->escapeString($username) - . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\';'; - $sql_query .= $q; - if (! $GLOBALS['dbi']->tryQuery($q)) { - $message = Message::rawError($GLOBALS['dbi']->getError()); - } - } - - if (isset($_REQUEST['createdb-2'])) { - // Grant all privileges on wildcard name (username\_%) - $q = 'GRANT ALL PRIVILEGES ON ' - . Util::backquote( - Util::escapeMysqlWildcards( - $GLOBALS['dbi']->escapeString($username) - ) . '\_%' - ) . '.* TO \'' - . $GLOBALS['dbi']->escapeString($username) - . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\';'; - $sql_query .= $q; - if (! $GLOBALS['dbi']->tryQuery($q)) { - $message = Message::rawError($GLOBALS['dbi']->getError()); - } - } - - if (isset($_REQUEST['createdb-3'])) { - // Grant all privileges on the specified database to the new user - $q = 'GRANT ALL PRIVILEGES ON ' - . Util::backquote( - $GLOBALS['dbi']->escapeString($dbname) - ) . '.* TO \'' - . $GLOBALS['dbi']->escapeString($username) - . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\';'; - $sql_query .= $q; - if (! $GLOBALS['dbi']->tryQuery($q)) { - $message = Message::rawError($GLOBALS['dbi']->getError()); - } - } - return array($sql_query, $message); -} - -/** - * Get the hashed string for password - * - * @param string $password password - * - * @return string $hashedPassword - */ -function PMA_getHashedPassword($password) -{ - $result = $GLOBALS['dbi']->fetchSingleRow( - "SELECT PASSWORD('" . $password . "') AS `password`;" - ); - - $hashedPassword = $result['password']; - - return $hashedPassword; -} - -/** - * Check if MariaDB's 'simple_password_check' - * OR 'cracklib_password_check' is ACTIVE - * - * @return boolean if atleast one of the plugins is ACTIVE - */ -function PMA_checkIfMariaDBPwdCheckPluginActive() -{ - if (Util::getServerType() !== 'MariaDB') { - return false; - } - - $result = $GLOBALS['dbi']->query( - 'SHOW PLUGINS SONAME LIKE \'%_password_check%\'' - ); - - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - if ($row['Status'] === 'ACTIVE') { - return true; - } - } - - return false; -} - - -/** - * Get SQL queries for Display and Add user - * - * @param string $username username - * @param string $hostname host name - * @param string $password password - * - * @return array ($create_user_real, $create_user_show,$real_sql_query, $sql_query - * $password_set_real, $password_set_show) - */ -function PMA_getSqlQueriesForDisplayAndAddUser($username, $hostname, $password) -{ - $slashedUsername = $GLOBALS['dbi']->escapeString($username); - $slashedHostname = $GLOBALS['dbi']->escapeString($hostname); - $slashedPassword = $GLOBALS['dbi']->escapeString($password); - $serverType = Util::getServerType(); - - $create_user_stmt = sprintf( - 'CREATE USER \'%s\'@\'%s\'', - $slashedUsername, - $slashedHostname - ); - $isMariaDBPwdPluginActive = PMA_checkIfMariaDBPwdCheckPluginActive(); - - // See https://github.com/phpmyadmin/phpmyadmin/pull/11560#issuecomment-147158219 - // for details regarding details of syntax usage for various versions - - // 'IDENTIFIED WITH auth_plugin' - // is supported by MySQL 5.5.7+ - if (($serverType == 'MySQL' || $serverType == 'Percona Server') - && PMA_MYSQL_INT_VERSION >= 50507 - && isset($_REQUEST['authentication_plugin']) - ) { - $create_user_stmt .= ' IDENTIFIED WITH ' - . $_REQUEST['authentication_plugin']; - } - - // 'IDENTIFIED VIA auth_plugin' - // is supported by MariaDB 5.2+ - if ($serverType == 'MariaDB' - && PMA_MYSQL_INT_VERSION >= 50200 - && isset($_REQUEST['authentication_plugin']) - && ! $isMariaDBPwdPluginActive - ) { - $create_user_stmt .= ' IDENTIFIED VIA ' - . $_REQUEST['authentication_plugin']; - } - - $create_user_real = $create_user_show = $create_user_stmt; - - $password_set_stmt = 'SET PASSWORD FOR \'%s\'@\'%s\' = \'%s\''; - $password_set_show = sprintf( - $password_set_stmt, - $slashedUsername, - $slashedHostname, - '***' - ); - - $sql_query_stmt = sprintf( - 'GRANT %s ON *.* TO \'%s\'@\'%s\'', - join(', ', PMA_extractPrivInfo()), - $slashedUsername, - $slashedHostname - ); - $real_sql_query = $sql_query = $sql_query_stmt; - - // Set the proper hashing method - if (isset($_REQUEST['authentication_plugin'])) { - PMA_setProperPasswordHashing( - $_REQUEST['authentication_plugin'] - ); - } - - // Use 'CREATE USER ... WITH ... AS ..' syntax for - // newer MySQL versions - // and 'CREATE USER ... VIA .. USING ..' syntax for - // newer MariaDB versions - if ((($serverType == 'MySQL' || $serverType == 'Percona Server') - && PMA_MYSQL_INT_VERSION >= 50706) - || ($serverType == 'MariaDB' - && PMA_MYSQL_INT_VERSION >= 50200) - ) { - $password_set_real = null; - - // Required for binding '%' with '%s' - $create_user_stmt = str_replace( - '%', '%%', $create_user_stmt - ); - - // MariaDB uses 'USING' whereas MySQL uses 'AS' - // but MariaDB with validation plugin needs cleartext password - if ($serverType == 'MariaDB' - && ! $isMariaDBPwdPluginActive - ) { - $create_user_stmt .= ' USING \'%s\''; - } elseif ($serverType == 'MariaDB') { - $create_user_stmt .= ' IDENTIFIED BY \'%s\''; - } else { - $create_user_stmt .= ' AS \'%s\''; - } - - if ($_POST['pred_password'] == 'keep') { - $create_user_real = sprintf( - $create_user_stmt, - $slashedPassword - ); - $create_user_show = sprintf( - $create_user_stmt, - '***' - ); - } else if ($_POST['pred_password'] == 'none') { - $create_user_real = sprintf( - $create_user_stmt, - null - ); - $create_user_show = sprintf( - $create_user_stmt, - '***' - ); - } else { - if (! ($serverType == 'MariaDB' - && $isMariaDBPwdPluginActive) - ) { - $hashedPassword = PMA_getHashedPassword($_POST['pma_pw']); - } else { - // MariaDB with validation plugin needs cleartext password - $hashedPassword = $_POST['pma_pw']; - } - $create_user_real = sprintf( - $create_user_stmt, - $hashedPassword - ); - $create_user_show = sprintf( - $create_user_stmt, - '***' - ); - } - } else { - // Use 'SET PASSWORD' syntax for pre-5.7.6 MySQL versions - // and pre-5.2.0 MariaDB versions - if ($_POST['pred_password'] == 'keep') { - $password_set_real = sprintf( - $password_set_stmt, - $slashedUsername, - $slashedHostname, - $slashedPassword - ); - } else if ($_POST['pred_password'] == 'none') { - $password_set_real = sprintf( - $password_set_stmt, - $slashedUsername, - $slashedHostname, - null - ); - } else { - $hashedPassword = PMA_getHashedPassword($_POST['pma_pw']); - $password_set_real = sprintf( - $password_set_stmt, - $slashedUsername, - $slashedHostname, - $hashedPassword - ); - } - } - - // add REQUIRE clause - $require_clause = PMA_getRequireClause(); - $real_sql_query .= $require_clause; - $sql_query .= $require_clause; - - $with_clause = PMA_getWithClauseForAddUserAndUpdatePrivs(); - $real_sql_query .= $with_clause; - $sql_query .= $with_clause; - - if (isset($create_user_real)) { - $create_user_real .= ';'; - $create_user_show .= ';'; - } - $real_sql_query .= ';'; - $sql_query .= ';'; - // No Global GRANT_OPTION privilege - if (!$GLOBALS['is_grantuser']) { - $real_sql_query = ''; - $sql_query = ''; - } - - // Use 'SET PASSWORD' for pre-5.7.6 MySQL versions - // and pre-5.2.0 MariaDB - if (($serverType == 'MySQL' - && PMA_MYSQL_INT_VERSION >= 50706) - || ($serverType == 'MariaDB' - && PMA_MYSQL_INT_VERSION >= 50200) - ) { - $password_set_real = null; - $password_set_show = null; - } else { - $password_set_real .= ";"; - $password_set_show .= ";"; - } - - return array($create_user_real, - $create_user_show, - $real_sql_query, - $sql_query, - $password_set_real, - $password_set_show - ); -} - -/** - * Returns the type ('PROCEDURE' or 'FUNCTION') of the routine - * - * @param string $dbname database - * @param string $routineName routine - * - * @return string type - */ -function PMA_getRoutineType($dbname, $routineName) -{ - $routineData = $GLOBALS['dbi']->getRoutines($dbname); - - foreach ($routineData as $routine) { - if ($routine['name'] === $routineName) { - return $routine['type']; - } - } - return ''; -} diff --git a/#pma/libraries/server_status.lib.php b/#pma/libraries/server_status.lib.php deleted file mode 100644 index b126bfd7..00000000 --- a/#pma/libraries/server_status.lib.php +++ /dev/null @@ -1,324 +0,0 @@ -fetchValue( - 'SELECT UNIX_TIMESTAMP() - ' . $ServerStatusData->status['Uptime'] - ); - - $retval = '

    '; - $bytes_received = $ServerStatusData->status['Bytes_received']; - $bytes_sent = $ServerStatusData->status['Bytes_sent']; - $retval .= sprintf( - __('Network traffic since startup: %s'), - implode( - ' ', - PMA\libraries\Util::formatByteDown( - $bytes_received + $bytes_sent, - 3, - 1 - ) - ) - ); - $retval .= '

    '; - $retval .= '

    '; - $retval .= sprintf( - __('This MySQL server has been running for %1$s. It started up on %2$s.'), - PMA\libraries\Util::timespanFormat($ServerStatusData->status['Uptime']), - PMA\libraries\Util::localisedDate($start_time) - ) . "\n"; - $retval .= '

    '; - - return $retval; -} - -/** - * Returns HTML to display replication information - * - * @return string HTML on replication - */ -function PMA_getHtmlForReplicationInfo() -{ - $retval = '

    '; - if ($GLOBALS['replication_info']['master']['status'] - && $GLOBALS['replication_info']['slave']['status'] - ) { - $retval .= __( - 'This MySQL server works as master and ' - . 'slave in replication process.' - ); - } elseif ($GLOBALS['replication_info']['master']['status']) { - $retval .= __( - 'This MySQL server works as master ' - . 'in replication process.' - ); - } elseif ($GLOBALS['replication_info']['slave']['status']) { - $retval .= __( - 'This MySQL server works as slave ' - . 'in replication process.' - ); - } - $retval .= '

    '; - - /* - * if the server works as master or slave in replication process, - * display useful information - */ - $retval .= '
    '; - $retval .= '

    '; - $retval .= __('Replication status'); - $retval .= '

    '; - foreach ($GLOBALS['replication_types'] as $type) { - if (isset($GLOBALS['replication_info'][$type]['status']) - && $GLOBALS['replication_info'][$type]['status'] - ) { - $retval .= PMA_getHtmlForReplicationStatusTable($type); - } - } - - return $retval; -} - -/** - * Prints server state traffic information - * - * @param ServerStatusData $ServerStatusData Server status data - * - * @return string - */ -function PMA_getHtmlForServerStateTraffic($ServerStatusData) -{ - $hour_factor = 3600 / $ServerStatusData->status['Uptime']; - $retval = ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= '
    '; - $retval .= __('Traffic') . ' '; - $retval .= PMA\libraries\Util::showHint( - __( - 'On a busy server, the byte counters may overrun, so those statistics ' - . 'as reported by the MySQL server may be incorrect.' - ) - ); - $retval .= '#ø ' . __('per hour') . '
    ' . __('Received') . ''; - $retval .= implode( - ' ', - PMA\libraries\Util::formatByteDown( - $ServerStatusData->status['Bytes_received'], 3, 1 - ) - ); - $retval .= ''; - $retval .= implode( - ' ', - PMA\libraries\Util::formatByteDown( - $ServerStatusData->status['Bytes_received'] * $hour_factor, 3, 1 - ) - ); - $retval .= '
    ' . __('Sent') . ''; - $retval .= implode( - ' ', - PMA\libraries\Util::formatByteDown( - $ServerStatusData->status['Bytes_sent'], 3, 1 - ) - ); - $retval .= ''; - $retval .= implode( - ' ', - PMA\libraries\Util::formatByteDown( - $ServerStatusData->status['Bytes_sent'] * $hour_factor, 3, 1 - ) - ); - $retval .= '
    ' . __('Total') . ''; - $bytes_received = $ServerStatusData->status['Bytes_received']; - $bytes_sent = $ServerStatusData->status['Bytes_sent']; - $retval .= implode( - ' ', - PMA\libraries\Util::formatByteDown( - $bytes_received + $bytes_sent, 3, 1 - ) - ); - $retval .= ''; - $bytes_received = $ServerStatusData->status['Bytes_received']; - $bytes_sent = $ServerStatusData->status['Bytes_sent']; - $retval .= implode( - ' ', - PMA\libraries\Util::formatByteDown( - ($bytes_received + $bytes_sent) * $hour_factor, 3, 1 - ) - ); - $retval .= '
    '; - return $retval; -} - -/** - * Prints server state connections information - * - * @param ServerStatusData $ServerStatusData Server status data - * - * @return string - */ -function PMA_getHtmlForServerStateConnections($ServerStatusData) -{ - $hour_factor = 3600 / $ServerStatusData->status['Uptime']; - $retval = ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= '
    ' . __('Connections') . '#ø ' . __('per hour') . '%
    ' . __('Max. concurrent connections') . ''; - $retval .= PMA\libraries\Util::formatNumber( - $ServerStatusData->status['Max_used_connections'], 0 - ); - $retval .= '--- ---
    ' . __('Failed attempts') . ''; - $retval .= PMA\libraries\Util::formatNumber( - $ServerStatusData->status['Aborted_connects'], 4, 1, true - ); - $retval .= ''; - $retval .= PMA\libraries\Util::formatNumber( - $ServerStatusData->status['Aborted_connects'] * $hour_factor, 4, 2, true - ); - $retval .= ''; - if ($ServerStatusData->status['Connections'] > 0) { - $abortNum = $ServerStatusData->status['Aborted_connects']; - $connectNum = $ServerStatusData->status['Connections']; - - $retval .= PMA\libraries\Util::formatNumber( - $abortNum * 100 / $connectNum, - 0, 2, true - ); - $retval .= '%'; - } else { - $retval .= '--- '; - } - $retval .= '
    ' . __('Aborted') . ''; - $retval .= PMA\libraries\Util::formatNumber( - $ServerStatusData->status['Aborted_clients'], 4, 1, true - ); - $retval .= ''; - $retval .= PMA\libraries\Util::formatNumber( - $ServerStatusData->status['Aborted_clients'] * $hour_factor, 4, 2, true - ); - $retval .= ''; - if ($ServerStatusData->status['Connections'] > 0) { - $abortNum = $ServerStatusData->status['Aborted_clients']; - $connectNum = $ServerStatusData->status['Connections']; - - $retval .= PMA\libraries\Util::formatNumber( - $abortNum * 100 / $connectNum, - 0, 2, true - ); - $retval .= '%'; - } else { - $retval .= '--- '; - } - $retval .= '
    ' . __('Total') . ''; - $retval .= PMA\libraries\Util::formatNumber( - $ServerStatusData->status['Connections'], 4, 0 - ); - $retval .= ''; - $retval .= PMA\libraries\Util::formatNumber( - $ServerStatusData->status['Connections'] * $hour_factor, 4, 2 - ); - $retval .= ''; - $retval .= PMA\libraries\Util::formatNumber(100, 0, 2); - $retval .= '%
    '; - - return $retval; -} - diff --git a/#pma/libraries/server_status_advisor.lib.php b/#pma/libraries/server_status_advisor.lib.php deleted file mode 100644 index f78577bd..00000000 --- a/#pma/libraries/server_status_advisor.lib.php +++ /dev/null @@ -1,63 +0,0 @@ -'; - $output .= PMA\libraries\Util::getIcon('b_help.png', __('Instructions')); - $output .= ''; - $output .= '
    '; - $output .= ''; - $output .= ''; - - return $output; -} - diff --git a/#pma/libraries/server_status_monitor.lib.php b/#pma/libraries/server_status_monitor.lib.php deleted file mode 100644 index c341ccca..00000000 --- a/#pma/libraries/server_status_monitor.lib.php +++ /dev/null @@ -1,819 +0,0 @@ -'; - $retval .= '
    '; - $retval .= '
    '; - $retval .= '
    '; - - $retval .= ''; - - return $retval; -} - -/** - * Returns html for Analyse Dialog - * - * @return string - */ -function PMA_getHtmlForAnalyseDialog() -{ - $retval = ''; - $retval .= ''; - - return $retval; -} - -/** - * Returns html for Instructions Dialog - * - * @return string - */ -function PMA_getHtmlForInstructionsDialog() -{ - $retval = ''; - - return $retval; -} - -/** - * Returns html for addChartDialog - * - * @return string - */ -function PMA_getHtmlForAddChartDialog() -{ - $retval = ''; - - return $retval; -} - -/** - * Returns html with Tab Links - * - * @return string - */ -function PMA_getHtmlForTabLinks() -{ - $retval = ''; - - return $retval; -} - -/** - * Returns html with Settings dialog - * - * @return string - */ -function PMA_getHtmlForSettingsDialog() -{ - $retval = '
    '; - $retval .= ''; - $retval .= PMA\libraries\Util::getImage('b_chart.png') . __('Add chart'); - $retval .= ''; - $retval .= ''; - $retval .= PMA\libraries\Util::getImage('b_tblops.png') - . __('Enable charts dragging'); - $retval .= ''; - $retval .= '
    '; - $retval .= '
    '; - $retval .= __('Refresh rate') . '
    '; - $retval .= ServerStatusData::getHtmlForRefreshList( - 'gridChartRefresh', - 5, - Array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200) - ); - $retval .= '
    '; - $retval .= '
    '; - $retval .= '
    '; - $retval .= __('Chart columns'); - $retval .= '
    '; - $retval .= ''; - $retval .= '
    '; - $retval .= '
    '; - $retval .= '' . __('Chart arrangement') . ' '; - $retval .= PMA\libraries\Util::showHint( - __( - 'The arrangement of the charts is stored to the browsers local storage. ' - . 'You may want to export it if you have a complicated set up.' - ) - ); - $retval .= '
    '; - $retval .= ''; - $retval .= __('Import'); - $retval .= ''; - $retval .= '  '; - $retval .= ''; - $retval .= __('Export'); - $retval .= ''; - $retval .= '  '; - $retval .= ''; - $retval .= __('Reset to default'); - $retval .= ''; - $retval .= '
    '; - $retval .= '
    '; - - return $retval; -} - - -/** - * Define some data and links needed on the client side - * - * @param ServerStatusData $ServerStatusData Server status data - * - * @return string - */ -function PMA_getHtmlForClientSideDataAndLinks($ServerStatusData) -{ - /** - * Define some data needed on the client side - */ - $input = ''; - $form = '
    '; - $form .= sprintf($input, 'server_time', microtime(true) * 1000); - $form .= sprintf($input, 'server_os', PHP_OS); - $form .= sprintf($input, 'is_superuser', $GLOBALS['dbi']->isSuperuser()); - $form .= sprintf($input, 'server_db_isLocal', $ServerStatusData->db_isLocal); - $form .= '
    '; - /** - * Define some links used on client side - */ - $links = '
    '; - $links .= PMA\libraries\Util::showMySQLDocu('general-thread-states'); - $links .= '
    '; - $links .= '
    '; - $links .= PMA\libraries\Util::showMySQLDocu('explain-output'); - $links .= '
    '; - - return $form . $links; -} - -/***************************Ajax request function***********************************/ - -/** - * Returns JSon for real-time charting data - * - * @return array - */ -function PMA_getJsonForChartingData() -{ - $ret = json_decode($_REQUEST['requiredData'], true); - $statusVars = array(); - $serverVars = array(); - $sysinfo = $cpuload = $memory = 0; - - /* Accumulate all required variables and data */ - list($serverVars, $statusVars, $ret) = PMA_getJsonForChartingDataGet( - $ret, $serverVars, $statusVars, $sysinfo, $cpuload, $memory - ); - - // Retrieve all required status variables - if (count($statusVars)) { - $statusVarValues = $GLOBALS['dbi']->fetchResult( - "SHOW GLOBAL STATUS WHERE Variable_name='" - . implode("' OR Variable_name='", $statusVars) . "'", - 0, - 1 - ); - } else { - $statusVarValues = array(); - } - - // Retrieve all required server variables - if (count($serverVars)) { - $serverVarValues = $GLOBALS['dbi']->fetchResult( - "SHOW GLOBAL VARIABLES WHERE Variable_name='" - . implode("' OR Variable_name='", $serverVars) . "'", - 0, - 1 - ); - } else { - $serverVarValues = array(); - } - - // ...and now assign them - $ret = PMA_getJsonForChartingDataSet($ret, $statusVarValues, $serverVarValues); - - $ret['x'] = microtime(true) * 1000; - return $ret; -} - -/** - * Assign the variables for real-time charting data - * - * @param array $ret Real-time charting data - * @param array $statusVarValues Status variable values - * @param array $serverVarValues Server variable values - * - * @return array - */ -function PMA_getJsonForChartingDataSet($ret, $statusVarValues, $serverVarValues) -{ - foreach ($ret as $chart_id => $chartNodes) { - foreach ($chartNodes as $node_id => $nodeDataPoints) { - foreach ($nodeDataPoints as $point_id => $dataPoint) { - switch ($dataPoint['type']) { - case 'statusvar': - $ret[$chart_id][$node_id][$point_id]['value'] - = $statusVarValues[$dataPoint['name']]; - break; - case 'servervar': - $ret[$chart_id][$node_id][$point_id]['value'] - = $serverVarValues[$dataPoint['name']]; - break; - } - } - } - } - return $ret; -} - -/** - * Get called to get JSON for charting data - * - * @param array $ret Real-time charting data - * @param array $serverVars Server variable values - * @param array $statusVars Status variable values - * @param mixed $sysinfo System info - * @param mixed $cpuload CPU load - * @param mixed $memory Memory - * - * @return array - */ -function PMA_getJsonForChartingDataGet( - $ret, $serverVars, $statusVars, $sysinfo, $cpuload, $memory -) { - // For each chart - foreach ($ret as $chart_id => $chartNodes) { - // For each data series - foreach ($chartNodes as $node_id => $nodeDataPoints) { - // For each data point in the series (usually just 1) - foreach ($nodeDataPoints as $point_id => $dataPoint) { - list($serverVars, $statusVars, $ret[$chart_id][$node_id][$point_id]) - = PMA_getJsonForChartingDataSwitch( - $dataPoint['type'], $dataPoint['name'], $serverVars, - $statusVars, $ret[$chart_id][$node_id][$point_id], - $sysinfo, $cpuload, $memory - ); - } /* foreach */ - } /* foreach */ - } - return array($serverVars, $statusVars, $ret); -} - -/** - * Switch called to get JSON for charting data - * - * @param string $type Type - * @param string $pName Name - * @param array $serverVars Server variable values - * @param array $statusVars Status variable values - * @param array $ret Real-time charting data - * @param mixed $sysinfo System info - * @param mixed $cpuload CPU load - * @param mixed $memory Memory - * - * @return array - */ -function PMA_getJsonForChartingDataSwitch( - $type, $pName, $serverVars, $statusVars, $ret, - $sysinfo, $cpuload, $memory -) { - switch ($type) { - /* We only collect the status and server variables here to - * read them all in one query, - * and only afterwards assign them. - * Also do some white list filtering on the names - */ - case 'servervar': - if (!preg_match('/[^a-zA-Z_]+/', $pName)) { - $serverVars[] = $pName; - } - break; - - case 'statusvar': - if (!preg_match('/[^a-zA-Z_]+/', $pName)) { - $statusVars[] = $pName; - } - break; - - case 'proc': - $result = $GLOBALS['dbi']->query('SHOW PROCESSLIST'); - $ret['value'] = $GLOBALS['dbi']->numRows($result); - break; - - case 'cpu': - if (!$sysinfo) { - include_once 'libraries/sysinfo.lib.php'; - $sysinfo = PMA_getSysInfo(); - } - if (!$cpuload) { - $cpuload = $sysinfo->loadavg(); - } - - if (PMA_getSysInfoOs() == 'Linux') { - $ret['idle'] = $cpuload['idle']; - $ret['busy'] = $cpuload['busy']; - } else { - $ret['value'] = $cpuload['loadavg']; - } - - break; - - case 'memory': - if (!$sysinfo) { - include_once 'libraries/sysinfo.lib.php'; - $sysinfo = PMA_getSysInfo(); - } - if (!$memory) { - $memory = $sysinfo->memory(); - } - - $ret['value'] = isset($memory[$pName]) ? $memory[$pName] : 0; - break; - } - - return array($serverVars, $statusVars, $ret); -} - -/** - * Returns JSon for log data with type: slow - * - * @param int $start Unix Time: Start time for query - * @param int $end Unix Time: End time for query - * - * @return array - */ -function PMA_getJsonForLogDataTypeSlow($start, $end) -{ - $query = 'SELECT start_time, user_host, '; - $query .= 'Sec_to_Time(Sum(Time_to_Sec(query_time))) as query_time, '; - $query .= 'Sec_to_Time(Sum(Time_to_Sec(lock_time))) as lock_time, '; - $query .= 'SUM(rows_sent) AS rows_sent, '; - $query .= 'SUM(rows_examined) AS rows_examined, db, sql_text, '; - $query .= 'COUNT(sql_text) AS \'#\' '; - $query .= 'FROM `mysql`.`slow_log` '; - $query .= 'WHERE start_time > FROM_UNIXTIME(' . $start . ') '; - $query .= 'AND start_time < FROM_UNIXTIME(' . $end . ') GROUP BY sql_text'; - - $result = $GLOBALS['dbi']->tryQuery($query); - - $return = array('rows' => array(), 'sum' => array()); - - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $type = mb_strtolower( - mb_substr( - $row['sql_text'], - 0, - mb_strpos($row['sql_text'], ' ') - ) - ); - - switch($type) { - case 'insert': - case 'update': - //Cut off big inserts and updates, but append byte count instead - if (mb_strlen($row['sql_text']) > 220) { - $implode_sql_text = implode( - ' ', - PMA\libraries\Util::formatByteDown( - mb_strlen($row['sql_text']), 2, 2 - ) - ); - $row['sql_text'] = mb_substr($row['sql_text'], 0, 200) - . '... [' . $implode_sql_text . ']'; - } - break; - default: - break; - } - - if (! isset($return['sum'][$type])) { - $return['sum'][$type] = 0; - } - $return['sum'][$type] += $row['#']; - $return['rows'][] = $row; - } - - $return['sum']['TOTAL'] = array_sum($return['sum']); - $return['numRows'] = count($return['rows']); - - $GLOBALS['dbi']->freeResult($result); - return $return; -} - -/** - * Returns JSon for log data with type: general - * - * @param int $start Unix Time: Start time for query - * @param int $end Unix Time: End time for query - * - * @return array - */ -function PMA_getJsonForLogDataTypeGeneral($start, $end) -{ - $limitTypes = ''; - if (isset($_REQUEST['limitTypes']) && $_REQUEST['limitTypes']) { - $limitTypes - = 'AND argument REGEXP \'^(INSERT|SELECT|UPDATE|DELETE)\' '; - } - - $query = 'SELECT TIME(event_time) as event_time, user_host, thread_id, '; - $query .= 'server_id, argument, count(argument) as \'#\' '; - $query .= 'FROM `mysql`.`general_log` '; - $query .= 'WHERE command_type=\'Query\' '; - $query .= 'AND event_time > FROM_UNIXTIME(' . $start . ') '; - $query .= 'AND event_time < FROM_UNIXTIME(' . $end . ') '; - $query .= $limitTypes . 'GROUP by argument'; // HAVING count > 1'; - - $result = $GLOBALS['dbi']->tryQuery($query); - - $return = array('rows' => array(), 'sum' => array()); - $insertTables = array(); - $insertTablesFirst = -1; - $i = 0; - $removeVars = isset($_REQUEST['removeVariables']) - && $_REQUEST['removeVariables']; - - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - preg_match('/^(\w+)\s/', $row['argument'], $match); - $type = mb_strtolower($match[1]); - - if (! isset($return['sum'][$type])) { - $return['sum'][$type] = 0; - } - $return['sum'][$type] += $row['#']; - - switch($type) { - /** @noinspection PhpMissingBreakStatementInspection */ - case 'insert': - // Group inserts if selected - if ($removeVars - && preg_match( - '/^INSERT INTO (`|\'|"|)([^\s\\1]+)\\1/i', - $row['argument'], $matches - ) - ) { - $insertTables[$matches[2]]++; - if ($insertTables[$matches[2]] > 1) { - $return['rows'][$insertTablesFirst]['#'] - = $insertTables[$matches[2]]; - - // Add a ... to the end of this query to indicate that - // there's been other queries - $temp = $return['rows'][$insertTablesFirst]['argument']; - $return['rows'][$insertTablesFirst]['argument'] - .= PMA_getSuspensionPoints( - $temp[mb_strlen($temp) - 1] - ); - - // Group this value, thus do not add to the result list - continue 2; - } else { - $insertTablesFirst = $i; - $insertTables[$matches[2]] += $row['#'] - 1; - } - } - // No break here - - case 'update': - // Cut off big inserts and updates, - // but append byte count therefor - if (mb_strlen($row['argument']) > 220) { - $row['argument'] = mb_substr($row['argument'], 0, 200) - . '... [' - . implode( - ' ', - PMA\libraries\Util::formatByteDown( - mb_strlen($row['argument']), - 2, - 2 - ) - ) - . ']'; - } - break; - - default: - break; - } - - $return['rows'][] = $row; - $i++; - } - - $return['sum']['TOTAL'] = array_sum($return['sum']); - $return['numRows'] = count($return['rows']); - - $GLOBALS['dbi']->freeResult($result); - - return $return; -} - -/** - * Return suspension points if needed - * - * @param string $lastChar Last char - * - * @return null|string Return suspension points if needed - */ -function PMA_getSuspensionPoints($lastChar) -{ - if ($lastChar != '.') { - return '
    ...'; - } - - return null; -} -/** - * Returns JSon for logging vars - * - * @return array - */ -function PMA_getJsonForLoggingVars() -{ - if (isset($_REQUEST['varName']) && isset($_REQUEST['varValue'])) { - $value = $GLOBALS['dbi']->escapeString($_REQUEST['varValue']); - if (! is_numeric($value)) { - $value="'" . $value . "'"; - } - - if (! preg_match("/[^a-zA-Z0-9_]+/", $_REQUEST['varName'])) { - $GLOBALS['dbi']->query( - 'SET GLOBAL ' . $_REQUEST['varName'] . ' = ' . $value - ); - } - - } - - $loggingVars = $GLOBALS['dbi']->fetchResult( - 'SHOW GLOBAL VARIABLES WHERE Variable_name IN' - . ' ("general_log","slow_query_log","long_query_time","log_output")', - 0, - 1 - ); - return $loggingVars; -} - -/** - * Returns JSon for query_analyzer - * - * @return array - */ -function PMA_getJsonForQueryAnalyzer() -{ - $return = array(); - - if (mb_strlen($_REQUEST['database'])) { - $GLOBALS['dbi']->selectDb($_REQUEST['database']); - } - - if ($profiling = PMA\libraries\Util::profilingSupported()) { - $GLOBALS['dbi']->query('SET PROFILING=1;'); - } - - // Do not cache query - $query = preg_replace( - '/^(\s*SELECT)/i', - '\\1 SQL_NO_CACHE', - $_REQUEST['query'] - ); - - $GLOBALS['dbi']->tryQuery($query); - $return['affectedRows'] = $GLOBALS['cached_affected_rows']; - - $result = $GLOBALS['dbi']->tryQuery('EXPLAIN ' . $query); - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $return['explain'][] = $row; - } - - // In case an error happened - $return['error'] = $GLOBALS['dbi']->getError(); - - $GLOBALS['dbi']->freeResult($result); - - if ($profiling) { - $return['profiling'] = array(); - $result = $GLOBALS['dbi']->tryQuery( - 'SELECT seq,state,duration FROM INFORMATION_SCHEMA.PROFILING' - . ' WHERE QUERY_ID=1 ORDER BY seq' - ); - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $return['profiling'][]= $row; - } - $GLOBALS['dbi']->freeResult($result); - } - return $return; -} - diff --git a/#pma/libraries/server_status_processes.lib.php b/#pma/libraries/server_status_processes.lib.php deleted file mode 100644 index b55226e0..00000000 --- a/#pma/libraries/server_status_processes.lib.php +++ /dev/null @@ -1,308 +0,0 @@ -getDisplay(); - $retval = $notice . ''; - return $retval; -} - -/** - * Prints Server Process list - * - * @return string - */ -function PMA_getHtmlForServerProcesslist() -{ - $url_params = array(); - - $show_full_sql = ! empty($_REQUEST['full']); - if ($show_full_sql) { - $url_params['full'] = 1; - $full_text_link = 'server_status_processes.php' . PMA_URL_getCommon( - array(), 'html', '?' - ); - } else { - $full_text_link = 'server_status_processes.php' . PMA_URL_getCommon( - array('full' => 1) - ); - } - - // This array contains display name and real column name of each - // sortable column in the table - $sortable_columns = array( - array( - 'column_name' => __('ID'), - 'order_by_field' => 'Id' - ), - array( - 'column_name' => __('User'), - 'order_by_field' => 'User' - ), - array( - 'column_name' => __('Host'), - 'order_by_field' => 'Host' - ), - array( - 'column_name' => __('Database'), - 'order_by_field' => 'db' - ), - array( - 'column_name' => __('Command'), - 'order_by_field' => 'Command' - ), - array( - 'column_name' => __('Time'), - 'order_by_field' => 'Time' - ), - array( - 'column_name' => __('Status'), - 'order_by_field' => 'State' - ), - array( - 'column_name' => __('Progress'), - 'order_by_field' => 'Progress' - ), - array( - 'column_name' => __('SQL query'), - 'order_by_field' => 'Info' - ) - ); - $sortableColCount = count($sortable_columns); - - $sql_query = $show_full_sql - ? 'SHOW FULL PROCESSLIST' - : 'SHOW PROCESSLIST'; - if ((! empty($_REQUEST['order_by_field']) - && ! empty($_REQUEST['sort_order'])) - || (! empty($_REQUEST['showExecuting'])) - ) { - $sql_query = 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` '; - } - if (! empty($_REQUEST['showExecuting'])) { - $sql_query .= ' WHERE state = "executing" '; - } - if (!empty($_REQUEST['order_by_field']) && !empty($_REQUEST['sort_order'])) { - $sql_query .= ' ORDER BY ' - . Util::backquote($_REQUEST['order_by_field']) - . ' ' . $_REQUEST['sort_order']; - } - - $result = $GLOBALS['dbi']->query($sql_query); - - $retval = ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - foreach ($sortable_columns as $column) { - - $is_sorted = ! empty($_REQUEST['order_by_field']) - && ! empty($_REQUEST['sort_order']) - && ($_REQUEST['order_by_field'] == $column['order_by_field']); - - $column['sort_order'] = 'ASC'; - if ($is_sorted && $_REQUEST['sort_order'] === 'ASC') { - $column['sort_order'] = 'DESC'; - } - if (isset($_REQUEST['showExecuting'])) { - $column['showExecuting'] = 'on'; - } - - $retval .= ''; - } - - $retval .= ''; - $retval .= ''; - $retval .= ''; - - $odd_row = true; - while ($process = $GLOBALS['dbi']->fetchAssoc($result)) { - $retval .= PMA_getHtmlForServerProcessItem( - $process, - $odd_row, - $show_full_sql - ); - $odd_row = ! $odd_row; - } - $retval .= ''; - $retval .= '
    ' . __('Processes') . ''; - $columnUrl = PMA_URL_getCommon($column); - $retval .= ''; - $retval .= ''
-                . __('Ascending') . ''; - } - - $retval .= ''; - - if (0 === --$sortableColCount) { - $retval .= ''; - if ($show_full_sql) { - $retval .= Util::getImage( - 's_partialtext.png', - __('Truncate Shown Queries') - ); - } else { - $retval .= Util::getImage( - 's_fulltext.png', - __('Show Full Queries') - ); - } - $retval .= ''; - } - $retval .= '
    '; - - return $retval; -} - -/** - * Returns the html for the list filter - * - * @return string - */ -function PMA_getHtmlForProcessListFilter() -{ - $showExecuting = ''; - if (! empty($_REQUEST['showExecuting'])) { - $showExecuting = ' checked="checked"'; - } - - $url_params = array( - 'ajax_request' => true, - 'full' => (isset($_REQUEST['full']) ? $_REQUEST['full'] : ''), - 'column_name' => (isset($_REQUEST['column_name']) ? $_REQUEST['column_name'] : ''), - 'order_by_field' - => (isset($_REQUEST['order_by_field']) ? $_REQUEST['order_by_field'] : ''), - 'sort_order' => (isset($_REQUEST['sort_order']) ? $_REQUEST['sort_order'] : ''), - ); - - $retval = ''; - $retval .= '
    '; - $retval .= '' . __('Filters') . ''; - $retval .= '
    '; - $retval .= ''; - $retval .= '
    '; - $retval .= ''; - $retval .= ''; - $retval .= '
    '; - $retval .= '
    '; - $retval .= '
    '; - - return $retval; -} - -/** - * Prints Every Item of Server Process - * - * @param array $process data of Every Item of Server Process - * @param bool $odd_row display odd row or not - * @param bool $show_full_sql show full sql or not - * - * @return string - */ -function PMA_getHtmlForServerProcessItem($process, $odd_row, $show_full_sql) -{ - // Array keys need to modify due to the way it has used - // to display column values - if ((! empty($_REQUEST['order_by_field']) && ! empty($_REQUEST['sort_order'])) - || (! empty($_REQUEST['showExecuting'])) - ) { - foreach (array_keys($process) as $key) { - $new_key = ucfirst(mb_strtolower($key)); - if ($new_key !== $key) { - $process[$new_key] = $process[$key]; - unset($process[$key]); - } - } - } - - $url_params = array( - 'kill' => $process['Id'], - 'ajax_request' => true - ); - $kill_process = 'server_status_processes.php' . PMA_URL_getCommon($url_params); - - $retval = ''; - $retval .= '' - . __('Kill') . ''; - $retval .= '' . $process['Id'] . ''; - $retval .= '' . htmlspecialchars($process['User']) . ''; - $retval .= '' . htmlspecialchars($process['Host']) . ''; - $retval .= '' . ((! isset($process['db']) - || !mb_strlen($process['db'])) - ? '' . __('None') . '' - : htmlspecialchars($process['db'])) . ''; - $retval .= '' . htmlspecialchars($process['Command']) . ''; - $retval .= '' . $process['Time'] . ''; - $processStatusStr = empty($process['State']) ? '---' : $process['State']; - $retval .= '' . $processStatusStr . ''; - $processProgress = empty($process['Progress']) ? '---' : $process['Progress']; - $retval .= '' . $processProgress . ''; - $retval .= ''; - - if (empty($process['Info'])) { - $retval .= '---'; - } else { - $retval .= Util::formatSql($process['Info'], ! $show_full_sql); - } - $retval .= ''; - $retval .= ''; - - return $retval; -} - diff --git a/#pma/libraries/server_status_queries.lib.php b/#pma/libraries/server_status_queries.lib.php deleted file mode 100644 index b81f9067..00000000 --- a/#pma/libraries/server_status_queries.lib.php +++ /dev/null @@ -1,152 +0,0 @@ -status['Uptime']; - $used_queries = $ServerStatusData->used_queries; - $total_queries = array_sum($used_queries); - - $retval .= '

    '; - /* l10n: Questions is the name of a MySQL Status variable */ - $retval .= sprintf( - __('Questions since startup: %s'), - PMA\libraries\Util::formatNumber($total_queries, 0) - ); - $retval .= ' '; - $retval .= PMA\libraries\Util::showMySQLDocu( - 'server-status-variables', - false, - 'statvar_Questions' - ); - $retval .= '
    '; - $retval .= ''; - $retval .= 'ø ' . __('per hour:') . ' '; - $retval .= PMA\libraries\Util::formatNumber($total_queries * $hour_factor, 0); - $retval .= '
    '; - $retval .= 'ø ' . __('per minute:') . ' '; - $retval .= PMA\libraries\Util::formatNumber( - $total_queries * 60 / $ServerStatusData->status['Uptime'], - 0 - ); - $retval .= '
    '; - if ($total_queries / $ServerStatusData->status['Uptime'] >= 1) { - $retval .= 'ø ' . __('per second:') . ' '; - $retval .= PMA\libraries\Util::formatNumber( - $total_queries / $ServerStatusData->status['Uptime'], - 0 - ); - } - $retval .= '
    '; - $retval .= '

    '; - - $retval .= PMA_getHtmlForServerStatusQueriesDetails($ServerStatusData); - - return $retval; -} - -/** - * Returns the html content for the query details - * - * @param ServerStatusData $ServerStatusData Server status data - * - * @return string - */ -function PMA_getHtmlForServerStatusQueriesDetails($ServerStatusData) -{ - $hour_factor = 3600 / $ServerStatusData->status['Uptime']; - $used_queries = $ServerStatusData->used_queries; - $total_queries = array_sum($used_queries); - // reverse sort by value to show most used statements first - arsort($used_queries); - - $odd_row = true; - - //(- $ServerStatusData->status['Connections']); - $perc_factor = 100 / $total_queries; - - $retval = ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - - $chart_json = array(); - $query_sum = array_sum($used_queries); - $other_sum = 0; - foreach ($used_queries as $name => $value) { - $odd_row = !$odd_row; - // For the percentage column, use Questions - Connections, because - // the number of connections is not an item of the Query types - // but is included in Questions. Then the total of the percentages is 100. - $name = str_replace(array('Com_', '_'), array('', ' '), $name); - // Group together values that make out less than 2% into "Other", but only - // if we have more than 6 fractions already - if ($value < $query_sum * 0.02 && count($chart_json)>6) { - $other_sum += $value; - } else { - $chart_json[$name] = $value; - } - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - } - $retval .= ''; - $retval .= '
    ' . __('Statements') . ''; - /* l10n: # = Amount of queries */ - $retval .= __('#'); - $retval .= 'ø ' . __('per hour') - . '%
    ' . htmlspecialchars($name) . ''; - $retval .= htmlspecialchars( - PMA\libraries\Util::formatNumber($value, 5, 0, true) - ); - $retval .= ''; - $retval .= htmlspecialchars( - PMA\libraries\Util::formatNumber($value * $hour_factor, 4, 1, true) - ); - $retval .= ''; - $retval .= htmlspecialchars( - PMA\libraries\Util::formatNumber($value * $perc_factor, 0, 2) - ); - $retval .= '
    '; - - $retval .= '
    '; - $retval .= ''; - - return $retval; -} - diff --git a/#pma/libraries/server_status_variables.lib.php b/#pma/libraries/server_status_variables.lib.php deleted file mode 100644 index 53b7ad4b..00000000 --- a/#pma/libraries/server_status_variables.lib.php +++ /dev/null @@ -1,765 +0,0 @@ -'; - $retval .= '' . __('Filters') . ''; - $retval .= '
    '; - $retval .= ''; - $retval .= '
    '; - $retval .= ''; - $retval .= ''; - $retval .= '
    '; - $retval .= '
    '; - $retval .= ''; - $retval .= ''; - $retval .= '
    '; - $retval .= '
    '; - $retval .= ''; - $retval .= '
    '; - $retval .= '
    '; - $retval .= ''; - $retval .= ''; - $retval .= '
    '; - $retval .= '
    '; - $retval .= ''; - - return $retval; -} - -/** - * Prints the suggestion links - * - * @param ServerStatusData $ServerStatusData Server status data - * - * @return string - */ -function PMA_getHtmlForLinkSuggestions($ServerStatusData) -{ - $retval = ''; - - return $retval; -} - -/** - * Returns a table with variables information - * - * @param ServerStatusData $ServerStatusData Server status data - * - * @return string - */ -function PMA_getHtmlForVariablesList($ServerStatusData) -{ - $retval = ''; - $strShowStatus = PMA_getStatusVariablesDescriptions(); - /** - * define some alerts - */ - // name => max value before alert - $alerts = array( - // lower is better - // variable => max value - 'Aborted_clients' => 0, - 'Aborted_connects' => 0, - - 'Binlog_cache_disk_use' => 0, - - 'Created_tmp_disk_tables' => 0, - - 'Handler_read_rnd' => 0, - 'Handler_read_rnd_next' => 0, - - 'Innodb_buffer_pool_pages_dirty' => 0, - 'Innodb_buffer_pool_reads' => 0, - 'Innodb_buffer_pool_wait_free' => 0, - 'Innodb_log_waits' => 0, - 'Innodb_row_lock_time_avg' => 10, // ms - 'Innodb_row_lock_time_max' => 50, // ms - 'Innodb_row_lock_waits' => 0, - - 'Slow_queries' => 0, - 'Delayed_errors' => 0, - 'Select_full_join' => 0, - 'Select_range_check' => 0, - 'Sort_merge_passes' => 0, - 'Opened_tables' => 0, - 'Table_locks_waited' => 0, - 'Qcache_lowmem_prunes' => 0, - - 'Qcache_free_blocks' => - isset($ServerStatusData->status['Qcache_total_blocks']) - ? $ServerStatusData->status['Qcache_total_blocks'] / 5 - : 0, - 'Slow_launch_threads' => 0, - - // depends on Key_read_requests - // normally lower then 1:0.01 - 'Key_reads' => isset($ServerStatusData->status['Key_read_requests']) - ? (0.01 * $ServerStatusData->status['Key_read_requests']) : 0, - // depends on Key_write_requests - // normally nearly 1:1 - 'Key_writes' => isset($ServerStatusData->status['Key_write_requests']) - ? (0.9 * $ServerStatusData->status['Key_write_requests']) : 0, - - 'Key_buffer_fraction' => 0.5, - - // alert if more than 95% of thread cache is in use - 'Threads_cached' => isset($ServerStatusData->variables['thread_cache_size']) - ? 0.95 * $ServerStatusData->variables['thread_cache_size'] : 0 - - // higher is better - // variable => min value - //'Handler read key' => '> ', - ); - - $retval .= PMA_getHtmlForRenderVariables( - $ServerStatusData, - $alerts, - $strShowStatus - ); - - return $retval; -} - -/** - * Returns HTML for render variables list - * - * @param ServerStatusData $ServerStatusData Server status data - * @param array $alerts Alert Array - * @param array $strShowStatus Status Array - * - * @return string - */ -function PMA_getHtmlForRenderVariables($ServerStatusData, $alerts, $strShowStatus) -{ - $retval = ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - $retval .= ''; - - $odd_row = false; - foreach ($ServerStatusData->status as $name => $value) { - $odd_row = !$odd_row; - $retval .= ''; - - $retval .= ''; - - $retval .= ''; - $retval .= ''; - $retval .= ''; - } - $retval .= ''; - $retval .= '
    ' . __('Variable') . '' . __('Value') . '' . __('Description') . '
    '; - $retval .= htmlspecialchars(str_replace('_', ' ', $name)); - // Fields containing % are calculated, - // they can not be described in MySQL documentation - if (mb_strpos($name, '%') === false) { - $retval .= PMA\libraries\Util::showMySQLDocu( - 'server-status-variables', - false, - 'statvar_' . $name - ); - } - $retval .= ''; - if (isset($alerts[$name])) { - if ($value > $alerts[$name]) { - $retval .= ''; - } else { - $retval .= ''; - } - } - if (substr($name, -1) === '%') { - $retval .= htmlspecialchars( - PMA\libraries\Util::formatNumber($value, 0, 2) - ) . ' %'; - } elseif (strpos($name, 'Uptime') !== false) { - $retval .= htmlspecialchars( - PMA\libraries\Util::timespanFormat($value) - ); - } elseif (is_numeric($value) && $value > 1000) { - $retval .= '' - . htmlspecialchars(PMA\libraries\Util::formatNumber($value, 3, 1)) - . ''; - } elseif (is_numeric($value)) { - $retval .= htmlspecialchars( - PMA\libraries\Util::formatNumber($value, 3, 1) - ); - } else { - $retval .= htmlspecialchars($value); - } - if (isset($alerts[$name])) { - $retval .= ''; - } - $retval .= ''; - $retval .= ''; - - if (isset($strShowStatus[$name])) { - $retval .= $strShowStatus[$name]; - } - - if (isset($ServerStatusData->links[$name])) { - foreach ($ServerStatusData->links[$name] as $link_name => $link_url) { - if ('doc' == $link_name) { - $retval .= PMA\libraries\Util::showMySQLDocu($link_url); - } else { - $retval .= ' ' . $link_name . ''; - } - } - unset($link_url, $link_name); - } - $retval .= '
    '; - - return $retval; -} - -/** - * Returns a list of variable descriptions - * - * @return array - */ -function PMA_getStatusVariablesDescriptions() -{ - /** - * Messages are built using the message name - */ - return array( - 'Aborted_clients' => __( - 'The number of connections that were aborted because the client died' - . ' without closing the connection properly.' - ), - 'Aborted_connects' => __( - 'The number of failed attempts to connect to the MySQL server.' - ), - 'Binlog_cache_disk_use' => __( - 'The number of transactions that used the temporary binary log cache' - . ' but that exceeded the value of binlog_cache_size and used a' - . ' temporary file to store statements from the transaction.' - ), - 'Binlog_cache_use' => __( - 'The number of transactions that used the temporary binary log cache.' - ), - 'Connections' => __( - 'The number of connection attempts (successful or not)' - . ' to the MySQL server.' - ), - 'Created_tmp_disk_tables' => __( - 'The number of temporary tables on disk created automatically by' - . ' the server while executing statements. If' - . ' Created_tmp_disk_tables is big, you may want to increase the' - . ' tmp_table_size value to cause temporary tables to be' - . ' memory-based instead of disk-based.' - ), - 'Created_tmp_files' => __( - 'How many temporary files mysqld has created.' - ), - 'Created_tmp_tables' => __( - 'The number of in-memory temporary tables created automatically' - . ' by the server while executing statements.' - ), - 'Delayed_errors' => __( - 'The number of rows written with INSERT DELAYED for which some' - . ' error occurred (probably duplicate key).' - ), - 'Delayed_insert_threads' => __( - 'The number of INSERT DELAYED handler threads in use. Every' - . ' different table on which one uses INSERT DELAYED gets' - . ' its own thread.' - ), - 'Delayed_writes' => __( - 'The number of INSERT DELAYED rows written.' - ), - 'Flush_commands' => __( - 'The number of executed FLUSH statements.' - ), - 'Handler_commit' => __( - 'The number of internal COMMIT statements.' - ), - 'Handler_delete' => __( - 'The number of times a row was deleted from a table.' - ), - 'Handler_discover' => __( - 'The MySQL server can ask the NDB Cluster storage engine if it' - . ' knows about a table with a given name. This is called discovery.' - . ' Handler_discover indicates the number of time tables have been' - . ' discovered.' - ), - 'Handler_read_first' => __( - 'The number of times the first entry was read from an index. If this' - . ' is high, it suggests that the server is doing a lot of full' - . ' index scans; for example, SELECT col1 FROM foo, assuming that' - . ' col1 is indexed.' - ), - 'Handler_read_key' => __( - 'The number of requests to read a row based on a key. If this is' - . ' high, it is a good indication that your queries and tables' - . ' are properly indexed.' - ), - 'Handler_read_next' => __( - 'The number of requests to read the next row in key order. This is' - . ' incremented if you are querying an index column with a range' - . ' constraint or if you are doing an index scan.' - ), - 'Handler_read_prev' => __( - 'The number of requests to read the previous row in key order.' - . ' This read method is mainly used to optimize ORDER BY … DESC.' - ), - 'Handler_read_rnd' => __( - 'The number of requests to read a row based on a fixed position.' - . ' This is high if you are doing a lot of queries that require' - . ' sorting of the result. You probably have a lot of queries that' - . ' require MySQL to scan whole tables or you have joins that' - . ' don\'t use keys properly.' - ), - 'Handler_read_rnd_next' => __( - 'The number of requests to read the next row in the data file.' - . ' This is high if you are doing a lot of table scans. Generally' - . ' this suggests that your tables are not properly indexed or that' - . ' your queries are not written to take advantage of the indexes' - . ' you have.' - ), - 'Handler_rollback' => __( - 'The number of internal ROLLBACK statements.' - ), - 'Handler_update' => __( - 'The number of requests to update a row in a table.' - ), - 'Handler_write' => __( - 'The number of requests to insert a row in a table.' - ), - 'Innodb_buffer_pool_pages_data' => __( - 'The number of pages containing data (dirty or clean).' - ), - 'Innodb_buffer_pool_pages_dirty' => __( - 'The number of pages currently dirty.' - ), - 'Innodb_buffer_pool_pages_flushed' => __( - 'The number of buffer pool pages that have been requested' - . ' to be flushed.' - ), - 'Innodb_buffer_pool_pages_free' => __( - 'The number of free pages.' - ), - 'Innodb_buffer_pool_pages_latched' => __( - 'The number of latched pages in InnoDB buffer pool. These are pages' - . ' currently being read or written or that can\'t be flushed or' - . ' removed for some other reason.' - ), - 'Innodb_buffer_pool_pages_misc' => __( - 'The number of pages busy because they have been allocated for' - . ' administrative overhead such as row locks or the adaptive' - . ' hash index. This value can also be calculated as' - . ' Innodb_buffer_pool_pages_total - Innodb_buffer_pool_pages_free' - . ' - Innodb_buffer_pool_pages_data.' - ), - 'Innodb_buffer_pool_pages_total' => __( - 'Total size of buffer pool, in pages.' - ), - 'Innodb_buffer_pool_read_ahead_rnd' => __( - 'The number of "random" read-aheads InnoDB initiated. This happens' - . ' when a query is to scan a large portion of a table but in' - . ' random order.' - ), - 'Innodb_buffer_pool_read_ahead_seq' => __( - 'The number of sequential read-aheads InnoDB initiated. This' - . ' happens when InnoDB does a sequential full table scan.' - ), - 'Innodb_buffer_pool_read_requests' => __( - 'The number of logical read requests InnoDB has done.' - ), - 'Innodb_buffer_pool_reads' => __( - 'The number of logical reads that InnoDB could not satisfy' - . ' from buffer pool and had to do a single-page read.' - ), - 'Innodb_buffer_pool_wait_free' => __( - 'Normally, writes to the InnoDB buffer pool happen in the' - . ' background. However, if it\'s necessary to read or create a page' - . ' and no clean pages are available, it\'s necessary to wait for' - . ' pages to be flushed first. This counter counts instances of' - . ' these waits. If the buffer pool size was set properly, this' - . ' value should be small.' - ), - 'Innodb_buffer_pool_write_requests' => __( - 'The number writes done to the InnoDB buffer pool.' - ), - 'Innodb_data_fsyncs' => __( - 'The number of fsync() operations so far.' - ), - 'Innodb_data_pending_fsyncs' => __( - 'The current number of pending fsync() operations.' - ), - 'Innodb_data_pending_reads' => __( - 'The current number of pending reads.' - ), - 'Innodb_data_pending_writes' => __( - 'The current number of pending writes.' - ), - 'Innodb_data_read' => __( - 'The amount of data read so far, in bytes.' - ), - 'Innodb_data_reads' => __( - 'The total number of data reads.' - ), - 'Innodb_data_writes' => __( - 'The total number of data writes.' - ), - 'Innodb_data_written' => __( - 'The amount of data written so far, in bytes.' - ), - 'Innodb_dblwr_pages_written' => __( - 'The number of pages that have been written for' - . ' doublewrite operations.' - ), - 'Innodb_dblwr_writes' => __( - 'The number of doublewrite operations that have been performed.' - ), - 'Innodb_log_waits' => __( - 'The number of waits we had because log buffer was too small and' - . ' we had to wait for it to be flushed before continuing.' - ), - 'Innodb_log_write_requests' => __( - 'The number of log write requests.' - ), - 'Innodb_log_writes' => __( - 'The number of physical writes to the log file.' - ), - 'Innodb_os_log_fsyncs' => __( - 'The number of fsync() writes done to the log file.' - ), - 'Innodb_os_log_pending_fsyncs' => __( - 'The number of pending log file fsyncs.' - ), - 'Innodb_os_log_pending_writes' => __( - 'Pending log file writes.' - ), - 'Innodb_os_log_written' => __( - 'The number of bytes written to the log file.' - ), - 'Innodb_pages_created' => __( - 'The number of pages created.' - ), - 'Innodb_page_size' => __( - 'The compiled-in InnoDB page size (default 16KB). Many values are' - . ' counted in pages; the page size allows them to be easily' - . ' converted to bytes.' - ), - 'Innodb_pages_read' => __( - 'The number of pages read.' - ), - 'Innodb_pages_written' => __( - 'The number of pages written.' - ), - 'Innodb_row_lock_current_waits' => __( - 'The number of row locks currently being waited for.' - ), - 'Innodb_row_lock_time_avg' => __( - 'The average time to acquire a row lock, in milliseconds.' - ), - 'Innodb_row_lock_time' => __( - 'The total time spent in acquiring row locks, in milliseconds.' - ), - 'Innodb_row_lock_time_max' => __( - 'The maximum time to acquire a row lock, in milliseconds.' - ), - 'Innodb_row_lock_waits' => __( - 'The number of times a row lock had to be waited for.' - ), - 'Innodb_rows_deleted' => __( - 'The number of rows deleted from InnoDB tables.' - ), - 'Innodb_rows_inserted' => __( - 'The number of rows inserted in InnoDB tables.' - ), - 'Innodb_rows_read' => __( - 'The number of rows read from InnoDB tables.' - ), - 'Innodb_rows_updated' => __( - 'The number of rows updated in InnoDB tables.' - ), - 'Key_blocks_not_flushed' => __( - 'The number of key blocks in the key cache that have changed but' - . ' haven\'t yet been flushed to disk. It used to be known as' - . ' Not_flushed_key_blocks.' - ), - 'Key_blocks_unused' => __( - 'The number of unused blocks in the key cache. You can use this' - . ' value to determine how much of the key cache is in use.' - ), - 'Key_blocks_used' => __( - 'The number of used blocks in the key cache. This value is a' - . ' high-water mark that indicates the maximum number of blocks' - . ' that have ever been in use at one time.' - ), - 'Key_buffer_fraction_%' => __( - 'Percentage of used key cache (calculated value)' - ), - 'Key_read_requests' => __( - 'The number of requests to read a key block from the cache.' - ), - 'Key_reads' => __( - 'The number of physical reads of a key block from disk. If Key_reads' - . ' is big, then your key_buffer_size value is probably too small.' - . ' The cache miss rate can be calculated as' - . ' Key_reads/Key_read_requests.' - ), - 'Key_read_ratio_%' => __( - 'Key cache miss calculated as rate of physical reads compared' - . ' to read requests (calculated value)' - ), - 'Key_write_requests' => __( - 'The number of requests to write a key block to the cache.' - ), - 'Key_writes' => __( - 'The number of physical writes of a key block to disk.' - ), - 'Key_write_ratio_%' => __( - 'Percentage of physical writes compared' - . ' to write requests (calculated value)' - ), - 'Last_query_cost' => __( - 'The total cost of the last compiled query as computed by the query' - . ' optimizer. Useful for comparing the cost of different query' - . ' plans for the same query. The default value of 0 means that' - . ' no query has been compiled yet.' - ), - 'Max_used_connections' => __( - 'The maximum number of connections that have been in use' - . ' simultaneously since the server started.' - ), - 'Not_flushed_delayed_rows' => __( - 'The number of rows waiting to be written in INSERT DELAYED queues.' - ), - 'Opened_tables' => __( - 'The number of tables that have been opened. If opened tables is' - . ' big, your table cache value is probably too small.' - ), - 'Open_files' => __( - 'The number of files that are open.' - ), - 'Open_streams' => __( - 'The number of streams that are open (used mainly for logging).' - ), - 'Open_tables' => __( - 'The number of tables that are open.' - ), - 'Qcache_free_blocks' => __( - 'The number of free memory blocks in query cache. High numbers can' - . ' indicate fragmentation issues, which may be solved by issuing' - . ' a FLUSH QUERY CACHE statement.' - ), - 'Qcache_free_memory' => __( - 'The amount of free memory for query cache.' - ), - 'Qcache_hits' => __( - 'The number of cache hits.' - ), - 'Qcache_inserts' => __( - 'The number of queries added to the cache.' - ), - 'Qcache_lowmem_prunes' => __( - 'The number of queries that have been removed from the cache to' - . ' free up memory for caching new queries. This information can' - . ' help you tune the query cache size. The query cache uses a' - . ' least recently used (LRU) strategy to decide which queries' - . ' to remove from the cache.' - ), - 'Qcache_not_cached' => __( - 'The number of non-cached queries (not cachable, or not cached' - . ' due to the query_cache_type setting).' - ), - 'Qcache_queries_in_cache' => __( - 'The number of queries registered in the cache.' - ), - 'Qcache_total_blocks' => __( - 'The total number of blocks in the query cache.' - ), - 'Rpl_status' => __( - 'The status of failsafe replication (not yet implemented).' - ), - 'Select_full_join' => __( - 'The number of joins that do not use indexes. If this value is' - . ' not 0, you should carefully check the indexes of your tables.' - ), - 'Select_full_range_join' => __( - 'The number of joins that used a range search on a reference table.' - ), - 'Select_range_check' => __( - 'The number of joins without keys that check for key usage after' - . ' each row. (If this is not 0, you should carefully check the' - . ' indexes of your tables.)' - ), - 'Select_range' => __( - 'The number of joins that used ranges on the first table. (It\'s' - . ' normally not critical even if this is big.)' - ), - 'Select_scan' => __( - 'The number of joins that did a full scan of the first table.' - ), - 'Slave_open_temp_tables' => __( - 'The number of temporary tables currently' - . ' open by the slave SQL thread.' - ), - 'Slave_retried_transactions' => __( - 'Total (since startup) number of times the replication slave SQL' - . ' thread has retried transactions.' - ), - 'Slave_running' => __( - 'This is ON if this server is a slave that is connected to a master.' - ), - 'Slow_launch_threads' => __( - 'The number of threads that have taken more than slow_launch_time' - . ' seconds to create.' - ), - 'Slow_queries' => __( - 'The number of queries that have taken more than long_query_time' - . ' seconds.' - ), - 'Sort_merge_passes' => __( - 'The number of merge passes the sort algorithm has had to do.' - . ' If this value is large, you should consider increasing the' - . ' value of the sort_buffer_size system variable.' - ), - 'Sort_range' => __( - 'The number of sorts that were done with ranges.' - ), - 'Sort_rows' => __( - 'The number of sorted rows.' - ), - 'Sort_scan' => __( - 'The number of sorts that were done by scanning the table.' - ), - 'Table_locks_immediate' => __( - 'The number of times that a table lock was acquired immediately.' - ), - 'Table_locks_waited' => __( - 'The number of times that a table lock could not be acquired' - . ' immediately and a wait was needed. If this is high, and you have' - . ' performance problems, you should first optimize your queries,' - . ' and then either split your table or tables or use replication.' - ), - 'Threads_cached' => __( - 'The number of threads in the thread cache. The cache hit rate can' - . ' be calculated as Threads_created/Connections. If this value is' - . ' red you should raise your thread_cache_size.' - ), - 'Threads_connected' => __( - 'The number of currently open connections.' - ), - 'Threads_created' => __( - 'The number of threads created to handle connections. If' - . ' Threads_created is big, you may want to increase the' - . ' thread_cache_size value. (Normally this doesn\'t give a notable' - . ' performance improvement if you have a good thread' - . ' implementation.)' - ), - 'Threads_cache_hitrate_%' => __( - 'Thread cache hit rate (calculated value)' - ), - 'Threads_running' => __( - 'The number of threads that are not sleeping.' - ) - ); -} - diff --git a/#pma/libraries/server_user_groups.lib.php b/#pma/libraries/server_user_groups.lib.php deleted file mode 100644 index add1f1dd..00000000 --- a/#pma/libraries/server_user_groups.lib.php +++ /dev/null @@ -1,362 +0,0 @@ -' - . sprintf(__('Users of \'%s\' user group'), htmlspecialchars($userGroup)) - . ''; - - $cfgRelation = PMA_getRelationsParam(); - $usersTable = PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['users']); - $sql_query = "SELECT `username` FROM " . $usersTable - . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) - . "'"; - $result = PMA_queryAsControlUser($sql_query, false); - if ($result) { - if ($GLOBALS['dbi']->numRows($result) == 0) { - $html_output .= '

    ' - . __('No users were found belonging to this user group.') - . '

    '; - } else { - $html_output .= '' - . '' - . ''; - $i = 0; - while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $i++; - $html_output .= '' - . '' - . '' - . ''; - } - $html_output .= '' - . '
    #' . __('User') . '
    ' . $i . ' ' . htmlspecialchars($row[0]) . '
    '; - } - } - $GLOBALS['dbi']->freeResult($result); - return $html_output; -} - -/** - * Returns HTML for the 'user groups' table - * - * @return string HTML for the 'user groups' table - */ -function PMA_getHtmlForUserGroupsTable() -{ - $html_output = '

    ' . __('User groups') . '

    '; - $cfgRelation = PMA_getRelationsParam(); - $groupTable = PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['usergroups']); - $sql_query = "SELECT * FROM " . $groupTable . " ORDER BY `usergroup` ASC"; - $result = PMA_queryAsControlUser($sql_query, false); - - if ($result && $GLOBALS['dbi']->numRows($result)) { - $html_output .= '
    '; - $html_output .= PMA_URL_getHiddenInputs(); - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - - $odd = true; - $userGroups = array(); - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $groupName = $row['usergroup']; - if (! isset($userGroups[$groupName])) { - $userGroups[$groupName] = array(); - } - $userGroups[$groupName][$row['tab']] = $row['allowed']; - } - foreach ($userGroups as $groupName => $tabs) { - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - - $html_output .= ''; - - $html_output .= ''; - - $odd = ! $odd; - } - - $html_output .= ''; - $html_output .= '
    ' - . __('User group') . '' . __('Server level tabs') . '' . __('Database level tabs') . '' . __('Table level tabs') . '' . __('Action') . '
    ' . htmlspecialchars($groupName) . '' . _getAllowedTabNames($tabs, 'server') . '' . _getAllowedTabNames($tabs, 'db') . '' . _getAllowedTabNames($tabs, 'table') . ''; - $html_output .= '' - . PMA\libraries\Util::getIcon('b_usrlist.png', __('View users')) - . ''; - $html_output .= '  '; - $html_output .= '' - . PMA\libraries\Util::getIcon('b_edit.png', __('Edit')) . ''; - $html_output .= '  '; - $html_output .= '' - . PMA\libraries\Util::getIcon('b_drop.png', __('Delete')) . ''; - $html_output .= '
    '; - $html_output .= '
    '; - } - $GLOBALS['dbi']->freeResult($result); - - $html_output .= '
    '; - $html_output .= '' - . PMA\libraries\Util::getIcon('b_usradd.png') - . __('Add user group') . ''; - $html_output .= '
    '; - - return $html_output; -} - -/** - * Returns the list of allowed menu tab names - * based on a data row from usergroup table. - * - * @param array $row row of usergroup table - * @param string $level 'server', 'db' or 'table' - * - * @return string comma separated list of allowed menu tab names - */ -function _getAllowedTabNames($row, $level) -{ - $tabNames = array(); - $tabs = PMA\libraries\Util::getMenuTabList($level); - foreach ($tabs as $tab => $tabName) { - if (! isset($row[$level . '_' . $tab]) - || $row[$level . '_' . $tab] == 'Y' - ) { - $tabNames[] = $tabName; - } - } - return implode(', ', $tabNames); -} - -/** - * Deletes a user group - * - * @param string $userGroup user group name - * - * @return void - */ -function PMA_deleteUserGroup($userGroup) -{ - $cfgRelation = PMA_getRelationsParam(); - $userTable = PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['users']); - $groupTable = PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['usergroups']); - $sql_query = "DELETE FROM " . $userTable - . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) - . "'"; - PMA_queryAsControlUser($sql_query, true); - $sql_query = "DELETE FROM " . $groupTable - . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) - . "'"; - PMA_queryAsControlUser($sql_query, true); -} - -/** - * Returns HTML for add/edit user group dialog - * - * @param string $userGroup name of the user group in case of editing - * - * @return string HTML for add/edit user group dialog - */ -function PMA_getHtmlToEditUserGroup($userGroup = null) -{ - $html_output = ''; - if ($userGroup == null) { - $html_output .= '

    ' . __('Add user group') . '

    '; - } else { - $html_output .= '

    ' - . sprintf(__('Edit user group: \'%s\''), htmlspecialchars($userGroup)) - . '

    '; - } - - $html_output .= '
    '; - $urlParams = array(); - if ($userGroup != null) { - $urlParams['userGroup'] = $userGroup; - $urlParams['editUserGroupSubmit'] = '1'; - } else { - $urlParams['addUserGroupSubmit'] = '1'; - } - $html_output .= PMA_URL_getHiddenInputs($urlParams); - - $html_output .= '
    '; - $html_output .= '' . __('User group menu assignments') - . '   ' - . '' - . '' - . ''; - - if ($userGroup == null) { - $html_output .= ''; - $html_output .= ''; - $html_output .= '
    '; - } - - $allowedTabs = array( - 'server' => array(), - 'db' => array(), - 'table' => array() - ); - if ($userGroup != null) { - $cfgRelation = PMA_getRelationsParam(); - $groupTable = PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['usergroups']); - $sql_query = "SELECT * FROM " . $groupTable - . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) - . "'"; - $result = PMA_queryAsControlUser($sql_query, false); - if ($result) { - while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { - $key = $row['tab']; - $value = $row['allowed']; - if (substr($key, 0, 7) == 'server_' && $value == 'Y') { - $allowedTabs['server'][] = mb_substr($key, 7); - } elseif (substr($key, 0, 3) == 'db_' && $value == 'Y') { - $allowedTabs['db'][] = mb_substr($key, 3); - } elseif (substr($key, 0, 6) == 'table_' - && $value == 'Y' - ) { - $allowedTabs['table'][] = mb_substr($key, 6); - } - } - } - $GLOBALS['dbi']->freeResult($result); - } - - $html_output .= _getTabList( - __('Server-level tabs'), 'server', $allowedTabs['server'] - ); - $html_output .= _getTabList( - __('Database-level tabs'), 'db', $allowedTabs['db'] - ); - $html_output .= _getTabList( - __('Table-level tabs'), 'table', $allowedTabs['table'] - ); - - $html_output .= '
    '; - - $html_output .= ''; - - return $html_output; -} - -/** - * Returns HTML for checkbox groups to choose - * tabs of 'server', 'db' or 'table' levels. - * - * @param string $title title of the checkbox group - * @param string $level 'server', 'db' or 'table' - * @param array $selected array of selected allowed tabs - * - * @return string HTML for checkbox groups - */ -function _getTabList($title, $level, $selected) -{ - $tabs = PMA\libraries\Util::getMenuTabList($level); - $html_output = '
    '; - $html_output .= '' . $title . ''; - foreach ($tabs as $tab => $tabName) { - $html_output .= '
    '; - $html_output .= ''; - $html_output .= ''; - $html_output .= '
    '; - } - $html_output .= '
    '; - return $html_output; -} - -/** - * Add/update a user group with allowed menu tabs. - * - * @param string $userGroup user group name - * @param boolean $new whether this is a new user group - * - * @return void - */ -function PMA_editUserGroup($userGroup, $new = false) -{ - $tabs = PMA\libraries\Util::getMenuTabList(); - $cfgRelation = PMA_getRelationsParam(); - $groupTable = PMA\libraries\Util::backquote($cfgRelation['db']) - . "." . PMA\libraries\Util::backquote($cfgRelation['usergroups']); - - if (! $new) { - $sql_query = "DELETE FROM " . $groupTable - . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) - . "';"; - PMA_queryAsControlUser($sql_query, true); - } - - $sql_query = "INSERT INTO " . $groupTable - . "(`usergroup`, `tab`, `allowed`)" - . " VALUES "; - $first = true; - foreach ($tabs as $tabGroupName => $tabGroup) { - foreach ($tabGroup as $tab => $tabName) { - if (! $first) { - $sql_query .= ", "; - } - $tabName = $tabGroupName . '_' . $tab; - $allowed = isset($_REQUEST[$tabName]) && $_REQUEST[$tabName] == 'Y'; - $sql_query .= "('" . $GLOBALS['dbi']->escapeString($userGroup) . "', '" . $tabName . "', '" - . ($allowed ? "Y" : "N") . "')"; - $first = false; - } - } - $sql_query .= ";"; - PMA_queryAsControlUser($sql_query, true); -} diff --git a/#pma/libraries/server_users.lib.php b/#pma/libraries/server_users.lib.php deleted file mode 100644 index a9031734..00000000 --- a/#pma/libraries/server_users.lib.php +++ /dev/null @@ -1,53 +0,0 @@ - __('User accounts overview'), - 'url' => 'server_privileges.php', - 'specific_params' => '&viewing_mode=server' - ) - ); - - if ($GLOBALS['is_superuser']) { - $items[] = array( - 'name' => __('User groups'), - 'url' => 'server_user_groups.php', - 'specific_params' => '' - ); - } - - $retval = '
      '; - foreach ($items as $item) { - $class = ''; - if ($item['url'] === $selfUrl) { - $class = ' class="tabactive"'; - } - $retval .= '
    • '; - $retval .= ''; - $retval .= $item['name']; - $retval .= ''; - $retval .= '
    • '; - } - $retval .= '
    '; - $retval .= '
    '; - - return $retval; -} diff --git a/#pma/libraries/session.inc.php b/#pma/libraries/session.inc.php deleted file mode 100644 index 71bd614d..00000000 --- a/#pma/libraries/session.inc.php +++ /dev/null @@ -1,169 +0,0 @@ -getRootPath(), - '', $GLOBALS['PMA_Config']->isHttps(), true -); - -// cookies are safer (use @ini_set() in case this function is disabled) -@ini_set('session.use_cookies', 'true'); - -// optionally set session_save_path -$path = $GLOBALS['PMA_Config']->get('SessionSavePath'); -if (!empty($path)) { - session_save_path($path); -} - -// use cookies only -@ini_set('session.use_only_cookies', '1'); -// strict session mode (do not accept random string as session ID) -@ini_set('session.use_strict_mode', '1'); -// make the session cookie HttpOnly -@ini_set('session.cookie_httponly', '1'); -// do not force transparent session ids -@ini_set('session.use_trans_sid', '0'); - -// delete session/cookies when browser is closed -@ini_set('session.cookie_lifetime', '0'); - -// warn but don't work with bug -@ini_set('session.bug_compat_42', 'false'); -@ini_set('session.bug_compat_warn', 'true'); - -// use more secure session ids -@ini_set('session.hash_function', '1'); - -// some pages (e.g. stylesheet) may be cached on clients, but not in shared -// proxy servers -session_cache_limiter('private'); - -// start the session -// on some servers (for example, sourceforge.net), we get a permission error -// on the session data directory, so I add some "@" - - -function PMA_sessionFailed($errors) -{ - $messages = array(); - foreach ($errors as $error) { - /* - * Remove path from open() in error message to avoid path disclossure - * - * This can happen with PHP 5 when nonexisting session ID is provided, - * since PHP 7, session existence is checked first. - * - * This error can also happen in case of session backed error (eg. - * read only filesystem) on any PHP version. - * - * The message string is currently hardcoded in PHP, so hopefully it - * will not change in future. - */ - $messages[] = preg_replace( - '/open\(.*, O_RDWR\)/', - 'open(SESSION_FILE, O_RDWR)', - htmlspecialchars($error->getMessage()) - ); - } - - /* - * Session initialization is done before selecting language, so we - * can not use translations here. - */ - PMA_fatalError( - 'Error during session start; please check your PHP and/or ' - . 'webserver log file and configure your PHP ' - . 'installation properly. Also ensure that cookies are enabled ' - . 'in your browser.' - . '

    ' - . implode('

    ', $messages) - ); -} - -// See bug #1538132. This would block normal behavior on a cluster -//ini_set('session.save_handler', 'files'); - -$session_name = 'phpMyAdmin'; -@session_name($session_name); - -// on first start of session we check for errors -// f.e. session dir cannot be accessed - session file not created -$orig_error_count = $GLOBALS['error_handler']->countErrors(false); - -$session_result = session_start(); - -if ($session_result !== true - || $orig_error_count != $GLOBALS['error_handler']->countErrors(false) -) { - setcookie($session_name, '', 1); - $errors = $GLOBALS['error_handler']->sliceErrors($orig_error_count); - PMA_sessionFailed($errors); -} -unset($orig_error_count, $session_result); - -/** - * Disable setting of session cookies for further session_start() calls. - */ -@ini_set('session.use_cookies', 'true'); - -/** - * Token which is used for authenticating access queries. - * (we use "space PMA_token space" to prevent overwriting) - */ -if (! isset($_SESSION[' PMA_token '])) { - if (! function_exists('openssl_random_pseudo_bytes')) { - $_SESSION[' PMA_token '] = bin2hex(phpseclib\Crypt\Random::string(16)); - } else { - $_SESSION[' PMA_token '] = bin2hex(openssl_random_pseudo_bytes(16)); - } - - /** - * Check for disk space on session storage by trying to write it. - * - * This seems to be most reliable approach to test if sessions are working, - * otherwise the check would fail with custom session backends. - */ - $orig_error_count = $GLOBALS['error_handler']->countErrors(); - session_write_close(); - if ($GLOBALS['error_handler']->countErrors() > $orig_error_count) { - $errors = $GLOBALS['error_handler']->sliceErrors($orig_error_count); - PMA_sessionFailed($errors); - } - session_start(); -} -/** - * Check if token is properly generated (both above functions can return false). - */ -if (empty($_SESSION[' PMA_token '])) { - PMA_fatalError( - 'Failed to generate random CSRF token!' - ); -} - -require_once 'libraries/session.lib.php'; diff --git a/#pma/libraries/session.lib.php b/#pma/libraries/session.lib.php deleted file mode 100644 index 5c78d381..00000000 --- a/#pma/libraries/session.lib.php +++ /dev/null @@ -1,27 +0,0 @@ - array( - * // Table name - * 'db' => array( - * // Column name - * 'user' => array( - * // Main url param (can be an array where represent sql) - * 'link_param' => 'username', - * // Other url params - * 'link_dependancy_params' => array( - * 0 => array( - * // URL parameter name - * // (can be array where url param has static value) - * 'param_info' => 'hostname', - * // Column name related to url param - * 'column_name' => 'host' - * ) - * ), - * // Page to link - * 'default_page' => './server_privileges.php' - * ) - * ) - * ) - * ); - * - */ -$GLOBALS['special_schema_links'] = array( - 'mysql' => array( - 'columns_priv' => array( - 'user' => array( - 'link_param' => 'username', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'hostname', - 'column_name' => 'host' - ) - ), - 'default_page' => './server_privileges.php' - ), - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'Db' - ), - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - 'column_name' => array( - 'link_param' => 'field', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'Db' - ), - 1 => array( - 'param_info' => 'table', - 'column_name' => 'Table_name' - ) - ), - 'default_page' => './tbl_structure.php?change_column=1' - ), - ), - 'db' => array( - 'user' => array( - 'link_param' => 'username', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'hostname', - 'column_name' => 'host' - ) - ), - 'default_page' => './server_privileges.php' - ) - ), - 'event' => array( - 'name' => array( - 'link_param' => 'item_name', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'db' - ) - ), - 'default_page' => './db_events.php?edit_item=1' - ), - - ), - 'innodb_index_stats' => array( - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'database_name' - ), - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - 'index_name' => array( - 'link_param' => 'index', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'database_name' - ), - 1 => array( - 'param_info' => 'table', - 'column_name' => 'table_name' - ) - ), - 'default_page' => './tbl_structure.php' - ), - ), - 'innodb_table_stats' => array( - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'database_name' - ), - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - ), - 'proc' => array( - 'name' => array( - 'link_param' => 'item_name', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'db' - ), - 1 => array( - 'param_info' => 'item_type', - 'column_name' => 'type' - ) - ), - 'default_page' => './db_routines.php?edit_item=1' - ), - 'specific_name' => array( - 'link_param' => 'item_name', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'db' - ), - 1 => array( - 'param_info' => 'item_type', - 'column_name' => 'type' - ) - ), - 'default_page' => './db_routines.php?edit_item=1' - ), - ), - 'proc_priv' => array( - 'user' => array( - 'link_param' => 'username', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'hostname', - 'column_name' => 'Host' - ) - ), - 'default_page' => './server_privileges.php' - ), - 'routine_name' => array( - 'link_param' => 'item_name', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'Db' - ), - 1 => array( - 'param_info' => 'item_type', - 'column_name' => 'Routine_type' - ) - ), - 'default_page' => './db_routines.php?edit_item=1' - ), - ), - 'proxies_priv' => array( - 'user' => array( - 'link_param' => 'username', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'hostname', - 'column_name' => 'Host' - ) - ), - 'default_page' => './server_privileges.php' - ), - ), - 'tables_priv' => array( - 'user' => array( - 'link_param' => 'username', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'hostname', - 'column_name' => 'Host' - ) - ), - 'default_page' => './server_privileges.php' - ), - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'Db' - ), - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - ), - 'user' => array( - 'user' => array( - 'link_param' => 'username', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'hostname', - 'column_name' => 'host' - ) - ), - 'default_page' => './server_privileges.php' - ) - ) - ), - 'information_schema' => array( - 'columns' => array( - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'table_schema' - ) - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - 'column_name' => array( - 'link_param' => 'field', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'table_schema' - ), - 1 => array( - 'param_info' => 'table', - 'column_name' => 'table_name' - ) - ), - 'default_page' => './tbl_structure.php?change_column=1' - ) - ), - 'key_column_usage' => array( - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'constraint_schema' - ) - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - 'column_name' => array( - 'link_param' => 'field', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'table_schema' - ), - 1 => array( - 'param_info' => 'table', - 'column_name' => 'table_name' - ) - ), - 'default_page' => './tbl_structure.php?change_column=1' - ), - 'referenced_table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'referenced_table_schema' - ) - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - 'referenced_column_name' => array( - 'link_param' => 'field', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'referenced_table_schema' - ), - 1 => array( - 'param_info' => 'table', - 'column_name' => 'referenced_table_name' - ) - ), - 'default_page' => './tbl_structure.php?change_column=1' - ) - ), - 'partitions' => array( - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'table_schema' - ) - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ) - ), - 'processlist' => array( - 'user' => array( - 'link_param' => 'username', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'hostname', - 'column_name' => 'host' - ) - ), - 'default_page' => './server_privileges.php' - ) - ), - 'referential_constraints' => array( - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'constraint_schema' - ) - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - 'referenced_table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'constraint_schema' - ) - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ) - ), - 'routines' => array( - 'routine_name' => array( - 'link_param' => 'item_name', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'routine_schema' - ), - 1 => array( - 'param_info' => 'item_type', - 'column_name' => 'routine_type' - ) - ), - 'default_page' => './db_routines.php' - ), - ), - 'schemata' => array( - 'schema_name' => array( - 'link_param' => 'db', - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ) - ), - 'statistics' => array( - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'table_schema' - ) - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - 'column_name' => array( - 'link_param' => 'field', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'table_schema' - ), - 1 => array( - 'param_info' => 'table', - 'column_name' => 'table_name' - ) - ), - 'default_page' => './tbl_structure.php?change_column=1' - ) - ), - 'tables' => array( - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'table_schema' - ) - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - ), - 'table_constraints' => array( - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'table_schema' - ) - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - ), - 'views' => array( - 'table_name' => array( - 'link_param' => 'table', - 'link_dependancy_params' => array( - 0 => array( - 'param_info' => 'db', - 'column_name' => 'table_schema' - ) - ), - 'default_page' => './' . PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ) - ), - ), - ) -); - diff --git a/#pma/libraries/sql-parser/ClassLoader.php b/#pma/libraries/sql-parser/ClassLoader.php deleted file mode 100644 index 3ff2f69d..00000000 --- a/#pma/libraries/sql-parser/ClassLoader.php +++ /dev/null @@ -1,250 +0,0 @@ - - * Jordi Boggiano - * - * @package SqlParser - * @subpackage Autoload - */ -namespace SqlParser\Autoload; - -/** - * ClassLoader implements a PSR-4 class loader, - * - * This class is loosely based on the Symfony UniversalClassLoader. - * This class is a stripped version of Composer's ClassLoader. - * - * @package SqlParser - * @subpackage Autoload - * @author Fabien Potencier - * @author Jordi Boggiano - */ -class ClassLoader -{ - public $prefixLengths = array(); - public $prefixDirs = array(); - public $fallbackDirs = array(); - - public $classMap = array(); - - public $classMapAuthoritative = false; - - /** - * @param array $classMap Class to filename map - * - * @return void - */ - public function addClassMap(array $classMap) - { - if (!empty($this->classMap)) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-0 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirs = array_merge( - (array) $paths, - $this->fallbackDirs - ); - } else { - $this->fallbackDirs = array_merge( - $this->fallbackDirs, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirs[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengths[$prefix[0]][$prefix] = $length; - $this->prefixDirs[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirs[$prefix] = array_merge( - (array) $paths, - $this->prefixDirs[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirs[$prefix] = array_merge( - $this->prefixDirs[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirs = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengths[$prefix[0]][$prefix] = $length; - $this->prefixDirs[$prefix] = (array) $paths; - } - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative) { - return false; - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if ($file === null && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if ($file === null) { - // Remember that this class does not exist. - return $this->classMap[$class] = false; - } - - return $file; - } - - /** - * Finds a file that defines the specified class and has the specified - * extension. - * - * @param string $class The name of the class - * @param string $ext The extension of the file - * - * @return string|false The path if found, false otherwise - */ - public function findFileWithExtension($class, $ext) - { - $logicalPath = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengths[$first])) { - foreach ($this->prefixLengths[$first] as $prefix => $length) { - if (0 === strpos($class, $prefix)) { - foreach ($this->prefixDirs[$prefix] as $dir) { - if (is_file($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPath, $length))) { - return $file; - } - } - } - } - } - - foreach ($this->fallbackDirs as $dir) { - if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPath)) { - return $file; - } - } - - return false; - } -} - -if (!function_exists('SqlParser\\Autoload\\includeFile')) { - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file The name of the file - * - * @return void - */ - function includeFile($file) - { - include $file; - } -} diff --git a/#pma/libraries/sql-parser/autoload.php b/#pma/libraries/sql-parser/autoload.php deleted file mode 100644 index f12057f2..00000000 --- a/#pma/libraries/sql-parser/autoload.php +++ /dev/null @@ -1,78 +0,0 @@ - - * Jordi Boggiano - * - * @package SqlParser - * @subpackage Autoload - */ -namespace SqlParser\Autoload; - -if (!class_exists('SqlParser\\Autoload\\ClassLoader')) { - if (! file_exists('./libraries/sql-parser/ClassLoader.php')) { - die('Invalid invocation'); - } - include_once './libraries/sql-parser/ClassLoader.php'; -} - -use SqlParser\Autoload\ClassLoader; - -/** - * Initializes the autoloader. - * - * @package SqlParser - * @subpackage Autoload - */ -class AutoloaderInit -{ - - /** - * The loader instance. - * - * @var ClassLoader - */ - public static $loader; - - /** - * Constructs and returns the class loader. - * - * @param array $map Array containing path to each namespace. - * - * @return ClassLoader - */ - public static function getLoader(array $map) - { - if (null !== self::$loader) { - return self::$loader; - } - - self::$loader = $loader = new ClassLoader(); - - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $loader->register(true); - - return $loader; - } -} - -// php-gettext is used to translate error messages. -// This must be included before any class of the parser is loaded because -// if there is no `__` function defined, the library defines a dummy one -// in `common.php`. -require_once './libraries/vendor_config.php'; -require_once GETTEXT_INC; - -// Initializing the autoloader. -return AutoloaderInit::getLoader( - array( - 'SqlParser\\' => array(dirname(__FILE__) . '/src'), - ) -); diff --git a/#pma/libraries/sql-parser/src/Component.php b/#pma/libraries/sql-parser/src/Component.php deleted file mode 100644 index 08720cfa..00000000 --- a/#pma/libraries/sql-parser/src/Component.php +++ /dev/null @@ -1,81 +0,0 @@ - array(1, 'var'), - 'CHARSET' => array(1, 'var'), - 'DEFAULT CHARACTER SET' => array(1, 'var'), - 'DEFAULT CHARSET' => array(1, 'var'), - 'UPGRADE' => array(1, 'var'), - 'COLLATE' => array(2, 'var'), - 'DEFAULT COLLATE' => array(2, 'var'), - ); - - /** - * All table options - * - * @var array - */ - public static $TABLE_OPTIONS = array( - 'ENGINE' => array(1, 'var='), - 'AUTO_INCREMENT' => array(1, 'var='), - 'AVG_ROW_LENGTH' => array(1, 'var'), - 'MAX_ROWS' => array(1, 'var'), - 'ROW_FORMAT' => array(1, 'var'), - 'COMMENT' => array(1, 'var'), - 'ADD' => 1, - 'ALTER' => 1, - 'ANALYZE' => 1, - 'CHANGE' => 1, - 'CHECK' => 1, - 'COALESCE' => 1, - 'CONVERT' => 1, - 'DISABLE' => 1, - 'DISCARD' => 1, - 'DROP' => 1, - 'ENABLE' => 1, - 'IMPORT' => 1, - 'MODIFY' => 1, - 'OPTIMIZE' => 1, - 'ORDER' => 1, - 'PARTITION' => 1, - 'REBUILD' => 1, - 'REMOVE' => 1, - 'RENAME' => 1, - 'REORGANIZE' => 1, - 'REPAIR' => 1, - 'UPGRADE' => 1, - - 'COLUMN' => 2, - 'CONSTRAINT' => 2, - 'DEFAULT' => 2, - 'TO' => 2, - 'BY' => 2, - 'FOREIGN' => 2, - 'FULLTEXT' => 2, - 'KEY' => 2, - 'KEYS' => 2, - 'PARTITIONING' => 2, - 'PRIMARY KEY' => 2, - 'SPATIAL' => 2, - 'TABLESPACE' => 2, - 'INDEX' => 2, - ); - - /** - * All view options - * - * @var array - */ - public static $VIEW_OPTIONS = array( - 'AS' => 1, - ); - - /** - * Options of this operation. - * - * @var OptionsArray - */ - public $options; - - /** - * The altered field. - * - * @var Expression - */ - public $field; - - /** - * Unparsed tokens. - * - * @var Token[]|string - */ - public $unknown = array(); - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return AlterOperation - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = new AlterOperation(); - - /** - * Counts brackets. - * - * @var int $brackets - */ - $brackets = 0; - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 ---------------------[ options ]---------------------> 1 - * - * 1 ----------------------[ field ]----------------------> 2 - * - * 2 -------------------------[ , ]-----------------------> 0 - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping comments. - if ($token->type === Token::TYPE_COMMENT) { - continue; - } - - // Skipping whitespaces. - if ($token->type === Token::TYPE_WHITESPACE) { - if ($state === 2) { - // When parsing the unknown part, the whitespaces are - // included to not break anything. - $ret->unknown[] = $token; - } - continue; - } - - if ($state === 0) { - $ret->options = OptionsArray::parse($parser, $list, $options); - - if ($ret->options->has('AS')) { - for (; $list->idx < $list->count; ++$list->idx) { - if ($list->tokens[$list->idx]->type === Token::TYPE_DELIMITER) { - break; - } - $ret->unknown[] = $list->tokens[$list->idx]; - } - break; - } - - $state = 1; - } elseif ($state === 1) { - $ret->field = Expression::parse( - $parser, - $list, - array( - 'breakOnAlias' => true, - 'parseField' => 'column', - ) - ); - if ($ret->field === null) { - // No field was read. We go back one token so the next - // iteration will parse the same token, but in state 2. - --$list->idx; - } - $state = 2; - } elseif ($state === 2) { - if ($token->type === Token::TYPE_OPERATOR) { - if ($token->value === '(') { - ++$brackets; - } elseif ($token->value === ')') { - --$brackets; - } elseif (($token->value === ',') && ($brackets === 0)) { - break; - } - } elseif (!empty(Parser::$STATEMENT_PARSERS[$token->value])) { - // We have reached the end of ALTER operation and suddenly found - // a start to new statement, but have not find a delimiter between them - - if (! ($token->value == 'SET' && $list->tokens[$list->idx - 1]->value == 'CHARACTER')) { - $parser->error( - __('A new statement was found, but no delimiter between it and the previous one.'), - $token - ); - break; - } - } - $ret->unknown[] = $token; - } - } - - if ($ret->options->isEmpty()) { - $parser->error( - __('Unrecognized alter operation.'), - $list->tokens[$list->idx] - ); - } - - --$list->idx; - - return $ret; - } - - /** - * @param AlterOperation $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - $ret = $component->options . ' '; - if ((isset($component->field)) && ($component->field !== '')) { - $ret .= $component->field . ' '; - } - $ret .= TokensList::build($component->unknown); - return $ret; - } -} diff --git a/#pma/libraries/sql-parser/src/Components/Array2d.php b/#pma/libraries/sql-parser/src/Components/Array2d.php deleted file mode 100644 index 2199efe1..00000000 --- a/#pma/libraries/sql-parser/src/Components/Array2d.php +++ /dev/null @@ -1,133 +0,0 @@ - 1 - * - * 1 ------------------------[ , ]------------------------> 0 - * 1 -----------------------[ else ]----------------------> (END) - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - // No keyword is expected. - if (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_RESERVED)) { - break; - } - - if ($state === 0) { - if ($token->value === '(') { - $arr = ArrayObj::parse($parser, $list, $options); - $arrCount = count($arr->values); - if ($count === -1) { - $count = $arrCount; - } elseif ($arrCount != $count) { - $parser->error( - sprintf( - __('%1$d values were expected, but found %2$d.'), - $count, - $arrCount - ), - $token - ); - } - $ret[] = $arr; - $state = 1; - } else { - break; - } - } elseif ($state === 1) { - if ($token->value === ',') { - $state = 0; - } else { - break; - } - } - } - - if ($state === 0) { - $parser->error( - __('An opening bracket followed by a set of values was expected.'), - $list->tokens[$list->idx] - ); - } - - --$list->idx; - return $ret; - } - - /** - * @param ArrayObj[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - return ArrayObj::build($component); - } -} diff --git a/#pma/libraries/sql-parser/src/Components/ArrayObj.php b/#pma/libraries/sql-parser/src/Components/ArrayObj.php deleted file mode 100644 index bed7fc73..00000000 --- a/#pma/libraries/sql-parser/src/Components/ArrayObj.php +++ /dev/null @@ -1,193 +0,0 @@ -raw = $raw; - $this->values = $values; - } - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return ArrayObj|Component[] - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = empty($options['type']) ? new ArrayObj() : array(); - - /** - * The last raw expression. - * - * @var string $lastRaw - */ - $lastRaw = ''; - - /** - * The last value. - * - * @var string $lastValue - */ - $lastValue = ''; - - /** - * Counts brackets. - * - * @var int $brackets - */ - $brackets = 0; - - /** - * Last separator (bracket or comma). - * - * @var boolean $isCommaLast - */ - $isCommaLast = false; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) - || ($token->type === Token::TYPE_COMMENT) - ) { - $lastRaw .= $token->token; - $lastValue = trim($lastValue) . ' '; - continue; - } - - if (($brackets === 0) - && (($token->type !== Token::TYPE_OPERATOR) - || ($token->value !== '(')) - ) { - $parser->error(__('An opening bracket was expected.'), $token); - break; - } - - if ($token->type === Token::TYPE_OPERATOR) { - if ($token->value === '(') { - if (++$brackets === 1) { // 1 is the base level. - continue; - } - } elseif ($token->value === ')') { - if (--$brackets === 0) { // Array ended. - break; - } - } elseif ($token->value === ',') { - if ($brackets === 1) { - $isCommaLast = true; - if (empty($options['type'])) { - $ret->raw[] = trim($lastRaw); - $ret->values[] = trim($lastValue); - $lastRaw = $lastValue = ''; - } - } - continue; - } - } - - if (empty($options['type'])) { - $lastRaw .= $token->token; - $lastValue .= $token->value; - } else { - $ret[] = $options['type']::parse( - $parser, - $list, - empty($options['typeOptions']) ? array() : $options['typeOptions'] - ); - } - } - - // Handling last element. - // - // This is treated differently to treat the following cases: - // - // => array() - // (,) => array('', '') - // () => array() - // (a,) => array('a', '') - // (a) => array('a') - // - $lastRaw = trim($lastRaw); - if ((empty($options['type'])) - && ((strlen($lastRaw) > 0) || ($isCommaLast)) - ) { - $ret->raw[] = $lastRaw; - $ret->values[] = trim($lastValue); - } - - return $ret; - } - - /** - * @param ArrayObj|ArrayObj[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if (is_array($component)) { - return implode(', ', $component); - } elseif (!empty($component->raw)) { - return '(' . implode(', ', $component->raw) . ')'; - } else { - return '(' . implode(', ', $component->values) . ')'; - } - } -} diff --git a/#pma/libraries/sql-parser/src/Components/CaseExpression.php b/#pma/libraries/sql-parser/src/Components/CaseExpression.php deleted file mode 100644 index df5a1bd3..00000000 --- a/#pma/libraries/sql-parser/src/Components/CaseExpression.php +++ /dev/null @@ -1,249 +0,0 @@ -idx; // Skip 'CASE' - - for (; $list->idx < $list->count; ++$list->idx) { - - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) - || ($token->type === Token::TYPE_COMMENT) - ) { - continue; - } - - if ($state === 0) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value === 'WHEN' - ) { - ++$list->idx; // Skip 'WHEN' - $new_condition = Condition::parse($parser, $list); - $type = 1; - $state = 1; - $ret->conditions[] = $new_condition; - } elseif ($token->type === Token::TYPE_KEYWORD - && $token->value === 'ELSE' - ) { - ++$list->idx; // Skip 'ELSE' - $ret->else_result = Expression::parse($parser, $list); - $state = 0; // last clause of CASE expression - } elseif ($token->type === Token::TYPE_KEYWORD - && ($token->value === 'END' - || $token->value === 'end') - ) { - $state = 3; // end of CASE expression - ++$list->idx; - break; - } elseif ($token->type === Token::TYPE_KEYWORD) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } else { - $ret->value = Expression::parse($parser, $list); - $type = 0; - $state = 1; - } - } elseif ($state === 1) { - if ($type === 0) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value === 'WHEN' - ) { - ++$list->idx; // Skip 'WHEN' - $new_value = Expression::parse($parser, $list); - $state = 2; - $ret->compare_values[] = $new_value; - } elseif ($token->type === Token::TYPE_KEYWORD - && $token->value === 'ELSE' - ) { - ++$list->idx; // Skip 'ELSE' - $ret->else_result = Expression::parse($parser, $list); - $state = 0; // last clause of CASE expression - } elseif ($token->type === Token::TYPE_KEYWORD - && ($token->value === 'END' - || $token->value === 'end') - ) { - $state = 3; // end of CASE expression - ++$list->idx; - break; - } elseif ($token->type === Token::TYPE_KEYWORD) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } - } else { - if ($token->type === Token::TYPE_KEYWORD - && $token->value === 'THEN' - ) { - ++$list->idx; // Skip 'THEN' - $new_result = Expression::parse($parser, $list); - $state = 0; - $ret->results[] = $new_result; - } elseif ($token->type === Token::TYPE_KEYWORD) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } - } - } elseif ($state === 2) { - if ($type === 0) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value === 'THEN' - ) { - ++$list->idx; // Skip 'THEN' - $new_result = Expression::parse($parser, $list); - $ret->results[] = $new_result; - $state = 1; - } elseif ($token->type === Token::TYPE_KEYWORD) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } - } - } - } - - if ($state !== 3) { - $parser->error( - __('Unexpected end of CASE expression'), - $list->tokens[$list->idx - 1] - ); - } - - --$list->idx; - return $ret; - } - - /** - * @param Expression $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - $ret = 'CASE '; - if (isset($component->value)) { - // Syntax type 0 - $ret .= $component->value . ' '; - for ( - $i = 0; - $i < count($component->compare_values) && $i < count($component->results); - ++$i - ) { - $ret .= 'WHEN ' . $component->compare_values[$i] . ' '; - $ret .= 'THEN ' . $component->results[$i] . ' '; - } - } else { - // Syntax type 1 - for ( - $i = 0; - $i < count($component->conditions) && $i < count($component->results); - ++$i - ) { - $ret .= 'WHEN ' . Condition::build($component->conditions[$i]) . ' '; - $ret .= 'THEN ' . $component->results[$i] . ' '; - } - } - if (isset($component->else_result)) { - $ret .= 'ELSE ' . $component->else_result . ' '; - } - $ret .= 'END'; - - return $ret; - } -} diff --git a/#pma/libraries/sql-parser/src/Components/Condition.php b/#pma/libraries/sql-parser/src/Components/Condition.php deleted file mode 100644 index c69441aa..00000000 --- a/#pma/libraries/sql-parser/src/Components/Condition.php +++ /dev/null @@ -1,231 +0,0 @@ - 1, - 'AND' => 1, - 'BETWEEN' => 1, - 'EXISTS' => 1, - 'IF' => 1, - 'IN' => 1, - 'INTERVAL' => 1, - 'IS' => 1, - 'LIKE' => 1, - 'MATCH' => 1, - 'NOT IN' => 1, - 'NOT NULL' => 1, - 'NOT' => 1, - 'NULL' => 1, - 'OR' => 1, - 'REGEXP' => 1, - 'RLIKE' => 1, - 'XOR' => 1, - ); - - /** - * Identifiers recognized. - * - * @var array - */ - public $identifiers = array(); - - /** - * Whether this component is an operator. - * - * @var bool - */ - public $isOperator = false; - - /** - * The condition. - * - * @var string - */ - public $expr; - - /** - * Constructor. - * - * @param string $expr The condition or the operator. - */ - public function __construct($expr = null) - { - $this->expr = trim($expr); - } - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return Condition[] - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = array(); - - $expr = new Condition(); - - /** - * Counts brackets. - * - * @var int $brackets - */ - $brackets = 0; - - /** - * Whether there was a `BETWEEN` keyword before or not. - * - * It is required to keep track of them because their structure contains - * the keyword `AND`, which is also an operator that delimits - * expressions. - * - * @var bool $betweenBefore - */ - $betweenBefore = false; - - for (; $list->idx < $list->count; ++$list->idx) { - - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if ($token->type === Token::TYPE_COMMENT) { - continue; - } - - // Replacing all whitespaces (new lines, tabs, etc.) with a single - // space character. - if ($token->type === Token::TYPE_WHITESPACE) { - $expr->expr .= ' '; - continue; - } - - // Conditions are delimited by logical operators. - if (in_array($token->value, static::$DELIMITERS, true)) { - if (($betweenBefore) && ($token->value === 'AND')) { - // The syntax of keyword `BETWEEN` is hard-coded. - $betweenBefore = false; - } else { - // The expression ended. - $expr->expr = trim($expr->expr); - if (!empty($expr->expr)) { - $ret[] = $expr; - } - - // Adding the operator. - $expr = new Condition($token->value); - $expr->isOperator = true; - $ret[] = $expr; - - // Preparing to parse another condition. - $expr = new Condition(); - continue; - } - } - - if (($token->type === Token::TYPE_KEYWORD) - && ($token->flags & Token::FLAG_KEYWORD_RESERVED) - && !($token->flags & Token::FLAG_KEYWORD_FUNCTION) - ) { - if ($token->value === 'BETWEEN') { - $betweenBefore = true; - } - if (($brackets === 0) && (empty(static::$ALLOWED_KEYWORDS[$token->value]))) { - break; - } - } - - if ($token->type === Token::TYPE_OPERATOR) { - if ($token->value === '(') { - ++$brackets; - } elseif ($token->value === ')') { - if ($brackets == 0) { - break; - } - --$brackets; - } - } - - $expr->expr .= $token->token; - if (($token->type === Token::TYPE_NONE) - || (($token->type === Token::TYPE_KEYWORD) - && (!($token->flags & Token::FLAG_KEYWORD_RESERVED))) - || ($token->type === Token::TYPE_STRING) - || ($token->type === Token::TYPE_SYMBOL) - ) { - if (!in_array($token->value, $expr->identifiers)) { - $expr->identifiers[] = $token->value; - } - } - } - - // Last iteration was not processed. - $expr->expr = trim($expr->expr); - if (!empty($expr->expr)) { - $ret[] = $expr; - } - - --$list->idx; - return $ret; - } - - /** - * @param Condition[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if (is_array($component)) { - return implode(' ', $component); - } else { - return $component->expr; - } - } -} diff --git a/#pma/libraries/sql-parser/src/Components/CreateDefinition.php b/#pma/libraries/sql-parser/src/Components/CreateDefinition.php deleted file mode 100644 index 86bb3157..00000000 --- a/#pma/libraries/sql-parser/src/Components/CreateDefinition.php +++ /dev/null @@ -1,339 +0,0 @@ - true, - - 'NOT NULL' => 1, - 'NULL' => 1, - 'DEFAULT' => array(2, 'expr', array('breakOnAlias' => true)), - 'AUTO_INCREMENT' => 3, - 'PRIMARY' => 4, - 'PRIMARY KEY' => 4, - 'UNIQUE' => 4, - 'UNIQUE KEY' => 4, - 'COMMENT' => array(5, 'var'), - 'COLUMN_FORMAT' => array(6, 'var'), - 'ON UPDATE' => array(7, 'expr'), - - // Generated columns options. - 'GENERATED ALWAYS' => 8, - 'AS' => array(9, 'expr', array('parenthesesDelimited' => true)), - 'VIRTUAL' => 10, - 'PERSISTENT' => 11, - 'STORED' => 11, - // Common entries. - // - // NOTE: Some of the common options are not in the same order which - // causes troubles when checking if the options are in the right order. - // I should find a way to define multiple sets of options and make the - // parser select the right set. - // - // 'UNIQUE' => 4, - // 'UNIQUE KEY' => 4, - // 'COMMENT' => array(5, 'var'), - // 'NOT NULL' => 1, - // 'NULL' => 1, - // 'PRIMARY' => 4, - // 'PRIMARY KEY' => 4, - ); - - /** - * The name of the new column. - * - * @var string - */ - public $name; - - /** - * Whether this field is a constraint or not. - * - * @var bool - */ - public $isConstraint; - - /** - * The data type of thew new column. - * - * @var DataType - */ - public $type; - - /** - * The key. - * - * @var Key - */ - public $key; - - /** - * The table that is referenced. - * - * @var Reference - */ - public $references; - - /** - * The options of this field. - * - * @var OptionsArray - */ - public $options; - - /** - * Constructor. - * - * @param string $name The name of the field. - * @param OptionsArray $options The options of this field. - * @param DataType|Key $type The data type of this field or the key. - * @param bool $isConstraint Whether this field is a constraint or not. - * @param Reference $references References. - */ - public function __construct( - $name = null, - $options = null, - $type = null, - $isConstraint = false, - $references = null - ) { - $this->name = $name; - $this->options = $options; - if ($type instanceof DataType) { - $this->type = $type; - } elseif ($type instanceof Key) { - $this->key = $type; - $this->isConstraint = $isConstraint; - $this->references = $references; - } - } - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return CreateDefinition[] - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = array(); - - $expr = new CreateDefinition(); - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 -----------------------[ ( ]------------------------> 1 - * - * 1 --------------------[ CONSTRAINT ]------------------> 1 - * 1 -----------------------[ key ]----------------------> 2 - * 1 -------------[ constraint / column name ]-----------> 2 - * - * 2 --------------------[ data type ]-------------------> 3 - * - * 3 ---------------------[ options ]--------------------> 4 - * - * 4 --------------------[ REFERENCES ]------------------> 4 - * - * 5 ------------------------[ , ]-----------------------> 1 - * 5 ------------------------[ ) ]-----------------------> 6 (-1) - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { - $state = 1; - } else { - $parser->error( - __('An opening bracket was expected.'), - $token - ); - break; - } - } elseif ($state === 1) { - if (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'CONSTRAINT')) { - $expr->isConstraint = true; - } elseif (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_KEY)) { - $expr->key = Key::parse($parser, $list); - $state = 4; - } elseif ($token->type === Token::TYPE_SYMBOL || $token->type === Token::TYPE_NONE) { - $expr->name = $token->value; - if (!$expr->isConstraint) { - $state = 2; - } - } else if ($token->type === Token::TYPE_KEYWORD) { - if ($token->flags & Token::FLAG_KEYWORD_RESERVED) { - // Reserved keywords can't be used - // as field names without backquotes - $parser->error( - __('A symbol name was expected! ' - . 'A reserved keyword can not be used ' - . 'as a column name without backquotes.' - ), - $token - ); - return $ret; - } else { - // Non-reserved keywords are allowed without backquotes - $expr->name = $token->value; - $state = 2; - } - } else { - $parser->error( - __('A symbol name was expected!'), - $token - ); - return $ret; - } - } elseif ($state === 2) { - $expr->type = DataType::parse($parser, $list); - $state = 3; - } elseif ($state === 3) { - $expr->options = OptionsArray::parse($parser, $list, static::$FIELD_OPTIONS); - $state = 4; - } elseif ($state === 4) { - if (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'REFERENCES')) { - ++$list->idx; // Skipping keyword 'REFERENCES'. - $expr->references = Reference::parse($parser, $list); - } else { - --$list->idx; - } - $state = 5; - } elseif ($state === 5) { - if ((!empty($expr->type)) || (!empty($expr->key))) { - $ret[] = $expr; - } - $expr = new CreateDefinition(); - if ($token->value === ',') { - $state = 1; - } elseif ($token->value === ')') { - $state = 6; - ++$list->idx; - break; - } else { - $parser->error( - __('A comma or a closing bracket was expected.'), - $token - ); - $state = 0; - break; - } - } - } - - // Last iteration was not saved. - if ((!empty($expr->type)) || (!empty($expr->key))) { - $ret[] = $expr; - } - - if (($state !== 0) && ($state !== 6)) { - $parser->error( - __('A closing bracket was expected.'), - $list->tokens[$list->idx - 1] - ); - } - - --$list->idx; - return $ret; - } - - /** - * @param CreateDefinition|CreateDefinition[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if (is_array($component)) { - return "(\n " . implode(",\n ", $component) . "\n)"; - } else { - $tmp = ''; - - if ($component->isConstraint) { - $tmp .= 'CONSTRAINT '; - } - - if ((isset($component->name)) && ($component->name !== '')) { - $tmp .= Context::escape($component->name) . ' '; - } - - if (!empty($component->type)) { - $tmp .= DataType::build( - $component->type, - array('lowercase' => true) - ) . ' '; - } - - if (!empty($component->key)) { - $tmp .= $component->key . ' '; - } - - if (!empty($component->references)) { - $tmp .= 'REFERENCES ' . $component->references . ' '; - } - - $tmp .= $component->options; - - return trim($tmp); - } - } -} diff --git a/#pma/libraries/sql-parser/src/Components/DataType.php b/#pma/libraries/sql-parser/src/Components/DataType.php deleted file mode 100644 index 378ec9d8..00000000 --- a/#pma/libraries/sql-parser/src/Components/DataType.php +++ /dev/null @@ -1,170 +0,0 @@ - 1, - 'CHARACTER SET' => array(2, 'var'), - 'CHARSET' => array(2, 'var'), - 'COLLATE' => array(3, 'var'), - 'UNSIGNED' => 4, - 'ZEROFILL' => 5, - ); - - /** - * The name of the data type. - * - * @var string - */ - public $name; - - /** - * The parameters of this data type. - * - * Some data types have no parameters. - * Numeric types might have parameters for the maximum number of digits, - * precision, etc. - * String types might have parameters for the maximum length stored. - * `ENUM` and `SET` have parameters for possible values. - * - * For more information, check the MySQL manual. - * - * @var array - */ - public $parameters = array(); - - /** - * The options of this data type. - * - * @var OptionsArray - */ - public $options; - - /** - * Constructor. - * - * @param string $name The name of this data type. - * @param array $parameters The parameters (size or possible values). - * @param OptionsArray $options The options of this data type. - */ - public function __construct( - $name = null, - array $parameters = array(), - $options = null - ) { - $this->name = $name; - $this->parameters = $parameters; - $this->options = $options; - } - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return DataType - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = new DataType(); - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 -------------------[ data type ]--------------------> 1 - * - * 1 ----------------[ size and options ]----------------> 2 - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - $ret->name = strtoupper($token->value); - if (($token->type !== Token::TYPE_KEYWORD) || (!($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { - $parser->error(__('Unrecognized data type.'), $token); - } - $state = 1; - } elseif ($state === 1) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { - $parameters = ArrayObj::parse($parser, $list); - ++$list->idx; - $ret->parameters = (($ret->name === 'ENUM') || ($ret->name === 'SET')) ? - $parameters->raw : $parameters->values; - } - $ret->options = OptionsArray::parse($parser, $list, static::$DATA_TYPE_OPTIONS); - ++$list->idx; - break; - } - - } - - if (empty($ret->name)) { - return null; - } - - --$list->idx; - return $ret; - } - - /** - * @param DataType $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - $name = (empty($options['lowercase'])) ? - $component->name : strtolower($component->name); - - $parameters = ''; - if (!empty($component->parameters)) { - $parameters = '(' . implode(',', $component->parameters) . ')'; - } - - return trim($name . $parameters . ' ' . $component->options); - } -} diff --git a/#pma/libraries/sql-parser/src/Components/Expression.php b/#pma/libraries/sql-parser/src/Components/Expression.php deleted file mode 100644 index e4079603..00000000 --- a/#pma/libraries/sql-parser/src/Components/Expression.php +++ /dev/null @@ -1,448 +0,0 @@ - 1, 'DUAL' => 1, 'NULL' => 1, 'REGEXP' => 1, 'CASE' => 1 - ); - - /** - * The name of this database. - * - * @var string - */ - public $database; - - /** - * The name of this table. - * - * @var string - */ - public $table; - - /** - * The name of the column. - * - * @var string - */ - public $column; - - /** - * The sub-expression. - * - * @var string - */ - public $expr = ''; - - /** - * The alias of this expression. - * - * @var string - */ - public $alias; - - /** - * The name of the function. - * - * @var mixed - */ - public $function; - - /** - * The type of subquery. - * - * @var string - */ - public $subquery; - - /** - * Constructor. - * - * Syntax: - * new Expression('expr') - * new Expression('expr', 'alias') - * new Expression('database', 'table', 'column') - * new Expression('database', 'table', 'column', 'alias') - * - * If the database, table or column name is not required, pass an empty - * string. - * - * @param string $database The name of the database or the the expression. - * the the expression. - * @param string $table The name of the table or the alias of the expression. - * the alias of the expression. - * @param string $column The name of the column. - * @param string $alias The name of the alias. - */ - public function __construct($database = null, $table = null, $column = null, $alias = null) - { - if (($column === null) && ($alias === null)) { - $this->expr = $database; // case 1 - $this->alias = $table; // case 2 - } else { - $this->database = $database; // case 3 - $this->table = $table; // case 3 - $this->column = $column; // case 3 - $this->alias = $alias; // case 4 - } - } - - /** - * Possible options: - * - * `field` - * - * First field to be filled. - * If this is not specified, it takes the value of `parseField`. - * - * `parseField` - * - * Specifies the type of the field parsed. It may be `database`, - * `table` or `column`. These expressions may not include - * parentheses. - * - * `breakOnAlias` - * - * If not empty, breaks when the alias occurs (it is not included). - * - * `breakOnParentheses` - * - * If not empty, breaks when the first parentheses occurs. - * - * `parenthesesDelimited` - * - * If not empty, breaks after last parentheses occurred. - * - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return Expression - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = new Expression(); - - /** - * Whether current tokens make an expression or a table reference. - * - * @var bool $isExpr - */ - $isExpr = false; - - /** - * Whether a period was previously found. - * - * @var bool $dot - */ - $dot = false; - - /** - * Whether an alias is expected. Is 2 if `AS` keyword was found. - * - * @var bool $alias - */ - $alias = false; - - /** - * Counts brackets. - * - * @var int $brackets - */ - $brackets = 0; - - /** - * Keeps track of the last two previous tokens. - * - * @var Token[] $prev - */ - $prev = array(null, null); - - // When a field is parsed, no parentheses are expected. - if (!empty($options['parseField'])) { - $options['breakOnParentheses'] = true; - $options['field'] = $options['parseField']; - } - - for (; $list->idx < $list->count; ++$list->idx) { - - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) - || ($token->type === Token::TYPE_COMMENT) - ) { - if ($isExpr) { - $ret->expr .= $token->token; - } - continue; - } - - if ($token->type === Token::TYPE_KEYWORD) { - if (($brackets > 0) && (empty($ret->subquery)) - && (!empty(Parser::$STATEMENT_PARSERS[$token->value])) - ) { - // A `(` was previously found and this keyword is the - // beginning of a statement, so this is a subquery. - $ret->subquery = $token->value; - } elseif (($token->flags & Token::FLAG_KEYWORD_FUNCTION) - && (empty($options['parseField']) - && ! $alias) - ) { - $isExpr = true; - } elseif (($token->flags & Token::FLAG_KEYWORD_RESERVED) - && ($brackets === 0) - ) { - if (empty(self::$ALLOWED_KEYWORDS[$token->value])) { - // A reserved keyword that is not allowed in the - // expression was found so the expression must have - // ended and a new clause is starting. - break; - } - if ($token->value === 'AS') { - if (!empty($options['breakOnAlias'])) { - break; - } - if ($alias) { - $parser->error( - __('An alias was expected.'), - $token - ); - break; - } - $alias = true; - continue; - } elseif ($token->value === 'CASE') { - // For a use of CASE like - // 'SELECT a = CASE .... END, b=1, `id`, ... FROM ...' - $tempCaseExpr = CaseExpression::parse($parser, $list); - $ret->expr .= CaseExpression::build($tempCaseExpr); - $isExpr = true; - continue; - } - $isExpr = true; - } elseif ($brackets === 0 && count($ret->expr) > 0 && ! $alias) { - /* End of expression */ - break; - } - } - - if (($token->type === Token::TYPE_NUMBER) - || ($token->type === Token::TYPE_BOOL) - || (($token->type === Token::TYPE_SYMBOL) - && ($token->flags & Token::FLAG_SYMBOL_VARIABLE)) - || (($token->type === Token::TYPE_OPERATOR) - && ($token->value !== '.')) - ) { - if (!empty($options['parseField'])) { - break; - } - - // Numbers, booleans and operators (except dot) are usually part - // of expressions. - $isExpr = true; - } - - if ($token->type === Token::TYPE_OPERATOR) { - if ((!empty($options['breakOnParentheses'])) - && (($token->value === '(') || ($token->value === ')')) - ) { - // No brackets were expected. - break; - } - if ($token->value === '(') { - ++$brackets; - if ((empty($ret->function)) && ($prev[1] !== null) - && (($prev[1]->type === Token::TYPE_NONE) - || ($prev[1]->type === Token::TYPE_SYMBOL) - || (($prev[1]->type === Token::TYPE_KEYWORD) - && ($prev[1]->flags & Token::FLAG_KEYWORD_FUNCTION))) - ) { - $ret->function = $prev[1]->value; - } - } elseif ($token->value === ')' && $brackets == 0) { - // Not our bracket - break; - } elseif ($token->value === ')') { - --$brackets; - if ($brackets === 0) { - if (!empty($options['parenthesesDelimited'])) { - // The current token is the last bracket, the next - // one will be outside the expression. - $ret->expr .= $token->token; - ++$list->idx; - break; - } - } elseif ($brackets < 0) { - // $parser->error(__('Unexpected closing bracket.'), $token); - // $brackets = 0; - break; - } - } elseif ($token->value === ',') { - // Expressions are comma-delimited. - if ($brackets === 0) { - break; - } - } - } - - // Saving the previous tokens. - $prev[0] = $prev[1]; - $prev[1] = $token; - - if ($alias) { - // An alias is expected (the keyword `AS` was previously found). - if (!empty($ret->alias)) { - $parser->error(__('An alias was previously found.'), $token); - break; - } - $ret->alias = $token->value; - $alias = false; - } elseif ($isExpr) { - // Handling aliases. - if (/* (empty($ret->alias)) && */ ($brackets === 0) - && (($prev[0] === null) - || ((($prev[0]->type !== Token::TYPE_OPERATOR) - || ($prev[0]->token === ')')) - && (($prev[0]->type !== Token::TYPE_KEYWORD) - || (!($prev[0]->flags & Token::FLAG_KEYWORD_RESERVED))))) - && (($prev[1]->type === Token::TYPE_STRING) - || (($prev[1]->type === Token::TYPE_SYMBOL) - && (!($prev[1]->flags & Token::FLAG_SYMBOL_VARIABLE))) - || ($prev[1]->type === Token::TYPE_NONE)) - ) { - if (!empty($ret->alias)) { - $parser->error(__('An alias was previously found.'), $token); - break; - } - $ret->alias = $prev[1]->value; - } else { - $ret->expr .= $token->token; - } - } elseif (!$isExpr) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '.')) { - // Found a `.` which means we expect a column name and - // the column name we parsed is actually the table name - // and the table name is actually a database name. - if ((!empty($ret->database)) || ($dot)) { - $parser->error(__('Unexpected dot.'), $token); - } - $ret->database = $ret->table; - $ret->table = $ret->column; - $ret->column = null; - $dot = true; - $ret->expr .= $token->token; - } else { - $field = empty($options['field']) ? 'column' : $options['field']; - if (empty($ret->$field)) { - $ret->$field = $token->value; - $ret->expr .= $token->token; - $dot = false; - } else { - // No alias is expected. - if (!empty($options['breakOnAlias'])) { - break; - } - if (!empty($ret->alias)) { - $parser->error(__('An alias was previously found.'), $token); - break; - } - $ret->alias = $token->value; - } - } - } - } - - if ($alias) { - $parser->error( - __('An alias was expected.'), - $list->tokens[$list->idx - 1] - ); - } - - // White-spaces might be added at the end. - $ret->expr = trim($ret->expr); - - if ($ret->expr === '') { - return null; - } - - --$list->idx; - return $ret; - } - - /** - * @param Expression|Expression[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if (is_array($component)) { - return implode($component, ', '); - } else { - if ($component->expr !== '' && !is_null($component->expr)) { - $ret = $component->expr; - } else { - $fields = array(); - if ((isset($component->database)) && ($component->database !== '')) { - $fields[] = $component->database; - } - if ((isset($component->table)) && ($component->table !== '')) { - $fields[] = $component->table; - } - if ((isset($component->column)) && ($component->column !== '')) { - $fields[] = $component->column; - } - $ret = implode('.', Context::escape($fields)); - } - - if (!empty($component->alias)) { - $ret .= ' AS ' . Context::escape($component->alias); - } - - return $ret; - } - } -} diff --git a/#pma/libraries/sql-parser/src/Components/ExpressionArray.php b/#pma/libraries/sql-parser/src/Components/ExpressionArray.php deleted file mode 100644 index e2aa86eb..00000000 --- a/#pma/libraries/sql-parser/src/Components/ExpressionArray.php +++ /dev/null @@ -1,129 +0,0 @@ - 1 - * - * 1 ------------------------[ , ]------------------------> 0 - * 1 -----------------------[ else ]----------------------> (END) - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if (($token->type === Token::TYPE_KEYWORD) - && ($token->flags & Token::FLAG_KEYWORD_RESERVED) - && ((~$token->flags & Token::FLAG_KEYWORD_FUNCTION)) - && ($token->value !== 'DUAL') - && ($token->value !== 'NULL') - && ($token->value !== 'CASE') - ) { - // No keyword is expected. - break; - } - - if ($state === 0) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value === 'CASE' - ) { - $expr = CaseExpression::parse($parser, $list, $options); - } else { - $expr = Expression::parse($parser, $list, $options); - } - - if ($expr === null) { - break; - } - $ret[] = $expr; - $state = 1; - } elseif ($state === 1) { - if ($token->value === ',') { - $state = 0; - } else { - break; - } - } - } - - if ($state === 0) { - $parser->error( - __('An expression was expected.'), - $list->tokens[$list->idx] - ); - } - - --$list->idx; - return $ret; - } - - /** - * @param Expression[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - $ret = array(); - foreach ($component as $frag) { - $ret[] = $frag::build($frag); - } - return implode($ret, ', '); - } -} diff --git a/#pma/libraries/sql-parser/src/Components/FunctionCall.php b/#pma/libraries/sql-parser/src/Components/FunctionCall.php deleted file mode 100644 index e260532b..00000000 --- a/#pma/libraries/sql-parser/src/Components/FunctionCall.php +++ /dev/null @@ -1,124 +0,0 @@ -name = $name; - if (is_array($parameters)) { - $this->parameters = new ArrayObj($parameters); - } elseif ($parameters instanceof ArrayObj) { - $this->parameters = $parameters; - } - } - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return FunctionCall - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = new FunctionCall(); - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 ----------------------[ name ]-----------------------> 1 - * - * 1 --------------------[ parameters ]-------------------> (END) - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - $ret->name = $token->value; - $state = 1; - } elseif ($state === 1) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { - $ret->parameters = ArrayObj::parse($parser, $list); - } - break; - } - - } - - return $ret; - } - - /** - * @param FunctionCall $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - return $component->name . $component->parameters; - } -} diff --git a/#pma/libraries/sql-parser/src/Components/IntoKeyword.php b/#pma/libraries/sql-parser/src/Components/IntoKeyword.php deleted file mode 100644 index d90963db..00000000 --- a/#pma/libraries/sql-parser/src/Components/IntoKeyword.php +++ /dev/null @@ -1,164 +0,0 @@ - 1 - * 0 ---------------------[ OUTFILE ]---------------------> 2 - * - * 1 ------------------------[ ( ]------------------------> (END) - * - * 2 ---------------------[ filename ]--------------------> 1 - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_RESERVED)) { - if (($state === 0) && ($token->value === 'OUTFILE')) { - $ret->type = 'OUTFILE'; - $state = 2; - continue; - } - - // No other keyword is expected. - break; - } - - if ($state === 0) { - if ((isset($options['fromInsert']) - && $options['fromInsert']) - || (isset($options['fromReplace']) - && $options['fromReplace']) - ) { - $ret->dest = Expression::parse( - $parser, - $list, - array( - 'parseField' => 'table', - 'breakOnAlias' => true, - ) - ); - } else { - $ret->values = ExpressionArray::parse($parser, $list); - } - $state = 1; - } elseif ($state === 1) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { - $ret->columns = ArrayObj::parse($parser, $list)->values; - ++$list->idx; - } - break; - } elseif ($state === 2) { - $ret->dest = $token->value; - ++$list->idx; - break; - } - } - - --$list->idx; - return $ret; - } - - /** - * @param IntoKeyword $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if ($component->dest instanceof Expression) { - $columns = !empty($component->columns) ? - '(`' . implode('`, `', $component->columns) . '`)' : ''; - return $component->dest . $columns; - } elseif (isset($component->values)) { - return ExpressionArray::build($component->values); - } else { - return 'OUTFILE "' . $component->dest . '"'; - } - } -} \ No newline at end of file diff --git a/#pma/libraries/sql-parser/src/Components/JoinKeyword.php b/#pma/libraries/sql-parser/src/Components/JoinKeyword.php deleted file mode 100644 index 548a64e9..00000000 --- a/#pma/libraries/sql-parser/src/Components/JoinKeyword.php +++ /dev/null @@ -1,210 +0,0 @@ - 'CROSS', - 'FULL JOIN' => 'FULL', - 'FULL OUTER JOIN' => 'FULL', - 'INNER JOIN' => 'INNER', - 'JOIN' => 'JOIN', - 'LEFT JOIN' => 'LEFT', - 'LEFT OUTER JOIN' => 'LEFT', - 'RIGHT JOIN' => 'RIGHT', - 'RIGHT OUTER JOIN' => 'RIGHT', - 'NATURAL JOIN' => 'NATURAL', - 'NATURAL LEFT JOIN' => 'NATURAL LEFT', - 'NATURAL LEFT JOIN' => 'NATURAL LEFT', - 'NATURAL RIGHT JOIN' => 'NATURAL RIGHT', - 'NATURAL LEFT OUTER JOIN' => 'NATURAL LEFT OUTER', - 'NATURAL RIGHT OUTER JOIN' => 'NATURAL RIGHT OUTER', - 'STRAIGHT_JOIN' => 'STRAIGHT', - ); - - /** - * Type of this join. - * - * @see static::$JOINS - * @var string - */ - public $type; - - /** - * Join expression. - * - * @var Expression - */ - public $expr; - - /** - * Join conditions. - * - * @var Condition[] - */ - public $on; - - /** - * Columns in Using clause - * - * @var ArrayObj - */ - public $using; - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return JoinKeyword[] - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = array(); - - $expr = new JoinKeyword(); - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 -----------------------[ JOIN ]----------------------> 1 - * - * 1 -----------------------[ expr ]----------------------> 2 - * - * 2 ------------------------[ ON ]-----------------------> 3 - * 2 -----------------------[ USING ]---------------------> 4 - * - * 3 --------------------[ conditions ]-------------------> 0 - * - * 4 ----------------------[ columns ]--------------------> 0 - * - * @var int $state - */ - $state = 0; - - // By design, the parser will parse first token after the keyword. - // In this case, the keyword must be analyzed too, in order to determine - // the type of this join. - if ($list->idx > 0) { - --$list->idx; - } - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - if (($token->type === Token::TYPE_KEYWORD) - && (!empty(static::$JOINS[$token->value])) - ) { - $expr->type = static::$JOINS[$token->value]; - $state = 1; - } else { - break; - } - } elseif ($state === 1) { - $expr->expr = Expression::parse($parser, $list, array('field' => 'table')); - $state = 2; - } elseif ($state === 2) { - if ($token->type === Token::TYPE_KEYWORD) { - if ($token->value === 'ON') { - $state = 3; - } elseif ($token->value === 'USING') { - $state = 4; - } else { - if (($token->type === Token::TYPE_KEYWORD) - && (!empty(static::$JOINS[$token->value])) - ) { - $ret[] = $expr; - $expr = new JoinKeyword(); - $expr->type = static::$JOINS[$token->value]; - $state = 1; - } else { - /* Next clause is starting */ - break; - } - } - } - } elseif ($state === 3) { - $expr->on = Condition::parse($parser, $list); - $ret[] = $expr; - $expr = new JoinKeyword(); - $state = 0; - } elseif ($state === 4) { - $expr->using = ArrayObj::parse($parser, $list); - $ret[] = $expr; - $expr = new JoinKeyword(); - $state = 0; - } - - } - - if (!empty($expr->type)) { - $ret[] = $expr; - } - - --$list->idx; - return $ret; - } - - /** - * @param JoinKeyword[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - $ret = array(); - foreach ($component as $c) { - $ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr - . (!empty($c->on) - ? ' ON ' . Condition::build($c->on) : '') - . (!empty($c->using) - ? ' USING ' . ArrayObj::build($c->using) : ''); - } - return implode(' ', $ret); - } -} diff --git a/#pma/libraries/sql-parser/src/Components/Key.php b/#pma/libraries/sql-parser/src/Components/Key.php deleted file mode 100644 index 24cc3632..00000000 --- a/#pma/libraries/sql-parser/src/Components/Key.php +++ /dev/null @@ -1,207 +0,0 @@ - array(1, 'var'), - 'USING' => array(2, 'var'), - 'WITH PARSER' => array(3, 'var'), - 'COMMENT' => array(4, 'var='), - ); - - /** - * The name of this key. - * - * @var string - */ - public $name; - - /** - * Columns. - * - * @var array - */ - public $columns; - - /** - * The type of this key. - * - * @var string - */ - public $type; - - /** - * The options of this key. - * - * @var OptionsArray - */ - public $options; - - /** - * Constructor. - * - * @param string $name The name of the key. - * @param array $columns The columns covered by this key. - * @param string $type The type of this key. - * @param OptionsArray $options The options of this key. - */ - public function __construct( - $name = null, - array $columns = array(), - $type = null, - $options = null - ) { - $this->name = $name; - $this->columns = $columns; - $this->type = $type; - $this->options = $options; - } - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return Key - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = new Key(); - - /** - * Last parsed column. - * - * @var array - */ - $lastColumn = array(); - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 ----------------------[ type ]-----------------------> 1 - * - * 1 ----------------------[ name ]-----------------------> 1 - * 1 ---------------------[ columns ]---------------------> 2 - * - * 2 ---------------------[ options ]---------------------> 3 - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - $ret->type = $token->value; - $state = 1; - } elseif ($state === 1) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { - $state = 2; - } else { - $ret->name = $token->value; - } - } elseif ($state === 2) { - if ($token->type === Token::TYPE_OPERATOR) { - if ($token->value === '(') { - $state = 3; - } elseif (($token->value === ',') || ($token->value === ')')) { - $state = ($token->value === ',') ? 2 : 4; - if (!empty($lastColumn)) { - $ret->columns[] = $lastColumn; - $lastColumn = array(); - } - } - } else { - $lastColumn['name'] = $token->value; - } - } elseif ($state === 3) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === ')')) { - $state = 2; - } else { - $lastColumn['length'] = $token->value; - } - } elseif ($state === 4) { - $ret->options = OptionsArray::parse($parser, $list, static::$KEY_OPTIONS); - ++$list->idx; - break; - } - } - - --$list->idx; - return $ret; - } - - /** - * @param Key $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - $ret = $component->type . ' '; - if (!empty($component->name)) { - $ret .= Context::escape($component->name) . ' '; - } - - $columns = array(); - foreach ($component->columns as $column) { - $tmp = Context::escape($column['name']); - if (isset($column['length'])) { - $tmp .= '(' . $column['length'] . ')'; - } - $columns[] = $tmp; - } - - $ret .= '(' . implode(',', $columns) . ') ' . $component->options; - return trim($ret); - } -} diff --git a/#pma/libraries/sql-parser/src/Components/Limit.php b/#pma/libraries/sql-parser/src/Components/Limit.php deleted file mode 100644 index 13a11277..00000000 --- a/#pma/libraries/sql-parser/src/Components/Limit.php +++ /dev/null @@ -1,131 +0,0 @@ -rowCount = $rowCount; - $this->offset = $offset; - } - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return Limit - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = new Limit(); - - $offset = false; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_RESERVED)) { - break; - } - - if (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'OFFSET')) { - if ($offset) { - $parser->error(__('An offset was expected.'), $token); - } - $offset = true; - continue; - } - - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === ',')) { - $ret->offset = $ret->rowCount; - $ret->rowCount = 0; - continue; - } - - if ($offset) { - $ret->offset = $token->value; - $offset = false; - } else { - $ret->rowCount = $token->value; - } - } - - if ($offset) { - $parser->error( - __('An offset was expected.'), - $list->tokens[$list->idx - 1] - ); - } - - --$list->idx; - return $ret; - } - - /** - * @param Limit $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - return $component->offset . ', ' . $component->rowCount; - } -} diff --git a/#pma/libraries/sql-parser/src/Components/OptionsArray.php b/#pma/libraries/sql-parser/src/Components/OptionsArray.php deleted file mode 100644 index 0c80e0d7..00000000 --- a/#pma/libraries/sql-parser/src/Components/OptionsArray.php +++ /dev/null @@ -1,372 +0,0 @@ -options = $options; - } - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return OptionsArray - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = new OptionsArray(); - - /** - * The ID that will be assigned to duplicate options. - * - * @var int $lastAssignedId - */ - $lastAssignedId = count($options) + 1; - - /** - * The option that was processed last time. - * - * @var array $lastOption - */ - $lastOption = null; - - /** - * The index of the option that was processed last time. - * - * @var int $lastOptionId - */ - $lastOptionId = 0; - - /** - * Counts brackets. - * - * @var int $brackets - */ - $brackets = 0; - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 ---------------------[ option ]----------------------> 1 - * - * 1 -------------------[ = (optional) ]------------------> 2 - * - * 2 ----------------------[ value ]----------------------> 0 - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping comments. - if ($token->type === Token::TYPE_COMMENT) { - continue; - } - - // Skipping whitespace if not parsing value. - if (($token->type === Token::TYPE_WHITESPACE) && ($brackets === 0)) { - continue; - } - - if ($lastOption === null) { - $upper = strtoupper($token->token); - if (isset($options[$upper])) { - $lastOption = $options[$upper]; - $lastOptionId = is_array($lastOption) ? - $lastOption[0] : $lastOption; - $state = 0; - - // Checking for option conflicts. - // For example, in `SELECT` statements the keywords `ALL` - // and `DISTINCT` conflict and if used together, they - // produce an invalid query. - // - // Usually, tokens can be identified in the array by the - // option ID, but if conflicts occur, a generated option ID - // is used. - // - // The first pseudo duplicate ID is the maximum value of the - // real options (e.g. if there are 5 options, the first - // fake ID is 6). - if (isset($ret->options[$lastOptionId])) { - $parser->error( - sprintf( - __('This option conflicts with "%1$s".'), - is_array($ret->options[$lastOptionId]) - ? $ret->options[$lastOptionId]['name'] - : $ret->options[$lastOptionId] - ), - $token - ); - $lastOptionId = $lastAssignedId++; - } - } else { - // There is no option to be processed. - break; - } - } - - if ($state === 0) { - if (!is_array($lastOption)) { - // This is a just keyword option without any value. - // This is the beginning and the end of it. - $ret->options[$lastOptionId] = $token->value; - $lastOption = null; - $state = 0; - } elseif (($lastOption[1] === 'var') || ($lastOption[1] === 'var=')) { - // This is a keyword that is followed by a value. - // This is only the beginning. The value is parsed in state - // 1 and 2. State 1 is used to skip the first equals sign - // and state 2 to parse the actual value. - $ret->options[$lastOptionId] = array( - // @var string The name of the option. - 'name' => $token->value, - // @var bool Whether it contains an equal sign. - // This is used by the builder to rebuild it. - 'equals' => $lastOption[1] === 'var=', - // @var string Raw value. - 'expr' => '', - // @var string Processed value. - 'value' => '', - ); - $state = 1; - } elseif ($lastOption[1] === 'expr' || $lastOption[1] === 'expr=') { - // This is a keyword that is followed by an expression. - // The expression is used by the specialized parser. - - // Skipping this option in order to parse the expression. - ++$list->idx; - $ret->options[$lastOptionId] = array( - // @var string The name of the option. - 'name' => $token->value, - // @var bool Whether it contains an equal sign. - // This is used by the builder to rebuild it. - 'equals' => $lastOption[1] === 'expr=', - // @var Expression The parsed expression. - 'expr' => '', - ); - $state = 1; - } - } elseif ($state === 1) { - $state = 2; - if ($token->token === '=') { - $ret->options[$lastOptionId]['equals'] = true; - continue; - } - } - - // This is outside the `elseif` group above because the change might - // change this iteration. - if ($state === 2) { - if ($lastOption[1] === 'expr' || $lastOption[1] === 'expr=') { - $ret->options[$lastOptionId]['expr'] = Expression::parse( - $parser, - $list, - empty($lastOption[2]) ? array() : $lastOption[2] - ); - $ret->options[$lastOptionId]['value'] - = $ret->options[$lastOptionId]['expr']->expr; - $lastOption = null; - $state = 0; - } else { - if ($token->token === '(') { - ++$brackets; - } elseif ($token->token === ')') { - --$brackets; - } - - $ret->options[$lastOptionId]['expr'] .= $token->token; - - if (!((($token->token === '(') && ($brackets === 1)) - || (($token->token === ')') && ($brackets === 0))) - ) { - // First pair of brackets is being skipped. - $ret->options[$lastOptionId]['value'] .= $token->value; - } - - // Checking if we finished parsing. - if ($brackets === 0) { - $lastOption = null; - } - } - } - } - - /* - * We reached the end of statement without getting a value - * for an option for which a value was required - */ - if ($state === 1 - && $lastOption - && ($lastOption[1] == 'expr' - || $lastOption[1] == 'var' - || $lastOption[1] == 'var=' - || $lastOption[1] == 'expr=') - ) { - $parser->error( - sprintf( - __('Value/Expression for the option %1$s was expected'), - $ret->options[$lastOptionId]['name'] - ), - $list->tokens[$list->idx - 1] - ); - } - - if (empty($options['_UNSORTED'])) { - ksort($ret->options); - } - - --$list->idx; - return $ret; - } - - /** - * @param OptionsArray $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if (empty($component->options)) { - return ''; - } - - $options = array(); - foreach ($component->options as $option) { - if (!is_array($option)) { - $options[] = $option; - } else { - $options[] = $option['name'] - . ((!empty($option['equals']) && $option['equals']) ? '=' : ' ') - . (!empty($option['expr']) ? $option['expr'] : $option['value']); - } - } - return implode(' ', $options); - } - - /** - * Checks if it has the specified option and returns it value or true. - * - * @param string $key The key to be checked. - * @param bool $getExpr Gets the expression instead of the value. - * The value is the processed form of the expression. - * - * @return mixed - */ - public function has($key, $getExpr = false) - { - foreach ($this->options as $option) { - if (is_array($option)) { - if (!strcasecmp($key, $option['name'])) { - return $getExpr ? $option['expr'] : $option['value']; - } - } elseif (!strcasecmp($key, $option)) { - return true; - } - } - return false; - } - - /** - * Removes the option from the array. - * - * @param string $key The key to be removed. - * - * @return bool Whether the key was found and deleted or not. - */ - public function remove($key) - { - foreach ($this->options as $idx => $option) { - if (is_array($option)) { - if (!strcasecmp($key, $option['name'])) { - unset($this->options[$idx]); - return true; - } - } elseif (!strcasecmp($key, $option)) { - unset($this->options[$idx]); - return true; - } - } - return false; - } - - /** - * Merges the specified options with these ones. Values with same ID will be - * replaced. - * - * @param array|OptionsArray $options The options to be merged. - * - * @return void - */ - public function merge($options) - { - if (is_array($options)) { - $this->options = array_merge_recursive($this->options, $options); - } elseif ($options instanceof OptionsArray) { - $this->options = array_merge_recursive($this->options, $options->options); - } - } - - /** - * Checks tf there are no options set. - * - * @return bool - */ - public function isEmpty() - { - return empty($this->options); - } -} diff --git a/#pma/libraries/sql-parser/src/Components/OrderKeyword.php b/#pma/libraries/sql-parser/src/Components/OrderKeyword.php deleted file mode 100644 index ba773a84..00000000 --- a/#pma/libraries/sql-parser/src/Components/OrderKeyword.php +++ /dev/null @@ -1,144 +0,0 @@ -expr = $expr; - $this->type = $type; - } - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return OrderKeyword[] - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = array(); - - $expr = new OrderKeyword(); - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 --------------------[ expression ]-------------------> 1 - * - * 1 ------------------------[ , ]------------------------> 0 - * 1 -------------------[ ASC / DESC ]--------------------> 1 - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - $expr->expr = Expression::parse($parser, $list); - $state = 1; - } elseif ($state === 1) { - if (($token->type === Token::TYPE_KEYWORD) - && (($token->value === 'ASC') || ($token->value === 'DESC')) - ) { - $expr->type = $token->value; - } elseif (($token->type === Token::TYPE_OPERATOR) - && ($token->value === ',') - ) { - if (!empty($expr->expr)) { - $ret[] = $expr; - } - $expr = new OrderKeyword(); - $state = 0; - } else { - break; - } - } - - } - - // Last iteration was not processed. - if (!empty($expr->expr)) { - $ret[] = $expr; - } - - --$list->idx; - return $ret; - } - - /** - * @param OrderKeyword|OrderKeyword[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if (is_array($component)) { - return implode(', ', $component); - } else { - return $component->expr . ' ' . $component->type; - } - } -} diff --git a/#pma/libraries/sql-parser/src/Components/ParameterDefinition.php b/#pma/libraries/sql-parser/src/Components/ParameterDefinition.php deleted file mode 100644 index 274555e9..00000000 --- a/#pma/libraries/sql-parser/src/Components/ParameterDefinition.php +++ /dev/null @@ -1,160 +0,0 @@ - 1 - * - * 1 ----------------[ IN / OUT / INOUT ]----------------> 1 - * 1 ----------------------[ name ]----------------------> 2 - * - * 2 -------------------[ data type ]--------------------> 3 - * - * 3 ------------------------[ , ]-----------------------> 1 - * 3 ------------------------[ ) ]-----------------------> (END) - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { - $state = 1; - } - continue; - } elseif ($state === 1) { - if (($token->value === 'IN') || ($token->value === 'OUT') || ($token->value === 'INOUT')) { - $expr->inOut = $token->value; - ++$list->idx; - } elseif ($token->value === ')') { - ++$list->idx; - break; - } else { - $expr->name = $token->value; - $state = 2; - } - } elseif ($state === 2) { - $expr->type = DataType::parse($parser, $list); - $state = 3; - } elseif ($state === 3) { - $ret[] = $expr; - $expr = new ParameterDefinition(); - if ($token->value === ',') { - $state = 1; - } elseif ($token->value === ')') { - ++$list->idx; - break; - } - } - } - - // Last iteration was not saved. - if ((isset($expr->name)) && ($expr->name !== '')) { - $ret[] = $expr; - } - - --$list->idx; - return $ret; - } - - /** - * @param ParameterDefinition[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if (is_array($component)) { - return '(' . implode(', ', $component) . ')'; - } else { - $tmp = ''; - if (!empty($component->inOut)) { - $tmp .= $component->inOut . ' '; - } - - return trim( - $tmp . Context::escape($component->name) . ' ' . $component->type - ); - } - } -} diff --git a/#pma/libraries/sql-parser/src/Components/PartitionDefinition.php b/#pma/libraries/sql-parser/src/Components/PartitionDefinition.php deleted file mode 100644 index 33c36928..00000000 --- a/#pma/libraries/sql-parser/src/Components/PartitionDefinition.php +++ /dev/null @@ -1,223 +0,0 @@ - array(1, 'var'), - 'ENGINE' => array(1, 'var'), - 'COMMENT' => array(2, 'var'), - 'DATA DIRECTORY' => array(3, 'var'), - 'INDEX DIRECTORY' => array(4, 'var'), - 'MAX_ROWS' => array(5, 'var'), - 'MIN_ROWS' => array(6, 'var'), - 'TABLESPACE' => array(7, 'var'), - 'NODEGROUP' => array(8, 'var'), - ); - - /** - * Whether this entry is a subpartition or a partition. - * - * @var bool - */ - public $isSubpartition; - - /** - * The name of this partition. - * - * @var string - */ - public $name; - - /** - * The type of this partition (what follows the `VALUES` keyword). - * - * @var string - */ - public $type; - - /** - * The expression used to defined this partition. - * - * @var Expression|string - */ - public $expr; - - /** - * The subpartitions of this partition. - * - * @var PartitionDefinition[] - */ - public $subpartitions; - - /** - * The options of this field. - * - * @var OptionsArray - */ - public $options; - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return PartitionDefinition - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = new PartitionDefinition(); - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 -------------[ PARTITION | SUBPARTITION ]------------> 1 - * - * 1 -----------------------[ name ]----------------------> 2 - * - * 2 ----------------------[ VALUES ]---------------------> 3 - * - * 3 ---------------------[ LESS THAN ]-------------------> 4 - * 3 ------------------------[ IN ]-----------------------> 4 - * - * 4 -----------------------[ expr ]----------------------> 5 - * - * 5 ----------------------[ options ]--------------------> 6 - * - * 6 ------------------[ subpartitions ]------------------> (END) - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - $ret->isSubpartition = ($token->type === Token::TYPE_KEYWORD) && ($token->value === 'SUBPARTITION'); - $state = 1; - } elseif ($state === 1) { - $ret->name = $token->value; - - // Looking ahead for a 'VALUES' keyword. - $idx = $list->idx; - $list->getNext(); - $nextToken = $list->getNext(); - $list->idx = $idx; - - $state = ($nextToken->type === Token::TYPE_KEYWORD) - && ($nextToken->value === 'VALUES') - ? 2 : 5; - } elseif ($state === 2) { - $state = 3; - } elseif ($state === 3) { - $ret->type = $token->value; - $state = 4; - } elseif ($state === 4) { - if ($token->value === 'MAXVALUE') { - $ret->expr = $token->value; - } else { - $ret->expr = Expression::parse( - $parser, - $list, - array( - 'parenthesesDelimited' => true, - 'breakOnAlias' => true, - ) - ); - } - $state = 5; - } elseif ($state === 5) { - $ret->options = OptionsArray::parse($parser, $list, static::$OPTIONS); - $state = 6; - } elseif ($state === 6) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { - $ret->subpartitions = ArrayObj::parse( - $parser, - $list, - array( - 'type' => 'SqlParser\\Components\\PartitionDefinition' - ) - ); - ++$list->idx; - } - break; - } - } - - --$list->idx; - return $ret; - } - - /** - * @param PartitionDefinition|PartitionDefinition[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if (is_array($component)) { - return "(\n" . implode(",\n", $component) . "\n)"; - } else { - if ($component->isSubpartition) { - return trim('SUBPARTITION ' . $component->name . ' ' . $component->options); - } else { - $subpartitions = empty($component->subpartitions) - ? '' : ' ' . PartitionDefinition::build($component->subpartitions); - return trim( - 'PARTITION ' . $component->name - . (empty($component->type) ? '' : ' VALUES ' . $component->type . ' ' . $component->expr . ' ') - . $component->options . $subpartitions - ); - } - } - } -} diff --git a/#pma/libraries/sql-parser/src/Components/Reference.php b/#pma/libraries/sql-parser/src/Components/Reference.php deleted file mode 100644 index 24d633ca..00000000 --- a/#pma/libraries/sql-parser/src/Components/Reference.php +++ /dev/null @@ -1,157 +0,0 @@ - array(1, 'var'), - 'ON DELETE' => array(2, 'var'), - 'ON UPDATE' => array(3, 'var'), - ); - - /** - * The referenced table. - * - * @var Expression - */ - public $table; - - /** - * The referenced columns. - * - * @var array - */ - public $columns; - - /** - * The options of the referencing. - * - * @var OptionsArray - */ - public $options; - - /** - * Constructor. - * - * @param Expression $table The name of the table referenced. - * @param array $columns The columns referenced. - * @param OptionsArray $options The options. - */ - public function __construct($table = null, array $columns = array(), $options = null) - { - $this->table = $table; - $this->columns = $columns; - $this->options = $options; - } - - /** - * @param Parser $parser The parser that serves as context. - * @param TokensList $list The list of tokens that are being parsed. - * @param array $options Parameters for parsing. - * - * @return Reference - */ - public static function parse(Parser $parser, TokensList $list, array $options = array()) - { - $ret = new Reference(); - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 ----------------------[ table ]---------------------> 1 - * - * 1 ---------------------[ columns ]--------------------> 2 - * - * 2 ---------------------[ options ]--------------------> (END) - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - $ret->table = Expression::parse( - $parser, - $list, - array( - 'parseField' => 'table', - 'breakOnAlias' => true, - ) - ); - $state = 1; - } elseif ($state === 1) { - $ret->columns = ArrayObj::parse($parser, $list)->values; - $state = 2; - } elseif ($state === 2) { - $ret->options = OptionsArray::parse($parser, $list, static::$REFERENCES_OPTIONS); - ++$list->idx; - break; - } - - } - - --$list->idx; - return $ret; - } - - /** - * @param Reference $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - return trim( - $component->table - . ' (' . implode(', ', Context::escape($component->columns)) . ') ' - . $component->options - ); - } -} diff --git a/#pma/libraries/sql-parser/src/Components/RenameOperation.php b/#pma/libraries/sql-parser/src/Components/RenameOperation.php deleted file mode 100644 index 291bd430..00000000 --- a/#pma/libraries/sql-parser/src/Components/RenameOperation.php +++ /dev/null @@ -1,173 +0,0 @@ - 1 - * - * 1 ------------------------[ TO ]-----------------------> 2 - * - * 2 ---------------------[ old name ]--------------------> 3 - * - * 3 ------------------------[ , ]------------------------> 0 - * 3 -----------------------[ else ]----------------------> (END) - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - $expr->old = Expression::parse( - $parser, - $list, - array( - 'breakOnAlias' => true, - 'parseField' => 'table', - ) - ); - if (empty($expr->old)) { - $parser->error( - __('The old name of the table was expected.'), - $token - ); - } - $state = 1; - } elseif ($state === 1) { - if (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'TO')) { - $state = 2; - } else { - $parser->error( - __('Keyword "TO" was expected.'), - $token - ); - break; - } - } elseif ($state === 2) { - $expr->new = Expression::parse( - $parser, - $list, - array( - 'breakOnAlias' => true, - 'parseField' => 'table', - ) - ); - if (empty($expr->new)) { - $parser->error( - __('The new name of the table was expected.'), - $token - ); - } - $state = 3; - } elseif ($state === 3) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === ',')) { - $ret[] = $expr; - $expr = new RenameOperation(); - $state = 0; - } else { - break; - } - } - } - - if ($state !== 3) { - $parser->error( - __('A rename operation was expected.'), - $list->tokens[$list->idx - 1] - ); - } - - // Last iteration was not saved. - if (!empty($expr->old)) { - $ret[] = $expr; - } - - --$list->idx; - return $ret; - } - - /** - * @param RenameOperation $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if (is_array($component)) { - return implode(', ', $component); - } else { - return $component->old . ' TO ' . $component->new; - } - } -} diff --git a/#pma/libraries/sql-parser/src/Components/SetOperation.php b/#pma/libraries/sql-parser/src/Components/SetOperation.php deleted file mode 100644 index 0a1a54ca..00000000 --- a/#pma/libraries/sql-parser/src/Components/SetOperation.php +++ /dev/null @@ -1,137 +0,0 @@ - 1 - * - * 1 ------------------------[ , ]------------------------> 0 - * 1 ----------------------[ value ]----------------------> 1 - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - // No keyword is expected. - if (($token->type === Token::TYPE_KEYWORD) - && ($token->flags & Token::FLAG_KEYWORD_RESERVED) - && ($state == 0) - ) { - break; - } - - if ($state === 0) { - if ($token->token === '=') { - $state = 1; - } elseif ($token->value !== ',') { - $expr->column .= $token->token; - } - } elseif ($state === 1) { - $tmp = Expression::parse( - $parser, - $list, - array( - 'breakOnAlias' => true, - ) - ); - if ($tmp == null) { - break; - } - $expr->column = trim($expr->column); - $expr->value = $tmp->expr; - $ret[] = $expr; - $expr = new SetOperation(); - $state = 0; - } - } - - --$list->idx; - return $ret; - } - - /** - * @param SetOperation|SetOperation[] $component The component to be built. - * @param array $options Parameters for building. - * - * @return string - */ - public static function build($component, array $options = array()) - { - if (is_array($component)) { - return implode(', ', $component); - } else { - return $component->column . ' = ' . $component->value; - } - } -} diff --git a/#pma/libraries/sql-parser/src/Components/UnionKeyword.php b/#pma/libraries/sql-parser/src/Components/UnionKeyword.php deleted file mode 100644 index 138a79e5..00000000 --- a/#pma/libraries/sql-parser/src/Components/UnionKeyword.php +++ /dev/null @@ -1,39 +0,0 @@ - 1, '*' => 1, '+' => 1, '-' => 1, '/' => 1, - - // @see Token::FLAG_OPERATOR_LOGICAL - '!' => 2, '!=' => 2, '&&' => 2, '<' => 2, '<=' => 2, - '<=>' => 2, '<>' => 2, '=' => 2, '>' => 2, '>=' => 2, - '||' => 2, - - // @see Token::FLAG_OPERATOR_BITWISE - '&' => 4, '<<' => 4, '>>' => 4, '^' => 4, '|' => 4, - '~' => 4, - - // @see Token::FLAG_OPERATOR_ASSIGNMENT - ':=' => 8, - - // @see Token::FLAG_OPERATOR_SQL - '(' => 16, ')' => 16, '.' => 16, ',' => 16, ';' => 16, - ); - - /** - * The mode of the MySQL server that will be used in lexing, parsing and - * building the statements. - * - * @var int - */ - public static $MODE = 0; - - /* - * Server SQL Modes - * https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html - */ - - // Compatibility mode for Microsoft's SQL server. - // This is the equivalent of ANSI_QUOTES. - const COMPAT_MYSQL = 2; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_allow_invalid_dates - const ALLOW_INVALID_DATES = 1; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_ansi_quotes - const ANSI_QUOTES = 2; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_error_for_division_by_zero - const ERROR_FOR_DIVISION_BY_ZERO = 4; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_high_not_precedence - const HIGH_NOT_PRECEDENCE = 8; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_ignore_space - const IGNORE_SPACE = 16; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_auto_create_user - const NO_AUTO_CREATE_USER = 32; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_auto_value_on_zero - const NO_AUTO_VALUE_ON_ZERO = 64; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_backslash_escapes - const NO_BACKSLASH_ESCAPES = 128; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_dir_in_create - const NO_DIR_IN_CREATE = 256; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_dir_in_create - const NO_ENGINE_SUBSTITUTION = 512; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_field_options - const NO_FIELD_OPTIONS = 1024; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_key_options - const NO_KEY_OPTIONS = 2048; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_table_options - const NO_TABLE_OPTIONS = 4096; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_unsigned_subtraction - const NO_UNSIGNED_SUBTRACTION = 8192; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_zero_date - const NO_ZERO_DATE = 16384; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_zero_in_date - const NO_ZERO_IN_DATE = 32768; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_only_full_group_by - const ONLY_FULL_GROUP_BY = 65536; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_pipes_as_concat - const PIPES_AS_CONCAT = 131072; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_real_as_float - const REAL_AS_FLOAT = 262144; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_strict_all_tables - const STRICT_ALL_TABLES = 524288; - - // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_strict_trans_tables - const STRICT_TRANS_TABLES = 1048576; - - // Custom modes. - - // The table and column names and any other field that must be escaped will - // not be. - // Reserved keywords are being escaped regardless this mode is used or not. - const NO_ENCLOSING_QUOTES = 1073741824; - - /* - * Combination SQL Modes - * https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sql-mode-combo - */ - - // REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE - const SQL_MODE_ANSI = 393234; - - // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, - // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, - const SQL_MODE_DB2 = 138258; - - // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, - // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER - const SQL_MODE_MAXDB = 138290; - - // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, - // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS - const SQL_MODE_MSSQL = 138258; - - // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, - // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER - const SQL_MODE_ORACLE = 138290; - - // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, - // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS - const SQL_MODE_POSTGRESQL = 138258; - - // STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, - // ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER - const SQL_MODE_TRADITIONAL = 1622052; - - // ------------------------------------------------------------------------- - // Keyword. - - /** - * Checks if the given string is a keyword. - * - * @param string $str String to be checked. - * @param bool $isReserved Checks if the keyword is reserved. - * - * @return int - */ - public static function isKeyword($str, $isReserved = false) - { - $str = strtoupper($str); - - if (isset(static::$KEYWORDS[$str])) { - if ($isReserved) { - if (!(static::$KEYWORDS[$str] & Token::FLAG_KEYWORD_RESERVED)) { - return null; - } - } - return static::$KEYWORDS[$str]; - } - - return null; - } - - // ------------------------------------------------------------------------- - // Operator. - - /** - * Checks if the given string is an operator. - * - * @param string $str String to be checked. - * - * @return int The appropriate flag for the operator. - */ - public static function isOperator($str) - { - if (!isset(static::$OPERATORS[$str])) { - return null; - } - return static::$OPERATORS[$str]; - } - - // ------------------------------------------------------------------------- - // Whitespace. - - /** - * Checks if the given character is a whitespace. - * - * @param string $str String to be checked. - * - * @return bool - */ - public static function isWhitespace($str) - { - return ($str === ' ') || ($str === "\r") || ($str === "\n") || ($str === "\t"); - } - - // ------------------------------------------------------------------------- - // Comment. - - /** - * Checks if the given string is the beginning of a whitespace. - * - * @param string $str String to be checked. - * - * @return int The appropriate flag for the comment type. - */ - public static function isComment($str) - { - $len = strlen($str); - if ($str[0] === '#') { - return Token::FLAG_COMMENT_BASH; - } elseif (($len > 1) && ($str[0] === '/') && ($str[1] === '*')) { - return (($len > 2) && ($str[2] == '!')) ? - Token::FLAG_COMMENT_MYSQL_CMD : Token::FLAG_COMMENT_C; - } elseif (($len > 1) && ($str[0] === '*') && ($str[1] === '/')) { - return Token::FLAG_COMMENT_C; - } elseif (($len > 2) && ($str[0] === '-') - && ($str[1] === '-') && (static::isWhitespace($str[2])) - ) { - return Token::FLAG_COMMENT_SQL; - } - return null; - } - - // ------------------------------------------------------------------------- - // Bool. - - /** - * Checks if the given string is a boolean value. - * This actually check only for `TRUE` and `FALSE` because `1` or `0` are - * actually numbers and are parsed by specific methods. - * - * @param string $str String to be checked. - * - * @return bool - */ - public static function isBool($str) - { - $str = strtoupper($str); - return ($str === 'TRUE') || ($str === 'FALSE'); - } - - // ------------------------------------------------------------------------- - // Number. - - /** - * Checks if the given character can be a part of a number. - * - * @param string $str String to be checked. - * - * @return bool - */ - public static function isNumber($str) - { - return (($str >= '0') && ($str <= '9')) || ($str === '.') - || ($str === '-') || ($str === '+') || ($str === 'e') || ($str === 'E'); - } - - // ------------------------------------------------------------------------- - // Symbol. - - /** - * Checks if the given character is the beginning of a symbol. A symbol - * can be either a variable or a field name. - * - * @param string $str String to be checked. - * - * @return int The appropriate flag for the symbol type. - */ - public static function isSymbol($str) - { - if ($str[0] === '@') { - return Token::FLAG_SYMBOL_VARIABLE; - } elseif ($str[0] === '`') { - return Token::FLAG_SYMBOL_BACKTICK; - } - return null; - } - - // ------------------------------------------------------------------------- - // String. - - /** - * Checks if the given character is the beginning of a string. - * - * @param string $str String to be checked. - * - * @return int The appropriate flag for the string type. - */ - public static function isString($str) - { - if ($str[0] === '\'') { - return Token::FLAG_STRING_SINGLE_QUOTES; - } elseif ($str[0] === '"') { - return Token::FLAG_STRING_DOUBLE_QUOTES; - } - return null; - } - - // ------------------------------------------------------------------------- - // Delimiter. - - /** - * Checks if the given character can be a separator for two lexeme. - * - * @param string $str String to be checked. - * - * @return bool - */ - public static function isSeparator($str) - { - // NOTES: Only non alphanumeric ASCII characters may be separators. - // `~` is the last printable ASCII character. - return ($str <= '~') && ($str !== '_') - && (($str < '0') || ($str > '9')) - && (($str < 'a') || ($str > 'z')) - && (($str < 'A') || ($str > 'Z')); - } - - /** - * Loads the specified context. - * - * Contexts may be used by accessing the context directly. - * - * @param string $context Name of the context or full class name that - * defines the context. - * - * @throws \Exception If the specified context doesn't exist. - * - * @return void - */ - public static function load($context = '') - { - if (empty($context)) { - $context = self::$defaultContext; - } - if ($context[0] !== '\\') { - // Short context name (must be formatted into class name). - $context = self::$contextPrefix . $context; - } - if (!class_exists($context)) { - throw new \Exception( - 'Specified context ("' . $context . '") does not exist.' - ); - } - self::$loadedContext = $context; - self::$KEYWORDS = $context::$KEYWORDS; - } - - /** - * Loads the context with the closest version to the one specified. - * - * The closest context is found by replacing last digits with zero until one - * is loaded successfully. - * - * @see Context::load() - * - * @param string $context Name of the context or full class name that - * defines the context. - * - * @return string The loaded context. `null` if no context was loaded. - */ - public static function loadClosest($context = '') - { - /** - * The number of replaces done by `preg_replace`. - * This actually represents whether a new context was generated or not. - * - * @var int $count - */ - $count = 0; - - // As long as a new context can be generated, we try to load it. - do { - try { - // Trying to load the new context. - static::load($context); - } catch (\Exception $e) { - // If it didn't work, we are looking for a new one and skipping - // over to the next generation that will try the new context. - $context = preg_replace( - '/[1-9](0*)$/', - '0$1', - $context, - -1, - $count - ); - continue; - } - - // Last generated context was valid (did not throw any exceptions). - // So we return it, to let the user know what context was loaded. - return $context; - } while ($count !== 0); - - return null; - } - - /** - * Sets the SQL mode. - * - * @param string $mode The list of modes. If empty, the mode is reset. - * - * @return void - */ - public static function setMode($mode = '') - { - static::$MODE = 0; - if (empty($mode)) { - return; - } - $mode = explode(',', $mode); - foreach ($mode as $m) { - static::$MODE |= constant('static::' . $m); - } - } - - /** - * Escapes the symbol by adding surrounding backticks. - * - * @param array|string $str The string to be escaped. - * @param string $quote Quote to be used when escaping. - * - * @return string - */ - public static function escape($str, $quote = '`') - { - if (is_array($str)) { - foreach ($str as $key => $value) { - $str[$key] = static::escape($value); - } - return $str; - } - - if ((static::$MODE & Context::NO_ENCLOSING_QUOTES) - && (!static::isKeyword($str, true)) - ) { - return $str; - } - - if (static::$MODE & Context::ANSI_QUOTES) { - $quote = '"'; - } - - return $quote . str_replace($quote, $quote . $quote, $str) . $quote; - } -} - -// Initializing the default context. -Context::load(); diff --git a/#pma/libraries/sql-parser/src/Contexts/ContextMySql50000.php b/#pma/libraries/sql-parser/src/Contexts/ContextMySql50000.php deleted file mode 100644 index 82ec3bd1..00000000 --- a/#pma/libraries/sql-parser/src/Contexts/ContextMySql50000.php +++ /dev/null @@ -1,287 +0,0 @@ - 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, - 'ANY' => 1, 'BDB' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, - 'NEW' => 1, 'ONE' => 1, 'ROW' => 1, - 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'FAST' => 1, - 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, 'LAST' => 1, 'LOGS' => 1, - 'MODE' => 1, 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'OPEN' => 1, 'PAGE' => 1, - 'PREV' => 1, 'ROWS' => 1, 'SOME' => 1, 'STOP' => 1, 'TYPE' => 1, 'VIEW' => 1, - 'WORK' => 1, 'X509' => 1, - 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, - 'CHAIN' => 1, 'CLOSE' => 1, 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, - 'FOUND' => 1, 'HOSTS' => 1, 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, - 'MERGE' => 1, 'MUTEX' => 1, 'NAMES' => 1, 'NCHAR' => 1, 'PHASE' => 1, - 'QUERY' => 1, 'QUICK' => 1, 'RAID0' => 1, 'RESET' => 1, 'RTREE' => 1, - 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, 'SWAPS' => 1, - 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, - 'ACTION' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, 'CLIENT' => 1, - 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, 'ESCAPE' => 1, - 'EVENTS' => 1, 'FAULTS' => 1, 'FIELDS' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, - 'IMPORT' => 1, 'INNODB' => 1, 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, - 'MEDIUM' => 1, 'MEMORY' => 1, 'MODIFY' => 1, 'OFFSET' => 1, 'RELOAD' => 1, - 'REPAIR' => 1, 'RESUME' => 1, 'ROLLUP' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, - 'SOUNDS' => 1, 'SOURCE' => 1, 'STATUS' => 1, 'STRING' => 1, 'TABLES' => 1, - 'CHANGED' => 1, 'COLUMNS' => 1, 'COMMENT' => 1, 'COMPACT' => 1, 'CONTEXT' => 1, - 'DEFINER' => 1, 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, 'ENGINES' => 1, - 'EXECUTE' => 1, 'HANDLER' => 1, 'INDEXES' => 1, 'INVOKER' => 1, 'MIGRATE' => 1, - 'PARTIAL' => 1, 'PREPARE' => 1, 'PROFILE' => 1, 'RECOVER' => 1, 'RESTORE' => 1, - 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, 'STORAGE' => 1, 'STRIPED' => 1, - 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, 'UNKNOWN' => 1, 'UPGRADE' => 1, - 'USE_FRM' => 1, 'VIRTUAL' => 1, - 'CASCADED' => 1, 'CHECKSUM' => 1, 'DUMPFILE' => 1, 'EXTENDED' => 1, - 'FUNCTION' => 1, 'INNOBASE' => 1, 'LANGUAGE' => 1, 'MAX_ROWS' => 1, - 'MIN_ROWS' => 1, 'NATIONAL' => 1, 'NVARCHAR' => 1, 'ONE_SHOT' => 1, - 'PROFILES' => 1, 'ROLLBACK' => 1, 'SECURITY' => 1, 'SHUTDOWN' => 1, - 'SNAPSHOT' => 1, 'SWITCHES' => 1, 'TRIGGERS' => 1, 'WARNINGS' => 1, - 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, - 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, - 'PACK_KEYS' => 1, 'RAID_TYPE' => 1, 'REDUNDANT' => 1, 'SAVEPOINT' => 1, - 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, 'UNDEFINED' => 1, - 'VARIABLES' => 1, - 'BERKELEYDB' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, - 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, - 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PRIVILEGES' => 1, - 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, 'SQL_THREAD' => 1, 'TABLESPACE' => 1, - 'FRAC_SECOND' => 1, 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, - 'PROCESSLIST' => 1, 'RAID_CHUNKS' => 1, 'REPLICATION' => 1, 'SQL_TSI_DAY' => 1, - 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, - 'DES_KEY_FILE' => 1, 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, - 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, 'SQL_TSI_WEEK' => 1, - 'SQL_TSI_YEAR' => 1, - 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, - 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, - 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'MASTER_LOG_POS' => 1, - 'MASTER_SSL_KEY' => 1, 'RAID_CHUNKSIZE' => 1, 'RELAY_LOG_FILE' => 1, - 'SQL_TSI_MINUTE' => 1, 'SQL_TSI_SECOND' => 1, 'USER_RESOURCES' => 1, - 'DELAY_KEY_WRITE' => 1, 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, - 'MASTER_SSL_CERT' => 1, 'SQL_TSI_QUARTER' => 1, - 'MASTER_SERVER_ID' => 1, - 'MASTER_SSL_CAPATH' => 1, 'MASTER_SSL_CIPHER' => 1, 'SQL_BUFFER_RESULT' => 1, - 'SQL_TSI_FRAC_SECOND' => 1, - 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, - 'MAX_UPDATES_PER_HOUR' => 1, 'MAX_USER_CONNECTIONS' => 1, - 'MAX_CONNECTIONS_PER_HOUR' => 1, - - 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, - 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, - 'FOR' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, 'USE' => 3, - 'XOR' => 3, - 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, - 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, - 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, - 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, - 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, - 'WHEN' => 3, 'WITH' => 3, - 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, - 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, - 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, - 'PURGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, 'UNION' => 3, - 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, 'WRITE' => 3, - 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, - 'DELETE' => 3, 'ELSEIF' => 3, 'EXISTS' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, - 'HAVING' => 3, 'IGNORE' => 3, 'INFILE' => 3, 'OPTION' => 3, 'REGEXP' => 3, - 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, 'SONAME' => 3, - 'UNLOCK' => 3, 'UPDATE' => 3, - 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, - 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, - 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, - 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, - 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, - 'ENCLOSED' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESTRICT' => 3, - 'SPECIFIC' => 3, 'SQLSTATE' => 3, 'STARTING' => 3, 'TRAILING' => 3, - 'UNSIGNED' => 3, 'ZEROFILL' => 3, - 'CONDITION' => 3, 'DATABASES' => 3, 'MIDDLEINT' => 3, 'PRECISION' => 3, - 'PROCEDURE' => 3, 'SENSITIVE' => 3, 'SEPARATOR' => 3, - 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, 'DAY_SECOND' => 3, - 'OPTIONALLY' => 3, 'REFERENCES' => 3, 'SQLWARNING' => 3, 'TERMINATED' => 3, - 'YEAR_MONTH' => 3, - 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, - 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, - 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, - 'STRAIGHT_JOIN' => 3, - 'SQL_BIG_RESULT' => 3, - 'DAY_MICROSECOND' => 3, - 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, - 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, - 'SQL_CALC_FOUND_ROWS' => 3, - - 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, - 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, - 'LESS THAN' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, 'ON UPDATE' => 7, - 'UNION ALL' => 7, - 'CROSS JOIN' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, 'LINEAR KEY' => 7, - 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, - 'LINEAR HASH' => 7, - 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, - 'PARTITION BY' => 7, 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, - 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, - 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, - 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, - 'INDEX DIRECTORY' => 7, 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, - 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, - 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, - 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, - 'DEFAULT CHARACTER SET' => 7, - 'NATURAL LEFT OUTER JOIN' => 7, - 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, - - 'BIT' => 9, 'XML' => 9, - 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, - 'ARRAY' => 9, - 'SERIAL' => 9, - 'BOOLEAN' => 9, - 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, - 'MULTILINEPOINT' => 9, - 'MULTILINEPOLYGON' => 9, - - 'INT' => 11, 'SET' => 11, - 'BLOB' => 11, 'REAL' => 11, - 'FLOAT' => 11, - 'BIGINT' => 11, 'BINARY' => 11, 'DOUBLE' => 11, - 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, - 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, - 'TINYTEXT' => 11, - 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, - 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, - - 'BINARY VARYING' => 15, - - 'KEY' => 19, - 'INDEX' => 19, - 'UNIQUE' => 19, - 'SPATIAL' => 19, - 'FULLTEXT' => 19, - - 'INDEX KEY' => 23, - 'UNIQUE KEY' => 23, - 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, - 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, - 'SPATIAL INDEX' => 23, - 'FULLTEXT INDEX' => 23, - - 'X' => 33, 'Y' => 33, - 'LN' => 33, 'PI' => 33, - 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, - 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, - 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, - 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, - 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, - 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, - 'SHA1' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'TRIM' => 33, 'USER' => 33, - 'UUID' => 33, 'WEEK' => 33, - 'ASCII' => 33, 'ATAN2' => 33, 'COUNT' => 33, 'CRC32' => 33, 'FIELD' => 33, - 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, 'LEAST' => 33, 'LOG10' => 33, - 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, 'POWER' => 33, 'QUOTE' => 33, - 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, 'SPACE' => 33, 'UCASE' => 33, - 'UNHEX' => 33, 'UPPER' => 33, - 'ASTEXT' => 33, 'BIT_OR' => 33, 'CONCAT' => 33, 'DECODE' => 33, 'ENCODE' => 33, - 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, 'LENGTH' => 33, - 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, 'SECOND' => 33, - 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, - 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, - 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, - 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, - 'ISEMPTY' => 33, 'QUARTER' => 33, 'RADIANS' => 33, 'REVERSE' => 33, 'SOUNDEX' => 33, - 'SUBDATE' => 33, 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, - 'VAR_POP' => 33, 'VERSION' => 33, 'WEEKDAY' => 33, - 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, - 'CONTAINS' => 33, 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, - 'DISJOINT' => 33, 'ENDPOINT' => 33, 'ENVELOPE' => 33, 'GET_LOCK' => 33, - 'GREATEST' => 33, 'ISCLOSED' => 33, 'ISSIMPLE' => 33, 'MAKEDATE' => 33, - 'MAKETIME' => 33, 'MAKE_SET' => 33, 'MBREQUAL' => 33, 'OVERLAPS' => 33, - 'PASSWORD' => 33, 'POSITION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, - 'VARIANCE' => 33, 'VAR_SAMP' => 33, 'YEARWEEK' => 33, - 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, 'CONCAT_WS' => 33, - 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, 'FROM_DAYS' => 33, - 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, 'LOAD_FILE' => 33, - 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, 'ROW_COUNT' => 33, - 'SUBSTRING' => 33, - 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'DAYOFMONTH' => 33, 'EXPORT_SET' => 33, - 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INTERSECTS' => 33, 'MBRTOUCHES' => 33, - 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, - 'STDDEV_POP' => 33, 'UNCOMPRESS' => 33, 'WEEKOFYEAR' => 33, - 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, - 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'GEOMFROMWKB' => 33, - 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, - 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, - 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, - 'TIME_TO_SEC' => 33, - 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'GEOMETRYTYPE' => 33, - 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, - 'IS_USED_LOCK' => 33, 'LINEFROMTEXT' => 33, 'MLINEFROMWKB' => 33, - 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, 'OCTET_LENGTH' => 33, - 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, - 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'TIMESTAMPADD' => 33, - 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'INTERIORRINGN' => 33, - 'MBRINTERSECTS' => 33, 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, - 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, 'POINTFROMTEXT' => 33, - 'TIMESTAMPDIFF' => 33, - 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, 'UNIX_TIMESTAMP' => 33, - 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'SUBSTRING_INDEX' => 33, - 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'NUMINTERIORRINGS' => 33, - 'UNCOMPRESSED_LENGTH' => 33, - - 'IF' => 35, 'IN' => 35, - 'MOD' => 35, - 'LEFT' => 35, - 'MATCH' => 35, 'RIGHT' => 35, - 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, - 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, - 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, - 'LOCALTIME' => 35, - 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, - 'UTC_TIMESTAMP' => 35, - 'LOCALTIMESTAMP' => 35, - 'CURRENT_TIMESTAMP' => 35, - - 'NOT IN' => 39, - - 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, - 'POINT' => 41, - 'POLYGON' => 41, - 'TIMESTAMP' => 41, - 'LINESTRING' => 41, - 'MULTILINESTRING' => 41, - 'GEOMETRYCOLLECTION' => 41, - - 'CHAR' => 43, - 'INTERVAL' => 43, - - ); -} diff --git a/#pma/libraries/sql-parser/src/Contexts/ContextMySql50100.php b/#pma/libraries/sql-parser/src/Contexts/ContextMySql50100.php deleted file mode 100644 index f63d1745..00000000 --- a/#pma/libraries/sql-parser/src/Contexts/ContextMySql50100.php +++ /dev/null @@ -1,312 +0,0 @@ - 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, - 'ANY' => 1, 'BDB' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, - 'NEW' => 1, 'ONE' => 1, 'ROW' => 1, - 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, - 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'GOTO' => 1, 'HASH' => 1, - 'HELP' => 1, 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, - 'MODE' => 1, 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'OPEN' => 1, 'PAGE' => 1, - 'PORT' => 1, 'PREV' => 1, 'ROWS' => 1, 'SOME' => 1, 'STOP' => 1, 'THAN' => 1, - 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, - 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, - 'CHAIN' => 1, 'CLOSE' => 1, 'EVENT' => 1, 'EVERY' => 1, 'FIRST' => 1, - 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, 'LABEL' => 1, - 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, - 'NAMES' => 1, 'NCHAR' => 1, 'OWNER' => 1, 'PHASE' => 1, 'QUERY' => 1, - 'QUICK' => 1, 'RAID0' => 1, 'RESET' => 1, 'RTREE' => 1, 'SHARE' => 1, - 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, 'SWAPS' => 1, 'TYPES' => 1, - 'UNTIL' => 1, 'VALUE' => 1, - 'ACTION' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, 'CLIENT' => 1, - 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, 'ESCAPE' => 1, - 'EVENTS' => 1, 'FAULTS' => 1, 'FIELDS' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, - 'IMPORT' => 1, 'INNODB' => 1, 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, - 'MEDIUM' => 1, 'MEMORY' => 1, 'MODIFY' => 1, 'OFFSET' => 1, 'PARSER' => 1, - 'PLUGIN' => 1, 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, - 'ROLLUP' => 1, 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, - 'SONAME' => 1, 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, - 'STRING' => 1, 'TABLES' => 1, - 'AUTHORS' => 1, 'CHANGED' => 1, 'COLUMNS' => 1, 'COMMENT' => 1, 'COMPACT' => 1, - 'CONTEXT' => 1, 'DEFINER' => 1, 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, - 'ENGINES' => 1, 'EXECUTE' => 1, 'HANDLER' => 1, 'INDEXES' => 1, 'INSTALL' => 1, - 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, 'OPTIONS' => 1, - 'PARTIAL' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, 'REBUILD' => 1, - 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, - 'STORAGE' => 1, 'STRIPED' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, - 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'VIRTUAL' => 1, 'WRAPPER' => 1, - 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, - 'EXTENDED' => 1, 'FUNCTION' => 1, 'INNOBASE' => 1, 'LANGUAGE' => 1, - 'MAXVALUE' => 1, 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, 'MIN_ROWS' => 1, - 'NATIONAL' => 1, 'NVARCHAR' => 1, 'ONE_SHOT' => 1, 'PRESERVE' => 1, - 'PROFILES' => 1, 'REDOFILE' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, - 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, - 'TRIGGERS' => 1, 'UNDOFILE' => 1, 'WARNINGS' => 1, - 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, - 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, - 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'PARTITION' => 1, 'RAID_TYPE' => 1, - 'READ_ONLY' => 1, 'REDUNDANT' => 1, 'SAVEPOINT' => 1, 'SCHEDULER' => 1, - 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, 'UNDEFINED' => 1, - 'UNINSTALL' => 1, 'VARIABLES' => 1, - 'BERKELEYDB' => 1, 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, - 'CONNECTION' => 1, 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, - 'MASTER_SSL' => 1, 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, - 'PRIVILEGES' => 1, 'REORGANISE' => 1, 'REORGANIZE' => 1, 'REPEATABLE' => 1, - 'ROW_FORMAT' => 1, 'SQL_THREAD' => 1, 'TABLESPACE' => 1, - 'EXTENT_SIZE' => 1, 'FRAC_SECOND' => 1, 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, - 'MASTER_USER' => 1, 'PROCESSLIST' => 1, 'RAID_CHUNKS' => 1, 'REPLICATION' => 1, - 'SQL_TSI_DAY' => 1, 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, - 'CONTRIBUTORS' => 1, 'DES_KEY_FILE' => 1, 'INITIAL_SIZE' => 1, - 'PARTITIONING' => 1, 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, - 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, 'SQL_TSI_WEEK' => 1, - 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, - 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'PAGE_CHECKSUM' => 1, - 'RELAY_LOG_POS' => 1, 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, - 'TRANSACTIONAL' => 1, - 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, - 'MASTER_LOG_POS' => 1, 'MASTER_SSL_KEY' => 1, 'RAID_CHUNKSIZE' => 1, - 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, 'SQL_TSI_SECOND' => 1, - 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, - 'AUTOEXTEND_SIZE' => 1, 'DELAY_KEY_WRITE' => 1, 'MASTER_LOG_FILE' => 1, - 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, 'SQL_TSI_QUARTER' => 1, - 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'UNDO_BUFFER_SIZE' => 1, - 'MASTER_SSL_CAPATH' => 1, 'MASTER_SSL_CIPHER' => 1, 'SQL_BUFFER_RESULT' => 1, - 'SQL_TSI_FRAC_SECOND' => 1, - 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, - 'MAX_UPDATES_PER_HOUR' => 1, 'MAX_USER_CONNECTIONS' => 1, - 'MAX_CONNECTIONS_PER_HOUR' => 1, - - 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, - 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, - 'FOR' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, 'USE' => 3, - 'XOR' => 3, - 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, - 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, - 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, - 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, - 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, - 'WHEN' => 3, 'WITH' => 3, - 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, - 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, - 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, - 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, - 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, - 'WRITE' => 3, - 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, - 'DELETE' => 3, 'ELSEIF' => 3, 'EXISTS' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, - 'HAVING' => 3, 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, - 'REGEXP' => 3, 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, - 'UNLOCK' => 3, 'UPDATE' => 3, - 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, - 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, - 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, - 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, - 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, - 'ENCLOSED' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESTRICT' => 3, - 'SPECIFIC' => 3, 'SQLSTATE' => 3, 'STARTING' => 3, 'TRAILING' => 3, - 'UNSIGNED' => 3, 'ZEROFILL' => 3, - 'CONDITION' => 3, 'DATABASES' => 3, 'MIDDLEINT' => 3, 'PRECISION' => 3, - 'PROCEDURE' => 3, 'SENSITIVE' => 3, 'SEPARATOR' => 3, - 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, - 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, - 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, - 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, - 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, - 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, - 'STRAIGHT_JOIN' => 3, - 'SQL_BIG_RESULT' => 3, - 'DAY_MICROSECOND' => 3, - 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, - 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, - 'SQL_CALC_FOUND_ROWS' => 3, - 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, - - 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, - 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, - 'LESS THAN' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, 'ON UPDATE' => 7, - 'UNION ALL' => 7, - 'CROSS JOIN' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, 'LINEAR KEY' => 7, - 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, - 'LINEAR HASH' => 7, - 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, - 'PARTITION BY' => 7, 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, - 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, - 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, - 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, - 'INDEX DIRECTORY' => 7, 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, - 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, - 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, - 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, - 'DEFAULT CHARACTER SET' => 7, - 'NATURAL LEFT OUTER JOIN' => 7, - 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, - - 'BIT' => 9, 'XML' => 9, - 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, - 'ARRAY' => 9, - 'SERIAL' => 9, - 'BOOLEAN' => 9, - 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, - 'MULTILINEPOINT' => 9, - 'MULTILINEPOLYGON' => 9, - - 'INT' => 11, 'SET' => 11, - 'BLOB' => 11, 'REAL' => 11, - 'FLOAT' => 11, - 'BIGINT' => 11, 'BINARY' => 11, 'DOUBLE' => 11, - 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, - 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, - 'TINYTEXT' => 11, - 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, - 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, - - 'BINARY VARYING' => 15, - - 'KEY' => 19, - 'INDEX' => 19, - 'UNIQUE' => 19, - 'SPATIAL' => 19, - 'FULLTEXT' => 19, - - 'INDEX KEY' => 23, - 'UNIQUE KEY' => 23, - 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, - 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, - 'SPATIAL INDEX' => 23, - 'FULLTEXT INDEX' => 23, - - 'X' => 33, 'Y' => 33, - 'LN' => 33, 'PI' => 33, - 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, - 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, - 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, - 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, - 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, - 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, - 'SHA1' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'TRIM' => 33, 'USER' => 33, - 'UUID' => 33, 'WEEK' => 33, - 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, - 'CRC32' => 33, 'DECOD' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, - 'LCASE' => 33, 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, - 'MONTH' => 33, 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, - 'SLEEP' => 33, 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, - 'ASTEXT' => 33, 'BIT_OR' => 33, 'CONCAT' => 33, 'ENCODE' => 33, 'EQUALS' => 33, - 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, 'LENGTH' => 33, 'LOCATE' => 33, - 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, 'SECOND' => 33, 'STDDEV' => 33, - 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, - 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, - 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, - 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, - 'ISEMPTY' => 33, 'QUARTER' => 33, 'RADIANS' => 33, 'REVERSE' => 33, 'SOUNDEX' => 33, - 'SUBDATE' => 33, 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, - 'VAR_POP' => 33, 'VERSION' => 33, 'WEEKDAY' => 33, - 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, - 'CONTAINS' => 33, 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, - 'DISJOINT' => 33, 'ENDPOINT' => 33, 'ENVELOPE' => 33, 'GET_LOCK' => 33, - 'GREATEST' => 33, 'ISCLOSED' => 33, 'ISSIMPLE' => 33, 'MAKEDATE' => 33, - 'MAKETIME' => 33, 'MAKE_SET' => 33, 'MBREQUAL' => 33, 'OVERLAPS' => 33, - 'PASSWORD' => 33, 'POSITION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, - 'VARIANCE' => 33, 'VAR_SAMP' => 33, 'YEARWEEK' => 33, - 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, 'CONCAT_WS' => 33, - 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, 'FROM_DAYS' => 33, - 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, 'LOAD_FILE' => 33, - 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, 'ROW_COUNT' => 33, - 'SUBSTRING' => 33, 'UPDATEXML' => 33, - 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'DAYOFMONTH' => 33, 'EXPORT_SET' => 33, - 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INTERSECTS' => 33, 'MBRTOUCHES' => 33, - 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, - 'STDDEV_POP' => 33, 'UNCOMPRESS' => 33, 'UUID_SHORT' => 33, 'WEEKOFYEAR' => 33, - 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, - 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'GEOMFROMWKB' => 33, - 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, - 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, - 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, - 'TIME_TO_SEC' => 33, - 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, - 'GEOMETRYTYPE' => 33, 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, - 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, 'LINEFROMTEXT' => 33, - 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, - 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, - 'POLYFROMTEXT' => 33, 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, - 'TIMESTAMPADD' => 33, - 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'INTERIORRINGN' => 33, - 'MBRINTERSECTS' => 33, 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, - 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, 'POINTFROMTEXT' => 33, - 'TIMESTAMPDIFF' => 33, - 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, 'POLYGONFROMWKB' => 33, - 'UNIX_TIMESTAMP' => 33, - 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, - 'SUBSTRING_INDEX' => 33, - 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, - 'NUMINTERIORRINGS' => 33, - 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, - 'MULTIPOINTFROMTEXT' => 33, - 'MULTIPOLYGONFROMWKB' => 33, 'UNCOMPRESSED_LENGTH' => 33, - 'MULTIPOLYGONFROMTEXT' => 33, - 'MULTILINESTRINGFROMWKB' => 33, - 'MULTILINESTRINGFROMTEXT' => 33, - 'GEOMETRYCOLLECTIONFROMWKB' => 33, - 'GEOMETRYCOLLECTIONFROMTEXT' => 33, - - 'IF' => 35, 'IN' => 35, - 'MOD' => 35, - 'LEFT' => 35, - 'MATCH' => 35, 'RIGHT' => 35, - 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, - 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, - 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, - 'LOCALTIME' => 35, - 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, - 'UTC_TIMESTAMP' => 35, - 'LOCALTIMESTAMP' => 35, - 'CURRENT_TIMESTAMP' => 35, - - 'NOT IN' => 39, - - 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, - 'POINT' => 41, - 'POLYGON' => 41, - 'TIMESTAMP' => 41, - 'LINESTRING' => 41, - 'MULTILINESTRING' => 41, - 'GEOMETRYCOLLECTION' => 41, - - 'CHAR' => 43, - 'INTERVAL' => 43, - - ); -} diff --git a/#pma/libraries/sql-parser/src/Contexts/ContextMySql50500.php b/#pma/libraries/sql-parser/src/Contexts/ContextMySql50500.php deleted file mode 100644 index a015dd82..00000000 --- a/#pma/libraries/sql-parser/src/Contexts/ContextMySql50500.php +++ /dev/null @@ -1,317 +0,0 @@ - 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, - 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, - 'ONE' => 1, 'ROW' => 1, - 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, - 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, - 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, - 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'OPEN' => 1, 'PAGE' => 1, 'PORT' => 1, - 'PREV' => 1, 'ROWS' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, 'THAN' => 1, - 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, - 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, - 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, - 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, - 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, - 'NAMES' => 1, 'NCHAR' => 1, 'OWNER' => 1, 'PHASE' => 1, 'PROXY' => 1, - 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, 'RTREE' => 1, - 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, 'SWAPS' => 1, - 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, - 'ACTION' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, 'CLIENT' => 1, - 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, 'ESCAPE' => 1, - 'EVENTS' => 1, 'FAULTS' => 1, 'FIELDS' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, - 'IMPORT' => 1, 'INNODB' => 1, 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, - 'MEDIUM' => 1, 'MEMORY' => 1, 'MODIFY' => 1, 'OFFSET' => 1, 'PARSER' => 1, - 'PLUGIN' => 1, 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, - 'ROLLUP' => 1, 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, - 'SONAME' => 1, 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, - 'STRING' => 1, 'TABLES' => 1, - 'AUTHORS' => 1, 'CHANGED' => 1, 'COLUMNS' => 1, 'COMMENT' => 1, 'COMPACT' => 1, - 'CONTEXT' => 1, 'DEFINER' => 1, 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, - 'ENGINES' => 1, 'EXECUTE' => 1, 'GENERAL' => 1, 'HANDLER' => 1, 'INDEXES' => 1, - 'INSTALL' => 1, 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, - 'OPTIONS' => 1, 'PARTIAL' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, - 'REBUILD' => 1, 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, - 'SESSION' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, - 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'VIRTUAL' => 1, 'WRAPPER' => 1, - 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, - 'EXTENDED' => 1, 'FUNCTION' => 1, 'INNOBASE' => 1, 'LANGUAGE' => 1, - 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, 'MIN_ROWS' => 1, 'NATIONAL' => 1, - 'NVARCHAR' => 1, 'ONE_SHOT' => 1, 'PRESERVE' => 1, 'PROFILES' => 1, - 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, - 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, - 'TRIGGERS' => 1, 'UNDOFILE' => 1, 'WARNINGS' => 1, - 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, - 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, - 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'PARTITION' => 1, 'READ_ONLY' => 1, - 'REDUNDANT' => 1, 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, - 'TEMPTABLE' => 1, 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, - 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, - 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, - 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PRIVILEGES' => 1, - 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, 'SQL_THREAD' => 1, - 'TABLESPACE' => 1, 'TABLE_NAME' => 1, - 'COLUMN_NAME' => 1, 'CURSOR_NAME' => 1, 'EXTENT_SIZE' => 1, 'FRAC_SECOND' => 1, - 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, 'MYSQL_ERRNO' => 1, - 'PROCESSLIST' => 1, 'REPLICATION' => 1, 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, - 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, - 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'CONTRIBUTORS' => 1, - 'DES_KEY_FILE' => 1, 'INITIAL_SIZE' => 1, 'MESSAGE_TEXT' => 1, - 'PARTITIONING' => 1, 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, - 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, 'SQL_TSI_WEEK' => 1, - 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, - 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, - 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, - 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, - 'MASTER_LOG_POS' => 1, 'MASTER_SSL_KEY' => 1, 'RELAY_LOG_FILE' => 1, - 'SQL_TSI_MINUTE' => 1, 'SQL_TSI_SECOND' => 1, 'TABLE_CHECKSUM' => 1, - 'USER_RESOURCES' => 1, - 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, - 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, - 'SQL_TSI_QUARTER' => 1, 'SUBCLASS_ORIGIN' => 1, - 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'UNDO_BUFFER_SIZE' => 1, - 'CONSTRAINT_SCHEMA' => 1, 'IGNORE_SERVER_IDS' => 1, 'MASTER_SSL_CAPATH' => 1, - 'MASTER_SSL_CIPHER' => 1, 'SQL_BUFFER_RESULT' => 1, - 'CONSTRAINT_CATALOG' => 1, - 'SQL_TSI_FRAC_SECOND' => 1, - 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, - 'MAX_UPDATES_PER_HOUR' => 1, 'MAX_USER_CONNECTIONS' => 1, - 'MASTER_HEARTBEAT_PERIOD' => 1, - 'MAX_CONNECTIONS_PER_HOUR' => 1, - - 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, - 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, - 'FOR' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, 'USE' => 3, - 'XOR' => 3, - 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, - 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, - 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, - 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, - 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, - 'WHEN' => 3, 'WITH' => 3, - 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, - 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, - 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, - 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, - 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, - 'WRITE' => 3, - 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, - 'DELETE' => 3, 'ELSEIF' => 3, 'EXISTS' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, - 'HAVING' => 3, 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, - 'REGEXP' => 3, 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, - 'SIGNAL' => 3, 'UNLOCK' => 3, 'UPDATE' => 3, - 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, - 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, - 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, - 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, - 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, - 'ENCLOSED' => 3, 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, - 'RESIGNAL' => 3, 'RESTRICT' => 3, 'SPECIFIC' => 3, 'SQLSTATE' => 3, - 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, 'ZEROFILL' => 3, - 'CONDITION' => 3, 'DATABASES' => 3, 'MIDDLEINT' => 3, 'PRECISION' => 3, - 'PROCEDURE' => 3, 'SENSITIVE' => 3, 'SEPARATOR' => 3, - 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, - 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, - 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, - 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, - 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, - 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, - 'STRAIGHT_JOIN' => 3, - 'SQL_BIG_RESULT' => 3, - 'DAY_MICROSECOND' => 3, - 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, - 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, - 'SQL_CALC_FOUND_ROWS' => 3, - 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, - - 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, - 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, - 'LESS THAN' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, 'ON UPDATE' => 7, - 'UNION ALL' => 7, - 'CROSS JOIN' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, 'LINEAR KEY' => 7, - 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, - 'LINEAR HASH' => 7, - 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, - 'PARTITION BY' => 7, 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, - 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, - 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, - 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, - 'INDEX DIRECTORY' => 7, 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, - 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, - 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, - 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, - 'DEFAULT CHARACTER SET' => 7, - 'NATURAL LEFT OUTER JOIN' => 7, - 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, - - 'BIT' => 9, 'XML' => 9, - 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, - 'ARRAY' => 9, - 'SERIAL' => 9, - 'BOOLEAN' => 9, - 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, - 'MULTILINEPOINT' => 9, - 'MULTILINEPOLYGON' => 9, - - 'INT' => 11, 'SET' => 11, - 'BLOB' => 11, 'REAL' => 11, - 'FLOAT' => 11, - 'BIGINT' => 11, 'BINARY' => 11, 'DOUBLE' => 11, - 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, - 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, - 'TINYTEXT' => 11, - 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, - 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, - - 'BINARY VARYING' => 15, - - 'KEY' => 19, - 'INDEX' => 19, - 'UNIQUE' => 19, - 'SPATIAL' => 19, - 'FULLTEXT' => 19, - - 'INDEX KEY' => 23, - 'UNIQUE KEY' => 23, - 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, - 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, - 'SPATIAL INDEX' => 23, - 'FULLTEXT INDEX' => 23, - - 'X' => 33, 'Y' => 33, - 'LN' => 33, 'PI' => 33, - 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, - 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, - 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, - 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, - 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, - 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, - 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'TRIM' => 33, - 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, - 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, - 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, - 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, - 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, - 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, - 'ASTEXT' => 33, 'BIT_OR' => 33, 'CONCAT' => 33, 'DECODE' => 33, 'ENCODE' => 33, - 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, 'LENGTH' => 33, - 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, 'SECOND' => 33, - 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, - 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, - 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, - 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, - 'ISEMPTY' => 33, 'QUARTER' => 33, 'RADIANS' => 33, 'REVERSE' => 33, 'SOUNDEX' => 33, - 'SUBDATE' => 33, 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, - 'VAR_POP' => 33, 'VERSION' => 33, 'WEEKDAY' => 33, - 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, - 'CONTAINS' => 33, 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, - 'DISJOINT' => 33, 'ENDPOINT' => 33, 'ENVELOPE' => 33, 'GET_LOCK' => 33, - 'GREATEST' => 33, 'ISCLOSED' => 33, 'ISSIMPLE' => 33, 'MAKEDATE' => 33, - 'MAKETIME' => 33, 'MAKE_SET' => 33, 'MBREQUAL' => 33, 'OVERLAPS' => 33, - 'PASSWORD' => 33, 'POSITION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, - 'VARIANCE' => 33, 'VAR_SAMP' => 33, 'YEARWEEK' => 33, - 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, 'CONCAT_WS' => 33, - 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, 'FROM_DAYS' => 33, - 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, 'LOAD_FILE' => 33, - 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, 'ROW_COUNT' => 33, - 'SUBSTRING' => 33, 'UPDATEXML' => 33, - 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'DAYOFMONTH' => 33, 'EXPORT_SET' => 33, - 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INTERSECTS' => 33, 'MBRTOUCHES' => 33, - 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, - 'STDDEV_POP' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, 'UUID_SHORT' => 33, - 'WEEKOFYEAR' => 33, - 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, - 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'GEOMFROMWKB' => 33, - 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, - 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, - 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, - 'TIME_TO_SEC' => 33, - 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, - 'GEOMETRYTYPE' => 33, 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, - 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, 'LINEFROMTEXT' => 33, - 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, - 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, - 'POLYFROMTEXT' => 33, 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, - 'TIMESTAMPADD' => 33, - 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'INTERIORRINGN' => 33, - 'MBRINTERSECTS' => 33, 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, - 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, 'POINTFROMTEXT' => 33, - 'TIMESTAMPDIFF' => 33, - 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, 'POLYGONFROMWKB' => 33, - 'UNIX_TIMESTAMP' => 33, - 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, - 'SUBSTRING_INDEX' => 33, - 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, - 'NUMINTERIORRINGS' => 33, - 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, - 'MULTIPOINTFROMTEXT' => 33, - 'MULTIPOLYGONFROMWKB' => 33, 'UNCOMPRESSED_LENGTH' => 33, - 'MULTIPOLYGONFROMTEXT' => 33, - 'MULTILINESTRINGFROMWKB' => 33, - 'MULTILINESTRINGFROMTEXT' => 33, - 'GEOMETRYCOLLECTIONFROMWKB' => 33, - 'GEOMETRYCOLLECTIONFROMTEXT' => 33, - - 'IF' => 35, 'IN' => 35, - 'MOD' => 35, - 'LEFT' => 35, - 'MATCH' => 35, 'RIGHT' => 35, - 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, - 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, - 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, - 'LOCALTIME' => 35, - 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, - 'UTC_TIMESTAMP' => 35, - 'LOCALTIMESTAMP' => 35, - 'CURRENT_TIMESTAMP' => 35, - - 'NOT IN' => 39, - - 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, - 'POINT' => 41, - 'POLYGON' => 41, - 'TIMESTAMP' => 41, - 'LINESTRING' => 41, - 'MULTILINESTRING' => 41, - 'GEOMETRYCOLLECTION' => 41, - - 'CHAR' => 43, - 'INTERVAL' => 43, - - ); -} diff --git a/#pma/libraries/sql-parser/src/Contexts/ContextMySql50600.php b/#pma/libraries/sql-parser/src/Contexts/ContextMySql50600.php deleted file mode 100644 index 94655aef..00000000 --- a/#pma/libraries/sql-parser/src/Contexts/ContextMySql50600.php +++ /dev/null @@ -1,346 +0,0 @@ - 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, - 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, - 'ONE' => 1, 'ROW' => 1, - 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, - 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, - 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, - 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'ONLY' => 1, 'OPEN' => 1, 'PAGE' => 1, - 'PORT' => 1, 'PREV' => 1, 'ROWS' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, - 'THAN' => 1, 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, - 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, - 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, - 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, - 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, - 'NAMES' => 1, 'NCHAR' => 1, 'OWNER' => 1, 'PHASE' => 1, 'PROXY' => 1, - 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, 'RTREE' => 1, - 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, 'SWAPS' => 1, - 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, - 'ACTION' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, 'CLIENT' => 1, - 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, 'ESCAPE' => 1, - 'EVENTS' => 1, 'EXPIRE' => 1, 'EXPORT' => 1, 'FAULTS' => 1, 'FIELDS' => 1, - 'GLOBAL' => 1, 'GRANTS' => 1, 'IMPORT' => 1, 'ISSUER' => 1, 'LEAVES' => 1, - 'MASTER' => 1, 'MEDIUM' => 1, 'MEMORY' => 1, 'MODIFY' => 1, 'NUMBER' => 1, - 'OFFSET' => 1, 'PARSER' => 1, 'PLUGIN' => 1, 'RELOAD' => 1, 'REMOVE' => 1, - 'REPAIR' => 1, 'RESUME' => 1, 'ROLLUP' => 1, 'SERVER' => 1, 'SIGNED' => 1, - 'SIMPLE' => 1, 'SOCKET' => 1, 'SONAME' => 1, 'SOUNDS' => 1, 'SOURCE' => 1, - 'STARTS' => 1, 'STATUS' => 1, 'STRING' => 1, 'TABLES' => 1, - 'ANALYSE' => 1, 'AUTHORS' => 1, 'CHANGED' => 1, 'COLUMNS' => 1, 'COMMENT' => 1, - 'COMPACT' => 1, 'CONTEXT' => 1, 'CURRENT' => 1, 'DEFINER' => 1, 'DISABLE' => 1, - 'DISCARD' => 1, 'DYNAMIC' => 1, 'ENGINES' => 1, 'EXECUTE' => 1, 'GENERAL' => 1, - 'HANDLER' => 1, 'INDEXES' => 1, 'INSTALL' => 1, 'INVOKER' => 1, 'LOGFILE' => 1, - 'MIGRATE' => 1, 'NO_WAIT' => 1, 'OPTIONS' => 1, 'PARTIAL' => 1, 'PLUGINS' => 1, - 'PREPARE' => 1, 'PROFILE' => 1, 'REBUILD' => 1, 'RECOVER' => 1, 'RESTORE' => 1, - 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, - 'SUSPEND' => 1, 'UNICODE' => 1, 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, - 'VIRTUAL' => 1, 'WRAPPER' => 1, - 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, - 'EXCHANGE' => 1, 'EXTENDED' => 1, 'FUNCTION' => 1, 'LANGUAGE' => 1, - 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, 'MIN_ROWS' => 1, 'NATIONAL' => 1, - 'NVARCHAR' => 1, 'ONE_SHOT' => 1, 'PRESERVE' => 1, 'PROFILES' => 1, - 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, - 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, - 'TRIGGERS' => 1, 'UNDOFILE' => 1, 'WARNINGS' => 1, - 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, - 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, - 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'READ_ONLY' => 1, 'REDUNDANT' => 1, - 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, - 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, - 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, - 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, - 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PLUGIN_DIR' => 1, - 'PRIVILEGES' => 1, 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, - 'SQL_THREAD' => 1, 'TABLESPACE' => 1, 'TABLE_NAME' => 1, - 'COLUMN_NAME' => 1, 'CURSOR_NAME' => 1, 'DIAGNOSTICS' => 1, 'EXTENT_SIZE' => 1, - 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, 'MYSQL_ERRNO' => 1, - 'PROCESSLIST' => 1, 'REPLICATION' => 1, 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, - 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, - 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'CONTRIBUTORS' => 1, - 'DEFAULT_AUTH' => 1, 'DES_KEY_FILE' => 1, 'INITIAL_SIZE' => 1, - 'MASTER_DELAY' => 1, 'MESSAGE_TEXT' => 1, 'PARTITIONING' => 1, - 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, - 'SQL_TSI_HOUR' => 1, 'SQL_TSI_WEEK' => 1, 'SQL_TSI_YEAR' => 1, - 'SUBPARTITION' => 1, - 'COLUMN_FORMAT' => 1, 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, - 'RELAY_LOG_POS' => 1, 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, - 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, - 'MASTER_LOG_POS' => 1, 'MASTER_SSL_CRL' => 1, 'MASTER_SSL_KEY' => 1, - 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, 'SQL_TSI_SECOND' => 1, - 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, - 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, - 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, - 'SQL_AFTER_GTIDS' => 1, 'SQL_TSI_QUARTER' => 1, 'SUBCLASS_ORIGIN' => 1, - 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'SQL_BEFORE_GTIDS' => 1, - 'STATS_PERSISTENT' => 1, 'UNDO_BUFFER_SIZE' => 1, - 'CONSTRAINT_SCHEMA' => 1, 'IGNORE_SERVER_IDS' => 1, 'MASTER_SSL_CAPATH' => 1, - 'MASTER_SSL_CIPHER' => 1, 'RETURNED_SQLSTATE' => 1, 'SQL_BUFFER_RESULT' => 1, - 'STATS_AUTO_RECALC' => 1, - 'CONSTRAINT_CATALOG' => 1, 'MASTER_RETRY_COUNT' => 1, 'MASTER_SSL_CRLPATH' => 1, - 'SQL_AFTER_MTS_GAPS' => 1, 'STATS_SAMPLE_PAGES' => 1, - 'MASTER_AUTO_POSITION' => 1, 'MASTER_CONNECT_RETRY' => 1, - 'MAX_QUERIES_PER_HOUR' => 1, 'MAX_UPDATES_PER_HOUR' => 1, - 'MAX_USER_CONNECTIONS' => 1, - 'MASTER_HEARTBEAT_PERIOD' => 1, - 'MAX_CONNECTIONS_PER_HOUR' => 1, - - 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, - 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, - 'FOR' => 3, 'GET' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, - 'USE' => 3, 'XOR' => 3, - 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, - 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, - 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, - 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, - 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, - 'WHEN' => 3, 'WITH' => 3, - 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, - 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, - 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, - 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, - 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, - 'WRITE' => 3, - 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, - 'DELETE' => 3, 'ELSEIF' => 3, 'EXISTS' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, - 'HAVING' => 3, 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, - 'REGEXP' => 3, 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, - 'SIGNAL' => 3, 'UNLOCK' => 3, 'UPDATE' => 3, - 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, - 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, - 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, - 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, - 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, - 'ENCLOSED' => 3, 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, - 'RESIGNAL' => 3, 'RESTRICT' => 3, 'SPECIFIC' => 3, 'SQLSTATE' => 3, - 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, 'ZEROFILL' => 3, - 'CONDITION' => 3, 'DATABASES' => 3, 'MIDDLEINT' => 3, 'PARTITION' => 3, - 'PRECISION' => 3, 'PROCEDURE' => 3, 'SENSITIVE' => 3, 'SEPARATOR' => 3, - 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, - 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, - 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, - 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, - 'MASTER_BIND' => 3, - 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, - 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, - 'STRAIGHT_JOIN' => 3, - 'IO_AFTER_GTIDS' => 3, 'SQL_BIG_RESULT' => 3, - 'DAY_MICROSECOND' => 3, 'IO_BEFORE_GTIDS' => 3, - 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, - 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, - 'SQL_CALC_FOUND_ROWS' => 3, - 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, - - 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, - 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, - 'LESS THAN' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, 'ON UPDATE' => 7, - 'UNION ALL' => 7, - 'CROSS JOIN' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, 'LINEAR KEY' => 7, - 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, - 'LINEAR HASH' => 7, - 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, - 'PARTITION BY' => 7, 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, - 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, - 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, - 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, - 'INDEX DIRECTORY' => 7, 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, - 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, - 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, - 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, - 'DEFAULT CHARACTER SET' => 7, - 'NATURAL LEFT OUTER JOIN' => 7, - 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, - - 'BIT' => 9, 'XML' => 9, - 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, - 'ARRAY' => 9, - 'SERIAL' => 9, - 'BOOLEAN' => 9, - 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, - 'MULTILINEPOINT' => 9, - 'MULTILINEPOLYGON' => 9, - - 'INT' => 11, 'SET' => 11, - 'BLOB' => 11, 'REAL' => 11, - 'FLOAT' => 11, - 'BIGINT' => 11, 'BINARY' => 11, 'DOUBLE' => 11, - 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, - 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, - 'TINYTEXT' => 11, - 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, - 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, - - 'BINARY VARYING' => 15, - - 'KEY' => 19, - 'INDEX' => 19, - 'UNIQUE' => 19, - 'SPATIAL' => 19, - 'FULLTEXT' => 19, - - 'INDEX KEY' => 23, - 'UNIQUE KEY' => 23, - 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, - 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, - 'SPATIAL INDEX' => 23, - 'FULLTEXT INDEX' => 23, - - 'X' => 33, 'Y' => 33, - 'LN' => 33, 'PI' => 33, - 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, - 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, - 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, - 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, - 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, - 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, - 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'ST_X' => 33, - 'ST_Y' => 33, 'TRIM' => 33, 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, - 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, - 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, - 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, - 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, - 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, - 'ASTEXT' => 33, 'BIT_OR' => 33, 'BUFFER' => 33, 'CONCAT' => 33, 'DECODE' => 33, - 'ENCODE' => 33, 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, - 'LENGTH' => 33, 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, - 'SECOND' => 33, 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, - 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, - 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, - 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, - 'ISEMPTY' => 33, 'IS_IPV4' => 33, 'IS_IPV6' => 33, 'QUARTER' => 33, 'RADIANS' => 33, - 'REVERSE' => 33, 'SOUNDEX' => 33, 'ST_AREA' => 33, 'ST_SRID' => 33, 'SUBDATE' => 33, - 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, 'VAR_POP' => 33, - 'VERSION' => 33, 'WEEKDAY' => 33, - 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, - 'CONTAINS' => 33, 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, - 'DISJOINT' => 33, 'ENDPOINT' => 33, 'ENVELOPE' => 33, 'GET_LOCK' => 33, - 'GREATEST' => 33, 'ISCLOSED' => 33, 'ISSIMPLE' => 33, 'MAKEDATE' => 33, - 'MAKETIME' => 33, 'MAKE_SET' => 33, 'MBREQUAL' => 33, 'OVERLAPS' => 33, - 'PASSWORD' => 33, 'POSITION' => 33, 'ST_ASWKB' => 33, 'ST_ASWKT' => 33, - 'ST_UNION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, - 'VAR_SAMP' => 33, 'YEARWEEK' => 33, - 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, 'CONCAT_WS' => 33, - 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, 'FROM_DAYS' => 33, - 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, 'LOAD_FILE' => 33, - 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, 'ROW_COUNT' => 33, - 'ST_ASTEXT' => 33, 'ST_BUFFER' => 33, 'ST_EQUALS' => 33, 'ST_POINTN' => 33, - 'ST_WITHIN' => 33, 'SUBSTRING' => 33, 'TO_BASE64' => 33, 'UPDATEXML' => 33, - 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'DAYOFMONTH' => 33, 'EXPORT_SET' => 33, - 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INET6_ATON' => 33, 'INET6_NTOA' => 33, - 'INTERSECTS' => 33, 'MBRTOUCHES' => 33, 'MULTIPOINT' => 33, 'NAME_CONST' => 33, - 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, 'STDDEV_POP' => 33, 'ST_CROSSES' => 33, - 'ST_ISEMPTY' => 33, 'ST_TOUCHES' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, - 'UUID_SHORT' => 33, 'WEEKOFYEAR' => 33, - 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, - 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'FROM_BASE64' => 33, - 'GEOMFROMWKB' => 33, 'GTID_SUBSET' => 33, 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, - 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, - 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, - 'ST_ASBINARY' => 33, 'ST_CENTROID' => 33, 'ST_CONTAINS' => 33, 'ST_DISJOINT' => 33, - 'ST_DISTANCE' => 33, 'ST_ENDPOINT' => 33, 'ST_ENVELOPE' => 33, 'ST_ISCLOSED' => 33, - 'ST_ISSIMPLE' => 33, 'ST_OVERLAPS' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, - 'TIME_TO_SEC' => 33, - 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, - 'GEOMETRYTYPE' => 33, 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, - 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, 'LINEFROMTEXT' => 33, - 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, - 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, - 'POLYFROMTEXT' => 33, 'RANDOM_BYTES' => 33, 'RELEASE_LOCK' => 33, - 'SESSION_USER' => 33, 'ST_DIMENSION' => 33, 'ST_GEOMETRYN' => 33, - 'ST_NUMPOINTS' => 33, 'TIMESTAMPADD' => 33, - 'CONNECTION_ID' => 33, 'CREATE_DIGEST' => 33, 'FROM_UNIXTIME' => 33, - 'GTID_SUBTRACT' => 33, 'INTERIORRINGN' => 33, 'MBRINTERSECTS' => 33, - 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, 'MPOLYFROMTEXT' => 33, - 'NUMGEOMETRIES' => 33, 'POINTFROMTEXT' => 33, 'ST_DIFFERENCE' => 33, - 'ST_INTERSECTS' => 33, 'ST_STARTPOINT' => 33, 'TIMESTAMPDIFF' => 33, - 'WEIGHT_STRING' => 33, - 'IS_IPV4_COMPAT' => 33, 'IS_IPV4_MAPPED' => 33, 'LAST_INSERT_ID' => 33, - 'MPOINTFROMTEXT' => 33, 'POLYGONFROMWKB' => 33, 'ST_GEOMFROMWKB' => 33, - 'ST_LINEFROMWKB' => 33, 'ST_POLYFROMWKB' => 33, 'UNIX_TIMESTAMP' => 33, - 'ASYMMETRIC_SIGN' => 33, 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, - 'POLYGONFROMTEXT' => 33, 'ST_EXTERIORRING' => 33, 'ST_GEOMETRYTYPE' => 33, - 'ST_GEOMFROMTEXT' => 33, 'ST_INTERSECTION' => 33, 'ST_LINEFROMTEXT' => 33, - 'ST_POINTFROMWKB' => 33, 'ST_POLYFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, - 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, - 'NUMINTERIORRINGS' => 33, 'ST_INTERIORRINGN' => 33, 'ST_NUMGEOMETRIES' => 33, - 'ST_POINTFROMTEXT' => 33, 'ST_SYMDIFFERENCE' => 33, - 'ASYMMETRIC_DERIVE' => 33, 'ASYMMETRIC_VERIFY' => 33, 'LINESTRINGFROMWKB' => 33, - 'MULTIPOINTFROMWKB' => 33, 'ST_POLYGONFROMWKB' => 33, - 'ASYMMETRIC_DECRYPT' => 33, 'ASYMMETRIC_ENCRYPT' => 33, 'MULTIPOINTFROMTEXT' => 33, - 'ST_GEOMCOLLFROMTXT' => 33, 'ST_GEOMCOLLFROMWKB' => 33, 'ST_POLYGONFROMTEXT' => 33, - 'MULTIPOLYGONFROMWKB' => 33, 'ST_GEOMCOLLFROMTEXT' => 33, 'ST_GEOMETRYFROMTEXT' => 33, - 'ST_NUMINTERIORRINGS' => 33, 'UNCOMPRESSED_LENGTH' => 33, - 'CREATE_DH_PARAMETERS' => 33, 'MULTIPOLYGONFROMTEXT' => 33, - 'ST_LINESTRINGFROMWKB' => 33, - 'MULTILINESTRINGFROMWKB' => 33, - 'MULTILINESTRINGFROMTEXT' => 33, - 'CREATE_ASYMMETRIC_PUB_KEY' => 33, 'GEOMETRYCOLLECTIONFROMWKB' => 33, - 'CREATE_ASYMMETRIC_PRIV_KEY' => 33, 'GEOMETRYCOLLECTIONFROMTEXT' => 33, - 'VALIDATE_PASSWORD_STRENGTH' => 33, - 'SQL_THREAD_WAIT_AFTER_GTIDS' => 33, - 'ST_GEOMETRYCOLLECTIONFROMWKB' => 33, - 'ST_GEOMETRYCOLLECTIONFROMTEXT' => 33, - 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS' => 33, - - 'IF' => 35, 'IN' => 35, - 'MOD' => 35, - 'LEFT' => 35, - 'MATCH' => 35, 'RIGHT' => 35, - 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, - 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, - 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, - 'LOCALTIME' => 35, - 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, - 'UTC_TIMESTAMP' => 35, - 'LOCALTIMESTAMP' => 35, - 'CURRENT_TIMESTAMP' => 35, - - 'NOT IN' => 39, - - 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, - 'POINT' => 41, - 'POLYGON' => 41, - 'TIMESTAMP' => 41, - 'LINESTRING' => 41, - 'MULTILINESTRING' => 41, - 'GEOMETRYCOLLECTION' => 41, - - 'CHAR' => 43, - 'INTERVAL' => 43, - - ); -} diff --git a/#pma/libraries/sql-parser/src/Contexts/ContextMySql50700.php b/#pma/libraries/sql-parser/src/Contexts/ContextMySql50700.php deleted file mode 100644 index 9f83e0f5..00000000 --- a/#pma/libraries/sql-parser/src/Contexts/ContextMySql50700.php +++ /dev/null @@ -1,358 +0,0 @@ - 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, - 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, - 'ONE' => 1, 'ROW' => 1, 'XID' => 1, - 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, - 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, - 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, - 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'ONLY' => 1, 'OPEN' => 1, 'PAGE' => 1, - 'PORT' => 1, 'PREV' => 1, 'ROWS' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, - 'THAN' => 1, 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, - 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, - 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, - 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, - 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, - 'NAMES' => 1, 'NCHAR' => 1, 'NEVER' => 1, 'OWNER' => 1, 'PHASE' => 1, - 'PROXY' => 1, 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, - 'RTREE' => 1, 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, - 'SWAPS' => 1, 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, - 'ACTION' => 1, 'ALWAYS' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, - 'CLIENT' => 1, 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, - 'ESCAPE' => 1, 'EVENTS' => 1, 'EXPIRE' => 1, 'EXPORT' => 1, 'FAULTS' => 1, - 'FIELDS' => 1, 'FILTER' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, 'IMPORT' => 1, - 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, 'MEDIUM' => 1, 'MEMORY' => 1, - 'MODIFY' => 1, 'NUMBER' => 1, 'OFFSET' => 1, 'PARSER' => 1, 'PLUGIN' => 1, - 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, 'ROLLUP' => 1, - 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, 'SONAME' => 1, - 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, 'STRING' => 1, - 'TABLES' => 1, - 'ACCOUNT' => 1, 'ANALYSE' => 1, 'CHANGED' => 1, 'CHANNEL' => 1, 'COLUMNS' => 1, - 'COMMENT' => 1, 'COMPACT' => 1, 'CONTEXT' => 1, 'CURRENT' => 1, 'DEFINER' => 1, - 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, 'ENGINES' => 1, 'EXECUTE' => 1, - 'FOLLOWS' => 1, 'GENERAL' => 1, 'HANDLER' => 1, 'INDEXES' => 1, 'INSTALL' => 1, - 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, 'OPTIONS' => 1, - 'PARTIAL' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, 'REBUILD' => 1, - 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, - 'STACKED' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, - 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'WITHOUT' => 1, 'WRAPPER' => 1, - 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, - 'EXCHANGE' => 1, 'EXTENDED' => 1, 'FUNCTION' => 1, 'LANGUAGE' => 1, - 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, 'MIN_ROWS' => 1, 'NATIONAL' => 1, - 'NVARCHAR' => 1, 'PRECEDES' => 1, 'PRESERVE' => 1, 'PROFILES' => 1, - 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, - 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, - 'TRIGGERS' => 1, 'UNDOFILE' => 1, 'WARNINGS' => 1, - 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, - 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, - 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'READ_ONLY' => 1, 'REDUNDANT' => 1, - 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, - 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, - 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, - 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, - 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PLUGIN_DIR' => 1, - 'PRIVILEGES' => 1, 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, - 'SQL_THREAD' => 1, 'TABLESPACE' => 1, 'TABLE_NAME' => 1, 'VALIDATION' => 1, - 'COLUMN_NAME' => 1, 'COMPRESSION' => 1, 'CURSOR_NAME' => 1, 'DIAGNOSTICS' => 1, - 'EXTENT_SIZE' => 1, 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, - 'MYSQL_ERRNO' => 1, 'NONBLOCKING' => 1, 'PROCESSLIST' => 1, 'REPLICATION' => 1, - 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, - 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'DEFAULT_AUTH' => 1, - 'DES_KEY_FILE' => 1, 'INITIAL_SIZE' => 1, 'MASTER_DELAY' => 1, - 'MESSAGE_TEXT' => 1, 'PARTITIONING' => 1, 'RELAY_THREAD' => 1, - 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, - 'SQL_TSI_WEEK' => 1, 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, - 'COLUMN_FORMAT' => 1, 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, - 'RELAY_LOG_POS' => 1, 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, - 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, - 'MASTER_LOG_POS' => 1, 'MASTER_SSL_CRL' => 1, 'MASTER_SSL_KEY' => 1, - 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, 'SQL_TSI_SECOND' => 1, - 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, - 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, - 'FILE_BLOCK_SIZE' => 1, 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, - 'MASTER_SSL_CERT' => 1, 'PARSE_GCOL_EXPR' => 1, 'REPLICATE_DO_DB' => 1, - 'SQL_AFTER_GTIDS' => 1, 'SQL_TSI_QUARTER' => 1, 'SUBCLASS_ORIGIN' => 1, - 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'SQL_BEFORE_GTIDS' => 1, - 'STATS_PERSISTENT' => 1, 'UNDO_BUFFER_SIZE' => 1, - 'CONSTRAINT_SCHEMA' => 1, 'GROUP_REPLICATION' => 1, 'IGNORE_SERVER_IDS' => 1, - 'MASTER_SSL_CAPATH' => 1, 'MASTER_SSL_CIPHER' => 1, 'RETURNED_SQLSTATE' => 1, - 'SQL_BUFFER_RESULT' => 1, 'STATS_AUTO_RECALC' => 1, - 'CONSTRAINT_CATALOG' => 1, 'MASTER_RETRY_COUNT' => 1, 'MASTER_SSL_CRLPATH' => 1, - 'MAX_STATEMENT_TIME' => 1, 'REPLICATE_DO_TABLE' => 1, 'SQL_AFTER_MTS_GAPS' => 1, - 'STATS_SAMPLE_PAGES' => 1, - 'REPLICATE_IGNORE_DB' => 1, - 'MASTER_AUTO_POSITION' => 1, 'MASTER_CONNECT_RETRY' => 1, - 'MAX_QUERIES_PER_HOUR' => 1, 'MAX_UPDATES_PER_HOUR' => 1, - 'MAX_USER_CONNECTIONS' => 1, 'REPLICATE_REWRITE_DB' => 1, - 'REPLICATE_IGNORE_TABLE' => 1, - 'MASTER_HEARTBEAT_PERIOD' => 1, 'REPLICATE_WILD_DO_TABLE' => 1, - 'MAX_CONNECTIONS_PER_HOUR' => 1, - 'REPLICATE_WILD_IGNORE_TABLE' => 1, - - 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, - 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, - 'FOR' => 3, 'GET' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, - 'USE' => 3, 'XOR' => 3, - 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, - 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, - 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, - 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, - 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, - 'WHEN' => 3, 'WITH' => 3, - 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, - 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, - 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, - 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, - 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, - 'WRITE' => 3, - 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, - 'DELETE' => 3, 'ELSEIF' => 3, 'EXISTS' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, - 'HAVING' => 3, 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, - 'REGEXP' => 3, 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, - 'SIGNAL' => 3, 'STORED' => 3, 'UNLOCK' => 3, 'UPDATE' => 3, - 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, - 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, - 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, - 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, 'VIRTUAL' => 3, - 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, - 'ENCLOSED' => 3, 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, - 'RESIGNAL' => 3, 'RESTRICT' => 3, 'SPECIFIC' => 3, 'SQLSTATE' => 3, - 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, 'ZEROFILL' => 3, - 'CONDITION' => 3, 'DATABASES' => 3, 'GENERATED' => 3, 'MIDDLEINT' => 3, - 'PARTITION' => 3, 'PRECISION' => 3, 'PROCEDURE' => 3, 'SENSITIVE' => 3, - 'SEPARATOR' => 3, - 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, - 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, - 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, - 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, - 'MASTER_BIND' => 3, - 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, - 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, - 'STRAIGHT_JOIN' => 3, - 'IO_AFTER_GTIDS' => 3, 'SQL_BIG_RESULT' => 3, - 'DAY_MICROSECOND' => 3, 'IO_BEFORE_GTIDS' => 3, 'OPTIMIZER_COSTS' => 3, - 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, - 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, - 'SQL_CALC_FOUND_ROWS' => 3, - 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, - - 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, - 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, - 'LESS THAN' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, 'ON UPDATE' => 7, - 'UNION ALL' => 7, - 'CROSS JOIN' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, 'LINEAR KEY' => 7, - 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, - 'LINEAR HASH' => 7, - 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, - 'PARTITION BY' => 7, 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, - 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, - 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, - 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, - 'INDEX DIRECTORY' => 7, 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, - 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, - 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, - 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, - 'DEFAULT CHARACTER SET' => 7, - 'NATURAL LEFT OUTER JOIN' => 7, - 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, - - 'BIT' => 9, 'XML' => 9, - 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, - 'ARRAY' => 9, - 'SERIAL' => 9, - 'BOOLEAN' => 9, - 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, - 'MULTILINEPOINT' => 9, - 'MULTILINEPOLYGON' => 9, - - 'INT' => 11, 'SET' => 11, - 'BLOB' => 11, 'REAL' => 11, - 'FLOAT' => 11, - 'BIGINT' => 11, 'BINARY' => 11, 'DOUBLE' => 11, - 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, - 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, - 'TINYTEXT' => 11, - 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, - 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, - - 'BINARY VARYING' => 15, - - 'KEY' => 19, - 'INDEX' => 19, - 'UNIQUE' => 19, - 'SPATIAL' => 19, - 'FULLTEXT' => 19, - - 'INDEX KEY' => 23, - 'UNIQUE KEY' => 23, - 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, - 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, - 'SPATIAL INDEX' => 23, - 'FULLTEXT INDEX' => 23, - - 'X' => 33, 'Y' => 33, - 'LN' => 33, 'PI' => 33, - 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, - 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, - 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, - 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, - 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, - 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, - 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'ST_X' => 33, - 'ST_Y' => 33, 'TRIM' => 33, 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, - 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, - 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, - 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, - 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, - 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, - 'ASTEXT' => 33, 'BIT_OR' => 33, 'BUFFER' => 33, 'CONCAT' => 33, 'DECODE' => 33, - 'ENCODE' => 33, 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, - 'LENGTH' => 33, 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, - 'SECOND' => 33, 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, - 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, - 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, - 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, - 'ISEMPTY' => 33, 'IS_IPV4' => 33, 'IS_IPV6' => 33, 'QUARTER' => 33, 'RADIANS' => 33, - 'REVERSE' => 33, 'SOUNDEX' => 33, 'ST_AREA' => 33, 'ST_SRID' => 33, 'SUBDATE' => 33, - 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, 'VAR_POP' => 33, - 'VERSION' => 33, 'WEEKDAY' => 33, - 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, - 'CONTAINS' => 33, 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, - 'DISJOINT' => 33, 'DISTANCE' => 33, 'ENDPOINT' => 33, 'ENVELOPE' => 33, - 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, 'ISSIMPLE' => 33, - 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, 'MBREQUAL' => 33, - 'OVERLAPS' => 33, 'PASSWORD' => 33, 'POSITION' => 33, 'ST_ASWKB' => 33, - 'ST_ASWKT' => 33, 'ST_UNION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, - 'VARIANCE' => 33, 'VAR_SAMP' => 33, 'YEARWEEK' => 33, - 'ANY_VALUE' => 33, 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, - 'CONCAT_WS' => 33, 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, - 'FROM_DAYS' => 33, 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, - 'LOAD_FILE' => 33, 'MBRCOVERS' => 33, 'MBREQUALS' => 33, 'MBRWITHIN' => 33, - 'MONTHNAME' => 33, 'NUMPOINTS' => 33, 'ROW_COUNT' => 33, 'ST_ASTEXT' => 33, - 'ST_BUFFER' => 33, 'ST_EQUALS' => 33, 'ST_LENGTH' => 33, 'ST_POINTN' => 33, - 'ST_WITHIN' => 33, 'SUBSTRING' => 33, 'TO_BASE64' => 33, 'UPDATEXML' => 33, - 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'CONVEXHULL' => 33, 'DAYOFMONTH' => 33, - 'EXPORT_SET' => 33, 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INET6_ATON' => 33, - 'INET6_NTOA' => 33, 'INTERSECTS' => 33, 'MBRTOUCHES' => 33, 'MULTIPOINT' => 33, - 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, 'STDDEV_POP' => 33, - 'ST_CROSSES' => 33, 'ST_GEOHASH' => 33, 'ST_ISEMPTY' => 33, 'ST_ISVALID' => 33, - 'ST_TOUCHES' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, 'UUID_SHORT' => 33, - 'WEEKOFYEAR' => 33, - 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, - 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'FROM_BASE64' => 33, - 'GEOMFROMWKB' => 33, 'GTID_SUBSET' => 33, 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, - 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, - 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, - 'ST_ASBINARY' => 33, 'ST_CENTROID' => 33, 'ST_CONTAINS' => 33, 'ST_DISJOINT' => 33, - 'ST_DISTANCE' => 33, 'ST_ENDPOINT' => 33, 'ST_ENVELOPE' => 33, 'ST_ISCLOSED' => 33, - 'ST_ISSIMPLE' => 33, 'ST_OVERLAPS' => 33, 'ST_SIMPLIFY' => 33, 'ST_VALIDATE' => 33, - 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, 'TIME_TO_SEC' => 33, - 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, - 'GEOMETRYTYPE' => 33, 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, - 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, 'LINEFROMTEXT' => 33, - 'MBRCOVEREDBY' => 33, 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, - 'MULTIPOLYGON' => 33, 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, - 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, 'RANDOM_BYTES' => 33, - 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'ST_ASGEOJSON' => 33, - 'ST_DIMENSION' => 33, 'ST_GEOMETRYN' => 33, 'ST_NUMPOINTS' => 33, - 'TIMESTAMPADD' => 33, - 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'GTID_SUBTRACT' => 33, - 'INTERIORRINGN' => 33, 'MBRINTERSECTS' => 33, 'MLINEFROMTEXT' => 33, - 'MPOINTFROMWKB' => 33, 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, - 'POINTFROMTEXT' => 33, 'ST_CONVEXHULL' => 33, 'ST_DIFFERENCE' => 33, - 'ST_INTERSECTS' => 33, 'ST_STARTPOINT' => 33, 'TIMESTAMPDIFF' => 33, - 'WEIGHT_STRING' => 33, - 'IS_IPV4_COMPAT' => 33, 'IS_IPV4_MAPPED' => 33, 'LAST_INSERT_ID' => 33, - 'MPOINTFROMTEXT' => 33, 'POLYGONFROMWKB' => 33, 'ST_GEOMFROMWKB' => 33, - 'ST_LINEFROMWKB' => 33, 'ST_POLYFROMWKB' => 33, 'UNIX_TIMESTAMP' => 33, - 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, - 'ST_EXTERIORRING' => 33, 'ST_GEOMETRYTYPE' => 33, 'ST_GEOMFROMTEXT' => 33, - 'ST_INTERSECTION' => 33, 'ST_LINEFROMTEXT' => 33, 'ST_MAKEENVELOPE' => 33, - 'ST_MLINEFROMWKB' => 33, 'ST_MPOLYFROMWKB' => 33, 'ST_POINTFROMWKB' => 33, - 'ST_POLYFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, - 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, - 'NUMINTERIORRINGS' => 33, 'ST_INTERIORRINGN' => 33, 'ST_MLINEFROMTEXT' => 33, - 'ST_MPOINTFROMWKB' => 33, 'ST_MPOLYFROMTEXT' => 33, 'ST_NUMGEOMETRIES' => 33, - 'ST_POINTFROMTEXT' => 33, 'ST_SYMDIFFERENCE' => 33, - 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, 'RELEASE_ALL_LOCKS' => 33, - 'ST_LATFROMGEOHASH' => 33, 'ST_MPOINTFROMTEXT' => 33, 'ST_POLYGONFROMWKB' => 33, - 'MULTIPOINTFROMTEXT' => 33, 'ST_BUFFER_STRATEGY' => 33, 'ST_DISTANCE_SPHERE' => 33, - 'ST_GEOMCOLLFROMTXT' => 33, 'ST_GEOMCOLLFROMWKB' => 33, 'ST_GEOMFROMGEOJSON' => 33, - 'ST_LONGFROMGEOHASH' => 33, 'ST_POLYGONFROMTEXT' => 33, - 'MULTIPOLYGONFROMWKB' => 33, 'ST_GEOMCOLLFROMTEXT' => 33, 'ST_GEOMETRYFROMTEXT' => 33, - 'ST_NUMINTERIORRINGS' => 33, 'ST_POINTFROMGEOHASH' => 33, 'UNCOMPRESSED_LENGTH' => 33, - 'MULTIPOLYGONFROMTEXT' => 33, 'ST_LINESTRINGFROMWKB' => 33, - 'ST_MULTIPOINTFROMWKB' => 33, - 'ST_MULTIPOINTFROMTEXT' => 33, - 'MULTILINESTRINGFROMWKB' => 33, 'ST_MULTIPOLYGONFROMWKB' => 33, - 'MULTILINESTRINGFROMTEXT' => 33, 'ST_MULTIPOLYGONFROMTEXT' => 33, - 'GEOMETRYCOLLECTIONFROMWKB' => 33, 'ST_MULTILINESTRINGFROMWKB' => 33, - 'GEOMETRYCOLLECTIONFROMTEXT' => 33, 'ST_MULTILINESTRINGFROMTEXT' => 33, - 'VALIDATE_PASSWORD_STRENGTH' => 33, 'WAIT_FOR_EXECUTED_GTID_SET' => 33, - 'ST_GEOMETRYCOLLECTIONFROMWKB' => 33, - 'ST_GEOMETRYCOLLECTIONFROMTEXT' => 33, - 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS' => 33, - - 'IF' => 35, 'IN' => 35, - 'MOD' => 35, - 'LEFT' => 35, - 'MATCH' => 35, 'RIGHT' => 35, - 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, - 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, - 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, - 'LOCALTIME' => 35, - 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, - 'UTC_TIMESTAMP' => 35, - 'LOCALTIMESTAMP' => 35, - 'CURRENT_TIMESTAMP' => 35, - - 'NOT IN' => 39, - - 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, - 'POINT' => 41, - 'POLYGON' => 41, - 'TIMESTAMP' => 41, - 'LINESTRING' => 41, - 'MULTILINESTRING' => 41, - 'GEOMETRYCOLLECTION' => 41, - - 'CHAR' => 43, - 'INTERVAL' => 43, - - ); -} diff --git a/#pma/libraries/sql-parser/src/Exceptions/LexerException.php b/#pma/libraries/sql-parser/src/Exceptions/LexerException.php deleted file mode 100644 index 2dd30412..00000000 --- a/#pma/libraries/sql-parser/src/Exceptions/LexerException.php +++ /dev/null @@ -1,50 +0,0 @@ -ch = $ch; - $this->pos = $pos; - } -} diff --git a/#pma/libraries/sql-parser/src/Exceptions/ParserException.php b/#pma/libraries/sql-parser/src/Exceptions/ParserException.php deleted file mode 100644 index 81f62593..00000000 --- a/#pma/libraries/sql-parser/src/Exceptions/ParserException.php +++ /dev/null @@ -1,43 +0,0 @@ -token = $token; - } -} diff --git a/#pma/libraries/sql-parser/src/Lexer.php b/#pma/libraries/sql-parser/src/Lexer.php deleted file mode 100644 index 9de2a7ab..00000000 --- a/#pma/libraries/sql-parser/src/Lexer.php +++ /dev/null @@ -1,930 +0,0 @@ -list; - } - - /** - * Constructor. - * - * @param string|UtfString $str The query to be lexed. - * @param bool $strict Whether strict mode should be - * enabled or not. - * @param string $delimiter The delimiter to be used. - */ - public function __construct($str, $strict = false, $delimiter = null) - { - // `strlen` is used instead of `mb_strlen` because the lexer needs to - // parse each byte of the input. - $len = ($str instanceof UtfString) ? $str->length() : strlen($str); - - // For multi-byte strings, a new instance of `UtfString` is - // initialized (only if `UtfString` usage is forced. - if (!($str instanceof UtfString)) { - if ((USE_UTF_STRINGS) && ($len !== mb_strlen($str, 'UTF-8'))) { - $str = new UtfString($str); - } - } - - $this->str = $str; - $this->len = ($str instanceof UtfString) ? $str->length() : $len; - - $this->strict = $strict; - - // Setting the delimiter. - $this->setDelimiter( - !empty($delimiter) ? $delimiter : static::$DEFAULT_DELIMITER - ); - - $this->lex(); - } - - /** - * Sets the delimiter. - * - * @param string $delimiter The new delimiter. - */ - public function setDelimiter($delimiter) - { - $this->delimiter = $delimiter; - $this->delimiterLen = strlen($delimiter); - } - - /** - * Parses the string and extracts lexemes. - * - * @return void - */ - public function lex() - { - // TODO: Sometimes, static::parse* functions make unnecessary calls to - // is* functions. For a better performance, some rules can be deduced - // from context. - // For example, in `parseBool` there is no need to compare the token - // every time with `true` and `false`. The first step would be to - // compare with 'true' only and just after that add another letter from - // context and compare again with `false`. - // Another example is `parseComment`. - - $list = new TokensList(); - - /** - * Last processed token. - * - * @var Token $lastToken - */ - $lastToken = null; - - for ($this->last = 0, $lastIdx = 0; $this->last < $this->len; $lastIdx = ++$this->last) { - /** - * The new token. - * - * @var Token $token - */ - $token = null; - - foreach (static::$PARSER_METHODS as $method) { - if (($token = $this->$method())) { - break; - } - } - - if ($token === null) { - // @assert($this->last === $lastIdx); - $token = new Token($this->str[$this->last]); - $this->error( - __('Unexpected character.'), - $this->str[$this->last], - $this->last - ); - } elseif (($lastToken !== null) - && ($token->type === Token::TYPE_SYMBOL) - && ($token->flags & Token::FLAG_SYMBOL_VARIABLE) - && (($lastToken->type === Token::TYPE_STRING) - || (($lastToken->type === Token::TYPE_SYMBOL) - && ($lastToken->flags & Token::FLAG_SYMBOL_BACKTICK))) - ) { - // Handles ```... FROM 'user'@'%' ...```. - $lastToken->token .= $token->token; - $lastToken->type = Token::TYPE_SYMBOL; - $lastToken->flags = Token::FLAG_SYMBOL_USER; - $lastToken->value .= '@' . $token->value; - continue; - } elseif (($lastToken !== null) - && ($token->type === Token::TYPE_KEYWORD) - && ($lastToken->type === Token::TYPE_OPERATOR) - && ($lastToken->value === '.') - ) { - // Handles ```... tbl.FROM ...```. In this case, FROM is not - // a reserved word. - $token->type = Token::TYPE_NONE; - $token->flags = 0; - $token->value = $token->token; - } - - $token->position = $lastIdx; - - $list->tokens[$list->count++] = $token; - - // Handling delimiters. - if (($token->type === Token::TYPE_NONE) && ($token->value === 'DELIMITER')) { - if ($this->last + 1 >= $this->len) { - $this->error( - __('Expected whitespace(s) before delimiter.'), - '', - $this->last + 1 - ); - continue; - } - - // Skipping last R (from `delimiteR`) and whitespaces between - // the keyword `DELIMITER` and the actual delimiter. - $pos = ++$this->last; - if (($token = $this->parseWhitespace()) !== null) { - $token->position = $pos; - $list->tokens[$list->count++] = $token; - } - - // Preparing the token that holds the new delimiter. - if ($this->last + 1 >= $this->len) { - $this->error( - __('Expected delimiter.'), - '', - $this->last + 1 - ); - continue; - } - $pos = $this->last + 1; - - // Parsing the delimiter. - $this->delimiter = null; - while ((++$this->last < $this->len) && (!Context::isWhitespace($this->str[$this->last]))) { - $this->delimiter .= $this->str[$this->last]; - } - - if (empty($this->delimiter)) { - $this->error( - __('Expected delimiter.'), - '', - $this->last - ); - $this->delimiter = ';'; - } - - --$this->last; - - // Saving the delimiter and its token. - $this->delimiterLen = strlen($this->delimiter); - $token = new Token($this->delimiter, Token::TYPE_DELIMITER); - $token->position = $pos; - $list->tokens[$list->count++] = $token; - } - - $lastToken = $token; - } - - // Adding a final delimiter to mark the ending. - $list->tokens[$list->count++] = new Token(null, Token::TYPE_DELIMITER); - - // Saving the tokens list. - $this->list = $list; - } - - /** - * Creates a new error log. - * - * @param string $msg The error message. - * @param string $str The character that produced the error. - * @param int $pos The position of the character. - * @param int $code The code of the error. - * - * @throws LexerException Throws the exception, if strict mode is enabled. - * - * @return void - */ - public function error($msg = '', $str = '', $pos = 0, $code = 0) - { - $error = new LexerException($msg, $str, $pos, $code); - if ($this->strict) { - throw $error; - } - $this->errors[] = $error; - } - - /** - * Parses a keyword. - * - * @return Token - */ - public function parseKeyword() - { - $token = ''; - - /** - * Value to be returned. - * - * @var Token $ret - */ - $ret = null; - - /** - * The value of `$this->last` where `$token` ends in `$this->str`. - * - * @var int $iEnd - */ - $iEnd = $this->last; - - /** - * Whether last parsed character is a whitespace. - * - * @var bool $lastSpace - */ - $lastSpace = false; - - for ($j = 1; $j < Context::KEYWORD_MAX_LENGTH && $this->last < $this->len; ++$j, ++$this->last) { - // Composed keywords shouldn't have more than one whitespace between - // keywords. - if (Context::isWhitespace($this->str[$this->last])) { - if ($lastSpace) { - --$j; // The size of the keyword didn't increase. - continue; - } else { - $lastSpace = true; - } - } else { - $lastSpace = false; - } - $token .= $this->str[$this->last]; - if (($this->last + 1 === $this->len) || (Context::isSeparator($this->str[$this->last + 1]))) { - if (($flags = Context::isKeyword($token))) { - $ret = new Token($token, Token::TYPE_KEYWORD, $flags); - $iEnd = $this->last; - - // We don't break so we find longest keyword. - // For example, `OR` and `ORDER` have a common prefix `OR`. - // If we stopped at `OR`, the parsing would be invalid. - } - } - } - - $this->last = $iEnd; - return $ret; - } - - /** - * Parses a label. - * - * @return Token - */ - public function parseLabel() - { - $token = ''; - - /** - * Value to be returned. - * - * @var Token $ret - */ - $ret = null; - - /** - * The value of `$this->last` where `$token` ends in `$this->str`. - * - * @var int $iEnd - */ - $iEnd = $this->last; - - /** - * Whether last parsed character is a whitespace. - * - * @var bool $lastSpace - */ - $lastSpace = false; - - for ($j = 1; $j < Context::LABEL_MAX_LENGTH && $this->last < $this->len; ++$j, ++$this->last) { - // Composed keywords shouldn't have more than one whitespace between - // keywords. - if (Context::isWhitespace($this->str[$this->last])) { - if ($lastSpace) { - --$j; // The size of the keyword didn't increase. - continue; - } else { - $lastSpace = true; - } - } elseif ($this->str[$this->last] === ':') { - $token .= $this->str[$this->last]; - $ret = new Token($token, Token::TYPE_LABEL); - $iEnd = $this->last; - break; - } else { - $lastSpace = false; - } - $token .= $this->str[$this->last]; - } - - $this->last = $iEnd; - return $ret; - } - - /** - * Parses an operator. - * - * @return Token - */ - public function parseOperator() - { - $token = ''; - - /** - * Value to be returned. - * - * @var Token $ret - */ - $ret = null; - - /** - * The value of `$this->last` where `$token` ends in `$this->str`. - * - * @var int $iEnd - */ - $iEnd = $this->last; - - for ($j = 1; $j < Context::OPERATOR_MAX_LENGTH && $this->last < $this->len; ++$j, ++$this->last) { - $token .= $this->str[$this->last]; - if ($flags = Context::isOperator($token)) { - $ret = new Token($token, Token::TYPE_OPERATOR, $flags); - $iEnd = $this->last; - } - } - - $this->last = $iEnd; - return $ret; - } - - /** - * Parses a whitespace. - * - * @return Token - */ - public function parseWhitespace() - { - $token = $this->str[$this->last]; - - if (!Context::isWhitespace($token)) { - return null; - } - - while ((++$this->last < $this->len) && (Context::isWhitespace($this->str[$this->last]))) { - $token .= $this->str[$this->last]; - } - - --$this->last; - return new Token($token, Token::TYPE_WHITESPACE); - } - - /** - * Parses a comment. - * - * @return Token - */ - public function parseComment() - { - $iBak = $this->last; - $token = $this->str[$this->last]; - - // Bash style comments. (#comment\n) - if (Context::isComment($token)) { - while ((++$this->last < $this->len) && ($this->str[$this->last] !== "\n")) { - $token .= $this->str[$this->last]; - } - $token .= "\n"; // Adding the line ending. - return new Token($token, Token::TYPE_COMMENT, Token::FLAG_COMMENT_BASH); - } - - // C style comments. (/*comment*\/) - if (++$this->last < $this->len) { - $token .= $this->str[$this->last]; - if (Context::isComment($token)) { - $flags = Token::FLAG_COMMENT_C; - - // This comment already ended. It may be a part of a - // previous MySQL specific command. - if ($token === '*/') { - return new Token($token, Token::TYPE_COMMENT, $flags); - } - - // Checking if this is a MySQL-specific command. - if (($this->last + 1 < $this->len) && ($this->str[$this->last + 1] === '!')) { - $flags |= Token::FLAG_COMMENT_MYSQL_CMD; - $token .= $this->str[++$this->last]; - - while ((++$this->last < $this->len) - && ('0' <= $this->str[$this->last]) - && ($this->str[$this->last] <= '9') - ) { - $token .= $this->str[$this->last]; - } - --$this->last; - - // We split this comment and parse only its beginning - // here. - return new Token($token, Token::TYPE_COMMENT, $flags); - } - - // Parsing the comment. - while ((++$this->last < $this->len) - && (($this->str[$this->last - 1] !== '*') || ($this->str[$this->last] !== '/')) - ) { - $token .= $this->str[$this->last]; - } - - // Adding the ending. - if ($this->last < $this->len) { - $token .= $this->str[$this->last]; - } - return new Token($token, Token::TYPE_COMMENT, $flags); - } - } - - // SQL style comments. (-- comment\n) - if (++$this->last < $this->len) { - $token .= $this->str[$this->last]; - if (Context::isComment($token)) { - // Checking if this comment did not end already (```--\n```). - if ($this->str[$this->last] !== "\n") { - while ((++$this->last < $this->len) && ($this->str[$this->last] !== "\n")) { - $token .= $this->str[$this->last]; - } - $token .= "\n"; // Adding the line ending. - } - return new Token($token, Token::TYPE_COMMENT, Token::FLAG_COMMENT_SQL); - } - } - - $this->last = $iBak; - return null; - } - - /** - * Parses a boolean. - * - * @return Token - */ - public function parseBool() - { - if ($this->last + 3 >= $this->len) { - // At least `min(strlen('TRUE'), strlen('FALSE'))` characters are - // required. - return null; - } - - $iBak = $this->last; - $token = $this->str[$this->last] . $this->str[++$this->last] - . $this->str[++$this->last] . $this->str[++$this->last]; // _TRUE_ or _FALS_e - - if (Context::isBool($token)) { - return new Token($token, Token::TYPE_BOOL); - } elseif (++$this->last < $this->len) { - $token .= $this->str[$this->last]; // fals_E_ - if (Context::isBool($token)) { - return new Token($token, Token::TYPE_BOOL, 1); - } - } - - $this->last = $iBak; - return null; - } - - /** - * Parses a number. - * - * @return Token - */ - public function parseNumber() - { - // A rudimentary state machine is being used to parse numbers due to - // the various forms of their notation. - // - // Below are the states of the machines and the conditions to change - // the state. - // - // 1 --------------------[ + or - ]-------------------> 1 - // 1 -------------------[ 0x or 0X ]------------------> 2 - // 1 --------------------[ 0 to 9 ]-------------------> 3 - // 1 -----------------------[ . ]---------------------> 4 - // 1 -----------------------[ b ]---------------------> 7 - // - // 2 --------------------[ 0 to F ]-------------------> 2 - // - // 3 --------------------[ 0 to 9 ]-------------------> 3 - // 3 -----------------------[ . ]---------------------> 4 - // 3 --------------------[ e or E ]-------------------> 5 - // - // 4 --------------------[ 0 to 9 ]-------------------> 4 - // 4 --------------------[ e or E ]-------------------> 5 - // - // 5 ---------------[ + or - or 0 to 9 ]--------------> 6 - // - // 7 -----------------------[ ' ]---------------------> 8 - // - // 8 --------------------[ 0 or 1 ]-------------------> 8 - // 8 -----------------------[ ' ]---------------------> 9 - // - // State 1 may be reached by negative numbers. - // State 2 is reached only by hex numbers. - // State 4 is reached only by float numbers. - // State 5 is reached only by numbers in approximate form. - // State 7 is reached only by numbers in bit representation. - // - // Valid final states are: 2, 3, 4 and 6. Any parsing that finished in a - // state other than these is invalid. - $iBak = $this->last; - $token = ''; - $flags = 0; - $state = 1; - for (; $this->last < $this->len; ++$this->last) { - if ($state === 1) { - if ($this->str[$this->last] === '-') { - $flags |= Token::FLAG_NUMBER_NEGATIVE; - } elseif (($this->last + 1 < $this->len) - && ($this->str[$this->last] === '0') - && (($this->str[$this->last + 1] === 'x') - || ($this->str[$this->last + 1] === 'X')) - ) { - $token .= $this->str[$this->last++]; - $state = 2; - } elseif (($this->str[$this->last] >= '0') && ($this->str[$this->last] <= '9')) { - $state = 3; - } elseif ($this->str[$this->last] === '.') { - $state = 4; - } elseif ($this->str[$this->last] === 'b') { - $state = 7; - } elseif ($this->str[$this->last] !== '+') { - // `+` is a valid character in a number. - break; - } - } elseif ($state === 2) { - $flags |= Token::FLAG_NUMBER_HEX; - if (!((($this->str[$this->last] >= '0') && ($this->str[$this->last] <= '9')) - || (($this->str[$this->last] >= 'A') && ($this->str[$this->last] <= 'F')) - || (($this->str[$this->last] >= 'a') && ($this->str[$this->last] <= 'f'))) - ) { - break; - } - } elseif ($state === 3) { - if ($this->str[$this->last] === '.') { - $state = 4; - } elseif (($this->str[$this->last] === 'e') || ($this->str[$this->last] === 'E')) { - $state = 5; - } elseif (($this->str[$this->last] < '0') || ($this->str[$this->last] > '9')) { - // Just digits and `.`, `e` and `E` are valid characters. - break; - } - } elseif ($state === 4) { - $flags |= Token::FLAG_NUMBER_FLOAT; - if (($this->str[$this->last] === 'e') || ($this->str[$this->last] === 'E')) { - $state = 5; - } elseif (($this->str[$this->last] < '0') || ($this->str[$this->last] > '9')) { - // Just digits, `e` and `E` are valid characters. - break; - } - } elseif ($state === 5) { - $flags |= Token::FLAG_NUMBER_APPROXIMATE; - if (($this->str[$this->last] === '+') || ($this->str[$this->last] === '-') - || ((($this->str[$this->last] >= '0') && ($this->str[$this->last] <= '9'))) - ) { - $state = 6; - } else { - break; - } - } elseif ($state === 6) { - if (($this->str[$this->last] < '0') || ($this->str[$this->last] > '9')) { - // Just digits are valid characters. - break; - } - } elseif ($state === 7) { - $flags |= Token::FLAG_NUMBER_BINARY; - if ($this->str[$this->last] === '\'') { - $state = 8; - } else { - break; - } - } elseif ($state === 8) { - if ($this->str[$this->last] === '\'') { - $state = 9; - } elseif (($this->str[$this->last] !== '0') - && ($this->str[$this->last] !== '1') - ) { - break; - } - } elseif ($state === 9) { - break; - } - $token .= $this->str[$this->last]; - } - if (($state === 2) || ($state === 3) - || (($token !== '.') && ($state === 4)) - || ($state === 6) || ($state === 9) - ) { - --$this->last; - return new Token($token, Token::TYPE_NUMBER, $flags); - } - $this->last = $iBak; - return null; - } - - /** - * Parses a string. - * - * @param string $quote Additional starting symbol. - * - * @return Token - */ - public function parseString($quote = '') - { - $token = $this->str[$this->last]; - if ((!($flags = Context::isString($token))) && ($token !== $quote)) { - return null; - } - $quote = $token; - - while (++$this->last < $this->len) { - if (($this->last + 1 < $this->len) - && ((($this->str[$this->last] === $quote) && ($this->str[$this->last + 1] === $quote)) - || (($this->str[$this->last] === '\\') && ($quote !== '`'))) - ) { - $token .= $this->str[$this->last] . $this->str[++$this->last]; - } else { - if ($this->str[$this->last] === $quote) { - break; - } - $token .= $this->str[$this->last]; - } - } - - if (($this->last >= $this->len) || ($this->str[$this->last] !== $quote)) { - $this->error( - sprintf( - __('Ending quote %1$s was expected.'), - $quote - ), - '', - $this->last - ); - } else { - $token .= $this->str[$this->last]; - } - return new Token($token, Token::TYPE_STRING, $flags); - } - - /** - * Parses a symbol. - * - * @return Token - */ - public function parseSymbol() - { - $token = $this->str[$this->last]; - if (!($flags = Context::isSymbol($token))) { - return null; - } - - if ($flags & Token::FLAG_SYMBOL_VARIABLE) { - if ($this->str[++$this->last] === '@') { - // This is a system variable (e.g. `@@hostname`). - $token .= $this->str[$this->last++]; - $flags |= Token::FLAG_SYMBOL_SYSTEM; - } - } else { - $token = ''; - } - - $str = null; - - if ($this->last < $this->len) { - if (($str = $this->parseString('`')) === null) { - if (($str = static::parseUnknown()) === null) { - $this->error( - __('Variable name was expected.'), - $this->str[$this->last], - $this->last - ); - } - } - } - - if ($str !== null) { - $token .= $str->token; - } - - return new Token($token, Token::TYPE_SYMBOL, $flags); - } - - /** - * Parses unknown parts of the query. - * - * @return Token - */ - public function parseUnknown() - { - $token = $this->str[$this->last]; - if (Context::isSeparator($token)) { - return null; - } - while ((++$this->last < $this->len) && (!Context::isSeparator($this->str[$this->last]))) { - $token .= $this->str[$this->last]; - } - --$this->last; - return new Token($token); - } - - /** - * Parses the delimiter of the query. - * - * @return Token - */ - public function parseDelimiter() - { - $idx = 0; - - while (($idx < $this->delimiterLen) && ($this->last + $idx < $this->len)) { - if ($this->delimiter[$idx] !== $this->str[$this->last + $idx]) { - return null; - } - ++$idx; - } - - $this->last += $this->delimiterLen - 1; - return new Token($this->delimiter, Token::TYPE_DELIMITER); - } -} diff --git a/#pma/libraries/sql-parser/src/Parser.php b/#pma/libraries/sql-parser/src/Parser.php deleted file mode 100644 index ddefc7ee..00000000 --- a/#pma/libraries/sql-parser/src/Parser.php +++ /dev/null @@ -1,607 +0,0 @@ - 'SqlParser\\Statements\\ExplainStatement', - 'DESC' => 'SqlParser\\Statements\\ExplainStatement', - 'EXPLAIN' => 'SqlParser\\Statements\\ExplainStatement', - 'FLUSH' => '', - 'GRANT' => '', - 'HELP' => '', - 'SET PASSWORD' => '', - 'STATUS' => '', - 'USE' => '', - - // Table Maintenance Statements - // https://dev.mysql.com/doc/refman/5.7/en/table-maintenance-sql.html - 'ANALYZE' => 'SqlParser\\Statements\\AnalyzeStatement', - 'BACKUP' => 'SqlParser\\Statements\\BackupStatement', - 'CHECK' => 'SqlParser\\Statements\\CheckStatement', - 'CHECKSUM' => 'SqlParser\\Statements\\ChecksumStatement', - 'OPTIMIZE' => 'SqlParser\\Statements\\OptimizeStatement', - 'REPAIR' => 'SqlParser\\Statements\\RepairStatement', - 'RESTORE' => 'SqlParser\\Statements\\RestoreStatement', - - // Database Administration Statements - // https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-server-administration.html - 'SET' => 'SqlParser\\Statements\\SetStatement', - 'SHOW' => 'SqlParser\\Statements\\ShowStatement', - - // Data Definition Statements. - // https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-data-definition.html - 'ALTER' => 'SqlParser\\Statements\\AlterStatement', - 'CREATE' => 'SqlParser\\Statements\\CreateStatement', - 'DROP' => 'SqlParser\\Statements\\DropStatement', - 'RENAME' => 'SqlParser\\Statements\\RenameStatement', - 'TRUNCATE' => 'SqlParser\\Statements\\TruncateStatement', - - // Data Manipulation Statements. - // https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-data-manipulation.html - 'CALL' => 'SqlParser\\Statements\\CallStatement', - 'DELETE' => 'SqlParser\\Statements\\DeleteStatement', - 'DO' => '', - 'HANDLER' => '', - 'INSERT' => 'SqlParser\\Statements\\InsertStatement', - 'LOAD' => '', - 'REPLACE' => 'SqlParser\\Statements\\ReplaceStatement', - 'SELECT' => 'SqlParser\\Statements\\SelectStatement', - 'UPDATE' => 'SqlParser\\Statements\\UpdateStatement', - - // Prepared Statements. - // https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-prepared-statements.html - 'DEALLOCATE' => '', - 'EXECUTE' => '', - 'PREPARE' => '', - - // Transactional and Locking Statements - // https://dev.mysql.com/doc/refman/5.7/en/commit.html - 'BEGIN' => 'SqlParser\\Statements\\TransactionStatement', - 'COMMIT' => 'SqlParser\\Statements\\TransactionStatement', - 'ROLLBACK' => 'SqlParser\\Statements\\TransactionStatement', - 'START TRANSACTION' => 'SqlParser\\Statements\\TransactionStatement', - ); - - /** - * Array of classes that are used in parsing SQL components. - * - * @var array - */ - public static $KEYWORD_PARSERS = array( - - // This is not a proper keyword and was added here to help the - // formatter. - 'PARTITION BY' => array(), - 'SUBPARTITION BY' => array(), - - // This is not a proper keyword and was added here to help the - // builder. - '_OPTIONS' => array( - 'class' => 'SqlParser\\Components\\OptionsArray', - 'field' => 'options', - ), - '_END_OPTIONS' => array( - 'class' => 'SqlParser\\Components\\OptionsArray', - 'field' => 'end_options', - ), - - - 'UNION' => array( - 'class' => 'SqlParser\\Components\\UnionKeyword', - 'field' => 'union', - ), - 'UNION ALL' => array( - 'class' => 'SqlParser\\Components\\UnionKeyword', - 'field' => 'union', - ), - 'UNION DISTINCT' => array( - 'class' => 'SqlParser\\Components\\UnionKeyword', - 'field' => 'union', - ), - - // Actual clause parsers. - 'ALTER' => array( - 'class' => 'SqlParser\\Components\\Expression', - 'field' => 'table', - 'options' => array('parseField' => 'table'), - ), - 'ANALYZE' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'tables', - 'options' => array('parseField' => 'table'), - ), - 'BACKUP' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'tables', - 'options' => array('parseField' => 'table'), - ), - 'CALL' => array( - 'class' => 'SqlParser\\Components\\FunctionCall', - 'field' => 'call', - ), - 'CHECK' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'tables', - 'options' => array('parseField' => 'table'), - ), - 'CHECKSUM' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'tables', - 'options' => array('parseField' => 'table'), - ), - 'CROSS JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'DROP' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'fields', - 'options' => array('parseField' => 'table'), - ), - 'FROM' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'from', - 'options' => array('field' => 'table'), - ), - 'GROUP BY' => array( - 'class' => 'SqlParser\\Components\\OrderKeyword', - 'field' => 'group', - ), - 'HAVING' => array( - 'class' => 'SqlParser\\Components\\Condition', - 'field' => 'having', - ), - 'INTO' => array( - 'class' => 'SqlParser\\Components\\IntoKeyword', - 'field' => 'into', - ), - 'JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'LEFT JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'LEFT OUTER JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'ON' => array( - 'class' => 'SqlParser\\Components\\Expression', - 'field' => 'table', - 'options' => array('parseField' => 'table'), - ), - 'RIGHT JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'RIGHT OUTER JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'INNER JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'FULL JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'FULL OUTER JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'NATURAL JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'NATURAL LEFT JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'NATURAL RIGHT JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'NATURAL LEFT OUTER JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'NATURAL RIGHT OUTER JOIN' => array( - 'class' => 'SqlParser\\Components\\JoinKeyword', - 'field' => 'join', - ), - 'LIMIT' => array( - 'class' => 'SqlParser\\Components\\Limit', - 'field' => 'limit', - ), - 'OPTIMIZE' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'tables', - 'options' => array('parseField' => 'table'), - ), - 'ORDER BY' => array( - 'class' => 'SqlParser\\Components\\OrderKeyword', - 'field' => 'order', - ), - 'PARTITION' => array( - 'class' => 'SqlParser\\Components\\ArrayObj', - 'field' => 'partition', - ), - 'PROCEDURE' => array( - 'class' => 'SqlParser\\Components\\FunctionCall', - 'field' => 'procedure', - ), - 'RENAME' => array( - 'class' => 'SqlParser\\Components\\RenameOperation', - 'field' => 'renames', - ), - 'REPAIR' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'tables', - 'options' => array('parseField' => 'table'), - ), - 'RESTORE' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'tables', - 'options' => array('parseField' => 'table'), - ), - 'SET' => array( - 'class' => 'SqlParser\\Components\\SetOperation', - 'field' => 'set', - ), - 'SELECT' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'expr', - ), - 'TRUNCATE' => array( - 'class' => 'SqlParser\\Components\\Expression', - 'field' => 'table', - 'options' => array('parseField' => 'table'), - ), - 'UPDATE' => array( - 'class' => 'SqlParser\\Components\\ExpressionArray', - 'field' => 'tables', - 'options' => array('parseField' => 'table'), - ), - 'VALUE' => array( - 'class' => 'SqlParser\\Components\\Array2d', - 'field' => 'values', - ), - 'VALUES' => array( - 'class' => 'SqlParser\\Components\\Array2d', - 'field' => 'values', - ), - 'WHERE' => array( - 'class' => 'SqlParser\\Components\\Condition', - 'field' => 'where', - ), - - ); - - /** - * The list of tokens that are parsed. - * - * @var TokensList - */ - public $list; - - /** - * Whether errors should throw exceptions or just be stored. - * - * @var bool - * - * @see static::$errors - */ - public $strict = false; - - /** - * List of errors that occurred during parsing. - * - * Usually, the parsing does not stop once an error occurred because that - * error might be a false positive or a partial result (even a bad one) - * might be needed. - * - * @var ParserException[] - * - * @see Parser::error() - */ - public $errors = array(); - - /** - * List of statements parsed. - * - * @var Statement[] - */ - public $statements = array(); - - /** - * The number of opened brackets. - * - * @var int - */ - public $brackets = 0; - - /** - * Constructor. - * - * @param string|UtfString|TokensList $list The list of tokens to be parsed. - * @param bool $strict Whether strict mode should be enabled or not. - */ - public function __construct($list = null, $strict = false) - { - if ((is_string($list)) || ($list instanceof UtfString)) { - $lexer = new Lexer($list, $strict); - $this->list = $lexer->list; - } elseif ($list instanceof TokensList) { - $this->list = $list; - } - - $this->strict = $strict; - - if ($list !== null) { - $this->parse(); - } - } - - /** - * Builds the parse trees. - * - * @return void - */ - public function parse() - { - - /** - * Last transaction. - * - * @var TransactionStatement $lastTransaction - */ - $lastTransaction = null; - - /** - * Last parsed statement. - * - * @var Statement $lastStatement - */ - $lastStatement = null; - - /** - * Union's type or false for no union. - * - * @var bool|string $unionType - */ - $unionType = false; - - /** - * The index of the last token from the last statement. - * - * @var int $prevLastIdx - */ - $prevLastIdx = -1; - - /** - * The list of tokens. - * - * @var TokensList $list - */ - $list = &$this->list; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // `DELIMITER` is not an actual statement and it requires - // special handling. - if (($token->type === Token::TYPE_NONE) - && (strtoupper($token->token) === 'DELIMITER') - ) { - // Skipping to the end of this statement. - $list->getNextOfType(Token::TYPE_DELIMITER); - $prevLastIdx = $list->idx; - continue; - } - - // Counting the brackets around statements. - if ($token->value === '(') { - ++$this->brackets; - continue; - } - - // Statements can start with keywords only. - // Comments, whitespaces, etc. are ignored. - if ($token->type !== Token::TYPE_KEYWORD) { - if (($token->type !== TOKEN::TYPE_COMMENT) - && ($token->type !== Token::TYPE_WHITESPACE) - && ($token->type !== Token::TYPE_OPERATOR) // `(` and `)` - && ($token->type !== Token::TYPE_DELIMITER) - ) { - $this->error( - __('Unexpected beginning of statement.'), - $token - ); - } - continue; - } - - if (($token->value === 'UNION') || ($token->value === 'UNION ALL') || ($token->value === 'UNION DISTINCT')) { - $unionType = $token->value; - continue; - } - - // Checking if it is a known statement that can be parsed. - if (empty(static::$STATEMENT_PARSERS[$token->value])) { - if (!isset(static::$STATEMENT_PARSERS[$token->value])) { - // A statement is considered recognized if the parser - // is aware that it is a statement, but it does not have - // a parser for it yet. - $this->error( - __('Unrecognized statement type.'), - $token - ); - } - // Skipping to the end of this statement. - $list->getNextOfType(Token::TYPE_DELIMITER); - $prevLastIdx = $list->idx; - continue; - } - - /** - * The name of the class that is used for parsing. - * - * @var string $class - */ - $class = static::$STATEMENT_PARSERS[$token->value]; - - /** - * Processed statement. - * - * @var Statement $statement - */ - $statement = new $class($this, $this->list); - - // The first token that is a part of this token is the next token - // unprocessed by the previous statement. - // There might be brackets around statements and this shouldn't - // affect the parser - $statement->first = $prevLastIdx + 1; - - // Storing the index of the last token parsed and updating the old - // index. - $statement->last = $list->idx; - $prevLastIdx = $list->idx; - - // Handles unions. - if ((!empty($unionType)) - && ($lastStatement instanceof SelectStatement) - && ($statement instanceof SelectStatement) - ) { - /** - * This SELECT statement. - * - * @var SelectStatement $statement - */ - - /** - * Last SELECT statement. - * - * @var SelectStatement $lastStatement - */ - $lastStatement->union[] = array($unionType, $statement); - - // if there are no no delimiting brackets, the `ORDER` and - // `LIMIT` keywords actually belong to the first statement. - $lastStatement->order = $statement->order; - $lastStatement->limit = $statement->limit; - $statement->order = array(); - $statement->limit = null; - - // The statement actually ends where the last statement in - // union ends. - $lastStatement->last = $statement->last; - - $unionType = false; - - // Validate clause order - $statement->validateClauseOrder($this, $list); - continue; - } - - // Handles transactions. - if ($statement instanceof TransactionStatement) { - /** - * @var TransactionStatement $statement - */ - if ($statement->type === TransactionStatement::TYPE_BEGIN) { - $lastTransaction = $statement; - $this->statements[] = $statement; - } elseif ($statement->type === TransactionStatement::TYPE_END) { - if ($lastTransaction === null) { - // Even though an error occurred, the query is being - // saved. - $this->statements[] = $statement; - $this->error( - __('No transaction was previously started.'), - $token - ); - } else { - $lastTransaction->end = $statement; - } - $lastTransaction = null; - } - - // Validate clause order - $statement->validateClauseOrder($this, $list); - continue; - } - - // Validate clause order - $statement->validateClauseOrder($this, $list); - - // Finally, storing the statement. - if ($lastTransaction !== null) { - $lastTransaction->statements[] = $statement; - } else { - $this->statements[] = $statement; - } - $lastStatement = $statement; - - } - } - - /** - * Creates a new error log. - * - * @param string $msg The error message. - * @param Token $token The token that produced the error. - * @param int $code The code of the error. - * - * @throws ParserException Throws the exception, if strict mode is enabled. - * - * @return void - */ - public function error($msg = '', Token $token = null, $code = 0) - { - $error = new ParserException($msg, $token, $code); - if ($this->strict) { - throw $error; - } - $this->errors[] = $error; - } -} diff --git a/#pma/libraries/sql-parser/src/Statement.php b/#pma/libraries/sql-parser/src/Statement.php deleted file mode 100644 index e3e5968c..00000000 --- a/#pma/libraries/sql-parser/src/Statement.php +++ /dev/null @@ -1,509 +0,0 @@ -parse($parser, $list); - } - } - - /** - * Builds the string representation of this statement. - * - * @return string - */ - public function build() - { - /** - * Query to be returned. - * - * @var string $query - */ - $query = ''; - - /** - * Clauses which were built already. - * - * It is required to keep track of built clauses because some fields, - * for example `join` is used by multiple clauses (`JOIN`, `LEFT JOIN`, - * `LEFT OUTER JOIN`, etc.). The same happens for `VALUE` and `VALUES`. - * - * A clause is considered built just after fields' value - * (`$this->field`) was used in building. - * - * @var array - */ - $built = array(); - - /** - * Statement's clauses. - * - * @var array - */ - $clauses = $this->getClauses(); - - foreach ($clauses as $clause) { - /** - * The name of the clause. - * - * @var string $name - */ - $name = $clause[0]; - - /** - * The type of the clause. - * - * @see self::$CLAUSES - * @var int $type - */ - $type = $clause[1]; - - /** - * The builder (parser) of this clause. - * - * @var Component $class - */ - $class = Parser::$KEYWORD_PARSERS[$name]['class']; - - /** - * The name of the field that is used as source for the builder. - * Same field is used to store the result of parsing. - * - * @var string $field - */ - $field = Parser::$KEYWORD_PARSERS[$name]['field']; - - // The field is empty, there is nothing to be built. - if (empty($this->$field)) { - continue; - } - - // Checking if this field was already built. - if ($type & 1) { - if (!empty($built[$field])) { - continue; - } - $built[$field] = true; - } - - // Checking if the name of the clause should be added. - if ($type & 2) { - $query .= $name . ' '; - } - - // Checking if the result of the builder should be added. - if ($type & 1) { - $query .= $class::build($this->$field) . ' '; - } - } - - return $query; - } - - /** - * Parses the statements defined by the tokens list. - * - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * - * @return void - */ - public function parse(Parser $parser, TokensList $list) - { - /** - * Array containing all list of clauses parsed. - * This is used to check for duplicates. - * - * @var array $parsedClauses - */ - $parsedClauses = array(); - - // This may be corrected by the parser. - $this->first = $list->idx; - - /** - * Whether options were parsed or not. - * For statements that do not have any options this is set to `true` by - * default. - * - * @var bool $parsedOptions - */ - $parsedOptions = empty(static::$OPTIONS); - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Checking if this closing bracket is the pair for a bracket - // outside the statement. - if (($token->value === ')') && ($parser->brackets > 0)) { - --$parser->brackets; - continue; - } - - // Only keywords are relevant here. Other parts of the query are - // processed in the functions below. - if ($token->type !== Token::TYPE_KEYWORD) { - if (($token->type !== TOKEN::TYPE_COMMENT) - && ($token->type !== Token::TYPE_WHITESPACE) - ) { - $parser->error(__('Unexpected token.'), $token); - } - continue; - } - - // Unions are parsed by the parser because they represent more than - // one statement. - if (($token->value === 'UNION') || ($token->value === 'UNION ALL') || ($token->value === 'UNION DISTINCT')) { - break; - } - - $lastIdx = $list->idx; - - // ON DUPLICATE KEY UPDATE ... - // has to be parsed in parent statement (INSERT or REPLACE) - // so look for it and break - if (get_class($this) === 'SqlParser\Statements\SelectStatement' - && $token->value === 'ON' - ) { - ++$list->idx; // Skip ON - - // look for ON DUPLICATE KEY UPDATE - $first = $list->getNextOfType(Token::TYPE_KEYWORD); - $second = $list->getNextOfType(Token::TYPE_KEYWORD); - $third = $list->getNextOfType(Token::TYPE_KEYWORD); - - if ($first && $second && $third - && $first->value === 'DUPLICATE' - && $second->value === 'KEY' - && $third->value === 'UPDATE' - ) { - $list->idx = $lastIdx; - break; - } - } - $list->idx = $lastIdx; - - /** - * The name of the class that is used for parsing. - * - * @var Component $class - */ - $class = null; - - /** - * The name of the field where the result of the parsing is stored. - * - * @var string $field - */ - $field = null; - - /** - * Parser's options. - * - * @var array $options - */ - $options = array(); - - // Looking for duplicated clauses. - if ((!empty(Parser::$KEYWORD_PARSERS[$token->value])) - || (!empty(Parser::$STATEMENT_PARSERS[$token->value])) - ) { - if (!empty($parsedClauses[$token->value])) { - $parser->error( - __('This type of clause was previously parsed.'), - $token - ); - break; - } - $parsedClauses[$token->value] = true; - } - - // Checking if this is the beginning of a clause. - if (!empty(Parser::$KEYWORD_PARSERS[$token->value])) { - $class = Parser::$KEYWORD_PARSERS[$token->value]['class']; - $field = Parser::$KEYWORD_PARSERS[$token->value]['field']; - if (!empty(Parser::$KEYWORD_PARSERS[$token->value]['options'])) { - $options = Parser::$KEYWORD_PARSERS[$token->value]['options']; - } - } - - // Checking if this is the beginning of the statement. - if (!empty(Parser::$STATEMENT_PARSERS[$token->value])) { - if ((!empty(static::$CLAUSES)) // Undefined for some statements. - && (empty(static::$CLAUSES[$token->value])) - ) { - // Some keywords (e.g. `SET`) may be the beginning of a - // statement and a clause. - // If such keyword was found and it cannot be a clause of - // this statement it means it is a new statement, but no - // delimiter was found between them. - $parser->error( - __('A new statement was found, but no delimiter between it and the previous one.'), - $token - ); - break; - } - if (!$parsedOptions) { - if (empty(static::$OPTIONS[$token->value])) { - // Skipping keyword because if it is not a option. - ++$list->idx; - } - $this->options = OptionsArray::parse( - $parser, - $list, - static::$OPTIONS - ); - $parsedOptions = true; - } - } elseif ($class === null) { - // Handle special end options in Select statement - // See Statements\SelectStatement::$END_OPTIONS - if (get_class($this) === 'SqlParser\Statements\SelectStatement' - && ($token->value === 'FOR UPDATE' - || $token->value === 'LOCK IN SHARE MODE') - ) { - $this->end_options = OptionsArray::parse( - $parser, - $list, - static::$END_OPTIONS - ); - } else { - // There is no parser for this keyword and isn't the beginning - // of a statement (so no options) either. - $parser->error(__('Unrecognized keyword.'), $token); - continue; - } - } - - $this->before($parser, $list, $token); - - // Parsing this keyword. - if ($class !== null) { - ++$list->idx; // Skipping keyword or last option. - $this->$field = $class::parse($parser, $list, $options); - } - - $this->after($parser, $list, $token); - } - - // This may be corrected by the parser. - $this->last = --$list->idx; // Go back to last used token. - } - - /** - * Function called before the token is processed. - * - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * @param Token $token The token that is being parsed. - * - * @return void - */ - public function before(Parser $parser, TokensList $list, Token $token) - { - - } - - /** - * Function called after the token was processed. - * - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * @param Token $token The token that is being parsed. - * - * @return void - */ - public function after(Parser $parser, TokensList $list, Token $token) - { - - } - - /** - * Gets the clauses of this statement. - * - * @return array - */ - public function getClauses() - { - return static::$CLAUSES; - } - - /** - * Builds the string representation of this statement. - * - * @see static::build - * - * @return string - */ - public function __toString() - { - return $this->build(); - } - - /** - * Validates the order of the clauses in parsed statement - * Ideally this should be called after successfully - * completing the parsing of each statement - * - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * - * @return boolean - */ - public function validateClauseOrder($parser, $list) - { - $clauses = array_flip(array_keys($this->getClauses())); - - if (empty($clauses) - || count($clauses) == 0 - ) { - return true; - } - - $minIdx = -1; - - /** - * For tracking JOIN clauses in a query - * 0 - JOIN not found till now - * 1 - JOIN has been found - * 2 - A Non-JOIN clause has been found - * after a previously found JOIN clause - * - * @var int $joinStart - */ - $joinStart = 0; - - $error = 0; - foreach ($clauses as $clauseType => $index) { - $clauseStartIdx = Utils\Query::getClauseStartOffset( - $this, - $list, - $clauseType - ); - - // Handle ordering of Multiple Joins in a query - if ($clauseStartIdx != -1) { - if ($joinStart == 0 && stripos($clauseType, 'JOIN')) { - $joinStart = 1; - } elseif ($joinStart == 1 && ! stripos($clauseType, 'JOIN')) { - $joinStart = 2; - } elseif ($joinStart == 2 && stripos($clauseType, 'JOIN')) { - $error = 1; - } - } - - if ($clauseStartIdx != -1 && $clauseStartIdx < $minIdx) { - if ($joinStart == 0 || ($joinStart == 2 && $error = 1)) { - $token = $list->tokens[$clauseStartIdx]; - $parser->error( - __('Unexpected ordering of clauses.'), - $token - ); - return false; - } else { - $minIdx = $clauseStartIdx; - } - } elseif ($clauseStartIdx != -1) { - $minIdx = $clauseStartIdx; - } - } - - return true; - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/AlterStatement.php b/#pma/libraries/sql-parser/src/Statements/AlterStatement.php deleted file mode 100644 index abad5dad..00000000 --- a/#pma/libraries/sql-parser/src/Statements/AlterStatement.php +++ /dev/null @@ -1,156 +0,0 @@ - 1, - 'OFFLINE' => 1, - 'IGNORE' => 2, - - 'DATABASE' => 3, - 'EVENT' => 3, - 'FUNCTION' => 3, - 'PROCEDURE' => 3, - 'SERVER' => 3, - 'TABLE' => 3, - 'TABLESPACE' => 3, - 'VIEW' => 3, - ); - - /** - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * - * @return void - */ - public function parse(Parser $parser, TokensList $list) - { - ++$list->idx; // Skipping `ALTER`. - $this->options = OptionsArray::parse( - $parser, - $list, - static::$OPTIONS - ); - ++$list->idx; - - // Parsing affected table. - $this->table = Expression::parse( - $parser, - $list, - array( - 'parseField' => 'table', - 'breakOnAlias' => true, - ) - ); - ++$list->idx; // Skipping field. - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 -----------------[ alter operation ]-----------------> 1 - * - * 1 -------------------------[ , ]-----------------------> 0 - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - $options = array(); - if ($this->options->has('DATABASE')) { - $options = AlterOperation::$DB_OPTIONS; - } elseif ($this->options->has('TABLE')) { - $options = AlterOperation::$TABLE_OPTIONS; - } elseif ($this->options->has('VIEW')) { - $options = AlterOperation::$VIEW_OPTIONS; - } - - $this->altered[] = AlterOperation::parse($parser, $list, $options); - $state = 1; - } elseif ($state === 1) { - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === ',')) { - $state = 0; - } - } - } - } - - /** - * @return string - */ - public function build() - { - $tmp = array(); - foreach ($this->altered as $altered) { - $tmp[] = $altered::build($altered); - } - - return 'ALTER ' . OptionsArray::build($this->options) - . ' ' . Expression::build($this->table) - . ' ' . implode(', ', $tmp); - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/AnalyzeStatement.php b/#pma/libraries/sql-parser/src/Statements/AnalyzeStatement.php deleted file mode 100644 index f7e8f816..00000000 --- a/#pma/libraries/sql-parser/src/Statements/AnalyzeStatement.php +++ /dev/null @@ -1,47 +0,0 @@ - 1, - - 'NO_WRITE_TO_BINLOG' => 2, - 'LOCAL' => 3, - ); - - /** - * Analyzed tables. - * - * @var Expression[] - */ - public $tables; -} diff --git a/#pma/libraries/sql-parser/src/Statements/BackupStatement.php b/#pma/libraries/sql-parser/src/Statements/BackupStatement.php deleted file mode 100644 index df759398..00000000 --- a/#pma/libraries/sql-parser/src/Statements/BackupStatement.php +++ /dev/null @@ -1,38 +0,0 @@ - 1, - - 'NO_WRITE_TO_BINLOG' => 2, - 'LOCAL' => 3, - - 'TO' => array(4, 'var'), - ); -} diff --git a/#pma/libraries/sql-parser/src/Statements/CallStatement.php b/#pma/libraries/sql-parser/src/Statements/CallStatement.php deleted file mode 100644 index 42a21d75..00000000 --- a/#pma/libraries/sql-parser/src/Statements/CallStatement.php +++ /dev/null @@ -1,37 +0,0 @@ - 1, - - 'FOR UPGRADE' => 2, - 'QUICK' => 3, - 'FAST' => 4, - 'MEDIUM' => 5, - 'EXTENDED' => 6, - 'CHANGED' => 7, - ); -} diff --git a/#pma/libraries/sql-parser/src/Statements/ChecksumStatement.php b/#pma/libraries/sql-parser/src/Statements/ChecksumStatement.php deleted file mode 100644 index 8b623353..00000000 --- a/#pma/libraries/sql-parser/src/Statements/ChecksumStatement.php +++ /dev/null @@ -1,36 +0,0 @@ - 1, - - 'QUICK' => 2, - 'EXTENDED' => 3, - ); -} diff --git a/#pma/libraries/sql-parser/src/Statements/CreateStatement.php b/#pma/libraries/sql-parser/src/Statements/CreateStatement.php deleted file mode 100644 index ed139523..00000000 --- a/#pma/libraries/sql-parser/src/Statements/CreateStatement.php +++ /dev/null @@ -1,638 +0,0 @@ - 1, - - // CREATE VIEW - 'OR REPLACE' => array(2, 'var='), - 'ALGORITHM' => array(3, 'var='), - // `DEFINER` is also used for `CREATE FUNCTION / PROCEDURE` - 'DEFINER' => array(4, 'expr='), - 'SQL SECURITY' => array(5, 'var'), - - 'DATABASE' => 6, - 'EVENT' => 6, - 'FUNCTION' => 6, - 'INDEX' => 6, - 'UNIQUE INDEX' => 6, - 'FULLTEXT INDEX' => 6, - 'SPATIAL INDEX' => 6, - 'PROCEDURE' => 6, - 'SERVER' => 6, - 'TABLE' => 6, - 'TABLESPACE' => 6, - 'TRIGGER' => 6, - 'USER' => 6, - 'VIEW' => 6, - - // CREATE TABLE - 'IF NOT EXISTS' => 7, - ); - - /** - * All database options. - * - * @var array - */ - public static $DB_OPTIONS = array( - 'CHARACTER SET' => array(1, 'var='), - 'CHARSET' => array(1, 'var='), - 'DEFAULT CHARACTER SET' => array(1, 'var='), - 'DEFAULT CHARSET' => array(1, 'var='), - 'DEFAULT COLLATE' => array(2, 'var='), - 'COLLATE' => array(2, 'var='), - ); - - /** - * All table options. - * - * @var array - */ - public static $TABLE_OPTIONS = array( - 'ENGINE' => array(1, 'var='), - 'AUTO_INCREMENT' => array(2, 'var='), - 'AVG_ROW_LENGTH' => array(3, 'var'), - 'CHARACTER SET' => array(4, 'var='), - 'CHARSET' => array(4, 'var='), - 'DEFAULT CHARACTER SET' => array(4, 'var='), - 'DEFAULT CHARSET' => array(4, 'var='), - 'CHECKSUM' => array(5, 'var'), - 'DEFAULT COLLATE' => array(6, 'var='), - 'COLLATE' => array(6, 'var='), - 'COMMENT' => array(7, 'var='), - 'CONNECTION' => array(8, 'var'), - 'DATA DIRECTORY' => array(9, 'var'), - 'DELAY_KEY_WRITE' => array(10, 'var'), - 'INDEX DIRECTORY' => array(11, 'var'), - 'INSERT_METHOD' => array(12, 'var'), - 'KEY_BLOCK_SIZE' => array(13, 'var'), - 'MAX_ROWS' => array(14, 'var'), - 'MIN_ROWS' => array(15, 'var'), - 'PACK_KEYS' => array(16, 'var'), - 'PASSWORD' => array(17, 'var'), - 'ROW_FORMAT' => array(18, 'var'), - 'TABLESPACE' => array(19, 'var'), - 'STORAGE' => array(20, 'var'), - 'UNION' => array(21, 'var'), - ); - - /** - * All function options. - * - * @var array - */ - public static $FUNC_OPTIONS = array( - 'COMMENT' => array(1, 'var='), - 'LANGUAGE SQL' => 2, - 'DETERMINISTIC' => 3, - 'NOT DETERMINISTIC' => 3, - 'CONTAINS SQL' => 4, - 'NO SQL' => 4, - 'READS SQL DATA' => 4, - 'MODIFIES SQL DATA' => 4, - 'SQL SECURITY DEFINER' => array(5, 'var'), - ); - - /** - * All trigger options. - * - * @var array - */ - public static $TRIGGER_OPTIONS = array( - 'BEFORE' => 1, - 'AFTER' => 1, - 'INSERT' => 2, - 'UPDATE' => 2, - 'DELETE' => 2, - ); - - /** - * The name of the entity that is created. - * - * Used by all `CREATE` statements. - * - * @var Expression - */ - public $name; - - /** - * The options of the entity (table, procedure, function, etc.). - * - * Used by `CREATE TABLE`, `CREATE FUNCTION` and `CREATE PROCEDURE`. - * - * @var OptionsArray - * - * @see static::$TABLE_OPTIONS - * @see static::$FUNC_OPTIONS - * @see static::$TRIGGER_OPTIONS - */ - public $entityOptions; - - /** - * If `CREATE TABLE`, a list of columns and keys. - * If `CREATE VIEW`, a list of columns. - * - * Used by `CREATE TABLE` and `CREATE VIEW`. - * - * @var CreateDefinition[]|ArrayObj - */ - public $fields; - - /** - * If `CREATE TABLE ... SELECT` - * - * Used by `CREATE TABLE` - * - * @var SelectStatement - */ - public $select; - - /** - * If `CREATE TABLE ... LIKE` - * - * Used by `CREATE TABLE` - * - * @var Expression - */ - public $like; - - /** - * Expression used for partitioning. - * - * @var string - */ - public $partitionBy; - - /** - * The number of partitions. - * - * @var int - */ - public $partitionsNum; - - /** - * Expression used for subpartitioning. - * - * @var string - */ - public $subpartitionBy; - - /** - * The number of subpartitions. - * - * @var int - */ - public $subpartitionsNum; - - /** - * The partition of the new table. - * - * @var PartitionDefinition[] - */ - public $partitions; - - /** - * If `CREATE TRIGGER` the name of the table. - * - * Used by `CREATE TRIGGER`. - * - * @var Expression - */ - public $table; - - /** - * The return data type of this routine. - * - * Used by `CREATE FUNCTION`. - * - * @var DataType - */ - public $return; - - /** - * The parameters of this routine. - * - * Used by `CREATE FUNCTION` and `CREATE PROCEDURE`. - * - * @var ParameterDefinition[] - */ - public $parameters; - - /** - * The body of this function or procedure. For views, it is the select - * statement that gets the - * - * Used by `CREATE FUNCTION`, `CREATE PROCEDURE` and `CREATE VIEW`. - * - * @var Token[]|string - */ - public $body = array(); - - /** - * @return string - */ - public function build() - { - $fields = ''; - if (!empty($this->fields)) { - if (is_array($this->fields)) { - $fields = CreateDefinition::build($this->fields) . ' '; - } elseif ($this->fields instanceof ArrayObj) { - $fields = ArrayObj::build($this->fields); - } - } - if ($this->options->has('DATABASE')) { - return 'CREATE ' - . OptionsArray::build($this->options) . ' ' - . Expression::build($this->name) . ' ' - . OptionsArray::build($this->entityOptions); - } elseif ($this->options->has('TABLE') && !is_null($this->select)) { - return 'CREATE ' - . OptionsArray::build($this->options) . ' ' - . Expression::build($this->name) . ' ' - . $this->select->build(); - } elseif ($this->options->has('TABLE') && !is_null($this->like)) { - return 'CREATE ' - . OptionsArray::build($this->options) . ' ' - . Expression::build($this->name) . ' LIKE ' - . Expression::build($this->like); - } elseif ($this->options->has('TABLE')) { - $partition = ''; - - if (!empty($this->partitionBy)) { - $partition .= "\nPARTITION BY " . $this->partitionBy; - } - if (!empty($this->partitionsNum)) { - $partition .= "\nPARTITIONS " . $this->partitionsNum; - } - if (!empty($this->subpartitionBy)) { - $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; - } - if (!empty($this->subpartitionsNum)) { - $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; - } - if (!empty($this->partitions)) { - $partition .= "\n" . PartitionDefinition::build($this->partitions); - } - - return 'CREATE ' - . OptionsArray::build($this->options) . ' ' - . Expression::build($this->name) . ' ' - . $fields - . OptionsArray::build($this->entityOptions) - . $partition; - } elseif ($this->options->has('VIEW')) { - return 'CREATE ' - . OptionsArray::build($this->options) . ' ' - . Expression::build($this->name) . ' ' - . $fields . ' AS ' . TokensList::build($this->body) . ' ' - . OptionsArray::build($this->entityOptions); - } elseif ($this->options->has('TRIGGER')) { - return 'CREATE ' - . OptionsArray::build($this->options) . ' ' - . Expression::build($this->name) . ' ' - . OptionsArray::build($this->entityOptions) . ' ' - . 'ON ' . Expression::build($this->table) . ' ' - . 'FOR EACH ROW ' . TokensList::build($this->body); - } elseif (($this->options->has('PROCEDURE')) - || ($this->options->has('FUNCTION')) - ) { - $tmp = ''; - if ($this->options->has('FUNCTION')) { - $tmp = 'RETURNS ' . DataType::build($this->return); - } - return 'CREATE ' - . OptionsArray::build($this->options) . ' ' - . Expression::build($this->name) . ' ' - . ParameterDefinition::build($this->parameters) . ' ' - . $tmp . ' ' . TokensList::build($this->body); - } - return 'CREATE ' - . OptionsArray::build($this->options) . ' ' - . Expression::build($this->name) . ' ' - . TokensList::build($this->body); - } - - /** - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * - * @return void - */ - public function parse(Parser $parser, TokensList $list) - { - ++$list->idx; // Skipping `CREATE`. - - // Parsing options. - $this->options = OptionsArray::parse($parser, $list, static::$OPTIONS); - ++$list->idx; // Skipping last option. - - // Parsing the field name. - $this->name = Expression::parse( - $parser, - $list, - array( - 'parseField' => 'table', - 'breakOnAlias' => true, - ) - ); - - if ((!isset($this->name)) || ($this->name === '')) { - $parser->error( - __('The name of the entity was expected.'), - $list->tokens[$list->idx] - ); - } else { - ++$list->idx; // Skipping field. - } - - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - $nextidx = $list->idx + 1; - while ($nextidx < $list->count && $list->tokens[$nextidx]->type == Token::TYPE_WHITESPACE) { - $nextidx++; - } - - if ($this->options->has('DATABASE')) { - $this->entityOptions = OptionsArray::parse( - $parser, - $list, - static::$DB_OPTIONS - ); - } elseif ($this->options->has('TABLE') - && ($token->type == Token::TYPE_KEYWORD) - && ($token->value == 'SELECT') - ) { - /* CREATE TABLE ... SELECT */ - $this->select = new SelectStatement($parser, $list); - } elseif ($this->options->has('TABLE') - && ($token->type == Token::TYPE_KEYWORD) && ($token->value == 'AS') - && ($list->tokens[$nextidx]->type == Token::TYPE_KEYWORD) - && ($list->tokens[$nextidx]->value == 'SELECT') - ) { - /* CREATE TABLE ... AS SELECT */ - $list->idx = $nextidx; - $this->select = new SelectStatement($parser, $list); - } elseif ($this->options->has('TABLE') - && $token->type == Token::TYPE_KEYWORD - && $token->value == 'LIKE' - ) { - /* CREATE TABLE `new_tbl` LIKE 'orig_tbl' */ - $list->idx = $nextidx; - $this->like = Expression::parse( - $parser, - $list, - array( - 'parseField' => 'table', - 'breakOnAlias' => true, - ) - ); - // The 'LIKE' keyword was found, but no table_name was found next to it - if ($this->like == null) { - $parser->error( - __('A table name was expected.'), - $list->tokens[$list->idx] - ); - } - } elseif ($this->options->has('TABLE')) { - $this->fields = CreateDefinition::parse($parser, $list); - if (empty($this->fields)) { - $parser->error( - __('At least one column definition was expected.'), - $list->tokens[$list->idx] - ); - } - ++$list->idx; - - $this->entityOptions = OptionsArray::parse( - $parser, - $list, - static::$TABLE_OPTIONS - ); - - /** - * The field that is being filled (`partitionBy` or - * `subpartitionBy`). - * - * @var string $field - */ - $field = null; - - /** - * The number of brackets. `false` means no bracket was found - * previously. At least one bracket is required to validate the - * expression. - * - * @var int|bool $brackets - */ - $brackets = false; - - /* - * Handles partitions. - */ - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping comments. - if ($token->type === Token::TYPE_COMMENT) { - continue; - } - - if (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'PARTITION BY')) { - $field = 'partitionBy'; - $brackets = false; - } elseif (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'SUBPARTITION BY')) { - $field = 'subpartitionBy'; - $brackets = false; - } elseif (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'PARTITIONS')) { - $token = $list->getNextOfType(Token::TYPE_NUMBER); - --$list->idx; // `getNextOfType` also advances one position. - $this->partitionsNum = $token->value; - } elseif (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'SUBPARTITIONS')) { - $token = $list->getNextOfType(Token::TYPE_NUMBER); - --$list->idx; // `getNextOfType` also advances one position. - $this->subpartitionsNum = $token->value; - } elseif (!empty($field)) { - /* - * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. - */ - - // Counting brackets. - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { - // This is used instead of `++$brackets` because, - // initially, `$brackets` is `false` cannot be - // incremented. - $brackets = $brackets + 1; - } elseif (($token->type === Token::TYPE_OPERATOR) && ($token->value === ')')) { - --$brackets; - } - - // Building the expression used for partitioning. - $this->$field .= ($token->type === Token::TYPE_WHITESPACE) ? ' ' : $token->token; - - // Last bracket was read, the expression ended. - // Comparing with `0` and not `false`, because `false` means - // that no bracket was found and at least one must is - // required. - if ($brackets === 0) { - $this->$field = trim($this->$field); - $field = null; - } - } elseif (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { - if (!empty($this->partitionBy)) { - $this->partitions = ArrayObj::parse( - $parser, - $list, - array( - 'type' => 'SqlParser\\Components\\PartitionDefinition' - ) - ); - } - break; - } - } - } elseif (($this->options->has('PROCEDURE')) - || ($this->options->has('FUNCTION')) - ) { - $this->parameters = ParameterDefinition::parse($parser, $list); - if ($this->options->has('FUNCTION')) { - $token = $list->getNextOfType(Token::TYPE_KEYWORD); - if ($token->value !== 'RETURNS') { - $parser->error( - __('A "RETURNS" keyword was expected.'), - $token - ); - } else { - ++$list->idx; - $this->return = DataType::parse( - $parser, - $list - ); - } - } - ++$list->idx; - - $this->entityOptions = OptionsArray::parse( - $parser, - $list, - static::$FUNC_OPTIONS - ); - ++$list->idx; - - for (; $list->idx < $list->count; ++$list->idx) { - $token = $list->tokens[$list->idx]; - $this->body[] = $token; - } - } elseif ($this->options->has('VIEW')) { - $token = $list->getNext(); // Skipping whitespaces and comments. - - // Parsing columns list. - if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { - --$list->idx; // getNext() also goes forward one field. - $this->fields = ArrayObj::parse($parser, $list); - ++$list->idx; // Skipping last token from the array. - $list->getNext(); - } - - // Parsing the `AS` keyword. - for (; $list->idx < $list->count; ++$list->idx) { - $token = $list->tokens[$list->idx]; - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - $this->body[] = $token; - } - } elseif ($this->options->has('TRIGGER')) { - // Parsing the time and the event. - $this->entityOptions = OptionsArray::parse( - $parser, - $list, - static::$TRIGGER_OPTIONS - ); - ++$list->idx; - - $list->getNextOfTypeAndValue(Token::TYPE_KEYWORD, 'ON'); - ++$list->idx; // Skipping `ON`. - - // Parsing the name of the table. - $this->table = Expression::parse( - $parser, - $list, - array( - 'parseField' => 'table', - 'breakOnAlias' => true, - ) - ); - ++$list->idx; - - $list->getNextOfTypeAndValue(Token::TYPE_KEYWORD, 'FOR EACH ROW'); - ++$list->idx; // Skipping `FOR EACH ROW`. - - for (; $list->idx < $list->count; ++$list->idx) { - $token = $list->tokens[$list->idx]; - $this->body[] = $token; - } - } else { - for (; $list->idx < $list->count; ++$list->idx) { - $token = $list->tokens[$list->idx]; - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - $this->body[] = $token; - } - } - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/DeleteStatement.php b/#pma/libraries/sql-parser/src/Statements/DeleteStatement.php deleted file mode 100644 index 0c661389..00000000 --- a/#pma/libraries/sql-parser/src/Statements/DeleteStatement.php +++ /dev/null @@ -1,349 +0,0 @@ - 1, - 'QUICK' => 2, - 'IGNORE' => 3, - ); - - /** - * The clauses of this statement, in order. - * - * @see Statement::$CLAUSES - * - * @var array - */ - public static $CLAUSES = array( - 'DELETE' => array('DELETE', 2), - // Used for options. - '_OPTIONS' => array('_OPTIONS', 1), - 'FROM' => array('FROM', 3), - 'PARTITION' => array('PARTITION', 3), - 'USING' => array('USING', 3), - 'WHERE' => array('WHERE', 3), - 'ORDER BY' => array('ORDER BY', 3), - 'LIMIT' => array('LIMIT', 3), - ); - - /** - * Table(s) used as sources for this statement. - * - * @var Expression[] - */ - public $from; - - /** - * Tables used as sources for this statement - * - * @var Expression[] - */ - public $using; - - /** - * Columns used in this statement - * - * @var Expression[] - */ - public $columns; - - /** - * Partitions used as source for this statement. - * - * @var ArrayObj - */ - public $partition; - - /** - * Conditions used for filtering each row of the result set. - * - * @var Condition[] - */ - public $where; - - /** - * Specifies the order of the rows in the result set. - * - * @var OrderKeyword[] - */ - public $order; - - /** - * Conditions used for limiting the size of the result set. - * - * @var Limit - */ - public $limit; - - - /** - * @return string - */ - public function build() - { - $ret = 'DELETE ' . OptionsArray::build($this->options); - - if ($this->columns != NULL && count($this->columns) > 0) { - $ret .= ' ' . ExpressionArray::build($this->columns); - } - if ($this->from != NULL && count($this->from) > 0) { - $ret .= ' FROM ' . ExpressionArray::build($this->from); - } - if ($this->using != NULL && count($this->using) > 0) { - $ret .= ' USING ' . ExpressionArray::build($this->using); - } - if ($this->where != NULL && count($this->where) > 0) { - $ret .= ' WHERE ' . Condition::build($this->where); - } - if ($this->order != NULL && count($this->order) > 0) { - $ret .= ' ORDER BY ' . ExpressionArray::build($this->order); - } - if ($this->limit != NULL && count($this->limit) > 0) { - $ret .= ' LIMIT ' . Limit::build($this->limit); - } - - return $ret; - - } - - - /** - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * - * @return void - */ - public function parse(Parser $parser, TokensList $list) - { - ++$list->idx; // Skipping `DELETE`. - - // parse any options if provided - $this->options = OptionsArray::parse( - $parser, - $list, - static::$OPTIONS - ); - ++$list->idx; - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 ---------------------------------[ FROM ]----------------------------------> 2 - * 0 ------------------------------[ table[.*] ]--------------------------------> 1 - * 1 ---------------------------------[ FROM ]----------------------------------> 2 - * 2 --------------------------------[ USING ]----------------------------------> 3 - * 2 --------------------------------[ WHERE ]----------------------------------> 4 - * 2 --------------------------------[ ORDER ]----------------------------------> 5 - * 2 --------------------------------[ LIMIT ]----------------------------------> 6 - * - * @var int $state - */ - $state = 0; - - /** - * If the query is multi-table or not - * - * @var bool $multiTable - */ - $multiTable = false; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - if ($state === 0) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value !== 'FROM' - ) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } elseif ($token->type === Token::TYPE_KEYWORD - && $token->value === 'FROM' - ) { - ++$list->idx; // Skip 'FROM' - $this->from = ExpressionArray::parse($parser, $list); - $state = 2; - } else { - $this->columns = ExpressionArray::parse($parser, $list); - $state = 1; - } - } elseif ($state === 1) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value !== 'FROM' - ) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } elseif ($token->type === Token::TYPE_KEYWORD - && $token->value === 'FROM' - ) { - ++$list->idx; // Skip 'FROM' - $this->from = ExpressionArray::parse($parser, $list); - $state = 2; - } else { - $parser->error(__('Unexpected token.'), $token); - break; - } - } elseif ($state === 2) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value === 'USING' - ) { - ++$list->idx; // Skip 'USING' - $this->using = ExpressionArray::parse($parser, $list); - $state = 3; - - $multiTable = true; - } elseif ($token->type === Token::TYPE_KEYWORD - && $token->value === 'WHERE' - ) { - ++$list->idx; // Skip 'WHERE' - $this->where = Condition::parse($parser, $list); - $state = 4; - } elseif ($token->type === Token::TYPE_KEYWORD - && $token->value === 'ORDER BY' - ) { - ++$list->idx; // Skip 'ORDER BY' - $this->order = OrderKeyword::parse($parser, $list); - $state = 5; - } elseif ($token->type === Token::TYPE_KEYWORD - && $token->value === 'LIMIT' - ) { - ++$list->idx; // Skip 'LIMIT' - $this->limit = Limit::parse($parser, $list); - $state = 6; - } elseif ($token->type === Token::TYPE_KEYWORD) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } - } elseif ($state === 3) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value === 'WHERE' - ) { - ++$list->idx; // Skip 'WHERE' - $this->where = Condition::parse($parser, $list); - $state = 4; - } elseif ($token->type === Token::TYPE_KEYWORD) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } else { - $parser->error(__('Unexpected token.'), $token); - break; - } - } elseif ($state === 4) { - if ($multiTable === true - && $token->type === Token::TYPE_KEYWORD - ) { - $parser->error( - __('This type of clause is not valid in Multi-table queries.'), - $token - ); - break; - } - - if ($token->type === Token::TYPE_KEYWORD - && $token->value === 'ORDER BY' - ) { - ++$list->idx; // Skip 'ORDER BY' - $this->order = OrderKeyword::parse($parser, $list); - $state = 5; - } elseif ($token->type === Token::TYPE_KEYWORD - && $token->value === 'LIMIT' - ) { - ++$list->idx; // Skip 'LIMIT' - $this->limit = Limit::parse($parser, $list); - $state = 6; - } elseif ($token->type === Token::TYPE_KEYWORD) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } - } elseif ($state === 5) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value === 'LIMIT' - ) { - ++$list->idx; // Skip 'LIMIT' - $this->limit = Limit::parse($parser, $list); - $state = 6; - } elseif ($token->type === Token::TYPE_KEYWORD) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } - } - } - - if ($state >= 2) { - foreach ($this->from as $from_expr) { - $from_expr->database = $from_expr->table; - $from_expr->table = $from_expr->column; - $from_expr->column = null; - } - } - - --$list->idx; - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/DropStatement.php b/#pma/libraries/sql-parser/src/Statements/DropStatement.php deleted file mode 100644 index b75ab0e5..00000000 --- a/#pma/libraries/sql-parser/src/Statements/DropStatement.php +++ /dev/null @@ -1,78 +0,0 @@ - 1, - 'EVENT' => 1, - 'FUNCTION' => 1, - 'INDEX' => 1, - 'LOGFILE' => 1, - 'PROCEDURE' => 1, - 'SCHEMA' => 1, - 'SERVER' => 1, - 'TABLE' => 1, - 'VIEW' => 1, - 'TABLESPACE' => 1, - 'TRIGGER' => 1, - - 'TEMPORARY' => 2, - 'IF EXISTS' => 3, - ); - - /** - * The clauses of this statement, in order. - * - * @see Statement::$CLAUSES - * - * @var array - */ - public static $CLAUSES = array( - 'DROP' => array('DROP', 2), - // Used for options. - '_OPTIONS' => array('_OPTIONS', 1), - // Used for select expressions. - 'DROP_' => array('DROP', 1), - 'ON' => array('ON', 3), - ); - - /** - * Dropped elements. - * - * @var Expression[] - */ - public $fields; - - /** - * Table of the dropped index. - * - * @var Expression - */ - public $table; -} diff --git a/#pma/libraries/sql-parser/src/Statements/ExplainStatement.php b/#pma/libraries/sql-parser/src/Statements/ExplainStatement.php deleted file mode 100644 index 78c7acd2..00000000 --- a/#pma/libraries/sql-parser/src/Statements/ExplainStatement.php +++ /dev/null @@ -1,22 +0,0 @@ - 1, - 'DELAYED' => 2, - 'HIGH_PRIORITY' => 3, - 'IGNORE' => 4, - ); - - /** - * Tables used as target for this statement. - * - * @var IntoKeyword - */ - public $into; - - /** - * Values to be inserted. - * - * @var Array2d - */ - public $values; - - /** - * If SET clause is present - * holds the SetOperation - * - * @var SetOperation[] - */ - public $set; - - /** - * If SELECT clause is present - * holds the SelectStatement - * - * @var SelectStatement - */ - public $select; - - /** - * If ON DUPLICATE KEY UPDATE clause is present - * holds the SetOperation - * - * @var SetOperation[] - */ - public $onDuplicateSet; - - /** - * @return string - */ - public function build() - { - $ret = 'INSERT ' . $this->options - . ' INTO ' . $this->into; - - if ($this->values != NULL && count($this->values) > 0) { - $ret .= ' VALUES ' . Array2d::build($this->values); - } elseif ($this->set != NULL && count($this->set) > 0) { - $ret .= ' SET ' . SetOperation::build($this->set); - } elseif ($this->select != NULL && count($this->select) > 0) { - $ret .= ' ' . $this->select->build(); - } - - if ($this->onDuplicateSet != NULL && count($this->onDuplicateSet) > 0) { - $ret .= ' ON DUPLICATE KEY UPDATE ' . SetOperation::build($this->onDuplicateSet); - } - - return $ret; - - } - - - /** - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * - * @return void - */ - public function parse(Parser $parser, TokensList $list) - { - ++$list->idx; // Skipping `INSERT`. - - // parse any options if provided - $this->options = OptionsArray::parse( - $parser, - $list, - static::$OPTIONS - ); - ++$list->idx; - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 ---------------------------------[ INTO ]----------------------------------> 1 - * - * 1 -------------------------[ VALUES/VALUE/SET/SELECT ]-----------------------> 2 - * - * 2 -------------------------[ ON DUPLICATE KEY UPDATE ]-----------------------> 3 - * - * @var int $state - */ - $state = 0; - - /** - * For keeping track of semi-states on encountering - * ON DUPLICATE KEY UPDATE ... - * - */ - $miniState = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value !== 'INTO' - ) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } else { - ++$list->idx; - $this->into = IntoKeyword::parse( - $parser, - $list, - array('fromInsert' => true) - ); - } - - $state = 1; - } elseif ($state === 1) { - if ($token->type === Token::TYPE_KEYWORD) { - if ($token->value === 'VALUE' - || $token->value === 'VALUES' - ) { - ++$list->idx; // skip VALUES - - $this->values = Array2d::parse($parser, $list); - } elseif ($token->value === 'SET') { - ++$list->idx; // skip SET - - $this->set = SetOperation::parse($parser, $list); - } elseif ($token->value === 'SELECT') { - $this->select = new SelectStatement($parser, $list); - } else { - $parser->error( - __('Unexpected keyword.'), - $token - ); - break; - } - $state = 2; - $miniState = 1; - } else { - $parser->error( - __('Unexpected token.'), - $token - ); - break; - } - } elseif ($state == 2) { - $lastCount = $miniState; - - if ($miniState === 1 && $token->value === 'ON') { - $miniState++; - } elseif ($miniState === 2 && $token->value === 'DUPLICATE') { - $miniState++; - } elseif ($miniState === 3 && $token->value === 'KEY') { - $miniState++; - } elseif ($miniState === 4 && $token->value === 'UPDATE') { - $miniState++; - } - - if ($lastCount === $miniState) { - $parser->error( - __('Unexpected token.'), - $token - ); - break; - } - - if ($miniState === 5) { - ++$list->idx; - $this->onDuplicateSet = SetOperation::parse($parser, $list); - $state = 3; - } - } - } - - --$list->idx; - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/MaintenanceStatement.php b/#pma/libraries/sql-parser/src/Statements/MaintenanceStatement.php deleted file mode 100644 index 9097527c..00000000 --- a/#pma/libraries/sql-parser/src/Statements/MaintenanceStatement.php +++ /dev/null @@ -1,67 +0,0 @@ -idx; - $this->options->merge( - OptionsArray::parse( - $parser, - $list, - static::$OPTIONS - ) - ); - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/NotImplementedStatement.php b/#pma/libraries/sql-parser/src/Statements/NotImplementedStatement.php deleted file mode 100644 index 8bdff2d7..00000000 --- a/#pma/libraries/sql-parser/src/Statements/NotImplementedStatement.php +++ /dev/null @@ -1,67 +0,0 @@ -unknown as $token) { - $query .= $token->token; - } - - return $query; - } - - /** - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * - * @return void - */ - public function parse(Parser $parser, TokensList $list) - { - for (; $list->idx < $list->count; ++$list->idx) { - if ($list->tokens[$list->idx]->type === Token::TYPE_DELIMITER) { - break; - } - $this->unknown[] = $list->tokens[$list->idx]; - } - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/OptimizeStatement.php b/#pma/libraries/sql-parser/src/Statements/OptimizeStatement.php deleted file mode 100644 index f688333e..00000000 --- a/#pma/libraries/sql-parser/src/Statements/OptimizeStatement.php +++ /dev/null @@ -1,47 +0,0 @@ - 1, - - 'NO_WRITE_TO_BINLOG' => 2, - 'LOCAL' => 3, - ); - - /** - * Optimized tables. - * - * @var Expression[] - */ - public $tables; -} diff --git a/#pma/libraries/sql-parser/src/Statements/RenameStatement.php b/#pma/libraries/sql-parser/src/Statements/RenameStatement.php deleted file mode 100644 index 0205f846..00000000 --- a/#pma/libraries/sql-parser/src/Statements/RenameStatement.php +++ /dev/null @@ -1,56 +0,0 @@ -type === Token::TYPE_KEYWORD) && ($token->value === 'RENAME')) { - // Checking if it is the beginning of the query. - $list->getNextOfTypeAndValue(Token::TYPE_KEYWORD, 'TABLE'); - } - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/RepairStatement.php b/#pma/libraries/sql-parser/src/Statements/RepairStatement.php deleted file mode 100644 index f98fcc62..00000000 --- a/#pma/libraries/sql-parser/src/Statements/RepairStatement.php +++ /dev/null @@ -1,42 +0,0 @@ - 1, - - 'NO_WRITE_TO_BINLOG' => 2, - 'LOCAL' => 3, - - 'QUICK' => 4, - 'EXTENDED' => 5, - 'USE_FRM' => 6, - ); -} diff --git a/#pma/libraries/sql-parser/src/Statements/ReplaceStatement.php b/#pma/libraries/sql-parser/src/Statements/ReplaceStatement.php deleted file mode 100644 index 4142c886..00000000 --- a/#pma/libraries/sql-parser/src/Statements/ReplaceStatement.php +++ /dev/null @@ -1,211 +0,0 @@ - 1, - 'DELAYED' => 1, - ); - - /** - * Tables used as target for this statement. - * - * @var IntoKeyword - */ - public $into; - - /** - * Values to be replaced. - * - * @var Array2d - */ - public $values; - - /** - * If SET clause is present - * holds the SetOperation - * - * @var SetOperation[] - */ - public $set; - - /** - * If SELECT clause is present - * holds the SelectStatement - * - * @var SelectStatement - */ - public $select; - - /** - * @return string - */ - public function build() - { - $ret = 'REPLACE ' . $this->options - . ' INTO ' . $this->into; - - if ($this->values != NULL && count($this->values) > 0) { - $ret .= ' VALUES ' . Array2d::build($this->values); - } elseif ($this->set != NULL && count($this->set) > 0) { - $ret .= ' SET ' . SetOperation::build($this->set); - } elseif ($this->select != NULL && count($this->select) > 0) { - $ret .= ' ' . $this->select->build(); - } - - return $ret; - } - - - /** - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * - * @return void - */ - public function parse(Parser $parser, TokensList $list) - { - ++$list->idx; // Skipping `REPLACE`. - - // parse any options if provided - $this->options = OptionsArray::parse( - $parser, - $list, - static::$OPTIONS - ); - ++$list->idx; - - $token = $list->tokens[$list->idx]; - - /** - * The state of the parser. - * - * Below are the states of the parser. - * - * 0 ---------------------------------[ INTO ]----------------------------------> 1 - * - * 1 -------------------------[ VALUES/VALUE/SET/SELECT ]-----------------------> 2 - * - * @var int $state - */ - $state = 0; - - for (; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $token - */ - $token = $list->tokens[$list->idx]; - - // End of statement. - if ($token->type === Token::TYPE_DELIMITER) { - break; - } - - // Skipping whitespaces and comments. - if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { - continue; - } - - if ($state === 0) { - if ($token->type === Token::TYPE_KEYWORD - && $token->value !== 'INTO' - ) { - $parser->error(__('Unexpected keyword.'), $token); - break; - } else { - ++$list->idx; - $this->into = IntoKeyword::parse( - $parser, - $list, - array('fromReplace' => true) - ); - } - - $state = 1; - } elseif ($state === 1) { - if ($token->type === Token::TYPE_KEYWORD) { - if ($token->value === 'VALUE' - || $token->value === 'VALUES' - ) { - ++$list->idx; // skip VALUES - - $this->values = Array2d::parse($parser, $list); - } elseif ($token->value === 'SET') { - ++$list->idx; // skip SET - - $this->set = SetOperation::parse($parser, $list); - } elseif ($token->value === 'SELECT') { - $this->select = new SelectStatement($parser, $list); - } else { - $parser->error( - __('Unexpected keyword.'), - $token - ); - break; - } - $state = 2; - } else { - $parser->error( - __('Unexpected token.'), - $token - ); - break; - } - } - } - - --$list->idx; - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/RestoreStatement.php b/#pma/libraries/sql-parser/src/Statements/RestoreStatement.php deleted file mode 100644 index 8500479b..00000000 --- a/#pma/libraries/sql-parser/src/Statements/RestoreStatement.php +++ /dev/null @@ -1,35 +0,0 @@ - 1, - - 'FROM' => array(2, 'var'), - ); -} diff --git a/#pma/libraries/sql-parser/src/Statements/SelectStatement.php b/#pma/libraries/sql-parser/src/Statements/SelectStatement.php deleted file mode 100644 index 49ed3934..00000000 --- a/#pma/libraries/sql-parser/src/Statements/SelectStatement.php +++ /dev/null @@ -1,238 +0,0 @@ - 1, - 'DISTINCT' => 1, - 'DISTINCTROW' => 1, - 'HIGH_PRIORITY' => 2, - 'MAX_STATEMENT_TIME' => array(3, 'var='), - 'STRAIGHT_JOIN' => 4, - 'SQL_SMALL_RESULT' => 5, - 'SQL_BIG_RESULT' => 6, - 'SQL_BUFFER_RESULT' => 7, - 'SQL_CACHE' => 8, - 'SQL_NO_CACHE' => 8, - 'SQL_CALC_FOUND_ROWS' => 9, - ); - - public static $END_OPTIONS = array( - 'FOR UPDATE' => 1, - 'LOCK IN SHARE MODE' => 1 - ); - - /** - * The clauses of this statement, in order. - * - * @see Statement::$CLAUSES - * - * @var array - */ - public static $CLAUSES = array( - 'SELECT' => array('SELECT', 2), - // Used for options. - '_OPTIONS' => array('_OPTIONS', 1), - // Used for selected expressions. - '_SELECT' => array('SELECT', 1), - 'INTO' => array('INTO', 3), - 'FROM' => array('FROM', 3), - 'PARTITION' => array('PARTITION', 3), - - 'JOIN' => array('JOIN', 1), - 'FULL JOIN' => array('FULL JOIN', 1), - 'INNER JOIN' => array('INNER JOIN', 1), - 'LEFT JOIN' => array('LEFT JOIN', 1), - 'LEFT OUTER JOIN' => array('LEFT OUTER JOIN', 1), - 'RIGHT JOIN' => array('RIGHT JOIN', 1), - 'RIGHT OUTER JOIN' => array('RIGHT OUTER JOIN', 1), - 'NATURAL JOIN' => array('NATURAL JOIN', 1), - 'NATURAL LEFT JOIN' => array('NATURAL LEFT JOIN', 1), - 'NATURAL RIGHT JOIN' => array('NATURAL RIGHT JOIN', 1), - 'NATURAL LEFT OUTER JOIN' => array('NATURAL LEFT OUTER JOIN', 1), - 'NATURAL RIGHT OUTER JOIN' => array('NATURAL RIGHT JOIN', 1), - - 'WHERE' => array('WHERE', 3), - 'GROUP BY' => array('GROUP BY', 3), - 'HAVING' => array('HAVING', 3), - 'ORDER BY' => array('ORDER BY', 3), - 'LIMIT' => array('LIMIT', 3), - 'PROCEDURE' => array('PROCEDURE', 3), - 'UNION' => array('UNION', 1), - '_END_OPTIONS' => array('_END_OPTIONS', 1) - // These are available only when `UNION` is present. - // 'ORDER BY' => array('ORDER BY', 3), - // 'LIMIT' => array('LIMIT', 3), - ); - - /** - * Expressions that are being selected by this statement. - * - * @var Expression[] - */ - public $expr = array(); - - /** - * Tables used as sources for this statement. - * - * @var Expression[] - */ - public $from = array(); - - /** - * Partitions used as source for this statement. - * - * @var ArrayObj - */ - public $partition; - - /** - * Conditions used for filtering each row of the result set. - * - * @var Condition[] - */ - public $where; - - /** - * Conditions used for grouping the result set. - * - * @var OrderKeyword[] - */ - public $group; - - /** - * Conditions used for filtering the result set. - * - * @var Condition[] - */ - public $having; - - /** - * Specifies the order of the rows in the result set. - * - * @var OrderKeyword[] - */ - public $order; - - /** - * Conditions used for limiting the size of the result set. - * - * @var Limit - */ - public $limit; - - /** - * Procedure that should process the data in the result set. - * - * @var FunctionCall - */ - public $procedure; - - /** - * Destination of this result set. - * - * @var IntoKeyword - */ - public $into; - - /** - * Joins. - * - * @var JoinKeyword[] - */ - public $join; - - /** - * Unions. - * - * @var SelectStatement[] - */ - public $union = array(); - - /** - * The end options of this query. - * - * @var OptionsArray - * - * @see static::$END_OPTIONS - */ - public $end_options; - - /** - * Gets the clauses of this statement. - * - * @return array - */ - public function getClauses() - { - // This is a cheap fix for `SELECT` statements that contain `UNION`. - // The `ORDER BY` and `LIMIT` clauses should be at the end of the - // statement. - if (!empty($this->union)) { - $clauses = static::$CLAUSES; - unset($clauses['ORDER BY']); - unset($clauses['LIMIT']); - $clauses['ORDER BY'] = array('ORDER BY', 3); - $clauses['LIMIT'] = array('LIMIT', 3); - return $clauses; - } - return static::$CLAUSES; - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/SetStatement.php b/#pma/libraries/sql-parser/src/Statements/SetStatement.php deleted file mode 100644 index a9ff4983..00000000 --- a/#pma/libraries/sql-parser/src/Statements/SetStatement.php +++ /dev/null @@ -1,71 +0,0 @@ - array('SET', 3), - ); - - /** - * Possible exceptions in SET statment - * - * @var array - */ - public static $OPTIONS = array( - 'CHARSET' => array(3, 'var'), - 'CHARACTER SET' => array(3, 'var'), - 'NAMES' => array(3, 'var'), - 'PASSWORD' => array(3, 'expr'), - ); - - /** - * Options used in current statement - * - * @var OptionsArray[] - */ - public $options; - - /** - * The updated values. - * - * @var SetOperation[] - */ - public $set; - - /** - * @return string - */ - public function build() - { - return 'SET ' . OptionsArray::build($this->options) - . ' ' . SetOperation::build($this->set); - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/ShowStatement.php b/#pma/libraries/sql-parser/src/Statements/ShowStatement.php deleted file mode 100644 index ecca3489..00000000 --- a/#pma/libraries/sql-parser/src/Statements/ShowStatement.php +++ /dev/null @@ -1,70 +0,0 @@ - 1, - 'AUTHORS' => 2, - 'BINARY' => 2, - 'BINLOG' => 2, - 'CHARACTER' => 2, - 'CODE' => 2, - 'COLLATION' => 2, - 'COLUMNS' => 2, - 'CONTRIBUTORS' => 2, - 'DATABASE' => 2, - 'DATABASES' => 2, - 'ENGINE' => 2, - 'ENGINES' => 2, - 'ERRORS' => 2, - 'EVENT' => 2, - 'EVENTS' => 2, - 'FUNCTION' => 2, - 'GRANTS' => 2, - 'HOSTS' => 2, - 'INDEX' => 2, - 'INNODB' => 2, - 'LOGS' => 2, - 'MASTER' => 2, - 'OPEN' => 2, - 'PLUGINS' => 2, - 'PRIVILEGES' => 2, - 'PROCEDURE' => 2, - 'PROCESSLIST' => 2, - 'PROFILE' => 2, - 'PROFILES' => 2, - 'SCHEDULER' => 2, - 'SET' => 2, - 'SLAVE' => 2, - 'STATUS' => 2, - 'TABLE' => 2, - 'TABLES' => 2, - 'TRIGGER' => 2, - 'TRIGGERS' => 2, - 'VARIABLES' => 2, - 'VIEW' => 2, - 'WARNINGS' => 2, - ); -} diff --git a/#pma/libraries/sql-parser/src/Statements/TransactionStatement.php b/#pma/libraries/sql-parser/src/Statements/TransactionStatement.php deleted file mode 100644 index 2d355eab..00000000 --- a/#pma/libraries/sql-parser/src/Statements/TransactionStatement.php +++ /dev/null @@ -1,119 +0,0 @@ - 1, - 'BEGIN' => 1, - 'COMMIT' => 1, - 'ROLLBACK' => 1, - 'WITH CONSISTENT SNAPSHOT' => 2, - 'WORK' => 2, - 'AND NO CHAIN' => 3, - 'AND CHAIN' => 3, - 'RELEASE' => 4, - 'NO RELEASE' => 4, - ); - - /** - * @param Parser $parser The instance that requests parsing. - * @param TokensList $list The list of tokens to be parsed. - * - * @return void - */ - public function parse(Parser $parser, TokensList $list) - { - parent::parse($parser, $list); - - // Checks the type of this query. - if (($this->options->has('START TRANSACTION')) - || ($this->options->has('BEGIN')) - ) { - $this->type = TransactionStatement::TYPE_BEGIN; - } elseif (($this->options->has('COMMIT')) - || ($this->options->has('ROLLBACK')) - ) { - $this->type = TransactionStatement::TYPE_END; - } - } - - /** - * @return string - */ - public function build() - { - $ret = OptionsArray::build($this->options); - if ($this->type === TransactionStatement::TYPE_BEGIN) { - foreach ($this->statements as $statement) { - /** - * @var SelectStatement $statement - */ - $ret .= ';' . $statement->build(); - } - $ret .= ';' . $this->end->build(); - } - return $ret; - } -} diff --git a/#pma/libraries/sql-parser/src/Statements/TruncateStatement.php b/#pma/libraries/sql-parser/src/Statements/TruncateStatement.php deleted file mode 100644 index 6f9d303a..00000000 --- a/#pma/libraries/sql-parser/src/Statements/TruncateStatement.php +++ /dev/null @@ -1,40 +0,0 @@ - 1, - ); - - /** - * The name of the truncated table. - * - * @var Expression - */ - public $table; -} diff --git a/#pma/libraries/sql-parser/src/Statements/UpdateStatement.php b/#pma/libraries/sql-parser/src/Statements/UpdateStatement.php deleted file mode 100644 index 011b9555..00000000 --- a/#pma/libraries/sql-parser/src/Statements/UpdateStatement.php +++ /dev/null @@ -1,104 +0,0 @@ - 1, - 'IGNORE' => 2, - ); - - /** - * The clauses of this statement, in order. - * - * @see Statement::$CLAUSES - * - * @var array - */ - public static $CLAUSES = array( - 'UPDATE' => array('UPDATE', 2), - // Used for options. - '_OPTIONS' => array('_OPTIONS', 1), - // Used for updated tables. - '_UPDATE' => array('UPDATE', 1), - 'SET' => array('SET', 3), - 'WHERE' => array('WHERE', 3), - 'ORDER BY' => array('ORDER BY', 3), - 'LIMIT' => array('LIMIT', 3), - ); - - /** - * Tables used as sources for this statement. - * - * @var Expression[] - */ - public $tables; - - /** - * The updated values. - * - * @var SetOperation[] - */ - public $set; - - /** - * Conditions used for filtering each row of the result set. - * - * @var Condition[] - */ - public $where; - - /** - * Specifies the order of the rows in the result set. - * - * @var OrderKeyword[] - */ - public $order; - - /** - * Conditions used for limiting the size of the result set. - * - * @var Limit - */ - public $limit; -} diff --git a/#pma/libraries/sql-parser/src/Token.php b/#pma/libraries/sql-parser/src/Token.php deleted file mode 100644 index e5001ef9..00000000 --- a/#pma/libraries/sql-parser/src/Token.php +++ /dev/null @@ -1,303 +0,0 @@ -, !==, etc. - * Bitwise operators: &, |, ^, etc. - * Assignment operators: =, +=, -=, etc. - * SQL specific operators: . (e.g. .. WHERE database.table ..), - * * (e.g. SELECT * FROM ..) - * - * @var int - */ - const TYPE_OPERATOR = 2; - - /** - * Spaces, tabs, new lines, etc. - * - * @var int - */ - const TYPE_WHITESPACE = 3; - - /** - * Any type of legal comment. - * - * Bash (#), C (/* *\/) or SQL (--) comments: - * - * -- SQL-comment - * - * #Bash-like comment - * - * /*C-like comment*\/ - * - * or: - * - * /*C-like - * comment*\/ - * - * Backslashes were added to respect PHP's comments syntax. - * - * @var int - */ - const TYPE_COMMENT = 4; - - /** - * Boolean values: true or false. - * - * @var int - */ - const TYPE_BOOL = 5; - - /** - * Numbers: 4, 0x8, 15.16, 23e42, etc. - * - * @var int - */ - const TYPE_NUMBER = 6; - - /** - * Literal strings: 'string', "test". - * Some of these strings are actually symbols. - * - * @var int - */ - const TYPE_STRING = 7; - - /** - * Database, table names, variables, etc. - * For example: ```SELECT `foo`, `bar` FROM `database`.`table`;``` - * - * @var int - */ - const TYPE_SYMBOL = 8; - - /** - * Delimits an unknown string. - * For example: ```SELECT * FROM test;```, `test` is a delimiter. - * - * @var int - */ - const TYPE_DELIMITER = 9; - - /** - * Labels in LOOP statement, ITERATE statement etc. - * For example (only for begin label): - * begin_label: BEGIN [statement_list] END [end_label] - * begin_label: LOOP [statement_list] END LOOP [end_label] - * begin_label: REPEAT [statement_list] ... END REPEAT [end_label] - * begin_label: WHILE ... DO [statement_list] END WHILE [end_label] - * - * @var int - */ - const TYPE_LABEL = 10; - - // Flags that describe the tokens in more detail. - // All keywords must have flag 1 so `Context::isKeyword` method doesn't - // require strict comparison. - const FLAG_KEYWORD_RESERVED = 2; - const FLAG_KEYWORD_COMPOSED = 4; - const FLAG_KEYWORD_DATA_TYPE = 8; - const FLAG_KEYWORD_KEY = 16; - const FLAG_KEYWORD_FUNCTION = 32; - - // Numbers related flags. - const FLAG_NUMBER_HEX = 1; - const FLAG_NUMBER_FLOAT = 2; - const FLAG_NUMBER_APPROXIMATE = 4; - const FLAG_NUMBER_NEGATIVE = 8; - const FLAG_NUMBER_BINARY = 16; - - // Strings related flags. - const FLAG_STRING_SINGLE_QUOTES = 1; - const FLAG_STRING_DOUBLE_QUOTES = 2; - - // Comments related flags. - const FLAG_COMMENT_BASH = 1; - const FLAG_COMMENT_C = 2; - const FLAG_COMMENT_SQL = 4; - const FLAG_COMMENT_MYSQL_CMD = 8; - - // Operators related flags. - const FLAG_OPERATOR_ARITHMETIC = 1; - const FLAG_OPERATOR_LOGICAL = 2; - const FLAG_OPERATOR_BITWISE = 4; - const FLAG_OPERATOR_ASSIGNMENT = 8; - const FLAG_OPERATOR_SQL = 16; - - // Symbols related flags. - const FLAG_SYMBOL_VARIABLE = 1; - const FLAG_SYMBOL_BACKTICK = 2; - const FLAG_SYMBOL_USER = 4; - const FLAG_SYMBOL_SYSTEM = 8; - - /** - * The token it its raw string representation. - * - * @var string - */ - public $token; - - /** - * The value this token contains (i.e. token after some evaluation) - * - * @var mixed - */ - public $value; - - /** - * The type of this token. - * - * @var int - */ - public $type; - - /** - * The flags of this token. - * - * @var int - */ - public $flags; - - /** - * The position in the initial string where this token started. - * - * @var int - */ - public $position; - - /** - * Constructor. - * - * @param string $token The value of the token. - * @param int $type The type of the token. - * @param int $flags The flags of the token. - */ - public function __construct($token, $type = 0, $flags = 0) - { - $this->token = $token; - $this->type = $type; - $this->flags = $flags; - $this->value = $this->extract(); - } - - /** - * Does little processing to the token to extract a value. - * - * If no processing can be done it will return the initial string. - * - * @return mixed - */ - public function extract() - { - switch ($this->type) { - case Token::TYPE_KEYWORD: - if (!($this->flags & Token::FLAG_KEYWORD_RESERVED)) { - // Unreserved keywords should stay the way they are because they - // might represent field names. - return $this->token; - } - return strtoupper($this->token); - case Token::TYPE_WHITESPACE: - return ' '; - case Token::TYPE_BOOL: - return strtoupper($this->token) === 'TRUE'; - case Token::TYPE_NUMBER: - $ret = str_replace('--', '', $this->token); // e.g. ---42 === -42 - if ($this->flags & Token::FLAG_NUMBER_HEX) { - if ($this->flags & Token::FLAG_NUMBER_NEGATIVE) { - $ret = str_replace('-', '', $this->token); - sscanf($ret, '%x', $ret); - $ret = -$ret; - } else { - sscanf($ret, '%x', $ret); - } - } elseif (($this->flags & Token::FLAG_NUMBER_APPROXIMATE) - || ($this->flags & Token::FLAG_NUMBER_FLOAT) - ) { - sscanf($ret, '%f', $ret); - } else { - sscanf($ret, '%d', $ret); - } - return $ret; - case Token::TYPE_STRING: - $quote = $this->token[0]; - $str = str_replace($quote . $quote, $quote, $this->token); - return mb_substr($str, 1, -1, 'UTF-8'); // trims quotes - case Token::TYPE_SYMBOL: - $str = $this->token; - if ((isset($str[0])) && ($str[0] === '@')) { - // `mb_strlen($str)` must be used instead of `null` because - // in PHP 5.3- the `null` parameter isn't handled correctly. - $str = mb_substr( - $str, - ((!empty($str[1])) && ($str[1] === '@')) ? 2 : 1, - mb_strlen($str), - 'UTF-8' - ); - } - if ((isset($str[0])) && (($str[0] === '`') - || ($str[0] === '"') || ($str[0] === '\'')) - ) { - $quote = $str[0]; - $str = str_replace($quote . $quote, $quote, $str); - $str = mb_substr($str, 1, -1, 'UTF-8'); - } - return $str; - } - return $this->token; - } - - /** - * Converts the token into an inline token by replacing tabs and new lines. - * - * @return string - */ - public function getInlineToken() - { - return str_replace( - array("\r", "\n", "\t"), - array('\r', '\n', '\t'), - $this->token - ); - } -} diff --git a/#pma/libraries/sql-parser/src/TokensList.php b/#pma/libraries/sql-parser/src/TokensList.php deleted file mode 100644 index c0c2c89e..00000000 --- a/#pma/libraries/sql-parser/src/TokensList.php +++ /dev/null @@ -1,207 +0,0 @@ -tokens = $tokens; - if ($count === -1) { - $this->count = count($tokens); - } - } - } - - /** - * Builds an array of tokens by merging their raw value. - * - * @param string|Token[]|TokensList $list The tokens to be built. - * - * @return string - */ - public static function build($list) - { - if (is_string($list)) { - return $list; - } - - if ($list instanceof TokensList) { - $list = $list->tokens; - } - - $ret = ''; - if (is_array($list)) { - foreach ($list as $tok) { - $ret .= $tok->token; - } - } - return $ret; - } - - /** - * Adds a new token. - * - * @param Token $token Token to be added in list. - * - * @return void - */ - public function add(Token $token) - { - $this->tokens[$this->count++] = $token; - } - - /** - * Gets the next token. Skips any irrelevant token (whitespaces and - * comments). - * - * @return Token - */ - public function getNext() - { - for (; $this->idx < $this->count; ++$this->idx) { - if (($this->tokens[$this->idx]->type !== Token::TYPE_WHITESPACE) - && ($this->tokens[$this->idx]->type !== Token::TYPE_COMMENT) - ) { - return $this->tokens[$this->idx++]; - } - } - return null; - } - - /** - * Gets the next token. - * - * @param int $type The type. - * - * @return Token - */ - public function getNextOfType($type) - { - for (; $this->idx < $this->count; ++$this->idx) { - if ($this->tokens[$this->idx]->type === $type) { - return $this->tokens[$this->idx++]; - } - } - return null; - } - - /** - * Gets the next token. - * - * @param int $type The type of the token. - * @param string $value The value of the token. - * - * @return Token - */ - public function getNextOfTypeAndValue($type, $value) - { - for (; $this->idx < $this->count; ++$this->idx) { - if (($this->tokens[$this->idx]->type === $type) - && ($this->tokens[$this->idx]->value === $value) - ) { - return $this->tokens[$this->idx++]; - } - } - return null; - } - - /** - * Sets an value inside the container. - * - * @param int $offset The offset to be set. - * @param Token $value The token to be saved. - * - * @return void - */ - public function offsetSet($offset, $value) - { - if ($offset === null) { - $this->tokens[$this->count++] = $value; - } else { - $this->tokens[$offset] = $value; - } - } - - /** - * Gets a value from the container. - * - * @param int $offset The offset to be returned. - * - * @return Token - */ - public function offsetGet($offset) - { - return $offset < $this->count ? $this->tokens[$offset] : null; - } - - /** - * Checks if an offset was previously set. - * - * @param int $offset The offset to be checked. - * - * @return bool - */ - public function offsetExists($offset) - { - return $offset < $this->count; - } - - /** - * Unsets the value of an offset. - * - * @param int $offset The offset to be unset. - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->tokens[$offset]); - --$this->count; - for ($i = $offset; $i < $this->count; ++$i) { - $this->tokens[$i] = $this->tokens[$i + 1]; - } - unset($this->tokens[$this->count]); - } -} diff --git a/#pma/libraries/sql-parser/src/UtfString.php b/#pma/libraries/sql-parser/src/UtfString.php deleted file mode 100644 index c7b08d8e..00000000 --- a/#pma/libraries/sql-parser/src/UtfString.php +++ /dev/null @@ -1,217 +0,0 @@ -str = $str; - $this->byteIdx = 0; - $this->charIdx = 0; - // TODO: `strlen($str)` might return a wrong length when function - // overloading is enabled. - // https://php.net/manual/ro/mbstring.overload.php - $this->byteLen = strlen($str); - $this->charLen = mb_strlen($str, 'UTF-8'); - } - - /** - * Checks if the given offset exists. - * - * @param int $offset The offset to be checked. - * - * @return bool - */ - public function offsetExists($offset) - { - return ($offset >= 0) && ($offset < $this->charLen); - } - - /** - * Gets the character at given offset. - * - * @param int $offset The offset to be returned. - * - * @return string - */ - public function offsetGet($offset) - { - if (($offset < 0) || ($offset >= $this->charLen)) { - return null; - } - - $delta = $offset - $this->charIdx; - - if ($delta > 0) { - // Fast forwarding. - while ($delta-- > 0) { - $this->byteIdx += static::getCharLength($this->str[$this->byteIdx]); - ++$this->charIdx; - } - } elseif ($delta < 0) { - // Rewinding. - while ($delta++ < 0) { - do { - $byte = ord($this->str[--$this->byteIdx]); - } while ((128 <= $byte) && ($byte < 192)); - --$this->charIdx; - } - } - - $bytesCount = static::getCharLength($this->str[$this->byteIdx]); - - $ret = ''; - for ($i = 0; $bytesCount-- > 0; ++$i) { - $ret .= $this->str[$this->byteIdx + $i]; - } - - return $ret; - } - - /** - * Sets the value of a character. - * - * @param int $offset The offset to be set. - * @param string $value The value to be set. - * - * @throws \Exception Not implemented. - * - * @return void - */ - public function offsetSet($offset, $value) - { - throw new \Exception('Not implemented.'); - } - - /** - * Unsets an index. - * - * @param int $offset The value to be unset. - * - * @throws \Exception Not implemented. - * - * @return void - */ - public function offsetUnset($offset) - { - throw new \Exception('Not implemented.'); - } - - /** - * Gets the length of an UTF-8 character. - * - * According to RFC 3629, a UTF-8 character can have at most 4 bytes. - * However, this implementation supports UTF-8 characters containing up to 6 - * bytes. - * - * @param string $byte The byte to be analyzed. - * - * @see http://tools.ietf.org/html/rfc3629 - * - * @return int - */ - public static function getCharLength($byte) - { - $byte = ord($byte); - if ($byte < 128) { - return 1; - } elseif ($byte < 224) { - return 2; - } elseif ($byte < 240) { - return 3; - } elseif ($byte < 248) { - return 4; - } elseif ($byte < 252) { - return 5; // unofficial - } - return 6; // unofficial - } - - /** - * Returns the length in characters of the string. - * - * @return int - */ - public function length() - { - return $this->charLen; - } - - /** - * Returns the contained string. - * - * @return string - */ - public function __toString() - { - return $this->str; - } -} diff --git a/#pma/libraries/sql-parser/src/Utils/BufferedQuery.php b/#pma/libraries/sql-parser/src/Utils/BufferedQuery.php deleted file mode 100644 index b1ef46d4..00000000 --- a/#pma/libraries/sql-parser/src/Utils/BufferedQuery.php +++ /dev/null @@ -1,416 +0,0 @@ -options = array_merge( - array( - - /** - * The starting delimiter. - * - * @var string - */ - 'delimiter' => ';', - - /** - * Whether `DELIMITER` statements should be parsed. - * - * @var bool - */ - 'parse_delimiter' => false, - - /** - * Whether a delimiter should be added at the end of the - * statement. - * - * @var bool - */ - 'add_delimiter' => false, - ), - $options - ); - - $this->query = $query; - $this->setDelimiter($this->options['delimiter']); - } - - /** - * Sets the delimiter. - * - * Used to update the length of it too. - * - * @param string $delimiter - */ - public function setDelimiter($delimiter) - { - $this->delimiter = $delimiter; - $this->delimiterLen = strlen($delimiter); - } - - /** - * Extracts a statement from the buffer. - * - * @param bool $end Whether the end of the buffer was reached. - * - * @return string - */ - public function extract($end = false) - { - /** - * The last parsed position. - * - * This is statically defined because it is not used outside anywhere - * outside this method and there is probably a (minor) performance - * improvement to it. - * - * @var int - */ - static $i = 0; - - if (empty($this->query)) { - return false; - } - - /** - * The length of the buffer. - * - * @var int $len - */ - $len = strlen($this->query); - - /** - * The last index of the string that is going to be parsed. - * - * There must be a few characters left in the buffer so the parser can - * avoid confusing some symbols that may have multiple meanings. - * - * For example, if the buffer ends in `-` that may be an operator or the - * beginning of a comment. - * - * Another example if the buffer ends in `DELIMITE`. The parser is going - * to require a few more characters because that may be a part of the - * `DELIMITER` keyword or just a column named `DELIMITE`. - * - * Those extra characters are required only if there is more data - * expected (the end of the buffer was not reached). - * - * @var int $loopLen - */ - $loopLen = $end ? $len : $len - 16; - - for (; $i < $loopLen; ++$i) { - /** - * Handling backslash. - * - * Even if the next character is a special character that should be - * treated differently, because of the preceding backslash, it will - * be ignored. - */ - if ((($this->status & static::STATUS_COMMENT) == 0) && ($this->query[$i] === '\\')) { - $this->current .= $this->query[$i] . $this->query[++$i]; - continue; - } - - /* - * Handling special parses statuses. - */ - if ($this->status === static::STATUS_STRING_SINGLE_QUOTES) { - // Single-quoted strings like 'foo'. - if ($this->query[$i] === '\'') { - $this->status = 0; - } - $this->current .= $this->query[$i]; - continue; - } elseif ($this->status === static::STATUS_STRING_DOUBLE_QUOTES) { - // Double-quoted strings like "bar". - if ($this->query[$i] === '"') { - $this->status = 0; - } - $this->current .= $this->query[$i]; - continue; - } elseif ($this->status === static::STATUS_STRING_BACKTICK) { - if ($this->query[$i] === '`') { - $this->status = 0; - } - $this->current .= $this->query[$i]; - continue; - } elseif (($this->status === static::STATUS_COMMENT_BASH) - || ($this->status === static::STATUS_COMMENT_SQL) - ) { - // Bash-like (#) or SQL-like (-- ) comments end in new line. - if ($this->query[$i] === "\n") { - $this->status = 0; - } - continue; - } elseif ($this->status === static::STATUS_COMMENT_C) { - // C-like comments end in */. - if (($this->query[$i - 1] === '*') && ($this->query[$i] === '/')) { - $this->status = 0; - } - continue; - } - - /* - * Checking if a string started. - */ - if ($this->query[$i] === '\'') { - $this->status = static::STATUS_STRING_SINGLE_QUOTES; - $this->current .= $this->query[$i]; - continue; - } elseif ($this->query[$i] === '"') { - $this->status = static::STATUS_STRING_DOUBLE_QUOTES; - $this->current .= $this->query[$i]; - continue; - } elseif ($this->query[$i] === '`') { - $this->status = static::STATUS_STRING_BACKTICK; - $this->current .= $this->query[$i]; - continue; - } - - /* - * Checking if a comment started. - */ - if ($this->query[$i] === '#') { - $this->status = static::STATUS_COMMENT_BASH; - continue; - } elseif (($i + 2 < $len) - && ($this->query[$i] === '-') - && ($this->query[$i + 1] === '-') - && (Context::isWhitespace($this->query[$i + 2])) - ) { - $this->status = static::STATUS_COMMENT_SQL; - continue; - } elseif (($i + 2 < $len) - && ($this->query[$i] === '/') - && ($this->query[$i + 1] === '*') - && ($this->query[$i + 2] !== '!') - ) { - $this->status = static::STATUS_COMMENT_C; - continue; - } - - /* - * Handling `DELIMITER` statement. - * - * The code below basically checks for - * `strtoupper(substr($this->query, $i, 9)) === 'DELIMITER'` - * - * This optimization makes the code about 3 times faster. - * - * `DELIMITER` is not being considered a keyword. The only context - * it has a special meaning is when it is the beginning of a - * statement. This is the reason for the last condition. - */ - if (($i + 9 < $len) - && (($this->query[$i ] === 'D') || ($this->query[$i ] === 'd')) - && (($this->query[$i + 1] === 'E') || ($this->query[$i + 1] === 'e')) - && (($this->query[$i + 2] === 'L') || ($this->query[$i + 2] === 'l')) - && (($this->query[$i + 3] === 'I') || ($this->query[$i + 3] === 'i')) - && (($this->query[$i + 4] === 'M') || ($this->query[$i + 4] === 'm')) - && (($this->query[$i + 5] === 'I') || ($this->query[$i + 5] === 'i')) - && (($this->query[$i + 6] === 'T') || ($this->query[$i + 6] === 't')) - && (($this->query[$i + 7] === 'E') || ($this->query[$i + 7] === 'e')) - && (($this->query[$i + 8] === 'R') || ($this->query[$i + 8] === 'r')) - && (Context::isWhitespace($this->query[$i + 9])) - && (trim($this->current) === '') - ) { - // Saving the current index to be able to revert any parsing - // done in this block. - $iBak = $i; - $i += 9; // Skipping `DELIMITER`. - - // Skipping whitespaces. - while (($i < $len) && (Context::isWhitespace($this->query[$i]))) { - ++$i; - } - - // Parsing the delimiter. - $delimiter = ''; - while (($i < $len) && (!Context::isWhitespace($this->query[$i]))) { - $delimiter .= $this->query[$i++]; - } - - // Checking if the delimiter definition ended. - if (($delimiter != '') - && ((($i < $len) && (Context::isWhitespace($this->query[$i]))) - || (($i === $len) && ($end))) - ) { - // Saving the delimiter. - $this->setDelimiter($delimiter); - - // Whether this statement should be returned or not. - $ret = ''; - if (!empty($this->options['parse_delimiter'])) { - // Appending the `DELIMITER` statement that was just - // found to the current statement. - $ret = trim( - $this->current . ' ' . substr($this->query, $iBak, $i - $iBak) - ); - } - - // Removing the statement that was just extracted from the - // query. - $this->query = substr($this->query, $i); - $i = 0; - - // Resetting the current statement. - $this->current = ''; - - return $ret; - } - - // Incomplete statement. Reverting - $i = $iBak; - return false; - } - - /* - * Checking if the current statement finished. - * - * The first letter of the delimiter is being checked as an - * optimization. This code is almost as fast as the one above. - * - * There is no point in checking if two strings match if not even - * the first letter matches. - */ - if (($this->query[$i] === $this->delimiter[0]) - && (($this->delimiterLen === 1) - || (substr($this->query, $i, $this->delimiterLen) === $this->delimiter)) - ) { - // Saving the statement that just ended. - $ret = $this->current; - - // If needed, adds a delimiter at the end of the statement. - if (!empty($this->options['add_delimiter'])) { - $ret .= $this->delimiter; - } - - // Removing the statement that was just extracted from the - // query. - $this->query = substr($this->query, $i + $this->delimiterLen); - $i = 0; - - // Resetting the current statement. - $this->current = ''; - - // Returning the statement. - return trim($ret); - } - - /* - * Appending current character to current statement. - */ - $this->current .= $this->query[$i]; - } - - if (($end) && ($i === $len)) { - // If the end of the buffer was reached, the buffer is emptied and - // the current statement that was extracted is returned. - $ret = $this->current; - - // Emptying the buffer. - $this->query = ''; - $i = 0; - - // Resetting the current statement. - $this->current = ''; - - // Returning the statement. - return trim($ret); - } - - return ''; - } -} diff --git a/#pma/libraries/sql-parser/src/Utils/CLI.php b/#pma/libraries/sql-parser/src/Utils/CLI.php deleted file mode 100644 index 9ec7b853..00000000 --- a/#pma/libraries/sql-parser/src/Utils/CLI.php +++ /dev/null @@ -1,127 +0,0 @@ -getopt( - 'hq:f:', $longopts - ); - if ($params === false) { - return false; - } - $this->mergeLongOpts($params, $longopts); - if (! isset($params['f'])) { - $params['f'] = 'cli'; - } - if (! in_array($params['f'], array('html', 'cli', 'text'))) { - echo "ERROR: Invalid value for format!\n"; - return false; - } - return $params; - } - - public function runHighlight() - { - $params = $this->parseHighlight(); - if ($params === false) { - return 1; - } - if (isset($params['h'])) { - $this->usageHighlight(); - return 0; - } - if (isset($params['q'])) { - echo Formatter::format( - $params['q'], array('type' => $params['f']) - ); - echo "\n"; - return 0; - } - echo "ERROR: Missing parameters!\n"; - $this->usageHighlight(); - return 1; - } - - public function usageLint() - { - echo "Usage: lint-query --query SQL\n"; - } - - public function parseLint() - { - $longopts = array('help', 'query:'); - $params = $this->getopt( - 'hq:', $longopts - ); - $this->mergeLongOpts($params, $longopts); - return $params; - } - - public function runLint() - { - $params = $this->parseLint(); - if ($params === false) { - return 1; - } - if (isset($params['h'])) { - $this->usageLint(); - return 0; - } - if (isset($params['q'])) { - $lexer = new Lexer($params['q'], false); - $parser = new Parser($lexer->list); - $errors = Error::get(array($lexer, $parser)); - if (count($errors) == 0) { - return 0; - } - $output = Error::format($errors); - echo implode("\n", $output); - echo "\n"; - return 10; - } - echo "ERROR: Missing parameters!\n"; - $this->usageLint(); - return 1; - } -} diff --git a/#pma/libraries/sql-parser/src/Utils/Error.php b/#pma/libraries/sql-parser/src/Utils/Error.php deleted file mode 100644 index 2e942c44..00000000 --- a/#pma/libraries/sql-parser/src/Utils/Error.php +++ /dev/null @@ -1,99 +0,0 @@ -errors as $err) { - $ret[] = array( - $err->getMessage(), - $err->getCode(), - $err->ch, - $err->pos - ); - } - } elseif ($obj instanceof Parser) { - foreach ($obj->errors as $err) { - $ret[] = array( - $err->getMessage(), - $err->getCode(), - $err->token->token, - $err->token->position - ); - } - } - } - - return $ret; - } - - /** - * Formats the specified errors - * - * @param array $errors The errors to be formatted. - * @param string $format The format of an error. - * '$1$d' is replaced by the position of this error. - * '$2$s' is replaced by the error message. - * '$3$d' is replaced by the error code. - * '$4$s' is replaced by the string that caused the - * issue. - * '$5$d' is replaced by the position of the string. - * @return array - */ - public static function format( - $errors, - $format = '#%1$d: %2$s (near "%4$s" at position %5$d)' - ) { - $ret = array(); - - $i = 0; - foreach ($errors as $key => $err) { - $ret[$key] = sprintf( - $format, - ++$i, - $err[0], - $err[1], - htmlspecialchars($err[2]), - $err[3] - ); - } - - return $ret; - } -} diff --git a/#pma/libraries/sql-parser/src/Utils/Formatter.php b/#pma/libraries/sql-parser/src/Utils/Formatter.php deleted file mode 100644 index bcf54862..00000000 --- a/#pma/libraries/sql-parser/src/Utils/Formatter.php +++ /dev/null @@ -1,573 +0,0 @@ - true, - 'LIMIT' => true, - 'PARTITION BY' => true, - 'PARTITION' => true, - 'PROCEDURE' => true, - 'SUBPARTITION BY' => true, - 'VALUES' => true, - ); - - /** - * Constructor. - * - * @param array $options The formatting options. - */ - public function __construct(array $options = array()) - { - // The specified formatting options are merged with the default values. - $this->options = array_merge( - array( - - /** - * The format of the result. - * - * @var string The type ('text', 'cli' or 'html') - */ - 'type' => php_sapi_name() == 'cli' ? 'cli' : 'text', - - /** - * The line ending used. - * By default, for text this is "\n" and for HTML this is "
    ". - * - * @var string - */ - 'line_ending' => NULL, - - /** - * The string used for indentation. - * - * @var string - */ - 'indentation' => ' ', - - /** - * Whether comments should be removed or not. - * - * @var bool - */ - 'remove_comments' => false, - - /** - * Whether each clause should be on a new line. - * - * @var bool - */ - 'clause_newline' => true, - - /** - * Whether each part should be on a new line. - * Parts are delimited by brackets and commas. - * - * @var bool - */ - 'parts_newline' => true, - - /** - * Whether each part of each clause should be indented. - * - * @var bool - */ - 'indent_parts' => true, - - /** - * The styles used for HTML formatting. - * array($type, $flags, $span, $callback) - * - * @var array[] - */ - 'formats' => array( - array( - 'type' => Token::TYPE_KEYWORD, - 'flags' => Token::FLAG_KEYWORD_RESERVED, - 'html' => 'class="sql-reserved"', - 'cli' => "\x1b[35m", - 'function' => 'strtoupper', - ), - array( - 'type' => Token::TYPE_KEYWORD, - 'flags' => 0, - 'html' => 'class="sql-keyword"', - 'cli' => "\x1b[95m", - 'function' => 'strtoupper', - ), - array( - 'type' => Token::TYPE_COMMENT, - 'flags' => 0, - 'html' => 'class="sql-comment"', - 'cli' => "\x1b[37m", - 'function' => '', - ), - array( - 'type' => Token::TYPE_BOOL, - 'flags' => 0, - 'html' => 'class="sql-atom"', - 'cli' => "\x1b[36m", - 'function' => 'strtoupper', - ), - array( - 'type' => Token::TYPE_NUMBER, - 'flags' => 0, - 'html' => 'class="sql-number"', - 'cli' => "\x1b[92m", - 'function' => 'strtolower', - ), - array( - 'type' => Token::TYPE_STRING, - 'flags' => 0, - 'html' => 'class="sql-string"', - 'cli' => "\x1b[91m", - 'function' => '', - ), - array( - 'type' => Token::TYPE_SYMBOL, - 'flags' => 0, - 'html' => 'class="sql-variable"', - 'cli' => "\x1b[36m", - 'function' => '', - ), - ) - ), - $options - ); - - if (is_null($this->options['line_ending'])) { - $this->options['line_ending'] = $this->options['type'] == 'html' ? '
    ' : "\n"; - } - - // `parts_newline` requires `clause_newline` - $this->options['parts_newline'] &= $this->options['clause_newline']; - } - - /** - * Formats the given list of tokens. - * - * @param TokensList $list The list of tokens. - * - * @return string - */ - public function formatList($list) - { - - /** - * The query to be returned. - * - * @var string $ret - */ - $ret = ''; - - /** - * The indentation level. - * - * @var int $indent - */ - $indent = 0; - - /** - * Whether the line ended. - * - * @var bool $lineEnded - */ - $lineEnded = false; - - /** - * Whether current group is short (no linebreaks) - * - * @var bool $shortGroup - */ - $shortGroup = false; - - /** - * The name of the last clause. - * - * @var string $lastClause - */ - $lastClause = ''; - - /** - * A stack that keeps track of the indentation level every time a new - * block is found. - * - * @var array $blocksIndentation - */ - $blocksIndentation = array(); - - /** - * A stack that keeps track of the line endings every time a new block - * is found. - * - * @var array $blocksLineEndings - */ - $blocksLineEndings = array(); - - /** - * Whether clause's options were formatted. - * - * @var bool $formattedOptions - */ - $formattedOptions = false; - - /** - * Previously parsed token. - * - * @var Token $prev - */ - $prev = null; - - /** - * Comments are being formatted separately to maintain the whitespaces - * before and after them. - * - * @var string $comment - */ - $comment = ''; - - // In order to be able to format the queries correctly, the next token - // must be taken into consideration. The loop below uses two pointers, - // `$prev` and `$curr` which store two consecutive tokens. - // Actually, at every iteration the previous token is being used. - for ($list->idx = 0; $list->idx < $list->count; ++$list->idx) { - /** - * Token parsed at this moment. - * - * @var Token $curr - */ - $curr = $list->tokens[$list->idx]; - - if ($curr->type === Token::TYPE_WHITESPACE) { - // Whitespaces are skipped because the formatter adds its own. - continue; - } elseif ($curr->type === Token::TYPE_COMMENT) { - // Whether the comments should be parsed. - if (!empty($this->options['remove_comments'])) { - continue; - } - - if ($list->tokens[$list->idx - 1]->type === Token::TYPE_WHITESPACE) { - // The whitespaces before and after are preserved for - // formatting reasons. - $comment .= $list->tokens[$list->idx - 1]->token; - } - $comment .= $this->toString($curr); - if (($list->tokens[$list->idx + 1]->type === Token::TYPE_WHITESPACE) - && ($list->tokens[$list->idx + 2]->type !== Token::TYPE_COMMENT) - ) { - // Adding the next whitespace only there is no comment that - // follows it immediately which may cause adding a - // whitespace twice. - $comment .= $list->tokens[$list->idx + 1]->token; - } - - // Everything was handled here, no need to continue. - continue; - } - - // Checking if pointers were initialized. - if ($prev !== null) { - // Checking if a new clause started. - if (static::isClause($prev) !== false) { - $lastClause = $prev->value; - $formattedOptions = false; - } - - // The options of a clause should stay on the same line and everything that follows. - if (($this->options['parts_newline']) - && (!$formattedOptions) - && (empty(self::$INLINE_CLAUSES[$lastClause])) - && (($curr->type !== Token::TYPE_KEYWORD) - || (($curr->type === Token::TYPE_KEYWORD) - && ($curr->flags & Token::FLAG_KEYWORD_FUNCTION))) - ) { - $formattedOptions = true; - $lineEnded = true; - ++$indent; - } - - // Checking if this clause ended. - if ($tmp = static::isClause($curr)) { - if (($tmp == 2) || ($this->options['clause_newline'])) { - $lineEnded = true; - if ($this->options['parts_newline']) { - --$indent; - } - } - } - - // Indenting BEGIN ... END blocks. - if (($prev->type === Token::TYPE_KEYWORD) && ($prev->value === 'BEGIN')) { - $lineEnded = true; - array_push($blocksIndentation, $indent); - ++$indent; - } elseif (($curr->type === Token::TYPE_KEYWORD) && ($curr->value === 'END')) { - $lineEnded = true; - $indent = array_pop($blocksIndentation); - } - - // Formatting fragments delimited by comma. - if (($prev->type === Token::TYPE_OPERATOR) && ($prev->value === ',')) { - // Fragments delimited by a comma are broken into multiple - // pieces only if the clause is not inlined or this fragment - // is between brackets that are on new line. - if (((empty(self::$INLINE_CLAUSES[$lastClause])) - && ! $shortGroup - && ($this->options['parts_newline'])) - || (end($blocksLineEndings) === true) - ) { - $lineEnded = true; - } - } - - // Handling brackets. - // Brackets are indented only if the length of the fragment between - // them is longer than 30 characters. - if (($prev->type === Token::TYPE_OPERATOR) && ($prev->value === '(')) { - array_push($blocksIndentation, $indent); - $shortGroup = true; - if (static::getGroupLength($list) > 30) { - ++$indent; - $lineEnded = true; - $shortGroup = false; - } - array_push($blocksLineEndings, $lineEnded); - } elseif (($curr->type === Token::TYPE_OPERATOR) && ($curr->value === ')')) { - $indent = array_pop($blocksIndentation); - $lineEnded |= array_pop($blocksLineEndings); - $shortGroup = false; - } - - // Delimiter must be placed on the same line with the last - // clause. - if ($curr->type === Token::TYPE_DELIMITER) { - $lineEnded = false; - } - - // Adding the token. - $ret .= $this->toString($prev); - - // Finishing the line. - if ($lineEnded) { - if ($indent < 0) { - // TODO: Make sure this never occurs and delete it. - $indent = 0; - } - - if ($curr->type !== Token::TYPE_COMMENT) { - $ret .= $this->options['line_ending'] - . str_repeat($this->options['indentation'], $indent); - } - $lineEnded = false; - } else { - // If the line ended there is no point in adding whitespaces. - // Also, some tokens do not have spaces before or after them. - if (!((($prev->type === Token::TYPE_OPERATOR) && (($prev->value === '.') || ($prev->value === '('))) - // No space after . ( - || (($curr->type === Token::TYPE_OPERATOR) && (($curr->value === '.') || ($curr->value === ',') - || ($curr->value === '(') || ($curr->value === ')'))) - // No space before . , ( ) - || (($curr->type === Token::TYPE_DELIMITER)) && (mb_strlen($curr->value, 'UTF-8') < 2)) - // A space after delimiters that are longer than 2 characters. - || ($prev->value === 'DELIMITER') - ) { - $ret .= ' '; - } - } - } - - if (!empty($comment)) { - $ret .= $comment; - $comment = ''; - } - - // Iteration finished, consider current token as previous. - $prev = $curr; - } - - if ($this->options['type'] === 'cli') { - return $ret . "\x1b[0m"; - } - - return $ret; - } - - public function escapeConsole($string) - { - return str_replace( - array( - "\x00", "\x01", "\x02", "\x03", "\x04", - "\x05", "\x06", "\x07", "\x08", "\x09", "\x0A", - "\x0B","\x0C","\x0D", "\x0E", "\x0F", "\x10", "\x11", - "\x12","\x13","\x14","\x15", "\x16", "\x17", "\x18", - "\x19","\x1A","\x1B","\x1C","\x1D", "\x1E", "\x1F" - ), - array( - '\x00', '\x01', '\x02', '\x03', '\x04', - '\x05', '\x06', '\x07', '\x08', '\x09', '\x0A', - '\x0B', '\x0C', '\x0D', '\x0E', '\x0F', '\x10', '\x11', - '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', - '\x19', '\x1A', '\x1B', '\x1C', '\x1D', '\x1E', '\x1F' - ), - $string - ); - } - - /** - * Tries to print the query and returns the result. - * - * @param Token $token The token to be printed. - * - * @return string - */ - public function toString($token) - { - $text = $token->token; - - foreach ($this->options['formats'] as $format) { - if (($token->type === $format['type']) - && (($token->flags & $format['flags']) === $format['flags']) - ) { - // Running transformation function. - if (!empty($format['function'])) { - $func = $format['function']; - $text = $func($text); - } - - // Formatting HTML. - if ($this->options['type'] === 'html') { - return '' . htmlspecialchars($text, ENT_NOQUOTES) . ''; - } elseif ($this->options['type'] === 'cli') { - return $format['cli'] . $this->escapeConsole($text); - } - - break; - } - } - - if ($this->options['type'] === 'cli') { - return "\x1b[39m" . $this->escapeConsole($text); - } elseif ($this->options['type'] === 'html') { - return htmlspecialchars($text, ENT_NOQUOTES); - } - } - - /** - * Formats a query. - * - * @param string $query The query to be formatted - * @param array $options The formatting options. - * - * @return string The formatted string. - */ - public static function format($query, array $options = array()) - { - $lexer = new Lexer($query); - $formatter = new Formatter($options); - return $formatter->formatList($lexer->list); - } - - /** - * Computes the length of a group. - * - * A group is delimited by a pair of brackets. - * - * @param TokensList $list The list of tokens. - * - * @return int - */ - public static function getGroupLength($list) - { - /** - * The number of opening brackets found. - * This counter starts at one because by the time this function called, - * the list already advanced one position and the opening bracket was - * already parsed. - * - * @var int $count - */ - $count = 1; - - /** - * The length of this group. - * - * @var int $length - */ - $length = 0; - - for ($idx = $list->idx; $idx < $list->count; ++$idx) { - // Counting the brackets. - if ($list->tokens[$idx]->type === Token::TYPE_OPERATOR) { - if ($list->tokens[$idx]->value === '(') { - ++$count; - } elseif ($list->tokens[$idx]->value === ')') { - --$count; - if ($count == 0) { - break; - } - } - } - - // Keeping track of this group's length. - $length += mb_strlen($list->tokens[$idx]->value, 'UTF-8'); - } - - return $length; - } - - /** - * Checks if a token is a statement or a clause inside a statement. - * - * @param Token $token The token to be checked. - * - * @return int|bool - */ - public static function isClause($token) - { - if ((($token->type === Token::TYPE_NONE) && (strtoupper($token->token) === 'DELIMITER')) - || (($token->type === Token::TYPE_KEYWORD) && (isset(Parser::$STATEMENT_PARSERS[$token->value]))) - ) { - return 2; - } elseif (($token->type === Token::TYPE_KEYWORD) && (isset(Parser::$KEYWORD_PARSERS[$token->value]))) { - return 1; - } - return false; - } -} diff --git a/#pma/libraries/sql-parser/src/Utils/Misc.php b/#pma/libraries/sql-parser/src/Utils/Misc.php deleted file mode 100644 index 8166c458..00000000 --- a/#pma/libraries/sql-parser/src/Utils/Misc.php +++ /dev/null @@ -1,113 +0,0 @@ -expr)) - || (empty($statement->from)) - ) { - return array(); - } - - $retval = array(); - - $tables = array(); - - /** - * Expressions that may contain aliases. - * These are extracted from `FROM` and `JOIN` keywords. - * - * @var Expression[] $expressions - */ - $expressions = $statement->from; - - // Adding expressions from JOIN. - if (!empty($statement->join)) { - foreach ($statement->join as $join) { - $expressions[] = $join->expr; - } - } - - foreach ($expressions as $expr) { - if ((!isset($expr->table)) || ($expr->table === '')) { - continue; - } - - $thisDb = ((isset($expr->database)) && ($expr->database !== '')) ? - $expr->database : $database; - - if (!isset($retval[$thisDb])) { - $retval[$thisDb] = array( - 'alias' => null, - 'tables' => array(), - ); - } - - if (!isset($retval[$thisDb]['tables'][$expr->table])) { - $retval[$thisDb]['tables'][$expr->table] = array( - 'alias' => ((isset($expr->alias)) && ($expr->alias !== '')) ? - $expr->alias : null, - 'columns' => array(), - ); - } - - if (!isset($tables[$thisDb])) { - $tables[$thisDb] = array(); - } - $tables[$thisDb][$expr->alias] = $expr->table; - } - - foreach ($statement->expr as $expr) { - if ((!isset($expr->column)) || ($expr->column === '') - || (!isset($expr->alias)) || ($expr->alias === '') - ) { - continue; - } - - $thisDb = ((isset($expr->database)) && ($expr->database !== '')) ? - $expr->database : $database; - - if ((isset($expr->table)) && ($expr->table !== '')) { - $thisTable = isset($tables[$thisDb][$expr->table]) ? - $tables[$thisDb][$expr->table] : $expr->table; - $retval[$thisDb]['tables'][$thisTable]['columns'][$expr->column] = $expr->alias; - } else { - foreach ($retval[$thisDb]['tables'] as &$table) { - $table['columns'][$expr->column] = $expr->alias; - } - } - } - - return $retval; - } -} diff --git a/#pma/libraries/sql-parser/src/Utils/Query.php b/#pma/libraries/sql-parser/src/Utils/Query.php deleted file mode 100644 index 4d66a90a..00000000 --- a/#pma/libraries/sql-parser/src/Utils/Query.php +++ /dev/null @@ -1,840 +0,0 @@ - false, - - /** - * drop ... DATABASE ... - */ - 'drop_database' => false, - - /** - * ... GROUP BY ... - */ - 'group' => false, - - /** - * ... HAVING ... - */ - 'having' => false, - - /** - * INSERT ... - * or - * REPLACE ... - * or - * DELETE ... - */ - 'is_affected' => false, - - /** - * select ... PROCEDURE ANALYSE( ... ) ... - */ - 'is_analyse' => false, - - /** - * select COUNT( ... ) ... - */ - 'is_count' => false, - - /** - * DELETE ... - */ - 'is_delete' => false, // @deprecated; use `querytype` - - /** - * EXPLAIN ... - */ - 'is_explain' => false, // @deprecated; use `querytype` - - /** - * select ... INTO OUTFILE ... - */ - 'is_export' => false, - - /** - * select FUNC( ... ) ... - */ - 'is_func' => false, - - /** - * select ... GROUP BY ... - * or - * select ... HAVING ... - */ - 'is_group' => false, - - /** - * INSERT ... - * or - * REPLACE ... - * or - * TODO: LOAD DATA ... - */ - 'is_insert' => false, - - /** - * ANALYZE ... - * or - * CHECK ... - * or - * CHECKSUM ... - * or - * OPTIMIZE ... - * or - * REPAIR ... - */ - 'is_maint' => false, - - /** - * CALL ... - */ - 'is_procedure' => false, - - /** - * REPLACE ... - */ - 'is_replace' => false, // @deprecated; use `querytype` - - /** - * SELECT ... - */ - 'is_select' => false, // @deprecated; use `querytype` - - /** - * SHOW ... - */ - 'is_show' => false, // @deprecated; use `querytype` - - /** - * Contains a subquery. - */ - 'is_subquery' => false, - - /** - * ... JOIN ... - */ - 'join' => false, - - /** - * ... LIMIT ... - */ - 'limit' => false, - - /** - * TODO - */ - 'offset' => false, - - /** - * ... ORDER ... - */ - 'order' => false, - - /** - * The type of the query (which is usually the first keyword of - * the statement). - */ - 'querytype' => false, - - /** - * Whether a page reload is required. - */ - 'reload' => false, - - /** - * SELECT ... FROM ... - */ - 'select_from' => false, - - /** - * ... UNION ... - */ - 'union' => false - ); - } - - if ($statement instanceof AlterStatement) { - $flags['querytype'] = 'ALTER'; - $flags['reload'] = true; - } elseif ($statement instanceof CreateStatement) { - $flags['querytype'] = 'CREATE'; - $flags['reload'] = true; - } elseif ($statement instanceof AnalyzeStatement) { - $flags['querytype'] = 'ANALYZE'; - $flags['is_maint'] = true; - } elseif ($statement instanceof CheckStatement) { - $flags['querytype'] = 'CHECK'; - $flags['is_maint'] = true; - } elseif ($statement instanceof ChecksumStatement) { - $flags['querytype'] = 'CHECKSUM'; - $flags['is_maint'] = true; - } elseif ($statement instanceof OptimizeStatement) { - $flags['querytype'] = 'OPTIMIZE'; - $flags['is_maint'] = true; - } elseif ($statement instanceof RepairStatement) { - $flags['querytype'] = 'REPAIR'; - $flags['is_maint'] = true; - } elseif ($statement instanceof CallStatement) { - $flags['querytype'] = 'CALL'; - $flags['is_procedure'] = true; - } elseif ($statement instanceof DeleteStatement) { - $flags['querytype'] = 'DELETE'; - $flags['is_delete'] = true; - $flags['is_affected'] = true; - } elseif ($statement instanceof DropStatement) { - $flags['querytype'] = 'DROP'; - $flags['reload'] = true; - - if (($statement->options->has('DATABASE') - || ($statement->options->has('SCHEMA'))) - ) { - $flags['drop_database'] = true; - } - } elseif ($statement instanceof ExplainStatement) { - $flags['querytype'] = 'EXPLAIN'; - $flags['is_explain'] = true; - } elseif ($statement instanceof InsertStatement) { - $flags['querytype'] = 'INSERT'; - $flags['is_affected'] = true; - $flags['is_insert'] = true; - } elseif ($statement instanceof ReplaceStatement) { - $flags['querytype'] = 'REPLACE'; - $flags['is_affected'] = true; - $flags['is_replace'] = true; - $flags['is_insert'] = true; - } elseif ($statement instanceof SelectStatement) { - $flags['querytype'] = 'SELECT'; - $flags['is_select'] = true; - - if (!empty($statement->from)) { - $flags['select_from'] = true; - } - - if ($statement->options->has('DISTINCT')) { - $flags['distinct'] = true; - } - - if ((!empty($statement->group)) || (!empty($statement->having))) { - $flags['is_group'] = true; - } - - if ((!empty($statement->into)) - && ($statement->into->type === 'OUTFILE') - ) { - $flags['is_export'] = true; - } - - $expressions = $statement->expr; - if (!empty($statement->join)) { - foreach ($statement->join as $join) { - $expressions[] = $join->expr; - } - } - - foreach ($expressions as $expr) { - if (!empty($expr->function)) { - if ($expr->function === 'COUNT') { - $flags['is_count'] = true; - } elseif (in_array($expr->function, static::$FUNCTIONS)) { - $flags['is_func'] = true; - } - } - if (!empty($expr->subquery)) { - $flags['is_subquery'] = true; - } - } - - if ((!empty($statement->procedure)) - && ($statement->procedure->name === 'ANALYSE') - ) { - $flags['is_analyse'] = true; - } - - if (!empty($statement->group)) { - $flags['group'] = true; - } - - if (!empty($statement->having)) { - $flags['having'] = true; - } - - if (!empty($statement->union)) { - $flags['union'] = true; - } - - if (!empty($statement->join)) { - $flags['join'] = true; - } - - } elseif ($statement instanceof ShowStatement) { - $flags['querytype'] = 'SHOW'; - $flags['is_show'] = true; - } elseif ($statement instanceof UpdateStatement) { - $flags['querytype'] = 'UPDATE'; - $flags['is_affected'] = true; - } - - if (($statement instanceof SelectStatement) - || ($statement instanceof UpdateStatement) - || ($statement instanceof DeleteStatement) - ) { - if (!empty($statement->limit)) { - $flags['limit'] = true; - } - if (!empty($statement->order)) { - $flags['order'] = true; - } - } - - return $flags; - } - - /** - * Parses a query and gets all information about it. - * - * @param string $query The query to be parsed. - * - * @return array The array returned is the one returned by - * `static::getFlags()`, with the following keys added: - * - parser - the parser used to analyze the query; - * - statement - the first statement resulted from parsing; - * - select_tables - the real name of the tables selected; - * if there are no table names in the `SELECT` - * expressions, the table names are fetched from the - * `FROM` expressions - * - select_expr - selected expressions - */ - public static function getAll($query) - { - $parser = new Parser($query); - - if (empty($parser->statements[0])) { - return static::getFlags(null, true); - } - - $statement = $parser->statements[0]; - - $ret = static::getFlags($statement, true); - - $ret['parser'] = $parser; - $ret['statement'] = $statement; - - if ($statement instanceof SelectStatement) { - $ret['select_tables'] = array(); - $ret['select_expr'] = array(); - - // Finding tables' aliases and their associated real names. - $tableAliases = array(); - foreach ($statement->from as $expr) { - if ((isset($expr->table)) && ($expr->table !== '') - && (isset($expr->alias)) && ($expr->alias !== '') - ) { - $tableAliases[$expr->alias] = array( - $expr->table, - isset($expr->database) ? $expr->database : null - ); - } - } - - // Trying to find selected tables only from the select expression. - // Sometimes, this is not possible because the tables aren't defined - // explicitly (e.g. SELECT * FROM film, SELECT film_id FROM film). - foreach ($statement->expr as $expr) { - if ((isset($expr->table)) && ($expr->table !== '')) { - if (isset($tableAliases[$expr->table])) { - $arr = $tableAliases[$expr->table]; - } else { - $arr = array( - $expr->table, - ((isset($expr->database)) && ($expr->database !== '')) ? - $expr->database : null - ); - } - if (!in_array($arr, $ret['select_tables'])) { - $ret['select_tables'][] = $arr; - } - } else { - $ret['select_expr'][] = $expr->expr; - } - } - - // If no tables names were found in the SELECT clause or if there - // are expressions like * or COUNT(*), etc. tables names should be - // extracted from the FROM clause. - if (empty($ret['select_tables'])) { - foreach ($statement->from as $expr) { - if ((isset($expr->table)) && ($expr->table !== '')) { - $arr = array( - $expr->table, - ((isset($expr->database)) && ($expr->database !== '')) ? - $expr->database : null - ); - if (!in_array($arr, $ret['select_tables'])) { - $ret['select_tables'][] = $arr; - } - } - } - } - } - - return $ret; - } - - /** - * Gets a list of all tables used in this statement. - * - * @param Statement $statement Statement to be scanned. - * - * @return array - */ - public static function getTables($statement) - { - $expressions = array(); - - if (($statement instanceof InsertStatement) - || ($statement instanceof ReplaceStatement) - ) { - $expressions = array($statement->into->dest); - } elseif ($statement instanceof UpdateStatement) { - $expressions = $statement->tables; - } elseif (($statement instanceof SelectStatement) - || ($statement instanceof DeleteStatement) - ) { - $expressions = $statement->from; - } elseif (($statement instanceof AlterStatement) - || ($statement instanceof TruncateStatement) - ) { - $expressions = array($statement->table); - } elseif ($statement instanceof DropStatement) { - if (!$statement->options->has('TABLE')) { - // No tables are dropped. - return array(); - } - $expressions = $statement->fields; - } elseif ($statement instanceof RenameStatement) { - foreach ($statement->renames as $rename) { - $expressions[] = $rename->old; - } - } - - $ret = array(); - foreach ($expressions as $expr) { - if (!empty($expr->table)) { - $expr->expr = null; // Force rebuild. - $expr->alias = null; // Aliases are not required. - $ret[] = Expression::build($expr); - } - } - return $ret; - } - - /** - * Gets a specific clause. - * - * @param Statement $statement The parsed query that has to be modified. - * @param TokensList $list The list of tokens. - * @param string $clause The clause to be returned. - * @param int|string $type The type of the search. - * If int, - * -1 for everything that was before - * 0 only for the clause - * 1 for everything after - * If string, the name of the first clause that - * should not be included. - * @param bool $skipFirst Whether to skip the first keyword in clause. - * - * @return string - */ - public static function getClause($statement, $list, $clause, $type = 0, $skipFirst = true) - { - - /** - * The index of the current clause. - * - * @var int $currIdx - */ - $currIdx = 0; - - /** - * The count of brackets. - * We keep track of them so we won't insert the clause in a subquery. - * - * @var int $brackets - */ - $brackets = 0; - - /** - * The string to be returned. - * - * @var string $ret - */ - $ret = ''; - - /** - * The clauses of this type of statement and their index. - * - * @var array $clauses - */ - $clauses = array_flip(array_keys($statement->getClauses())); - - /** - * Lexer used for lexing the clause. - * - * @var Lexer $lexer - */ - $lexer = new Lexer($clause); - - /** - * The type of this clause. - * - * @var string $clauseType - */ - $clauseType = $lexer->list->getNextOfType(Token::TYPE_KEYWORD)->value; - - /** - * The index of this clause. - * - * @var int $clauseIdx - */ - $clauseIdx = $clauses[$clauseType]; - - $firstClauseIdx = $clauseIdx; - $lastClauseIdx = $clauseIdx + 1; - - // Determining the behavior of this function. - if ($type === -1) { - $firstClauseIdx = -1; // Something small enough. - $lastClauseIdx = $clauseIdx - 1; - } elseif ($type === 1) { - $firstClauseIdx = $clauseIdx + 1; - $lastClauseIdx = 10000; // Something big enough. - } elseif (is_string($type)) { - if ($clauses[$type] > $clauseIdx) { - $firstClauseIdx = $clauseIdx + 1; - $lastClauseIdx = $clauses[$type] - 1; - } else { - $firstClauseIdx = $clauses[$type] + 1; - $lastClauseIdx = $clauseIdx - 1; - } - } - - // This option is unavailable for multiple clauses. - if ($type !== 0) { - $skipFirst = false; - } - - for ($i = $statement->first; $i <= $statement->last; ++$i) { - $token = $list->tokens[$i]; - - if ($token->type === Token::TYPE_COMMENT) { - continue; - } - - if ($token->type === Token::TYPE_OPERATOR) { - if ($token->value === '(') { - ++$brackets; - } elseif ($token->value === ')') { - --$brackets; - } - } - - if ($brackets == 0) { - // Checking if the section was changed. - if (($token->type === Token::TYPE_KEYWORD) - && (isset($clauses[$token->value])) - && ($clauses[$token->value] >= $currIdx) - ) { - $currIdx = $clauses[$token->value]; - if (($skipFirst) && ($currIdx == $clauseIdx)) { - // This token is skipped (not added to the old - // clause) because it will be replaced. - continue; - } - } - } - - if (($firstClauseIdx <= $currIdx) && ($currIdx <= $lastClauseIdx)) { - $ret .= $token->token; - } - } - - return trim($ret); - } - - /** - * Builds a query by rebuilding the statement from the tokens list supplied - * and replaces a clause. - * - * It is a very basic version of a query builder. - * - * @param Statement $statement The parsed query that has to be modified. - * @param TokensList $list The list of tokens. - * @param string $old The type of the clause that should be - * replaced. This can be an entire clause. - * @param string $new The new clause. If this parameter is omitted - * it is considered to be equal with `$old`. - * @param bool $onlyType Whether only the type of the clause should - * be replaced or the entire clause. - * - * @return string - */ - public static function replaceClause($statement, $list, $old, $new = null, $onlyType = false) - { - // TODO: Update the tokens list and the statement. - - if ($new === null) { - $new = $old; - } - - if ($onlyType) { - return static::getClause($statement, $list, $old, -1, false) . ' ' . - $new . ' ' . static::getClause($statement, $list, $old, 0) . ' ' . - static::getClause($statement, $list, $old, 1, false); - } - - return static::getClause($statement, $list, $old, -1, false) . ' ' . - $new . ' ' . static::getClause($statement, $list, $old, 1, false); - } - - /** - * Builds a query by rebuilding the statement from the tokens list supplied - * and replaces multiple clauses. - * - * @param Statement $statement The parsed query that has to be modified. - * @param TokensList $list The list of tokens. - * @param array $ops Clauses to be replaced. Contains multiple - * arrays having two values: array($old, $new). - * Clauses must be sorted. - * - * @return string - */ - public static function replaceClauses($statement, $list, array $ops) - { - $count = count($ops); - - // Nothing to do. - if ($count === 0) { - return ''; - } - - /** - * Value to be returned. - * - * @var string $ret - */ - $ret = ''; - - // If there is only one clause, `replaceClause()` should be used. - if ($count === 1) { - return static::replaceClause( - $statement, - $list, - $ops[0][0], - $ops[0][1] - ); - } - - // Adding everything before first replacement. - $ret .= static::getClause($statement, $list, $ops[0][0], -1) . ' '; - - // Doing replacements. - for ($i = 0; $i < $count; ++$i) { - $ret .= $ops[$i][1] . ' '; - - // Adding everything between this and next replacement. - if ($i + 1 !== $count) { - $ret .= static::getClause($statement, $list, $ops[$i][0], $ops[$i + 1][0]) . ' '; - } - } - - // Adding everything after the last replacement. - $ret .= static::getClause($statement, $list, $ops[$count - 1][0], 1); - - return $ret; - } - - /** - * Gets the first full statement in the query. - * - * @param string $query The query to be analyzed. - * @param string $delimiter The delimiter to be used. - * - * @return array Array containing the first full query, the - * remaining part of the query and the last - * delimiter. - */ - public static function getFirstStatement($query, $delimiter = null) - { - $lexer = new Lexer($query, false, $delimiter); - $list = $lexer->list; - - /** - * Whether a full statement was found. - * - * @var bool $fullStatement - */ - $fullStatement = false; - - /** - * The first full statement. - * - * @var string $statement - */ - $statement = ''; - - for ($list->idx = 0; $list->idx < $list->count; ++$list->idx) { - $token = $list->tokens[$list->idx]; - - if ($token->type === Token::TYPE_COMMENT) { - continue; - } - - $statement .= $token->token; - - if (($token->type === Token::TYPE_DELIMITER) && (!empty($token->token))) { - $delimiter = $token->token; - $fullStatement = true; - break; - } - } - - // No statement was found so we return the entire query as being the - // remaining part. - if (!$fullStatement) { - return array(null, $query, $delimiter); - } - - // At least one query was found so we have to build the rest of the - // remaining query. - $query = ''; - for (++$list->idx; $list->idx < $list->count; ++$list->idx) { - $query .= $list->tokens[$list->idx]->token; - } - - return array(trim($statement), $query, $delimiter); - } - - /** - * Gets a starting offset of a specific clause. - * - * @param Statement $statement The parsed query that has to be modified. - * @param TokensList $list The list of tokens. - * @param string $clause The clause to be returned. - * - * @return int - */ - public static function getClauseStartOffset($statement, $list, $clause) - { - /** - * The count of brackets. - * We keep track of them so we won't insert the clause in a subquery. - * - * @var int $brackets - */ - $brackets = 0; - - /** - * The clauses of this type of statement and their index. - * - * @var array $clauses - */ - $clauses = array_flip(array_keys($statement->getClauses())); - - for ($i = $statement->first; $i <= $statement->last; ++$i) { - $token = $list->tokens[$i]; - - if ($token->type === Token::TYPE_COMMENT) { - continue; - } - - if ($token->type === Token::TYPE_OPERATOR) { - if ($token->value === '(') { - ++$brackets; - } elseif ($token->value === ')') { - --$brackets; - } - } - - if ($brackets == 0) { - if (($token->type === Token::TYPE_KEYWORD) - && (isset($clauses[$token->value])) - && ($clause === $token->value) - ) { - return $i; - } - } - } - - return -1; - } -} diff --git a/#pma/libraries/sql-parser/src/Utils/Routine.php b/#pma/libraries/sql-parser/src/Utils/Routine.php deleted file mode 100644 index d5a7891d..00000000 --- a/#pma/libraries/sql-parser/src/Utils/Routine.php +++ /dev/null @@ -1,135 +0,0 @@ -list); - - if ($type === null) { - return array('', '', '', '', ''); - } - - $options = array(); - foreach ($type->options->options as $opt) { - $options[] = is_string($opt) ? $opt : $opt['value']; - } - - return array( - '', - '', - $type->name, - implode(',', $type->parameters), - implode(' ', $options) - ); - } - - /** - * Parses a parameter of a routine. - * - * @param string $param Parameter's definition. - * - * @return array - */ - public static function getParameter($param) - { - $lexer = new Lexer('(' . $param . ')'); - - // A dummy parser is used for error reporting. - $param = ParameterDefinition::parse(new Parser(), $lexer->list); - - if (empty($param[0])) { - return array('', '', '', '', ''); - } - - $param = $param[0]; - - $options = array(); - foreach ($param->type->options->options as $opt) { - $options[] = is_string($opt) ? $opt : $opt['value']; - } - - return array( - empty($param->inOut) ? '' : $param->inOut, - $param->name, - $param->type->name, - implode(',', $param->type->parameters), - implode(' ', $options) - ); - } - - /** - * Gets the parameters of a routine from the parse tree. - * - * @param CreateStatement $statement The statement to be processed. - * - * @return array - */ - public static function getParameters($statement) - { - $retval = array( - 'num' => 0, - 'dir' => array(), - 'name' => array(), - 'type' => array(), - 'length' => array(), - 'length_arr' => array(), - 'opts' => array(), - ); - - if (!empty($statement->parameters)) { - $idx = 0; - foreach ($statement->parameters as $param) { - $retval['dir'][$idx] = $param->inOut; - $retval['name'][$idx] = $param->name; - $retval['type'][$idx] = $param->type->name; - $retval['length'][$idx] = implode(',', $param->type->parameters); - $retval['length_arr'][$idx] = $param->type->parameters; - $retval['opts'][$idx] = array(); - foreach ($param->type->options->options as $opt) { - $retval['opts'][$idx][] = is_string($opt) ? - $opt : $opt['value']; - } - $retval['opts'][$idx] = implode(' ', $retval['opts'][$idx]); - ++$idx; - } - - $retval['num'] = $idx; - } - - return $retval; - } -} diff --git a/#pma/libraries/sql-parser/src/Utils/Table.php b/#pma/libraries/sql-parser/src/Utils/Table.php deleted file mode 100644 index a31ddf27..00000000 --- a/#pma/libraries/sql-parser/src/Utils/Table.php +++ /dev/null @@ -1,141 +0,0 @@ -fields)) - || (!is_array($statement->fields)) - || (!$statement->options->has('TABLE')) - ) { - return array(); - } - - $ret = array(); - - foreach ($statement->fields as $field) { - if ((empty($field->key)) || ($field->key->type !== 'FOREIGN KEY')) { - continue; - } - - $columns = array(); - foreach ($field->key->columns as $column) { - $columns[] = $column['name']; - } - - $tmp = array( - 'constraint' => $field->name, - 'index_list' => $columns, - ); - - if (!empty($field->references)) { - $tmp['ref_db_name'] = $field->references->table->database; - $tmp['ref_table_name'] = $field->references->table->table; - $tmp['ref_index_list'] = $field->references->columns; - - if (($opt = $field->references->options->has('ON UPDATE'))) { - $tmp['on_update'] = str_replace(' ', '_', $opt); - } - - if (($opt = $field->references->options->has('ON DELETE'))) { - $tmp['on_delete'] = str_replace(' ', '_', $opt); - } - - // if (($opt = $field->references->options->has('MATCH'))) { - // $tmp['match'] = str_replace(' ', '_', $opt); - // } - } - - $ret[] = $tmp; - - } - - return $ret; - } - - /** - * Gets fields of the table. - * - * @param CreateStatement $statement The statement to be processed. - * - * @return array - */ - public static function getFields($statement) - { - if ((empty($statement->fields)) - || (!is_array($statement->fields)) - || (!$statement->options->has('TABLE')) - ) { - return array(); - } - - $ret = array(); - - foreach ($statement->fields as $field) { - // Skipping keys. - if (empty($field->type)) { - continue; - } - - $ret[$field->name] = array( - 'type' => $field->type->name, - 'timestamp_not_null' => false, - ); - - if ($field->options) { - if ($field->type->name === 'TIMESTAMP') { - if ($field->options->has('NOT NULL')) { - $ret[$field->name]['timestamp_not_null'] = true; - } - } - - if (($option = $field->options->has('DEFAULT'))) { - $ret[$field->name]['default_value'] = $option; - if ($option === 'CURRENT_TIMESTAMP') { - $ret[$field->name]['default_current_timestamp'] = true; - } - } - - if (($option = $field->options->has('ON UPDATE'))) { - if ($option === 'CURRENT_TIMESTAMP') { - $ret[$field->name]['on_update_current_timestamp'] = true; - } - } - - if (($option = $field->options->has('AS'))) { - $ret[$field->name]['generated'] = true; - $ret[$field->name]['expr'] = $option; - } - } - - } - - return $ret; - } -} diff --git a/#pma/libraries/sql-parser/src/Utils/Tokens.php b/#pma/libraries/sql-parser/src/Utils/Tokens.php deleted file mode 100644 index acec369c..00000000 --- a/#pma/libraries/sql-parser/src/Utils/Tokens.php +++ /dev/null @@ -1,174 +0,0 @@ -token) - ) { - return false; - } - - // Value. - if ((isset($pattern['value'])) - && ($pattern['value'] !== $token->value) - ) { - return false; - } - - if ((isset($pattern['value_str'])) - && (strcasecmp($pattern['value_str'], $token->value)) - ) { - return false; - } - - // Type. - if ((isset($pattern['type'])) - && ($pattern['type'] !== $token->type) - ) { - return false; - } - - // Flags. - if ((isset($pattern['flags'])) - && (($pattern['flags'] & $token->flags) === 0) - ) { - return false; - } - - return true; - } - - public static function replaceTokens($list, array $find, array $replace) - { - - /** - * Whether the first parameter is a list. - * - * @var bool - */ - $isList = $list instanceof TokensList; - - // Parsing the tokens. - if (!$isList) { - $list = Lexer::getTokens($list); - } - - /** - * The list to be returned. - * - * @var array - */ - $newList = array(); - - /** - * The length of the find pattern is calculated only once. - * - * @var int - */ - $findCount = count($find); - - /** - * The starting index of the pattern. - * - * @var int - */ - $i = 0; - - while ($i < $list->count) { - // A sequence may not start with a comment. - if ($list->tokens[$i]->type === Token::TYPE_COMMENT) { - $newList[] = $list->tokens[$i]; - ++$i; - continue; - } - - /** - * The index used to parse `$list->tokens`. - * - * This index might be running faster than `$k` because some tokens - * are skipped. - * - * @var int - */ - $j = $i; - - /** - * The index used to parse `$find`. - * - * This index might be running slower than `$j` because some tokens - * are skipped. - * - * @var int - */ - $k = 0; - - // Checking if the next tokens match the pattern described. - while (($j < $list->count) && ($k < $findCount)) { - // Comments are being skipped. - if ($list->tokens[$j]->type === Token::TYPE_COMMENT) { - ++$j; - } - - if (!static::match($list->tokens[$j], $find[$k])) { - // This token does not match the pattern. - break; - } - - // Going to next token and segment of find pattern. - ++$j; - ++$k; - } - - - // Checking if the sequence was found. - if ($k === $findCount) { - // Inserting new tokens. - foreach ($replace as $token) { - $newList[] = $token; - } - - // Skipping next `$findCount` tokens. - $i = $j; - } else { - // Adding the same token. - $newList[] = $list->tokens[$i]; - ++$i; - } - } - - return $isList ? - new TokensList($newList) : TokensList::build($newList); - } -} diff --git a/#pma/libraries/sql-parser/src/common.php b/#pma/libraries/sql-parser/src/common.php deleted file mode 100644 index 3575c24a..00000000 --- a/#pma/libraries/sql-parser/src/common.php +++ /dev/null @@ -1,21 +0,0 @@ -getUiProp(Table::PROP_SORTED_COLUMN); - if (empty($sortCol)) { - return; - } - - // Remove the name of the table from the retrieved field name. - $sortCol = str_replace( - PMA\libraries\Util::backquote($table) . '.', - '', - $sortCol - ); - - // Create the new query. - $full_sql_query = SqlParser\Utils\Query::replaceClause( - $analyzed_sql_results['statement'], - $analyzed_sql_results['parser']->list, - 'ORDER BY ' . $sortCol - ); - - // TODO: Avoid reparsing the query. - $analyzed_sql_results = SqlParser\Utils\Query::getAll($full_sql_query); - } else { - // Store the remembered table into session. - $pmatable->setUiProp( - Table::PROP_SORTED_COLUMN, - SqlParser\Utils\Query::getClause( - $analyzed_sql_results['statement'], - $analyzed_sql_results['parser']->list, - 'ORDER BY' - ) - ); - } -} - -/** - * Append limit clause to SQL query - * - * @param array &$analyzed_sql_results the analyzed query results - * - * @return string limit clause appended SQL query - */ -function PMA_getSqlWithLimitClause(&$analyzed_sql_results) -{ - return SqlParser\Utils\Query::replaceClause( - $analyzed_sql_results['statement'], - $analyzed_sql_results['parser']->list, - 'LIMIT ' . $_SESSION['tmpval']['pos'] . ', ' - . $_SESSION['tmpval']['max_rows'] - ); -} - -/** - * Verify whether the result set has columns from just one table - * - * @param array $fields_meta meta fields - * - * @return boolean whether the result set has columns from just one table - */ -function PMA_resultSetHasJustOneTable($fields_meta) -{ - $just_one_table = true; - $prev_table = ''; - foreach ($fields_meta as $one_field_meta) { - if ($one_field_meta->table != '' - && $prev_table != '' - && $one_field_meta->table != $prev_table - ) { - $just_one_table = false; - } - if ($one_field_meta->table != '') { - $prev_table = $one_field_meta->table; - } - } - return $just_one_table && $prev_table != ''; -} - -/** - * Verify whether the result set contains all the columns - * of at least one unique key - * - * @param string $db database name - * @param string $table table name - * @param array $fields_meta meta fields - * - * @return boolean whether the result set contains a unique key - */ -function PMA_resultSetContainsUniqueKey($db, $table, $fields_meta) -{ - $resultSetColumnNames = array(); - foreach ($fields_meta as $oneMeta) { - $resultSetColumnNames[] = $oneMeta->name; - } - foreach (PMA\libraries\Index::getFromTable($table, $db) as $index) { - if ($index->isUnique()) { - $indexColumns = $index->getColumns(); - $numberFound = 0; - foreach ($indexColumns as $indexColumnName => $dummy) { - if (in_array($indexColumnName, $resultSetColumnNames)) { - $numberFound++; - } - } - if ($numberFound == count($indexColumns)) { - return true; - } - } - } - return false; -} - -/** - * Get the HTML for relational column dropdown - * During grid edit, if we have a relational field, returns the html for the - * dropdown - * - * @param string $db current database - * @param string $table current table - * @param string $column current column - * @param string $curr_value current selected value - * - * @return string $dropdown html for the dropdown - */ -function PMA_getHtmlForRelationalColumnDropdown($db, $table, $column, $curr_value) -{ - $foreigners = PMA_getForeigners($db, $table, $column); - - $foreignData = PMA_getForeignData($foreigners, $column, false, '', ''); - - if ($foreignData['disp_row'] == null) { - //Handle the case when number of values - //is more than $cfg['ForeignKeyMaxLimit'] - $_url_params = array( - 'db' => $db, - 'table' => $table, - 'field' => $column - ); - - $dropdown = '' - . htmlspecialchars($_REQUEST['curr_value']) - . '' - . '' - . __('Browse foreign values') - . ''; - } else { - $dropdown = PMA_foreignDropdown( - $foreignData['disp_row'], - $foreignData['foreign_field'], - $foreignData['foreign_display'], - $curr_value, - $GLOBALS['cfg']['ForeignKeyMaxLimit'] - ); - $dropdown = ''; - } - - return $dropdown; -} - -/** - * Get the HTML for the profiling table and accompanying chart if profiling is set. - * Otherwise returns null - * - * @param string $url_query url query - * @param string $db current database - * @param array $profiling_results array containing the profiling info - * - * @return string $profiling_table html for the profiling table and chart - */ -function PMA_getHtmlForProfilingChart($url_query, $db, $profiling_results) -{ - if (! empty($profiling_results)) { - $pma_token = $_SESSION[' PMA_token ']; - $url_query = isset($url_query) - ? $url_query - : PMA_URL_getCommon(array('db' => $db)); - - $profiling_table = ''; - $profiling_table .= '
    ' . __('Profiling') - . '' . "\n"; - $profiling_table .= '
    '; - $profiling_table .= '

    ' . __('Detailed profile') . '

    '; - $profiling_table .= '' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= ' ' . "\n"; - list($detailed_table, $chart_json, $profiling_stats) - = PMA_analyzeAndGetTableHtmlForProfilingResults($profiling_results); - $profiling_table .= $detailed_table; - $profiling_table .= '
    ' . __('Order') - . '
    ' . __('State') - . PMA\libraries\Util::showMySQLDocu('general-thread-states') - . '
    ' . __('Time') - . '
    ' . "\n"; - $profiling_table .= '
    '; - - $profiling_table .= '
    '; - $profiling_table .= '

    ' . __('Summary by state') . '

    '; - $profiling_table .= '' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= ' ' . "\n"; - $profiling_table .= PMA_getTableHtmlForProfilingSummaryByState( - $profiling_stats - ); - $profiling_table .= '
    ' . __('State') - . PMA\libraries\Util::showMySQLDocu('general-thread-states') - . '
    ' . __('Total Time') - . '
    ' . __('% Time') - . '
    ' . __('Calls') - . '
    ' . __('ø Time') - . '
    ' . "\n"; - - $profiling_table .= << - pma_token = '$pma_token'; - url_query = '$url_query'; - -EOT; - $profiling_table .= "
    "; - $profiling_table .= "
    "; - - //require_once 'libraries/chart.lib.php'; - $profiling_table .= ''; - $profiling_table .= ''; - $profiling_table .= ''; - $profiling_table .= '
    ' . "\n"; - } else { - $profiling_table = null; - } - return $profiling_table; -} - -/** - * Function to get HTML for detailed profiling results table, profiling stats, and - * $chart_json for displaying the chart. - * - * @param array $profiling_results profiling results - * - * @return mixed - */ -function PMA_analyzeAndGetTableHtmlForProfilingResults( - $profiling_results -) { - $profiling_stats = array( - 'total_time' => 0, - 'states' => array(), - ); - $chart_json = Array(); - $i = 1; - $table = ''; - foreach ($profiling_results as $one_result) { - if (isset($profiling_stats['states'][ucwords($one_result['Status'])])) { - $states = $profiling_stats['states']; - $states[ucwords($one_result['Status'])]['total_time'] - += $one_result['Duration']; - $states[ucwords($one_result['Status'])]['calls']++; - } else { - $profiling_stats['states'][ucwords($one_result['Status'])] = array( - 'total_time' => $one_result['Duration'], - 'calls' => 1, - ); - } - $profiling_stats['total_time'] += $one_result['Duration']; - - $table .= ' ' . "\n"; - $table .= '' . $i++ . '' . "\n"; - $table .= '' . ucwords($one_result['Status']) - . '' . "\n"; - $table .= '' - . (PMA\libraries\Util::formatNumber($one_result['Duration'], 3, 1)) - . 's' . "\n"; - if (isset($chart_json[ucwords($one_result['Status'])])) { - $chart_json[ucwords($one_result['Status'])] - += $one_result['Duration']; - } else { - $chart_json[ucwords($one_result['Status'])] - = $one_result['Duration']; - } - } - return array($table, $chart_json, $profiling_stats); -} - -/** - * Function to get HTML for summary by state table - * - * @param array $profiling_stats profiling stats - * - * @return string $table html for the table - */ -function PMA_getTableHtmlForProfilingSummaryByState($profiling_stats) -{ - $table = ''; - foreach ($profiling_stats['states'] as $name => $stats) { - $table .= ' ' . "\n"; - $table .= '' . $name . '' . "\n"; - $table .= '' - . PMA\libraries\Util::formatNumber($stats['total_time'], 3, 1) - . 's' . "\n"; - $table .= '' - . PMA\libraries\Util::formatNumber( - 100 * ($stats['total_time'] / $profiling_stats['total_time']), - 0, 2 - ) - . '%' . "\n"; - $table .= '' . $stats['calls'] . '' - . "\n"; - $table .= '' - . PMA\libraries\Util::formatNumber( - $stats['total_time'] / $stats['calls'], 3, 1 - ) - . 's' . "\n"; - $table .= ' ' . "\n"; - } - return $table; -} - -/** - * Get the HTML for the enum column dropdown - * During grid edit, if we have a enum field, returns the html for the - * dropdown - * - * @param string $db current database - * @param string $table current table - * @param string $column current column - * @param string $curr_value currently selected value - * - * @return string $dropdown html for the dropdown - */ -function PMA_getHtmlForEnumColumnDropdown($db, $table, $column, $curr_value) -{ - $values = PMA_getValuesForColumn($db, $table, $column); - $dropdown = ''; - $dropdown .= PMA_getHtmlForOptionsList($values, array($curr_value)); - $dropdown = ''; - return $dropdown; -} - -/** - * Get value of a column for a specific row (marked by $where_clause) - * - * @param string $db current database - * @param string $table current table - * @param string $column current column - * @param string $where_clause where clause to select a particular row - * - * @return string with value - */ -function PMA_getFullValuesForSetColumn($db, $table, $column, $where_clause) -{ - $result = $GLOBALS['dbi']->fetchSingleRow( - "SELECT `$column` FROM `$db`.`$table` WHERE $where_clause" - ); - - return $result[$column]; -} - -/** - * Get the HTML for the set column dropdown - * During grid edit, if we have a set field, returns the html for the - * dropdown - * - * @param string $db current database - * @param string $table current table - * @param string $column current column - * @param string $curr_value currently selected value - * - * @return string $dropdown html for the set column - */ -function PMA_getHtmlForSetColumn($db, $table, $column, $curr_value) -{ - $values = PMA_getValuesForColumn($db, $table, $column); - $dropdown = ''; - $full_values = - isset($_REQUEST['get_full_values']) ? $_REQUEST['get_full_values'] : false; - $where_clause = - isset($_REQUEST['where_clause']) ? $_REQUEST['where_clause'] : null; - - // If the $curr_value was truncated, we should - // fetch the correct full values from the table - if ($full_values && ! empty($where_clause)) { - $curr_value = PMA_getFullValuesForSetColumn( - $db, $table, $column, $where_clause - ); - } - - //converts characters of $curr_value to HTML entities - $converted_curr_value = htmlentities( - $curr_value, ENT_COMPAT, "UTF-8" - ); - - $selected_values = explode(',', $converted_curr_value); - - $dropdown .= PMA_getHtmlForOptionsList($values, $selected_values); - - $select_size = (sizeof($values) > 10) ? 10 : sizeof($values); - $dropdown = ''; - - return $dropdown; -} - -/** - * Get all the values for a enum column or set column in a table - * - * @param string $db current database - * @param string $table current table - * @param string $column current column - * - * @return array $values array containing the value list for the column - */ -function PMA_getValuesForColumn($db, $table, $column) -{ - $field_info_query = $GLOBALS['dbi']->getColumnsSql($db, $table, $column); - - $field_info_result = $GLOBALS['dbi']->fetchResult( - $field_info_query, - null, - null, - null, - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - - $values = PMA\libraries\Util::parseEnumSetValues($field_info_result[0]['Type']); - - return $values; -} - -/** - * Get HTML for options list - * - * @param array $values set of values - * @param array $selected_values currently selected values - * - * @return string $options HTML for options list - */ -function PMA_getHtmlForOptionsList($values, $selected_values) -{ - $options = ''; - foreach ($values as $value) { - $options .= ''; - - } else { - $html = null; - } - - return $html; -} - -/** - * Function to check whether to remember the sorting order or not - * - * @param array $analyzed_sql_results the analyzed query and other variables set - * after analyzing the query - * - * @return boolean - */ -function PMA_isRememberSortingOrder($analyzed_sql_results) -{ - return $GLOBALS['cfg']['RememberSorting'] - && ! ($analyzed_sql_results['is_count'] - || $analyzed_sql_results['is_export'] - || $analyzed_sql_results['is_func'] - || $analyzed_sql_results['is_analyse']) - && $analyzed_sql_results['select_from'] - && ((empty($analyzed_sql_results['select_expr'])) - || (count($analyzed_sql_results['select_expr'] == 1) - && ($analyzed_sql_results['select_expr'][0] == '*'))) - && count($analyzed_sql_results['select_tables']) == 1; -} - -/** - * Function to check whether the LIMIT clause should be appended or not - * - * @param array $analyzed_sql_results the analyzed query and other variables set - * after analyzing the query - * - * @return boolean - */ -function PMA_isAppendLimitClause($analyzed_sql_results) -{ - // Assigning LIMIT clause to an syntactically-wrong query - // is not needed. Also we would want to show the true query - // and the true error message to the query executor - - return (isset($analyzed_sql_results['parser']) - && count($analyzed_sql_results['parser']->errors) === 0) - && ($_SESSION['tmpval']['max_rows'] != 'all') - && ! ($analyzed_sql_results['is_export'] - || $analyzed_sql_results['is_analyse']) - && ($analyzed_sql_results['select_from'] - || $analyzed_sql_results['is_subquery']) - && empty($analyzed_sql_results['limit']); -} - -/** - * Function to check whether this query is for just browsing - * - * @param array $analyzed_sql_results the analyzed query and other variables set - * after analyzing the query - * @param boolean $find_real_end whether the real end should be found - * - * @return boolean - */ -function PMA_isJustBrowsing($analyzed_sql_results, $find_real_end) -{ - return ! $analyzed_sql_results['is_group'] - && ! $analyzed_sql_results['is_func'] - && empty($analyzed_sql_results['union']) - && empty($analyzed_sql_results['distinct']) - && $analyzed_sql_results['select_from'] - && (count($analyzed_sql_results['select_tables']) === 1) - && (empty($analyzed_sql_results['statement']->where) - || (count($analyzed_sql_results['statement']->where) == 1 - && $analyzed_sql_results['statement']->where[0]->expr ==='1')) - && empty($analyzed_sql_results['group']) - && ! isset($find_real_end) - && ! $analyzed_sql_results['is_subquery'] - && ! $analyzed_sql_results['join'] - && empty($analyzed_sql_results['having']); -} - -/** - * Function to check whether the related transformation information should be deleted - * - * @param array $analyzed_sql_results the analyzed query and other variables set - * after analyzing the query - * - * @return boolean - */ -function PMA_isDeleteTransformationInfo($analyzed_sql_results) -{ - return !empty($analyzed_sql_results['querytype']) - && (($analyzed_sql_results['querytype'] == 'ALTER') - || ($analyzed_sql_results['querytype'] == 'DROP')); -} - -/** - * Function to check whether the user has rights to drop the database - * - * @param array $analyzed_sql_results the analyzed query and other variables set - * after analyzing the query - * @param boolean $allowUserDropDatabase whether the user is allowed to drop db - * @param boolean $is_superuser whether this user is a superuser - * - * @return boolean - */ -function PMA_hasNoRightsToDropDatabase($analyzed_sql_results, - $allowUserDropDatabase, $is_superuser -) { - return ! $allowUserDropDatabase - && isset($analyzed_sql_results['drop_database']) - && $analyzed_sql_results['drop_database'] - && ! $is_superuser; -} - -/** - * Function to set a column property - * - * @param Table $pmatable Table instance - * @param string $request_index col_order|col_visib - * - * @return boolean $retval - */ -function PMA_setColumnProperty($pmatable, $request_index) -{ - $property_value = explode(',', $_REQUEST[$request_index]); - switch($request_index) { - case 'col_order': - $property_to_set = Table::PROP_COLUMN_ORDER; - break; - case 'col_visib': - $property_to_set = Table::PROP_COLUMN_VISIB; - break; - default: - $property_to_set = ''; - } - $retval = $pmatable->setUiProp( - $property_to_set, - $property_value, - $_REQUEST['table_create_time'] - ); - if (gettype($retval) != 'boolean') { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus(false); - $response->addJSON('message', $retval->getString()); - exit; - } - - return $retval; -} - -/** - * Function to check the request for setting the column order or visibility - * - * @param String $table the current table - * @param String $db the current database - * - * @return void - */ -function PMA_setColumnOrderOrVisibility($table, $db) -{ - $pmatable = new Table($table, $db); - $retval = false; - - // set column order - if (isset($_REQUEST['col_order'])) { - $retval = PMA_setColumnProperty($pmatable, 'col_order'); - } - - // set column visibility - if ($retval === true && isset($_REQUEST['col_visib'])) { - $retval = PMA_setColumnProperty($pmatable, 'col_visib'); - } - - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus($retval == true); - exit; -} - -/** - * Function to add a bookmark - * - * @param String $goto goto page URL - * - * @return void - */ -function PMA_addBookmark($goto) -{ - $result = PMA_Bookmark_save( - $_POST['bkm_fields'], - (isset($_POST['bkm_all_users']) - && $_POST['bkm_all_users'] == 'true' ? true : false - ) - ); - $response = Response::getInstance(); - if ($response->isAjax()) { - if ($result) { - $msg = Message::success(__('Bookmark %s has been created.')); - $msg->addParam($_POST['bkm_fields']['bkm_label']); - $response->addJSON('message', $msg); - } else { - $msg = PMA\libraries\message::error(__('Bookmark not created!')); - $response->setRequestStatus(false); - $response->addJSON('message', $msg); - } - exit; - } else { - // go back to sql.php to redisplay query; do not use & in this case: - /** - * @todo In which scenario does this happen? - */ - PMA_sendHeaderLocation( - './' . $goto - . '&label=' . $_POST['bkm_fields']['bkm_label'] - ); - } -} - -/** - * Function to find the real end of rows - * - * @param String $db the current database - * @param String $table the current table - * - * @return mixed the number of rows if "retain" param is true, otherwise true - */ -function PMA_findRealEndOfRows($db, $table) -{ - $unlim_num_rows = $GLOBALS['dbi']->getTable($db, $table)->countRecords(true); - $_SESSION['tmpval']['pos'] = PMA_getStartPosToDisplayRow($unlim_num_rows); - - return $unlim_num_rows; -} - -/** - * Function to get values for the relational columns - * - * @param String $db the current database - * @param String $table the current table - * - * @return void - */ -function PMA_getRelationalValues($db, $table) -{ - $column = $_REQUEST['column']; - if ($_SESSION['tmpval']['relational_display'] == 'D' - && isset($_REQUEST['relation_key_or_display_column']) - && $_REQUEST['relation_key_or_display_column'] - ) { - $curr_value = $_REQUEST['relation_key_or_display_column']; - } else { - $curr_value = $_REQUEST['curr_value']; - } - $dropdown = PMA_getHtmlForRelationalColumnDropdown( - $db, $table, $column, $curr_value - ); - $response = PMA\libraries\Response::getInstance(); - $response->addJSON('dropdown', $dropdown); - exit; -} - -/** - * Function to get values for Enum or Set Columns - * - * @param String $db the current database - * @param String $table the current table - * @param String $columnType whether enum or set - * - * @return void - */ -function PMA_getEnumOrSetValues($db, $table, $columnType) -{ - $column = $_REQUEST['column']; - $curr_value = $_REQUEST['curr_value']; - $response = PMA\libraries\Response::getInstance(); - if ($columnType == "enum") { - $dropdown = PMA_getHtmlForEnumColumnDropdown( - $db, $table, $column, $curr_value - ); - $response->addJSON('dropdown', $dropdown); - } else { - $select = PMA_getHtmlForSetColumn( - $db, $table, $column, $curr_value - ); - $response->addJSON('select', $select); - } - exit; -} - -/** - * Function to get the default sql query for browsing page - * - * @param String $db the current database - * @param String $table the current table - * - * @return String $sql_query the default $sql_query for browse page - */ -function PMA_getDefaultSqlQueryForBrowse($db, $table) -{ - include_once 'libraries/bookmark.lib.php'; - $book_sql_query = PMA_Bookmark_get( - $db, - '\'' . $GLOBALS['dbi']->escapeString($table) . '\'', - 'label', - false, - true - ); - - if (! empty($book_sql_query)) { - $GLOBALS['using_bookmark_message'] = Message::notice( - __('Using bookmark "%s" as default browse query.') - ); - $GLOBALS['using_bookmark_message']->addParam($table); - $GLOBALS['using_bookmark_message']->addMessage( - PMA\libraries\Util::showDocu('faq', 'faq6-22') - ); - $sql_query = $book_sql_query; - } else { - - $defaultOrderByClause = ''; - - if (isset($GLOBALS['cfg']['TablePrimaryKeyOrder']) - && ($GLOBALS['cfg']['TablePrimaryKeyOrder'] !== 'NONE') - ) { - - $primaryKey = null; - $primary = PMA\libraries\Index::getPrimary($table, $db); - - if ($primary !== false) { - - $primarycols = $primary->getColumns(); - - foreach ($primarycols as $col) { - $primaryKey = $col->getName(); - break; - } - - if ($primaryKey != null) { - $defaultOrderByClause = ' ORDER BY ' - . PMA\libraries\Util::backquote($table) . '.' - . PMA\libraries\Util::backquote($primaryKey) . ' ' - . $GLOBALS['cfg']['TablePrimaryKeyOrder']; - } - - } - - } - - $sql_query = 'SELECT * FROM ' . PMA\libraries\Util::backquote($table) - . $defaultOrderByClause; - - } - unset($book_sql_query); - - return $sql_query; -} - -/** - * Responds an error when an error happens when executing the query - * - * @param boolean $is_gotofile whether goto file or not - * @param String $error error after executing the query - * @param String $full_sql_query full sql query - * - * @return void - */ -function PMA_handleQueryExecuteError($is_gotofile, $error, $full_sql_query) -{ - if ($is_gotofile) { - $message = PMA\libraries\Message::rawError($error); - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus(false); - $response->addJSON('message', $message); - } else { - PMA\libraries\Util::mysqlDie($error, $full_sql_query, '', ''); - } - exit; -} - -/** - * Function to store the query as a bookmark - * - * @param String $db the current database - * @param String $bkm_user the bookmarking user - * @param String $sql_query_for_bookmark the query to be stored in bookmark - * @param String $bkm_label bookmark label - * @param boolean $bkm_replace whether to replace existing bookmarks - * - * @return void - */ -function PMA_storeTheQueryAsBookmark($db, $bkm_user, $sql_query_for_bookmark, - $bkm_label, $bkm_replace -) { - include_once 'libraries/bookmark.lib.php'; - $bfields = array( - 'bkm_database' => $db, - 'bkm_user' => $bkm_user, - 'bkm_sql_query' => $sql_query_for_bookmark, - 'bkm_label' => $bkm_label - ); - - // Should we replace bookmark? - if (isset($bkm_replace)) { - $bookmarks = PMA_Bookmark_getList($db); - foreach ($bookmarks as $key => $val) { - if ($val['label'] == $bkm_label) { - PMA_Bookmark_delete($key); - } - } - } - - PMA_Bookmark_save($bfields, isset($_POST['bkm_all_users'])); - -} - -/** - * Executes the SQL query and measures its execution time - * - * @param String $full_sql_query the full sql query - * - * @return array ($result, $querytime) - */ -function PMA_executeQueryAndMeasureTime($full_sql_query) -{ - // close session in case the query takes too long - session_write_close(); - - // Measure query time. - $querytime_before = array_sum(explode(' ', microtime())); - - $result = @$GLOBALS['dbi']->tryQuery( - $full_sql_query, null, PMA\libraries\DatabaseInterface::QUERY_STORE - ); - $querytime_after = array_sum(explode(' ', microtime())); - - // reopen session - session_start(); - - return array($result, $querytime_after - $querytime_before); -} - -/** - * Function to get the affected or changed number of rows after executing a query - * - * @param boolean $is_affected whether the query affected a table - * @param mixed $result results of executing the query - * - * @return int $num_rows number of rows affected or changed - */ -function PMA_getNumberOfRowsAffectedOrChanged($is_affected, $result) -{ - if (! $is_affected) { - $num_rows = ($result) ? @$GLOBALS['dbi']->numRows($result) : 0; - } else { - $num_rows = @$GLOBALS['dbi']->affectedRows(); - } - - return $num_rows; -} - -/** - * Checks if the current database has changed - * This could happen if the user sends a query like "USE `database`;" - * - * @param String $db the database in the query - * - * @return int $reload whether to reload the navigation(1) or not(0) - */ -function PMA_hasCurrentDbChanged($db) -{ - if (mb_strlen($db)) { - $current_db = $GLOBALS['dbi']->fetchValue('SELECT DATABASE()'); - // $current_db is false, except when a USE statement was sent - return ($current_db != false) && ($db !== $current_db); - } - - return false; -} - -/** - * If a table, database or column gets dropped, clean comments. - * - * @param String $db current database - * @param String $table current table - * @param String $column current column - * @param bool $purge whether purge set or not - * - * @return array $extra_data - */ -function PMA_cleanupRelations($db, $table, $column, $purge) -{ - include_once 'libraries/relation_cleanup.lib.php'; - - if (! empty($purge) && mb_strlen($db)) { - if (mb_strlen($table)) { - if (isset($column) && mb_strlen($column)) { - PMA_relationsCleanupColumn($db, $table, $column); - } else { - PMA_relationsCleanupTable($db, $table); - } - } else { - PMA_relationsCleanupDatabase($db); - } - } -} - -/** - * Function to count the total number of rows for the same 'SELECT' query without - * the 'LIMIT' clause that may have been programatically added - * - * @param int $num_rows number of rows affected/changed by the query - * @param bool $justBrowsing whether just browsing or not - * @param string $db the current database - * @param string $table the current table - * @param array $analyzed_sql_results the analyzed query and other variables set - * after analyzing the query - * - * @return int $unlim_num_rows unlimited number of rows - */ -function PMA_countQueryResults( - $num_rows, $justBrowsing, $db, $table, $analyzed_sql_results -) { - - /* Shortcut for not analyzed/empty query */ - if (empty($analyzed_sql_results)) { - return 0; - } - - if (!PMA_isAppendLimitClause($analyzed_sql_results)) { - // if we did not append a limit, set this to get a correct - // "Showing rows..." message - // $_SESSION['tmpval']['max_rows'] = 'all'; - $unlim_num_rows = $num_rows; - } elseif ($analyzed_sql_results['querytype'] == 'SELECT' - || $analyzed_sql_results['is_subquery'] - ) { - // c o u n t q u e r y - - // If we are "just browsing", there is only one table (and no join), - // and no WHERE clause (or just 'WHERE 1 '), - // we do a quick count (which uses MaxExactCount) because - // SQL_CALC_FOUND_ROWS is not quick on large InnoDB tables - - // However, do not count again if we did it previously - // due to $find_real_end == true - if ($justBrowsing) { - // Get row count (is approximate for InnoDB) - $unlim_num_rows = $GLOBALS['dbi']->getTable($db, $table)->countRecords(); - /** - * @todo Can we know at this point that this is InnoDB, - * (in this case there would be no need for getting - * an exact count)? - */ - if ($unlim_num_rows < $GLOBALS['cfg']['MaxExactCount']) { - // Get the exact count if approximate count - // is less than MaxExactCount - /** - * @todo In countRecords(), MaxExactCount is also verified, - * so can we avoid checking it twice? - */ - $unlim_num_rows = $GLOBALS['dbi']->getTable($db, $table) - ->countRecords(true); - } - - } else { - - // The SQL_CALC_FOUND_ROWS option of the SELECT statement is used. - - // For UNION statements, only a SQL_CALC_FOUND_ROWS is required - // after the first SELECT. - - $count_query = SqlParser\Utils\Query::replaceClause( - $analyzed_sql_results['statement'], - $analyzed_sql_results['parser']->list, - 'SELECT SQL_CALC_FOUND_ROWS', - null, - true - ); - - // Another LIMIT clause is added to avoid long delays. - // A complete result will be returned anyway, but the LIMIT would - // stop the query as soon as the result that is required has been - // computed. - - if (empty($analyzed_sql_results['union'])) { - $count_query .= ' LIMIT 1'; - } - - // Running the count query. - $GLOBALS['dbi']->tryQuery($count_query); - - $unlim_num_rows = $GLOBALS['dbi']->fetchValue('SELECT FOUND_ROWS()'); - } // end else "just browsing" - } else {// not $is_select - $unlim_num_rows = 0; - } - - return $unlim_num_rows; -} - -/** - * Function to handle all aspects relating to executing the query - * - * @param array $analyzed_sql_results analyzed sql results - * @param String $full_sql_query full sql query - * @param boolean $is_gotofile whether to go to a file - * @param String $db current database - * @param String $table current table - * @param boolean $find_real_end whether to find the real end - * @param String $sql_query_for_bookmark sql query to be stored as bookmark - * @param array $extra_data extra data - * - * @return mixed - */ -function PMA_executeTheQuery($analyzed_sql_results, $full_sql_query, $is_gotofile, - $db, $table, $find_real_end, $sql_query_for_bookmark, $extra_data -) { - $response = PMA\libraries\Response::getInstance(); - $response->getHeader()->getMenu()->setTable($table); - - // Only if we ask to see the php code - if (isset($GLOBALS['show_as_php'])) { - $result = null; - $num_rows = 0; - $unlim_num_rows = 0; - } else { // If we don't ask to see the php code - if (isset($_SESSION['profiling']) - && PMA\libraries\Util::profilingSupported() - ) { - $GLOBALS['dbi']->query('SET PROFILING=1;'); - } - - list( - $result, - $GLOBALS['querytime'] - ) = PMA_executeQueryAndMeasureTime($full_sql_query); - - // Displays an error message if required and stop parsing the script - $error = $GLOBALS['dbi']->getError(); - if ($error && $GLOBALS['cfg']['IgnoreMultiSubmitErrors']) { - $extra_data['error'] = $error; - } elseif ($error) { - PMA_handleQueryExecuteError($is_gotofile, $error, $full_sql_query); - } - - // If there are no errors and bookmarklabel was given, - // store the query as a bookmark - if (! empty($_POST['bkm_label']) && ! empty($sql_query_for_bookmark)) { - $cfgBookmark = PMA_Bookmark_getParams(); - PMA_storeTheQueryAsBookmark( - $db, $cfgBookmark['user'], - $sql_query_for_bookmark, $_POST['bkm_label'], - isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null - ); - } // end store bookmarks - - // Gets the number of rows affected/returned - // (This must be done immediately after the query because - // mysql_affected_rows() reports about the last query done) - $num_rows = PMA_getNumberOfRowsAffectedOrChanged( - $analyzed_sql_results['is_affected'], $result - ); - - // Grabs the profiling results - if (isset($_SESSION['profiling']) - && PMA\libraries\Util::profilingSupported() - ) { - $profiling_results = $GLOBALS['dbi']->fetchResult('SHOW PROFILE;'); - } - - $justBrowsing = PMA_isJustBrowsing( - $analyzed_sql_results, isset($find_real_end) ? $find_real_end : null - ); - - $unlim_num_rows = PMA_countQueryResults( - $num_rows, $justBrowsing, $db, $table, $analyzed_sql_results - ); - - PMA_cleanupRelations( - isset($db) ? $db : '', - isset($table) ? $table : '', - isset($_REQUEST['dropped_column']) ? $_REQUEST['dropped_column'] : null, - isset($_REQUEST['purge']) ? $_REQUEST['purge'] : null - ); - - if (isset($_REQUEST['dropped_column']) - && mb_strlen($db) - && mb_strlen($table) - ) { - // to refresh the list of indexes (Ajax mode) - $extra_data['indexes_list'] = PMA\libraries\Index::getHtmlForIndexes( - $table, - $db - ); - } - } - - return array($result, $num_rows, $unlim_num_rows, - isset($profiling_results) ? $profiling_results : null, $extra_data - ); -} -/** - * Delete related tranformation information - * - * @param String $db current database - * @param String $table current table - * @param array $analyzed_sql_results analyzed sql results - * - * @return void - */ -function PMA_deleteTransformationInfo($db, $table, $analyzed_sql_results) -{ - include_once 'libraries/transformations.lib.php'; - $statement = $analyzed_sql_results['statement']; - if ($statement instanceof SqlParser\Statements\AlterStatement) { - if (!empty($statement->altered[0]) - && $statement->altered[0]->options->has('DROP') - ) { - if (!empty($statement->altered[0]->field->column)) { - PMA_clearTransformations( - $db, - $table, - $statement->altered[0]->field->column - ); - } - } - } elseif ($statement instanceof SqlParser\Statements\DropStatement) { - PMA_clearTransformations($db, $table); - } -} - -/** - * Function to get the message for the no rows returned case - * - * @param string $message_to_show message to show - * @param array $analyzed_sql_results analyzed sql results - * @param int $num_rows number of rows - * - * @return string $message - */ -function PMA_getMessageForNoRowsReturned($message_to_show, - $analyzed_sql_results, $num_rows -) { - if ($analyzed_sql_results['querytype'] == 'DELETE"') { - $message = Message::getMessageForDeletedRows($num_rows); - } elseif ($analyzed_sql_results['is_insert']) { - if ($analyzed_sql_results['querytype'] == 'REPLACE') { - // For REPLACE we get DELETED + INSERTED row count, - // so we have to call it affected - $message = Message::getMessageForAffectedRows($num_rows); - } else { - $message = Message::getMessageForInsertedRows($num_rows); - } - $insert_id = $GLOBALS['dbi']->insertId(); - if ($insert_id != 0) { - // insert_id is id of FIRST record inserted in one insert, - // so if we inserted multiple rows, we had to increment this - $message->addMessage('[br]'); - // need to use a temporary because the Message class - // currently supports adding parameters only to the first - // message - $_inserted = Message::notice(__('Inserted row id: %1$d')); - $_inserted->addParam($insert_id + $num_rows - 1); - $message->addMessage($_inserted); - } - } elseif ($analyzed_sql_results['is_affected']) { - $message = Message::getMessageForAffectedRows($num_rows); - - // Ok, here is an explanation for the !$is_select. - // The form generated by sql_query_form.lib.php - // and db_sql.php has many submit buttons - // on the same form, and some confusion arises from the - // fact that $message_to_show is sent for every case. - // The $message_to_show containing a success message and sent with - // the form should not have priority over errors - } elseif (! empty($message_to_show) - && $analyzed_sql_results['querytype'] != 'SELECT' - ) { - $message = Message::rawSuccess(htmlspecialchars($message_to_show)); - } elseif (! empty($GLOBALS['show_as_php'])) { - $message = Message::success(__('Showing as PHP code')); - } elseif (isset($GLOBALS['show_as_php'])) { - /* User disable showing as PHP, query is only displayed */ - $message = Message::notice(__('Showing SQL query')); - } else { - $message = Message::success( - __('MySQL returned an empty result set (i.e. zero rows).') - ); - } - - if (isset($GLOBALS['querytime'])) { - $_querytime = Message::notice( - '(' . __('Query took %01.4f seconds.') . ')' - ); - $_querytime->addParam($GLOBALS['querytime']); - $message->addMessage($_querytime); - } - - // In case of ROLLBACK, notify the user. - if (isset($_REQUEST['rollback_query'])) { - $message->addMessage(__('[ROLLBACK occurred.]')); - } - - return $message; -} - -/** - * Function to respond back when the query returns zero rows - * This method is called - * 1-> When browsing an empty table - * 2-> When executing a query on a non empty table which returns zero results - * 3-> When executing a query on an empty table - * 4-> When executing an INSERT, UPDATE, DELETE query from the SQL tab - * 5-> When deleting a row from BROWSE tab - * 6-> When searching using the SEARCH tab which returns zero results - * 7-> When changing the structure of the table except change operation - * - * @param array $analyzed_sql_results analyzed sql results - * @param string $db current database - * @param string $table current table - * @param string $message_to_show message to show - * @param int $num_rows number of rows - * @param DisplayResults $displayResultsObject DisplayResult instance - * @param array $extra_data extra data - * @param string $pmaThemeImage uri of the theme image - * @param object $result executed query results - * @param string $sql_query sql query - * @param string $complete_query complete sql query - * - * @return string html - */ -function PMA_getQueryResponseForNoResultsReturned($analyzed_sql_results, $db, - $table, $message_to_show, $num_rows, $displayResultsObject, $extra_data, - $pmaThemeImage, $result, $sql_query, $complete_query -) { - if (PMA_isDeleteTransformationInfo($analyzed_sql_results)) { - PMA_deleteTransformationInfo($db, $table, $analyzed_sql_results); - } - - if (isset($extra_data['error'])) { - $message = PMA\libraries\Message::rawError($extra_data['error']); - } else { - $message = PMA_getMessageForNoRowsReturned( - isset($message_to_show) ? $message_to_show : null, - $analyzed_sql_results, $num_rows - ); - } - - $html_output = ''; - $html_message = PMA\libraries\Util::getMessage( - $message, $GLOBALS['sql_query'], 'success' - ); - $html_output .= $html_message; - if (!isset($GLOBALS['show_as_php'])) { - - if (! empty($GLOBALS['reload'])) { - $extra_data['reload'] = 1; - $extra_data['db'] = $GLOBALS['db']; - } - - // For ajax requests add message and sql_query as JSON - if (empty($_REQUEST['ajax_page_request'])) { - $extra_data['message'] = $message; - if ($GLOBALS['cfg']['ShowSQL']) { - $extra_data['sql_query'] = $html_message; - } - } - - $response = PMA\libraries\Response::getInstance(); - $response->addJSON(isset($extra_data) ? $extra_data : array()); - - if (!empty($analyzed_sql_results['is_select']) && - !isset($extra_data['error'])) { - $url_query = isset($url_query) ? $url_query : null; - - $displayParts = array( - 'edit_lnk' => null, - 'del_lnk' => null, - 'sort_lnk' => '1', - 'nav_bar' => '0', - 'bkm_form' => '1', - 'text_btn' => '1', - 'pview_lnk' => '1' - ); - - $html_output .= PMA_getHtmlForSqlQueryResultsTable( - $displayResultsObject, - $pmaThemeImage, $url_query, $displayParts, - false, 0, $num_rows, true, $result, - $analyzed_sql_results, true - ); - - $html_output .= $displayResultsObject->getCreateViewQueryResultOp( - $analyzed_sql_results - ); - - $cfgBookmark = PMA_Bookmark_getParams(); - if ($cfgBookmark) { - $html_output .= PMA_getHtmlForBookmark( - $displayParts, - $cfgBookmark, - $sql_query, $db, $table, - isset($complete_query) ? $complete_query : $sql_query, - $cfgBookmark['user'] - ); - } - } - } - - return $html_output; -} - -/** - * Function to send response for ajax grid edit - * - * @param object $result result of the executed query - * - * @return void - */ -function PMA_sendResponseForGridEdit($result) -{ - $row = $GLOBALS['dbi']->fetchRow($result); - $field_flags = $GLOBALS['dbi']->fieldFlags($result, 0); - if (stristr($field_flags, PMA\libraries\DisplayResults::BINARY_FIELD)) { - $row[0] = bin2hex($row[0]); - } - $response = PMA\libraries\Response::getInstance(); - $response->addJSON('value', $row[0]); - exit; -} - -/** - * Function to get html for the sql query results div - * - * @param string $previous_update_query_html html for the previously executed query - * @param string $profiling_chart_html html for profiling - * @param Message $missing_unique_column_msg message for the missing unique column - * @param Message $bookmark_created_msg message for bookmark creation - * @param string $table_html html for the table for displaying sql - * results - * @param string $indexes_problems_html html for displaying errors in indexes - * @param string $bookmark_support_html html for displaying bookmark form - * - * @return string $html_output - */ -function PMA_getHtmlForSqlQueryResults($previous_update_query_html, - $profiling_chart_html, $missing_unique_column_msg, $bookmark_created_msg, - $table_html, $indexes_problems_html, $bookmark_support_html -) { - //begin the sqlqueryresults div here. container div - $html_output = '
    '; - $html_output .= isset($previous_update_query_html) - ? $previous_update_query_html : ''; - $html_output .= isset($profiling_chart_html) ? $profiling_chart_html : ''; - $html_output .= isset($missing_unique_column_msg) - ? $missing_unique_column_msg->getDisplay() : ''; - $html_output .= isset($bookmark_created_msg) - ? $bookmark_created_msg->getDisplay() : ''; - $html_output .= $table_html; - $html_output .= isset($indexes_problems_html) ? $indexes_problems_html : ''; - $html_output .= isset($bookmark_support_html) ? $bookmark_support_html : ''; - $html_output .= '
    '; // end sqlqueryresults div - - return $html_output; -} - -/** - * Returns a message for successful creation of a bookmark or null if a bookmark - * was not created - * - * @return Message $bookmark_created_msg - */ -function PMA_getBookmarkCreatedMessage() -{ - if (isset($_GET['label'])) { - $bookmark_created_msg = Message::success( - __('Bookmark %s has been created.') - ); - $bookmark_created_msg->addParam($_GET['label']); - } else { - $bookmark_created_msg = null; - } - - return $bookmark_created_msg; -} - -/** - * Function to get html for the sql query results table - * - * @param DisplayResults $displayResultsObject instance of DisplayResult - * @param string $pmaThemeImage theme image uri - * @param string $url_query url query - * @param array $displayParts the parts to display - * @param bool $editable whether the result table is - * editable or not - * @param int $unlim_num_rows unlimited number of rows - * @param int $num_rows number of rows - * @param bool $showtable whether to show table or not - * @param object $result result of the executed query - * @param array $analyzed_sql_results analyzed sql results - * @param bool $is_limited_display Show only limited operations or not - * - * @return String - */ -function PMA_getHtmlForSqlQueryResultsTable($displayResultsObject, - $pmaThemeImage, $url_query, $displayParts, - $editable, $unlim_num_rows, $num_rows, $showtable, $result, - $analyzed_sql_results, $is_limited_display = false -) { - $printview = isset($_REQUEST['printview']) ? $_REQUEST['printview'] : null; - $table_html = ''; - $browse_dist = ! empty($_REQUEST['is_browse_distinct']); - - if ($analyzed_sql_results['is_procedure']) { - - do { - if (! isset($result)) { - $result = $GLOBALS['dbi']->storeResult(); - } - $num_rows = $GLOBALS['dbi']->numRows($result); - - if ($result !== false && $num_rows > 0) { - - $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); - $fields_cnt = count($fields_meta); - - $displayResultsObject->setProperties( - $num_rows, - $fields_meta, - $analyzed_sql_results['is_count'], - $analyzed_sql_results['is_export'], - $analyzed_sql_results['is_func'], - $analyzed_sql_results['is_analyse'], - $num_rows, - $fields_cnt, - $GLOBALS['querytime'], - $pmaThemeImage, - $GLOBALS['text_dir'], - $analyzed_sql_results['is_maint'], - $analyzed_sql_results['is_explain'], - $analyzed_sql_results['is_show'], - $showtable, - $printview, - $url_query, - $editable, - $browse_dist - ); - - $displayParts = array( - 'edit_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, - 'del_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, - 'sort_lnk' => '1', - 'nav_bar' => '1', - 'bkm_form' => '1', - 'text_btn' => '1', - 'pview_lnk' => '1' - ); - - $table_html .= $displayResultsObject->getTable( - $result, - $displayParts, - $analyzed_sql_results, - $is_limited_display - ); - } - - $GLOBALS['dbi']->freeResult($result); - unset($result); - - } while ($GLOBALS['dbi']->moreResults() && $GLOBALS['dbi']->nextResult()); - - } else { - if (isset($result) && $result) { - $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); - $fields_cnt = count($fields_meta); - } - $_SESSION['is_multi_query'] = false; - $displayResultsObject->setProperties( - $unlim_num_rows, - $fields_meta, - $analyzed_sql_results['is_count'], - $analyzed_sql_results['is_export'], - $analyzed_sql_results['is_func'], - $analyzed_sql_results['is_analyse'], - $num_rows, - $fields_cnt, $GLOBALS['querytime'], - $pmaThemeImage, $GLOBALS['text_dir'], - $analyzed_sql_results['is_maint'], - $analyzed_sql_results['is_explain'], - $analyzed_sql_results['is_show'], - $showtable, - $printview, - $url_query, - $editable, - $browse_dist - ); - - $table_html .= $displayResultsObject->getTable( - $result, - $displayParts, - $analyzed_sql_results, - $is_limited_display - ); - $GLOBALS['dbi']->freeResult($result); - } - - return $table_html; -} - -/** - * Function to get html for the previous query if there is such. If not will return - * null - * - * @param string $disp_query display query - * @param bool $showSql whether to show sql - * @param array $sql_data sql data - * @param string $disp_message display message - * - * @return string $previous_update_query_html - */ -function PMA_getHtmlForPreviousUpdateQuery($disp_query, $showSql, $sql_data, - $disp_message -) { - // previous update query (from tbl_replace) - if (isset($disp_query) && ($showSql == true) && empty($sql_data)) { - $previous_update_query_html = PMA\libraries\Util::getMessage( - $disp_message, $disp_query, 'success' - ); - } else { - $previous_update_query_html = null; - } - - return $previous_update_query_html; -} - -/** - * To get the message if a column index is missing. If not will return null - * - * @param string $table current table - * @param string $db current database - * @param boolean $editable whether the results table can be editable or not - * @param boolean $has_unique whether there is a unique key - * - * @return Message $message - */ -function PMA_getMessageIfMissingColumnIndex($table, $db, $editable, $has_unique) -{ - if (!empty($table) && ($GLOBALS['dbi']->isSystemSchema($db) || !$editable)) { - $missing_unique_column_msg = Message::notice( - sprintf( - __( - 'Current selection does not contain a unique column.' - . ' Grid edit, checkbox, Edit, Copy and Delete features' - . ' are not available. %s' - ), - PMA\libraries\Util::showDocu( - 'config', - 'cfg_RowActionLinksWithoutUnique' - ) - ) - ); - } elseif (! empty($table) && ! $has_unique) { - $missing_unique_column_msg = Message::notice( - sprintf( - __( - 'Current selection does not contain a unique column.' - . ' Grid edit, Edit, Copy and Delete features may result in' - . ' undesired behavior. %s' - ), - PMA\libraries\Util::showDocu( - 'config', - 'cfg_RowActionLinksWithoutUnique' - ) - ) - ); - } else { - $missing_unique_column_msg = null; - } - - return $missing_unique_column_msg; -} - -/** - * Function to get html to display problems in indexes - * - * @param string $query_type query type - * @param array|null $selectedTables array of table names selected from the - * database structure page, for an action - * like check table, optimize table, - * analyze table or repair table - * @param string $db current database - * - * @return string - */ -function PMA_getHtmlForIndexesProblems($query_type, $selectedTables, $db) -{ - // BEGIN INDEX CHECK See if indexes should be checked. - if (isset($query_type) - && $query_type == 'check_tbl' - && isset($selectedTables) - && is_array($selectedTables) - ) { - $indexes_problems_html = ''; - foreach ($selectedTables as $tbl_name) { - $check = PMA\libraries\Index::findDuplicates($tbl_name, $db); - if (! empty($check)) { - $indexes_problems_html .= sprintf( - __('Problems with indexes of table `%s`'), $tbl_name - ); - $indexes_problems_html .= $check; - } - } - } else { - $indexes_problems_html = null; - } - - return $indexes_problems_html; -} - -/** - * Function to display results when the executed query returns non empty results - * - * @param object $result executed query results - * @param array $analyzed_sql_results analysed sql results - * @param string $db current database - * @param string $table current table - * @param string $message message to show - * @param array $sql_data sql data - * @param DisplayResults $displayResultsObject Instance of DisplayResults - * @param string $pmaThemeImage uri of the theme image - * @param int $unlim_num_rows unlimited number of rows - * @param int $num_rows number of rows - * @param string $disp_query display query - * @param string $disp_message display message - * @param array $profiling_results profiling results - * @param string $query_type query type - * @param array|null $selectedTables array of table names selected - * from the database structure page, for - * an action like check table, - * optimize table, analyze table or - * repair table - * @param string $sql_query sql query - * @param string $complete_query complete sql query - * - * @return string html - */ -function PMA_getQueryResponseForResultsReturned($result, $analyzed_sql_results, - $db, $table, $message, $sql_data, $displayResultsObject, $pmaThemeImage, - $unlim_num_rows, $num_rows, $disp_query, $disp_message, $profiling_results, - $query_type, $selectedTables, $sql_query, $complete_query -) { - // If we are retrieving the full value of a truncated field or the original - // value of a transformed field, show it here - if (isset($_REQUEST['grid_edit']) && $_REQUEST['grid_edit'] == true) { - PMA_sendResponseForGridEdit($result); - // script has exited at this point - } - - // Gets the list of fields properties - if (isset($result) && $result) { - $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); - } - - // Should be initialized these parameters before parsing - $showtable = isset($showtable) ? $showtable : null; - $url_query = isset($url_query) ? $url_query : null; - - $response = PMA\libraries\Response::getInstance(); - $header = $response->getHeader(); - $scripts = $header->getScripts(); - - $just_one_table = PMA_resultSetHasJustOneTable($fields_meta); - - // hide edit and delete links: - // - for information_schema - // - if the result set does not contain all the columns of a unique key - // (unless this is an updatable view) - // - if the SELECT query contains a join or a subquery - - $updatableView = false; - - $statement = $analyzed_sql_results['statement']; - if ($statement instanceof SqlParser\Statements\SelectStatement) { - if (!empty($statement->expr)) { - if ($statement->expr[0]->expr === '*') { - $_table = new Table($table, $db); - $updatableView = $_table->isUpdatableView(); - } - } - - if ($analyzed_sql_results['join'] - || $analyzed_sql_results['is_subquery'] - || count($analyzed_sql_results['select_tables']) !== 1 - ) { - $just_one_table = false; - } - } - - $has_unique = PMA_resultSetContainsUniqueKey( - $db, $table, $fields_meta - ); - - $editable = ($has_unique - || $GLOBALS['cfg']['RowActionLinksWithoutUnique'] - || $updatableView) - && $just_one_table; - - $displayParts = array( - 'edit_lnk' => $displayResultsObject::UPDATE_ROW, - 'del_lnk' => $displayResultsObject::DELETE_ROW, - 'sort_lnk' => '1', - 'nav_bar' => '1', - 'bkm_form' => '1', - 'text_btn' => '0', - 'pview_lnk' => '1' - ); - - if ($GLOBALS['dbi']->isSystemSchema($db) || !$editable) { - $displayParts = array( - 'edit_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, - 'del_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, - 'sort_lnk' => '1', - 'nav_bar' => '1', - 'bkm_form' => '1', - 'text_btn' => '1', - 'pview_lnk' => '1' - ); - - } - if (isset($_REQUEST['printview']) && $_REQUEST['printview'] == '1') { - $displayParts = array( - 'edit_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, - 'del_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, - 'sort_lnk' => '0', - 'nav_bar' => '0', - 'bkm_form' => '0', - 'text_btn' => '0', - 'pview_lnk' => '0' - ); - } - - if (isset($_REQUEST['table_maintenance'])) { - $scripts->addFile('makegrid.js'); - $scripts->addFile('sql.js'); - $table_maintenance_html = ''; - if (isset($message)) { - $message = Message::success($message); - $table_maintenance_html = PMA\libraries\Util::getMessage( - $message, $GLOBALS['sql_query'], 'success' - ); - } - $table_maintenance_html .= PMA_getHtmlForSqlQueryResultsTable( - $displayResultsObject, - $pmaThemeImage, $url_query, $displayParts, - false, $unlim_num_rows, $num_rows, $showtable, $result, - $analyzed_sql_results - ); - if (empty($sql_data) || ($sql_data['valid_queries'] = 1)) { - $response->addHTML($table_maintenance_html); - exit(); - } - } - - if (!isset($_REQUEST['printview']) || $_REQUEST['printview'] != '1') { - $scripts->addFile('makegrid.js'); - $scripts->addFile('sql.js'); - unset($GLOBALS['message']); - //we don't need to buffer the output in getMessage here. - //set a global variable and check against it in the function - $GLOBALS['buffer_message'] = false; - } - - $previous_update_query_html = PMA_getHtmlForPreviousUpdateQuery( - isset($disp_query) ? $disp_query : null, - $GLOBALS['cfg']['ShowSQL'], isset($sql_data) ? $sql_data : null, - isset($disp_message) ? $disp_message : null - ); - - $profiling_chart_html = PMA_getHtmlForProfilingChart( - $url_query, $db, isset($profiling_results) ? $profiling_results :array() - ); - - $missing_unique_column_msg = PMA_getMessageIfMissingColumnIndex( - $table, $db, $editable, $has_unique - ); - - $bookmark_created_msg = PMA_getBookmarkCreatedMessage(); - - $table_html = PMA_getHtmlForSqlQueryResultsTable( - $displayResultsObject, - $pmaThemeImage, $url_query, $displayParts, - $editable, $unlim_num_rows, $num_rows, $showtable, $result, - $analyzed_sql_results - ); - - $indexes_problems_html = PMA_getHtmlForIndexesProblems( - isset($query_type) ? $query_type : null, - isset($selectedTables) ? $selectedTables : null, $db - ); - - $cfgBookmark = PMA_Bookmark_getParams(); - if ($cfgBookmark) { - $bookmark_support_html = PMA_getHtmlForBookmark( - $displayParts, - $cfgBookmark, - $sql_query, $db, $table, - isset($complete_query) ? $complete_query : $sql_query, - $cfgBookmark['user'] - ); - } else { - $bookmark_support_html = ''; - } - - $html_output = isset($table_maintenance_html) ? $table_maintenance_html : ''; - - $html_output .= PMA_getHtmlForSqlQueryResults( - $previous_update_query_html, $profiling_chart_html, - $missing_unique_column_msg, $bookmark_created_msg, - $table_html, $indexes_problems_html, $bookmark_support_html - ); - - return $html_output; -} - -/** - * Function to execute the query and send the response - * - * @param array $analyzed_sql_results analysed sql results - * @param bool $is_gotofile whether goto file or not - * @param string $db current database - * @param string $table current table - * @param bool|null $find_real_end whether to find real end or not - * @param string $sql_query_for_bookmark the sql query to be stored as bookmark - * @param array|null $extra_data extra data - * @param string $message_to_show message to show - * @param string $message message - * @param array|null $sql_data sql data - * @param string $goto goto page url - * @param string $pmaThemeImage uri of the PMA theme image - * @param string $disp_query display query - * @param string $disp_message display message - * @param string $query_type query type - * @param string $sql_query sql query - * @param array|null $selectedTables array of table names selected from the - * database structure page, for an action - * like check table, optimize table, - * analyze table or repair table - * @param string $complete_query complete query - * - * @return void - */ -function PMA_executeQueryAndSendQueryResponse($analyzed_sql_results, - $is_gotofile, $db, $table, $find_real_end, $sql_query_for_bookmark, - $extra_data, $message_to_show, $message, $sql_data, $goto, $pmaThemeImage, - $disp_query, $disp_message, $query_type, $sql_query, $selectedTables, - $complete_query -) { - if ($analyzed_sql_results == null) { - // Parse and analyze the query - include_once 'libraries/parse_analyze.lib.php'; - list( - $analyzed_sql_results, - $db, - $table_from_sql - ) = PMA_parseAnalyze($sql_query, $db); - // @todo: possibly refactor - extract($analyzed_sql_results); - - if ($table != $table_from_sql && !empty($table_from_sql)) { - $table = $table_from_sql; - } - } - - $html_output = PMA_executeQueryAndGetQueryResponse( - $analyzed_sql_results, // analyzed_sql_results - $is_gotofile, // is_gotofile - $db, // db - $table, // table - $find_real_end, // find_real_end - $sql_query_for_bookmark, // sql_query_for_bookmark - $extra_data, // extra_data - $message_to_show, // message_to_show - $message, // message - $sql_data, // sql_data - $goto, // goto - $pmaThemeImage, // pmaThemeImage - $disp_query, // disp_query - $disp_message, // disp_message - $query_type, // query_type - $sql_query, // sql_query - $selectedTables, // selectedTables - $complete_query // complete_query - ); - - $response = PMA\libraries\Response::getInstance(); - $response->addHTML($html_output); -} - -/** - * Function to execute the query and send the response - * - * @param array $analyzed_sql_results analysed sql results - * @param bool $is_gotofile whether goto file or not - * @param string $db current database - * @param string $table current table - * @param bool|null $find_real_end whether to find real end or not - * @param string $sql_query_for_bookmark the sql query to be stored as bookmark - * @param array|null $extra_data extra data - * @param string $message_to_show message to show - * @param string $message message - * @param array|null $sql_data sql data - * @param string $goto goto page url - * @param string $pmaThemeImage uri of the PMA theme image - * @param string $disp_query display query - * @param string $disp_message display message - * @param string $query_type query type - * @param string $sql_query sql query - * @param array|null $selectedTables array of table names selected from the - * database structure page, for an action - * like check table, optimize table, - * analyze table or repair table - * @param string $complete_query complete query - * - * @return string html - */ -function PMA_executeQueryAndGetQueryResponse($analyzed_sql_results, - $is_gotofile, $db, $table, $find_real_end, $sql_query_for_bookmark, - $extra_data, $message_to_show, $message, $sql_data, $goto, $pmaThemeImage, - $disp_query, $disp_message, $query_type, $sql_query, $selectedTables, - $complete_query -) { - // Handle disable/enable foreign key checks - $default_fk_check = PMA\libraries\Util::handleDisableFKCheckInit(); - - // Handle remembered sorting order, only for single table query. - // Handling is not required when it's a union query - // (the parser never sets the 'union' key to 0). - // Handling is also not required if we came from the "Sort by key" - // drop-down. - if (! empty($analyzed_sql_results) - && PMA_isRememberSortingOrder($analyzed_sql_results) - && empty($analyzed_sql_results['union']) - && ! isset($_REQUEST['sort_by_key']) - ) { - if (! isset($_SESSION['sql_from_query_box'])) { - PMA_handleSortOrder($db, $table, $analyzed_sql_results, $sql_query); - } else { - unset($_SESSION['sql_from_query_box']); - } - - } - - $displayResultsObject = new PMA\libraries\DisplayResults( - $GLOBALS['db'], $GLOBALS['table'], $goto, $sql_query - ); - $displayResultsObject->setConfigParamsForDisplayTable(); - - // assign default full_sql_query - $full_sql_query = $sql_query; - - // Do append a "LIMIT" clause? - if (PMA_isAppendLimitClause($analyzed_sql_results)) { - $full_sql_query = PMA_getSqlWithLimitClause($analyzed_sql_results); - } - - $GLOBALS['reload'] = PMA_hasCurrentDbChanged($db); - $GLOBALS['dbi']->selectDb($db); - - // Execute the query - list($result, $num_rows, $unlim_num_rows, $profiling_results, $extra_data) - = PMA_executeTheQuery( - $analyzed_sql_results, - $full_sql_query, - $is_gotofile, - $db, - $table, - isset($find_real_end) ? $find_real_end : null, - isset($sql_query_for_bookmark) ? $sql_query_for_bookmark : null, - isset($extra_data) ? $extra_data : null - ); - - // No rows returned -> move back to the calling page - if ((0 == $num_rows && 0 == $unlim_num_rows) - || $analyzed_sql_results['is_affected'] - ) { - $html_output = PMA_getQueryResponseForNoResultsReturned( - $analyzed_sql_results, $db, $table, - isset($message_to_show) ? $message_to_show : null, - $num_rows, $displayResultsObject, $extra_data, - $pmaThemeImage, isset($result) ? $result : null, - $sql_query, isset($complete_query) ? $complete_query : null - ); - } else { - // At least one row is returned -> displays a table with results - $html_output = PMA_getQueryResponseForResultsReturned( - isset($result) ? $result : null, - $analyzed_sql_results, - $db, - $table, - isset($message) ? $message : null, - isset($sql_data) ? $sql_data : null, - $displayResultsObject, - $pmaThemeImage, - $unlim_num_rows, - $num_rows, - isset($disp_query) ? $disp_query : null, - isset($disp_message) ? $disp_message : null, - $profiling_results, - isset($query_type) ? $query_type : null, - isset($selectedTables) ? $selectedTables : null, - $sql_query, - isset($complete_query) ? $complete_query : null - ); - } - - // Handle disable/enable foreign key checks - PMA\libraries\Util::handleDisableFKCheckCleanup($default_fk_check); - - return $html_output; -} - -/** - * Function to define pos to display a row - * - * @param Int $number_of_line Number of the line to display - * @param Int $max_rows Number of rows by page - * - * @return Int Start position to display the line - */ -function PMA_getStartPosToDisplayRow($number_of_line, $max_rows = null) -{ - if (null === $max_rows) { - $max_rows = $_SESSION['tmpval']['max_rows']; - } - - return @((ceil($number_of_line / $max_rows) - 1) * $max_rows); -} - -/** - * Function to calculate new pos if pos is higher than number of rows - * of displayed table - * - * @param String $db Database name - * @param String $table Table name - * @param Int|null $pos Initial position - * - * @return Int Number of pos to display last page - */ -function PMA_calculatePosForLastPage($db, $table, $pos) -{ - if (null === $pos) { - $pos = $_SESSION['tmpval']['pos']; - } - - $_table = new Table($table, $db); - $unlim_num_rows = $_table->countRecords(true); - //If position is higher than number of rows - if ($unlim_num_rows <= $pos && 0 != $pos) { - $pos = PMA_getStartPosToDisplayRow($unlim_num_rows); - } - - return $pos; -} diff --git a/#pma/libraries/sql_query_form.lib.php b/#pma/libraries/sql_query_form.lib.php deleted file mode 100644 index 35ee7b70..00000000 --- a/#pma/libraries/sql_query_form.lib.php +++ /dev/null @@ -1,435 +0,0 @@ -' . "\n"; - - $html .= '' - . "\n" . PMA_URL_getHiddenInputs($db, $table) . "\n" - . '' . "\n" - . '' . "\n" - . '' - . "\n" . '' . "\n"; - - // display querybox - if ($display_tab === 'full' || $display_tab === 'sql') { - $html .= PMA_getHtmlForSqlQueryFormInsert( - $query, $delimiter - ); - } - - // Bookmark Support - if ($display_tab === 'full') { - $cfgBookmark = PMA_Bookmark_getParams(); - if ($cfgBookmark) { - $html .= PMA_getHtmlForSqlQueryFormBookmark(); - } - } - - // Encoding setting form appended by Y.Kawada - if (function_exists('PMA_Kanji_encodingForm')) { - $html .= PMA_Kanji_encodingForm(); - } - - $html .= '' . "\n"; - // print an empty div, which will be later filled with - // the sql query results by ajax - $html .= '
    '; - - return $html; -} - -/** - * Get initial values for Sql Query Form Insert - * - * @param string $query query to display in the textarea - * - * @return array ($legend, $query, $columns_list) - * - * @usedby PMA_getHtmlForSqlQueryFormInsert() - */ -function PMA_initQueryForm($query) -{ - $columns_list = array(); - if (! mb_strlen($GLOBALS['db'])) { - // prepare for server related - $legend = sprintf( - __('Run SQL query/queries on server %s'), - '"' . htmlspecialchars( - ! empty($GLOBALS['cfg']['Servers'][$GLOBALS['server']]['verbose']) - ? $GLOBALS['cfg']['Servers'][$GLOBALS['server']]['verbose'] - : $GLOBALS['cfg']['Servers'][$GLOBALS['server']]['host'] - ) . '"' - ); - } elseif (! mb_strlen($GLOBALS['table'])) { - // prepare for db related - $db = $GLOBALS['db']; - // if you want navigation: - $tmp_db_link = ''; - $legend = sprintf(__('Run SQL query/queries on database %s'), $tmp_db_link); - if (empty($query)) { - $query = PMA\libraries\Util::expandUserString( - $GLOBALS['cfg']['DefaultQueryDatabase'], 'backquote' - ); - } - } else { - $db = $GLOBALS['db']; - $table = $GLOBALS['table']; - // Get the list and number of fields - // we do a try_query here, because we could be in the query window, - // trying to synchronize and the table has not yet been created - $columns_list = $GLOBALS['dbi']->getColumns( - $db, $GLOBALS['table'], null, true - ); - - $tmp_tbl_link = ''; - $tmp_tbl_link .= htmlspecialchars($db) - . '.' . htmlspecialchars($table) . ''; - $legend = sprintf(__('Run SQL query/queries on table %s'), $tmp_tbl_link); - if (empty($query)) { - $query = PMA\libraries\Util::expandUserString( - $GLOBALS['cfg']['DefaultQueryTable'], 'backquote' - ); - } - } - $legend .= ': ' . PMA\libraries\Util::showMySQLDocu('SELECT'); - - return array($legend, $query, $columns_list); -} - -/** - * return HTML for Sql Query Form Insert - * - * @param string $query query to display in the textarea - * @param string $delimiter default delimiter to use - * - * @return string - * - * @usedby PMA_getHtmlForSqlQueryForm() - */ -function PMA_getHtmlForSqlQueryFormInsert( - $query = '', $delimiter = ';' -) { - // enable auto select text in textarea - if ($GLOBALS['cfg']['TextareaAutoSelect']) { - $auto_sel = ' onclick="selectContent(this, sql_box_locked, true);"'; - } else { - $auto_sel = ''; - } - - $locking = ''; - $height = $GLOBALS['cfg']['TextareaRows'] * 2; - - list($legend, $query, $columns_list) = PMA_initQueryForm($query); - - if (! empty($columns_list)) { - $sqlquerycontainer_id = 'sqlquerycontainer'; - } else { - $sqlquerycontainer_id = 'sqlquerycontainerfull'; - } - - $html = '' - . '
    ' - . '
    '; - $html .= '' . $legend . ''; - $html .= '
    '; - $html .= '
    ' - . ''; - $html .= '
    '; - // Add buttons to generate query easily for - // select all, single select, insert, update and delete - if (! empty($columns_list)) { - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - $html .= ''; - if ($GLOBALS['cfg']['CodemirrorEnable']) { - $html .= ''; - } - $html .= ''; - - // parameter binding - $html .= '
    '; - $html .= ''; - $html .= ''; - $html .= PMA\libraries\Util::showDocu('faq', 'faq6-40'); - $html .= '
    '; - $html .= '
    '; - - $html .= '
    ' . "\n"; - - if (! empty($columns_list)) { - $html .= '
    ' - . '' - . '' - . '
    '; - if (PMA\libraries\Util::showIcons('ActionLinksMode')) { - $html .= ''; - } else { - $html .= ''; - } - $html .= '
    ' . "\n" - . '
    ' . "\n"; - } - - $html .= '
    ' . "\n"; - $html .= '
    ' . "\n"; - - $cfgBookmark = PMA_Bookmark_getParams(); - if ($cfgBookmark) { - $html .= '
    '; - $html .= '
    '; - $html .= ''; - $html .= ''; - $html .= '
    '; - $html .= '
    '; - $html .= ''; - $html .= ''; - $html .= '
    '; - $html .= '
    '; - $html .= ''; - $html .= ''; - $html .= '
    '; - $html .= '
    '; - } - - $html .= '
    ' . "\n"; - $html .= '
    ' . "\n" - . '
    ' . "\n"; - - $html .= '
    ' . "\n"; - $html .= '
    ' . "\n"; - $html .= '
    ' . "\n"; - - $html .= '
    '; - $html .= '' . "\n"; - $html .= ' ]'; - $html .= '
    '; - - $html .= '
    '; - $html .= '' - . ''; - $html .= '
    '; - - $html .= '
    '; - $html .= '' - . ''; - $html .= '
    '; - - $html .= '
    '; - $html .= '' - . ''; - $html .= '
    '; - - // Disable/Enable foreign key checks - $html .= '
    '; - $html .= PMA\libraries\Util::getFKCheckbox(); - $html .= '
    '; - - $html .= '' . "\n"; - $html .= '
    ' . "\n"; - $html .= '
    ' . "\n"; - - return $html; -} - -/** - * return HTML for sql Query Form Bookmark - * - * @return string|null - * - * @usedby PMA_getHtmlForSqlQueryForm() - */ -function PMA_getHtmlForSqlQueryFormBookmark() -{ - $bookmark_list = PMA_Bookmark_getList($GLOBALS['db']); - if (empty($bookmark_list) || count($bookmark_list) < 1) { - return null; - } - - $html = '
    '; - $html .= ''; - $html .= __('Bookmarked SQL query') . '' . "\n"; - $html .= '
    '; - $html .= ' ' . "\n"; - $html .= '
    ' . "\n"; - $html .= '
    ' . "\n"; - $html .= '' - . '' . "\n"; - $html .= '' - . '' . "\n"; - $html .= '' - . '' . "\n"; - $html .= '
    ' . "\n"; - $html .= '
    ' . "\n"; - $html .= '
    ' . "\n"; - $html .= __('Variables'); - $html .= PMA\libraries\Util::showDocu('faq', 'faqbookmark'); - $html .= '
    '; - $html .= '
    ' . "\n"; - $html .= '
    ' . "\n"; - - $html .= '
    '; - $html .= ''; - $html .= '
    ' . "\n"; - $html .= '
    ' . "\n"; - - return $html; -} diff --git a/#pma/libraries/string.lib.php b/#pma/libraries/string.lib.php deleted file mode 100644 index e1e54f37..00000000 --- a/#pma/libraries/string.lib.php +++ /dev/null @@ -1,33 +0,0 @@ -= strlen($haystack) - ) { - return false; - } - return stripos($haystack, $needle, $offset); - } - - /** - * Returns position of last $needle in $haystack or false if not found - * - * @param string $haystack the string being checked - * @param string $needle the string to find in haystack - * @param int $offset the search offset - * - * @return integer position of last $needle in $haystack or false - */ - function mb_strrpos($haystack, $needle, $offset = 0) - { - return strrpos($haystack, $needle, $offset); - } - - /** - * Returns position of last $needle in $haystack - case insensitive - or false - * if not found - * - * @param string $haystack the string being checked - * @param string $needle the string to find in haystack - * @param int $offset the search offset - * - * @return integer position of last $needle in $haystack or false - */ - function mb_strripos($haystack, $needle, $offset = 0) - { - if (('' === $haystack || false === $haystack) && $offset >= strlen($haystack) - ) { - return false; - } - return strripos($haystack, $needle, $offset); - } - - /** - * Returns part of $haystack string starting from and including the first - * occurrence of $needle to the end of $haystack or false if not found - * - * @param string $haystack the string being checked - * @param string $needle the string to find in haystack - * @param bool $before_needle the part before the needle - * - * @return string part of $haystack or false - */ - function mb_strstr($haystack, $needle, $before_needle = false) - { - return strstr($haystack, $needle, $before_needle); - } - - /** - * Returns part of $haystack string starting from and including the first - * occurrence of $needle to the end of $haystack - case insensitive - or false - * if not found - * - * @param string $haystack the string being checked - * @param string $needle the string to find in haystack - * @param bool $before_needle the part before the needle - * - * @return string part of $haystack or false - */ - function mb_stristr($haystack, $needle, $before_needle = false) - { - return stristr($haystack, $needle, $before_needle); - } - - /** - * Returns the portion of haystack which starts at the last occurrence or false - * if not found - * - * @param string $haystack the string being checked - * @param string $needle the string to find in haystack - * - * @return string portion of haystack which starts at the last occurrence or - * false - */ - function mb_strrchr($haystack, $needle) - { - return strrchr($haystack, $needle); - } - - /** - * Make a string lowercase - * - * @param string $string the string being lowercased - * - * @return string the lower case string - */ - function mb_strtolower($string) - { - return strtolower($string); - } - - /** - * Make a string uppercase - * - * @param string $string the string being uppercased - * - * @return string the upper case string - */ - function mb_strtoupper($string) - { - return strtoupper($string); - } -} - -//New functions. -if (!@function_exists('mb_ord')) { - /** - * Perform a regular expression match - * - * @param string $pattern Pattern to search for - * @param string $subject Input string - * @param int $offset Start from search - * - * @return int 1 if matched, 0 if doesn't, false on failure - */ - function mb_preg_strpos($pattern, $subject, $offset = 0) - { - $matches = array(); - $bFind = preg_match( - $pattern, $subject, $matches, PREG_OFFSET_CAPTURE, $offset - ); - if (1 !== $bFind) { - return false; - } - - return $matches[1][1]; - } - - /** - * Get the ordinal value of a string - * - * @param string $string the string for which ord is required - * - * @return int the ord value - */ - function mb_ord($string) - { - return ord($string); - } - - /** - * Get the character of an ASCII - * - * @param int $ascii the ASCII code for which character is required - * - * @return string the character - */ - function mb_chr($ascii) - { - return chr($ascii); - } -} \ No newline at end of file diff --git a/#pma/libraries/sysinfo.lib.php b/#pma/libraries/sysinfo.lib.php deleted file mode 100644 index e20cd3fe..00000000 --- a/#pma/libraries/sysinfo.lib.php +++ /dev/null @@ -1,61 +0,0 @@ -supported()) { - return $ret; - } - } - - return new \PMA\libraries\SysInfo(); -} diff --git a/#pma/libraries/tbl_columns_definition_form.inc.php b/#pma/libraries/tbl_columns_definition_form.inc.php deleted file mode 100644 index 4fa2de4b..00000000 --- a/#pma/libraries/tbl_columns_definition_form.inc.php +++ /dev/null @@ -1,416 +0,0 @@ - $db -); - -if ($action == 'tbl_create.php') { - $form_params['reload'] = 1; -} else { - if ($action == 'tbl_addfield.php') { - $form_params = array_merge( - $form_params, array( - 'field_where' => Util\get($_REQUEST, 'field_where')) - ); - if (isset($_REQUEST['field_where'])) { - $form_params['after_field'] = $_REQUEST['after_field']; - } - } - $form_params['table'] = $table; -} - -if (isset($num_fields)) { - $form_params['orig_num_fields'] = $num_fields; -} - -$form_params = array_merge( - $form_params, - array( - 'orig_field_where' => Util\get($_REQUEST, 'field_where'), - 'orig_after_field' => Util\get($_REQUEST, 'after_field'), - ) -); - -if (isset($selected) && is_array($selected)) { - foreach ($selected as $o_fld_nr => $o_fld_val) { - $form_params['selected[' . $o_fld_nr . ']'] = $o_fld_val; - } -} - -$is_backup = ($action != 'tbl_create.php' && $action != 'tbl_addfield.php'); - -require_once './libraries/transformations.lib.php'; -$cfgRelation = PMA_getRelationsParam(); - -$comments_map = PMA_getComments($db, $table); - -$move_columns = array(); -if (isset($fields_meta)) { - /** @var PMA\libraries\DatabaseInterface $dbi */ - $dbi = \PMA\libraries\di\Container::getDefaultContainer()->get('dbi'); - $move_columns = $dbi->getTable($db, $table)->getColumnsMeta(); -} - -$available_mime = array(); -if ($cfgRelation['mimework'] && $GLOBALS['cfg']['BrowseMIME']) { - $mime_map = PMA_getMIME($db, $table); - $available_mime = PMA_getAvailableMIMEtypes(); -} - -// workaround for field_fulltext, because its submitted indices contain -// the index as a value, not a key. Inserted here for easier maintenance -// and less code to change in existing files. -if (isset($field_fulltext) && is_array($field_fulltext)) { - foreach ($field_fulltext as $fulltext_nr => $fulltext_indexkey) { - $submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey; - } -} -if (isset($_REQUEST['submit_num_fields']) - || isset($_REQUEST['submit_partition_change']) -) { - //if adding new fields, set regenerate to keep the original values - $regenerate = 1; -} - -$foreigners = PMA_getForeigners($db, $table, '', 'foreign'); -$child_references = null; -// From MySQL 5.6.6 onwards columns with foreign keys can be renamed. -// Hence, no need to get child references -if (PMA_MYSQL_INT_VERSION < 50606) { - $child_references = PMA_getChildReferences($db, $table); -} - -for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) { - - $type = ''; - $length = ''; - $columnMeta = array(); - $submit_attribute = null; - $extracted_columnspec = array(); - - if (!empty($regenerate)) { - - $columnMeta = array_merge( - $columnMeta, - array( - 'Field' => Util\get( - $_REQUEST, "field_name.${columnNumber}", false - ), - 'Type' => Util\get( - $_REQUEST, "field_type.${columnNumber}", false - ), - 'Collation' => Util\get( - $_REQUEST, "field_collation.${columnNumber}", '' - ), - 'Null' => Util\get( - $_REQUEST, "field_null.${columnNumber}", '' - ), - 'DefaultType' => Util\get( - $_REQUEST, "field_default_type.${columnNumber}", 'NONE' - ), - 'DefaultValue' => Util\get( - $_REQUEST, "field_default_value.${columnNumber}", '' - ), - 'Extra' => Util\get( - $_REQUEST, "field_extra.${columnNumber}", false - ), - 'Virtuality' => Util\get( - $_REQUEST, "field_virtuality.${columnNumber}", '' - ), - 'Expression' => Util\get( - $_REQUEST, "field_expression.${columnNumber}", '' - ), - ) - ); - - $columnMeta['Key'] = ''; - $parts = explode( - '_', Util\get($_REQUEST, "field_key.${columnNumber}", ''), 2 - ); - if (count($parts) == 2 && $parts[1] == $columnNumber) { - $columnMeta['Key'] = Util\get( - array( - 'primary' => 'PRI', - 'index' => 'MUL', - 'unique' => 'UNI', - 'fulltext' => 'FULLTEXT', - 'spatial' => 'SPATIAL' - ), - $parts[0], '' - ); - } - - $columnMeta['Comment'] - = isset($submit_fulltext[$columnNumber]) - && ($submit_fulltext[$columnNumber] == $columnNumber) - ? 'FULLTEXT' : false; - - switch ($columnMeta['DefaultType']) { - case 'NONE': - $columnMeta['Default'] = null; - break; - case 'USER_DEFINED': - $columnMeta['Default'] = $columnMeta['DefaultValue']; - break; - case 'NULL': - case 'CURRENT_TIMESTAMP': - $columnMeta['Default'] = $columnMeta['DefaultType']; - break; - } - - $length = Util\get($_REQUEST, "field_length.${columnNumber}", $length); - $submit_attribute = Util\get( - $_REQUEST, "field_attribute.${columnNumber}", false - ); - $comments_map[$columnMeta['Field']] = Util\get( - $_REQUEST, "field_comments.${columnNumber}" - ); - - $mime_map[$columnMeta['Field']] = array_merge( - $mime_map[$columnMeta['Field']], - array( - 'mimetype' => Util\get($_REQUEST, "field_mimetype.${$columnNumber}"), - 'transformation' => Util\get( - $_REQUEST, "field_transformation.${$columnNumber}" - ), - 'transformation_options' => Util\get( - $_REQUEST, "field_transformation_options.${$columnNumber}" - ), - ) - ); - - } elseif (isset($fields_meta[$columnNumber])) { - $columnMeta = $fields_meta[$columnNumber]; - $virtual = array( - 'VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED' - ); - if (in_array($columnMeta['Extra'], $virtual)) { - $tableObj = new Table($GLOBALS['table'], $GLOBALS['db']); - $expressions = $tableObj->getColumnGenerationExpression( - $columnMeta['Field'] - ); - $columnMeta['Expression'] = $expressions[$columnMeta['Field']]; - } - switch ($columnMeta['Default']) { - case null: - if (is_null($columnMeta['Default'])) { // null - if ($columnMeta['Null'] == 'YES') { - $columnMeta['DefaultType'] = 'NULL'; - $columnMeta['DefaultValue'] = ''; - } else { - $columnMeta['DefaultType'] = 'NONE'; - $columnMeta['DefaultValue'] = ''; - } - } else { // empty - $columnMeta['DefaultType'] = 'USER_DEFINED'; - $columnMeta['DefaultValue'] = $columnMeta['Default']; - } - break; - case 'CURRENT_TIMESTAMP': - $columnMeta['DefaultType'] = 'CURRENT_TIMESTAMP'; - $columnMeta['DefaultValue'] = ''; - break; - default: - $columnMeta['DefaultType'] = 'USER_DEFINED'; - $columnMeta['DefaultValue'] = $columnMeta['Default']; - break; - } - } - - if (isset($columnMeta['Type'])) { - $extracted_columnspec = PMA\libraries\Util::extractColumnSpec( - $columnMeta['Type'] - ); - if ($extracted_columnspec['type'] == 'bit') { - $columnMeta['Default'] - = PMA\libraries\Util::convertBitDefaultValue($columnMeta['Default']); - } - $type = $extracted_columnspec['type']; - if ($length == '') { - $length = $extracted_columnspec['spec_in_brackets']; - } - } else { - // creating a column - $columnMeta['Type'] = ''; - } - - // Variable tell if current column is bound in a foreign key constraint or not. - // MySQL version from 5.6.6 allow renaming columns with foreign keys - if (isset($columnMeta['Field']) - && isset($form_params['table']) - && PMA_MYSQL_INT_VERSION < 50606 - ) { - $columnMeta['column_status'] = PMA_checkChildForeignReferences( - $form_params['db'], - $form_params['table'], - $columnMeta['Field'], - $foreigners, - $child_references - ); - } - - // some types, for example longtext, are reported as - // "longtext character set latin7" when their charset and / or collation - // differs from the ones of the corresponding database. - // rtrim the type, for cases like "float unsigned" - $type = rtrim( - preg_replace('/[\s]character set[\s][\S]+/', '', $type) - ); - - /** - * old column attributes - */ - if ($is_backup) { - - // old column name - if (isset($columnMeta['Field'])) { - $form_params['field_orig[' . $columnNumber . ']'] - = $columnMeta['Field']; - if (isset($columnMeta['column_status']) - && !$columnMeta['column_status']['isEditable'] - ) { - $form_params['field_name[' . $columnNumber . ']'] - = $columnMeta['Field']; - } - } else { - $form_params['field_orig[' . $columnNumber . ']'] = ''; - } - - // old column type - if (isset($columnMeta['Type'])) { - // keep in uppercase because the new type will be in uppercase - $form_params['field_type_orig[' . $columnNumber . ']'] = mb_strtoupper($type); - if (isset($columnMeta['column_status']) - && !$columnMeta['column_status']['isEditable'] - ) { - $form_params['field_type[' . $columnNumber . ']'] = mb_strtoupper($type); - } - } else { - $form_params['field_type_orig[' . $columnNumber . ']'] = ''; - } - - // old column length - $form_params['field_length_orig[' . $columnNumber . ']'] = $length; - - // old column default - $form_params = array_merge( - $form_params, - array( - "field_default_value_orig[${columnNumber}]" => Util\get( - $columnMeta, 'Default', '' - ), - "field_default_type_orig[${columnNumber}]" => Util\get( - $columnMeta, 'DefaultType', '' - ), - "field_collation_orig[${columnNumber}]" => Util\get( - $columnMeta, 'Collation', '' - ), - "field_attribute_orig[${columnNumber}]" => trim( - Util\get($extracted_columnspec, 'attribute', '') - ), - "field_null_orig[${columnNumber}]" => Util\get( - $columnMeta, 'Null', '' - ), - "field_extra_orig[${columnNumber}]" => Util\get( - $columnMeta, 'Extra', '' - ), - "field_comments_orig[${columnNumber}]" => Util\get( - $columnMeta, 'Comment', '' - ), - "field_virtuality_orig[${columnNumber}]" => Util\get( - $columnMeta, 'Virtuality', '' - ), - "field_expression_orig[${columnNumber}]" => Util\get( - $columnMeta, 'Expression', '' - ), - ) - ); - } - - $content_cells[$columnNumber] = array( - 'columnNumber' => $columnNumber, - 'columnMeta' => $columnMeta, - 'type_upper' => mb_strtoupper($type), - 'length_values_input_size' => $length_values_input_size, - 'length' => $length, - 'extracted_columnspec' => $extracted_columnspec, - 'submit_attribute' => $submit_attribute, - 'comments_map' => $comments_map, - 'fields_meta' => isset($fields_meta) ? $fields_meta : null, - 'is_backup' => $is_backup, - 'move_columns' => $move_columns, - 'cfgRelation' => $cfgRelation, - 'available_mime' => $available_mime, - 'mime_map' => isset($mime_map) ? $mime_map : array() - ); -} // end for - -$html = PMA\libraries\Template::get('columns_definitions/column_definitions_form') - ->render( - array( - 'is_backup' => $is_backup, - 'fields_meta' => isset($fields_meta) ? $fields_meta : null, - 'mimework' => $cfgRelation['mimework'], - 'action' => $action, - 'form_params' => $form_params, - 'content_cells' => $content_cells, - ) - ); - -unset($form_params); - -$response = PMA\libraries\Response::getInstance(); -$response->getHeader()->getScripts()->addFiles( - array( - 'jquery/jquery.uitablefilter.js', - 'indexes.js' - ) -); -$response->addHTML($html); diff --git a/#pma/libraries/tbl_common.inc.php b/#pma/libraries/tbl_common.inc.php deleted file mode 100644 index 5878717d..00000000 --- a/#pma/libraries/tbl_common.inc.php +++ /dev/null @@ -1,55 +0,0 @@ -isSystemSchema($db); - -/** - * Set parameters for links - * @deprecated - */ -$url_query = PMA_URL_getCommon(array('db' => $db, 'table' => $table)); - -/** - * Set parameters for links - */ -$url_params = array(); -$url_params['db'] = $db; -$url_params['table'] = $table; - -/** - * Defines the urls to return to in case of error in a sql statement - */ -$err_url_0 = PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabDatabase'], 'database' -) - . PMA_URL_getCommon(array('db' => $db)); - -$err_url = PMA\libraries\Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' -) - . PMA_URL_getCommon($url_params); - - -/** - * Ensures the database and the table exist (else move to the "parent" script) - * Skip test if we are exporting as we can't tell whether a table name is an alias (which would fail the test). - */ -if (basename($_SERVER['PHP_SELF']) != 'tbl_export.php') { - require_once './libraries/db_table_exists.lib.php'; -} diff --git a/#pma/libraries/tbl_info.inc.php b/#pma/libraries/tbl_info.inc.php deleted file mode 100644 index dc8a325b..00000000 --- a/#pma/libraries/tbl_info.inc.php +++ /dev/null @@ -1,109 +0,0 @@ -selectDb($GLOBALS['db']); - - -/** - * Holds information about the current table - * - * Table::getStatusInfo() does caching by default, but here - * we force reading of the current table status - * if $reread_info is true (for example, coming from tbl_operations.php - * and we just changed the table's storage engine) - * - * @todo replace this by Table - * @global array $GLOBALS['showtable'] - * @name $showtable - */ -$GLOBALS['showtable'] = $GLOBALS['dbi']->getTable( - $GLOBALS['db'], - $GLOBALS['table'] -)->getStatusInfo( - null, - (isset($reread_info) && $reread_info ? true : false) -); - -// need this test because when we are creating a table, we get 0 rows -// from the SHOW TABLE query -// and we don't want to mess up the $tbl_storage_engine coming from the form - -if ($showtable) { - if ($GLOBALS['dbi']->getTable($GLOBALS['db'], $GLOBALS['table'])->isView()) { - $tbl_is_view = true; - $tbl_storage_engine = __('View'); - $show_comment = null; - } else { - $tbl_is_view = false; - $tbl_storage_engine = isset($showtable['Engine']) - ? mb_strtoupper($showtable['Engine']) - : ''; - $show_comment = ''; - if (isset($showtable['Comment'])) { - $show_comment = $showtable['Comment']; - } - } - $tbl_collation = empty($showtable['Collation']) - ? '' - : $showtable['Collation']; - - if (null === $showtable['Rows']) { - $showtable['Rows'] = $GLOBALS['dbi'] - ->getTable($GLOBALS['db'], $showtable['Name']) - ->countRecords(true); - } - $table_info_num_rows = isset($showtable['Rows']) ? $showtable['Rows'] : 0; - $row_format = isset($showtable['Row_format']) ? $showtable['Row_format'] : ''; - $auto_increment = isset($showtable['Auto_increment']) - ? $showtable['Auto_increment'] - : ''; - - $create_options_tmp = isset($showtable['Create_options']) - ? explode(' ', $showtable['Create_options']) - : array(); - $create_options = array(); - - // export create options by its name as variables into global namespace - // f.e. pack_keys=1 becomes available as $pack_keys with value of '1' - unset($pack_keys); - foreach ($create_options_tmp as $each_create_option) { - $each_create_option = explode('=', $each_create_option); - if (isset($each_create_option[1])) { - // ensure there is no ambiguity for PHP 5 and 7 - $create_options[$each_create_option[0]] = $each_create_option[1]; - } - } - // we need explicit DEFAULT value here (different from '0') - $create_options['pack_keys'] = (! isset($create_options['pack_keys']) || strlen($create_options['pack_keys']) == 0) - ? 'DEFAULT' - : $create_options['pack_keys']; - unset($create_options_tmp, $each_create_option); -} else { - $pack_keys = $row_format = null; -}// end if diff --git a/#pma/libraries/tbl_partition_definition.inc.php b/#pma/libraries/tbl_partition_definition.inc.php deleted file mode 100644 index fb2f490f..00000000 --- a/#pma/libraries/tbl_partition_definition.inc.php +++ /dev/null @@ -1,146 +0,0 @@ - 1 - && isset($_REQUEST['partition_by']) - && ($_REQUEST['partition_by'] == 'RANGE' - || $_REQUEST['partition_by'] == 'RANGE COLUMNS' - || $_REQUEST['partition_by'] == 'LIST' - || $_REQUEST['partition_by'] == 'LIST COLUMNS'); - - // Values are specified only for LIST and RANGE type partitions - $partitionDetails['value_enabled'] = isset($_REQUEST['partition_by']) - && ($_REQUEST['partition_by'] == 'RANGE' - || $_REQUEST['partition_by'] == 'RANGE COLUMNS' - || $_REQUEST['partition_by'] == 'LIST' - || $_REQUEST['partition_by'] == 'LIST COLUMNS'); - - // Has partitions - if ($partition_count > 1) { - $partitions = isset($_REQUEST['partitions']) - ? $_REQUEST['partitions'] - : array(); - - // Remove details of the additional partitions - // when number of partitions have been reduced - array_splice($partitions, $partition_count); - - for ($i = 0; $i < $partition_count; $i++) { - if (! isset($partitions[$i])) { // Newly added partition - $partitions[$i] = array( - 'name' => 'p' . $i, - 'value_type' => '', - 'value' => '', - 'engine' => '', - 'comment' => '', - 'data_directory' => '', - 'index_directory' => '', - 'max_rows' => '', - 'min_rows' => '', - 'tablespace' => '', - 'node_group' => '', - ); - } - - $partition =& $partitions[$i]; - $partition['prefix'] = 'partitions[' . $i . ']'; - - // Changing from HASH/KEY to RANGE/LIST - if (! isset($partition['value_type'])) { - $partition['value_type'] = ''; - $partition['value'] = ''; - } - if (! isset($partition['engine'])) { // When removing subpartitioning - $partition['engine'] = ''; - $partition['comment'] = ''; - $partition['data_directory'] = ''; - $partition['index_directory'] = ''; - $partition['max_rows'] = ''; - $partition['min_rows'] = ''; - $partition['tablespace'] = ''; - $partition['node_group'] = ''; - } - - if ($subpartition_count > 1 - && $partitionDetails['can_have_subpartitions'] == true - ) { // Has subpartitions - $partition['subpartition_count'] = $subpartition_count; - - if (! isset($partition['subpartitions'])) { - $partition['subpartitions'] = array(); - } - $subpartitions =& $partition['subpartitions']; - - // Remove details of the additional subpartitions - // when number of subpartitions have been reduced - array_splice($subpartitions, $subpartition_count); - - for ($j = 0; $j < $subpartition_count; $j++) { - if (! isset($subpartitions[$j])) { // Newly added subpartition - $subpartitions[$j] = array( - 'name' => $partition['name'] . '_s' . $j, - 'engine' => '', - 'comment' => '', - 'data_directory' => '', - 'index_directory' => '', - 'max_rows' => '', - 'min_rows' => '', - 'tablespace' => '', - 'node_group' => '', - ); - } - - $subpartition =& $subpartitions[$j]; - $subpartition['prefix'] = 'partitions[' . $i . ']' - . '[subpartitions][' . $j . ']'; - } - } else { // No subpartitions - unset($partition['subpartitions']); - unset($partition['subpartition_count']); - } - } - $partitionDetails['partitions'] = $partitions; - } -} - -echo Template::get('columns_definitions/partitions') - ->render(array('partitionDetails' => $partitionDetails)); diff --git a/#pma/libraries/tcpdf/LICENSE.TXT b/#pma/libraries/tcpdf/LICENSE.TXT deleted file mode 100644 index daf21f7d..00000000 --- a/#pma/libraries/tcpdf/LICENSE.TXT +++ /dev/null @@ -1,858 +0,0 @@ -********************************************************************** -* TCPDF LICENSE -********************************************************************** - - TCPDF is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - -********************************************************************** -********************************************************************** - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. - -********************************************************************** -********************************************************************** - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. - -********************************************************************** -********************************************************************** diff --git a/#pma/libraries/tcpdf/README.TXT b/#pma/libraries/tcpdf/README.TXT deleted file mode 100644 index 2061fa7a..00000000 --- a/#pma/libraries/tcpdf/README.TXT +++ /dev/null @@ -1,117 +0,0 @@ -TCPDF - README -============================================================ - -I WISH TO IMPROVE AND EXPAND TCPDF BUT I NEED YOUR SUPPORT. -PLEASE MAKE A DONATION: -http://sourceforge.net/donate/index.php?group_id=128076 -or via PayPal at paypal@tecnick.com - ------------------------------------------------------------- - -Name: TCPDF -Version: 6.2.12 -Release date: 2015-09-12 -Author: Nicola Asuni - -Copyright (c) 2002-2015: - Nicola Asuni - Tecnick.com LTD - www.tecnick.com - -URLs: - http://www.tcpdf.org - http://www.sourceforge.net/projects/tcpdf - https://github.com/tecnickcom/TCPDF - -Description: - TCPDF is a PHP class for generating PDF files on-the-fly without requiring external extensions. - This library includes also a class to extract data from existing PDF documents and - classes to generate 1D and 2D barcodes in various formats. - -Main Features: - * no external libraries are required for the basic functions; - * all standard page formats, custom page formats, custom margins and units of measure; - * UTF-8 Unicode and Right-To-Left languages; - * TrueTypeUnicode, OpenTypeUnicode v1, TrueType, OpenType v1, Type1 and CID-0 fonts; - * font subsetting; - * methods to publish some XHTML + CSS code, Javascript and Forms; - * images, graphic (geometric figures) and transformation methods; - * supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/script/formats.php) - * 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extension, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417; - * JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies; - * automatic page header and footer management; - * document encryption up to 256 bit and digital signature certifications; - * transactions to UNDO commands; - * PDF annotations, including links, text and file attachments; - * text rendering modes (fill, stroke and clipping); - * multiple columns mode; - * no-write page regions; - * bookmarks, named destinations and table of content; - * text hyphenation; - * text stretching and spacing (tracking); - * automatic page break, line break and text alignments including justification; - * automatic page numbering and page groups; - * move and delete pages; - * page compression (requires php-zlib extension); - * XOBject Templates; - * Layers and object visibility. - * PDF/A-1b support. - -Installation (full instructions on http: www.tcpdf.org): - 1. copy the folder on your Web server - 2. set your installation path and other parameters on the config/tcpdf_config.php - 3. call the examples/example_001.php page with your browser to see an example - -Source Code Documentation: - http://www.tcpdf.org - -Additional Documentation: - http://www.tcpdf.org - -License: - Copyright (C) 2002-2014 Nicola Asuni - Tecnick.com LTD - - TCPDF is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - TCPDF is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the License - along with TCPDF. If not, see - . - - See LICENSE.TXT file for more information. - -Third party fonts: - - This library may include third party font files released with different licenses. - - All the PHP files on the fonts directory are subject to the general TCPDF license (GNU-LGPLv3), - they do not contain any binary data but just a description of the general properties of a particular font. - These files can be also generated on the fly using the font utilities and TCPDF methods. - - All the original binary TTF font files have been renamed for compatibility with TCPDF and compressed using the gzcompress PHP function that uses the ZLIB data format (.z files). - - The binary files (.z) that begins with the prefix "free" have been extracted from the GNU FreeFont collection (GNU-GPLv3). - The binary files (.z) that begins with the prefix "pdfa" have been derived from the GNU FreeFont, so they are subject to the same license. - For the details of Copyright, License and other information, please check the files inside the directory fonts/freefont-20120503 - Link : http://www.gnu.org/software/freefont/ - - The binary files (.z) that begins with the prefix "dejavu" have been extracted from the DejaVu fonts 2.33 (Bitstream) collection. - For the details of Copyright, License and other information, please check the files inside the directory fonts/dejavu-fonts-ttf-2.33 - Link : http://dejavu-fonts.org - - The binary files (.z) that begins with the prefix "ae" have been extracted from the Arabeyes.org collection (GNU-GPLv2). - Link : http://projects.arabeyes.org/ - -ICC profile: - TCPDF includes the sRGB.icc profile from the icc-profiles-free Debian package: - https://packages.debian.org/source/stable/icc-profiles-free - - -============================================================ diff --git a/#pma/libraries/tcpdf/config/tcpdf_config.php b/#pma/libraries/tcpdf/config/tcpdf_config.php deleted file mode 100644 index 92317b12..00000000 --- a/#pma/libraries/tcpdf/config/tcpdf_config.php +++ /dev/null @@ -1,227 +0,0 @@ -. -// -// See LICENSE.TXT file for more information. -//============================================================+ - -/** - * Configuration file for TCPDF. - * @author Nicola Asuni - * @package com.tecnick.tcpdf - * @version 4.9.005 - * @since 2004-10-27 - */ - -// IMPORTANT: -// If you define the constant K_TCPDF_EXTERNAL_CONFIG, all the following settings will be ignored. -// If you use the tcpdf_autoconfig.php, then you can overwrite some values here. - - -/** - * Installation path (/var/www/tcpdf/). - * By default it is automatically calculated but you can also set it as a fixed string to improve performances. - */ -//define ('K_PATH_MAIN', ''); - -/** - * URL path to tcpdf installation folder (http://localhost/tcpdf/). - * By default it is automatically set but you can also set it as a fixed string to improve performances. - */ -//define ('K_PATH_URL', ''); - -/** - * Path for PDF fonts. - * By default it is automatically set but you can also set it as a fixed string to improve performances. - */ -//define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/'); - -/** - * Default images directory. - * By default it is automatically set but you can also set it as a fixed string to improve performances. - */ -//define ('K_PATH_IMAGES', ''); - -/** - * Deafult image logo used be the default Header() method. - * Please set here your own logo or an empty string to disable it. - */ -//define ('PDF_HEADER_LOGO', ''); - -/** - * Header logo image width in user units. - */ -//define ('PDF_HEADER_LOGO_WIDTH', 0); - -/** - * Cache directory for temporary files (full path). - */ -//define ('K_PATH_CACHE', '/tmp/'); - -/** - * Generic name for a blank image. - */ -define ('K_BLANK_IMAGE', '_blank.png'); - -/** - * Page format. - */ -define ('PDF_PAGE_FORMAT', 'A4'); - -/** - * Page orientation (P=portrait, L=landscape). - */ -define ('PDF_PAGE_ORIENTATION', 'P'); - -/** - * Document creator. - */ -define ('PDF_CREATOR', 'TCPDF'); - -/** - * Document author. - */ -define ('PDF_AUTHOR', 'TCPDF'); - -/** - * Header title. - */ -define ('PDF_HEADER_TITLE', 'TCPDF Example'); - -/** - * Header description string. - */ -define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); - -/** - * Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]. - */ -define ('PDF_UNIT', 'mm'); - -/** - * Header margin. - */ -define ('PDF_MARGIN_HEADER', 5); - -/** - * Footer margin. - */ -define ('PDF_MARGIN_FOOTER', 10); - -/** - * Top margin. - */ -define ('PDF_MARGIN_TOP', 27); - -/** - * Bottom margin. - */ -define ('PDF_MARGIN_BOTTOM', 25); - -/** - * Left margin. - */ -define ('PDF_MARGIN_LEFT', 15); - -/** - * Right margin. - */ -define ('PDF_MARGIN_RIGHT', 15); - -/** - * Default main font name. - */ -define ('PDF_FONT_NAME_MAIN', 'helvetica'); - -/** - * Default main font size. - */ -define ('PDF_FONT_SIZE_MAIN', 10); - -/** - * Default data font name. - */ -define ('PDF_FONT_NAME_DATA', 'helvetica'); - -/** - * Default data font size. - */ -define ('PDF_FONT_SIZE_DATA', 8); - -/** - * Default monospaced font name. - */ -define ('PDF_FONT_MONOSPACED', 'courier'); - -/** - * Ratio used to adjust the conversion of pixels to user units. - */ -define ('PDF_IMAGE_SCALE_RATIO', 1.25); - -/** - * Magnification factor for titles. - */ -define('HEAD_MAGNIFICATION', 1.1); - -/** - * Height of cell respect font height. - */ -define('K_CELL_HEIGHT_RATIO', 1.25); - -/** - * Title magnification respect main font size. - */ -define('K_TITLE_MAGNIFICATION', 1.3); - -/** - * Reduction factor for small font. - */ -define('K_SMALL_RATIO', 2/3); - -/** - * Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language. - */ -define('K_THAI_TOPCHARS', true); - -/** - * If true allows to call TCPDF methods using HTML syntax - * IMPORTANT: For security reason, disable this feature if you are printing user HTML content. - */ -define('K_TCPDF_CALLS_IN_HTML', false); - -/** - * If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution. - */ -define('K_TCPDF_THROW_EXCEPTION_ERROR', false); - -/** - * Default timezone for datetime functions - */ -define('K_TIMEZONE', 'UTC'); - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/#pma/libraries/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE b/#pma/libraries/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE deleted file mode 100644 index 254e2cc4..00000000 --- a/#pma/libraries/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE +++ /dev/null @@ -1,99 +0,0 @@ -Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. -Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) - -Bitstream Vera Fonts Copyright ------------------------------- - -Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is -a trademark of Bitstream, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of the fonts accompanying this license ("Fonts") and associated -documentation files (the "Font Software"), to reproduce and distribute the -Font Software, including without limitation the rights to use, copy, merge, -publish, distribute, and/or sell copies of the Font Software, and to permit -persons to whom the Font Software is furnished to do so, subject to the -following conditions: - -The above copyright and trademark notices and this permission notice shall -be included in all copies of one or more of the Font Software typefaces. - -The Font Software may be modified, altered, or added to, and in particular -the designs of glyphs or characters in the Fonts may be modified and -additional glyphs or characters may be added to the Fonts, only if the fonts -are renamed to names not containing either the words "Bitstream" or the word -"Vera". - -This License becomes null and void to the extent applicable to Fonts or Font -Software that has been modified and is distributed under the "Bitstream -Vera" names. - -The Font Software may be sold as part of a larger software package but no -copy of one or more of the Font Software typefaces may be sold by itself. - -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, -TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME -FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING -ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE -FONT SOFTWARE. - -Except as contained in this notice, the names of Gnome, the Gnome -Foundation, and Bitstream Inc., shall not be used in advertising or -otherwise to promote the sale, use or other dealings in this Font Software -without prior written authorization from the Gnome Foundation or Bitstream -Inc., respectively. For further information, contact: fonts at gnome dot -org. - -Arev Fonts Copyright ------------------------------- - -Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the fonts accompanying this license ("Fonts") and -associated documentation files (the "Font Software"), to reproduce -and distribute the modifications to the Bitstream Vera Font Software, -including without limitation the rights to use, copy, merge, publish, -distribute, and/or sell copies of the Font Software, and to permit -persons to whom the Font Software is furnished to do so, subject to -the following conditions: - -The above copyright and trademark notices and this permission notice -shall be included in all copies of one or more of the Font Software -typefaces. - -The Font Software may be modified, altered, or added to, and in -particular the designs of glyphs or characters in the Fonts may be -modified and additional glyphs or characters may be added to the -Fonts, only if the fonts are renamed to names not containing either -the words "Tavmjong Bah" or the word "Arev". - -This License becomes null and void to the extent applicable to Fonts -or Font Software that has been modified and is distributed under the -"Tavmjong Bah Arev" names. - -The Font Software may be sold as part of a larger software package but -no copy of one or more of the Font Software typefaces may be sold by -itself. - -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL -TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - -Except as contained in this notice, the name of Tavmjong Bah shall not -be used in advertising or otherwise to promote the sale, use or other -dealings in this Font Software without prior written authorization -from Tavmjong Bah. For further information, contact: tavmjong @ free -. fr. - -$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ diff --git a/#pma/libraries/tcpdf/fonts/dejavusans.ctg.z b/#pma/libraries/tcpdf/fonts/dejavusans.ctg.z deleted file mode 100644 index df25b649..00000000 Binary files a/#pma/libraries/tcpdf/fonts/dejavusans.ctg.z and /dev/null differ diff --git a/#pma/libraries/tcpdf/fonts/dejavusans.php b/#pma/libraries/tcpdf/fonts/dejavusans.php deleted file mode 100644 index 72147bee..00000000 --- a/#pma/libraries/tcpdf/fonts/dejavusans.php +++ /dev/null @@ -1,16 +0,0 @@ -32,'FontBBox'=>'[-1021 -415 1681 1167]','ItalicAngle'=>0,'Ascent'=>928,'Descent'=>-236,'Leading'=>0,'CapHeight'=>729,'XHeight'=>547,'StemV'=>34,'StemH'=>15,'AvgWidth'=>507,'MaxWidth'=>1735,'MissingWidth'=>600); -$cbbox=array(0=>array(50,-177,550,705),33=>array(151,0,250,729),34=>array(96,458,364,729),35=>array(77,0,761,718),36=>array(83,-147,553,760),37=>array(55,-14,895,742),38=>array(63,-14,749,742),39=>array(96,458,179,729),40=>array(86,-132,310,759),41=>array(80,-132,304,759),42=>array(30,286,470,742),43=>array(106,0,732,627),44=>array(77,-116,220,124),45=>array(49,234,312,314),46=>array(107,0,210,124),47=>array(0,-93,337,729),48=>array(66,-14,570,742),49=>array(110,0,544,729),50=>array(73,0,536,742),51=>array(76,-14,556,742),52=>array(49,0,580,729),53=>array(77,-14,549,729),54=>array(70,-14,573,742),55=>array(82,0,551,729),56=>array(68,-14,568,742),57=>array(63,-14,566,742),58=>array(117,0,220,517),59=>array(77,-116,220,517),60=>array(106,46,732,581),61=>array(106,172,732,454),62=>array(106,46,732,581),63=>array(72,0,461,742),64=>array(66,-174,930,704),65=>array(8,0,676,729),66=>array(98,0,615,729),67=>array(56,-14,644,742),68=>array(98,0,711,729),69=>array(98,0,568,729),70=>array(98,0,517,729),71=>array(56,-14,693,742),72=>array(98,0,654,729),73=>array(98,0,197,729),74=>array(-52,-200,197,729),75=>array(98,0,677,729),76=>array(98,0,552,729),77=>array(98,0,765,729),78=>array(98,0,650,729),79=>array(56,-14,731,742),80=>array(98,0,569,729),81=>array(56,-129,731,742),82=>array(98,0,666,729),83=>array(66,-14,579,742),84=>array(-3,0,614,729),85=>array(87,-14,645,729),86=>array(8,0,676,729),87=>array(33,0,956,729),88=>array(30,0,654,729),89=>array(-2,0,613,729),90=>array(45,0,640,729),91=>array(86,-132,293,760),92=>array(0,-93,337,729),93=>array(97,-132,304,760),94=>array(106,457,732,729),95=>array(-10,-236,510,-166),96=>array(83,617,317,800),97=>array(60,-14,522,560),98=>array(91,-14,580,760),99=>array(55,-14,488,560),100=>array(55,-14,544,760),101=>array(55,-14,562,560),102=>array(23,0,371,760),103=>array(55,-208,544,560),104=>array(91,0,549,760),105=>array(94,0,184,760),106=>array(-18,-208,184,760),107=>array(91,0,576,760),108=>array(94,0,184,760),109=>array(91,0,889,560),110=>array(91,0,549,560),111=>array(55,-14,557,560),112=>array(91,-208,580,560),113=>array(55,-208,544,560),114=>array(91,0,411,560),115=>array(54,-14,472,560),116=>array(27,0,368,702),117=>array(85,-14,543,560),118=>array(30,0,562,547),119=>array(42,0,776,547),120=>array(29,0,559,547),121=>array(30,-208,562,547),122=>array(43,0,482,547),123=>array(125,-163,511,760),124=>array(127,-236,210,764),125=>array(125,-163,511,760),126=>array(106,228,732,399),161=>array(151,0,250,729),162=>array(84,-153,517,699),163=>array(63,0,548,742),164=>array(46,40,592,587),165=>array(40,0,595,729),166=>array(127,-171,210,699),167=>array(45,-95,454,742),168=>array(105,659,395,758),169=>array(138,0,862,725),170=>array(56,229,404,742),171=>array(77,69,518,517),172=>array(106,140,732,421),173=>array(49,234,312,314),174=>array(138,0,862,725),175=>array(104,673,396,745),176=>array(95,432,405,742),177=>array(106,0,732,627),178=>array(46,326,338,742),179=>array(48,319,350,742),180=>array(181,616,415,800),181=>array(85,-208,612,547),182=>array(77,-96,528,729),183=>array(107,285,210,409),184=>array(142,-193,344,0),185=>array(67,326,346,734),186=>array(47,229,424,742),187=>array(94,69,535,517),188=>array(67,-14,937,742),189=>array(67,-14,906,742),190=>array(48,-14,937,742),191=>array(70,-14,459,729),192=>array(8,0,676,927),193=>array(8,0,676,927),194=>array(8,0,676,928),195=>array(8,0,676,921),196=>array(8,0,676,913),197=>array(8,0,676,928),198=>array(4,0,910,729),199=>array(56,-193,644,742),200=>array(98,0,568,927),201=>array(98,0,568,927),202=>array(98,0,568,928),203=>array(98,0,568,913),204=>array(29,0,216,927),205=>array(79,0,265,927),206=>array(-1,0,297,928),207=>array(3,0,293,913),208=>array(5,0,716,729),209=>array(98,0,650,921),210=>array(56,-14,731,927),211=>array(56,-14,731,927),212=>array(56,-14,731,928),213=>array(56,-14,731,921),214=>array(56,-14,731,913),215=>array(137,31,701,596),216=>array(50,-34,737,761),217=>array(87,-14,645,927),218=>array(87,-14,645,927),219=>array(87,-14,645,928),220=>array(87,-14,645,913),221=>array(-2,0,613,927),222=>array(98,0,569,729),223=>array(91,-14,584,760),224=>array(60,-14,522,800),225=>array(60,-14,522,800),226=>array(60,-14,522,800),227=>array(60,-14,522,777),228=>array(60,-14,522,758),229=>array(60,-14,522,878),230=>array(60,-14,929,560),231=>array(55,-193,488,560),232=>array(55,-14,562,800),233=>array(55,-14,562,800),234=>array(55,-14,562,800),235=>array(55,-14,562,758),236=>array(-28,0,206,800),237=>array(70,0,304,800),238=>array(-17,0,295,800),239=>array(-6,0,284,758),240=>array(55,-14,557,760),241=>array(91,0,549,777),242=>array(55,-14,557,800),243=>array(55,-14,557,800),244=>array(55,-14,557,800),245=>array(55,-14,557,777),246=>array(55,-14,557,758),247=>array(106,73,732,554),248=>array(35,-46,576,592),249=>array(85,-14,543,800),250=>array(85,-14,543,800),251=>array(85,-14,543,800),252=>array(85,-14,543,758),253=>array(30,-208,562,800),254=>array(91,-208,580,760),255=>array(30,-208,562,758),256=>array(8,0,676,899),257=>array(60,-14,522,745),258=>array(8,0,676,946),259=>array(60,-14,522,765),260=>array(8,-193,706,729),261=>array(60,-193,563,560),262=>array(56,-14,644,927),263=>array(55,-14,488,800),264=>array(56,-14,644,928),265=>array(55,-14,488,800),266=>array(56,-14,644,914),267=>array(55,-14,488,760),268=>array(56,-14,644,928),269=>array(55,-14,488,800),270=>array(98,0,711,928),271=>array(55,-14,732,760),272=>array(5,0,716,729),273=>array(55,-14,619,760),274=>array(98,0,568,900),275=>array(55,-14,562,745),276=>array(98,0,568,928),277=>array(55,-14,562,785),278=>array(98,0,568,914),279=>array(55,-14,562,760),280=>array(98,-193,569,729),281=>array(55,-193,562,560),282=>array(98,0,568,925),283=>array(55,-14,562,797),284=>array(56,-14,693,928),285=>array(55,-208,544,800),286=>array(56,-14,693,928),287=>array(55,-208,544,785),288=>array(56,-14,693,914),289=>array(55,-208,544,760),290=>array(56,-250,693,742),291=>array(55,-208,544,775),292=>array(98,0,654,928),293=>array(-13,0,549,928),294=>array(98,0,818,729),295=>array(59,0,578,760),296=>array(-14,0,309,921),297=>array(-22,0,300,777),298=>array(1,0,293,899),299=>array(-7,0,285,745),300=>array(-5,0,300,928),301=>array(-14,0,292,785),302=>array(86,-193,268,729),303=>array(73,-193,255,760),304=>array(98,0,198,914),305=>array(94,0,184,560),306=>array(98,-200,492,729),307=>array(94,-208,461,760),308=>array(-52,-200,296,928),309=>array(-18,-208,295,800),310=>array(98,-235,677,729),311=>array(91,-235,576,760),312=>array(91,0,576,547),313=>array(98,0,552,928),314=>array(94,0,286,928),315=>array(98,-235,552,729),316=>array(66,-235,209,760),317=>array(98,0,552,729),318=>array(94,0,375,760),319=>array(98,0,552,729),320=>array(94,0,314,760),321=>array(-7,0,557,729),322=>array(1,0,285,760),323=>array(98,0,650,928),324=>array(91,0,549,803),325=>array(98,-235,650,729),326=>array(91,-235,549,560),327=>array(98,0,650,921),328=>array(91,0,549,800),329=>array(100,0,715,729),330=>array(98,-208,637,742),331=>array(91,-208,549,560),332=>array(56,-14,731,899),333=>array(55,-14,557,745),334=>array(56,-14,731,928),335=>array(55,-14,557,785),336=>array(56,-14,731,927),337=>array(55,-14,557,800),338=>array(56,0,1006,729),339=>array(55,-14,970,560),340=>array(98,0,666,928),341=>array(91,0,447,803),342=>array(98,-235,666,729),343=>array(63,-235,411,560),344=>array(98,0,666,921),345=>array(91,0,419,800),346=>array(66,-14,579,928),347=>array(54,-14,472,803),348=>array(66,-14,579,928),349=>array(54,-14,472,800),350=>array(66,-193,579,742),351=>array(54,-193,472,560),352=>array(66,-14,579,928),353=>array(54,-14,472,800),354=>array(-3,-193,614,729),355=>array(27,-193,368,702),356=>array(-3,0,614,921),357=>array(27,0,374,813),358=>array(-3,0,614,729),359=>array(27,0,368,702),360=>array(87,-14,645,921),361=>array(85,-14,543,777),362=>array(87,-14,645,899),363=>array(85,-14,543,745),364=>array(87,-14,645,928),365=>array(85,-14,543,785),366=>array(87,-14,645,929),367=>array(85,-14,543,849),368=>array(87,-14,645,927),369=>array(85,-14,546,800),370=>array(87,-193,645,729),371=>array(85,-193,613,560),372=>array(33,0,956,932),373=>array(42,0,776,803),374=>array(-2,0,613,932),375=>array(30,-208,562,803),376=>array(-2,0,613,913),377=>array(45,0,640,928),378=>array(43,0,482,803),379=>array(45,0,640,914),380=>array(43,0,482,760),381=>array(45,0,640,928),382=>array(43,0,482,800),383=>array(23,0,371,760),384=>array(16,-14,580,760),385=>array(-51,0,664,729),386=>array(98,0,615,729),387=>array(91,-14,580,760),388=>array(0,0,615,729),389=>array(0,-14,580,760),390=>array(56,-14,644,742),391=>array(56,-14,794,924),392=>array(55,-14,600,760),393=>array(5,0,716,729),394=>array(-51,0,760,729),395=>array(98,0,615,729),396=>array(55,-14,544,760),397=>array(55,-208,557,548),398=>array(64,0,534,729),399=>array(57,-14,731,742),400=>array(80,-14,560,742),401=>array(-52,-200,517,729),402=>array(-63,-208,371,760),403=>array(56,-14,824,924),404=>array(4,-210,683,729),405=>array(91,0,910,760),406=>array(98,0,347,729),407=>array(5,0,290,729),408=>array(98,0,746,742),409=>array(90,0,576,760),410=>array(5,0,271,760),411=>array(30,0,562,760),412=>array(87,-14,894,729),413=>array(-52,-200,650,729),414=>array(91,-208,549,560),415=>array(56,-14,731,742),416=>array(50,-14,764,760),417=>array(58,-14,603,615),418=>array(56,-14,851,742),419=>array(55,-208,668,560),420=>array(-51,0,618,729),421=>array(90,-208,580,760),422=>array(98,-129,666,729),423=>array(56,-14,569,742),424=>array(49,-14,467,560),425=>array(98,0,568,729),426=>array(-132,-208,355,760),427=>array(27,-208,368,702),428=>array(12,0,614,729),429=>array(27,0,368,760),430=>array(-3,-200,614,729),431=>array(84,-4,796,760),432=>array(86,-14,676,615),433=>array(38,-14,726,724),434=>array(98,-15,683,729),435=>array(-2,0,742,742),436=>array(30,-208,730,560),437=>array(45,0,640,729),438=>array(43,0,482,547),439=>array(78,-31,621,729),440=>array(45,-31,588,729),441=>array(51,-213,531,547),442=>array(55,-208,488,547),443=>array(73,0,536,742),444=>array(45,-31,622,729),445=>array(51,-213,531,547),446=>array(43,-14,456,702),447=>array(91,-208,580,560),448=>array(98,-208,197,729),449=>array(98,-208,394,729),450=>array(10,-208,451,729),451=>array(98,0,197,729),452=>array(98,0,1352,928),453=>array(98,0,1211,800),454=>array(55,-14,1071,800),455=>array(98,-200,768,729),456=>array(98,-208,733,760),457=>array(94,-208,367,760),458=>array(98,-200,868,729),459=>array(98,-208,839,760),460=>array(91,-208,733,760),461=>array(8,0,676,928),462=>array(60,-14,522,800),463=>array(-1,0,297,928),464=>array(-16,0,296,800),465=>array(56,-14,731,928),466=>array(55,-14,557,800),467=>array(87,-14,645,928),468=>array(85,-14,543,800),469=>array(87,-14,645,1025),470=>array(85,-14,543,899),471=>array(87,-14,645,1044),472=>array(85,-14,543,892),473=>array(87,-14,645,1044),474=>array(85,-14,543,892),475=>array(87,-14,645,1047),476=>array(85,-14,543,892),477=>array(55,-14,562,560),478=>array(8,0,676,1025),479=>array(60,-14,522,899),480=>array(8,0,676,1025),481=>array(60,-14,522,869),482=>array(4,0,910,900),483=>array(60,-14,929,743),484=>array(56,-14,752,742),485=>array(55,-208,622,560),486=>array(56,-14,693,928),487=>array(55,-208,544,798),488=>array(98,0,677,928),489=>array(-11,0,576,928),490=>array(56,-193,731,742),491=>array(55,-193,557,560),492=>array(56,-193,731,899),493=>array(55,-193,557,745),494=>array(78,-31,621,928),495=>array(43,-213,523,800),496=>array(-18,-208,299,800),497=>array(98,0,1352,729),498=>array(98,0,1211,729),499=>array(55,-14,1071,760),500=>array(56,-14,693,928),501=>array(55,-208,544,798),502=>array(98,-14,1022,729),503=>array(98,-208,626,742),504=>array(98,0,650,927),505=>array(91,0,549,799),506=>array(8,0,676,931),507=>array(60,-14,607,931),508=>array(4,0,910,928),509=>array(60,-14,929,798),510=>array(50,-34,737,928),511=>array(35,-46,576,798),512=>array(8,0,676,930),513=>array(60,-14,522,799),514=>array(8,0,676,901),515=>array(60,-14,522,785),516=>array(98,0,568,930),517=>array(55,-14,562,798),518=>array(98,0,568,901),519=>array(55,-14,562,785),520=>array(-43,0,306,930),521=>array(-30,0,313,798),522=>array(2,0,308,901),523=>array(-14,0,292,785),524=>array(56,-14,731,930),525=>array(55,-14,557,799),526=>array(56,-14,731,901),527=>array(55,-14,557,785),528=>array(97,0,666,930),529=>array(63,0,411,798),530=>array(98,0,666,901),531=>array(91,0,421,785),532=>array(87,-14,645,930),533=>array(85,-14,543,799),534=>array(87,-14,645,901),535=>array(85,-14,543,785),536=>array(66,-240,579,742),537=>array(54,-240,472,560),538=>array(-3,-240,614,729),539=>array(27,-240,368,702),540=>array(76,-210,556,742),541=>array(35,-211,467,560),542=>array(98,0,654,928),543=>array(-8,0,549,928),544=>array(98,-208,637,742),545=>array(55,-70,783,760),546=>array(55,-14,643,742),547=>array(55,-14,555,632),548=>array(45,-208,640,729),549=>array(43,-208,482,547),550=>array(8,0,676,914),551=>array(60,-14,522,760),552=>array(98,-193,568,729),553=>array(55,-193,562,560),554=>array(56,-14,731,1025),555=>array(55,-14,557,899),556=>array(56,-14,731,1025),557=>array(55,-14,557,864),558=>array(56,-14,731,914),559=>array(55,-14,557,760),560=>array(56,-14,731,1025),561=>array(55,-14,557,899),562=>array(-2,0,613,899),563=>array(30,-208,562,745),564=>array(67,-70,420,757),565=>array(91,-70,788,560),566=>array(27,-70,422,702),567=>array(-18,-208,184,547),568=>array(55,-14,943,760),569=>array(55,-208,943,560),570=>array(-1,-34,686,761),571=>array(6,-34,692,761),572=>array(4,-46,545,592),573=>array(5,0,552,729),574=>array(-38,-34,649,761),575=>array(54,-242,512,560),576=>array(43,-242,525,547),577=>array(39,0,569,729),578=>array(39,0,445,560),579=>array(5,0,615,729),580=>array(6,-14,726,729),581=>array(8,0,676,729),582=>array(98,-93,568,822),583=>array(55,-93,562,640),584=>array(-52,-200,290,729),585=>array(-18,-208,264,760),586=>array(56,-200,836,743),587=>array(55,-208,656,560),588=>array(5,0,666,729),589=>array(7,0,411,560),590=>array(-5,0,615,729),591=>array(5,-208,588,547),592=>array(85,-14,547,560),593=>array(55,-14,544,560),594=>array(91,-14,580,560),595=>array(91,-14,580,760),596=>array(62,-14,495,560),597=>array(55,-69,488,560),598=>array(55,-208,656,760),599=>array(55,-14,715,760),600=>array(55,-14,562,560),601=>array(55,-14,562,560),602=>array(61,-14,814,560),603=>array(65,-14,473,561),604=>array(65,-14,473,561),605=>array(65,-14,771,561),606=>array(55,-14,596,561),607=>array(-18,-208,264,547),608=>array(55,-208,715,760),609=>array(55,-208,544,547),610=>array(55,-14,539,560),611=>array(47,-210,549,547),612=>array(47,-14,549,547),613=>array(85,-208,543,547),614=>array(91,0,549,760),615=>array(91,-208,549,760),616=>array(7,0,265,760),617=>array(81,0,304,547),618=>array(57,0,314,547),619=>array(37,0,359,760),620=>array(38,0,416,760),621=>array(94,-208,296,760),622=>array(94,-213,651,760),623=>array(91,-13,889,548),624=>array(91,-208,889,548),625=>array(91,-208,889,560),626=>array(-18,-208,552,560),627=>array(91,-208,661,560),628=>array(87,0,549,547),629=>array(55,-14,557,560),630=>array(55,0,768,547),631=>array(72,-18,655,561),632=>array(55,-208,602,760),633=>array(0,-13,320,547),634=>array(0,-13,320,755),635=>array(0,-208,433,547),636=>array(91,-207,411,560),637=>array(91,-208,411,560),638=>array(64,0,437,560),639=>array(57,0,437,560),640=>array(91,0,574,547),641=>array(91,0,574,547),642=>array(54,-208,472,560),643=>array(-19,-208,355,760),644=>array(-19,-208,355,760),645=>array(27,-208,401,549),646=>array(-132,-208,355,760),647=>array(27,-156,368,546),648=>array(27,-208,370,702),649=>array(0,-14,634,547),650=>array(55,-15,564,547),651=>array(94,0,545,548),652=>array(30,0,562,547),653=>array(42,0,776,547),654=>array(30,0,562,760),655=>array(50,0,552,547),656=>array(43,-208,593,547),657=>array(43,-54,482,547),658=>array(43,-213,523,547),659=>array(53,-213,553,547),660=>array(43,0,456,759),661=>array(43,0,456,759),662=>array(43,0,456,759),663=>array(43,-213,456,760),664=>array(56,-14,731,742),665=>array(91,0,530,547),666=>array(55,-14,596,561),667=>array(55,-14,724,760),668=>array(91,0,563,547),669=>array(-132,-208,272,760),670=>array(91,-213,576,547),671=>array(91,0,493,547),672=>array(55,-208,746,759),673=>array(43,0,456,759),674=>array(43,0,456,759),675=>array(55,-14,970,760),676=>array(55,-213,1014,760),677=>array(55,-54,970,760),678=>array(27,0,781,702),679=>array(27,-208,629,760),680=>array(27,-70,723,702),681=>array(23,-208,804,760),682=>array(94,0,657,760),683=>array(94,0,610,760),684=>array(26,-15,489,640),685=>array(26,84,489,640),686=>array(0,-214,570,760),687=>array(0,-208,683,760),688=>array(57,326,346,751),689=>array(57,326,346,751),690=>array(-11,209,116,751),691=>array(57,326,259,640),692=>array(35,319,236,632),693=>array(35,209,307,632),694=>array(16,326,320,632),695=>array(26,326,489,632),696=>array(19,209,354,632),697=>array(78,557,203,800),698=>array(78,557,384,800),699=>array(85,489,228,729),700=>array(87,499,230,729),701=>array(96,616,239,856),702=>array(57,492,191,760),703=>array(57,492,191,760),704=>array(57,326,317,751),705=>array(57,326,317,751),706=>array(130,524,370,836),707=>array(130,524,370,836),708=>array(94,561,406,800),709=>array(94,561,406,800),710=>array(94,616,406,800),711=>array(94,616,406,800),712=>array(104,488,171,759),713=>array(104,673,396,745),714=>array(181,616,415,800),715=>array(83,617,317,800),716=>array(104,-148,171,123),717=>array(104,-156,396,-84),718=>array(83,-236,317,-54),719=>array(181,-236,415,-53),720=>array(54,0,229,517),721=>array(54,356,229,517),722=>array(57,249,191,517),723=>array(57,249,191,517),724=>array(140,229,360,448),725=>array(140,229,360,448),726=>array(49,125,341,417),727=>array(49,234,269,307),728=>array(97,645,403,785),729=>array(200,658,300,758),730=>array(116,610,384,878),731=>array(162,-193,344,0),732=>array(89,639,411,777),733=>array(117,616,460,800),734=>array(-0,233,334,504),735=>array(117,616,383,800),736=>array(57,208,374,632),737=>array(60,326,116,751),738=>array(57,326,320,648),739=>array(57,326,391,632),740=>array(57,326,317,751),741=>array(104,0,389,668),742=>array(104,0,389,668),743=>array(104,0,389,668),744=>array(104,0,389,668),745=>array(104,0,389,668),748=>array(94,-260,406,-21),749=>array(104,610,396,808),750=>array(85,489,428,729),755=>array(116,-240,384,28),759=>array(89,-192,411,-55),768=>array(-418,560,-184,800),769=>array(-320,560,-86,800),770=>array(-406,560,-94,800),771=>array(-412,639,-90,777),772=>array(-394,673,-102,745),773=>array(-510,686,10,755),774=>array(-407,645,-101,785),775=>array(-296,560,-206,760),776=>array(-395,560,-105,758),777=>array(-348,618,-129,810),778=>array(-385,610,-117,878),779=>array(-381,616,-38,800),780=>array(-404,560,-92,800),781=>array(-283,615,-217,832),782=>array(-383,615,-117,832),783=>array(-455,616,-112,800),784=>array(-407,645,-101,917),785=>array(-407,645,-101,785),786=>array(-235,489,-92,645),787=>array(-305,595,-187,844),788=>array(-305,595,-187,844),789=>array(-66,575,66,759),790=>array(-418,-266,-184,-83),791=>array(-320,-267,-86,-83),792=>array(-357,-240,-221,-24),793=>array(-279,-240,-143,-24),794=>array(-208,690,31,930),795=>array(-133,427,60,609),796=>array(-313,-241,-208,-32),797=>array(-370,-240,-130,-87),798=>array(-370,-240,-130,-87),799=>array(-357,-240,-143,-24),800=>array(-370,-184,-130,-117),801=>array(-315,-208,-23,63),802=>array(-317,-208,-25,63),803=>array(-296,-183,-206,-69),804=>array(-396,-183,-106,-84),805=>array(-355,-241,-146,-32),806=>array(-323,-240,-180,-84),807=>array(-358,-193,-156,0),808=>array(-338,-193,-156,0),809=>array(-283,-240,-217,-47),810=>array(-383,-211,-114,-50),811=>array(-452,-222,-51,-82),812=>array(-404,-240,-92,-57),813=>array(-407,-240,-95,-57),814=>array(-407,-222,-101,-82),815=>array(-407,-224,-101,-83),816=>array(-412,-222,-90,-84),817=>array(-394,-156,-102,-84),818=>array(-510,-236,10,-166),819=>array(-510,-236,10,-9),820=>array(-557,240,-41,381),821=>array(-316,221,-59,301),822=>array(-634,221,-0,301),823=>array(-574,-46,-33,592),824=>array(-741,-34,-54,761),825=>array(-291,-241,-187,-32),826=>array(-382,-206,-113,-44),827=>array(-359,-240,-139,-21),828=>array(-452,-222,-51,-82),829=>array(-354,619,-138,834),830=>array(-247,595,-109,853),831=>array(-510,528,10,755),832=>array(-418,617,-184,800),833=>array(-320,616,-86,800),834=>array(-412,639,-90,777),835=>array(-305,595,-187,844),836=>array(-387,659,-77,978),837=>array(-278,-208,-171,-45),838=>array(-396,639,-104,786),839=>array(-360,-226,-140,-35),840=>array(-365,-240,-135,-47),841=>array(-360,-240,-140,-21),842=>array(-411,616,-89,800),843=>array(-411,567,-89,850),844=>array(-411,596,-89,820),845=>array(-452,-230,-48,-30),846=>array(-350,-240,-150,-45),849=>array(-316,610,-184,878),850=>array(-407,547,-101,855),851=>array(-354,-240,-138,-24),855=>array(-316,610,-184,878),856=>array(-103,658,-3,758),858=>array(-430,-241,-71,-32),860=>array(-445,-237,445,-60),861=>array(-445,802,445,979),862=>array(-445,855,445,927),863=>array(-445,-156,445,-84),864=>array(-354,756,354,894),865=>array(-445,752,445,929),866=>array(-442,-230,447,-30),880=>array(98,0,555,729),881=>array(94,0,477,547),882=>array(98,0,764,729),883=>array(98,0,549,729),884=>array(78,557,203,800),885=>array(78,-208,203,35),886=>array(98,0,650,729),887=>array(91,0,559,547),890=>array(214,-208,321,-45),891=>array(62,-14,495,560),892=>array(55,-14,488,560),893=>array(62,-14,495,560),894=>array(77,-116,220,517),900=>array(181,616,415,800),901=>array(105,659,415,978),902=>array(8,0,676,800),903=>array(107,285,210,409),904=>array(-12,0,682,800),905=>array(-6,0,765,800),906=>array(-9,0,311,800),908=>array(-7,-14,750,800),910=>array(-15,0,821,800),911=>array(-18,0,752,800),912=>array(2,0,313,978),913=>array(8,0,676,729),914=>array(98,0,615,729),915=>array(98,0,552,729),916=>array(8,0,676,729),917=>array(98,0,568,729),918=>array(45,0,640,729),919=>array(98,0,654,729),920=>array(56,-14,731,742),921=>array(98,0,197,729),922=>array(98,0,677,729),923=>array(8,0,676,729),924=>array(98,0,765,729),925=>array(98,0,650,729),926=>array(98,0,548,729),927=>array(56,-14,731,742),928=>array(98,0,654,729),929=>array(98,0,569,729),931=>array(98,0,568,729),932=>array(-3,0,614,729),933=>array(-2,0,613,729),934=>array(56,0,731,729),935=>array(30,0,654,729),936=>array(56,0,732,729),937=>array(38,0,726,738),938=>array(3,0,293,913),939=>array(-2,0,613,913),940=>array(55,-12,611,800),941=>array(65,-14,473,800),942=>array(91,-208,549,800),943=>array(81,0,324,800),944=>array(73,-14,521,978),945=>array(55,-12,611,559),946=>array(94,-208,566,766),947=>array(16,-208,562,547),948=>array(55,-14,557,742),949=>array(65,-14,473,561),950=>array(52,-210,496,760),951=>array(91,-208,549,560),952=>array(55,-11,557,768),953=>array(81,0,304,547),954=>array(93,0,565,547),955=>array(30,0,562,760),956=>array(85,-208,612,547),957=>array(36,0,512,547),958=>array(52,-210,500,760),959=>array(55,-14,557,560),960=>array(36,-19,574,547),961=>array(91,-208,580,560),962=>array(55,-210,488,560),963=>array(55,-14,604,547),964=>array(49,0,553,547),965=>array(73,-14,521,547),966=>array(55,-208,602,551),967=>array(29,-208,549,547),968=>array(55,-208,602,547),969=>array(66,-14,769,547),970=>array(2,0,311,758),971=>array(73,-14,521,758),972=>array(55,-14,557,800),973=>array(73,-14,521,800),974=>array(66,-14,769,800),975=>array(98,-208,677,729),976=>array(82,-11,538,768),977=>array(55,-11,557,768),978=>array(42,0,665,734),979=>array(-15,0,829,800),980=>array(42,0,665,913),981=>array(55,-208,602,760),982=>array(32,-14,803,547),983=>array(55,-206,600,550),984=>array(56,-207,731,742),985=>array(55,-208,557,560),986=>array(68,-210,583,729),987=>array(55,-210,540,547),988=>array(98,0,517,729),989=>array(-94,-208,409,760),990=>array(87,-2,604,729),991=>array(93,0,566,759),992=>array(56,-208,797,742),993=>array(58,-180,573,559),994=>array(56,-213,877,729),995=>array(66,-208,769,547),996=>array(56,-208,660,742),997=>array(55,-208,568,560),998=>array(98,-213,735,729),999=>array(22,-14,571,575),1000=>array(39,-208,630,745),1001=>array(49,-208,552,560),1002=>array(56,0,714,742),1003=>array(26,0,599,560),1004=>array(56,-14,643,758),1005=>array(55,-14,544,758),1006=>array(21,-208,589,729),1007=>array(27,-208,510,726),1008=>array(55,-7,600,550),1009=>array(91,-208,580,560),1010=>array(55,-14,488,560),1011=>array(-18,-208,184,760),1012=>array(56,-14,731,742),1013=>array(55,-14,480,560),1014=>array(96,-14,521,560),1015=>array(98,0,569,729),1016=>array(91,-208,580,760),1017=>array(56,-14,644,742),1018=>array(98,0,765,729),1019=>array(62,-208,587,547),1020=>array(42,-208,580,560),1021=>array(56,-14,644,742),1022=>array(56,-14,644,742),1023=>array(56,-14,644,742),1024=>array(98,0,568,927),1025=>array(98,0,568,913),1026=>array(-3,-200,709,729),1027=>array(98,0,552,927),1028=>array(56,-14,644,742),1029=>array(66,-14,579,742),1030=>array(98,0,197,729),1031=>array(3,0,293,913),1032=>array(-52,-200,197,729),1033=>array(41,0,1023,729),1034=>array(98,0,975,729),1035=>array(-3,0,709,729),1036=>array(98,0,690,927),1037=>array(98,0,650,927),1038=>array(17,0,592,928),1039=>array(98,-157,654,729),1040=>array(8,0,676,729),1041=>array(98,0,615,729),1042=>array(98,0,615,729),1043=>array(98,0,552,729),1044=>array(49,-157,732,729),1045=>array(98,0,568,729),1046=>array(20,0,1058,729),1047=>array(66,-14,575,742),1048=>array(98,0,650,729),1049=>array(98,0,650,928),1050=>array(98,0,690,729),1051=>array(41,0,653,729),1052=>array(98,0,765,729),1053=>array(98,0,654,729),1054=>array(56,-14,731,742),1055=>array(98,0,654,729),1056=>array(98,0,569,729),1057=>array(56,-14,644,742),1058=>array(-3,0,614,729),1059=>array(17,0,592,729),1060=>array(59,0,802,729),1061=>array(30,0,654,729),1062=>array(98,-157,737,729),1063=>array(85,0,587,729),1064=>array(98,0,971,729),1065=>array(98,-157,1054,729),1066=>array(29,0,762,729),1067=>array(98,0,784,729),1068=>array(98,0,615,729),1069=>array(54,-14,642,742),1070=>array(103,-14,1023,742),1071=>array(66,0,597,729),1072=>array(60,-14,522,560),1073=>array(55,-14,562,777),1074=>array(91,0,530,547),1075=>array(91,0,477,547),1076=>array(52,-138,639,547),1077=>array(55,-14,562,560),1078=>array(34,0,867,547),1079=>array(65,-14,473,561),1080=>array(91,0,559,547),1081=>array(91,0,559,760),1082=>array(91,0,571,547),1083=>array(37,0,556,547),1084=>array(91,0,664,547),1085=>array(91,0,563,547),1086=>array(55,-14,557,560),1087=>array(91,0,563,547),1088=>array(91,-208,580,560),1089=>array(55,-14,488,560),1090=>array(29,0,553,547),1091=>array(30,-208,562,547),1092=>array(55,-208,800,729),1093=>array(29,0,559,547),1094=>array(91,-138,635,547),1095=>array(73,0,500,547),1096=>array(91,0,824,547),1097=>array(91,-138,896,547),1098=>array(30,0,647,547),1099=>array(91,0,701,560),1100=>array(91,0,530,547),1101=>array(55,-14,488,560),1102=>array(94,-14,787,560),1103=>array(57,0,517,547),1104=>array(55,-14,562,802),1105=>array(55,-14,562,758),1106=>array(23,-208,570,760),1107=>array(91,0,480,803),1108=>array(55,-14,488,560),1109=>array(54,-14,472,560),1110=>array(94,0,184,760),1111=>array(-6,0,284,758),1112=>array(-18,-208,184,760),1113=>array(37,0,843,547),1114=>array(91,0,839,547),1115=>array(23,0,567,760),1116=>array(91,0,571,803),1117=>array(91,0,559,802),1118=>array(30,-208,562,760),1119=>array(91,-138,563,547),1120=>array(56,-14,877,729),1121=>array(66,-14,769,547),1122=>array(15,0,711,729),1123=>array(15,0,613,760),1124=>array(103,-14,888,742),1125=>array(94,-14,688,560),1126=>array(8,0,871,729),1127=>array(25,0,758,547),1128=>array(98,0,1135,729),1129=>array(94,0,977,547),1130=>array(56,0,731,729),1131=>array(52,0,560,547),1132=>array(98,0,971,729),1133=>array(94,0,772,547),1134=>array(56,-208,556,935),1135=>array(44,-193,473,753),1136=>array(8,0,844,729),1137=>array(24,-208,852,765),1138=>array(56,-14,731,742),1139=>array(55,-14,557,560),1140=>array(8,0,769,742),1141=>array(24,0,640,560),1142=>array(8,0,769,930),1143=>array(24,0,640,800),1144=>array(56,-208,962,742),1145=>array(55,-208,875,560),1146=>array(56,-14,897,742),1147=>array(55,-14,704,560),1148=>array(58,-14,1122,932),1149=>array(74,-14,954,758),1150=>array(56,-14,877,900),1151=>array(66,-14,769,734),1152=>array(56,-208,644,742),1153=>array(55,-208,488,560),1154=>array(29,-44,474,457),1155=>array(-519,608,-93,810),1156=>array(-372,645,4,788),1157=>array(-288,595,-169,797),1158=>array(-288,595,-169,797),1159=>array(-776,606,4,788),1160=>array(-1021,-180,409,922),1161=>array(-957,-280,345,1022),1162=>array(98,-208,748,928),1163=>array(94,-208,652,760),1164=>array(16,0,615,729),1165=>array(19,0,534,702),1166=>array(98,0,610,729),1167=>array(91,-208,580,560),1168=>array(98,0,552,878),1169=>array(91,0,477,700),1170=>array(35,0,617,729),1171=>array(27,0,542,547),1172=>array(98,-200,600,729),1173=>array(91,-208,505,547),1174=>array(20,-157,1071,729),1175=>array(34,-138,876,547),1176=>array(66,-193,575,742),1177=>array(65,-193,473,561),1178=>array(98,-157,713,729),1179=>array(91,-138,587,547),1180=>array(98,0,690,729),1181=>array(91,0,571,547),1182=>array(16,0,690,729),1183=>array(30,0,571,760),1184=>array(24,0,837,729),1185=>array(21,0,688,547),1186=>array(98,-157,752,729),1187=>array(94,-138,656,547),1188=>array(98,0,1009,729),1189=>array(94,0,862,547),1190=>array(98,-200,1057,729),1191=>array(94,-208,891,547),1192=>array(56,-14,871,743),1193=>array(55,-14,684,560),1194=>array(56,-193,644,742),1195=>array(55,-193,488,560),1196=>array(-3,-157,614,729),1197=>array(29,-138,553,547),1198=>array(-2,0,613,729),1199=>array(30,-208,562,547),1200=>array(-2,0,613,729),1201=>array(30,-208,562,547),1202=>array(30,-157,654,729),1203=>array(29,-138,559,547),1204=>array(-3,-157,910,729),1205=>array(2,-138,782,547),1206=>array(85,-157,686,729),1207=>array(73,-138,590,547),1208=>array(85,0,587,729),1209=>array(73,0,500,547),1210=>array(85,0,587,729),1211=>array(91,0,549,760),1212=>array(10,-14,885,742),1213=>array(7,-14,675,560),1214=>array(10,-184,885,742),1215=>array(7,-161,675,560),1216=>array(98,0,197,729),1217=>array(20,0,1058,928),1218=>array(34,0,867,785),1219=>array(98,-200,651,729),1220=>array(93,-208,566,547),1221=>array(26,-208,751,729),1222=>array(22,-208,646,547),1223=>array(98,-200,654,729),1224=>array(94,-208,566,547),1225=>array(98,-208,752,729),1226=>array(94,-208,656,547),1227=>array(85,-157,587,729),1228=>array(73,-138,500,547),1229=>array(98,-208,863,729),1230=>array(94,-208,750,547),1231=>array(94,0,184,760),1232=>array(8,0,676,946),1233=>array(60,-14,522,765),1234=>array(8,0,676,913),1235=>array(60,-14,522,758),1236=>array(4,0,910,729),1237=>array(60,-14,929,560),1238=>array(98,0,568,928),1239=>array(55,-14,562,785),1240=>array(57,-14,731,742),1241=>array(55,-14,562,560),1242=>array(57,-14,731,913),1243=>array(55,-14,562,758),1244=>array(20,0,1058,913),1245=>array(34,0,867,758),1246=>array(66,-14,575,913),1247=>array(65,-14,473,758),1248=>array(78,-31,621,729),1249=>array(43,-213,523,547),1250=>array(98,0,650,899),1251=>array(91,0,559,745),1252=>array(98,0,650,913),1253=>array(91,0,559,758),1254=>array(56,-14,731,913),1255=>array(55,-14,557,758),1256=>array(56,-14,731,742),1257=>array(55,-14,557,560),1258=>array(56,-14,731,913),1259=>array(55,-14,557,758),1260=>array(54,-14,642,913),1261=>array(55,-14,488,758),1262=>array(17,0,592,899),1263=>array(30,-208,562,745),1264=>array(17,0,592,913),1265=>array(30,-208,562,758),1266=>array(17,0,592,927),1267=>array(30,-208,562,800),1268=>array(85,0,587,913),1269=>array(73,0,500,758),1270=>array(98,-157,552,729),1271=>array(91,-138,477,547),1272=>array(98,0,784,913),1273=>array(91,0,701,758),1274=>array(35,-208,617,729),1275=>array(27,-208,542,547),1276=>array(30,-200,646,729),1277=>array(29,-208,549,547),1278=>array(30,0,654,729),1279=>array(29,0,559,547),1280=>array(71,0,588,729),1281=>array(55,0,495,547),1282=>array(71,-14,908,729),1283=>array(55,-14,806,547),1284=>array(98,-14,876,742),1285=>array(83,-14,784,561),1286=>array(98,-208,654,742),1287=>array(83,-208,564,561),1288=>array(26,-14,974,729),1289=>array(22,-14,866,547),1290=>array(98,-14,1022,729),1291=>array(94,-14,876,547),1292=>array(56,-14,692,742),1293=>array(55,-14,534,560),1294=>array(-3,-14,675,729),1295=>array(2,-14,620,547),1296=>array(80,-14,560,742),1297=>array(65,-14,473,561),1298=>array(41,-200,653,729),1299=>array(37,-208,556,547),1300=>array(41,0,1139,729),1301=>array(37,0,962,547),1302=>array(98,0,863,729),1303=>array(91,-208,832,560),1304=>array(66,0,967,729),1305=>array(57,-14,933,560),1306=>array(56,-129,731,742),1307=>array(55,-208,544,560),1308=>array(33,0,956,729),1309=>array(42,0,776,547),1310=>array(98,0,690,729),1311=>array(91,0,571,547),1312=>array(41,-200,1056,729),1313=>array(37,-208,881,547),1314=>array(98,-200,1057,729),1315=>array(91,-208,888,547),1316=>array(98,-157,752,729),1317=>array(91,-138,653,547),1329=>array(87,-29,680,729),1330=>array(87,0,650,743),1331=>array(45,0,729,743),1332=>array(44,0,724,743),1333=>array(87,-14,650,729),1334=>array(87,0,692,744),1335=>array(92,0,616,729),1336=>array(87,0,650,743),1337=>array(87,-14,835,743),1338=>array(45,-14,729,729),1339=>array(92,0,650,729),1340=>array(92,0,533,729),1341=>array(92,-14,849,729),1342=>array(129,-13,763,742),1343=>array(87,0,645,729),1344=>array(34,-26,638,729),1345=>array(82,-23,688,744),1346=>array(49,0,729,743),1347=>array(51,0,715,735),1348=>array(87,-14,767,729),1349=>array(71,-14,668,743),1350=>array(0,-14,680,729),1351=>array(78,-15,684,729),1352=>array(87,0,645,743),1353=>array(59,-28,664,744),1354=>array(44,0,713,743),1355=>array(82,0,686,744),1356=>array(87,0,767,743),1357=>array(87,-14,645,729),1358=>array(49,0,729,729),1359=>array(73,-14,632,741),1360=>array(87,0,645,743),1361=>array(78,-14,675,743),1362=>array(92,0,538,729),1363=>array(59,0,752,729),1364=>array(24,0,679,743),1365=>array(56,-14,731,742),1366=>array(54,-13,746,729),1369=>array(57,492,191,760),1370=>array(87,499,230,729),1371=>array(0,620,234,803),1372=>array(2,618,356,893),1373=>array(-0,617,233,800),1374=>array(4,613,401,866),1375=>array(44,618,462,760),1377=>array(85,-14,883,547),1378=>array(91,-208,549,560),1379=>array(55,-208,648,560),1380=>array(91,-208,653,560),1381=>array(85,-14,548,760),1382=>array(55,-208,648,560),1383=>array(91,0,490,760),1384=>array(91,-208,549,560),1385=>array(91,-208,738,560),1386=>array(55,-14,648,760),1387=>array(91,-208,549,760),1388=>array(91,-208,303,547),1389=>array(91,-208,889,760),1390=>array(55,-14,557,760),1391=>array(85,-208,543,760),1392=>array(91,0,549,760),1393=>array(52,-15,523,760),1394=>array(91,-208,653,560),1395=>array(68,-14,544,768),1396=>array(85,-14,647,760),1397=>array(-21,-208,181,547),1398=>array(-19,-14,543,760),1399=>array(0,-208,435,560),1400=>array(91,0,549,560),1401=>array(5,-208,370,547),1402=>array(85,-208,883,547),1403=>array(54,-208,494,561),1404=>array(91,0,609,560),1405=>array(85,-14,543,560),1406=>array(85,-208,647,760),1407=>array(85,-14,889,560),1408=>array(91,-208,549,560),1409=>array(54,-208,543,560),1410=>array(91,0,449,547),1411=>array(85,-208,889,760),1412=>array(20,-208,580,560),1413=>array(54,-14,556,560),1414=>array(34,-208,766,760),1415=>array(85,-14,812,760),1417=>array(117,0,220,415),1418=>array(49,212,312,314),1456=>array(283,-217,356,-22),1457=>array(83,-217,438,-22),1458=>array(125,-217,454,-22),1459=>array(125,-217,454,-22),1460=>array(283,-159,356,-85),1461=>array(222,-159,417,-85),1462=>array(222,-217,417,-22),1463=>array(173,-159,466,-85),1464=>array(173,-193,466,-46),1465=>array(0,625,73,698),1466=>array(0,625,73,698),1467=>array(148,-237,465,-17),1468=>array(288,237,361,310),1469=>array(283,-217,356,-22),1470=>array(49,472,312,552),1471=>array(173,625,466,698),1472=>array(102,-98,193,645),1473=>array(637,625,710,698),1474=>array(96,625,169,698),1475=>array(102,0,193,547),1478=>array(50,0,357,547),1479=>array(173,-217,466,-22),1488=>array(91,0,578,547),1489=>array(43,0,535,547),1490=>array(43,-5,383,547),1491=>array(43,0,511,547),1492=>array(91,0,563,547),1493=>array(91,0,182,547),1494=>array(43,0,303,547),1495=>array(91,0,563,547),1496=>array(90,-14,593,552),1497=>array(66,204,157,547),1498=>array(43,-208,446,547),1499=>array(43,0,474,547),1500=>array(43,0,492,729),1501=>array(91,0,573,547),1502=>array(43,0,588,555),1503=>array(91,-208,182,547),1504=>array(43,0,309,547),1505=>array(90,-14,593,547),1506=>array(43,-93,535,547),1507=>array(91,-208,549,547),1508=>array(91,0,569,547),1509=>array(43,-208,497,548),1510=>array(43,0,502,547),1511=>array(91,-208,633,546),1512=>array(43,0,474,547),1513=>array(43,0,666,547),1514=>array(10,-4,566,547),1520=>array(91,0,380,547),1521=>array(66,0,332,547),1522=>array(66,204,312,547),1523=>array(91,361,325,547),1524=>array(91,361,554,547),1542=>array(0,-20,607,892),1543=>array(0,-20,607,895),1545=>array(65,0,685,635),1546=>array(65,0,904,635),1548=>array(107,0,250,240),1557=>array(123,624,377,868),1563=>array(107,0,250,633),1567=>array(72,0,461,742),1569=>array(80,42,390,483),1570=>array(-37,0,315,939),1571=>array(53,0,220,999),1572=>array(-42,-244,406,588),1573=>array(53,-244,220,760),1574=>array(63,-131,719,588),1575=>array(94,0,184,760),1576=>array(63,-171,865,327),1577=>array(68,-28,453,513),1578=>array(63,-10,865,391),1579=>array(63,-10,865,513),1580=>array(77,-244,645,425),1581=>array(77,-244,645,425),1582=>array(77,-244,645,586),1583=>array(61,-19,388,415),1584=>array(61,-19,388,586),1585=>array(-42,-244,423,269),1586=>array(-42,-244,423,464),1587=>array(63,-244,1138,366),1588=>array(63,-244,1138,586),1589=>array(63,-244,1134,362),1590=>array(63,-244,1134,464),1591=>array(70,0,857,760),1592=>array(70,0,857,760),1593=>array(57,-244,587,521),1594=>array(57,-244,587,659),1600=>array(-10,0,303,90),1601=>array(63,-45,952,635),1602=>array(52,-215,701,635),1603=>array(70,-27,722,760),1604=>array(70,-152,637,760),1605=>array(68,-240,546,369),1606=>array(72,-162,660,464),1607=>array(68,-28,453,358),1608=>array(-42,-244,406,315),1609=>array(63,-131,719,411),1610=>array(63,-244,719,411),1611=>array(107,591,393,825),1612=>array(107,591,393,874),1613=>array(107,-239,393,-5),1614=>array(107,591,393,708),1615=>array(107,590,393,874),1616=>array(107,-137,393,-20),1617=>array(98,599,402,869),1618=>array(115,610,383,878),1619=>array(74,590,426,719),1620=>array(164,593,331,808),1621=>array(164,-244,331,-29),1623=>array(107,615,393,898),1626=>array(119,616,381,775),1632=>array(215,220,322,342),1633=>array(136,0,342,635),1634=>array(40,0,492,635),1635=>array(37,0,509,635),1636=>array(85,-10,457,641),1637=>array(66,-10,471,643),1638=>array(42,0,493,635),1639=>array(29,0,508,635),1640=>array(29,0,508,635),1641=>array(49,0,493,640),1642=>array(65,0,472,635),1643=>array(0,-110,300,318),1644=>array(87,499,230,729),1645=>array(42,101,502,537),1646=>array(63,-10,865,327),1647=>array(52,-215,701,481),1648=>array(223,602,277,887),1652=>array(60,649,227,864),1657=>array(63,-10,865,575),1658=>array(63,-10,865,513),1659=>array(63,-244,865,327),1660=>array(63,-180,865,391),1661=>array(63,-10,865,464),1662=>array(63,-244,865,327),1663=>array(63,-10,865,513),1664=>array(63,-244,865,327),1665=>array(77,-244,645,710),1666=>array(77,-244,645,708),1667=>array(77,-244,645,425),1668=>array(77,-244,645,425),1669=>array(77,-244,645,708),1670=>array(77,-244,645,425),1671=>array(77,-244,645,425),1672=>array(61,-19,388,746),1673=>array(61,-180,388,415),1674=>array(61,-171,388,415),1675=>array(61,-171,388,746),1676=>array(61,-19,388,586),1677=>array(61,-146,388,415),1678=>array(61,-19,388,708),1679=>array(61,-19,388,684),1680=>array(61,-19,388,708),1681=>array(-42,-244,469,648),1682=>array(-42,-244,473,556),1683=>array(-42,-244,507,269),1684=>array(-42,-244,474,269),1685=>array(-42,-244,634,269),1686=>array(-42,-244,474,269),1687=>array(-42,-244,439,464),1688=>array(-42,-244,439,586),1689=>array(-42,-244,439,586),1690=>array(63,-244,1138,464),1691=>array(63,-244,1138,366),1692=>array(63,-244,1138,586),1693=>array(63,-244,1134,362),1694=>array(63,-244,1134,586),1695=>array(70,0,857,760),1696=>array(57,-244,587,781),1697=>array(63,-45,952,481),1698=>array(63,-171,952,481),1699=>array(63,-171,952,635),1700=>array(63,-45,952,757),1701=>array(63,-293,952,481),1702=>array(63,-45,952,757),1703=>array(52,-215,701,635),1704=>array(52,-215,701,757),1705=>array(63,-43,895,760),1706=>array(63,-43,1000,760),1707=>array(63,-43,895,760),1708=>array(70,-27,722,760),1709=>array(70,-27,722,854),1710=>array(70,-293,722,760),1711=>array(63,-43,895,896),1712=>array(63,-43,895,896),1713=>array(63,-43,895,903),1714=>array(63,-171,895,896),1715=>array(63,-293,895,896),1716=>array(63,-43,895,1025),1717=>array(70,-152,723,971),1718=>array(70,-152,637,952),1719=>array(70,-152,684,1025),1720=>array(70,-391,637,760),1721=>array(72,-317,660,464),1722=>array(72,-162,660,366),1723=>array(72,-162,660,636),1724=>array(72,-330,660,464),1725=>array(72,-162,660,586),1726=>array(70,-33,638,487),1727=>array(77,-244,645,586),1734=>array(-42,-244,406,556),1740=>array(63,-131,719,411),1742=>array(63,-131,719,556),1749=>array(68,-28,453,358),1776=>array(215,220,322,342),1777=>array(136,0,342,635),1778=>array(40,0,492,635),1779=>array(37,0,509,635),1780=>array(40,0,471,643),1781=>array(52,-5,485,643),1782=>array(102,0,445,640),1783=>array(29,0,508,635),1784=>array(29,0,508,635),1785=>array(49,0,493,640),1984=>array(66,-14,570,742),1985=>array(110,0,544,729),1986=>array(110,0,530,729),1987=>array(110,0,530,729),1988=>array(110,0,530,729),1989=>array(110,0,530,729),1990=>array(110,0,530,729),1991=>array(104,0,532,729),1992=>array(104,0,532,729),1993=>array(77,0,560,741),1994=>array(94,0,184,729),1995=>array(55,-14,516,447),1996=>array(30,0,394,731),1997=>array(30,0,562,430),1998=>array(91,0,563,430),1999=>array(91,0,563,430),2000=>array(55,0,539,735),2001=>array(91,0,563,581),2002=>array(55,0,738,741),2003=>array(94,0,408,729),2004=>array(30,0,344,729),2005=>array(91,0,504,729),2006=>array(94,0,518,729),2007=>array(30,0,256,729),2008=>array(94,0,865,513),2009=>array(30,0,443,729),2010=>array(30,0,754,729),2011=>array(91,0,563,430),2012=>array(30,0,595,729),2013=>array(94,0,679,729),2014=>array(94,0,436,729),2015=>array(55,0,630,729),2016=>array(30,0,443,729),2017=>array(30,0,595,729),2018=>array(55,0,539,729),2019=>array(94,0,436,729),2020=>array(94,0,436,612),2021=>array(94,0,428,729),2022=>array(55,0,539,729),2023=>array(55,0,539,729),2027=>array(106,673,398,745),2028=>array(32,609,468,800),2029=>array(205,658,305,758),2030=>array(93,616,405,800),2031=>array(44,616,456,800),2032=>array(32,609,468,800),2033=>array(44,616,456,800),2034=>array(200,-184,300,-84),2035=>array(104,659,394,758),2036=>array(98,557,216,760),2037=>array(98,557,216,760),2040=>array(49,0,511,498),2041=>array(49,0,511,483),2042=>array(-10,0,371,72),3647=>array(86,-138,571,769),3713=>array(63,-10,607,560),3714=>array(68,-17,691,568),3716=>array(67,-10,619,568),3719=>array(53,-238,415,568),3720=>array(62,-0,574,575),3722=>array(68,-234,690,568),3725=>array(56,-8,619,573),3732=>array(91,-14,592,560),3733=>array(63,-15,564,579),3734=>array(0,-240,587,560),3735=>array(42,-8,599,571),3737=>array(46,-14,593,568),3738=>array(36,-8,556,561),3739=>array(36,-8,556,760),3740=>array(43,-8,725,614),3741=>array(91,-14,676,760),3742=>array(51,-8,636,561),3743=>array(51,-8,636,760),3745=>array(31,-14,636,547),3746=>array(56,-8,619,760),3747=>array(68,-8,634,568),3749=>array(39,-8,583,568),3751=>array(56,-13,558,560),3754=>array(39,-8,688,679),3755=>array(62,-12,762,575),3757=>array(56,-14,558,560),3758=>array(68,-8,684,605),3759=>array(99,-166,742,579),3760=>array(54,-13,589,563),3761=>array(-578,639,-43,880),3762=>array(60,0,473,560),3763=>array(-425,0,473,806),3764=>array(-594,615,-73,926),3765=>array(-594,615,0,926),3766=>array(-594,615,-73,926),3767=>array(-594,615,0,926),3768=>array(-376,-350,-161,-38),3769=>array(-418,-306,-152,-40),3771=>array(-578,639,-43,880),3772=>array(-611,-278,6,-39),3773=>array(63,-240,619,715),3776=>array(60,-14,324,560),3777=>array(60,-14,598,560),3778=>array(-22,-5,398,896),3779=>array(45,-14,490,892),3780=>array(92,-11,445,886),3782=>array(72,-232,574,557),3784=>array(-366,618,-278,792),3785=>array(-563,609,-45,891),3786=>array(-595,598,22,869),3787=>array(-462,609,-182,890),3788=>array(-611,636,6,875),3789=>array(-425,620,-220,806),3792=>array(66,-14,570,547),3793=>array(48,-75,582,576),3794=>array(48,-66,545,711),3795=>array(11,-9,692,830),3796=>array(48,-83,601,711),3797=>array(48,-83,601,711),3798=>array(43,-8,744,812),3799=>array(63,-240,607,560),3800=>array(73,-210,680,557),3801=>array(51,-4,621,571),3804=>array(62,-12,947,575),3805=>array(62,-12,973,575),4256=>array(59,-15,815,828),4257=>array(54,-0,704,828),4258=>array(54,-148,649,837),4259=>array(54,-15,781,828),4260=>array(49,0,552,837),4261=>array(39,0,714,837),4262=>array(29,-15,695,828),4263=>array(59,-15,885,837),4264=>array(29,0,390,874),4265=>array(59,0,561,828),4266=>array(29,-15,784,828),4267=>array(59,-15,824,828),4268=>array(63,0,566,828),4269=>array(49,-167,806,837),4270=>array(24,-15,717,837),4271=>array(39,0,566,828),4272=>array(54,-15,853,828),4273=>array(63,-15,567,828),4274=>array(63,-0,566,837),4275=>array(49,-182,806,837),4276=>array(49,0,817,834),4277=>array(44,0,680,828),4278=>array(64,-15,566,837),4279=>array(54,0,557,828),4280=>array(59,-15,562,828),4281=>array(63,0,566,828),4282=>array(59,-15,764,837),4283=>array(59,-15,810,828),4284=>array(63,-0,566,828),4285=>array(49,-15,574,837),4286=>array(63,-0,566,828),4287=>array(29,0,695,828),4288=>array(29,-15,785,828),4289=>array(63,0,566,828),4290=>array(54,-15,635,837),4291=>array(29,0,532,828),4292=>array(54,0,540,828),4293=>array(39,-15,699,837),4304=>array(49,-15,459,592),4305=>array(49,-14,469,837),4306=>array(44,-235,537,551),4307=>array(49,-230,759,547),4308=>array(49,-236,449,547),4309=>array(49,-236,459,547),4310=>array(20,-14,452,838),4311=>array(49,-14,752,547),4312=>array(49,0,469,547),4313=>array(44,-236,456,542),4314=>array(49,-230,1016,552),4315=>array(49,-15,459,837),4316=>array(63,-15,474,833),4317=>array(49,-0,737,547),4318=>array(49,-15,459,833),4319=>array(49,-236,458,551),4320=>array(49,0,747,833),4321=>array(63,-15,474,827),4322=>array(44,-236,610,680),4323=>array(5,-236,464,571),4324=>array(49,-236,766,547),4325=>array(49,-236,449,828),4326=>array(49,-230,737,546),4327=>array(49,-236,459,538),4328=>array(29,-15,454,837),4329=>array(63,0,474,837),4330=>array(44,-236,527,532),4331=>array(49,-14,458,828),4332=>array(64,-15,488,837),4333=>array(49,-236,471,827),4334=>array(63,-15,474,827),4335=>array(10,-235,444,572),4336=>array(49,-15,459,837),4337=>array(59,-15,469,837),4338=>array(49,-141,458,547),4339=>array(49,-236,459,546),4340=>array(49,-236,458,837),4341=>array(49,-15,515,837),4342=>array(49,-236,778,547),4343=>array(44,-236,508,547),4344=>array(49,-236,459,538),4345=>array(39,-236,532,551),4346=>array(49,-77,459,547),4347=>array(54,-10,394,484),4348=>array(49,420,270,837),5121=>array(8,1,676,730),5122=>array(8,0,676,1037),5123=>array(8,0,676,729),5124=>array(8,0,676,914),5125=>array(98,0,711,729),5126=>array(98,0,711,914),5127=>array(98,0,711,913),5129=>array(98,0,711,729),5130=>array(58,0,671,729),5131=>array(58,0,671,914),5132=>array(98,1,827,730),5133=>array(8,1,776,730),5134=>array(98,0,827,729),5135=>array(8,0,776,729),5136=>array(98,0,827,914),5137=>array(8,0,776,914),5138=>array(98,0,909,729),5139=>array(98,0,909,729),5140=>array(98,0,909,914),5141=>array(98,0,909,914),5142=>array(98,0,711,914),5143=>array(98,0,869,729),5144=>array(58,0,909,729),5145=>array(98,0,869,914),5146=>array(58,0,909,914),5147=>array(58,0,671,914),5149=>array(98,629,198,729),5150=>array(67,326,488,734),5151=>array(46,356,362,714),5152=>array(46,356,362,714),5153=>array(67,398,334,674),5154=>array(67,391,334,667),5155=>array(67,398,338,667),5156=>array(67,398,334,667),5157=>array(35,327,405,733),5158=>array(67,326,331,734),5159=>array(98,312,198,412),5160=>array(67,503,334,563),5161=>array(67,399,334,667),5162=>array(67,399,334,691),5163=>array(8,1,1028,730),5164=>array(8,0,847,729),5165=>array(98,0,892,729),5166=>array(58,0,1055,729),5167=>array(8,0,676,729),5168=>array(8,0,676,1037),5169=>array(8,0,676,729),5170=>array(8,0,676,914),5171=>array(58,0,671,729),5172=>array(58,0,671,914),5173=>array(58,0,671,913),5175=>array(58,0,671,729),5176=>array(58,0,671,729),5177=>array(58,0,671,914),5178=>array(98,0,827,729),5179=>array(8,0,776,729),5180=>array(98,0,827,729),5181=>array(8,0,776,729),5182=>array(98,0,827,914),5183=>array(8,0,776,914),5184=>array(98,0,869,729),5185=>array(58,0,909,729),5186=>array(98,0,869,914),5187=>array(58,0,909,914),5188=>array(98,0,869,729),5189=>array(58,0,909,729),5190=>array(98,0,869,914),5191=>array(58,0,909,914),5192=>array(58,0,671,913),5193=>array(67,326,453,734),5194=>array(67,326,137,734),5196=>array(87,-14,645,729),5197=>array(87,0,645,1037),5198=>array(87,0,645,743),5199=>array(87,0,645,914),5200=>array(58,0,671,729),5201=>array(58,0,671,914),5202=>array(58,0,671,913),5204=>array(58,0,671,729),5205=>array(59,0,672,729),5206=>array(59,0,672,914),5207=>array(98,-14,834,729),5208=>array(87,-14,831,729),5209=>array(98,0,834,743),5210=>array(87,0,831,743),5211=>array(98,0,834,914),5212=>array(87,0,831,914),5213=>array(98,0,869,729),5214=>array(58,0,842,729),5215=>array(98,0,869,914),5216=>array(58,0,842,914),5217=>array(98,0,889,729),5218=>array(59,0,842,729),5219=>array(98,0,889,914),5220=>array(59,0,842,914),5221=>array(117,0,889,729),5222=>array(67,326,379,734),5223=>array(87,-14,823,734),5224=>array(87,0,823,743),5225=>array(58,0,811,734),5226=>array(59,0,835,734),5227=>array(34,0,530,743),5228=>array(98,0,594,1037),5229=>array(98,0,594,743),5230=>array(98,0,594,914),5231=>array(34,-14,530,729),5232=>array(34,-14,530,914),5233=>array(34,-14,623,913),5234=>array(98,-14,594,729),5235=>array(98,-14,594,914),5236=>array(98,0,762,743),5237=>array(34,0,712,743),5238=>array(98,0,781,743),5239=>array(98,0,758,743),5240=>array(98,0,781,914),5241=>array(98,0,758,914),5242=>array(98,-14,762,729),5243=>array(34,-14,712,729),5244=>array(98,-14,762,914),5245=>array(34,-14,712,914),5246=>array(98,-14,781,729),5247=>array(98,-14,758,729),5248=>array(98,-14,781,914),5249=>array(98,-14,758,914),5250=>array(117,-14,781,729),5251=>array(67,318,379,734),5252=>array(27,318,340,734),5253=>array(34,0,696,743),5254=>array(98,0,720,743),5255=>array(34,-14,696,734),5256=>array(98,-14,720,734),5257=>array(34,0,530,743),5258=>array(98,0,594,1037),5259=>array(98,0,594,743),5260=>array(98,0,594,914),5261=>array(34,-14,530,729),5262=>array(34,-14,530,914),5263=>array(34,-14,623,913),5264=>array(98,-14,594,729),5265=>array(98,-14,594,914),5266=>array(98,0,762,743),5267=>array(34,0,712,743),5268=>array(98,0,781,743),5269=>array(98,0,758,743),5270=>array(98,0,781,914),5271=>array(98,0,758,914),5272=>array(98,-14,762,729),5273=>array(34,-14,712,729),5274=>array(98,-14,762,914),5275=>array(34,-14,712,914),5276=>array(98,-14,781,729),5277=>array(98,-14,758,729),5278=>array(98,-14,781,914),5279=>array(98,-14,758,914),5280=>array(117,-14,781,729),5281=>array(67,318,379,734),5282=>array(67,318,379,734),5283=>array(58,0,512,729),5284=>array(98,0,552,1037),5285=>array(98,0,552,729),5286=>array(98,0,552,914),5287=>array(58,0,512,729),5288=>array(58,0,512,914),5289=>array(58,0,607,913),5290=>array(98,0,552,729),5291=>array(98,0,552,914),5292=>array(98,0,651,729),5293=>array(58,0,710,729),5294=>array(98,0,741,729),5295=>array(98,0,706,729),5296=>array(98,0,741,914),5297=>array(98,0,706,914),5298=>array(98,0,651,729),5299=>array(58,0,710,729),5300=>array(98,0,651,914),5301=>array(58,0,710,914),5302=>array(98,0,741,729),5303=>array(98,0,706,729),5304=>array(98,0,741,914),5305=>array(98,0,706,914),5306=>array(117,0,741,729),5307=>array(67,326,331,734),5308=>array(67,326,453,734),5309=>array(67,326,331,734),5312=>array(58,-14,817,436),5313=>array(34,-14,793,755),5314=>array(34,-14,793,436),5315=>array(5,-14,765,636),5316=>array(58,0,817,450),5317=>array(58,0,817,636),5318=>array(58,0,817,635),5319=>array(34,0,793,450),5320=>array(34,0,793,636),5321=>array(98,-14,1035,436),5322=>array(58,-14,977,436),5323=>array(98,0,1025,450),5324=>array(34,0,793,450),5325=>array(98,0,1025,636),5326=>array(34,0,793,636),5327=>array(34,0,793,635),5328=>array(67,484,545,736),5329=>array(67,318,397,734),5330=>array(67,484,545,736),5331=>array(58,0,817,450),5332=>array(34,0,793,755),5333=>array(34,0,793,450),5334=>array(34,0,793,636),5335=>array(58,0,817,450),5336=>array(58,0,817,636),5337=>array(58,0,817,635),5338=>array(34,0,793,450),5339=>array(34,0,793,636),5340=>array(98,0,1035,450),5341=>array(58,0,977,450),5342=>array(98,0,1025,450),5343=>array(34,0,972,450),5344=>array(98,0,1025,636),5345=>array(34,0,972,636),5346=>array(98,0,1035,450),5347=>array(58,0,977,450),5348=>array(98,0,1035,636),5349=>array(58,0,977,636),5350=>array(98,0,1025,450),5351=>array(34,0,972,450),5352=>array(98,0,1025,636),5353=>array(34,0,972,636),5354=>array(67,484,545,736),5356=>array(58,0,671,729),5357=>array(34,0,505,729),5358=>array(98,0,649,1037),5359=>array(98,0,569,729),5360=>array(98,0,569,914),5361=>array(34,0,505,729),5362=>array(34,0,505,914),5363=>array(34,0,600,913),5364=>array(98,0,569,729),5365=>array(98,0,569,914),5366=>array(98,0,736,729),5367=>array(34,0,696,729),5368=>array(98,0,758,729),5369=>array(98,0,713,729),5370=>array(98,0,758,914),5371=>array(98,0,713,914),5372=>array(98,0,736,729),5373=>array(34,0,696,729),5374=>array(98,0,736,914),5375=>array(34,0,696,914),5376=>array(98,0,758,729),5377=>array(98,0,713,729),5378=>array(98,0,758,914),5379=>array(98,0,713,914),5380=>array(117,0,758,729),5381=>array(67,326,363,734),5382=>array(67,318,365,741),5383=>array(67,326,363,734),5392=>array(34,-14,678,743),5393=>array(34,-14,678,743),5394=>array(34,-14,678,914),5395=>array(34,-14,857,464),5396=>array(34,-14,857,636),5397=>array(34,-14,857,464),5398=>array(34,-14,857,636),5399=>array(98,-14,875,743),5400=>array(34,-14,814,743),5401=>array(98,-14,875,743),5402=>array(34,-14,814,743),5403=>array(98,-14,875,914),5404=>array(34,-14,814,914),5405=>array(98,-14,1106,464),5406=>array(34,-14,1042,464),5407=>array(98,-14,1106,636),5408=>array(34,-14,1042,636),5409=>array(98,-14,1106,464),5410=>array(34,-14,1042,464),5411=>array(98,-14,1106,636),5412=>array(34,-14,1042,636),5413=>array(67,476,585,737),5414=>array(58,0,529,729),5415=>array(98,0,569,1037),5416=>array(98,0,569,729),5417=>array(98,0,569,914),5418=>array(58,0,529,729),5419=>array(58,0,531,914),5420=>array(58,0,626,913),5421=>array(98,0,569,729),5422=>array(98,0,569,914),5423=>array(98,0,746,729),5424=>array(58,0,723,729),5425=>array(98,0,758,729),5426=>array(98,0,760,729),5427=>array(98,0,758,914),5428=>array(98,0,760,914),5429=>array(98,0,746,729),5430=>array(58,0,723,729),5431=>array(98,0,749,914),5432=>array(58,0,723,914),5433=>array(98,0,758,729),5434=>array(98,0,760,729),5435=>array(98,0,758,914),5436=>array(98,0,760,914),5437=>array(117,0,758,729),5438=>array(67,326,363,734),5440=>array(67,399,334,667),5441=>array(67,326,429,734),5442=>array(98,-14,857,436),5443=>array(58,-14,817,436),5444=>array(58,0,817,450),5445=>array(98,0,857,755),5446=>array(98,0,857,450),5447=>array(98,0,857,636),5448=>array(98,0,569,729),5449=>array(98,0,569,914),5450=>array(98,0,569,729),5451=>array(34,0,505,729),5452=>array(34,0,505,914),5453=>array(34,0,505,729),5454=>array(98,0,736,914),5455=>array(34,0,696,914),5456=>array(67,326,363,734),5458=>array(58,0,671,729),5459=>array(73,0,676,744),5460=>array(73,-15,676,1037),5461=>array(73,-15,676,729),5462=>array(73,-15,676,914),5463=>array(38,0,668,662),5464=>array(38,0,668,914),5465=>array(58,0,688,662),5466=>array(58,0,688,914),5467=>array(98,0,886,914),5468=>array(58,0,909,914),5469=>array(67,326,462,695),5470=>array(87,-14,645,743),5471=>array(87,-14,645,743),5472=>array(87,-14,645,743),5473=>array(87,-14,645,743),5474=>array(87,-14,645,914),5475=>array(87,-14,645,914),5476=>array(41,0,671,729),5477=>array(41,0,671,914),5478=>array(59,0,689,729),5479=>array(59,0,689,914),5480=>array(98,0,907,914),5481=>array(59,0,842,914),5482=>array(67,326,467,734),5492=>array(34,0,772,743),5493=>array(58,0,796,743),5494=>array(58,0,796,914),5495=>array(34,-14,772,729),5496=>array(34,-14,772,914),5497=>array(58,-14,796,729),5498=>array(58,-14,796,914),5499=>array(67,318,508,734),5500=>array(98,0,654,729),5501=>array(67,326,429,734),5502=>array(67,0,1013,1037),5503=>array(67,0,1013,743),5504=>array(67,0,1013,914),5505=>array(67,-14,949,734),5506=>array(67,-14,949,914),5507=>array(67,-14,1013,734),5508=>array(67,-14,1013,914),5509=>array(67,318,798,734),5514=>array(34,0,772,743),5515=>array(58,0,796,743),5516=>array(34,-14,772,729),5517=>array(58,-14,796,729),5518=>array(67,0,1225,1037),5519=>array(67,0,1225,743),5520=>array(67,0,1225,914),5521=>array(67,-14,904,736),5522=>array(67,-14,904,914),5523=>array(67,-14,1225,736),5524=>array(67,-14,1225,914),5525=>array(67,332,645,736),5526=>array(67,332,1018,736),5536=>array(34,0,793,692),5537=>array(34,0,793,692),5538=>array(58,-242,817,450),5539=>array(58,-242,817,636),5540=>array(34,-242,793,450),5541=>array(34,-242,793,636),5542=>array(67,338,545,736),5543=>array(58,0,627,729),5544=>array(16,0,585,729),5545=>array(16,0,585,914),5546=>array(58,0,627,729),5547=>array(58,0,627,914),5548=>array(16,0,585,729),5549=>array(16,0,585,914),5550=>array(5,326,363,734),5551=>array(98,-14,594,729),5598=>array(98,0,711,729),5601=>array(56,0,669,729),5702=>array(67,326,413,734),5703=>array(67,240,413,820),5742=>array(57,0,391,306),5743=>array(67,0,949,743),5744=>array(67,0,1211,743),5745=>array(67,0,1598,743),5746=>array(67,0,1598,914),5747=>array(67,-14,1277,736),5748=>array(67,-14,1277,914),5749=>array(67,-14,1598,736),5750=>array(67,-14,1598,914),5760=>array(-10,246,487,328),5761=>array(-10,-125,502,328),5762=>array(-10,-125,722,328),5763=>array(-10,-125,941,328),5764=>array(-10,-125,1160,328),5765=>array(-10,-125,1379,328),5766=>array(-10,246,502,697),5767=>array(-10,246,722,697),5768=>array(-10,246,941,697),5769=>array(-10,246,1160,697),5770=>array(-10,246,1379,697),5771=>array(-10,-125,508,697),5772=>array(-10,-125,728,697),5773=>array(-10,-125,948,697),5774=>array(-10,-125,1168,697),5775=>array(-10,-125,1389,697),5776=>array(-10,41,502,533),5777=>array(-10,41,722,533),5778=>array(-10,41,939,533),5779=>array(-10,41,1159,533),5780=>array(-10,41,1379,533),5781=>array(-10,-125,508,697),5782=>array(-10,-125,762,697),5783=>array(-10,-83,798,328),5784=>array(-10,-240,1214,328),5785=>array(-10,246,1160,902),5786=>array(-10,82,693,328),5787=>array(55,28,517,544),5788=>array(-10,28,452,544),7424=>array(30,0,562,547),7425=>array(5,0,669,547),7426=>array(60,-14,929,560),7427=>array(30,0,530,547),7428=>array(55,-14,488,560),7429=>array(91,0,550,547),7430=>array(18,0,550,547),7431=>array(91,0,443,547),7432=>array(63,-14,471,561),7433=>array(94,-213,184,547),7434=>array(0,-14,310,547),7435=>array(91,0,576,547),7436=>array(1,0,498,560),7437=>array(91,0,664,547),7438=>array(91,0,559,547),7439=>array(55,-14,557,560),7440=>array(62,-14,495,560),7441=>array(55,22,629,524),7442=>array(55,57,629,489),7443=>array(25,2,663,543),7444=>array(55,-14,970,560),7446=>array(55,273,557,560),7447=>array(55,-14,557,273),7448=>array(74,0,475,547),7449=>array(24,0,507,547),7450=>array(24,0,507,547),7451=>array(29,0,553,547),7452=>array(91,-16,510,547),7453=>array(85,37,646,495),7454=>array(85,38,857,496),7455=>array(23,-238,583,560),7456=>array(30,0,562,547),7457=>array(42,0,776,547),7458=>array(43,0,482,547),7459=>array(59,-14,466,547),7462=>array(87,0,498,560),7463=>array(30,0,562,547),7464=>array(74,0,490,547),7465=>array(74,0,475,547),7466=>array(44,0,546,547),7467=>array(37,0,556,547),7468=>array(5,326,426,734),7469=>array(2,326,573,734),7470=>array(62,326,388,734),7472=>array(62,326,448,734),7473=>array(62,326,358,734),7474=>array(41,326,336,734),7475=>array(35,318,437,742),7476=>array(62,326,412,734),7477=>array(62,326,124,734),7478=>array(-33,214,124,734),7479=>array(62,326,426,734),7480=>array(62,326,348,734),7481=>array(62,326,482,734),7482=>array(62,326,410,734),7483=>array(62,326,410,734),7484=>array(35,318,460,742),7485=>array(35,318,405,742),7486=>array(62,326,358,734),7487=>array(62,326,419,734),7488=>array(-2,326,387,734),7489=>array(55,318,406,734),7490=>array(21,326,603,734),7491=>array(38,318,329,640),7492=>array(38,318,329,640),7493=>array(35,318,343,640),7494=>array(38,318,585,640),7495=>array(57,318,365,751),7496=>array(35,318,343,751),7497=>array(35,318,354,640),7498=>array(35,318,354,640),7499=>array(41,318,298,640),7500=>array(40,318,297,640),7501=>array(35,209,343,640),7502=>array(60,207,116,632),7503=>array(57,326,363,751),7504=>array(57,326,560,640),7505=>array(57,209,346,640),7506=>array(35,318,351,640),7507=>array(35,318,307,640),7508=>array(35,479,351,640),7509=>array(35,318,351,479),7510=>array(57,209,365,640),7511=>array(17,326,232,719),7512=>array(54,318,342,632),7513=>array(54,347,407,604),7514=>array(57,319,560,633),7515=>array(19,326,354,632),7517=>array(59,209,357,755),7518=>array(10,209,354,632),7519=>array(35,318,351,742),7520=>array(35,209,379,635),7521=>array(18,209,346,633),7522=>array(60,0,116,425),7523=>array(57,0,259,313),7524=>array(54,-8,342,306),7525=>array(19,0,354,306),7526=>array(59,-117,357,429),7527=>array(10,-117,354,306),7528=>array(59,-117,367,313),7529=>array(35,-117,379,309),7530=>array(18,-117,346,307),7543=>array(91,-208,580,560),7544=>array(62,326,412,734),7547=>array(57,0,314,547),7549=>array(24,-208,643,560),7557=>array(71,-208,273,760),7579=>array(35,318,343,640),7580=>array(35,318,307,640),7581=>array(35,287,307,640),7582=>array(35,318,351,751),7583=>array(41,318,298,640),7584=>array(15,326,234,751),7585=>array(-11,209,170,632),7586=>array(35,209,343,632),7587=>array(54,209,342,632),7588=>array(36,326,198,751),7589=>array(60,326,187,632),7590=>array(36,326,198,632),7591=>array(36,326,198,632),7592=>array(-83,209,172,751),7593=>array(60,209,187,751),7594=>array(44,209,172,751),7595=>array(55,326,314,640),7596=>array(57,209,560,640),7597=>array(57,209,560,633),7598=>array(-11,209,348,640),7599=>array(57,209,417,640),7600=>array(55,326,346,640),7601=>array(35,318,351,640),7602=>array(35,210,351,751),7603=>array(34,209,297,640),7604=>array(-11,209,224,751),7605=>array(17,209,232,719),7606=>array(46,318,445,632),7607=>array(35,318,355,632),7608=>array(57,317,321,632),7609=>array(60,326,343,632),7610=>array(19,326,354,632),7611=>array(27,326,304,632),7612=>array(27,209,374,632),7613=>array(27,296,304,632),7614=>array(27,207,330,632),7615=>array(35,320,351,756),7620=>array(-456,616,-44,800),7621=>array(-456,616,-44,800),7622=>array(-456,616,-44,800),7623=>array(-456,616,-44,800),7624=>array(-468,616,-32,800),7625=>array(-468,616,-32,800),7680=>array(8,-241,676,729),7681=>array(60,-241,522,560),7682=>array(98,0,615,914),7683=>array(90,-14,580,915),7684=>array(98,-183,615,729),7685=>array(91,-183,580,760),7686=>array(98,-156,615,729),7687=>array(91,-156,580,760),7688=>array(56,-193,644,928),7689=>array(55,-193,488,800),7690=>array(98,0,711,914),7691=>array(55,-14,544,942),7692=>array(98,-183,711,729),7693=>array(55,-183,544,760),7694=>array(98,-156,711,729),7695=>array(55,-156,544,760),7696=>array(98,-192,711,729),7697=>array(55,-193,544,760),7698=>array(98,-240,711,729),7699=>array(55,-240,544,760),7700=>array(98,0,568,1044),7701=>array(55,-14,562,921),7702=>array(98,0,568,1044),7703=>array(55,-14,562,921),7704=>array(98,-213,568,729),7705=>array(55,-213,562,560),7706=>array(98,-192,568,729),7707=>array(55,-192,562,560),7708=>array(98,-193,568,928),7709=>array(55,-193,562,785),7710=>array(98,0,517,914),7711=>array(23,0,371,942),7712=>array(56,-14,693,887),7713=>array(55,-208,544,745),7714=>array(98,0,654,913),7715=>array(90,0,549,915),7716=>array(98,-183,654,729),7717=>array(91,-183,549,760),7718=>array(98,0,654,914),7719=>array(-9,0,549,913),7720=>array(8,-193,654,729),7721=>array(1,-193,549,760),7722=>array(98,-222,654,729),7723=>array(91,-222,549,760),7724=>array(0,-192,322,729),7725=>array(-22,-192,300,760),7726=>array(3,0,293,1044),7727=>array(-6,0,284,886),7728=>array(98,0,677,928),7729=>array(91,0,576,928),7730=>array(98,-183,677,729),7731=>array(91,-183,576,760),7732=>array(98,-156,677,729),7733=>array(91,-156,576,760),7734=>array(98,-183,552,729),7735=>array(98,-183,189,760),7736=>array(1,-183,552,927),7737=>array(-1,-183,291,899),7738=>array(98,-156,552,729),7739=>array(-6,-156,286,760),7740=>array(98,-240,552,729),7741=>array(-17,-240,295,760),7742=>array(98,0,765,928),7743=>array(91,0,889,800),7744=>array(98,0,765,914),7745=>array(91,0,889,760),7746=>array(98,-183,765,729),7747=>array(91,-183,889,560),7748=>array(98,0,650,914),7749=>array(91,0,549,760),7750=>array(98,-183,650,729),7751=>array(91,-183,549,560),7752=>array(98,-156,650,729),7753=>array(91,-156,549,560),7754=>array(98,-240,650,729),7755=>array(91,-240,549,560),7756=>array(56,-14,731,1044),7757=>array(55,-14,557,881),7758=>array(56,-14,731,1042),7759=>array(55,-14,557,882),7760=>array(56,-14,731,1044),7761=>array(55,-14,557,921),7762=>array(56,-14,731,1044),7763=>array(55,-14,557,921),7764=>array(98,0,569,928),7765=>array(91,-208,580,800),7766=>array(98,0,569,914),7767=>array(91,-208,580,760),7768=>array(98,0,666,913),7769=>array(91,0,411,760),7770=>array(98,-183,666,729),7771=>array(91,-183,411,560),7772=>array(98,-183,666,899),7773=>array(91,-183,411,745),7774=>array(98,-156,666,729),7775=>array(41,-156,411,560),7776=>array(66,-14,579,914),7777=>array(54,-14,472,760),7778=>array(66,-183,579,742),7779=>array(54,-183,472,560),7780=>array(66,-14,579,928),7781=>array(54,-14,485,800),7782=>array(66,-14,579,1042),7783=>array(54,-14,472,973),7784=>array(66,-183,579,914),7785=>array(54,-183,472,733),7786=>array(-3,0,614,914),7787=>array(27,0,368,942),7788=>array(-3,-183,614,729),7789=>array(27,-183,368,702),7790=>array(-3,-156,614,729),7791=>array(27,-156,390,702),7792=>array(-3,-240,614,729),7793=>array(27,-240,394,702),7794=>array(87,-183,645,729),7795=>array(85,-183,543,560),7796=>array(87,-192,645,729),7797=>array(85,-192,543,560),7798=>array(87,-213,645,729),7799=>array(85,-213,543,560),7800=>array(87,-14,645,1044),7801=>array(85,-14,543,990),7802=>array(87,-14,645,1025),7803=>array(85,-14,543,869),7804=>array(8,0,676,936),7805=>array(30,0,562,777),7806=>array(8,-183,676,729),7807=>array(30,-183,562,547),7808=>array(33,0,956,931),7809=>array(42,0,776,802),7810=>array(33,0,956,931),7811=>array(42,0,776,803),7812=>array(33,0,956,913),7813=>array(42,0,776,758),7814=>array(33,0,956,913),7815=>array(42,0,776,760),7816=>array(33,-183,956,729),7817=>array(42,-183,776,547),7818=>array(30,0,654,914),7819=>array(29,0,559,760),7820=>array(30,0,654,913),7821=>array(29,0,559,758),7822=>array(-2,0,613,914),7823=>array(30,-208,562,760),7824=>array(45,0,640,928),7825=>array(43,0,482,800),7826=>array(45,-183,640,729),7827=>array(43,-183,482,547),7828=>array(45,-156,640,729),7829=>array(43,-156,482,547),7830=>array(91,-156,549,760),7831=>array(2,0,368,913),7832=>array(42,0,776,878),7833=>array(30,-208,562,878),7834=>array(60,-14,672,760),7835=>array(23,0,371,942),7836=>array(1,0,371,760),7837=>array(23,0,371,760),7838=>array(87,-14,713,743),7839=>array(55,-14,557,742),7840=>array(8,-183,676,729),7841=>array(60,-183,522,560),7842=>array(8,0,676,992),7843=>array(60,-14,522,810),7844=>array(8,0,676,1028),7845=>array(60,-14,585,846),7846=>array(8,0,676,1028),7847=>array(60,-14,522,847),7848=>array(8,0,676,1044),7849=>array(60,-14,577,862),7850=>array(8,0,676,1057),7851=>array(60,-14,522,875),7852=>array(8,-183,676,928),7853=>array(60,-183,522,800),7854=>array(8,0,676,1044),7855=>array(60,-14,522,877),7856=>array(8,0,676,1044),7857=>array(60,-14,522,877),7858=>array(8,0,676,1068),7859=>array(60,-14,522,901),7860=>array(8,0,676,1043),7861=>array(60,-14,522,876),7862=>array(8,-183,676,946),7863=>array(60,-183,522,765),7864=>array(98,-183,568,729),7865=>array(55,-183,562,560),7866=>array(98,0,568,992),7867=>array(55,-14,562,810),7868=>array(98,0,568,921),7869=>array(55,-14,562,777),7870=>array(98,0,637,1028),7871=>array(55,-14,613,846),7872=>array(98,0,568,1028),7873=>array(55,-14,562,847),7874=>array(98,0,620,1044),7875=>array(55,-14,605,862),7876=>array(98,0,568,1057),7877=>array(55,-14,562,875),7878=>array(98,-183,568,928),7879=>array(55,-183,562,800),7880=>array(44,0,263,992),7881=>array(33,0,252,811),7882=>array(98,-183,197,729),7883=>array(93,-183,184,760),7884=>array(56,-183,731,742),7885=>array(55,-183,557,560),7886=>array(56,-14,731,992),7887=>array(55,-14,557,810),7888=>array(56,-14,731,1028),7889=>array(55,-14,601,846),7890=>array(56,-14,731,1028),7891=>array(55,-14,557,847),7892=>array(56,-14,731,1044),7893=>array(55,-14,592,862),7894=>array(56,-14,731,1057),7895=>array(55,-14,557,875),7896=>array(56,-183,731,928),7897=>array(55,-183,557,800),7898=>array(50,-14,764,927),7899=>array(58,-14,603,800),7900=>array(50,-14,764,927),7901=>array(58,-14,603,800),7902=>array(50,-14,764,992),7903=>array(58,-14,603,810),7904=>array(50,-14,764,921),7905=>array(58,-14,603,777),7906=>array(50,-183,764,760),7907=>array(58,-183,603,615),7908=>array(87,-183,645,729),7909=>array(85,-183,543,560),7910=>array(87,-14,645,992),7911=>array(85,-14,543,810),7912=>array(84,-4,796,927),7913=>array(86,-14,676,800),7914=>array(84,-4,796,927),7915=>array(86,-14,676,800),7916=>array(84,-4,796,992),7917=>array(86,-14,676,810),7918=>array(84,-4,796,921),7919=>array(86,-14,676,777),7920=>array(84,-183,796,760),7921=>array(86,-183,676,615),7922=>array(-2,0,613,931),7923=>array(30,-208,562,802),7924=>array(-2,-183,613,729),7925=>array(30,-208,562,547),7926=>array(-2,0,613,996),7927=>array(30,-208,562,813),7928=>array(-2,0,613,921),7929=>array(30,-208,562,777),7930=>array(98,0,764,729),7931=>array(16,0,462,760),7936=>array(55,-12,611,797),7937=>array(55,-12,611,797),7938=>array(55,-12,611,800),7939=>array(55,-12,611,800),7940=>array(55,-12,611,800),7941=>array(55,-12,611,800),7942=>array(55,-12,611,928),7943=>array(55,-12,611,928),7944=>array(8,0,676,797),7945=>array(8,0,676,797),7946=>array(2,0,869,800),7947=>array(3,0,869,800),7948=>array(3,0,761,800),7949=>array(2,0,793,800),7950=>array(3,0,700,928),7951=>array(2,0,734,928),7952=>array(65,-14,473,797),7953=>array(65,-14,473,797),7954=>array(65,-14,473,800),7955=>array(65,-14,473,800),7956=>array(65,-14,486,800),7957=>array(65,-14,501,800),7960=>array(3,0,647,797),7961=>array(3,0,647,797),7962=>array(2,0,902,800),7963=>array(3,0,911,800),7964=>array(3,0,834,800),7965=>array(2,0,864,800),7968=>array(91,-208,549,797),7969=>array(91,-208,549,797),7970=>array(91,-208,549,800),7971=>array(91,-208,549,800),7972=>array(91,-208,549,800),7973=>array(91,-208,549,800),7974=>array(91,-208,549,928),7975=>array(91,-208,549,928),7976=>array(3,0,739,797),7977=>array(3,0,737,797),7978=>array(2,0,988,800),7979=>array(3,0,991,800),7980=>array(3,0,929,800),7981=>array(2,0,953,800),7982=>array(3,0,835,928),7983=>array(2,0,849,928),7984=>array(76,0,304,797),7985=>array(71,0,304,797),7986=>array(-39,0,340,800),7987=>array(-34,0,347,800),7988=>array(2,0,362,800),7989=>array(-22,0,366,800),7990=>array(-26,0,304,928),7991=>array(-28,0,304,928),7992=>array(3,0,282,797),7993=>array(3,0,276,797),7994=>array(2,0,537,800),7995=>array(3,0,537,800),7996=>array(3,0,472,800),7997=>array(2,0,501,800),7998=>array(3,0,392,928),7999=>array(2,0,395,928),8000=>array(55,-14,557,797),8001=>array(55,-14,557,797),8002=>array(55,-14,557,800),8003=>array(55,-14,557,800),8004=>array(55,-14,557,800),8005=>array(55,-14,557,800),8008=>array(3,-14,748,797),8009=>array(3,-14,792,797),8010=>array(2,-14,1039,800),8011=>array(3,-14,1043,800),8012=>array(3,-14,882,800),8013=>array(2,-14,914,800),8016=>array(73,-14,521,797),8017=>array(73,-14,521,797),8018=>array(73,-14,521,800),8019=>array(73,-14,521,800),8020=>array(73,-14,521,800),8021=>array(73,-14,521,800),8022=>array(73,-14,521,928),8023=>array(73,-14,521,928),8025=>array(3,0,786,797),8027=>array(3,0,1000,800),8029=>array(2,0,1014,800),8031=>array(2,0,900,928),8032=>array(66,-14,769,797),8033=>array(66,-14,769,797),8034=>array(66,-14,769,800),8035=>array(66,-14,769,800),8036=>array(66,-14,769,800),8037=>array(66,-14,769,800),8038=>array(66,-14,769,928),8039=>array(66,-14,769,928),8040=>array(3,0,764,797),8041=>array(3,0,805,797),8042=>array(2,0,1051,800),8043=>array(3,0,1057,800),8044=>array(3,0,908,800),8045=>array(2,0,934,800),8046=>array(3,0,883,928),8047=>array(2,0,914,928),8048=>array(55,-12,611,800),8049=>array(55,-12,611,800),8050=>array(65,-14,473,800),8051=>array(65,-14,473,800),8052=>array(91,-208,549,800),8053=>array(91,-208,549,800),8054=>array(-56,0,304,800),8055=>array(81,0,324,800),8056=>array(55,-14,557,800),8057=>array(55,-14,557,800),8058=>array(73,-14,521,800),8059=>array(73,-14,521,800),8060=>array(66,-14,769,800),8061=>array(66,-14,769,800),8064=>array(55,-208,611,797),8065=>array(55,-208,611,797),8066=>array(55,-208,611,800),8067=>array(55,-208,611,800),8068=>array(55,-208,611,800),8069=>array(55,-208,611,800),8070=>array(55,-208,611,928),8071=>array(55,-208,611,928),8072=>array(8,-208,676,797),8073=>array(8,-208,676,797),8074=>array(2,-208,869,800),8075=>array(3,-208,869,800),8076=>array(3,-208,761,800),8077=>array(2,-208,793,800),8078=>array(3,-208,700,928),8079=>array(2,-208,734,928),8080=>array(91,-208,549,797),8081=>array(91,-208,549,797),8082=>array(91,-208,549,800),8083=>array(91,-208,549,800),8084=>array(91,-208,549,800),8085=>array(91,-208,549,800),8086=>array(91,-208,549,928),8087=>array(91,-208,549,928),8088=>array(3,-208,739,797),8089=>array(3,-208,737,797),8090=>array(2,-208,988,800),8091=>array(3,-208,991,800),8092=>array(3,-208,929,800),8093=>array(2,-208,953,800),8094=>array(3,-208,835,928),8095=>array(2,-208,849,928),8096=>array(66,-208,769,797),8097=>array(66,-208,769,797),8098=>array(66,-208,769,800),8099=>array(66,-208,769,800),8100=>array(66,-208,769,800),8101=>array(66,-208,769,800),8102=>array(66,-208,769,928),8103=>array(66,-208,769,928),8104=>array(3,-208,764,797),8105=>array(3,-208,805,797),8106=>array(2,-208,1051,800),8107=>array(3,-208,1057,800),8108=>array(3,-208,908,800),8109=>array(2,-208,934,800),8110=>array(3,-208,883,928),8111=>array(2,-208,914,928),8112=>array(55,-12,611,785),8113=>array(55,-12,611,745),8114=>array(55,-208,611,800),8115=>array(55,-208,611,559),8116=>array(55,-208,611,800),8118=>array(55,-12,611,777),8119=>array(55,-208,611,777),8120=>array(8,0,676,928),8121=>array(8,0,676,899),8122=>array(-2,0,708,800),8123=>array(8,0,676,800),8124=>array(8,-208,676,729),8125=>array(190,595,309,797),8126=>array(214,-208,321,-45),8127=>array(190,595,309,797),8128=>array(89,639,411,777),8129=>array(89,659,411,928),8130=>array(91,-208,549,800),8131=>array(91,-208,549,560),8132=>array(91,-208,549,800),8134=>array(91,-208,549,777),8135=>array(91,-208,549,777),8136=>array(-2,0,741,800),8137=>array(-12,0,682,800),8138=>array(-2,0,833,800),8139=>array(-6,0,765,800),8140=>array(98,-208,654,729),8141=>array(67,595,446,800),8142=>array(88,595,447,800),8143=>array(89,595,411,928),8144=>array(-10,0,304,785),8145=>array(-14,0,304,745),8146=>array(-20,0,304,978),8147=>array(2,0,313,978),8150=>array(-14,0,309,777),8151=>array(-13,0,310,928),8152=>array(-5,0,300,928),8153=>array(1,0,293,899),8154=>array(-2,0,377,800),8155=>array(-9,0,311,800),8157=>array(62,595,443,800),8158=>array(73,595,461,800),8159=>array(89,595,411,928),8160=>array(73,-14,521,785),8161=>array(73,-14,521,745),8162=>array(73,-14,521,978),8163=>array(73,-14,521,978),8164=>array(91,-208,580,797),8165=>array(91,-208,580,797),8166=>array(73,-14,521,777),8167=>array(73,-14,521,928),8168=>array(-2,0,613,928),8169=>array(-2,0,613,899),8170=>array(-2,0,847,800),8171=>array(-15,0,821,800),8172=>array(3,0,651,797),8173=>array(83,659,395,978),8174=>array(105,659,415,978),8175=>array(83,617,317,800),8178=>array(66,-208,769,800),8179=>array(66,-208,769,547),8180=>array(66,-208,769,800),8182=>array(66,-14,769,777),8183=>array(66,-208,769,777),8184=>array(-2,-14,885,800),8185=>array(-7,-14,750,800),8186=>array(-2,0,884,800),8187=>array(-18,0,752,800),8188=>array(38,-208,726,738),8189=>array(181,616,415,800),8190=>array(190,595,309,797),8208=>array(49,234,312,314),8209=>array(49,234,312,314),8210=>array(49,239,587,309),8211=>array(49,239,451,309),8212=>array(49,239,951,309),8213=>array(0,239,1000,309),8214=>array(127,-236,371,764),8215=>array(-10,-236,510,-9),8216=>array(85,489,228,729),8217=>array(87,499,230,729),8218=>array(85,-116,228,124),8219=>array(87,499,230,729),8220=>array(85,489,428,729),8221=>array(85,489,428,729),8222=>array(85,-116,428,124),8223=>array(85,489,428,729),8224=>array(28,-96,472,729),8225=>array(28,-96,472,729),8226=>array(150,227,440,516),8227=>array(150,188,479,555),8228=>array(115,0,219,124),8229=>array(115,0,552,124),8230=>array(115,0,885,124),8231=>array(107,302,210,426),8240=>array(55,-14,1287,742),8241=>array(55,-14,1681,742),8242=>array(20,547,203,729),8243=>array(20,547,350,729),8244=>array(20,547,496,729),8245=>array(20,547,203,729),8246=>array(20,547,350,729),8247=>array(20,547,496,729),8248=>array(5,-236,333,-30),8249=>array(77,69,306,517),8250=>array(94,69,323,517),8251=>array(95,2,740,725),8252=>array(72,0,414,729),8253=>array(72,0,461,742),8254=>array(-10,686,510,755),8255=>array(-43,-237,847,-60),8256=>array(-43,752,847,929),8257=>array(-42,-236,286,229),8258=>array(30,-29,970,814),8259=>array(108,313,400,421),8260=>array(-183,-14,350,742),8261=>array(86,-132,293,760),8262=>array(86,-132,293,760),8263=>array(36,0,886,742),8264=>array(72,0,661,742),8265=>array(72,0,661,742),8266=>array(49,-123,448,545),8267=>array(115,-96,566,729),8268=>array(105,220,395,509),8269=>array(105,220,395,509),8270=>array(30,-29,470,427),8271=>array(139,-116,282,517),8272=>array(-43,-237,847,929),8273=>array(30,-7,470,929),8274=>array(71,-93,408,729),8275=>array(49,228,951,399),8276=>array(-43,-240,847,-63),8277=>array(152,98,686,631),8278=>array(122,149,464,589),8279=>array(20,547,643,729),8280=>array(175,125,663,613),8281=>array(175,120,663,608),8282=>array(107,0,210,729),8283=>array(49,-138,749,867),8284=>array(55,0,783,729),8285=>array(107,39,210,655),8286=>array(107,8,210,683),8304=>array(42,319,366,742),8305=>array(60,326,116,751),8308=>array(31,326,369,734),8309=>array(50,319,353,734),8310=>array(45,319,369,742),8311=>array(53,326,354,734),8312=>array(43,319,365,742),8313=>array(41,319,364,742),8314=>array(67,326,461,677),8315=>array(67,479,461,525),8316=>array(67,422,461,581),8317=>array(54,252,195,751),8318=>array(50,252,191,751),8319=>array(57,326,346,640),8320=>array(42,-7,366,416),8321=>array(67,0,346,408),8322=>array(46,0,338,416),8323=>array(48,-7,350,416),8324=>array(31,0,369,408),8325=>array(50,-7,353,408),8326=>array(45,-7,369,416),8327=>array(53,0,354,408),8328=>array(43,-7,365,416),8329=>array(41,-7,364,416),8330=>array(67,0,461,351),8331=>array(67,152,461,199),8332=>array(67,96,461,254),8333=>array(54,-74,195,425),8334=>array(50,-74,191,425),8336=>array(38,-8,329,313),8337=>array(35,-8,354,313),8338=>array(35,-8,351,313),8339=>array(57,0,391,306),8340=>array(35,-8,354,313),8341=>array(57,0,346,425),8342=>array(57,0,363,425),8343=>array(60,0,116,425),8344=>array(57,0,560,313),8345=>array(57,0,346,313),8346=>array(57,-117,365,313),8347=>array(57,0,320,322),8348=>array(17,0,232,393),8352=>array(42,0,835,729),8353=>array(56,-44,593,778),8354=>array(47,-14,587,742),8355=>array(65,0,599,729),8356=>array(63,0,548,742),8357=>array(91,-93,889,640),8358=>array(57,0,691,729),8359=>array(98,-14,1226,729),8360=>array(98,-14,1025,729),8361=>array(29,0,960,729),8362=>array(46,-14,743,729),8363=>array(55,-156,619,760),8364=>array(0,-14,570,742),8365=>array(20,0,636,729),8366=>array(10,0,626,729),8367=>array(102,-222,1205,742),8368=>array(22,-14,569,742),8369=>array(33,0,579,729),8370=>array(45,-81,586,809),8371=>array(8,0,627,729),8372=>array(57,-14,717,742),8373=>array(81,-147,556,760),8376=>array(10,0,626,729),8377=>array(52,0,585,729),8378=>array(5,2,649,731),8400=>array(-491,635,-26,760),8401=>array(-470,635,-5,760),8406=>array(-470,560,-26,760),8407=>array(-470,560,-26,760),8411=>array(-491,560,-10,758),8412=>array(-586,560,86,758),8417=>array(-470,560,-26,760),8448=>array(33,-24,980,752),8449=>array(33,-24,999,752),8450=>array(56,-14,644,742),8451=>array(95,-14,1053,742),8452=>array(-21,0,637,729),8453=>array(29,-24,987,752),8454=>array(29,-24,1038,752),8455=>array(80,-14,560,742),8456=>array(54,-146,642,611),8457=>array(95,0,894,742),8459=>array(36,-14,943,748),8460=>array(1,-128,693,731),8461=>array(98,0,751,729),8462=>array(35,0,566,760),8463=>array(44,0,566,760),8464=>array(29,-15,432,742),8465=>array(52,-14,659,742),8466=>array(33,-14,679,743),8467=>array(-14,-14,353,742),8468=>array(16,-14,763,760),8469=>array(97,0,704,729),8470=>array(26,0,969,729),8471=>array(138,0,862,724),8472=>array(54,-221,658,495),8473=>array(98,0,666,729),8474=>array(56,-129,731,742),8475=>array(32,-9,764,774),8476=>array(41,-14,803,743),8477=>array(98,0,774,729),8478=>array(83,0,814,729),8479=>array(98,-107,666,847),8480=>array(126,443,770,730),8481=>array(-2,0,1023,547),8482=>array(144,447,784,729),8483=>array(8,-108,676,846),8484=>array(45,0,700,729),8485=>array(43,-213,523,760),8486=>array(38,0,726,738),8487=>array(38,-14,726,724),8488=>array(12,-149,573,783),8489=>array(33,0,255,547),8490=>array(98,0,677,729),8491=>array(8,0,676,928),8492=>array(45,0,734,772),8493=>array(63,-12,652,742),8494=>array(61,-12,793,647),8495=>array(42,-14,547,533),8496=>array(79,-14,565,742),8497=>array(41,-16,758,755),8498=>array(98,0,517,729),8499=>array(28,-28,1032,751),8500=>array(51,-12,411,395),8501=>array(50,-14,712,742),8502=>array(-2,-14,653,743),8503=>array(13,-35,407,742),8504=>array(42,-35,591,742),8505=>array(34,0,355,760),8506=>array(44,-21,915,654),8507=>array(74,0,1162,547),8508=>array(18,-8,685,547),8509=>array(0,-194,669,560),8510=>array(98,0,648,729),8511=>array(98,0,750,729),8512=>array(12,-192,791,719),8513=>array(80,-14,716,742),8514=>array(4,0,458,729),8515=>array(3,0,457,729),8516=>array(-2,0,613,729),8517=>array(42,0,786,729),8518=>array(44,-14,709,760),8519=>array(44,-14,572,560),8520=>array(39,0,313,760),8521=>array(-114,-208,313,760),8523=>array(29,-14,715,742),8526=>array(40,0,441,547),8528=>array(67,-14,922,742),8529=>array(67,-14,932,742),8530=>array(67,-14,1335,742),8531=>array(67,-14,918,742),8532=>array(46,-14,918,742),8533=>array(67,-14,921,742),8534=>array(46,-14,921,742),8535=>array(48,-14,921,742),8536=>array(31,-14,921,742),8537=>array(67,-14,937,742),8538=>array(50,-14,937,742),8539=>array(67,-14,933,742),8540=>array(48,-14,933,742),8541=>array(50,-14,933,742),8542=>array(53,-14,933,742),8543=>array(67,-14,751,742),8544=>array(98,0,197,729),8545=>array(98,0,394,729),8546=>array(98,0,591,729),8547=>array(98,0,915,729),8548=>array(8,0,676,729),8549=>array(8,0,824,729),8550=>array(8,0,1021,729),8551=>array(8,0,1219,729),8552=>array(98,0,886,729),8553=>array(30,0,654,729),8554=>array(30,0,835,729),8555=>array(30,0,1032,729),8556=>array(98,0,552,729),8557=>array(56,-14,644,742),8558=>array(98,0,711,729),8559=>array(98,0,765,729),8560=>array(94,0,184,760),8561=>array(94,0,364,760),8562=>array(94,0,543,760),8563=>array(94,0,782,760),8564=>array(30,0,562,547),8565=>array(30,0,717,760),8566=>array(30,0,897,760),8567=>array(30,0,1077,760),8568=>array(94,0,786,760),8569=>array(29,0,559,547),8570=>array(29,0,729,760),8571=>array(29,0,908,760),8572=>array(94,0,184,760),8573=>array(55,-14,488,560),8574=>array(55,-14,544,760),8575=>array(91,0,889,560),8576=>array(59,0,1186,729),8577=>array(98,0,711,729),8578=>array(59,0,1186,729),8579=>array(56,-14,644,742),8580=>array(62,-14,495,560),8581=>array(56,-208,644,742),8585=>array(42,-14,918,742),8592=>array(49,100,781,527),8593=>array(205,0,632,732),8594=>array(57,100,789,527),8595=>array(205,-3,632,729),8596=>array(49,100,789,527),8597=>array(205,-8,632,732),8598=>array(141,25,703,587),8599=>array(141,25,703,587),8600=>array(141,25,703,587),8601=>array(141,25,703,587),8602=>array(49,100,781,527),8603=>array(57,100,789,527),8604=>array(21,103,827,414),8605=>array(11,103,816,414),8606=>array(49,100,781,527),8607=>array(206,0,633,732),8608=>array(57,100,789,527),8609=>array(206,-3,633,729),8610=>array(49,100,781,527),8611=>array(57,100,789,527),8612=>array(49,100,781,527),8613=>array(206,0,632,732),8614=>array(57,100,789,527),8615=>array(206,-3,632,729),8616=>array(206,0,632,732),8617=>array(49,100,780,565),8618=>array(58,100,789,565),8619=>array(49,100,780,565),8620=>array(58,100,789,565),8621=>array(49,100,789,527),8622=>array(49,93,789,534),8623=>array(146,-2,702,730),8624=>array(169,0,629,743),8625=>array(209,0,669,743),8626=>array(169,-14,629,729),8627=>array(209,-14,669,729),8628=>array(233,-3,760,604),8629=>array(49,100,656,626),8630=>array(22,203,799,668),8631=>array(39,203,816,668),8632=>array(108,25,788,729),8633=>array(55,-46,783,673),8634=>array(103,62,762,680),8635=>array(77,62,736,680),8636=>array(49,272,781,527),8637=>array(49,100,781,355),8638=>array(377,0,632,732),8639=>array(205,0,460,732),8640=>array(57,272,789,527),8641=>array(57,100,789,355),8642=>array(377,0,632,732),8643=>array(205,0,460,732),8644=>array(49,-47,789,674),8645=>array(58,-3,779,732),8646=>array(49,-47,789,674),8647=>array(49,-47,781,674),8648=>array(59,0,779,732),8649=>array(58,-47,790,674),8650=>array(59,-3,779,729),8651=>array(49,7,789,620),8652=>array(49,7,789,620),8653=>array(49,100,781,527),8654=>array(49,94,789,533),8655=>array(57,100,789,527),8656=>array(49,100,781,527),8657=>array(206,0,633,732),8658=>array(57,100,789,527),8659=>array(206,-3,633,729),8660=>array(49,100,789,527),8661=>array(205,-8,633,732),8662=>array(141,-23,751,587),8663=>array(92,-23,703,587),8664=>array(92,25,703,636),8665=>array(141,25,751,636),8666=>array(49,100,781,527),8667=>array(57,100,789,527),8668=>array(49,100,781,527),8669=>array(57,100,789,527),8670=>array(205,0,632,732),8671=>array(205,-3,632,729),8672=>array(49,100,781,527),8673=>array(205,0,633,732),8674=>array(57,100,789,527),8675=>array(205,-3,633,729),8676=>array(52,99,781,528),8677=>array(57,99,786,528),8678=>array(27,65,781,562),8679=>array(171,0,667,754),8680=>array(35,65,789,562),8681=>array(171,-25,667,729),8682=>array(171,0,667,754),8683=>array(171,0,667,754),8684=>array(156,0,682,754),8685=>array(171,0,667,754),8686=>array(171,0,667,754),8687=>array(171,0,667,754),8688=>array(57,65,811,562),8689=>array(60,0,788,729),8690=>array(60,0,788,729),8691=>array(171,-25,667,754),8692=>array(57,100,789,527),8693=>array(58,-3,779,732),8694=>array(57,-193,789,820),8695=>array(49,94,781,533),8696=>array(57,94,789,533),8697=>array(49,94,789,533),8698=>array(49,94,781,533),8699=>array(57,94,789,533),8700=>array(49,94,789,533),8701=>array(27,96,781,531),8702=>array(57,96,811,531),8703=>array(27,96,811,531),8704=>array(8,0,676,729),8705=>array(66,-14,554,742),8706=>array(46,-14,471,662),8707=>array(98,0,568,729),8708=>array(98,-46,568,776),8709=>array(76,-10,795,710),8710=>array(-3,0,672,719),8711=>array(-3,0,672,719),8712=>array(85,-10,786,710),8713=>array(85,-138,786,835),8714=>array(106,76,612,550),8715=>array(85,-10,786,710),8716=>array(85,-138,786,835),8717=>array(106,76,612,550),8718=>array(146,0,490,485),8719=>array(76,-192,680,719),8720=>array(76,-192,680,719),8721=>array(12,-192,654,719),8722=>array(106,272,732,355),8723=>array(106,0,732,627),8724=>array(106,0,732,729),8725=>array(0,-93,337,729),8726=>array(192,-54,529,768),8727=>array(127,0,710,627),8728=>array(158,160,468,470),8729=>array(168,168,458,458),8730=>array(30,-20,637,811),8731=>array(30,-20,637,933),8732=>array(30,-20,637,924),8733=>array(107,112,607,487),8734=>array(107,112,726,487),8735=>array(138,99,700,661),8736=>array(85,0,786,729),8737=>array(85,-53,786,729),8738=>array(116,-3,732,727),8739=>array(211,-214,289,771),8740=>array(50,-214,451,771),8741=>array(133,-214,367,771),8742=>array(50,-214,451,771),8743=>array(129,0,603,579),8744=>array(129,0,603,579),8745=>array(129,0,603,579),8746=>array(129,0,603,579),8747=>array(57,-212,464,757),8748=>array(57,-212,732,757),8749=>array(57,-212,1000,757),8750=>array(57,-212,464,757),8751=>array(57,-212,732,757),8752=>array(57,-212,1000,757),8753=>array(57,-213,522,757),8754=>array(57,-212,514,757),8755=>array(57,-212,515,757),8756=>array(59,100,577,604),8757=>array(59,100,577,604),8758=>array(79,100,182,604),8759=>array(59,100,577,604),8760=>array(106,272,732,552),8761=>array(106,78,732,552),8762=>array(105,78,732,552),8763=>array(106,78,732,552),8764=>array(106,228,732,399),8765=>array(106,228,732,399),8766=>array(79,149,759,479),8767=>array(106,42,732,584),8768=>array(102,0,273,626),8769=>array(106,77,732,553),8770=>array(106,133,732,454),8771=>array(106,172,732,494),8772=>array(106,48,732,603),8773=>array(106,90,732,594),8774=>array(106,12,732,594),8775=>array(106,-5,732,657),8776=>array(106,133,732,494),8777=>array(106,2,732,625),8778=>array(106,90,732,598),8779=>array(106,59,732,602),8780=>array(106,90,732,594),8781=>array(105,105,732,521),8782=>array(106,26,732,601),8783=>array(106,172,732,601),8784=>array(106,172,732,625),8785=>array(106,1,732,625),8786=>array(106,2,733,625),8787=>array(106,2,733,625),8788=>array(101,151,899,476),8789=>array(100,151,900,475),8790=>array(106,172,732,454),8791=>array(106,172,732,760),8792=>array(106,172,732,662),8793=>array(106,172,732,812),8794=>array(106,172,732,812),8795=>array(106,172,732,849),8796=>array(106,172,732,854),8797=>array(106,172,732,764),8798=>array(106,172,732,760),8799=>array(106,172,732,856),8800=>array(106,19,732,608),8801=>array(106,90,732,537),8802=>array(106,-24,732,650),8803=>array(106,0,732,629),8804=>array(106,0,732,582),8805=>array(106,0,732,582),8806=>array(106,-83,732,638),8807=>array(106,-83,732,638),8808=>array(106,-164,732,638),8809=>array(106,-164,732,638),8810=>array(72,22,975,609),8811=>array(72,22,975,609),8812=>array(86,-132,378,759),8813=>array(105,13,732,613),8814=>array(106,2,732,674),8815=>array(106,-47,732,625),8816=>array(106,-102,732,667),8817=>array(106,-102,732,667),8818=>array(106,-55,732,582),8819=>array(106,-39,732,582),8820=>array(106,-105,732,664),8821=>array(106,-102,732,667),8822=>array(102,-87,732,686),8823=>array(102,-87,732,686),8824=>array(102,-197,732,797),8825=>array(102,-197,732,797),8826=>array(106,-38,732,664),8827=>array(106,-38,732,664),8828=>array(106,-105,732,667),8829=>array(106,-105,732,667),8830=>array(106,-85,732,667),8831=>array(106,-85,732,667),8832=>array(106,-61,732,764),8833=>array(106,-138,732,687),8834=>array(100,80,738,546),8835=>array(100,80,738,546),8836=>array(100,-96,738,726),8837=>array(100,-100,738,722),8838=>array(93,0,732,613),8839=>array(106,0,745,613),8840=>array(93,-116,732,730),8841=>array(106,-116,745,730),8842=>array(93,-73,732,614),8843=>array(93,-73,732,614),8844=>array(129,0,603,579),8845=>array(129,0,603,579),8846=>array(129,2,603,582),8847=>array(106,0,732,568),8848=>array(106,0,732,568),8849=>array(106,-83,732,630),8850=>array(106,-83,732,630),8851=>array(106,0,674,626),8852=>array(106,0,674,626),8853=>array(91,-14,747,643),8854=>array(91,-14,747,643),8855=>array(91,-14,747,643),8856=>array(91,-14,747,643),8857=>array(91,-14,747,643),8858=>array(91,-14,747,643),8859=>array(91,-14,747,643),8860=>array(91,-14,747,643),8861=>array(91,-14,747,643),8862=>array(91,-14,747,643),8863=>array(91,-14,747,643),8864=>array(91,-14,747,643),8865=>array(91,-14,747,643),8866=>array(85,0,786,700),8867=>array(85,0,786,700),8868=>array(85,0,786,700),8869=>array(85,0,786,700),8870=>array(85,0,436,700),8871=>array(85,0,436,700),8872=>array(85,0,786,700),8873=>array(85,0,786,700),8874=>array(85,0,786,700),8875=>array(85,0,786,700),8876=>array(85,-40,786,740),8877=>array(85,-40,786,740),8878=>array(85,-40,786,740),8879=>array(85,-40,786,740),8880=>array(106,-43,724,670),8881=>array(106,-43,724,670),8882=>array(106,15,732,612),8883=>array(106,15,732,612),8884=>array(106,-48,732,674),8885=>array(106,-48,732,674),8886=>array(59,175,941,454),8887=>array(59,175,941,454),8888=>array(48,175,790,454),8889=>array(59,-47,779,674),8890=>array(116,0,404,701),8891=>array(98,0,634,740),8892=>array(98,0,634,740),8893=>array(98,0,634,740),8894=>array(138,0,700,562),8895=>array(138,0,700,562),8896=>array(-3,-192,823,719),8897=>array(-3,-192,823,719),8898=>array(68,-192,752,719),8899=>array(68,-192,752,719),8900=>array(3,-233,491,807),8901=>array(107,285,210,409),8902=>array(122,149,504,512),8903=>array(106,15,732,613),8904=>array(106,-30,894,657),8905=>array(106,-30,894,657),8906=>array(106,-30,894,657),8907=>array(106,-30,894,657),8908=>array(106,-30,894,657),8909=>array(106,172,732,494),8910=>array(48,0,684,579),8911=>array(48,0,684,579),8912=>array(93,-3,732,630),8913=>array(106,-3,745,630),8914=>array(103,0,735,663),8915=>array(103,-14,735,649),8916=>array(186,0,652,729),8917=>array(106,-100,732,729),8918=>array(106,46,732,581),8919=>array(106,46,732,581),8920=>array(72,22,1350,609),8921=>array(72,22,1350,609),8922=>array(106,-228,732,854),8923=>array(106,-228,732,854),8924=>array(106,0,732,582),8925=>array(106,0,732,582),8926=>array(106,-105,732,667),8927=>array(106,-105,732,667),8928=>array(106,-178,732,764),8929=>array(106,-178,732,764),8930=>array(106,-141,732,767),8931=>array(106,-141,732,767),8932=>array(106,-94,732,619),8933=>array(106,-94,732,619),8934=>array(106,-138,732,582),8935=>array(106,-138,732,582),8936=>array(106,-169,732,667),8937=>array(110,-171,736,667),8938=>array(106,-130,732,756),8939=>array(106,-130,732,756),8940=>array(106,-189,732,815),8941=>array(104,-189,730,815),8942=>array(448,-93,551,715),8943=>array(115,249,884,373),8944=>array(115,-93,884,715),8945=>array(115,-93,884,715),8946=>array(43,-10,957,710),8947=>array(85,-10,786,710),8948=>array(106,76,612,550),8949=>array(85,-10,786,910),8950=>array(85,-10,786,853),8951=>array(106,76,612,686),8952=>array(85,-144,786,710),8953=>array(85,-10,786,710),8954=>array(43,-10,957,710),8955=>array(85,-10,786,710),8956=>array(106,76,612,550),8957=>array(85,-10,786,853),8958=>array(106,76,612,686),8959=>array(106,0,765,720),8960=>array(36,-18,567,514),8961=>array(56,162,540,443),8962=>array(71,0,563,596),8963=>array(205,481,632,732),8964=>array(205,0,632,251),8965=>array(205,0,632,406),8966=>array(205,0,632,513),8967=>array(154,-29,334,788),8968=>array(86,-132,293,760),8969=>array(97,-132,304,760),8970=>array(86,-132,293,760),8971=>array(97,-132,304,760),8972=>array(369,-77,759,313),8973=>array(49,-77,439,313),8974=>array(369,243,759,634),8975=>array(49,243,439,634),8976=>array(106,140,732,421),8977=>array(3,126,510,634),8984=>array(121,0,879,759),8985=>array(106,140,732,421),8988=>array(86,425,403,760),8989=>array(65,425,383,760),8990=>array(86,-70,403,264),8991=>array(65,-70,383,264),8992=>array(210,-250,497,928),8993=>array(21,-237,307,942),8996=>array(76,227,1076,575),8997=>array(76,0,1076,575),8998=>array(76,0,1414,760),8999=>array(76,0,1076,760),9000=>array(59,0,1385,729),9003=>array(0,0,1338,760),9004=>array(73,-91,800,748),9075=>array(81,0,304,547),9076=>array(91,-208,580,560),9077=>array(66,-14,769,547),9082=>array(55,-12,611,559),9085=>array(13,-228,745,102),9095=>array(76,0,1096,748),9108=>array(17,0,856,727),9115=>array(86,-252,414,946),9116=>array(86,-252,181,942),9117=>array(86,-240,414,942),9118=>array(86,-252,414,946),9119=>array(319,-252,414,942),9120=>array(86,-240,414,942),9121=>array(86,-252,414,928),9122=>array(86,-252,181,942),9123=>array(86,-240,414,942),9124=>array(86,-252,414,928),9125=>array(319,-252,414,935),9126=>array(86,-240,414,935),9127=>array(330,-261,668,928),9128=>array(82,-252,420,940),9129=>array(330,-240,668,940),9130=>array(330,-256,420,943),9131=>array(82,-261,420,928),9132=>array(330,-252,668,940),9133=>array(82,-240,420,940),9134=>array(210,-250,307,942),9166=>array(27,65,781,729),9167=>array(91,0,854,596),9187=>array(73,-91,800,748),9189=>array(3,75,766,444),9192=>array(43,-129,601,294),9250=>array(-62,-14,580,760),9251=>array(71,-228,563,102),9312=>array(74,-10,822,738),9313=>array(74,-10,822,738),9314=>array(74,-10,822,738),9315=>array(74,-10,822,738),9316=>array(74,-10,822,738),9317=>array(74,-10,822,738),9318=>array(74,-10,822,738),9319=>array(74,-10,822,738),9320=>array(74,-10,822,738),9321=>array(74,-10,822,738),9472=>array(-10,242,612,326),9473=>array(-10,200,612,368),9474=>array(262,-302,340,973),9475=>array(223,-302,379,973),9476=>array(-10,242,612,326),9477=>array(-10,200,612,368),9478=>array(262,-302,340,973),9479=>array(223,-302,379,973),9480=>array(-10,242,612,326),9481=>array(-10,200,612,368),9482=>array(262,-302,340,973),9483=>array(223,-302,379,973),9484=>array(262,-302,612,326),9485=>array(262,-302,612,368),9486=>array(223,-302,612,326),9487=>array(223,-302,612,368),9488=>array(-10,-302,340,326),9489=>array(-10,-302,340,368),9490=>array(-10,-302,379,326),9491=>array(-10,-302,379,368),9492=>array(262,242,612,973),9493=>array(262,200,612,973),9494=>array(223,242,612,973),9495=>array(223,200,612,973),9496=>array(-10,242,340,973),9497=>array(-10,200,340,973),9498=>array(-10,242,379,973),9499=>array(-10,200,379,973),9500=>array(262,-302,612,973),9501=>array(262,-302,612,973),9502=>array(223,-302,612,973),9503=>array(223,-302,612,973),9504=>array(223,-302,612,973),9505=>array(223,-302,612,973),9506=>array(223,-302,612,973),9507=>array(223,-302,612,973),9508=>array(-10,-302,340,973),9509=>array(-10,-302,340,973),9510=>array(-10,-302,379,973),9511=>array(-10,-302,379,973),9512=>array(-10,-302,379,973),9513=>array(-10,-302,379,973),9514=>array(-10,-302,379,973),9515=>array(-10,-302,379,973),9516=>array(-10,-302,612,326),9517=>array(-10,-302,612,368),9518=>array(-10,-302,612,368),9519=>array(-10,-302,612,368),9520=>array(-10,-302,612,326),9521=>array(-10,-302,612,368),9522=>array(-10,-302,612,368),9523=>array(-10,-302,612,368),9524=>array(-10,242,612,973),9525=>array(-10,200,612,973),9526=>array(-10,200,612,973),9527=>array(-10,200,612,973),9528=>array(-10,242,612,973),9529=>array(-10,200,612,973),9530=>array(-10,200,612,973),9531=>array(-10,200,612,973),9532=>array(-10,-302,612,973),9533=>array(-10,-302,612,973),9534=>array(-10,-302,612,973),9535=>array(-10,-302,612,973),9536=>array(-10,-302,612,973),9537=>array(-10,-302,612,973),9538=>array(-10,-302,612,973),9539=>array(-10,-302,612,973),9540=>array(-10,-302,612,973),9541=>array(-10,-302,612,973),9542=>array(-10,-302,612,973),9543=>array(-10,-302,612,973),9544=>array(-10,-302,612,973),9545=>array(-10,-302,612,973),9546=>array(-10,-302,612,973),9547=>array(-10,-302,612,973),9548=>array(-10,242,612,326),9549=>array(-10,200,612,368),9550=>array(262,-302,340,973),9551=>array(223,-302,379,973),9552=>array(-10,158,612,410),9553=>array(184,-302,418,973),9554=>array(262,-302,612,410),9555=>array(184,-302,612,326),9556=>array(184,-302,612,410),9557=>array(-10,-302,340,410),9558=>array(-10,-302,418,326),9559=>array(-10,-302,418,410),9560=>array(262,158,612,973),9561=>array(184,242,612,973),9562=>array(184,158,612,973),9563=>array(-10,158,340,973),9564=>array(-10,242,418,973),9565=>array(-10,158,418,973),9566=>array(262,-302,612,973),9567=>array(184,-302,612,973),9568=>array(184,-302,612,973),9569=>array(-10,-302,340,973),9570=>array(-10,-302,418,973),9571=>array(-10,-302,418,973),9572=>array(-10,-302,612,410),9573=>array(-10,-302,612,326),9574=>array(-10,-302,612,410),9575=>array(-10,158,612,973),9576=>array(-10,242,612,973),9577=>array(-10,158,612,973),9578=>array(-10,-302,612,973),9579=>array(-10,-302,612,973),9580=>array(-10,-302,612,973),9581=>array(262,-302,612,326),9582=>array(-10,-302,340,326),9583=>array(-10,242,340,973),9584=>array(262,242,612,973),9585=>array(-53,-302,655,973),9586=>array(-53,-302,655,973),9587=>array(-53,-302,655,973),9588=>array(-10,242,311,326),9589=>array(262,284,340,973),9590=>array(311,242,612,326),9591=>array(262,-302,340,284),9592=>array(-10,200,311,368),9593=>array(223,284,379,973),9594=>array(311,200,612,368),9595=>array(223,-302,379,284),9596=>array(-10,200,612,368),9597=>array(223,-302,379,973),9598=>array(-10,200,612,368),9599=>array(223,-302,379,973),9600=>array(-10,260,779,770),9601=>array(-10,-250,779,-123),9602=>array(-10,-250,779,-5),9603=>array(-10,-250,779,132),9604=>array(-10,-250,779,260),9605=>array(-10,-250,779,387),9606=>array(-10,-250,779,515),9607=>array(-10,-250,779,642),9608=>array(-10,-250,779,770),9609=>array(-10,-250,680,770),9610=>array(-10,-250,582,770),9611=>array(-10,-250,483,770),9612=>array(-10,-250,384,770),9613=>array(-10,-250,286,770),9614=>array(-10,-250,187,770),9615=>array(-10,-250,88,770),9616=>array(384,-250,778,770),9617=>array(-10,-250,680,770),9618=>array(-10,-250,775,770),9619=>array(-10,-250,779,770),9620=>array(-10,642,779,770),9621=>array(680,-250,778,770),9622=>array(-10,-250,385,260),9623=>array(384,-250,779,260),9624=>array(-10,260,385,770),9625=>array(-10,-250,779,770),9626=>array(-10,-250,779,770),9627=>array(-10,-250,779,770),9628=>array(-10,-250,779,770),9629=>array(384,260,779,770),9630=>array(-10,-250,779,770),9631=>array(-10,-250,779,770),9632=>array(91,-123,854,643),9633=>array(91,-123,854,643),9634=>array(91,-123,854,643),9635=>array(91,-123,854,643),9636=>array(91,-123,854,643),9637=>array(91,-123,854,643),9638=>array(91,-123,854,643),9639=>array(91,-123,854,643),9640=>array(91,-123,854,643),9641=>array(91,-123,854,643),9642=>array(91,11,587,509),9643=>array(91,11,587,509),9644=>array(91,75,854,444),9645=>array(91,75,854,444),9646=>array(91,-122,459,642),9647=>array(91,-122,459,642),9648=>array(3,75,766,444),9649=>array(3,75,766,444),9650=>array(3,-123,766,643),9651=>array(3,-123,766,643),9652=>array(3,11,499,509),9653=>array(3,11,499,509),9654=>array(3,-123,766,643),9655=>array(3,-123,766,643),9656=>array(3,11,499,509),9657=>array(3,11,499,509),9658=>array(3,11,766,509),9659=>array(3,11,766,509),9660=>array(3,-123,766,643),9661=>array(3,-123,766,643),9662=>array(3,11,499,509),9663=>array(3,11,499,509),9664=>array(3,-123,766,643),9665=>array(3,-123,766,643),9666=>array(3,11,499,509),9667=>array(3,11,499,509),9668=>array(3,11,766,509),9669=>array(3,11,766,509),9670=>array(3,-123,766,643),9671=>array(3,-123,766,643),9672=>array(3,-123,766,643),9673=>array(55,-125,818,645),9674=>array(3,-233,491,807),9675=>array(55,-125,818,645),9676=>array(56,-125,817,644),9677=>array(55,-125,818,645),9678=>array(55,-125,818,645),9679=>array(55,-123,818,641),9680=>array(55,-123,818,641),9681=>array(55,-123,818,641),9682=>array(55,-123,818,641),9683=>array(55,-123,818,641),9684=>array(55,-123,818,641),9685=>array(55,-123,818,641),9686=>array(55,-125,436,645),9687=>array(91,-125,472,645),9688=>array(91,-10,700,770),9689=>array(91,-250,879,770),9690=>array(91,260,879,770),9691=>array(91,-250,879,260),9692=>array(3,260,384,645),9693=>array(3,260,384,645),9694=>array(3,-125,384,260),9695=>array(3,-125,384,260),9696=>array(55,260,818,645),9697=>array(55,-125,818,260),9698=>array(3,-123,766,643),9699=>array(3,-123,766,643),9700=>array(3,-123,766,643),9701=>array(3,-123,766,643),9702=>array(150,227,440,516),9703=>array(91,-123,854,643),9704=>array(91,-123,854,643),9705=>array(91,-123,854,643),9706=>array(91,-123,854,643),9707=>array(91,-123,854,643),9708=>array(3,-123,766,643),9709=>array(3,-123,766,643),9710=>array(3,-123,766,643),9711=>array(55,-250,1064,770),9712=>array(91,-123,854,643),9713=>array(91,-123,854,643),9714=>array(91,-123,854,643),9715=>array(91,-123,854,643),9716=>array(55,-123,818,641),9717=>array(55,-123,818,641),9718=>array(55,-123,818,641),9719=>array(55,-123,818,641),9720=>array(3,-123,766,643),9721=>array(3,-123,766,643),9722=>array(3,-123,766,643),9723=>array(91,-66,739,585),9724=>array(91,-66,739,585),9725=>array(91,-17,642,537),9726=>array(91,-17,642,537),9727=>array(3,-123,766,643),9728=>array(83,0,813,729),9729=>array(51,-2,949,360),9730=>array(49,0,848,729),9731=>array(83,-0,813,927),9732=>array(64,0,833,880),9733=>array(65,-4,832,723),9734=>array(65,-4,832,723),9735=>array(83,2,490,729),9736=>array(83,0,813,731),9737=>array(83,0,813,730),9738=>array(61,0,828,727),9739=>array(61,0,828,723),9740=>array(61,-1,610,722),9741=>array(61,0,952,723),9742=>array(68,0,1177,729),9743=>array(71,0,1180,729),9744=>array(90,0,807,729),9745=>array(89,0,808,729),9746=>array(89,0,808,729),9747=>array(75,78,457,656),9748=>array(49,0,870,933),9749=>array(74,0,822,731),9750=>array(84,0,813,731),9751=>array(84,0,813,727),9752=>array(78,0,819,729),9753=>array(83,140,813,574),9754=>array(84,113,813,569),9755=>array(84,113,813,569),9756=>array(87,104,810,569),9757=>array(72,0,537,724),9758=>array(86,103,810,569),9759=>array(72,-3,537,720),9760=>array(61,0,835,730),9761=>array(84,0,813,730),9762=>array(83,0,813,730),9763=>array(49,0,848,730),9764=>array(49,-2,620,727),9765=>array(83,0,663,731),9766=>array(83,-1,566,731),9767=>array(83,0,701,911),9768=>array(83,0,462,730),9769=>array(83,-1,813,729),9770=>array(87,0,810,730),9771=>array(83,0,814,731),9772=>array(83,0,627,731),9773=>array(83,0,813,730),9774=>array(83,0,813,730),9775=>array(83,0,813,730),9776=>array(83,0,813,729),9777=>array(83,0,814,729),9778=>array(83,0,813,729),9779=>array(83,0,813,729),9780=>array(83,0,813,729),9781=>array(83,0,813,729),9782=>array(83,0,813,729),9783=>array(83,0,813,729),9784=>array(66,-11,831,735),9785=>array(83,-73,959,804),9786=>array(83,-73,959,804),9787=>array(83,-73,959,804),9788=>array(83,0,813,730),9789=>array(358,0,814,730),9790=>array(83,0,539,730),9791=>array(85,-102,528,732),9792=>array(85,-125,647,731),9793=>array(85,-14,647,843),9794=>array(79,-14,831,720),9795=>array(166,0,730,730),9796=>array(219,0,677,730),9797=>array(121,0,774,730),9798=>array(127,0,769,730),9799=>array(240,0,656,730),9800=>array(45,0,851,731),9801=>array(89,0,807,730),9802=>array(94,0,802,731),9803=>array(113,31,784,679),9804=>array(140,0,756,730),9805=>array(53,-180,843,730),9806=>array(83,52,813,653),9807=>array(34,-96,863,730),9808=>array(83,-0,813,730),9809=>array(94,0,802,730),9810=>array(86,153,810,579),9811=>array(157,0,739,730),9812=>array(98,0,798,730),9813=>array(110,0,786,730),9814=>array(167,-1,729,729),9815=>array(214,0,683,730),9816=>array(165,0,732,730),9817=>array(148,-0,748,730),9818=>array(98,0,798,730),9819=>array(110,0,786,730),9820=>array(167,-1,729,729),9821=>array(214,0,683,730),9822=>array(162,0,734,730),9823=>array(148,-0,748,730),9824=>array(158,0,738,729),9825=>array(90,0,806,727),9826=>array(168,0,728,729),9827=>array(111,0,785,729),9828=>array(157,0,739,729),9829=>array(89,0,808,729),9830=>array(168,0,728,729),9831=>array(111,0,785,732),9832=>array(105,-1,791,729),9833=>array(84,-5,339,729),9834=>array(84,-5,554,729),9835=>array(184,-102,712,729),9836=>array(92,-5,804,729),9837=>array(88,-3,392,731),9838=>array(84,0,273,731),9839=>array(84,0,400,731),9840=>array(84,0,664,731),9841=>array(64,0,701,731),9842=>array(84,0,813,709),9843=>array(76,16,820,731),9844=>array(76,16,820,731),9845=>array(76,16,820,731),9846=>array(76,16,820,731),9847=>array(76,16,820,731),9848=>array(76,16,820,731),9849=>array(76,16,820,731),9850=>array(76,16,820,731),9851=>array(84,0,812,704),9852=>array(83,0,814,731),9853=>array(83,0,814,731),9854=>array(83,0,814,731),9855=>array(149,1,747,731),9856=>array(73,0,797,725),9857=>array(73,0,797,725),9858=>array(73,0,797,725),9859=>array(73,0,797,725),9860=>array(73,0,797,725),9861=>array(73,0,797,725),9862=>array(83,0,813,731),9863=>array(83,0,813,731),9864=>array(83,0,813,731),9865=>array(83,0,813,731),9866=>array(83,0,813,98),9867=>array(83,0,813,98),9868=>array(83,0,813,413),9869=>array(83,0,813,413),9870=>array(83,0,813,413),9871=>array(83,0,813,413),9872=>array(168,3,728,731),9873=>array(168,3,728,731),9874=>array(52,0,844,731),9875=>array(97,-10,799,732),9876=>array(131,0,765,729),9877=>array(61,-10,479,732),9878=>array(59,-10,837,732),9879=>array(61,0,835,732),9880=>array(145,0,750,732),9881=>array(95,-17,802,727),9882=>array(128,-9,768,733),9883=>array(127,0,769,728),9884=>array(127,0,769,729),9888=>array(49,0,848,729),9889=>array(83,2,619,730),9890=>array(85,-125,919,731),9891=>array(79,-206,1023,720),9892=>array(85,-186,1109,856),9893=>array(85,-125,837,917),9894=>array(131,-14,727,869),9895=>array(101,-170,741,884),9896=>array(188,-14,650,869),9897=>array(4,133,829,596),9898=>array(187,133,651,596),9899=>array(187,133,651,596),9900=>array(247,194,591,537),9901=>array(174,194,664,537),9902=>array(41,169,797,560),9903=>array(5,194,833,536),9904=>array(103,237,757,540),9905=>array(211,42,626,698),9906=>array(85,-125,647,731),9907=>array(168,-125,646,731),9908=>array(86,-125,646,731),9909=>array(86,-125,646,731),9910=>array(59,-118,791,643),9911=>array(194,-104,595,710),9912=>array(158,-125,543,731),9920=>array(42,4,796,553),9921=>array(42,4,796,724),9922=>array(42,4,796,553),9923=>array(42,4,796,724),9954=>array(85,-14,647,843),9985=>array(11,190,803,635),9986=>array(42,141,784,588),9987=>array(11,94,803,539),9988=>array(36,119,824,613),9990=>array(42,-14,796,742),9991=>array(42,-14,796,742),9992=>array(59,21,782,708),9993=>array(64,107,773,622),9996=>array(212,0,561,742),9997=>array(21,83,802,678),9998=>array(89,75,724,710),9999=>array(26,198,819,530),10000=>array(89,75,724,710),10001=>array(43,185,757,544),10002=>array(67,209,757,520),10003=>array(150,97,667,630),10004=>array(116,87,721,631),10005=>array(126,72,711,657),10006=>array(85,31,752,698),10007=>array(118,-9,701,732),10008=>array(123,0,754,739),10009=>array(55,0,783,729),10010=>array(55,0,783,729),10011=>array(55,0,783,729),10012=>array(55,0,783,729),10013=>array(165,0,673,729),10014=>array(131,0,678,729),10015=>array(155,0,683,729),10016=>array(55,0,783,729),10017=>array(91,-13,747,744),10018=>array(41,-14,797,742),10019=>array(42,-12,796,742),10020=>array(41,-14,797,742),10021=>array(41,-13,797,743),10022=>array(42,-14,796,745),10023=>array(42,-14,796,745),10025=>array(23,-10,815,744),10026=>array(42,-14,796,742),10027=>array(23,-9,814,743),10028=>array(23,-10,815,744),10029=>array(23,-9,814,743),10030=>array(23,-9,814,743),10031=>array(23,-9,814,743),10032=>array(24,12,815,714),10033=>array(64,0,773,729),10034=>array(74,0,764,729),10035=>array(55,0,783,729),10036=>array(31,-14,787,742),10037=>array(41,-14,797,742),10038=>array(91,-14,747,742),10039=>array(41,-14,797,742),10040=>array(41,-14,797,742),10041=>array(41,-14,797,742),10042=>array(55,0,783,729),10043=>array(82,-14,756,742),10044=>array(82,-14,756,742),10045=>array(79,-14,759,742),10046=>array(79,-14,759,742),10047=>array(54,0,784,709),10048=>array(54,0,784,709),10049=>array(41,-14,797,742),10050=>array(42,-14,796,742),10051=>array(79,-14,759,742),10052=>array(89,0,749,729),10053=>array(76,0,762,729),10054=>array(63,2,773,729),10055=>array(79,-13,759,742),10056=>array(47,-13,791,730),10057=>array(47,-13,791,730),10058=>array(41,-13,797,743),10059=>array(41,-13,797,743),10061=>array(50,-10,847,738),10063=>array(60,-49,837,729),10064=>array(60,0,837,777),10065=>array(60,-49,837,729),10066=>array(60,0,837,777),10070=>array(83,-2,813,728),10072=>array(377,-240,460,760),10073=>array(336,-240,502,760),10074=>array(253,-240,585,760),10075=>array(85,395,264,729),10076=>array(59,395,237,729),10077=>array(85,395,479,729),10078=>array(59,395,453,729),10081=>array(155,-93,772,851),10082=>array(202,-17,636,742),10083=>array(163,-17,675,742),10084=>array(54,83,784,645),10085=>array(168,-1,729,729),10086=>array(62,21,724,702),10087=>array(78,169,759,564),10088=>array(196,-139,648,769),10089=>array(196,-139,648,769),10090=>array(264,-132,574,758),10091=>array(264,-132,574,758),10092=>array(215,-240,607,760),10093=>array(232,-240,623,760),10094=>array(142,-240,685,760),10095=>array(153,-240,696,760),10096=>array(167,-240,656,760),10097=>array(183,-240,672,760),10098=>array(346,-241,535,760),10099=>array(303,-241,492,760),10100=>array(175,-163,634,760),10101=>array(204,-163,663,760),10102=>array(74,-10,822,738),10103=>array(74,-10,822,738),10104=>array(74,-10,822,738),10105=>array(74,-10,822,738),10106=>array(74,-10,822,738),10107=>array(74,-10,822,738),10108=>array(74,-10,822,738),10109=>array(74,-10,822,738),10110=>array(74,-10,822,738),10111=>array(74,-10,822,738),10112=>array(4,-52,833,780),10113=>array(4,-52,833,780),10114=>array(4,-52,833,780),10115=>array(4,-52,833,780),10116=>array(4,-52,833,780),10117=>array(4,-52,833,780),10118=>array(4,-52,833,780),10119=>array(4,-52,833,780),10120=>array(4,-52,833,780),10121=>array(4,-52,833,780),10122=>array(4,-52,833,780),10123=>array(4,-52,833,780),10124=>array(4,-52,833,780),10125=>array(4,-52,833,780),10126=>array(4,-52,833,780),10127=>array(4,-52,833,780),10128=>array(4,-52,833,780),10129=>array(4,-52,833,780),10130=>array(4,-52,833,780),10131=>array(4,-52,833,780),10132=>array(57,75,789,552),10136=>array(123,55,682,614),10137=>array(57,100,789,527),10138=>array(123,13,682,572),10139=>array(57,129,789,498),10140=>array(57,57,764,570),10141=>array(57,100,789,527),10142=>array(57,100,789,527),10143=>array(57,100,789,527),10144=>array(57,100,789,527),10145=>array(57,65,811,562),10146=>array(111,94,789,533),10147=>array(111,94,789,533),10148=>array(111,-4,789,631),10149=>array(57,100,789,548),10150=>array(57,79,789,527),10151=>array(240,-7,606,634),10152=>array(57,100,789,527),10153=>array(57,75,765,552),10154=>array(57,75,765,552),10155=>array(21,12,794,586),10156=>array(21,12,794,586),10157=>array(135,0,774,574),10158=>array(135,0,774,574),10159=>array(62,49,799,574),10161=>array(62,49,799,574),10162=>array(154,-20,721,585),10163=>array(63,157,789,470),10164=>array(81,55,682,655),10165=>array(57,173,789,454),10166=>array(82,-29,682,572),10167=>array(82,55,682,655),10168=>array(57,172,789,455),10169=>array(82,-28,682,572),10170=>array(56,84,789,543),10171=>array(73,140,779,487),10172=>array(79,167,774,460),10173=>array(79,118,774,509),10174=>array(57,81,789,546),10181=>array(54,-163,352,769),10182=>array(39,-163,336,769),10208=>array(3,-233,491,807),10214=>array(86,-132,398,760),10215=>array(85,-132,398,760),10216=>array(89,-132,310,759),10217=>array(80,-132,301,759),10218=>array(89,-132,476,759),10219=>array(80,-132,467,759),10224=>array(44,0,794,732),10225=>array(43,-3,793,729),10226=>array(39,53,814,658),10227=>array(39,61,814,666),10228=>array(57,-14,1108,643),10229=>array(49,100,1376,527),10230=>array(57,100,1385,527),10231=>array(49,100,1385,527),10232=>array(49,100,1376,527),10233=>array(57,100,1385,527),10234=>array(49,100,1385,527),10235=>array(49,100,1376,527),10236=>array(57,100,1385,527),10237=>array(49,100,1376,527),10238=>array(57,100,1385,527),10239=>array(57,100,1385,527),10241=>array(146,635,293,781),10242=>array(146,358,293,504),10243=>array(146,358,293,781),10244=>array(146,82,293,228),10245=>array(146,82,293,781),10246=>array(146,82,293,504),10247=>array(146,82,293,781),10248=>array(439,635,586,781),10249=>array(146,635,586,781),10250=>array(146,358,586,781),10251=>array(146,358,586,781),10252=>array(146,82,586,781),10253=>array(146,82,586,781),10254=>array(146,82,586,781),10255=>array(146,82,586,781),10256=>array(439,358,586,504),10257=>array(146,358,586,781),10258=>array(146,358,586,504),10259=>array(146,358,586,781),10260=>array(146,82,586,504),10261=>array(146,82,586,781),10262=>array(146,82,586,504),10263=>array(146,82,586,781),10264=>array(439,358,586,781),10265=>array(146,358,586,781),10266=>array(146,358,586,781),10267=>array(146,358,586,781),10268=>array(146,82,586,781),10269=>array(146,82,586,781),10270=>array(146,82,586,781),10271=>array(146,82,586,781),10272=>array(439,82,586,228),10273=>array(146,82,586,781),10274=>array(146,82,586,504),10275=>array(146,82,586,781),10276=>array(146,82,586,228),10277=>array(146,82,586,781),10278=>array(146,82,586,504),10279=>array(146,82,586,781),10280=>array(439,82,586,781),10281=>array(146,82,586,781),10282=>array(146,82,586,781),10283=>array(146,82,586,781),10284=>array(146,82,586,781),10285=>array(146,82,586,781),10286=>array(146,82,586,781),10287=>array(146,82,586,781),10288=>array(439,82,586,504),10289=>array(146,82,586,781),10290=>array(146,82,586,504),10291=>array(146,82,586,781),10292=>array(146,82,586,504),10293=>array(146,82,586,781),10294=>array(146,82,586,504),10295=>array(146,82,586,781),10296=>array(439,82,586,781),10297=>array(146,82,586,781),10298=>array(146,82,586,781),10299=>array(146,82,586,781),10300=>array(146,82,586,781),10301=>array(146,82,586,781),10302=>array(146,82,586,781),10303=>array(146,82,586,781),10304=>array(146,-195,293,-49),10305=>array(146,-195,293,781),10306=>array(146,-195,293,504),10307=>array(146,-195,293,781),10308=>array(146,-195,293,228),10309=>array(146,-195,293,781),10310=>array(146,-195,293,504),10311=>array(146,-195,293,781),10312=>array(146,-195,586,781),10313=>array(146,-195,586,781),10314=>array(146,-195,586,781),10315=>array(146,-195,586,781),10316=>array(146,-195,586,781),10317=>array(146,-195,586,781),10318=>array(146,-195,586,781),10319=>array(146,-195,586,781),10320=>array(146,-195,586,504),10321=>array(146,-195,586,781),10322=>array(146,-195,586,504),10323=>array(146,-195,586,781),10324=>array(146,-195,586,504),10325=>array(146,-195,586,781),10326=>array(146,-195,586,504),10327=>array(146,-195,586,781),10328=>array(146,-195,586,781),10329=>array(146,-195,586,781),10330=>array(146,-195,586,781),10331=>array(146,-195,586,781),10332=>array(146,-195,586,781),10333=>array(146,-195,586,781),10334=>array(146,-195,586,781),10335=>array(146,-195,586,781),10336=>array(146,-195,586,228),10337=>array(146,-195,586,781),10338=>array(146,-195,586,504),10339=>array(146,-195,586,781),10340=>array(146,-195,586,228),10341=>array(146,-195,586,781),10342=>array(146,-195,586,504),10343=>array(146,-195,586,781),10344=>array(146,-195,586,781),10345=>array(146,-195,586,781),10346=>array(146,-195,586,781),10347=>array(146,-195,586,781),10348=>array(146,-195,586,781),10349=>array(146,-195,586,781),10350=>array(146,-195,586,781),10351=>array(146,-195,586,781),10352=>array(146,-195,586,504),10353=>array(146,-195,586,781),10354=>array(146,-195,586,504),10355=>array(146,-195,586,781),10356=>array(146,-195,586,504),10357=>array(146,-195,586,781),10358=>array(146,-195,586,504),10359=>array(146,-195,586,781),10360=>array(146,-195,586,781),10361=>array(146,-195,586,781),10362=>array(146,-195,586,781),10363=>array(146,-195,586,781),10364=>array(146,-195,586,781),10365=>array(146,-195,586,781),10366=>array(146,-195,586,781),10367=>array(146,-195,586,781),10368=>array(439,-195,586,-49),10369=>array(146,-195,586,781),10370=>array(146,-195,586,504),10371=>array(146,-195,586,781),10372=>array(146,-195,586,228),10373=>array(146,-195,586,781),10374=>array(146,-195,586,504),10375=>array(146,-195,586,781),10376=>array(439,-195,586,781),10377=>array(146,-195,586,781),10378=>array(146,-195,586,781),10379=>array(146,-195,586,781),10380=>array(146,-195,586,781),10381=>array(146,-195,586,781),10382=>array(146,-195,586,781),10383=>array(146,-195,586,781),10384=>array(439,-195,586,504),10385=>array(146,-195,586,781),10386=>array(146,-195,586,504),10387=>array(146,-195,586,781),10388=>array(146,-195,586,504),10389=>array(146,-195,586,781),10390=>array(146,-195,586,504),10391=>array(146,-195,586,781),10392=>array(439,-195,586,781),10393=>array(146,-195,586,781),10394=>array(146,-195,586,781),10395=>array(146,-195,586,781),10396=>array(146,-195,586,781),10397=>array(146,-195,586,781),10398=>array(146,-195,586,781),10399=>array(146,-195,586,781),10400=>array(439,-195,586,228),10401=>array(146,-195,586,781),10402=>array(146,-195,586,504),10403=>array(146,-195,586,781),10404=>array(146,-195,586,228),10405=>array(146,-195,586,781),10406=>array(146,-195,586,504),10407=>array(146,-195,586,781),10408=>array(439,-195,586,781),10409=>array(146,-195,586,781),10410=>array(146,-195,586,781),10411=>array(146,-195,586,781),10412=>array(146,-195,586,781),10413=>array(146,-195,586,781),10414=>array(146,-195,586,781),10415=>array(146,-195,586,781),10416=>array(439,-195,586,504),10417=>array(146,-195,586,781),10418=>array(146,-195,586,504),10419=>array(146,-195,586,781),10420=>array(146,-195,586,504),10421=>array(146,-195,586,781),10422=>array(146,-195,586,504),10423=>array(146,-195,586,781),10424=>array(439,-195,586,781),10425=>array(146,-195,586,781),10426=>array(146,-195,586,781),10427=>array(146,-195,586,781),10428=>array(146,-195,586,781),10429=>array(146,-195,586,781),10430=>array(146,-195,586,781),10431=>array(146,-195,586,781),10432=>array(146,-195,586,-49),10433=>array(146,-195,586,781),10434=>array(146,-195,586,504),10435=>array(146,-195,586,781),10436=>array(146,-195,586,228),10437=>array(146,-195,586,781),10438=>array(146,-195,586,504),10439=>array(146,-195,586,781),10440=>array(146,-195,586,781),10441=>array(146,-195,586,781),10442=>array(146,-195,586,781),10443=>array(146,-195,586,781),10444=>array(146,-195,586,781),10445=>array(146,-195,586,781),10446=>array(146,-195,586,781),10447=>array(146,-195,586,781),10448=>array(146,-195,586,504),10449=>array(146,-195,586,781),10450=>array(146,-195,586,504),10451=>array(146,-195,586,781),10452=>array(146,-195,586,504),10453=>array(146,-195,586,781),10454=>array(146,-195,586,504),10455=>array(146,-195,586,781),10456=>array(146,-195,586,781),10457=>array(146,-195,586,781),10458=>array(146,-195,586,781),10459=>array(146,-195,586,781),10460=>array(146,-195,586,781),10461=>array(146,-195,586,781),10462=>array(146,-195,586,781),10463=>array(146,-195,586,781),10464=>array(146,-195,586,228),10465=>array(146,-195,586,781),10466=>array(146,-195,586,504),10467=>array(146,-195,586,781),10468=>array(146,-195,586,228),10469=>array(146,-195,586,781),10470=>array(146,-195,586,504),10471=>array(146,-195,586,781),10472=>array(146,-195,586,781),10473=>array(146,-195,586,781),10474=>array(146,-195,586,781),10475=>array(146,-195,586,781),10476=>array(146,-195,586,781),10477=>array(146,-195,586,781),10478=>array(146,-195,586,781),10479=>array(146,-195,586,781),10480=>array(146,-195,586,504),10481=>array(146,-195,586,781),10482=>array(146,-195,586,504),10483=>array(146,-195,586,781),10484=>array(146,-195,586,504),10485=>array(146,-195,586,781),10486=>array(146,-195,586,504),10487=>array(146,-195,586,781),10488=>array(146,-195,586,781),10489=>array(146,-195,586,781),10490=>array(146,-195,586,781),10491=>array(146,-195,586,781),10492=>array(146,-195,586,781),10493=>array(146,-195,586,781),10494=>array(146,-195,586,781),10495=>array(146,-195,586,781),10502=>array(49,100,781,527),10503=>array(57,100,789,527),10506=>array(125,0,713,732),10507=>array(125,-3,713,729),10560=>array(39,63,644,838),10561=>array(39,63,644,838),10627=>array(125,-163,609,760),10628=>array(125,-163,609,760),10702=>array(106,-226,732,747),10703=>array(106,15,894,612),10704=>array(106,15,894,612),10705=>array(106,-30,894,657),10706=>array(106,-30,894,657),10707=>array(106,-30,894,657),10708=>array(106,-30,894,657),10709=>array(106,-30,894,657),10731=>array(3,-233,491,807),10746=>array(106,0,732,627),10747=>array(106,0,732,627),10752=>array(28,-198,972,748),10753=>array(28,-198,972,748),10754=>array(28,-198,972,748),10764=>array(57,-212,1268,757),10765=>array(57,-212,464,757),10766=>array(57,-212,464,757),10767=>array(57,-212,464,757),10768=>array(57,-212,464,757),10769=>array(57,-212,522,757),10770=>array(57,-212,464,757),10771=>array(57,-212,464,757),10772=>array(57,-212,555,757),10773=>array(57,-212,464,757),10774=>array(57,-212,464,757),10775=>array(-32,-212,553,757),10776=>array(57,-212,464,757),10777=>array(57,-212,464,757),10778=>array(57,-212,464,757),10779=>array(57,-212,469,872),10780=>array(52,-327,464,757),10799=>array(137,31,701,596),10858=>array(106,228,732,552),10859=>array(106,78,732,552),10877=>array(106,-123,732,581),10878=>array(106,-123,732,581),10879=>array(106,-123,733,581),10880=>array(106,-123,732,581),10881=>array(106,-123,732,644),10882=>array(106,-123,732,644),10883=>array(106,-123,733,759),10884=>array(106,-123,732,756),10885=>array(106,-132,732,663),10886=>array(106,-132,732,663),10887=>array(106,-121,732,582),10888=>array(106,-121,732,582),10889=>array(106,-204,732,663),10890=>array(106,-204,732,663),10891=>array(106,-311,732,791),10892=>array(106,-311,732,791),10893=>array(106,-124,732,663),10894=>array(106,-124,732,663),10895=>array(106,-241,732,756),10896=>array(106,-241,732,756),10897=>array(106,-229,732,730),10898=>array(106,-229,732,730),10899=>array(106,-224,732,741),10900=>array(106,-224,732,741),10901=>array(106,-61,732,644),10902=>array(106,-61,732,644),10903=>array(106,-61,733,644),10904=>array(106,-61,732,644),10905=>array(106,-36,732,685),10906=>array(106,-36,732,685),10907=>array(106,-31,732,725),10908=>array(106,-31,732,725),10909=>array(106,8,732,645),10910=>array(106,23,732,645),10911=>array(106,-176,732,729),10912=>array(106,-176,732,729),10926=>array(106,50,732,601),10927=>array(106,-24,732,667),10928=>array(106,-24,732,667),10929=>array(106,-145,732,667),10930=>array(106,-145,732,667),10931=>array(106,-121,732,662),10932=>array(106,-121,732,662),10933=>array(106,-195,732,662),10934=>array(106,-195,732,662),10935=>array(106,-191,732,693),10936=>array(106,-191,732,693),10937=>array(106,-259,732,693),10938=>array(106,-259,732,693),11001=>array(106,-171,732,585),11002=>array(106,-171,732,585),11008=>array(88,-27,703,587),11009=>array(141,-27,755,587),11010=>array(88,25,703,640),11011=>array(141,25,755,640),11012=>array(27,65,789,562),11013=>array(27,65,781,562),11014=>array(171,0,667,754),11015=>array(171,-25,667,729),11016=>array(88,-27,703,587),11017=>array(141,-27,755,587),11018=>array(88,25,703,640),11019=>array(141,25,755,640),11020=>array(27,65,789,562),11021=>array(171,-25,667,754),11022=>array(57,-3,790,355),11023=>array(57,272,790,630),11024=>array(35,-3,768,355),11025=>array(35,272,768,630),11026=>array(91,-123,854,643),11027=>array(91,-123,854,643),11028=>array(91,-123,854,643),11029=>array(91,-123,854,643),11030=>array(3,-123,766,643),11031=>array(3,-123,766,643),11032=>array(3,-123,766,643),11033=>array(3,-123,766,643),11034=>array(91,-123,854,643),11039=>array(18,-26,852,767),11040=>array(18,-26,852,767),11041=>array(73,-91,800,748),11042=>array(73,-91,800,748),11043=>array(17,-35,856,692),11044=>array(55,-250,1064,770),11091=>array(38,-47,832,788),11092=>array(38,-47,832,788),11360=>array(5,0,552,729),11361=>array(5,0,271,760),11362=>array(-20,0,552,729),11363=>array(5,0,569,729),11364=>array(98,-200,666,729),11365=>array(35,-46,576,592),11366=>array(-12,-93,384,822),11367=>array(98,-157,752,729),11368=>array(91,-138,639,760),11369=>array(98,-157,677,729),11370=>array(91,-138,576,760),11371=>array(45,-157,738,729),11372=>array(43,-138,572,547),11373=>array(56,-14,683,743),11374=>array(98,-200,765,729),11375=>array(8,0,676,729),11376=>array(56,-14,683,743),11377=>array(30,0,734,560),11378=>array(33,0,1128,742),11379=>array(42,0,961,560),11380=>array(51,0,562,587),11381=>array(98,0,555,729),11382=>array(94,0,477,547),11383=>array(55,-12,602,551),11385=>array(0,-13,320,760),11386=>array(55,-14,557,560),11387=>array(48,0,400,547),11388=>array(-11,-117,116,425),11389=>array(5,326,426,734),11390=>array(66,-242,598,742),11391=>array(45,-242,640,729),11520=>array(60,-63,544,547),11521=>array(24,-235,556,546),11522=>array(39,-235,535,546),11523=>array(62,-10,572,807),11524=>array(51,-235,537,546),11525=>array(39,-236,862,546),11526=>array(0,-8,575,816),11527=>array(53,0,900,546),11528=>array(69,0,542,546),11529=>array(51,-235,556,816),11530=>array(39,0,903,546),11531=>array(53,-8,595,816),11532=>array(39,0,544,816),11533=>array(51,0,887,546),11534=>array(51,0,556,546),11535=>array(69,-235,767,816),11536=>array(51,0,880,816),11537=>array(51,0,545,816),11538=>array(50,-235,536,546),11539=>array(51,-235,884,661),11540=>array(60,-235,892,546),11541=>array(49,-235,784,816),11542=>array(39,0,545,546),11543=>array(51,-235,556,547),11544=>array(51,-235,551,546),11545=>array(39,-235,541,816),11546=>array(42,-235,532,547),11547=>array(60,-9,596,816),11548=>array(39,-235,870,547),11549=>array(29,-235,545,546),11550=>array(47,-235,547,546),11551=>array(34,-235,547,567),11552=>array(39,0,875,546),11553=>array(49,-235,544,816),11554=>array(60,0,538,626),11555=>array(61,-235,553,816),11556=>array(51,-235,603,546),11557=>array(60,-8,841,816),11568=>array(55,-14,591,380),11569=>array(56,-14,832,742),11570=>array(56,-14,832,742),11571=>array(31,0,651,729),11572=>array(33,0,652,729),11573=>array(31,0,604,729),11574=>array(73,0,488,729),11575=>array(8,0,676,729),11576=>array(8,0,676,729),11577=>array(98,0,568,729),11578=>array(64,0,534,729),11579=>array(73,-14,609,742),11580=>array(107,0,811,729),11581=>array(45,0,665,729),11582=>array(73,0,437,729),11583=>array(45,0,665,729),11584=>array(56,-14,832,742),11585=>array(56,-52,832,781),11586=>array(73,0,197,729),11587=>array(20,0,610,729),11588=>array(98,0,654,729),11589=>array(30,0,654,729),11590=>array(73,0,454,729),11591=>array(45,0,629,729),11592=>array(73,301,571,426),11593=>array(98,0,568,729),11594=>array(54,0,448,729),11595=>array(54,-15,899,742),11596=>array(54,0,725,729),11597=>array(98,0,650,729),11598=>array(100,0,566,729),11599=>array(98,0,197,729),11600=>array(54,0,725,729),11601=>array(98,0,198,729),11602=>array(78,-14,705,729),11603=>array(48,-14,584,742),11604=>array(56,-14,832,742),11605=>array(56,-54,832,742),11606=>array(98,0,654,729),11607=>array(98,0,222,729),11608=>array(73,0,676,729),11609=>array(56,-14,832,742),11610=>array(56,-14,832,780),11611=>array(56,-14,681,742),11612=>array(49,0,719,729),11613=>array(30,0,654,729),11614=>array(56,-14,681,742),11615=>array(98,0,568,729),11616=>array(8,0,676,729),11617=>array(98,0,654,729),11618=>array(98,0,559,729),11619=>array(56,0,732,729),11620=>array(98,0,495,729),11621=>array(56,0,732,729),11631=>array(26,522,489,729),11800=>array(70,-14,459,728),11806=>array(106,78,732,399),11810=>array(86,403,293,760),11811=>array(97,403,304,760),11812=>array(86,-132,293,225),11813=>array(97,-132,304,225),11822=>array(72,0,461,742),19904=>array(83,-158,813,729),19905=>array(83,-158,813,729),19906=>array(83,-158,813,729),19907=>array(83,-158,813,729),19908=>array(83,-158,813,729),19909=>array(83,-158,813,729),19910=>array(83,-158,813,729),19911=>array(83,-158,813,729),19912=>array(83,-158,813,729),19913=>array(83,-158,814,729),19914=>array(83,-158,813,729),19915=>array(83,-158,813,729),19916=>array(83,-158,813,729),19917=>array(83,-158,813,729),19918=>array(83,-158,813,729),19919=>array(83,-158,813,729),19920=>array(83,-158,814,729),19921=>array(83,-158,813,729),19922=>array(83,-158,814,729),19923=>array(83,-158,813,729),19924=>array(83,-158,813,729),19925=>array(83,-158,813,729),19926=>array(83,-158,813,729),19927=>array(83,-158,813,729),19928=>array(83,-158,813,729),19929=>array(83,-158,813,729),19930=>array(83,-158,813,729),19931=>array(83,-158,814,729),19932=>array(83,-158,813,729),19933=>array(83,-158,813,729),19934=>array(83,-158,814,729),19935=>array(83,-158,813,729),19936=>array(83,-158,813,729),19937=>array(83,-158,813,729),19938=>array(83,-158,813,729),19939=>array(83,-158,813,729),19940=>array(83,-158,813,729),19941=>array(83,-158,814,729),19942=>array(83,-158,813,729),19943=>array(83,-158,813,729),19944=>array(83,-158,814,729),19945=>array(83,-158,813,729),19946=>array(83,-158,814,729),19947=>array(83,-158,813,729),19948=>array(83,-158,814,729),19949=>array(83,-158,813,729),19950=>array(83,-158,814,729),19951=>array(83,-158,813,729),19952=>array(83,-158,814,729),19953=>array(83,-158,813,729),19954=>array(83,-158,813,729),19955=>array(83,-158,813,729),19956=>array(83,-158,813,729),19957=>array(83,-158,814,729),19958=>array(83,-158,813,729),19959=>array(83,-158,813,729),19960=>array(83,-158,813,729),19961=>array(83,-158,814,729),19962=>array(83,-158,813,729),19963=>array(83,-158,814,729),19964=>array(83,-158,814,729),19965=>array(83,-158,813,729),19966=>array(83,-158,813,729),19967=>array(83,-158,813,729),42192=>array(98,0,615,729),42193=>array(98,0,569,729),42194=>array(34,0,505,729),42195=>array(98,0,711,729),42196=>array(-3,0,614,729),42197=>array(-3,0,614,729),42198=>array(56,-14,693,742),42199=>array(98,0,677,729),42200=>array(-21,0,558,729),42201=>array(0,-14,414,729),42202=>array(56,-14,644,742),42203=>array(56,-14,644,742),42204=>array(45,0,640,729),42205=>array(98,0,517,729),42206=>array(98,0,517,729),42207=>array(98,0,765,729),42208=>array(98,0,650,729),42209=>array(98,0,552,729),42210=>array(66,-14,579,742),42211=>array(98,0,666,729),42212=>array(29,0,597,729),42213=>array(8,0,676,729),42214=>array(8,0,676,729),42215=>array(98,0,654,729),42216=>array(80,-14,716,742),42217=>array(98,0,512,743),42218=>array(33,0,956,729),42219=>array(30,0,654,729),42220=>array(-2,0,613,729),42221=>array(71,0,588,729),42222=>array(8,0,676,729),42223=>array(8,0,676,729),42224=>array(98,0,568,729),42225=>array(64,0,534,729),42226=>array(98,0,197,729),42227=>array(56,-14,731,742),42228=>array(87,-14,645,729),42229=>array(87,0,645,743),42230=>array(4,0,458,729),42231=>array(56,0,669,729),42232=>array(85,0,214,155),42233=>array(71,-156,214,155),42234=>array(85,0,511,155),42235=>array(85,-156,511,155),42236=>array(71,-156,214,517),42237=>array(85,0,214,517),42238=>array(85,0,502,354),42239=>array(85,172,502,454),42564=>array(56,-14,569,742),42565=>array(49,-14,467,560),42566=>array(98,0,347,729),42567=>array(81,0,304,547),42572=>array(58,-14,1122,645),42573=>array(74,-14,954,471),42576=>array(29,0,931,729),42577=>array(30,0,817,560),42580=>array(56,-14,977,742),42581=>array(55,-14,748,560),42582=>array(103,0,968,729),42583=>array(94,-14,752,560),42594=>array(49,-157,1004,729),42595=>array(52,-138,863,547),42596=>array(41,0,1008,729),42597=>array(37,0,852,547),42598=>array(98,0,1120,729),42599=>array(91,0,959,547),42600=>array(56,-14,731,742),42601=>array(55,-14,557,560),42602=>array(56,-14,799,742),42603=>array(55,-14,658,560),42604=>array(56,-14,1302,742),42605=>array(55,-14,964,560),42606=>array(28,-208,851,743),42634=>array(-3,-200,758,729),42635=>array(29,-208,660,547),42636=>array(-3,0,614,729),42637=>array(29,0,553,547),42644=>array(85,0,587,729),42645=>array(91,0,549,760),42760=>array(104,0,389,668),42761=>array(104,0,389,668),42762=>array(104,0,389,668),42763=>array(104,0,389,668),42764=>array(104,0,389,668),42765=>array(104,0,389,668),42766=>array(104,0,389,668),42767=>array(104,0,389,668),42768=>array(104,0,389,668),42769=>array(104,0,389,668),42770=>array(104,0,389,668),42771=>array(104,0,389,668),42772=>array(104,0,389,668),42773=>array(104,0,389,668),42774=>array(104,0,389,668),42779=>array(50,326,319,736),42780=>array(50,324,319,734),42781=>array(95,326,158,734),42782=>array(95,326,158,734),42783=>array(95,0,158,408),42786=>array(67,0,350,729),42787=>array(67,0,321,547),42788=>array(56,224,411,742),42789=>array(56,42,411,560),42790=>array(98,-200,654,729),42791=>array(91,-208,549,760),42792=>array(-3,-213,819,729),42793=>array(27,-213,650,702),42794=>array(80,-14,560,742),42795=>array(65,-200,473,561),42800=>array(91,0,437,547),42801=>array(54,-14,472,560),42802=>array(8,0,1241,729),42803=>array(60,-14,894,560),42804=>array(8,-14,1147,742),42805=>array(60,-14,935,560),42806=>array(8,-14,1055,729),42807=>array(60,-14,890,560),42808=>array(8,0,963,729),42809=>array(60,-14,788,560),42810=>array(8,0,963,729),42811=>array(60,-14,788,560),42812=>array(8,-208,951,729),42813=>array(60,-208,788,560),42814=>array(56,-14,644,742),42815=>array(62,-14,495,560),42816=>array(5,0,677,729),42817=>array(7,0,580,760),42822=>array(98,0,675,729),42823=>array(94,0,298,760),42824=>array(41,0,576,729),42825=>array(59,0,368,760),42826=>array(5,-14,802,742),42827=>array(5,-14,694,560),42830=>array(56,-14,1302,742),42831=>array(55,-14,964,560),42832=>array(5,0,569,729),42833=>array(-2,-208,580,560),42834=>array(24,0,700,729),42835=>array(24,-208,720,560),42838=>array(56,-178,731,742),42839=>array(55,-208,637,560),42852=>array(5,0,569,729),42853=>array(-2,-208,580,760),42854=>array(5,0,569,729),42855=>array(-2,-208,580,760),42880=>array(5,0,459,729),42881=>array(94,-208,184,560),42882=>array(98,-208,637,742),42883=>array(91,-208,549,560),42889=>array(117,0,220,517),42890=>array(78,161,298,380),42891=>array(151,235,250,729),42892=>array(96,458,179,729),42893=>array(85,0,587,729),42894=>array(38,-208,416,760),42896=>array(98,-157,733,729),42897=>array(91,-138,621,560),42912=>array(2,-14,778,742),42913=>array(2,-208,633,560),42914=>array(2,0,677,729),42915=>array(2,0,577,760),42916=>array(2,0,746,729),42917=>array(2,0,633,560),42918=>array(2,0,693,729),42919=>array(2,0,411,560),42920=>array(2,-14,633,742),42921=>array(2,-14,519,560),42922=>array(-51,0,703,729),43002=>array(91,0,824,547),43003=>array(58,0,477,729),43004=>array(34,0,505,729),43005=>array(98,0,765,729),43006=>array(98,0,197,928),43007=>array(33,0,1167,729),61184=>array(95,602,323,668),61185=>array(69,451,342,668),61186=>array(54,301,361,668),61187=>array(47,150,368,668),61188=>array(44,0,372,668),61189=>array(69,451,342,668),61190=>array(95,451,323,518),61191=>array(69,301,342,518),61192=>array(54,150,361,518),61193=>array(47,0,368,518),61194=>array(54,301,361,668),61195=>array(69,301,342,518),61196=>array(95,301,323,367),61197=>array(69,150,342,367),61198=>array(54,0,361,367),61199=>array(47,150,368,668),61200=>array(54,150,361,518),61201=>array(69,150,342,367),61202=>array(95,150,323,217),61203=>array(69,0,342,217),61204=>array(44,0,372,668),61205=>array(47,0,368,518),61206=>array(54,0,361,367),61207=>array(69,0,342,217),61208=>array(95,0,323,66),61209=>array(104,0,171,668),61440=>array(73,0,903,732),61441=>array(73,0,903,732),61442=>array(73,0,903,732),61443=>array(73,0,903,732),62464=>array(54,-15,526,828),62465=>array(54,-15,526,828),62466=>array(54,-15,570,837),62467=>array(54,0,835,837),62468=>array(54,-15,526,837),62469=>array(54,-15,526,837),62470=>array(54,-15,599,837),62471=>array(54,-15,828,837),62472=>array(54,0,501,837),62473=>array(54,-15,526,828),62474=>array(54,0,1115,837),62475=>array(54,-15,525,837),62476=>array(63,-15,536,828),62477=>array(54,0,815,837),62478=>array(54,-15,526,828),62479=>array(54,-15,526,844),62480=>array(54,0,860,837),62481=>array(63,-15,536,828),62482=>array(54,-15,677,837),62483=>array(24,-15,519,837),62484=>array(54,-15,818,837),62485=>array(54,-15,526,828),62486=>array(54,-15,841,837),62487=>array(54,-15,525,829),62488=>array(54,-15,525,837),62489=>array(64,0,536,837),62490=>array(55,-15,595,828),62491=>array(54,-15,525,828),62492=>array(64,-15,536,837),62493=>array(54,-15,545,828),62494=>array(63,-15,536,828),62495=>array(24,-15,492,837),62496=>array(54,-15,526,837),62497=>array(59,-15,530,837),62498=>array(54,-79,526,837),62499=>array(54,-15,525,838),62500=>array(54,-15,532,838),62501=>array(54,-15,594,837),62502=>array(54,-15,901,838),62504=>array(60,-235,872,816),62505=>array(49,-230,759,853),62506=>array(49,-15,459,765),62507=>array(49,-15,459,777),62508=>array(49,-15,459,875),62509=>array(49,-15,459,818),62510=>array(49,-15,459,887),62511=>array(49,-15,459,809),62512=>array(49,-236,449,765),62513=>array(49,-236,449,799),62514=>array(49,-236,449,901),62515=>array(49,-236,449,809),62516=>array(49,0,469,765),62517=>array(49,0,469,799),62518=>array(49,0,469,809),62519=>array(49,-0,737,765),62520=>array(49,-0,737,777),62521=>array(49,-0,737,895),62522=>array(49,-0,737,799),62523=>array(49,-0,737,809),62524=>array(29,-236,488,765),62525=>array(29,-236,488,777),62526=>array(29,-236,488,904),62527=>array(29,-236,488,799),62528=>array(29,-236,488,809),62529=>array(29,-236,488,852),63173=>array(55,-14,557,760),64256=>array(23,0,708,760),64257=>array(23,0,536,760),64258=>array(23,0,536,760),64259=>array(23,0,873,760),64260=>array(23,0,873,760),64261=>array(23,0,662,760),64262=>array(54,-14,837,742),64275=>array(83,-14,1111,760),64276=>array(85,-14,1111,760),64277=>array(85,-208,1111,760),64278=>array(85,-208,1111,760),64279=>array(85,-208,1451,760),64285=>array(66,44,157,547),64286=>array(167,625,473,765),64287=>array(36,44,329,547),64288=>array(38,0,562,547),64289=>array(85,0,772,547),64290=>array(43,0,717,547),64291=>array(91,0,764,547),64292=>array(43,0,716,547),64293=>array(43,0,716,760),64294=>array(91,0,764,547),64295=>array(43,0,716,547),64296=>array(47,-4,716,547),64297=>array(106,272,732,627),64298=>array(43,0,666,698),64299=>array(38,0,666,698),64300=>array(43,0,666,698),64301=>array(43,0,666,698),64302=>array(91,-159,578,547),64303=>array(91,-193,578,547),64304=>array(91,-159,578,547),64305=>array(43,0,535,547),64306=>array(43,-5,383,547),64307=>array(43,0,511,547),64308=>array(91,0,563,547),64309=>array(43,0,265,547),64310=>array(43,0,363,547),64312=>array(90,-14,593,552),64313=>array(43,204,264,547),64314=>array(43,-208,446,547),64315=>array(43,0,474,547),64316=>array(43,0,492,729),64318=>array(43,0,588,555),64320=>array(43,0,309,547),64321=>array(90,-14,593,547),64323=>array(91,-208,549,547),64324=>array(91,0,569,547),64326=>array(43,0,502,547),64327=>array(91,-208,633,546),64328=>array(43,0,474,547),64329=>array(43,0,666,547),64330=>array(10,-4,566,547),64331=>array(91,0,182,698),64332=>array(43,0,535,698),64333=>array(43,0,474,698),64334=>array(91,0,569,698),64335=>array(43,0,571,760),64338=>array(63,-244,865,327),64339=>array(63,-244,992,327),64340=>array(-10,-244,191,293),64341=>array(-10,-244,312,293),64342=>array(63,-244,865,327),64343=>array(63,-244,992,327),64344=>array(-10,-244,244,293),64345=>array(-10,-244,312,293),64346=>array(63,-244,865,327),64347=>array(63,-244,992,327),64348=>array(-10,-244,244,293),64349=>array(-10,-244,312,293),64350=>array(63,-10,865,513),64351=>array(63,-10,992,513),64352=>array(-10,0,191,610),64353=>array(-10,0,312,610),64354=>array(63,-10,865,513),64355=>array(63,-10,992,513),64356=>array(-10,0,244,610),64357=>array(-10,0,312,610),64358=>array(63,-10,865,575),64359=>array(63,-10,992,575),64360=>array(-10,0,273,672),64361=>array(-10,0,312,672),64362=>array(63,-45,952,757),64363=>array(63,-44,1045,659),64364=>array(-10,0,406,757),64365=>array(-10,0,516,684),64366=>array(63,-45,952,757),64367=>array(63,-44,1045,659),64368=>array(-10,0,406,757),64369=>array(-10,0,516,684),64370=>array(77,-244,645,425),64371=>array(77,-244,655,425),64372=>array(-10,-220,545,398),64373=>array(-10,-220,655,398),64374=>array(77,-244,645,425),64375=>array(77,-244,655,425),64376=>array(-10,-98,545,398),64377=>array(-10,-98,655,398),64378=>array(77,-244,645,425),64379=>array(77,-244,655,425),64380=>array(-10,-220,545,398),64381=>array(-10,-220,655,398),64382=>array(77,-244,645,425),64383=>array(77,-244,655,425),64384=>array(-10,-220,545,398),64385=>array(-10,-220,655,398),64386=>array(61,-146,388,415),64387=>array(61,-146,535,415),64388=>array(61,-19,388,586),64389=>array(61,-19,535,586),64390=>array(61,-19,388,708),64391=>array(61,-19,535,708),64392=>array(61,-19,388,746),64393=>array(61,-19,535,746),64394=>array(-42,-244,439,586),64395=>array(-42,-244,562,586),64396=>array(-42,-244,469,648),64397=>array(-42,-244,562,648),64398=>array(63,-43,895,760),64399=>array(63,-43,981,760),64400=>array(-10,0,476,760),64401=>array(-10,0,562,760),64402=>array(63,-43,895,896),64403=>array(63,-43,981,896),64404=>array(-10,0,476,896),64405=>array(-10,0,562,896),64406=>array(63,-293,895,896),64407=>array(63,-293,981,896),64408=>array(-10,-269,476,896),64409=>array(-10,-269,562,896),64410=>array(63,-43,895,903),64411=>array(63,-43,981,903),64412=>array(-10,0,476,903),64413=>array(-10,0,562,903),64414=>array(72,-162,660,366),64415=>array(72,-244,771,284),64416=>array(72,-162,660,636),64417=>array(72,-244,771,514),64418=>array(-10,0,273,672),64419=>array(-10,0,312,672),64426=>array(70,-33,638,487),64427=>array(70,-244,642,333),64428=>array(-10,-33,467,487),64429=>array(-10,-244,471,333),64467=>array(70,-27,722,854),64468=>array(70,-27,853,854),64469=>array(-10,0,476,928),64470=>array(-10,0,562,928),64473=>array(-42,-244,406,556),64474=>array(-42,-244,526,556),64488=>array(-10,0,191,293),64489=>array(-10,0,312,293),64508=>array(63,-131,719,411),64509=>array(63,-133,843,251),64510=>array(-10,-146,244,293),64511=>array(-10,-146,312,293),65056=>array(-445,752,0,929),65057=>array(0,752,445,929),65058=>array(-354,756,0,894),65059=>array(0,756,354,894),65136=>array(4,591,289,825),65137=>array(-10,0,303,825),65138=>array(4,591,289,874),65139=>array(51,0,271,177),65140=>array(4,-239,289,-5),65142=>array(4,591,289,708),65143=>array(-10,0,303,708),65144=>array(4,590,289,874),65145=>array(-10,0,303,874),65146=>array(4,-137,289,-20),65147=>array(-10,-137,303,90),65148=>array(-6,599,299,869),65149=>array(-10,0,303,869),65150=>array(12,610,279,878),65151=>array(-10,0,303,878),65152=>array(80,42,390,483),65153=>array(-37,0,315,939),65154=>array(-37,0,315,939),65155=>array(53,0,220,1028),65156=>array(53,0,314,1028),65157=>array(-42,-244,406,588),65158=>array(-42,-244,526,588),65159=>array(53,-244,220,760),65160=>array(53,-244,314,760),65161=>array(63,-131,719,588),65162=>array(63,-133,843,466),65163=>array(-10,0,227,613),65164=>array(-10,0,312,613),65165=>array(94,0,184,760),65166=>array(94,0,314,760),65167=>array(63,-171,865,327),65168=>array(63,-171,992,327),65169=>array(-10,-146,191,293),65170=>array(-10,-146,312,293),65171=>array(68,-28,453,513),65172=>array(71,0,546,513),65173=>array(63,-10,865,391),65174=>array(63,-10,992,391),65175=>array(-10,0,244,488),65176=>array(-10,0,312,488),65177=>array(63,-10,865,513),65178=>array(63,-10,992,513),65179=>array(-10,0,244,610),65180=>array(-10,0,312,610),65181=>array(77,-244,645,425),65182=>array(77,-244,655,425),65183=>array(-10,-146,545,398),65184=>array(-10,-146,655,398),65185=>array(77,-244,645,425),65186=>array(77,-244,655,425),65187=>array(-10,0,545,398),65188=>array(-10,0,655,398),65189=>array(77,-244,645,586),65190=>array(77,-244,655,586),65191=>array(-10,0,545,537),65192=>array(-10,0,655,537),65193=>array(61,-19,388,415),65194=>array(61,-19,535,415),65195=>array(61,-19,388,586),65196=>array(61,-19,535,586),65197=>array(-42,-244,423,269),65198=>array(-42,-244,562,269),65199=>array(-42,-244,423,464),65200=>array(-42,-244,562,464),65201=>array(63,-244,1138,366),65202=>array(63,-244,1285,366),65203=>array(-10,-14,755,366),65204=>array(-10,-14,902,366),65205=>array(63,-244,1138,586),65206=>array(63,-244,1285,586),65207=>array(-10,-14,755,586),65208=>array(-10,-14,902,586),65209=>array(63,-244,1134,362),65210=>array(63,-244,1235,362),65211=>array(-10,0,774,362),65212=>array(-10,0,877,362),65213=>array(63,-244,1134,464),65214=>array(63,-244,1235,464),65215=>array(-10,0,774,464),65216=>array(-10,0,877,464),65217=>array(70,0,857,760),65218=>array(70,0,959,760),65219=>array(-10,0,729,760),65220=>array(-10,0,830,760),65221=>array(70,0,857,760),65222=>array(70,0,959,760),65223=>array(-10,0,729,760),65224=>array(-10,0,830,760),65225=>array(57,-244,587,521),65226=>array(57,-244,587,382),65227=>array(-10,0,496,521),65228=>array(-10,0,492,382),65229=>array(57,-244,587,659),65230=>array(57,-244,587,537),65231=>array(-10,0,496,659),65232=>array(-10,0,492,537),65233=>array(63,-45,952,635),65234=>array(63,-44,1045,537),65235=>array(-10,0,406,635),65236=>array(-10,0,516,562),65237=>array(52,-215,701,635),65238=>array(52,-244,844,500),65239=>array(-10,0,406,635),65240=>array(-10,0,516,562),65241=>array(70,-27,722,760),65242=>array(70,-27,853,760),65243=>array(-10,0,476,760),65244=>array(-10,0,562,760),65245=>array(70,-152,637,760),65246=>array(70,-152,767,760),65247=>array(-10,0,210,760),65248=>array(-10,0,341,760),65249=>array(68,-240,546,369),65250=>array(68,-240,675,307),65251=>array(-10,-25,456,303),65252=>array(-10,-24,588,303),65253=>array(72,-162,660,464),65254=>array(72,-244,771,342),65255=>array(-10,0,191,488),65256=>array(-10,0,312,488),65257=>array(68,-28,453,358),65258=>array(71,0,546,366),65259=>array(-10,-33,467,487),65260=>array(-10,-244,471,333),65261=>array(-42,-244,406,315),65262=>array(-42,-244,526,315),65263=>array(63,-131,719,411),65264=>array(63,-133,843,251),65265=>array(63,-244,719,411),65266=>array(63,-244,843,251),65267=>array(-10,-146,244,293),65268=>array(-10,-146,312,293),65269=>array(-103,-10,468,866),65270=>array(-103,-10,606,866),65271=>array(-13,-10,468,955),65272=>array(-13,-10,606,955),65273=>array(11,-244,468,760),65274=>array(11,-244,606,760),65275=>array(41,-10,468,760),65276=>array(41,-10,606,760),65533=>array(15,-84,1011,912),65535=>array(50,-177,550,705)); -$cw=array(0=>600,32=>318,33=>401,34=>460,35=>838,36=>636,37=>950,38=>780,39=>275,40=>390,41=>390,42=>500,43=>838,44=>318,45=>361,46=>318,47=>337,48=>636,49=>636,50=>636,51=>636,52=>636,53=>636,54=>636,55=>636,56=>636,57=>636,58=>337,59=>337,60=>838,61=>838,62=>838,63=>531,64=>1000,65=>684,66=>686,67=>698,68=>770,69=>632,70=>575,71=>775,72=>752,73=>295,74=>295,75=>656,76=>557,77=>863,78=>748,79=>787,80=>603,81=>787,82=>695,83=>635,84=>611,85=>732,86=>684,87=>989,88=>685,89=>611,90=>685,91=>390,92=>337,93=>390,94=>838,95=>500,96=>500,97=>613,98=>635,99=>550,100=>635,101=>615,102=>352,103=>635,104=>634,105=>278,106=>278,107=>579,108=>278,109=>974,110=>634,111=>612,112=>635,113=>635,114=>411,115=>521,116=>392,117=>634,118=>592,119=>818,120=>592,121=>592,122=>525,123=>636,124=>337,125=>636,126=>838,160=>318,161=>401,162=>636,163=>636,164=>636,165=>636,166=>337,167=>500,168=>500,169=>1000,170=>471,171=>612,172=>838,173=>361,174=>1000,175=>500,176=>500,177=>838,178=>401,179=>401,180=>500,181=>636,182=>636,183=>318,184=>500,185=>401,186=>471,187=>612,188=>969,189=>969,190=>969,191=>531,192=>684,193=>684,194=>684,195=>684,196=>684,197=>684,198=>974,199=>698,200=>632,201=>632,202=>632,203=>632,204=>295,205=>295,206=>295,207=>295,208=>775,209=>748,210=>787,211=>787,212=>787,213=>787,214=>787,215=>838,216=>787,217=>732,218=>732,219=>732,220=>732,221=>611,222=>605,223=>630,224=>613,225=>613,226=>613,227=>613,228=>613,229=>613,230=>982,231=>550,232=>615,233=>615,234=>615,235=>615,236=>278,237=>278,238=>278,239=>278,240=>612,241=>634,242=>612,243=>612,244=>612,245=>612,246=>612,247=>838,248=>612,249=>634,250=>634,251=>634,252=>634,253=>592,254=>635,255=>592,256=>684,257=>613,258=>684,259=>613,260=>684,261=>613,262=>698,263=>550,264=>698,265=>550,266=>698,267=>550,268=>698,269=>550,270=>770,271=>635,272=>775,273=>635,274=>632,275=>615,276=>632,277=>615,278=>632,279=>615,280=>632,281=>615,282=>632,283=>615,284=>775,285=>635,286=>775,287=>635,288=>775,289=>635,290=>775,291=>635,292=>752,293=>634,294=>916,295=>695,296=>295,297=>278,298=>295,299=>278,300=>295,301=>278,302=>295,303=>278,304=>295,305=>278,306=>590,307=>556,308=>295,309=>278,310=>656,311=>579,312=>579,313=>557,314=>278,315=>557,316=>278,317=>557,318=>375,319=>557,320=>342,321=>562,322=>284,323=>748,324=>634,325=>748,326=>634,327=>748,328=>634,329=>813,330=>748,331=>634,332=>787,333=>612,334=>787,335=>612,336=>787,337=>612,338=>1070,339=>1023,340=>695,341=>411,342=>695,343=>411,344=>695,345=>411,346=>635,347=>521,348=>635,349=>521,350=>635,351=>521,352=>635,353=>521,354=>611,355=>392,356=>611,357=>392,358=>611,359=>392,360=>732,361=>634,362=>732,363=>634,364=>732,365=>634,366=>732,367=>634,368=>732,369=>634,370=>732,371=>634,372=>989,373=>818,374=>611,375=>592,376=>611,377=>685,378=>525,379=>685,380=>525,381=>685,382=>525,383=>352,384=>635,385=>735,386=>686,387=>635,388=>686,389=>635,390=>703,391=>698,392=>550,393=>775,394=>819,395=>686,396=>635,397=>612,398=>632,399=>787,400=>614,401=>575,402=>352,403=>775,404=>687,405=>984,406=>354,407=>295,408=>746,409=>579,410=>278,411=>592,412=>974,413=>748,414=>634,415=>787,416=>913,417=>612,418=>949,419=>759,420=>652,421=>635,422=>695,423=>635,424=>521,425=>632,426=>336,427=>392,428=>611,429=>392,430=>611,431=>858,432=>634,433=>764,434=>721,435=>744,436=>730,437=>685,438=>525,439=>666,440=>666,441=>578,442=>525,443=>636,444=>666,445=>578,446=>510,447=>635,448=>295,449=>492,450=>459,451=>295,452=>1422,453=>1299,454=>1154,455=>835,456=>787,457=>457,458=>931,459=>924,460=>797,461=>684,462=>613,463=>295,464=>278,465=>787,466=>612,467=>732,468=>634,469=>732,470=>634,471=>732,472=>634,473=>732,474=>634,475=>732,476=>634,477=>615,478=>684,479=>613,480=>684,481=>613,482=>974,483=>982,484=>775,485=>635,486=>775,487=>635,488=>656,489=>579,490=>787,491=>612,492=>787,493=>612,494=>666,495=>578,496=>278,497=>1422,498=>1299,499=>1154,500=>775,501=>635,502=>1113,503=>682,504=>748,505=>634,506=>684,507=>613,508=>974,509=>982,510=>787,511=>612,512=>684,513=>613,514=>684,515=>613,516=>632,517=>615,518=>632,519=>615,520=>295,521=>278,522=>295,523=>278,524=>787,525=>612,526=>787,527=>612,528=>695,529=>411,530=>695,531=>411,532=>732,533=>634,534=>732,535=>634,536=>635,537=>521,538=>611,539=>392,540=>627,541=>521,542=>752,543=>634,544=>735,545=>838,546=>698,547=>610,548=>685,549=>525,550=>684,551=>613,552=>632,553=>615,554=>787,555=>612,556=>787,557=>612,558=>787,559=>612,560=>787,561=>612,562=>611,563=>592,564=>475,565=>843,566=>477,567=>278,568=>998,569=>998,570=>684,571=>698,572=>550,573=>557,574=>611,575=>521,576=>525,577=>603,578=>479,579=>686,580=>732,581=>684,582=>632,583=>615,584=>295,585=>278,586=>781,587=>635,588=>695,589=>411,590=>611,591=>592,592=>600,593=>635,594=>635,595=>635,596=>549,597=>550,598=>635,599=>696,600=>615,601=>615,602=>819,603=>541,604=>532,605=>775,606=>664,607=>278,608=>696,609=>635,610=>629,611=>596,612=>596,613=>634,614=>634,615=>634,616=>278,617=>338,618=>372,619=>396,620=>487,621=>278,622=>706,623=>974,624=>974,625=>974,626=>646,627=>642,628=>634,629=>612,630=>858,631=>728,632=>660,633=>414,634=>414,635=>414,636=>411,637=>411,638=>530,639=>530,640=>604,641=>604,642=>521,643=>336,644=>336,645=>461,646=>336,647=>392,648=>392,649=>634,650=>618,651=>598,652=>592,653=>818,654=>592,655=>611,656=>525,657=>525,658=>578,659=>578,660=>510,661=>510,662=>510,663=>510,664=>787,665=>580,666=>664,667=>708,668=>654,669=>292,670=>667,671=>507,672=>727,673=>510,674=>510,675=>1014,676=>1058,677=>1013,678=>830,679=>610,680=>778,681=>848,682=>706,683=>654,684=>515,685=>515,686=>661,687=>664,688=>404,689=>399,690=>175,691=>259,692=>295,693=>296,694=>379,695=>515,696=>373,697=>278,698=>460,699=>318,700=>318,701=>318,702=>307,703=>307,704=>370,705=>370,706=>500,707=>500,708=>500,709=>500,710=>500,711=>500,712=>275,713=>500,714=>500,715=>500,716=>275,717=>500,718=>500,719=>500,720=>337,721=>337,722=>307,723=>307,724=>500,725=>500,726=>390,727=>317,728=>500,729=>500,730=>500,731=>500,732=>500,733=>500,734=>315,735=>500,736=>426,737=>166,738=>373,739=>444,740=>370,741=>493,742=>493,743=>493,744=>493,745=>493,748=>500,749=>500,750=>518,755=>500,759=>500,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0,844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0,860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>654,881=>568,882=>862,883=>647,884=>278,885=>278,886=>748,887=>650,890=>500,891=>549,892=>550,893=>549,894=>337,900=>500,901=>500,902=>692,903=>318,904=>746,905=>871,906=>408,908=>813,910=>825,911=>826,912=>338,913=>684,914=>686,915=>557,916=>684,917=>632,918=>685,919=>752,920=>787,921=>295,922=>656,923=>684,924=>863,925=>748,926=>632,927=>787,928=>752,929=>603,931=>632,932=>611,933=>611,934=>787,935=>685,936=>787,937=>764,938=>295,939=>611,940=>659,941=>541,942=>634,943=>338,944=>579,945=>659,946=>638,947=>592,948=>612,949=>541,950=>544,951=>634,952=>612,953=>338,954=>589,955=>592,956=>636,957=>559,958=>558,959=>612,960=>602,961=>635,962=>587,963=>634,964=>602,965=>579,966=>660,967=>578,968=>660,969=>837,970=>338,971=>579,972=>612,973=>579,974=>837,975=>656,976=>614,977=>619,978=>699,979=>842,980=>699,981=>660,982=>837,983=>664,984=>787,985=>612,986=>648,987=>587,988=>575,989=>458,990=>660,991=>660,992=>865,993=>627,994=>934,995=>837,996=>758,997=>659,998=>792,999=>615,1000=>687,1001=>607,1002=>768,1003=>625,1004=>699,1005=>612,1006=>611,1007=>536,1008=>664,1009=>635,1010=>550,1011=>278,1012=>787,1013=>615,1014=>615,1015=>605,1016=>635,1017=>698,1018=>863,1019=>651,1020=>635,1021=>703,1022=>698,1023=>703,1024=>632,1025=>632,1026=>786,1027=>610,1028=>698,1029=>635,1030=>295,1031=>295,1032=>295,1033=>1094,1034=>1045,1035=>786,1036=>710,1037=>748,1038=>609,1039=>752,1040=>684,1041=>686,1042=>686,1043=>610,1044=>781,1045=>632,1046=>1077,1047=>641,1048=>748,1049=>748,1050=>710,1051=>752,1052=>863,1053=>752,1054=>787,1055=>752,1056=>603,1057=>698,1058=>611,1059=>609,1060=>861,1061=>685,1062=>776,1063=>686,1064=>1069,1065=>1094,1066=>833,1067=>882,1068=>686,1069=>698,1070=>1080,1071=>695,1072=>613,1073=>617,1074=>589,1075=>525,1076=>691,1077=>615,1078=>901,1079=>532,1080=>650,1081=>650,1082=>604,1083=>639,1084=>754,1085=>654,1086=>612,1087=>654,1088=>635,1089=>550,1090=>583,1091=>592,1092=>855,1093=>592,1094=>681,1095=>591,1096=>915,1097=>942,1098=>707,1099=>790,1100=>589,1101=>549,1102=>842,1103=>602,1104=>615,1105=>615,1106=>625,1107=>525,1108=>549,1109=>521,1110=>278,1111=>278,1112=>278,1113=>902,1114=>898,1115=>652,1116=>604,1117=>650,1118=>592,1119=>654,1120=>934,1121=>837,1122=>771,1123=>672,1124=>942,1125=>749,1126=>879,1127=>783,1128=>1160,1129=>1001,1130=>787,1131=>612,1132=>1027,1133=>824,1134=>636,1135=>541,1136=>856,1137=>876,1138=>787,1139=>612,1140=>781,1141=>665,1142=>781,1143=>665,1144=>992,1145=>904,1146=>953,1147=>758,1148=>1180,1149=>1028,1150=>934,1151=>837,1152=>698,1153=>550,1154=>502,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>418,1161=>418,1162=>772,1163=>677,1164=>686,1165=>589,1166=>603,1167=>635,1168=>610,1169=>525,1170=>675,1171=>590,1172=>624,1173=>530,1174=>1077,1175=>901,1176=>641,1177=>532,1178=>710,1179=>604,1180=>710,1181=>604,1182=>710,1183=>604,1184=>856,1185=>832,1186=>752,1187=>661,1188=>1014,1189=>877,1190=>1081,1191=>916,1192=>878,1193=>693,1194=>698,1195=>550,1196=>611,1197=>583,1198=>611,1199=>592,1200=>611,1201=>592,1202=>685,1203=>592,1204=>934,1205=>807,1206=>686,1207=>591,1208=>686,1209=>591,1210=>686,1211=>634,1212=>941,1213=>728,1214=>941,1215=>728,1216=>295,1217=>1077,1218=>901,1219=>656,1220=>604,1221=>776,1222=>670,1223=>752,1224=>661,1225=>776,1226=>681,1227=>686,1228=>591,1229=>888,1230=>774,1231=>278,1232=>684,1233=>613,1234=>684,1235=>613,1236=>974,1237=>982,1238=>632,1239=>615,1240=>787,1241=>615,1242=>787,1243=>615,1244=>1077,1245=>901,1246=>641,1247=>532,1248=>666,1249=>578,1250=>748,1251=>650,1252=>748,1253=>650,1254=>787,1255=>612,1256=>787,1257=>612,1258=>787,1259=>612,1260=>698,1261=>549,1262=>609,1263=>592,1264=>609,1265=>592,1266=>609,1267=>592,1268=>686,1269=>591,1270=>610,1271=>525,1272=>882,1273=>790,1274=>675,1275=>590,1276=>685,1277=>592,1278=>685,1279=>592,1280=>686,1281=>589,1282=>1006,1283=>897,1284=>975,1285=>869,1286=>679,1287=>588,1288=>1072,1289=>957,1290=>1113,1291=>967,1292=>775,1293=>660,1294=>773,1295=>711,1296=>614,1297=>541,1298=>752,1299=>639,1300=>1169,1301=>994,1302=>894,1303=>864,1304=>1032,1305=>986,1306=>787,1307=>635,1308=>989,1309=>818,1310=>710,1311=>604,1312=>1081,1313=>905,1314=>1081,1315=>912,1316=>793,1317=>683,1329=>766,1330=>732,1331=>753,1332=>753,1333=>732,1334=>772,1335=>640,1336=>732,1337=>859,1338=>753,1339=>691,1340=>533,1341=>922,1342=>863,1343=>732,1344=>716,1345=>766,1346=>753,1347=>767,1348=>792,1349=>728,1350=>729,1351=>757,1352=>732,1353=>713,1354=>800,1355=>768,1356=>792,1357=>732,1358=>753,1359=>705,1360=>694,1361=>744,1362=>538,1363=>811,1364=>757,1365=>787,1366=>790,1369=>307,1370=>318,1371=>234,1372=>361,1373=>238,1374=>405,1375=>500,1377=>974,1378=>634,1379=>658,1380=>663,1381=>634,1382=>635,1383=>515,1384=>634,1385=>738,1386=>658,1387=>634,1388=>271,1389=>980,1390=>623,1391=>634,1392=>634,1393=>608,1394=>634,1395=>629,1396=>634,1397=>271,1398=>634,1399=>499,1400=>634,1401=>404,1402=>974,1403=>560,1404=>648,1405=>634,1406=>634,1407=>974,1408=>634,1409=>633,1410=>435,1411=>974,1412=>636,1413=>609,1414=>805,1415=>812,1417=>337,1418=>361,1456=>0,1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0,1467=>0,1468=>0,1469=>0,1470=>361,1471=>0,1472=>295,1473=>0,1474=>0,1475=>295,1478=>441,1479=>0,1488=>668,1489=>578,1490=>412,1491=>546,1492=>653,1493=>272,1494=>346,1495=>653,1496=>648,1497=>224,1498=>537,1499=>529,1500=>568,1501=>664,1502=>679,1503=>272,1504=>400,1505=>649,1506=>626,1507=>640,1508=>625,1509=>540,1510=>593,1511=>709,1512=>564,1513=>708,1514=>657,1520=>471,1521=>423,1522=>331,1523=>416,1524=>645,1542=>637,1543=>637,1545=>757,1546=>977,1548=>323,1557=>0,1563=>318,1567=>531,1569=>470,1570=>278,1571=>278,1572=>483,1573=>278,1574=>783,1575=>278,1576=>941,1577=>524,1578=>941,1579=>941,1580=>646,1581=>646,1582=>646,1583=>445,1584=>445,1585=>483,1586=>483,1587=>1221,1588=>1221,1589=>1209,1590=>1209,1591=>925,1592=>925,1593=>597,1594=>597,1600=>293,1601=>1037,1602=>776,1603=>824,1604=>727,1605=>619,1606=>734,1607=>524,1608=>483,1609=>783,1610=>783,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1619=>0,1620=>0,1621=>0,1623=>0,1626=>500,1632=>537,1633=>537,1634=>537,1635=>537,1636=>537,1637=>537,1638=>537,1639=>537,1640=>537,1641=>537,1642=>537,1643=>325,1644=>318,1645=>545,1646=>941,1647=>776,1648=>0,1652=>292,1657=>941,1658=>941,1659=>941,1660=>941,1661=>941,1662=>941,1663=>941,1664=>941,1665=>646,1666=>646,1667=>646,1668=>646,1669=>646,1670=>646,1671=>646,1672=>445,1673=>445,1674=>445,1675=>445,1676=>445,1677=>445,1678=>445,1679=>445,1680=>445,1681=>483,1682=>483,1683=>498,1684=>530,1685=>610,1686=>530,1687=>483,1688=>483,1689=>483,1690=>1221,1691=>1221,1692=>1221,1693=>1209,1694=>1209,1695=>925,1696=>597,1697=>1037,1698=>1037,1699=>1037,1700=>1037,1701=>1037,1702=>1037,1703=>776,1704=>776,1705=>895,1706=>1054,1707=>895,1708=>824,1709=>824,1710=>824,1711=>895,1712=>895,1713=>895,1714=>895,1715=>895,1716=>895,1717=>727,1718=>727,1719=>727,1720=>727,1721=>734,1722=>734,1723=>734,1724=>734,1725=>734,1726=>698,1727=>646,1734=>483,1740=>783,1742=>783,1749=>524,1776=>537,1777=>537,1778=>537,1779=>537,1780=>537,1781=>537,1782=>537,1783=>537,1784=>537,1785=>537,1984=>636,1985=>636,1986=>636,1987=>636,1988=>636,1989=>636,1990=>636,1991=>636,1992=>636,1993=>636,1994=>278,1995=>571,1996=>424,1997=>592,1998=>654,1999=>654,2000=>594,2001=>654,2002=>829,2003=>438,2004=>438,2005=>559,2006=>612,2007=>350,2008=>959,2009=>473,2010=>783,2011=>654,2012=>625,2013=>734,2014=>530,2015=>724,2016=>473,2017=>625,2018=>594,2019=>530,2020=>530,2021=>522,2022=>594,2023=>594,2027=>0,2028=>0,2029=>0,2030=>0,2031=>0,2032=>0,2033=>0,2034=>0,2035=>0,2036=>313,2037=>313,2040=>560,2041=>560,2042=>361,3647=>636,3713=>670,3714=>684,3716=>688,3719=>482,3720=>628,3722=>684,3725=>688,3732=>669,3733=>642,3734=>645,3735=>655,3737=>659,3738=>625,3739=>625,3740=>745,3741=>767,3742=>687,3743=>687,3745=>702,3746=>688,3747=>684,3749=>649,3751=>632,3754=>703,3755=>819,3757=>633,3758=>684,3759=>788,3760=>632,3761=>0,3762=>539,3763=>539,3764=>0,3765=>0,3766=>0,3767=>0,3768=>0,3769=>0,3771=>0,3772=>0,3773=>663,3776=>375,3777=>657,3778=>460,3779=>547,3780=>491,3782=>674,3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>636,3793=>641,3794=>641,3795=>670,3796=>625,3797=>625,3798=>703,3799=>670,3800=>674,3801=>677,3804=>1028,3805=>1028,4256=>874,4257=>733,4258=>679,4259=>834,4260=>615,4261=>768,4262=>753,4263=>914,4264=>453,4265=>620,4266=>843,4267=>882,4268=>625,4269=>854,4270=>781,4271=>629,4272=>912,4273=>621,4274=>620,4275=>854,4276=>866,4277=>724,4278=>630,4279=>621,4280=>625,4281=>620,4282=>818,4283=>874,4284=>615,4285=>623,4286=>625,4287=>725,4288=>844,4289=>596,4290=>688,4291=>596,4292=>594,4293=>738,4304=>508,4305=>518,4306=>581,4307=>818,4308=>508,4309=>513,4310=>500,4311=>801,4312=>518,4313=>510,4314=>1064,4315=>522,4316=>522,4317=>786,4318=>508,4319=>518,4320=>796,4321=>522,4322=>654,4323=>522,4324=>825,4325=>513,4326=>786,4327=>518,4328=>518,4329=>522,4330=>571,4331=>522,4332=>518,4333=>520,4334=>522,4335=>454,4336=>508,4337=>518,4338=>508,4339=>508,4340=>518,4341=>554,4342=>828,4343=>552,4344=>508,4345=>571,4346=>508,4347=>448,4348=>324,5121=>684,5122=>684,5123=>684,5124=>684,5125=>769,5126=>769,5127=>769,5129=>769,5130=>769,5131=>769,5132=>835,5133=>834,5134=>835,5135=>834,5136=>835,5137=>834,5138=>967,5139=>1007,5140=>967,5141=>1007,5142=>769,5143=>967,5144=>1007,5145=>967,5146=>1007,5147=>769,5149=>256,5150=>543,5151=>423,5152=>423,5153=>389,5154=>389,5155=>393,5156=>389,5157=>466,5158=>385,5159=>256,5160=>389,5161=>389,5162=>389,5163=>1090,5164=>909,5165=>953,5166=>1117,5167=>684,5168=>684,5169=>684,5170=>684,5171=>729,5172=>729,5173=>729,5175=>729,5176=>729,5177=>729,5178=>835,5179=>684,5180=>835,5181=>834,5182=>835,5183=>834,5184=>967,5185=>1007,5186=>967,5187=>1007,5188=>967,5189=>1007,5190=>967,5191=>1007,5192=>729,5193=>508,5194=>192,5196=>732,5197=>732,5198=>732,5199=>732,5200=>730,5201=>730,5202=>730,5204=>730,5205=>730,5206=>730,5207=>921,5208=>889,5209=>921,5210=>889,5211=>921,5212=>889,5213=>928,5214=>900,5215=>928,5216=>900,5217=>947,5218=>900,5219=>947,5220=>900,5221=>947,5222=>434,5223=>877,5224=>877,5225=>866,5226=>890,5227=>628,5228=>628,5229=>628,5230=>628,5231=>628,5232=>628,5233=>628,5234=>628,5235=>628,5236=>860,5237=>771,5238=>815,5239=>816,5240=>815,5241=>816,5242=>860,5243=>771,5244=>860,5245=>771,5246=>815,5247=>816,5248=>815,5249=>816,5250=>815,5251=>407,5252=>407,5253=>750,5254=>775,5255=>750,5256=>775,5257=>628,5258=>628,5259=>628,5260=>628,5261=>628,5262=>628,5263=>628,5264=>628,5265=>628,5266=>860,5267=>771,5268=>815,5269=>816,5270=>815,5271=>816,5272=>860,5273=>771,5274=>860,5275=>771,5276=>815,5277=>816,5278=>815,5279=>816,5280=>815,5281=>435,5282=>435,5283=>610,5284=>557,5285=>557,5286=>557,5287=>610,5288=>610,5289=>610,5290=>557,5291=>557,5292=>749,5293=>769,5294=>746,5295=>764,5296=>746,5297=>764,5298=>749,5299=>769,5300=>749,5301=>769,5302=>746,5303=>764,5304=>746,5305=>764,5306=>746,5307=>386,5308=>508,5309=>386,5312=>852,5313=>852,5314=>852,5315=>852,5316=>852,5317=>852,5318=>852,5319=>852,5320=>852,5321=>1069,5322=>1035,5323=>1059,5324=>852,5325=>1059,5326=>852,5327=>852,5328=>600,5329=>453,5330=>600,5331=>852,5332=>852,5333=>852,5334=>852,5335=>852,5336=>852,5337=>852,5338=>852,5339=>852,5340=>1069,5341=>1035,5342=>1059,5343=>1030,5344=>1059,5345=>1030,5346=>1069,5347=>1035,5348=>1069,5349=>1035,5350=>1083,5351=>1030,5352=>1083,5353=>1030,5354=>600,5356=>729,5357=>603,5358=>603,5359=>603,5360=>603,5361=>603,5362=>603,5363=>603,5364=>603,5365=>603,5366=>834,5367=>754,5368=>792,5369=>771,5370=>792,5371=>771,5372=>834,5373=>754,5374=>834,5375=>754,5376=>792,5377=>771,5378=>792,5379=>771,5380=>792,5381=>418,5382=>420,5383=>418,5392=>712,5393=>712,5394=>712,5395=>892,5396=>892,5397=>892,5398=>892,5399=>910,5400=>872,5401=>910,5402=>872,5403=>910,5404=>872,5405=>1140,5406=>1100,5407=>1140,5408=>1100,5409=>1140,5410=>1100,5411=>1140,5412=>1100,5413=>641,5414=>627,5415=>627,5416=>627,5417=>627,5418=>627,5419=>627,5420=>627,5421=>627,5422=>627,5423=>844,5424=>781,5425=>816,5426=>818,5427=>816,5428=>818,5429=>844,5430=>781,5431=>844,5432=>781,5433=>816,5434=>818,5435=>816,5436=>818,5437=>816,5438=>418,5440=>389,5441=>484,5442=>916,5443=>916,5444=>916,5445=>916,5446=>916,5447=>916,5448=>603,5449=>603,5450=>603,5451=>603,5452=>603,5453=>603,5454=>834,5455=>754,5456=>418,5458=>729,5459=>684,5460=>684,5461=>684,5462=>684,5463=>726,5464=>726,5465=>726,5466=>726,5467=>924,5468=>1007,5469=>508,5470=>732,5471=>732,5472=>732,5473=>732,5474=>732,5475=>732,5476=>730,5477=>730,5478=>730,5479=>730,5480=>947,5481=>900,5482=>508,5492=>831,5493=>831,5494=>831,5495=>831,5496=>831,5497=>831,5498=>831,5499=>563,5500=>752,5501=>484,5502=>1047,5503=>1047,5504=>1047,5505=>1047,5506=>1047,5507=>1047,5508=>1047,5509=>825,5514=>831,5515=>831,5516=>831,5517=>831,5518=>1259,5519=>1259,5520=>1259,5521=>1002,5522=>1002,5523=>1259,5524=>1259,5525=>700,5526=>1073,5536=>852,5537=>852,5538=>852,5539=>852,5540=>852,5541=>852,5542=>600,5543=>643,5544=>643,5545=>643,5546=>643,5547=>643,5548=>643,5549=>643,5550=>418,5551=>628,5598=>770,5601=>767,5702=>468,5703=>468,5742=>444,5743=>1047,5744=>1310,5745=>1632,5746=>1632,5747=>1375,5748=>1375,5749=>1632,5750=>1632,5760=>477,5761=>493,5762=>712,5763=>931,5764=>1150,5765=>1370,5766=>493,5767=>712,5768=>931,5769=>1150,5770=>1370,5771=>498,5772=>718,5773=>938,5774=>1159,5775=>1379,5776=>493,5777=>712,5778=>930,5779=>1149,5780=>1370,5781=>498,5782=>752,5783=>789,5784=>1205,5785=>1150,5786=>683,5787=>507,5788=>507,7424=>592,7425=>717,7426=>982,7427=>586,7428=>550,7429=>605,7430=>605,7431=>491,7432=>541,7433=>278,7434=>395,7435=>579,7436=>583,7437=>754,7438=>650,7439=>612,7440=>550,7441=>684,7442=>684,7443=>684,7444=>1023,7446=>612,7447=>612,7448=>524,7449=>602,7450=>602,7451=>583,7452=>574,7453=>737,7454=>948,7455=>638,7456=>592,7457=>818,7458=>525,7459=>526,7462=>583,7463=>592,7464=>564,7465=>524,7466=>590,7467=>639,7468=>431,7469=>613,7470=>432,7472=>485,7473=>398,7474=>398,7475=>488,7476=>474,7477=>186,7478=>186,7479=>413,7480=>351,7481=>543,7482=>471,7483=>471,7484=>496,7485=>439,7486=>380,7487=>438,7488=>385,7489=>461,7490=>623,7491=>392,7492=>392,7493=>405,7494=>648,7495=>428,7496=>405,7497=>417,7498=>417,7499=>360,7500=>359,7501=>405,7502=>179,7503=>426,7504=>623,7505=>409,7506=>414,7507=>370,7508=>414,7509=>414,7510=>428,7511=>295,7512=>405,7513=>470,7514=>623,7515=>417,7517=>402,7518=>373,7519=>385,7520=>416,7521=>364,7522=>179,7523=>259,7524=>405,7525=>417,7526=>402,7527=>373,7528=>412,7529=>416,7530=>364,7543=>635,7544=>474,7547=>372,7549=>667,7557=>278,7579=>405,7580=>370,7581=>370,7582=>414,7583=>360,7584=>296,7585=>233,7586=>405,7587=>405,7588=>261,7589=>250,7590=>261,7591=>261,7592=>234,7593=>250,7594=>235,7595=>376,7596=>623,7597=>623,7598=>411,7599=>479,7600=>409,7601=>414,7602=>414,7603=>360,7604=>287,7605=>295,7606=>508,7607=>418,7608=>361,7609=>406,7610=>417,7611=>366,7612=>437,7613=>366,7614=>392,7615=>414,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0,7680=>684,7681=>613,7682=>686,7683=>635,7684=>686,7685=>635,7686=>686,7687=>635,7688=>698,7689=>550,7690=>770,7691=>635,7692=>770,7693=>635,7694=>770,7695=>635,7696=>770,7697=>635,7698=>770,7699=>635,7700=>632,7701=>615,7702=>632,7703=>615,7704=>632,7705=>615,7706=>632,7707=>615,7708=>632,7709=>615,7710=>575,7711=>352,7712=>775,7713=>635,7714=>752,7715=>634,7716=>752,7717=>634,7718=>752,7719=>634,7720=>752,7721=>634,7722=>752,7723=>634,7724=>295,7725=>278,7726=>295,7727=>278,7728=>656,7729=>579,7730=>656,7731=>579,7732=>656,7733=>579,7734=>557,7735=>288,7736=>557,7737=>288,7738=>557,7739=>278,7740=>557,7741=>278,7742=>863,7743=>974,7744=>863,7745=>974,7746=>863,7747=>974,7748=>748,7749=>634,7750=>748,7751=>634,7752=>748,7753=>634,7754=>748,7755=>634,7756=>787,7757=>612,7758=>787,7759=>612,7760=>787,7761=>612,7762=>787,7763=>612,7764=>603,7765=>635,7766=>603,7767=>635,7768=>695,7769=>411,7770=>695,7771=>411,7772=>695,7773=>411,7774=>695,7775=>411,7776=>635,7777=>521,7778=>635,7779=>521,7780=>635,7781=>521,7782=>635,7783=>521,7784=>635,7785=>521,7786=>611,7787=>392,7788=>611,7789=>392,7790=>611,7791=>392,7792=>611,7793=>392,7794=>732,7795=>634,7796=>732,7797=>634,7798=>732,7799=>634,7800=>732,7801=>634,7802=>732,7803=>634,7804=>684,7805=>592,7806=>684,7807=>592,7808=>989,7809=>818,7810=>989,7811=>818,7812=>989,7813=>818,7814=>989,7815=>818,7816=>989,7817=>818,7818=>685,7819=>592,7820=>685,7821=>592,7822=>611,7823=>592,7824=>685,7825=>525,7826=>685,7827=>525,7828=>685,7829=>525,7830=>634,7831=>392,7832=>818,7833=>592,7834=>613,7835=>352,7836=>352,7837=>352,7838=>769,7839=>612,7840=>684,7841=>613,7842=>684,7843=>613,7844=>684,7845=>613,7846=>684,7847=>613,7848=>684,7849=>613,7850=>684,7851=>613,7852=>684,7853=>613,7854=>684,7855=>613,7856=>684,7857=>613,7858=>684,7859=>613,7860=>684,7861=>613,7862=>684,7863=>613,7864=>632,7865=>615,7866=>632,7867=>615,7868=>632,7869=>615,7870=>632,7871=>615,7872=>632,7873=>615,7874=>632,7875=>615,7876=>632,7877=>615,7878=>632,7879=>615,7880=>295,7881=>278,7882=>295,7883=>278,7884=>787,7885=>612,7886=>787,7887=>612,7888=>787,7889=>612,7890=>787,7891=>612,7892=>787,7893=>612,7894=>787,7895=>612,7896=>787,7897=>612,7898=>913,7899=>612,7900=>913,7901=>612,7902=>913,7903=>612,7904=>913,7905=>612,7906=>913,7907=>612,7908=>732,7909=>634,7910=>732,7911=>634,7912=>858,7913=>634,7914=>858,7915=>634,7916=>858,7917=>634,7918=>858,7919=>634,7920=>858,7921=>634,7922=>611,7923=>592,7924=>611,7925=>592,7926=>611,7927=>592,7928=>611,7929=>592,7930=>769,7931=>477,7936=>659,7937=>659,7938=>659,7939=>659,7940=>659,7941=>659,7942=>659,7943=>659,7944=>684,7945=>684,7946=>877,7947=>877,7948=>769,7949=>801,7950=>708,7951=>743,7952=>541,7953=>541,7954=>541,7955=>541,7956=>541,7957=>541,7960=>711,7961=>711,7962=>966,7963=>975,7964=>898,7965=>928,7968=>634,7969=>634,7970=>634,7971=>634,7972=>634,7973=>634,7974=>634,7975=>634,7976=>837,7977=>835,7978=>1086,7979=>1089,7980=>1027,7981=>1051,7982=>934,7983=>947,7984=>338,7985=>338,7986=>338,7987=>338,7988=>338,7989=>338,7990=>338,7991=>338,7992=>380,7993=>374,7994=>635,7995=>635,7996=>570,7997=>600,7998=>489,7999=>493,8000=>612,8001=>612,8002=>612,8003=>612,8004=>612,8005=>612,8008=>804,8009=>848,8010=>1095,8011=>1100,8012=>938,8013=>970,8016=>579,8017=>579,8018=>579,8019=>579,8020=>579,8021=>579,8022=>579,8023=>579,8025=>784,8027=>998,8029=>1012,8031=>897,8032=>837,8033=>837,8034=>837,8035=>837,8036=>837,8037=>837,8038=>837,8039=>837,8040=>802,8041=>843,8042=>1089,8043=>1095,8044=>946,8045=>972,8046=>921,8047=>952,8048=>659,8049=>659,8050=>541,8051=>548,8052=>634,8053=>654,8054=>338,8055=>338,8056=>612,8057=>612,8058=>579,8059=>579,8060=>837,8061=>837,8064=>659,8065=>659,8066=>659,8067=>659,8068=>659,8069=>659,8070=>659,8071=>659,8072=>684,8073=>684,8074=>877,8075=>877,8076=>769,8077=>801,8078=>708,8079=>743,8080=>634,8081=>634,8082=>634,8083=>634,8084=>634,8085=>634,8086=>634,8087=>634,8088=>837,8089=>835,8090=>1086,8091=>1089,8092=>1027,8093=>1051,8094=>934,8095=>947,8096=>837,8097=>837,8098=>837,8099=>837,8100=>837,8101=>837,8102=>837,8103=>837,8104=>802,8105=>843,8106=>1089,8107=>1095,8108=>946,8109=>972,8110=>921,8111=>952,8112=>659,8113=>659,8114=>659,8115=>659,8116=>659,8118=>659,8119=>659,8120=>684,8121=>684,8122=>716,8123=>692,8124=>684,8125=>500,8126=>500,8127=>500,8128=>500,8129=>500,8130=>634,8131=>634,8132=>654,8134=>634,8135=>634,8136=>805,8137=>746,8138=>931,8139=>871,8140=>752,8141=>500,8142=>500,8143=>500,8144=>338,8145=>338,8146=>338,8147=>338,8150=>338,8151=>338,8152=>295,8153=>295,8154=>475,8155=>408,8157=>500,8158=>500,8159=>500,8160=>579,8161=>579,8162=>579,8163=>579,8164=>635,8165=>635,8166=>579,8167=>579,8168=>611,8169=>611,8170=>845,8171=>825,8172=>685,8173=>500,8174=>500,8175=>500,8178=>837,8179=>837,8180=>837,8182=>837,8183=>837,8184=>941,8185=>813,8186=>922,8187=>826,8188=>764,8189=>500,8190=>500,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>330,8197=>250,8198=>167,8199=>636,8200=>318,8201=>200,8202=>100,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>361,8209=>361,8210=>636,8211=>500,8212=>1000,8213=>1000,8214=>500,8215=>500,8216=>318,8217=>318,8218=>318,8219=>318,8220=>518,8221=>518,8222=>518,8223=>518,8224=>500,8225=>500,8226=>590,8227=>590,8228=>334,8229=>667,8230=>1000,8231=>318,8232=>0,8233=>0,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>200,8240=>1342,8241=>1735,8242=>227,8243=>374,8244=>520,8245=>227,8246=>374,8247=>520,8248=>339,8249=>400,8250=>400,8251=>838,8252=>485,8253=>531,8254=>500,8255=>804,8256=>804,8257=>250,8258=>1000,8259=>500,8260=>167,8261=>390,8262=>390,8263=>922,8264=>733,8265=>733,8266=>497,8267=>636,8268=>500,8269=>500,8270=>500,8271=>337,8272=>804,8273=>500,8274=>450,8275=>1000,8276=>804,8277=>838,8278=>586,8279=>663,8280=>838,8281=>838,8282=>318,8283=>797,8284=>838,8285=>318,8286=>318,8287=>222,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0,8303=>0,8304=>401,8305=>179,8308=>401,8309=>401,8310=>401,8311=>401,8312=>401,8313=>401,8314=>528,8315=>528,8316=>528,8317=>246,8318=>246,8319=>398,8320=>401,8321=>401,8322=>401,8323=>401,8324=>401,8325=>401,8326=>401,8327=>401,8328=>401,8329=>401,8330=>528,8331=>528,8332=>528,8333=>246,8334=>246,8336=>392,8337=>417,8338=>414,8339=>444,8340=>417,8341=>404,8342=>426,8343=>166,8344=>623,8345=>398,8346=>428,8347=>373,8348=>295,8352=>877,8353=>636,8354=>636,8355=>636,8356=>636,8357=>974,8358=>748,8359=>1272,8360=>1074,8361=>989,8362=>784,8363=>636,8364=>636,8365=>636,8366=>636,8367=>1272,8368=>636,8369=>636,8370=>636,8371=>636,8372=>774,8373=>636,8376=>636,8377=>636,8378=>679,8400=>0,8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>1019,8449=>1019,8450=>698,8451=>1123,8452=>642,8453=>1019,8454=>1067,8455=>614,8456=>698,8457=>952,8459=>988,8460=>754,8461=>850,8462=>634,8463=>634,8464=>470,8465=>697,8466=>720,8467=>413,8468=>818,8469=>801,8470=>1040,8471=>1000,8472=>697,8473=>701,8474=>787,8475=>798,8476=>814,8477=>792,8478=>896,8479=>684,8480=>1020,8481=>1074,8482=>1000,8483=>684,8484=>745,8485=>578,8486=>764,8487=>764,8488=>616,8489=>338,8490=>656,8491=>684,8492=>786,8493=>703,8494=>854,8495=>592,8496=>605,8497=>786,8498=>575,8499=>1069,8500=>462,8501=>745,8502=>674,8503=>466,8504=>645,8505=>380,8506=>926,8507=>1194,8508=>702,8509=>728,8510=>654,8511=>849,8512=>811,8513=>775,8514=>557,8515=>557,8516=>611,8517=>819,8518=>708,8519=>615,8520=>351,8521=>351,8523=>780,8526=>526,8528=>969,8529=>969,8530=>1370,8531=>969,8532=>969,8533=>969,8534=>969,8535=>969,8536=>969,8537=>969,8538=>969,8539=>969,8540=>969,8541=>969,8542=>969,8543=>568,8544=>295,8545=>492,8546=>689,8547=>923,8548=>684,8549=>922,8550=>1120,8551=>1317,8552=>917,8553=>685,8554=>933,8555=>1131,8556=>557,8557=>698,8558=>770,8559=>863,8560=>278,8561=>458,8562=>637,8563=>812,8564=>592,8565=>811,8566=>991,8567=>1170,8568=>819,8569=>592,8570=>822,8571=>1002,8572=>278,8573=>550,8574=>635,8575=>974,8576=>1245,8577=>770,8578=>1245,8579=>703,8580=>549,8581=>698,8585=>969,8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838,8598=>838,8599=>838,8600=>838,8601=>838,8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838,8608=>838,8609=>838,8610=>838,8611=>838,8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838,8618=>838,8619=>838,8620=>838,8621=>838,8622=>838,8623=>838,8624=>838,8625=>838,8626=>838,8627=>838,8628=>838,8629=>838,8630=>838,8631=>838,8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838,8638=>838,8639=>838,8640=>838,8641=>838,8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838,8648=>838,8649=>838,8650=>838,8651=>838,8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838,8658=>838,8659=>838,8660=>838,8661=>838,8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838,8668=>838,8669=>838,8670=>838,8671=>838,8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838,8678=>838,8679=>838,8680=>838,8681=>838,8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838,8688=>838,8689=>838,8690=>838,8691=>838,8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838,8698=>838,8699=>838,8700=>838,8701=>838,8702=>838,8703=>838,8704=>684,8705=>636,8706=>517,8707=>632,8708=>632,8709=>871,8710=>669,8711=>669,8712=>871,8713=>871,8714=>718,8715=>871,8716=>871,8717=>718,8718=>636,8719=>757,8720=>757,8721=>674,8722=>838,8723=>838,8724=>838,8725=>337,8726=>637,8727=>838,8728=>626,8729=>626,8730=>637,8731=>637,8732=>637,8733=>714,8734=>833,8735=>838,8736=>896,8737=>896,8738=>838,8739=>500,8740=>500,8741=>500,8742=>500,8743=>732,8744=>732,8745=>732,8746=>732,8747=>521,8748=>789,8749=>1057,8750=>521,8751=>789,8752=>1057,8753=>521,8754=>521,8755=>521,8756=>636,8757=>636,8758=>260,8759=>636,8760=>838,8761=>838,8762=>838,8763=>838,8764=>838,8765=>838,8766=>838,8767=>838,8768=>375,8769=>838,8770=>838,8771=>838,8772=>838,8773=>838,8774=>838,8775=>838,8776=>838,8777=>838,8778=>838,8779=>838,8780=>838,8781=>838,8782=>838,8783=>838,8784=>838,8785=>838,8786=>839,8787=>839,8788=>1000,8789=>1000,8790=>838,8791=>838,8792=>838,8793=>838,8794=>838,8795=>838,8796=>838,8797=>838,8798=>838,8799=>838,8800=>838,8801=>838,8802=>838,8803=>838,8804=>838,8805=>838,8806=>838,8807=>838,8808=>838,8809=>838,8810=>1047,8811=>1047,8812=>464,8813=>838,8814=>838,8815=>838,8816=>838,8817=>838,8818=>838,8819=>838,8820=>838,8821=>838,8822=>838,8823=>838,8824=>838,8825=>838,8826=>838,8827=>838,8828=>838,8829=>838,8830=>838,8831=>838,8832=>838,8833=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838,8840=>838,8841=>838,8842=>838,8843=>838,8844=>732,8845=>732,8846=>732,8847=>838,8848=>838,8849=>838,8850=>838,8851=>780,8852=>780,8853=>838,8854=>838,8855=>838,8856=>838,8857=>838,8858=>838,8859=>838,8860=>838,8861=>838,8862=>838,8863=>838,8864=>838,8865=>838,8866=>871,8867=>871,8868=>871,8869=>871,8870=>521,8871=>521,8872=>871,8873=>871,8874=>871,8875=>871,8876=>871,8877=>871,8878=>871,8879=>871,8880=>838,8881=>838,8882=>838,8883=>838,8884=>838,8885=>838,8886=>1000,8887=>1000,8888=>838,8889=>838,8890=>521,8891=>732,8892=>732,8893=>732,8894=>838,8895=>838,8896=>820,8897=>820,8898=>820,8899=>820,8900=>494,8901=>318,8902=>626,8903=>838,8904=>1000,8905=>1000,8906=>1000,8907=>1000,8908=>1000,8909=>838,8910=>732,8911=>732,8912=>838,8913=>838,8914=>838,8915=>838,8916=>838,8917=>838,8918=>838,8919=>838,8920=>1422,8921=>1422,8922=>838,8923=>838,8924=>838,8925=>838,8926=>838,8927=>838,8928=>838,8929=>838,8930=>838,8931=>838,8932=>838,8933=>838,8934=>838,8935=>838,8936=>838,8937=>838,8938=>838,8939=>838,8940=>838,8941=>838,8942=>1000,8943=>1000,8944=>1000,8945=>1000,8946=>1000,8947=>871,8948=>718,8949=>871,8950=>871,8951=>718,8952=>871,8953=>871,8954=>1000,8955=>871,8956=>718,8957=>871,8958=>718,8959=>871,8960=>602,8961=>602,8962=>635,8963=>838,8964=>838,8965=>838,8966=>838,8967=>488,8968=>390,8969=>390,8970=>390,8971=>390,8972=>809,8973=>809,8974=>809,8975=>809,8976=>838,8977=>513,8984=>1000,8985=>838,8988=>469,8989=>469,8990=>469,8991=>469,8992=>521,8993=>521,8996=>1152,8997=>1152,8998=>1414,8999=>1152,9000=>1443,9003=>1414,9004=>873,9075=>338,9076=>635,9077=>837,9082=>659,9085=>757,9095=>1152,9108=>873,9115=>500,9116=>500,9117=>500,9118=>500,9119=>500,9120=>500,9121=>500,9122=>500,9123=>500,9124=>500,9125=>500,9126=>500,9127=>750,9128=>750,9129=>750,9130=>750,9131=>750,9132=>750,9133=>750,9134=>521,9166=>838,9167=>945,9187=>873,9189=>769,9192=>636,9250=>635,9251=>635,9312=>896,9313=>896,9314=>896,9315=>896,9316=>896,9317=>896,9318=>896,9319=>896,9320=>896,9321=>896,9472=>602,9473=>602,9474=>602,9475=>602,9476=>602,9477=>602,9478=>602,9479=>602,9480=>602,9481=>602,9482=>602,9483=>602,9484=>602,9485=>602,9486=>602,9487=>602,9488=>602,9489=>602,9490=>602,9491=>602,9492=>602,9493=>602,9494=>602,9495=>602,9496=>602,9497=>602,9498=>602,9499=>602,9500=>602,9501=>602,9502=>602,9503=>602,9504=>602,9505=>602,9506=>602,9507=>602,9508=>602,9509=>602,9510=>602,9511=>602,9512=>602,9513=>602,9514=>602,9515=>602,9516=>602,9517=>602,9518=>602,9519=>602,9520=>602,9521=>602,9522=>602,9523=>602,9524=>602,9525=>602,9526=>602,9527=>602,9528=>602,9529=>602,9530=>602,9531=>602,9532=>602,9533=>602,9534=>602,9535=>602,9536=>602,9537=>602,9538=>602,9539=>602,9540=>602,9541=>602,9542=>602,9543=>602,9544=>602,9545=>602,9546=>602,9547=>602,9548=>602,9549=>602,9550=>602,9551=>602,9552=>602,9553=>602,9554=>602,9555=>602,9556=>602,9557=>602,9558=>602,9559=>602,9560=>602,9561=>602,9562=>602,9563=>602,9564=>602,9565=>602,9566=>602,9567=>602,9568=>602,9569=>602,9570=>602,9571=>602,9572=>602,9573=>602,9574=>602,9575=>602,9576=>602,9577=>602,9578=>602,9579=>602,9580=>602,9581=>602,9582=>602,9583=>602,9584=>602,9585=>602,9586=>602,9587=>602,9588=>602,9589=>602,9590=>602,9591=>602,9592=>602,9593=>602,9594=>602,9595=>602,9596=>602,9597=>602,9598=>602,9599=>602,9600=>769,9601=>769,9602=>769,9603=>769,9604=>769,9605=>769,9606=>769,9607=>769,9608=>769,9609=>769,9610=>769,9611=>769,9612=>769,9613=>769,9614=>769,9615=>769,9616=>769,9617=>769,9618=>769,9619=>769,9620=>769,9621=>769,9622=>769,9623=>769,9624=>769,9625=>769,9626=>769,9627=>769,9628=>769,9629=>769,9630=>769,9631=>769,9632=>945,9633=>945,9634=>945,9635=>945,9636=>945,9637=>945,9638=>945,9639=>945,9640=>945,9641=>945,9642=>678,9643=>678,9644=>945,9645=>945,9646=>550,9647=>550,9648=>769,9649=>769,9650=>769,9651=>769,9652=>502,9653=>502,9654=>769,9655=>769,9656=>502,9657=>502,9658=>769,9659=>769,9660=>769,9661=>769,9662=>502,9663=>502,9664=>769,9665=>769,9666=>502,9667=>502,9668=>769,9669=>769,9670=>769,9671=>769,9672=>769,9673=>873,9674=>494,9675=>873,9676=>873,9677=>873,9678=>873,9679=>873,9680=>873,9681=>873,9682=>873,9683=>873,9684=>873,9685=>873,9686=>527,9687=>527,9688=>791,9689=>970,9690=>970,9691=>970,9692=>387,9693=>387,9694=>387,9695=>387,9696=>873,9697=>873,9698=>769,9699=>769,9700=>769,9701=>769,9702=>590,9703=>945,9704=>945,9705=>945,9706=>945,9707=>945,9708=>769,9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945,9714=>945,9715=>945,9716=>873,9717=>873,9718=>873,9719=>873,9720=>769,9721=>769,9722=>769,9723=>830,9724=>830,9725=>732,9726=>732,9727=>769,9728=>896,9729=>1000,9730=>896,9731=>896,9732=>896,9733=>896,9734=>896,9735=>573,9736=>896,9737=>896,9738=>888,9739=>888,9740=>671,9741=>1013,9742=>1246,9743=>1250,9744=>896,9745=>896,9746=>896,9747=>532,9748=>896,9749=>896,9750=>896,9751=>896,9752=>896,9753=>896,9754=>896,9755=>896,9756=>896,9757=>609,9758=>896,9759=>609,9760=>896,9761=>896,9762=>896,9763=>896,9764=>669,9765=>746,9766=>649,9767=>784,9768=>545,9769=>896,9770=>896,9771=>896,9772=>710,9773=>896,9774=>896,9775=>896,9776=>896,9777=>896,9778=>896,9779=>896,9780=>896,9781=>896,9782=>896,9783=>896,9784=>896,9785=>1042,9786=>1042,9787=>1042,9788=>896,9789=>896,9790=>896,9791=>614,9792=>732,9793=>732,9794=>896,9795=>896,9796=>896,9797=>896,9798=>896,9799=>896,9800=>896,9801=>896,9802=>896,9803=>896,9804=>896,9805=>896,9806=>896,9807=>896,9808=>896,9809=>896,9810=>896,9811=>896,9812=>896,9813=>896,9814=>896,9815=>896,9816=>896,9817=>896,9818=>896,9819=>896,9820=>896,9821=>896,9822=>896,9823=>896,9824=>896,9825=>896,9826=>896,9827=>896,9828=>896,9829=>896,9830=>896,9831=>896,9832=>896,9833=>472,9834=>638,9835=>896,9836=>896,9837=>472,9838=>357,9839=>484,9840=>748,9841=>766,9842=>896,9843=>896,9844=>896,9845=>896,9846=>896,9847=>896,9848=>896,9849=>896,9850=>896,9851=>896,9852=>896,9853=>896,9854=>896,9855=>896,9856=>869,9857=>869,9858=>869,9859=>869,9860=>869,9861=>869,9862=>896,9863=>896,9864=>896,9865=>896,9866=>896,9867=>896,9868=>896,9869=>896,9870=>896,9871=>896,9872=>896,9873=>896,9874=>896,9875=>896,9876=>896,9877=>541,9878=>896,9879=>896,9880=>896,9881=>896,9882=>896,9883=>896,9884=>896,9888=>896,9889=>702,9890=>1004,9891=>1089,9892=>1175,9893=>903,9894=>838,9895=>838,9896=>838,9897=>838,9898=>838,9899=>838,9900=>838,9901=>838,9902=>838,9903=>838,9904=>844,9905=>838,9906=>732,9907=>732,9908=>732,9909=>732,9910=>850,9911=>732,9912=>732,9920=>838,9921=>838,9922=>838,9923=>838,9954=>732,9985=>838,9986=>838,9987=>838,9988=>838,9990=>838,9991=>838,9992=>838,9993=>838,9996=>838,9997=>838,9998=>838,9999=>838,10000=>838,10001=>838,10002=>838,10003=>838,10004=>838,10005=>838,10006=>838,10007=>838,10008=>838,10009=>838,10010=>838,10011=>838,10012=>838,10013=>838,10014=>838,10015=>838,10016=>838,10017=>838,10018=>838,10019=>838,10020=>838,10021=>838,10022=>838,10023=>838,10025=>838,10026=>838,10027=>838,10028=>838,10029=>838,10030=>838,10031=>838,10032=>838,10033=>838,10034=>838,10035=>838,10036=>838,10037=>838,10038=>838,10039=>838,10040=>838,10041=>838,10042=>838,10043=>838,10044=>838,10045=>838,10046=>838,10047=>838,10048=>838,10049=>838,10050=>838,10051=>838,10052=>838,10053=>838,10054=>838,10055=>838,10056=>838,10057=>838,10058=>838,10059=>838,10061=>896,10063=>896,10064=>896,10065=>896,10066=>896,10070=>896,10072=>838,10073=>838,10074=>838,10075=>322,10076=>322,10077=>538,10078=>538,10081=>838,10082=>838,10083=>838,10084=>838,10085=>838,10086=>838,10087=>838,10088=>838,10089=>838,10090=>838,10091=>838,10092=>838,10093=>838,10094=>838,10095=>838,10096=>838,10097=>838,10098=>838,10099=>838,10100=>838,10101=>838,10102=>896,10103=>896,10104=>896,10105=>896,10106=>896,10107=>896,10108=>896,10109=>896,10110=>896,10111=>896,10112=>838,10113=>838,10114=>838,10115=>838,10116=>838,10117=>838,10118=>838,10119=>838,10120=>838,10121=>838,10122=>838,10123=>838,10124=>838,10125=>838,10126=>838,10127=>838,10128=>838,10129=>838,10130=>838,10131=>838,10132=>838,10136=>838,10137=>838,10138=>838,10139=>838,10140=>838,10141=>838,10142=>838,10143=>838,10144=>838,10145=>838,10146=>838,10147=>838,10148=>838,10149=>838,10150=>838,10151=>838,10152=>838,10153=>838,10154=>838,10155=>838,10156=>838,10157=>838,10158=>838,10159=>838,10161=>838,10162=>838,10163=>838,10164=>838,10165=>838,10166=>838,10167=>838,10168=>838,10169=>838,10170=>838,10171=>838,10172=>838,10173=>838,10174=>838,10181=>390,10182=>390,10208=>494,10214=>495,10215=>495,10216=>390,10217=>390,10218=>556,10219=>556,10224=>838,10225=>838,10226=>838,10227=>838,10228=>1157,10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434,10237=>1434,10238=>1434,10239=>1434,10240=>732,10241=>732,10242=>732,10243=>732,10244=>732,10245=>732,10246=>732,10247=>732,10248=>732,10249=>732,10250=>732,10251=>732,10252=>732,10253=>732,10254=>732,10255=>732,10256=>732,10257=>732,10258=>732,10259=>732,10260=>732,10261=>732,10262=>732,10263=>732,10264=>732,10265=>732,10266=>732,10267=>732,10268=>732,10269=>732,10270=>732,10271=>732,10272=>732,10273=>732,10274=>732,10275=>732,10276=>732,10277=>732,10278=>732,10279=>732,10280=>732,10281=>732,10282=>732,10283=>732,10284=>732,10285=>732,10286=>732,10287=>732,10288=>732,10289=>732,10290=>732,10291=>732,10292=>732,10293=>732,10294=>732,10295=>732,10296=>732,10297=>732,10298=>732,10299=>732,10300=>732,10301=>732,10302=>732,10303=>732,10304=>732,10305=>732,10306=>732,10307=>732,10308=>732,10309=>732,10310=>732,10311=>732,10312=>732,10313=>732,10314=>732,10315=>732,10316=>732,10317=>732,10318=>732,10319=>732,10320=>732,10321=>732,10322=>732,10323=>732,10324=>732,10325=>732,10326=>732,10327=>732,10328=>732,10329=>732,10330=>732,10331=>732,10332=>732,10333=>732,10334=>732,10335=>732,10336=>732,10337=>732,10338=>732,10339=>732,10340=>732,10341=>732,10342=>732,10343=>732,10344=>732,10345=>732,10346=>732,10347=>732,10348=>732,10349=>732,10350=>732,10351=>732,10352=>732,10353=>732,10354=>732,10355=>732,10356=>732,10357=>732,10358=>732,10359=>732,10360=>732,10361=>732,10362=>732,10363=>732,10364=>732,10365=>732,10366=>732,10367=>732,10368=>732,10369=>732,10370=>732,10371=>732,10372=>732,10373=>732,10374=>732,10375=>732,10376=>732,10377=>732,10378=>732,10379=>732,10380=>732,10381=>732,10382=>732,10383=>732,10384=>732,10385=>732,10386=>732,10387=>732,10388=>732,10389=>732,10390=>732,10391=>732,10392=>732,10393=>732,10394=>732,10395=>732,10396=>732,10397=>732,10398=>732,10399=>732,10400=>732,10401=>732,10402=>732,10403=>732,10404=>732,10405=>732,10406=>732,10407=>732,10408=>732,10409=>732,10410=>732,10411=>732,10412=>732,10413=>732,10414=>732,10415=>732,10416=>732,10417=>732,10418=>732,10419=>732,10420=>732,10421=>732,10422=>732,10423=>732,10424=>732,10425=>732,10426=>732,10427=>732,10428=>732,10429=>732,10430=>732,10431=>732,10432=>732,10433=>732,10434=>732,10435=>732,10436=>732,10437=>732,10438=>732,10439=>732,10440=>732,10441=>732,10442=>732,10443=>732,10444=>732,10445=>732,10446=>732,10447=>732,10448=>732,10449=>732,10450=>732,10451=>732,10452=>732,10453=>732,10454=>732,10455=>732,10456=>732,10457=>732,10458=>732,10459=>732,10460=>732,10461=>732,10462=>732,10463=>732,10464=>732,10465=>732,10466=>732,10467=>732,10468=>732,10469=>732,10470=>732,10471=>732,10472=>732,10473=>732,10474=>732,10475=>732,10476=>732,10477=>732,10478=>732,10479=>732,10480=>732,10481=>732,10482=>732,10483=>732,10484=>732,10485=>732,10486=>732,10487=>732,10488=>732,10489=>732,10490=>732,10491=>732,10492=>732,10493=>732,10494=>732,10495=>732,10502=>838,10503=>838,10506=>838,10507=>838,10560=>683,10561=>683,10627=>734,10628=>734,10702=>838,10703=>1000,10704=>1000,10705=>1000,10706=>1000,10707=>1000,10708=>1000,10709=>1000,10731=>494,10746=>838,10747=>838,10752=>1000,10753=>1000,10754=>1000,10764=>1325,10765=>521,10766=>521,10767=>521,10768=>521,10769=>521,10770=>521,10771=>521,10772=>521,10773=>521,10774=>521,10775=>521,10776=>521,10777=>521,10778=>521,10779=>521,10780=>521,10799=>838,10858=>838,10859=>838,10877=>838,10878=>838,10879=>838,10880=>838,10881=>838,10882=>838,10883=>838,10884=>838,10885=>838,10886=>838,10887=>838,10888=>838,10889=>838,10890=>838,10891=>838,10892=>838,10893=>838,10894=>838,10895=>838,10896=>838,10897=>838,10898=>838,10899=>838,10900=>838,10901=>838,10902=>838,10903=>838,10904=>838,10905=>838,10906=>838,10907=>838,10908=>838,10909=>838,10910=>838,10911=>838,10912=>838,10926=>838,10927=>838,10928=>838,10929=>838,10930=>838,10931=>838,10932=>838,10933=>838,10934=>838,10935=>838,10936=>838,10937=>838,10938=>838,11001=>838,11002=>838,11008=>838,11009=>838,11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838,11016=>838,11017=>838,11018=>838,11019=>838,11020=>838,11021=>838,11022=>836,11023=>836,11024=>836,11025=>836,11026=>945,11027=>945,11028=>945,11029=>945,11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11039=>869,11040=>869,11041=>873,11042=>873,11043=>873,11044=>1119,11091=>869,11092=>869,11360=>557,11361=>278,11362=>557,11363=>603,11364=>695,11365=>613,11366=>392,11367=>752,11368=>634,11369=>656,11370=>579,11371=>685,11372=>525,11373=>781,11374=>863,11375=>684,11376=>781,11377=>734,11378=>1128,11379=>961,11380=>592,11381=>654,11382=>568,11383=>660,11385=>414,11386=>612,11387=>491,11388=>175,11389=>431,11390=>635,11391=>685,11520=>591,11521=>595,11522=>564,11523=>602,11524=>587,11525=>911,11526=>626,11527=>952,11528=>595,11529=>607,11530=>954,11531=>620,11532=>595,11533=>926,11534=>595,11535=>806,11536=>931,11537=>584,11538=>592,11539=>923,11540=>953,11541=>828,11542=>596,11543=>595,11544=>590,11545=>592,11546=>592,11547=>621,11548=>920,11549=>589,11550=>586,11551=>581,11552=>914,11553=>596,11554=>595,11555=>592,11556=>642,11557=>901,11568=>646,11569=>888,11570=>888,11571=>682,11572=>684,11573=>635,11574=>562,11575=>684,11576=>684,11577=>632,11578=>632,11579=>683,11580=>875,11581=>685,11582=>491,11583=>685,11584=>888,11585=>888,11586=>300,11587=>627,11588=>752,11589=>656,11590=>527,11591=>685,11592=>645,11593=>632,11594=>502,11595=>953,11596=>778,11597=>748,11598=>621,11599=>295,11600=>778,11601=>295,11602=>752,11603=>633,11604=>888,11605=>888,11606=>752,11607=>320,11608=>749,11609=>888,11610=>888,11611=>698,11612=>768,11613=>685,11614=>698,11615=>622,11616=>684,11617=>752,11618=>632,11619=>788,11620=>567,11621=>788,11631=>515,11800=>531,11806=>838,11810=>390,11811=>390,11812=>390,11813=>390,11822=>531,19904=>896,19905=>896,19906=>896,19907=>896,19908=>896,19909=>896,19910=>896,19911=>896,19912=>896,19913=>896,19914=>896,19915=>896,19916=>896,19917=>896,19918=>896,19919=>896,19920=>896,19921=>896,19922=>896,19923=>896,19924=>896,19925=>896,19926=>896,19927=>896,19928=>896,19929=>896,19930=>896,19931=>896,19932=>896,19933=>896,19934=>896,19935=>896,19936=>896,19937=>896,19938=>896,19939=>896,19940=>896,19941=>896,19942=>896,19943=>896,19944=>896,19945=>896,19946=>896,19947=>896,19948=>896,19949=>896,19950=>896,19951=>896,19952=>896,19953=>896,19954=>896,19955=>896,19956=>896,19957=>896,19958=>896,19959=>896,19960=>896,19961=>896,19962=>896,19963=>896,19964=>896,19965=>896,19966=>896,19967=>896,42192=>686,42193=>603,42194=>603,42195=>770,42196=>611,42197=>611,42198=>775,42199=>656,42200=>656,42201=>512,42202=>698,42203=>703,42204=>685,42205=>575,42206=>575,42207=>863,42208=>748,42209=>557,42210=>635,42211=>695,42212=>695,42213=>684,42214=>684,42215=>752,42216=>775,42217=>512,42218=>989,42219=>685,42220=>611,42221=>686,42222=>684,42223=>684,42224=>632,42225=>632,42226=>295,42227=>787,42228=>732,42229=>732,42230=>557,42231=>767,42232=>300,42233=>300,42234=>596,42235=>596,42236=>300,42237=>300,42238=>588,42239=>588,42564=>635,42565=>521,42566=>354,42567=>338,42572=>1180,42573=>1028,42576=>1029,42577=>906,42580=>1080,42581=>842,42582=>977,42583=>843,42594=>1062,42595=>912,42596=>1066,42597=>901,42598=>1178,42599=>1008,42600=>787,42601=>612,42602=>855,42603=>712,42604=>1358,42605=>1019,42606=>879,42634=>782,42635=>685,42636=>611,42637=>583,42644=>686,42645=>634,42760=>493,42761=>493,42762=>493,42763=>493,42764=>493,42765=>493,42766=>493,42767=>493,42768=>493,42769=>493,42770=>493,42771=>493,42772=>493,42773=>493,42774=>493,42779=>369,42780=>369,42781=>252,42782=>252,42783=>252,42786=>385,42787=>356,42788=>472,42789=>472,42790=>752,42791=>634,42792=>878,42793=>709,42794=>614,42795=>541,42800=>491,42801=>521,42802=>1250,42803=>985,42804=>1203,42805=>990,42806=>1142,42807=>981,42808=>971,42809=>818,42810=>971,42811=>818,42812=>959,42813=>818,42814=>703,42815=>549,42816=>656,42817=>583,42822=>680,42823=>392,42824=>582,42825=>427,42826=>807,42827=>704,42830=>1358,42831=>1019,42832=>603,42833=>635,42834=>734,42835=>774,42838=>787,42839=>635,42852=>605,42853=>635,42854=>605,42855=>635,42880=>557,42881=>278,42882=>735,42883=>634,42889=>337,42890=>376,42891=>401,42892=>275,42893=>686,42894=>487,42896=>772,42897=>667,42912=>775,42913=>635,42914=>656,42915=>579,42916=>748,42917=>634,42918=>695,42919=>411,42920=>635,42921=>521,42922=>801,43002=>915,43003=>575,43004=>603,43005=>863,43006=>295,43007=>1199,61184=>213,61185=>238,61186=>257,61187=>264,61188=>267,61189=>238,61190=>213,61191=>238,61192=>257,61193=>264,61194=>257,61195=>238,61196=>213,61197=>238,61198=>257,61199=>264,61200=>257,61201=>238,61202=>213,61203=>238,61204=>267,61205=>264,61206=>257,61207=>238,61208=>213,61209=>275,61440=>977,61441=>977,61442=>977,61443=>977,62464=>580,62465=>580,62466=>624,62467=>889,62468=>585,62469=>580,62470=>653,62471=>882,62472=>555,62473=>580,62474=>1168,62475=>589,62476=>590,62477=>869,62478=>580,62479=>589,62480=>914,62481=>590,62482=>731,62483=>583,62484=>872,62485=>589,62486=>895,62487=>589,62488=>589,62489=>590,62490=>649,62491=>589,62492=>589,62493=>599,62494=>590,62495=>516,62496=>580,62497=>584,62498=>580,62499=>580,62500=>581,62501=>638,62502=>955,62504=>931,62505=>808,62506=>508,62507=>508,62508=>508,62509=>508,62510=>508,62511=>508,62512=>508,62513=>508,62514=>508,62515=>508,62516=>518,62517=>518,62518=>518,62519=>787,62520=>787,62521=>787,62522=>787,62523=>787,62524=>546,62525=>546,62526=>546,62527=>546,62528=>546,62529=>546,63173=>612,64256=>689,64257=>630,64258=>630,64259=>967,64260=>967,64261=>686,64262=>861,64275=>1202,64276=>1202,64277=>1196,64278=>1186,64279=>1529,64285=>224,64286=>0,64287=>331,64288=>636,64289=>856,64290=>774,64291=>906,64292=>771,64293=>843,64294=>855,64295=>807,64296=>875,64297=>838,64298=>708,64299=>708,64300=>708,64301=>708,64302=>668,64303=>668,64304=>668,64305=>578,64306=>412,64307=>546,64308=>653,64309=>355,64310=>406,64312=>648,64313=>330,64314=>537,64315=>529,64316=>568,64318=>679,64320=>399,64321=>649,64323=>640,64324=>625,64326=>593,64327=>709,64328=>564,64329=>708,64330=>657,64331=>272,64332=>578,64333=>529,64334=>625,64335=>629,64338=>941,64339=>982,64340=>278,64341=>302,64342=>941,64343=>982,64344=>278,64345=>302,64346=>941,64347=>982,64348=>278,64349=>302,64350=>941,64351=>982,64352=>278,64353=>302,64354=>941,64355=>982,64356=>278,64357=>302,64358=>941,64359=>982,64360=>278,64361=>302,64362=>1037,64363=>1035,64364=>478,64365=>506,64366=>1037,64367=>1035,64368=>478,64369=>506,64370=>646,64371=>646,64372=>618,64373=>646,64374=>646,64375=>646,64376=>618,64377=>646,64378=>646,64379=>646,64380=>618,64381=>646,64382=>646,64383=>646,64384=>618,64385=>646,64386=>445,64387=>525,64388=>445,64389=>525,64390=>445,64391=>525,64392=>445,64393=>525,64394=>483,64395=>552,64396=>483,64397=>552,64398=>895,64399=>895,64400=>476,64401=>552,64402=>895,64403=>895,64404=>476,64405=>552,64406=>895,64407=>895,64408=>476,64409=>552,64410=>895,64411=>895,64412=>476,64413=>552,64414=>734,64415=>761,64416=>734,64417=>761,64418=>278,64419=>302,64426=>698,64427=>632,64428=>527,64429=>461,64467=>824,64468=>843,64469=>476,64470=>552,64473=>483,64474=>517,64488=>278,64489=>302,64508=>783,64509=>833,64510=>278,64511=>302,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0,65059=>0,65136=>293,65137=>293,65138=>293,65139=>262,65140=>293,65142=>293,65143=>293,65144=>293,65145=>293,65146=>293,65147=>293,65148=>293,65149=>293,65150=>293,65151=>293,65152=>470,65153=>278,65154=>305,65155=>278,65156=>305,65157=>483,65158=>517,65159=>278,65160=>305,65161=>783,65162=>833,65163=>278,65164=>302,65165=>278,65166=>305,65167=>941,65168=>982,65169=>278,65170=>302,65171=>524,65172=>536,65173=>941,65174=>982,65175=>278,65176=>302,65177=>941,65178=>982,65179=>278,65180=>302,65181=>646,65182=>646,65183=>618,65184=>646,65185=>646,65186=>646,65187=>618,65188=>646,65189=>646,65190=>646,65191=>618,65192=>646,65193=>445,65194=>525,65195=>445,65196=>525,65197=>483,65198=>552,65199=>483,65200=>552,65201=>1221,65202=>1275,65203=>838,65204=>892,65205=>1221,65206=>1275,65207=>838,65208=>892,65209=>1209,65210=>1225,65211=>849,65212=>867,65213=>1209,65214=>1225,65215=>849,65216=>867,65217=>925,65218=>949,65219=>796,65220=>820,65221=>925,65222=>949,65223=>796,65224=>820,65225=>597,65226=>532,65227=>597,65228=>482,65229=>597,65230=>532,65231=>523,65232=>482,65233=>1037,65234=>1035,65235=>478,65236=>506,65237=>776,65238=>834,65239=>478,65240=>506,65241=>824,65242=>843,65243=>476,65244=>552,65245=>727,65246=>757,65247=>305,65248=>331,65249=>619,65250=>666,65251=>536,65252=>578,65253=>734,65254=>761,65255=>278,65256=>302,65257=>524,65258=>536,65259=>527,65260=>461,65261=>483,65262=>517,65263=>783,65264=>833,65265=>783,65266=>833,65267=>278,65268=>302,65269=>570,65270=>597,65271=>570,65272=>597,65273=>570,65274=>597,65275=>570,65276=>597,65279=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1025,65535=>600); -// --- EOF --- diff --git a/#pma/libraries/tcpdf/fonts/dejavusans.z b/#pma/libraries/tcpdf/fonts/dejavusans.z deleted file mode 100644 index d0c4d3de..00000000 Binary files a/#pma/libraries/tcpdf/fonts/dejavusans.z and /dev/null differ diff --git a/#pma/libraries/tcpdf/fonts/dejavusansb.ctg.z b/#pma/libraries/tcpdf/fonts/dejavusansb.ctg.z deleted file mode 100644 index 71cef637..00000000 Binary files a/#pma/libraries/tcpdf/fonts/dejavusansb.ctg.z and /dev/null differ diff --git a/#pma/libraries/tcpdf/fonts/dejavusansb.php b/#pma/libraries/tcpdf/fonts/dejavusansb.php deleted file mode 100644 index 5214aef7..00000000 --- a/#pma/libraries/tcpdf/fonts/dejavusansb.php +++ /dev/null @@ -1,16 +0,0 @@ -32,'FontBBox'=>'[-1069 -415 1975 1174]','ItalicAngle'=>0,'Ascent'=>928,'Descent'=>-236,'Leading'=>0,'CapHeight'=>729,'XHeight'=>547,'StemV'=>60,'StemH'=>26,'AvgWidth'=>573,'MaxWidth'=>2016,'MissingWidth'=>600); -$cbbox=array(0=>array(50,-177,550,705),33=>array(140,0,316,729),34=>array(95,458,426,729),35=>array(68,0,770,718),36=>array(78,-147,628,760),37=>array(32,-14,970,742),38=>array(60,-14,830,742),39=>array(95,458,211,729),40=>array(86,-132,377,759),41=>array(80,-132,371,759),42=>array(20,278,503,742),43=>array(106,0,732,627),44=>array(53,-142,278,189),45=>array(54,217,361,359),46=>array(102,0,278,189),47=>array(0,-93,365,729),48=>array(48,-14,648,742),49=>array(113,0,627,729),50=>array(79,0,609,742),51=>array(67,-14,616,742),52=>array(45,0,650,729),53=>array(77,-14,626,729),54=>array(62,-14,642,741),55=>array(67,0,616,729),56=>array(61,-14,634,742),57=>array(52,-14,632,741),58=>array(112,0,288,547),59=>array(63,-142,288,547),60=>array(106,30,732,597),61=>array(106,144,732,482),62=>array(106,30,732,597),63=>array(69,0,515,742),64=>array(66,-174,929,703),65=>array(5,0,769,729),66=>array(92,0,692,729),67=>array(50,-14,670,742),68=>array(92,0,778,729),69=>array(92,0,610,729),70=>array(92,0,599,729),71=>array(50,-14,747,742),72=>array(92,0,745,729),73=>array(92,0,280,729),74=>array(-56,-200,280,729),75=>array(92,0,805,729),76=>array(92,0,610,729),77=>array(92,0,903,729),78=>array(92,0,745,729),79=>array(50,-14,800,742),80=>array(92,0,692,729),81=>array(50,-146,800,742),82=>array(92,0,750,729),83=>array(72,-14,647,742),84=>array(5,0,677,729),85=>array(92,-14,720,729),86=>array(5,0,769,729),87=>array(30,0,1072,729),88=>array(19,0,751,729),89=>array(-10,0,734,729),90=>array(45,0,680,729),91=>array(86,-132,389,760),92=>array(0,-93,365,729),93=>array(68,-132,371,760),94=>array(101,457,737,729),95=>array(0,-236,500,-143),96=>array(46,616,322,800),97=>array(43,-14,596,560),98=>array(84,-14,671,760),99=>array(43,-14,526,560),100=>array(45,-14,632,760),101=>array(43,-14,630,560),102=>array(19,0,444,760),103=>array(45,-216,632,559),104=>array(84,0,634,760),105=>array(84,0,259,760),106=>array(-33,-216,259,760),107=>array(84,0,684,760),108=>array(84,0,259,760),109=>array(83,0,963,560),110=>array(84,0,634,560),111=>array(43,-14,644,560),112=>array(84,-208,671,560),113=>array(45,-208,632,559),114=>array(84,0,490,560),115=>array(52,-14,548,560),116=>array(13,0,455,702),117=>array(78,-14,628,547),118=>array(15,0,637,547),119=>array(35,0,889,547),120=>array(15,0,630,547),121=>array(12,-216,634,547),122=>array(45,0,534,547),123=>array(125,-163,587,760),124=>array(127,-236,238,764),125=>array(125,-163,587,760),126=>array(106,212,732,415),161=>array(140,0,316,729),162=>array(85,-153,567,699),163=>array(61,0,613,742),164=>array(36,30,601,596),165=>array(12,0,684,729),166=>array(127,-171,238,699),167=>array(7,-95,496,742),168=>array(96,654,404,774),169=>array(138,0,862,725),170=>array(77,182,489,742),171=>array(77,67,552,519),172=>array(106,140,732,444),173=>array(54,217,361,359),174=>array(138,0,862,725),175=>array(96,668,404,760),176=>array(87,424,412,749),177=>array(106,0,732,627),178=>array(53,326,382,742),179=>array(44,319,384,742),180=>array(178,616,454,800),181=>array(85,-209,704,547),182=>array(63,-96,549,729),183=>array(102,253,278,442),184=>array(128,-196,349,0),185=>array(60,326,382,734),186=>array(57,182,507,742),187=>array(94,67,569,519),188=>array(49,-14,957,742),189=>array(49,-14,987,742),190=>array(51,-14,957,742),191=>array(69,-14,515,729),192=>array(5,0,769,927),193=>array(5,0,769,927),194=>array(5,0,769,927),195=>array(5,0,769,931),196=>array(5,0,769,927),197=>array(5,0,769,928),198=>array(0,0,1012,729),199=>array(50,-196,670,742),200=>array(92,0,610,927),201=>array(92,0,610,927),202=>array(92,0,610,927),203=>array(92,0,610,927),204=>array(11,0,280,927),205=>array(92,0,337,927),206=>array(1,0,370,927),207=>array(32,0,339,927),208=>array(16,0,787,729),209=>array(92,0,745,928),210=>array(50,-14,800,927),211=>array(50,-14,800,927),212=>array(50,-14,800,927),213=>array(50,-14,800,928),214=>array(50,-14,800,927),215=>array(125,20,713,607),216=>array(22,-36,823,765),217=>array(92,-14,720,927),218=>array(92,-14,720,927),219=>array(92,-14,720,927),220=>array(92,-14,720,927),221=>array(-10,0,734,927),222=>array(92,0,692,729),223=>array(84,-14,676,760),224=>array(43,-14,596,800),225=>array(43,-14,596,800),226=>array(43,-14,596,800),227=>array(43,-14,596,778),228=>array(43,-14,596,774),229=>array(43,-14,596,888),230=>array(43,-14,1000,560),231=>array(43,-196,526,560),232=>array(43,-14,630,800),233=>array(43,-14,630,800),234=>array(43,-14,630,800),235=>array(43,-14,630,774),236=>array(-21,0,259,800),237=>array(84,0,387,800),238=>array(-13,0,355,800),239=>array(17,0,325,774),240=>array(43,-14,644,760),241=>array(84,0,634,778),242=>array(43,-14,644,800),243=>array(43,-14,644,800),244=>array(43,-14,644,800),245=>array(43,-14,644,778),246=>array(43,-14,644,774),247=>array(106,42,732,585),248=>array(38,-46,645,594),249=>array(78,-14,628,800),250=>array(78,-14,628,800),251=>array(78,-14,628,800),252=>array(78,-14,628,774),253=>array(12,-216,634,800),254=>array(84,-208,671,760),255=>array(12,-216,634,774),256=>array(5,0,769,914),257=>array(43,-14,596,763),258=>array(5,0,769,935),259=>array(43,-14,596,780),260=>array(5,-196,769,729),261=>array(43,-196,596,560),262=>array(50,-14,670,927),263=>array(43,-14,557,800),264=>array(50,-14,670,927),265=>array(43,-14,542,800),266=>array(50,-14,670,927),267=>array(43,-14,526,760),268=>array(50,-14,670,927),269=>array(43,-14,537,800),270=>array(92,0,778,927),271=>array(45,-14,871,760),272=>array(16,0,787,729),273=>array(45,-14,707,760),274=>array(92,0,610,914),275=>array(43,-14,630,763),276=>array(92,0,610,927),277=>array(43,-14,630,784),278=>array(92,0,610,927),279=>array(43,-14,630,760),280=>array(92,-196,610,729),281=>array(43,-196,630,560),282=>array(92,0,610,927),283=>array(43,-14,630,800),284=>array(50,-14,747,927),285=>array(45,-216,632,800),286=>array(50,-14,747,927),287=>array(45,-216,632,784),288=>array(50,-14,747,927),289=>array(45,-216,632,760),290=>array(50,-224,747,742),291=>array(45,-216,632,765),292=>array(92,0,745,927),293=>array(-9,0,634,927),294=>array(92,0,882,729),295=>array(81,0,709,760),296=>array(16,0,355,928),297=>array(1,0,341,778),298=>array(32,0,339,914),299=>array(18,0,325,763),300=>array(21,0,350,927),301=>array(7,0,335,784),302=>array(92,-196,366,729),303=>array(84,-196,345,760),304=>array(92,0,280,927),305=>array(84,0,259,547),306=>array(92,-200,651,729),307=>array(84,-216,602,760),308=>array(-56,-200,370,927),309=>array(-33,-216,355,800),310=>array(92,-209,805,729),311=>array(84,-209,684,760),312=>array(84,0,684,547),313=>array(92,0,610,928),314=>array(84,0,357,928),315=>array(92,-209,610,729),316=>array(71,-209,273,760),317=>array(92,0,610,729),318=>array(84,0,479,760),319=>array(92,0,610,729),320=>array(84,0,484,760),321=>array(-45,0,615,729),322=>array(-18,0,390,760),323=>array(92,0,745,928),324=>array(84,0,634,803),325=>array(92,-209,745,729),326=>array(84,-209,634,560),327=>array(92,0,745,927),328=>array(84,0,634,800),329=>array(51,0,891,729),330=>array(84,-200,730,742),331=>array(84,-216,634,560),332=>array(50,-14,800,914),333=>array(43,-14,644,763),334=>array(50,-14,800,927),335=>array(43,-14,644,787),336=>array(50,-14,800,927),337=>array(43,-14,644,800),338=>array(50,-1,1094,730),339=>array(43,-14,1046,560),340=>array(92,0,750,928),341=>array(84,0,515,803),342=>array(92,-209,750,729),343=>array(71,-209,490,560),344=>array(92,0,750,927),345=>array(84,0,490,800),346=>array(72,-14,647,928),347=>array(52,-14,548,803),348=>array(72,-14,647,927),349=>array(52,-14,548,800),350=>array(72,-196,647,742),351=>array(52,-196,548,560),352=>array(72,-14,647,927),353=>array(52,-14,548,800),354=>array(5,-196,677,729),355=>array(13,-196,455,702),356=>array(5,0,677,930),357=>array(13,0,507,814),358=>array(5,0,677,729),359=>array(13,0,455,702),360=>array(92,-14,720,928),361=>array(78,-14,628,778),362=>array(92,-14,720,914),363=>array(78,-14,628,763),364=>array(92,-14,720,927),365=>array(78,-14,628,784),366=>array(92,-14,720,929),367=>array(78,-14,628,881),368=>array(92,-14,720,927),369=>array(78,-14,628,800),370=>array(92,-196,720,729),371=>array(78,-196,716,547),372=>array(30,0,1072,931),373=>array(35,0,889,800),374=>array(-10,0,734,931),375=>array(12,-216,634,800),376=>array(-10,0,734,927),377=>array(45,0,680,928),378=>array(45,0,534,803),379=>array(45,0,680,929),380=>array(45,0,534,760),381=>array(45,0,680,927),382=>array(45,0,534,800),383=>array(19,0,444,760),384=>array(9,-14,671,760),385=>array(-68,0,741,729),386=>array(92,0,692,729),387=>array(84,-14,671,760),388=>array(40,0,731,729),389=>array(25,-14,696,760),390=>array(50,-14,670,742),391=>array(50,-14,818,924),392=>array(43,-14,643,724),393=>array(16,0,787,729),394=>array(-68,0,827,729),395=>array(70,0,669,729),396=>array(45,-14,632,760),397=>array(43,-222,645,560),398=>array(92,0,610,729),399=>array(51,-14,800,742),400=>array(67,-14,616,742),401=>array(-56,-200,599,729),402=>array(-57,-208,444,760),403=>array(50,-14,868,924),404=>array(2,-211,793,730),405=>array(84,0,1000,760),406=>array(92,0,428,729),407=>array(5,0,384,729),408=>array(92,0,805,742),409=>array(84,0,684,760),410=>array(5,0,355,760),411=>array(-11,0,562,760),412=>array(83,-13,963,729),413=>array(-56,-200,745,729),414=>array(84,-208,634,560),415=>array(50,-14,800,742),416=>array(53,-14,854,761),417=>array(46,-14,708,609),418=>array(50,-14,1007,742),419=>array(43,-216,826,560),420=>array(-68,0,741,729),421=>array(84,-208,671,760),422=>array(92,-146,760,729),423=>array(26,-14,601,742),424=>array(15,-14,511,560),425=>array(92,0,610,729),426=>array(-31,-217,561,760),427=>array(13,-216,455,702),428=>array(15,0,701,729),429=>array(13,0,455,760),430=>array(5,-200,677,729),431=>array(91,-14,833,761),432=>array(75,-14,733,609),433=>array(27,-14,823,728),434=>array(92,0,772,729),435=>array(-10,0,796,742),436=>array(12,-216,778,560),437=>array(45,0,680,729),438=>array(45,0,534,547),439=>array(72,-33,728,729),440=>array(41,-33,696,729),441=>array(37,-215,586,547),442=>array(57,-208,534,547),443=>array(79,0,609,742),444=>array(41,-33,728,729),445=>array(37,-215,586,547),446=>array(36,-15,525,702),447=>array(84,-208,671,560),448=>array(92,-208,280,729),449=>array(92,-208,566,729),450=>array(5,-208,536,729),451=>array(99,0,274,729),452=>array(92,0,1510,927),453=>array(92,0,1364,800),454=>array(45,-14,1250,800),455=>array(92,-200,917,729),456=>array(92,-216,896,760),457=>array(84,-216,602,760),458=>array(92,-200,1117,729),459=>array(92,-216,1096,760),460=>array(84,-216,971,760),461=>array(5,0,769,927),462=>array(43,-14,596,800),463=>array(3,0,371,927),464=>array(2,0,370,800),465=>array(50,-14,800,927),466=>array(43,-14,644,800),467=>array(92,-14,720,927),468=>array(78,-14,628,800),469=>array(92,-14,720,1040),470=>array(78,-14,628,914),471=>array(92,-14,720,1114),472=>array(78,-14,628,917),473=>array(92,-14,720,1114),474=>array(78,-14,628,917),475=>array(92,-14,720,1114),476=>array(78,-14,628,917),477=>array(43,-14,630,560),478=>array(5,0,769,1040),479=>array(43,-14,596,914),480=>array(5,0,769,1042),481=>array(43,-14,596,914),482=>array(0,0,1012,914),483=>array(43,-14,1000,758),484=>array(50,-14,792,742),485=>array(45,-216,674,559),486=>array(50,-14,747,927),487=>array(45,-216,632,800),488=>array(92,0,805,927),489=>array(-5,0,684,927),490=>array(50,-196,800,742),491=>array(43,-196,644,560),492=>array(50,-196,800,914),493=>array(43,-196,644,763),494=>array(72,-33,728,927),495=>array(43,-215,593,793),496=>array(-33,-216,359,800),497=>array(92,0,1510,729),498=>array(92,0,1364,729),499=>array(45,-14,1250,760),500=>array(50,-14,747,928),501=>array(45,-216,632,800),502=>array(92,-14,1186,729),503=>array(92,-208,737,742),504=>array(92,0,745,927),505=>array(84,0,634,800),506=>array(5,0,769,931),507=>array(43,-14,708,931),508=>array(0,0,1012,927),509=>array(43,-14,1000,800),510=>array(22,-36,823,927),511=>array(38,-46,645,800),512=>array(5,0,769,928),513=>array(43,-14,596,800),514=>array(5,0,769,923),515=>array(43,-14,596,784),516=>array(92,0,610,928),517=>array(43,-14,630,800),518=>array(92,0,610,923),519=>array(43,-14,630,784),520=>array(-41,0,377,928),521=>array(-3,0,381,800),522=>array(23,0,351,923),523=>array(7,0,335,784),524=>array(50,-14,800,928),525=>array(43,-14,644,800),526=>array(50,-14,800,923),527=>array(43,-14,644,784),528=>array(92,0,750,928),529=>array(58,0,490,800),530=>array(92,0,750,923),531=>array(84,0,490,784),532=>array(92,-14,720,928),533=>array(78,-14,628,800),534=>array(92,-14,720,923),535=>array(78,-14,628,784),536=>array(72,-239,647,742),537=>array(52,-239,548,560),538=>array(5,-239,677,729),539=>array(13,-239,455,702),540=>array(67,-210,616,742),541=>array(49,-211,544,560),542=>array(92,0,745,927),543=>array(-12,0,634,927),544=>array(84,-208,730,742),545=>array(45,-75,822,760),546=>array(61,-14,748,742),547=>array(43,-14,616,646),548=>array(45,-216,680,729),549=>array(45,-216,534,547),550=>array(5,0,769,927),551=>array(43,-14,596,760),552=>array(92,-192,610,729),553=>array(43,-196,630,560),554=>array(50,-14,800,1040),555=>array(43,-14,644,914),556=>array(50,-14,800,1040),557=>array(43,-14,644,898),558=>array(50,-14,800,927),559=>array(43,-14,644,760),560=>array(50,-14,800,1042),561=>array(43,-14,644,914),562=>array(-10,0,734,914),563=>array(12,-216,634,763),564=>array(84,-75,449,760),565=>array(84,-75,824,560),566=>array(13,-76,469,702),567=>array(-33,-216,259,547),568=>array(45,-14,1043,760),569=>array(45,-208,1043,560),570=>array(-14,-36,788,765),571=>array(-34,-36,768,765),572=>array(-7,-46,600,594),573=>array(-1,0,610,729),574=>array(-60,-36,742,765),575=>array(52,-240,595,560),576=>array(45,-240,595,547),577=>array(40,0,741,729),578=>array(42,0,573,560),579=>array(6,0,692,729),580=>array(23,-14,789,729),581=>array(5,0,769,729),582=>array(92,-93,610,822),583=>array(43,-93,630,640),584=>array(-56,-200,360,729),585=>array(-33,-216,360,760),586=>array(48,-200,927,741),587=>array(45,-216,800,560),588=>array(6,0,750,729),589=>array(-21,0,490,560),590=>array(-10,0,734,729),591=>array(-4,-216,656,547),592=>array(78,-14,631,560),593=>array(45,-14,632,560),594=>array(84,-14,671,560),595=>array(84,-14,671,760),596=>array(43,-14,526,560),597=>array(43,-69,526,560),598=>array(45,-216,750,760),599=>array(45,-14,801,760),600=>array(43,-14,630,560),601=>array(43,-14,630,560),602=>array(59,-14,885,560),603=>array(54,-14,493,560),604=>array(54,-14,493,560),605=>array(54,-14,769,560),606=>array(54,-14,665,560),607=>array(-33,-216,360,547),608=>array(45,-216,801,760),609=>array(45,-216,632,547),610=>array(43,-14,545,546),611=>array(25,-211,619,547),612=>array(25,-21,619,547),613=>array(78,-214,628,547),614=>array(84,0,634,760),615=>array(84,-216,634,760),616=>array(84,0,461,760),617=>array(83,0,356,547),618=>array(84,0,461,547),619=>array(84,0,475,760),620=>array(84,0,609,760),621=>array(85,-216,429,760),622=>array(84,-215,793,760),623=>array(79,-14,959,546),624=>array(79,-209,959,546),625=>array(83,-216,964,560),626=>array(-33,-216,634,560),627=>array(84,-216,802,560),628=>array(84,0,623,547),629=>array(43,-14,644,560),630=>array(43,-1,826,547),631=>array(51,0,630,574),632=>array(60,-208,729,760),633=>array(84,-13,490,547),634=>array(84,-13,490,760),635=>array(84,-216,659,547),636=>array(84,-208,490,560),637=>array(83,-216,490,560),638=>array(84,0,530,547),639=>array(84,0,530,547),640=>array(52,0,590,547),641=>array(52,0,590,547),642=>array(52,-216,548,560),643=>array(-33,-216,431,760),644=>array(-11,-216,444,760),645=>array(84,-216,539,560),646=>array(-31,-217,561,760),647=>array(13,-155,455,547),648=>array(13,-216,455,702),649=>array(84,-14,836,547),650=>array(79,-14,693,547),651=>array(83,0,625,547),652=>array(15,0,637,547),653=>array(35,0,889,547),654=>array(12,0,634,763),655=>array(64,0,660,547),656=>array(45,-216,703,547),657=>array(45,-69,617,547),658=>array(43,-215,593,547),659=>array(57,-215,593,547),660=>array(36,0,525,759),661=>array(36,0,525,759),662=>array(36,0,525,759),663=>array(36,-208,525,759),664=>array(50,-14,800,742),665=>array(84,0,589,547),666=>array(54,-14,665,560),667=>array(43,0,693,760),668=>array(84,0,607,547),669=>array(-170,-216,341,760),670=>array(84,-213,684,547),671=>array(84,0,499,547),672=>array(45,-208,801,760),673=>array(36,0,525,759),674=>array(36,0,525,759),675=>array(45,-14,1108,760),676=>array(45,-215,1167,760),677=>array(45,-55,1107,760),678=>array(13,0,928,702),679=>array(13,-216,777,760),680=>array(13,-69,881,702),681=>array(19,-216,979,760),682=>array(84,0,815,760),683=>array(84,0,732,760),684=>array(22,0,569,641),685=>array(22,86,345,641),686=>array(-89,-214,629,760),687=>array(-89,-216,797,760),688=>array(54,326,406,751),689=>array(54,326,406,751),690=>array(-21,205,166,751),691=>array(54,326,314,640),692=>array(54,319,314,632),693=>array(54,205,421,632),694=>array(14,326,358,632),695=>array(22,326,569,632),696=>array(8,205,406,632),697=>array(78,557,218,800),698=>array(78,557,437,800),699=>array(103,418,318,729),700=>array(63,418,278,729),701=>array(124,616,296,856),702=>array(116,481,255,760),703=>array(116,481,255,760),704=>array(23,326,336,751),705=>array(23,326,336,751),706=>array(130,517,370,843),707=>array(130,517,370,843),708=>array(87,561,413,800),709=>array(87,561,413,800),710=>array(66,616,434,800),711=>array(66,616,434,800),712=>array(107,488,199,759),713=>array(96,668,404,760),714=>array(178,616,454,800),715=>array(46,616,322,800),716=>array(107,-81,199,190),717=>array(96,-184,404,-92),718=>array(46,-236,322,-52),719=>array(178,-236,454,-52),720=>array(45,0,246,547),721=>array(45,361,246,547),722=>array(116,269,255,547),723=>array(116,269,255,547),724=>array(138,238,357,458),725=>array(141,238,360,458),726=>array(54,119,362,427),727=>array(54,229,274,317),728=>array(86,639,414,784),729=>array(183,654,317,774),730=>array(111,610,389,888),731=>array(167,-196,376,0),732=>array(80,638,420,778),733=>array(94,616,479,800),734=>array(0,213,360,524),735=>array(111,616,387,800),736=>array(16,208,390,633),737=>array(54,326,166,751),738=>array(33,318,351,640),739=>array(10,326,403,632),740=>array(23,326,336,751),741=>array(96,0,404,693),742=>array(96,0,404,693),743=>array(96,0,404,693),744=>array(96,0,404,693),745=>array(96,0,404,693),748=>array(88,-260,414,-21),749=>array(96,605,404,822),750=>array(92,418,554,729),755=>array(111,-240,389,38),759=>array(80,-196,420,-84),768=>array(-455,616,-179,800),769=>array(-326,616,-50,800),770=>array(-435,616,-67,800),771=>array(-424,638,-84,778),772=>array(-405,668,-97,760),773=>array(-500,663,0,755),774=>array(-409,639,-81,784),775=>array(-338,617,-164,760),776=>array(-402,654,-94,774),777=>array(-370,616,-122,843),778=>array(-390,610,-112,888),779=>array(-404,616,-19,800),780=>array(-435,616,-67,800),781=>array(-297,615,-205,832),782=>array(-390,615,-113,832),783=>array(-484,616,-100,800),784=>array(-409,639,-81,882),785=>array(-409,639,-81,784),786=>array(-271,418,-69,563),787=>array(-266,595,-132,844),788=>array(-266,595,-132,844),789=>array(-89,616,89,800),790=>array(-455,-276,-179,-93),791=>array(-326,-276,-50,-93),792=>array(-380,-240,-211,-6),793=>array(-295,-240,-126,-6),794=>array(-224,658,47,929),795=>array(-175,400,21,609),796=>array(-331,-240,-216,-11),797=>array(-386,-240,-115,-59),798=>array(-389,-240,-118,-59),799=>array(-370,-240,-136,-6),800=>array(-389,-202,-118,-110),801=>array(-423,-216,-79,117),802=>array(-419,-216,-75,117),803=>array(-338,-212,-164,-70),804=>array(-402,-212,-94,-92),805=>array(-365,-240,-135,-11),806=>array(-327,-239,-125,-93),807=>array(-372,-196,-151,0),808=>array(-333,-196,-124,0),809=>array(-297,-240,-205,-47),810=>array(-405,-237,-97,-54),811=>array(-450,-239,-51,-94),812=>array(-435,-240,-67,-57),813=>array(-435,-240,-67,-57),814=>array(-409,-239,-81,-94),815=>array(-409,-240,-81,-95),816=>array(-424,-234,-84,-94),817=>array(-405,-184,-97,-92),818=>array(-500,-236,0,-143),819=>array(-500,-236,0,-9),820=>array(-625,212,1,415),821=>array(-471,214,-94,309),822=>array(-837,214,-86,309),823=>array(-655,-46,-48,594),824=>array(-825,-36,-24,765),825=>array(-285,-240,-170,-11),826=>array(-405,-238,-97,-55),827=>array(-332,-241,-98,-6),828=>array(-450,-239,-51,-94),829=>array(-379,585,-123,842),830=>array(-267,595,-127,867),831=>array(-500,528,0,755),832=>array(-455,616,-179,800),833=>array(-323,616,-47,800),834=>array(-421,638,-81,778),835=>array(-266,595,-132,844),836=>array(-404,654,-55,978),837=>array(-286,-208,-179,-45),838=>array(-403,639,-97,786),839=>array(-360,-226,-140,-35),840=>array(-379,-240,-121,-47),841=>array(-367,-240,-133,-21),842=>array(-420,616,-80,800),843=>array(-420,567,-80,850),844=>array(-420,573,-80,835),845=>array(-459,-230,-41,-30),846=>array(-357,-240,-143,-45),849=>array(-320,610,-179,888),850=>array(-409,640,-81,882),851=>array(-367,-240,-135,-9),855=>array(-320,610,-179,888),856=>array(-120,654,14,774),858=>array(-445,-240,-58,-11),860=>array(-433,-237,458,-79),861=>array(-433,802,458,960),862=>array(-445,797,445,889),863=>array(-445,-185,445,-93),864=>array(-362,756,362,894),865=>array(-445,769,445,927),866=>array(-449,-230,454,-30),880=>array(92,0,606,729),881=>array(84,0,481,547),882=>array(92,0,930,729),883=>array(92,0,744,729),884=>array(78,557,218,800),885=>array(78,-208,218,35),886=>array(92,0,745,729),887=>array(84,0,617,547),890=>array(202,-208,333,-45),891=>array(43,-14,526,560),892=>array(43,-14,526,560),893=>array(43,-14,526,560),894=>array(63,-142,288,547),900=>array(169,616,445,800),901=>array(96,654,445,978),902=>array(26,0,792,800),903=>array(102,253,278,442),904=>array(-24,0,771,800),905=>array(-18,0,915,800),906=>array(-21,0,450,800),908=>array(-19,-14,836,800),910=>array(-27,0,992,800),911=>array(-30,0,867,800),912=>array(23,-19,372,978),913=>array(5,0,769,729),914=>array(92,0,692,729),915=>array(92,0,610,729),916=>array(5,0,769,729),917=>array(92,0,610,729),918=>array(45,0,680,729),919=>array(92,0,745,729),920=>array(50,-14,800,742),921=>array(92,0,280,729),922=>array(92,0,805,729),923=>array(5,0,769,729),924=>array(92,0,903,729),925=>array(92,0,745,729),926=>array(98,0,548,729),927=>array(50,-14,800,742),928=>array(92,0,745,729),929=>array(92,0,692,729),931=>array(92,0,610,729),932=>array(5,0,677,729),933=>array(-10,0,734,729),934=>array(50,0,800,729),935=>array(19,0,751,729),936=>array(56,0,795,729),937=>array(27,0,823,742),938=>array(34,0,342,927),939=>array(-10,0,734,927),940=>array(48,-13,645,800),941=>array(54,-14,493,800),942=>array(84,-208,634,800),943=>array(77,-19,353,800),944=>array(78,-10,629,978),945=>array(48,-13,645,559),946=>array(84,-208,671,773),947=>array(15,-208,667,547),948=>array(43,-14,645,768),949=>array(54,-14,493,560),950=>array(43,-208,542,760),951=>array(84,-208,634,560),952=>array(43,-11,645,768),953=>array(78,-19,348,547),954=>array(84,0,655,547),955=>array(30,0,603,760),956=>array(85,-209,704,547),957=>array(15,0,635,547),958=>array(43,-208,542,760),959=>array(43,-14,644,560),960=>array(42,-19,732,547),961=>array(84,-208,671,562),962=>array(43,-208,526,560),963=>array(43,-14,727,547),964=>array(21,-19,612,547),965=>array(78,-10,629,547),966=>array(64,-208,725,552),967=>array(25,-208,620,547),968=>array(65,-208,724,547),969=>array(43,-13,826,547),970=>array(19,-19,355,774),971=>array(78,-10,629,774),972=>array(43,-14,644,800),973=>array(78,-10,629,800),974=>array(43,-13,826,800),975=>array(92,-208,805,729),976=>array(55,-11,575,768),977=>array(51,-11,612,768),978=>array(21,0,717,729),979=>array(-24,0,954,800),980=>array(21,0,717,927),981=>array(60,-208,729,760),982=>array(22,-13,843,547),983=>array(54,-205,688,548),984=>array(50,-208,800,742),985=>array(43,-208,644,560),986=>array(50,-208,678,729),987=>array(43,-208,541,547),988=>array(92,0,599,729),989=>array(-56,-208,437,760),990=>array(61,2,646,729),991=>array(82,0,571,759),992=>array(56,-208,843,742),993=>array(22,-180,537,559),994=>array(50,-213,1043,729),995=>array(59,-208,775,547),996=>array(50,-208,740,742),997=>array(45,-208,632,560),998=>array(92,-213,878,729),999=>array(21,-14,689,575),1000=>array(42,-208,692,745),1001=>array(46,-208,608,560),1002=>array(53,0,736,742),1003=>array(49,0,622,560),1004=>array(50,-14,715,758),1005=>array(83,-14,670,758),1006=>array(28,-208,654,729),1007=>array(27,-208,563,729),1008=>array(54,-7,688,548),1009=>array(84,-216,671,562),1010=>array(43,-14,526,560),1011=>array(-33,-216,259,760),1012=>array(50,-14,800,742),1013=>array(67,-14,550,560),1014=>array(81,-14,563,560),1015=>array(92,0,692,729),1016=>array(84,-208,671,760),1017=>array(50,-14,670,742),1018=>array(92,0,903,729),1019=>array(73,-208,649,547),1020=>array(33,-208,671,562),1021=>array(33,-14,653,742),1022=>array(50,-14,670,742),1023=>array(33,-14,653,742),1024=>array(92,0,610,927),1025=>array(92,0,610,927),1026=>array(5,-200,798,729),1027=>array(92,0,610,928),1028=>array(50,-14,670,742),1029=>array(72,-14,647,742),1030=>array(92,0,280,729),1031=>array(32,0,339,927),1032=>array(-56,-200,280,729),1033=>array(46,0,1102,729),1034=>array(92,0,1060,729),1035=>array(5,0,798,729),1036=>array(92,0,803,928),1037=>array(92,0,745,927),1038=>array(29,0,741,927),1039=>array(92,-157,745,729),1040=>array(5,0,769,729),1041=>array(92,0,692,729),1042=>array(92,0,692,729),1043=>array(92,0,610,729),1044=>array(60,-157,831,729),1045=>array(92,0,610,729),1046=>array(15,0,1209,729),1047=>array(66,-14,645,742),1048=>array(92,0,745,729),1049=>array(92,0,745,927),1050=>array(92,0,803,729),1051=>array(46,0,739,729),1052=>array(92,0,903,729),1053=>array(92,0,745,729),1054=>array(50,-14,800,742),1055=>array(92,0,745,729),1056=>array(92,0,692,729),1057=>array(50,-14,670,742),1058=>array(5,0,677,729),1059=>array(29,0,741,729),1060=>array(50,0,941,729),1061=>array(19,0,751,729),1062=>array(92,-157,868,729),1063=>array(81,0,716,729),1064=>array(92,0,1143,729),1065=>array(92,-157,1266,729),1066=>array(49,0,890,729),1067=>array(92,0,944,729),1068=>array(92,0,692,729),1069=>array(64,-14,684,742),1070=>array(92,-14,1119,742),1071=>array(64,0,678,729),1072=>array(43,-14,596,560),1073=>array(43,-14,655,792),1074=>array(84,0,589,547),1075=>array(84,0,499,547),1076=>array(56,-138,751,547),1077=>array(43,-14,630,560),1078=>array(15,0,980,547),1079=>array(49,-14,518,560),1080=>array(84,0,617,547),1081=>array(84,0,617,765),1082=>array(84,0,664,547),1083=>array(55,0,648,547),1084=>array(84,0,733,547),1085=>array(84,0,607,547),1086=>array(43,-14,644,560),1087=>array(84,0,607,547),1088=>array(84,-208,671,560),1089=>array(43,-14,526,560),1090=>array(4,0,575,547),1091=>array(12,-216,634,547),1092=>array(55,-208,937,760),1093=>array(15,0,630,547),1094=>array(84,-138,698,547),1095=>array(64,0,573,547),1096=>array(84,0,972,547),1097=>array(84,-138,1063,547),1098=>array(20,0,711,547),1099=>array(84,0,823,547),1100=>array(84,0,588,547),1101=>array(67,-14,550,560),1102=>array(84,-14,928,560),1103=>array(31,0,560,547),1104=>array(43,-14,630,803),1105=>array(43,-14,630,774),1106=>array(20,-216,669,760),1107=>array(84,0,520,803),1108=>array(43,-14,526,560),1109=>array(52,-14,548,560),1110=>array(84,0,259,760),1111=>array(17,0,325,774),1112=>array(-33,-216,259,760),1113=>array(44,0,942,547),1114=>array(84,0,912,547),1115=>array(20,0,656,760),1116=>array(84,0,664,803),1117=>array(84,0,617,803),1118=>array(12,-216,634,765),1119=>array(84,-138,607,547),1120=>array(50,-14,1043,729),1121=>array(43,-13,826,547),1122=>array(49,0,791,729),1123=>array(20,0,692,731),1124=>array(92,-14,948,742),1125=>array(84,-14,760,560),1126=>array(8,0,984,729),1127=>array(25,0,807,547),1128=>array(92,0,1351,729),1129=>array(84,0,1097,547),1130=>array(50,0,800,729),1131=>array(43,0,644,547),1132=>array(92,0,1137,729),1133=>array(84,0,964,547),1134=>array(54,-208,616,938),1135=>array(40,-193,493,756),1136=>array(9,0,1060,729),1137=>array(9,-208,1046,759),1138=>array(50,-14,800,742),1139=>array(43,-14,644,560),1140=>array(5,0,826,742),1141=>array(9,0,681,560),1142=>array(5,0,826,928),1143=>array(9,0,681,800),1144=>array(47,-216,1130,742),1145=>array(43,-216,1025,560),1146=>array(50,-14,1024,742),1147=>array(43,-14,820,560),1148=>array(57,-14,1348,928),1149=>array(47,-13,1126,828),1150=>array(50,-14,1043,910),1151=>array(43,-13,826,746),1152=>array(50,-208,670,742),1153=>array(43,-208,526,560),1154=>array(27,-33,521,488),1155=>array(-601,606,-85,822),1156=>array(-413,638,0,784),1157=>array(-365,595,-231,785),1158=>array(-365,595,-231,785),1159=>array(-796,592,4,788),1160=>array(-1069,-179,383,928),1161=>array(-996,-280,306,1022),1162=>array(92,-208,933,927),1163=>array(84,-208,782,765),1164=>array(23,0,692,729),1165=>array(0,0,567,702),1166=>array(92,0,702,729),1167=>array(84,-208,671,560),1168=>array(92,0,610,878),1169=>array(84,0,499,700),1170=>array(28,0,638,729),1171=>array(21,0,519,547),1172=>array(92,-200,728,729),1173=>array(84,-216,591,547),1174=>array(15,-157,1209,729),1175=>array(15,-138,980,547),1176=>array(66,-196,645,742),1177=>array(49,-196,518,560),1178=>array(92,-157,803,729),1179=>array(84,-138,664,547),1180=>array(92,0,803,729),1181=>array(84,0,664,547),1182=>array(23,0,803,729),1183=>array(7,0,664,760),1184=>array(24,0,1000,729),1185=>array(20,0,812,547),1186=>array(92,-157,932,729),1187=>array(84,-138,783,547),1188=>array(92,0,1075,729),1189=>array(84,0,847,547),1190=>array(92,-200,1193,729),1191=>array(84,-216,939,547),1192=>array(56,-14,924,743),1193=>array(55,-14,836,560),1194=>array(50,-196,670,742),1195=>array(43,-196,526,560),1196=>array(5,-157,677,729),1197=>array(4,-138,575,547),1198=>array(-10,0,734,729),1199=>array(12,-216,634,547),1200=>array(-10,0,734,729),1201=>array(12,-216,634,547),1202=>array(19,-157,751,729),1203=>array(15,-138,630,547),1204=>array(5,-157,1088,729),1205=>array(4,-138,976,547),1206=>array(81,-157,904,729),1207=>array(64,-138,749,547),1208=>array(81,0,716,729),1209=>array(64,0,573,547),1210=>array(81,0,716,729),1211=>array(84,0,634,760),1212=>array(7,-14,976,742),1213=>array(5,-14,761,560),1214=>array(7,-184,976,742),1215=>array(5,-161,761,560),1216=>array(92,0,280,729),1217=>array(15,0,1209,927),1218=>array(15,0,980,784),1219=>array(92,-200,769,729),1220=>array(84,-216,626,547),1221=>array(26,-208,926,729),1222=>array(21,-208,781,547),1223=>array(92,-200,745,729),1224=>array(84,-216,608,547),1225=>array(92,-208,933,729),1226=>array(84,-208,782,547),1227=>array(81,-157,716,729),1228=>array(64,-138,573,547),1229=>array(92,-208,1090,729),1230=>array(84,-208,908,547),1231=>array(84,0,259,760),1232=>array(5,0,769,935),1233=>array(43,-14,596,780),1234=>array(5,0,769,927),1235=>array(43,-14,596,774),1236=>array(0,0,1012,729),1237=>array(43,-14,1000,560),1238=>array(92,0,610,927),1239=>array(43,-14,630,784),1240=>array(51,-14,800,742),1241=>array(43,-14,630,560),1242=>array(51,-14,800,927),1243=>array(43,-14,630,774),1244=>array(15,0,1209,927),1245=>array(15,0,980,774),1246=>array(66,-14,645,927),1247=>array(49,-14,518,773),1248=>array(72,-33,728,729),1249=>array(43,-215,593,547),1250=>array(92,0,745,914),1251=>array(84,0,617,763),1252=>array(92,0,745,927),1253=>array(84,0,617,774),1254=>array(50,-14,800,927),1255=>array(43,-14,644,774),1256=>array(50,-14,800,742),1257=>array(43,-14,644,560),1258=>array(50,-14,800,927),1259=>array(43,-14,644,774),1260=>array(64,-14,684,927),1261=>array(67,-14,550,774),1262=>array(29,0,741,914),1263=>array(12,-216,634,763),1264=>array(29,0,741,927),1265=>array(12,-216,634,774),1266=>array(29,0,741,927),1267=>array(12,-216,634,800),1268=>array(81,0,716,927),1269=>array(64,0,573,774),1270=>array(92,-157,610,729),1271=>array(84,-138,499,547),1272=>array(92,0,944,927),1273=>array(84,0,823,774),1274=>array(28,-216,638,729),1275=>array(21,-217,519,547),1276=>array(19,-200,750,729),1277=>array(15,-216,620,547),1278=>array(19,0,751,729),1279=>array(15,0,630,547),1280=>array(70,0,670,729),1281=>array(44,0,524,547),1282=>array(70,-14,1081,729),1283=>array(44,-14,850,547),1284=>array(98,-14,1027,742),1285=>array(79,-14,836,560),1286=>array(98,-208,804,742),1287=>array(79,-208,668,560),1288=>array(26,-14,1150,729),1289=>array(21,-14,933,547),1290=>array(92,-14,1186,729),1291=>array(84,-14,939,547),1292=>array(50,-14,748,742),1293=>array(43,-14,544,546),1294=>array(5,-14,846,729),1295=>array(4,-14,709,547),1296=>array(67,-14,616,742),1297=>array(54,-14,493,560),1298=>array(46,-200,739,729),1299=>array(55,-216,648,547),1300=>array(46,0,1266,729),1301=>array(55,0,1053,547),1302=>array(92,0,1045,729),1303=>array(84,-208,964,560),1304=>array(64,0,1008,729),1305=>array(31,-14,965,560),1306=>array(50,-146,800,742),1307=>array(45,-208,632,559),1308=>array(30,0,1072,729),1309=>array(35,0,889,547),1310=>array(92,0,803,729),1311=>array(84,0,664,547),1312=>array(46,-200,1187,729),1313=>array(55,-216,980,547),1314=>array(92,-200,1193,729),1315=>array(84,-216,939,547),1316=>array(92,-157,933,729),1317=>array(84,-138,782,547),1329=>array(83,-38,731,729),1330=>array(83,0,655,743),1331=>array(26,0,728,743),1332=>array(22,0,731,743),1333=>array(83,-14,655,729),1334=>array(66,0,664,743),1335=>array(83,0,625,729),1336=>array(83,0,655,743),1337=>array(83,-13,903,742),1338=>array(26,-14,728,729),1339=>array(83,0,648,729),1340=>array(83,0,549,729),1341=>array(83,-14,888,729),1342=>array(62,-12,722,741),1343=>array(74,0,639,729),1344=>array(4,-46,598,729),1345=>array(66,-48,664,743),1346=>array(18,0,715,743),1347=>array(22,0,660,735),1348=>array(83,-14,780,729),1349=>array(57,-14,645,743),1350=>array(0,-14,697,729),1351=>array(57,-14,655,729),1352=>array(83,0,648,743),1353=>array(40,-48,638,743),1354=>array(18,0,789,743),1355=>array(57,0,654,743),1356=>array(83,0,780,743),1357=>array(92,-14,720,729),1358=>array(18,0,715,729),1359=>array(53,-14,641,743),1360=>array(83,0,648,743),1361=>array(57,-14,645,743),1362=>array(83,0,567,729),1363=>array(22,0,811,729),1364=>array(9,0,645,743),1365=>array(49,-14,799,742),1366=>array(44,-14,833,729),1369=>array(104,481,230,760),1370=>array(57,418,250,729),1371=>array(0,616,310,800),1372=>array(0,595,375,893),1373=>array(-7,614,290,847),1374=>array(0,586,460,878),1375=>array(40,618,434,893),1377=>array(71,-13,863,547),1378=>array(76,-208,571,560),1379=>array(40,-208,700,559),1380=>array(76,-208,703,560),1381=>array(71,-14,567,760),1382=>array(40,-208,700,559),1383=>array(76,0,532,760),1384=>array(76,-208,579,560),1385=>array(76,-208,756,560),1386=>array(40,-14,700,760),1387=>array(76,-208,571,760),1388=>array(76,-208,410,547),1389=>array(76,-208,909,760),1390=>array(40,-14,600,760),1391=>array(71,-208,567,760),1392=>array(76,0,571,760),1393=>array(26,-13,536,760),1394=>array(76,-208,703,560),1395=>array(62,-13,570,768),1396=>array(71,-13,699,760),1397=>array(-30,-216,233,547),1398=>array(-61,-13,567,760),1399=>array(13,-208,456,560),1400=>array(76,0,571,560),1401=>array(5,-208,375,547),1402=>array(71,-208,863,546),1403=>array(44,-208,533,560),1404=>array(76,0,622,560),1405=>array(71,-13,567,547),1406=>array(71,-208,699,760),1407=>array(71,-13,863,560),1408=>array(76,-208,571,560),1409=>array(44,-216,631,559),1410=>array(76,0,475,547),1411=>array(71,-208,863,760),1412=>array(-56,-208,604,560),1413=>array(44,-14,645,560),1414=>array(31,-190,774,760),1415=>array(71,-14,808,760),1417=>array(101,0,259,547),1418=>array(49,180,325,359),1456=>array(296,-229,394,-10),1457=>array(147,-229,501,-10),1458=>array(138,-229,492,-10),1459=>array(125,-229,492,-10),1460=>array(296,-171,394,-73),1461=>array(223,-171,467,-73),1462=>array(235,-229,455,-10),1463=>array(174,-171,516,0),1464=>array(187,-217,504,0),1465=>array(-24,547,73,723),1466=>array(-24,547,73,723),1467=>array(187,-239,528,-5),1468=>array(301,225,399,322),1469=>array(296,-217,394,-22),1470=>array(54,413,361,555),1471=>array(187,547,504,710),1472=>array(98,-98,273,645),1473=>array(753,613,851,710),1474=>array(137,613,235,710),1475=>array(98,0,273,547),1478=>array(78,0,462,547),1479=>array(187,-229,504,-10),1488=>array(84,0,644,547),1489=>array(43,0,567,547),1490=>array(43,-9,418,547),1491=>array(43,0,545,547),1492=>array(91,0,596,547),1493=>array(91,0,252,547),1494=>array(43,0,357,547),1495=>array(91,0,596,547),1496=>array(90,-13,624,553),1497=>array(66,164,228,547),1498=>array(43,-240,487,547),1499=>array(43,0,511,547),1500=>array(43,0,527,711),1501=>array(91,0,605,547),1502=>array(43,0,633,554),1503=>array(91,-240,252,547),1504=>array(43,0,362,547),1505=>array(90,-13,624,547),1506=>array(43,-101,575,547),1507=>array(91,-240,584,547),1508=>array(91,0,603,547),1509=>array(11,-240,543,548),1510=>array(33,0,564,547),1511=>array(91,-240,660,546),1512=>array(43,0,511,547),1513=>array(20,0,750,547),1514=>array(10,-4,592,547),1520=>array(91,0,574,547),1521=>array(66,0,524,547),1522=>array(66,164,500,547),1523=>array(84,361,360,547),1524=>array(84,361,626,547),1542=>array(-2,-20,630,892),1543=>array(-2,-20,630,897),1545=>array(65,0,811,635),1546=>array(65,0,1084,635),1548=>array(98,0,322,331),1557=>array(121,612,379,868),1563=>array(98,0,323,689),1567=>array(69,0,515,742),1569=>array(73,20,437,493),1570=>array(-20,0,362,955),1571=>array(75,0,259,993),1572=>array(-42,-244,547,603),1573=>array(76,-245,259,760),1574=>array(63,-107,863,603),1575=>array(84,0,259,760),1576=>array(63,-149,921,327),1577=>array(48,-30,540,513),1578=>array(63,-5,921,415),1579=>array(63,-5,921,537),1580=>array(77,-244,720,425),1581=>array(77,-244,720,425),1582=>array(77,-244,720,579),1583=>array(61,-15,442,415),1584=>array(61,-15,442,579),1585=>array(-42,-244,508,269),1586=>array(-42,-244,508,457),1587=>array(63,-244,1297,366),1588=>array(63,-244,1297,586),1589=>array(63,-244,1265,362),1590=>array(63,-244,1265,457),1591=>array(70,0,971,760),1592=>array(70,0,971,760),1593=>array(87,-244,720,521),1594=>array(87,-244,720,652),1600=>array(-10,0,352,125),1601=>array(63,-24,1082,627),1602=>array(52,-215,825,635),1603=>array(70,-27,814,760),1604=>array(70,-142,778,760),1605=>array(68,-244,660,369),1606=>array(62,-165,779,457),1607=>array(48,-30,540,358),1608=>array(-42,-244,547,322),1609=>array(63,-107,863,462),1610=>array(63,-244,863,462),1611=>array(107,591,393,825),1612=>array(107,591,393,881),1613=>array(107,-239,393,-5),1614=>array(107,591,393,723),1615=>array(107,590,393,881),1616=>array(107,-137,393,-5),1617=>array(88,599,412,869),1618=>array(115,610,383,878),1619=>array(59,584,441,735),1620=>array(154,601,335,822),1621=>array(155,-245,336,-23),1623=>array(107,615,393,906),1626=>array(99,616,401,775),1632=>array(218,195,392,366),1633=>array(140,0,431,635),1634=>array(12,0,598,635),1635=>array(12,0,597,635),1636=>array(74,-10,530,646),1637=>array(63,-10,547,643),1638=>array(37,0,574,635),1639=>array(15,0,596,635),1640=>array(15,0,596,635),1641=>array(32,0,590,640),1642=>array(65,0,545,635),1643=>array(0,-118,349,318),1644=>array(63,418,278,729),1645=>array(42,101,502,537),1646=>array(63,-5,921,327),1647=>array(52,-215,825,484),1648=>array(216,600,284,885),1652=>array(51,641,232,863),1657=>array(63,-5,921,599),1658=>array(63,-5,921,566),1659=>array(63,-244,921,327),1660=>array(63,-171,921,415),1661=>array(63,-5,921,566),1662=>array(63,-244,921,327),1663=>array(63,-5,921,566),1664=>array(63,-244,921,327),1665=>array(77,-244,720,725),1666=>array(77,-244,720,737),1667=>array(77,-244,720,425),1668=>array(77,-244,720,425),1669=>array(77,-244,720,737),1670=>array(77,-244,720,425),1671=>array(77,-244,720,425),1672=>array(61,-15,442,746),1673=>array(61,-180,442,415),1674=>array(61,-171,442,415),1675=>array(61,-171,442,746),1676=>array(61,-15,442,586),1677=>array(61,-146,442,415),1678=>array(61,-15,442,708),1679=>array(61,-15,442,684),1680=>array(61,-15,442,708),1681=>array(-42,-244,520,648),1682=>array(-42,-244,542,556),1683=>array(-42,-244,587,269),1684=>array(-42,-244,522,269),1685=>array(-42,-244,753,269),1686=>array(-42,-244,522,269),1687=>array(-42,-244,508,464),1688=>array(-42,-244,508,586),1689=>array(-42,-244,508,586),1690=>array(63,-244,1297,464),1691=>array(63,-244,1297,366),1692=>array(63,-244,1297,586),1693=>array(63,-244,1265,362),1694=>array(63,-244,1265,586),1695=>array(70,0,971,760),1696=>array(87,-244,720,781),1697=>array(63,-24,1082,484),1698=>array(63,-171,1082,484),1699=>array(63,-171,1082,635),1700=>array(63,-24,1082,786),1701=>array(63,-293,1082,484),1702=>array(63,-24,1082,786),1703=>array(52,-215,825,635),1704=>array(52,-215,825,757),1705=>array(63,-39,1024,760),1706=>array(63,-39,1194,760),1707=>array(63,-39,1024,760),1708=>array(70,-27,814,760),1709=>array(70,-27,814,854),1710=>array(70,-293,814,760),1711=>array(63,-39,1024,910),1712=>array(63,-39,1024,910),1713=>array(63,-39,1024,910),1714=>array(63,-171,1024,910),1715=>array(63,-293,1024,910),1716=>array(63,-39,1024,1025),1717=>array(70,-142,841,971),1718=>array(70,-142,778,952),1719=>array(70,-142,781,1025),1720=>array(70,-391,778,760),1721=>array(62,-317,779,464),1722=>array(62,-165,779,366),1723=>array(62,-165,779,636),1724=>array(62,-330,779,464),1725=>array(62,-165,779,586),1726=>array(70,-33,877,506),1727=>array(77,-244,720,579),1734=>array(-42,-244,547,556),1740=>array(63,-107,863,462),1742=>array(63,-107,863,556),1749=>array(48,-30,540,358),1776=>array(218,195,392,366),1777=>array(140,0,431,635),1778=>array(12,0,598,635),1779=>array(12,0,597,635),1780=>array(12,0,573,650),1781=>array(30,-8,580,643),1782=>array(85,0,514,645),1783=>array(15,0,596,635),1784=>array(15,0,596,635),1785=>array(32,0,590,640),1984=>array(48,-14,648,742),1985=>array(69,0,583,729),1986=>array(80,0,616,729),1987=>array(80,0,616,729),1988=>array(80,0,616,729),1989=>array(80,0,616,729),1990=>array(80,0,616,729),1991=>array(98,0,599,729),1992=>array(98,0,599,729),1993=>array(70,0,625,742),1994=>array(84,0,259,729),1995=>array(43,-14,504,465),1996=>array(15,0,529,729),1997=>array(15,0,637,451),1998=>array(84,0,607,451),1999=>array(84,0,607,451),2000=>array(46,0,548,742),2001=>array(84,0,607,667),2002=>array(43,0,820,742),2003=>array(84,0,467,729),2004=>array(84,0,467,729),2005=>array(84,0,584,729),2006=>array(84,0,604,729),2007=>array(15,0,360,729),2008=>array(84,0,938,532),2009=>array(15,0,491,729),2010=>array(15,0,811,729),2011=>array(84,0,607,451),2012=>array(15,0,637,729),2013=>array(84,0,869,729),2014=>array(84,0,543,729),2015=>array(43,0,692,729),2016=>array(15,0,491,729),2017=>array(15,0,637,729),2018=>array(43,0,531,729),2019=>array(84,0,543,729),2020=>array(84,0,543,581),2021=>array(84,0,543,729),2022=>array(43,0,531,729),2023=>array(43,0,531,729),2027=>array(95,668,403,760),2028=>array(63,638,438,777),2029=>array(185,654,319,774),2030=>array(65,616,433,800),2031=>array(33,616,438,803),2032=>array(63,638,438,777),2033=>array(33,616,438,803),2034=>array(183,-212,317,-92),2035=>array(96,654,404,774),2036=>array(63,418,278,729),2037=>array(103,418,318,729),2040=>array(84,0,607,562),2041=>array(84,0,607,564),2042=>array(-10,0,425,125),3647=>array(62,-147,638,760),3713=>array(43,-14,706,560),3714=>array(43,-14,723,560),3716=>array(43,-14,704,560),3719=>array(21,-241,521,561),3720=>array(42,0,705,560),3722=>array(40,-269,768,560),3725=>array(40,-24,713,610),3732=>array(42,-14,647,560),3733=>array(42,-19,647,561),3734=>array(-22,-240,684,560),3735=>array(20,-14,768,560),3737=>array(37,-15,681,560),3738=>array(38,-15,664,561),3739=>array(38,-15,664,760),3740=>array(60,-12,910,626),3741=>array(64,-14,762,760),3742=>array(76,-14,773,560),3743=>array(76,-14,773,760),3745=>array(24,-14,771,547),3746=>array(40,-23,713,760),3747=>array(48,-10,733,615),3749=>array(41,-33,693,560),3751=>array(33,-33,640,561),3754=>array(51,-21,819,724),3755=>array(44,-21,935,620),3757=>array(53,-20,662,606),3758=>array(48,-14,825,698),3759=>array(43,-259,897,648),3760=>array(36,-16,658,567),3761=>array(-653,610,-31,896),3762=>array(39,0,563,593),3763=>array(-479,0,563,875),3764=>array(-654,622,-62,950),3765=>array(-654,633,13,962),3766=>array(-654,622,-62,950),3767=>array(-654,633,13,962),3768=>array(-426,-385,-165,-55),3769=>array(-473,-316,-174,-28),3771=>array(-653,610,-31,896),3772=>array(-682,-311,15,-48),3773=>array(39,-220,691,776),3776=>array(83,-13,444,561),3777=>array(83,-13,818,561),3778=>array(-37,-14,458,936),3779=>array(23,-14,595,879),3780=>array(-15,-35,585,809),3782=>array(70,-240,688,582),3784=>array(-413,659,-297,844),3785=>array(-627,622,-22,918),3786=>array(-667,621,39,965),3787=>array(-521,612,-187,917),3788=>array(-682,603,15,866),3789=>array(-479,668,-229,875),3792=>array(66,-29,723,563),3793=>array(25,-139,721,586),3794=>array(31,-80,603,711),3795=>array(24,-14,882,981),3796=>array(48,-156,696,711),3797=>array(48,-156,696,711),3798=>array(64,-14,894,950),3799=>array(43,-240,706,560),3800=>array(72,-269,774,582),3801=>array(58,-14,858,564),3804=>array(44,-21,1301,620),3805=>array(44,-21,1305,620),4256=>array(47,-14,827,819),4257=>array(39,-0,719,819),4258=>array(37,-138,667,828),4259=>array(41,-15,793,819),4260=>array(29,0,572,828),4261=>array(24,0,729,828),4262=>array(15,-14,709,819),4263=>array(49,-14,890,828),4264=>array(4,0,415,862),4265=>array(39,0,581,819),4266=>array(18,-14,796,820),4267=>array(48,-14,837,819),4268=>array(43,0,586,819),4269=>array(37,-157,817,829),4270=>array(11,-14,731,822),4271=>array(20,0,585,823),4272=>array(43,-15,863,820),4273=>array(43,-15,587,820),4274=>array(43,-0,586,828),4275=>array(37,-170,817,828),4276=>array(37,0,828,825),4277=>array(28,0,695,820),4278=>array(44,0,586,828),4279=>array(34,0,577,820),4280=>array(39,-14,582,820),4281=>array(43,0,586,819),4282=>array(45,-14,778,827),4283=>array(46,-15,822,820),4284=>array(43,-0,586,819),4285=>array(29,-15,594,828),4286=>array(43,-0,586,819),4287=>array(15,0,726,819),4288=>array(18,-14,796,820),4289=>array(43,0,586,820),4290=>array(37,-15,652,828),4291=>array(9,0,552,820),4292=>array(33,0,561,820),4293=>array(24,-14,714,828),4304=>array(49,-14,505,599),4305=>array(49,-14,515,823),4306=>array(44,-232,578,561),4307=>array(49,-225,786,557),4308=>array(49,-232,496,557),4309=>array(49,-232,505,557),4310=>array(25,-14,502,828),4311=>array(49,-14,779,557),4312=>array(49,0,515,557),4313=>array(49,-232,506,542),4314=>array(49,-225,1025,562),4315=>array(49,-14,505,828),4316=>array(63,-14,520,819),4317=>array(49,-0,765,557),4318=>array(49,-14,505,818),4319=>array(49,-232,504,560),4320=>array(49,0,774,830),4321=>array(63,-14,520,818),4322=>array(49,-232,651,670),4323=>array(29,-232,533,604),4324=>array(49,-232,792,558),4325=>array(49,-232,496,818),4326=>array(49,-225,766,557),4327=>array(49,-232,505,549),4328=>array(20,-14,489,828),4329=>array(63,0,520,828),4330=>array(49,-232,573,548),4331=>array(49,-14,504,818),4332=>array(64,-15,534,828),4333=>array(49,-232,517,818),4334=>array(63,-14,520,818),4335=>array(24,-232,516,580),4336=>array(49,-15,505,823),4337=>array(49,-14,505,823),4338=>array(49,-146,504,557),4339=>array(49,-232,505,558),4340=>array(49,-232,504,828),4341=>array(49,-14,558,828),4342=>array(49,-232,803,557),4343=>array(49,-232,556,557),4344=>array(49,-232,505,549),4345=>array(44,-232,578,561),4346=>array(49,-111,505,557),4347=>array(49,0,399,500),4348=>array(24,400,294,828),5121=>array(5,0,769,729),5122=>array(5,0,769,1056),5123=>array(5,0,769,729),5124=>array(5,0,769,928),5125=>array(92,0,821,729),5126=>array(92,0,821,928),5127=>array(92,0,821,927),5129=>array(92,0,821,729),5130=>array(84,0,813,729),5131=>array(84,0,813,928),5132=>array(92,0,1013,729),5133=>array(5,0,925,729),5134=>array(92,0,1013,729),5135=>array(5,0,925,729),5136=>array(92,0,1013,928),5137=>array(5,0,925,928),5138=>array(92,0,1065,729),5139=>array(92,0,1056,729),5140=>array(92,0,1065,928),5141=>array(92,0,1056,928),5142=>array(92,0,821,928),5143=>array(92,0,1057,729),5144=>array(84,0,1058,729),5145=>array(92,0,1057,928),5146=>array(84,0,1058,928),5147=>array(84,0,813,928),5149=>array(92,607,226,728),5150=>array(60,326,473,734),5151=>array(31,338,379,722),5152=>array(31,338,379,722),5153=>array(60,392,338,711),5154=>array(60,352,338,670),5155=>array(60,392,338,670),5156=>array(60,392,338,670),5157=>array(31,327,518,749),5158=>array(60,326,414,734),5159=>array(92,304,226,424),5160=>array(60,494,338,569),5161=>array(60,392,338,670),5162=>array(60,392,338,693),5163=>array(5,0,1167,729),5164=>array(5,0,940,729),5165=>array(92,0,1170,729),5166=>array(84,0,1251,729),5167=>array(5,0,769,729),5168=>array(5,0,769,1056),5169=>array(5,0,769,729),5170=>array(5,0,769,928),5171=>array(73,0,802,729),5172=>array(73,0,802,928),5173=>array(73,0,802,927),5175=>array(73,0,802,729),5176=>array(73,0,802,729),5177=>array(73,0,802,928),5178=>array(92,0,1013,729),5179=>array(5,0,925,729),5180=>array(92,0,1013,729),5181=>array(5,0,925,729),5182=>array(92,0,1013,928),5183=>array(5,0,925,928),5184=>array(92,0,1046,729),5185=>array(73,0,1056,729),5186=>array(92,0,1046,928),5187=>array(73,0,1056,928),5188=>array(92,0,1046,729),5189=>array(73,0,1058,729),5190=>array(92,0,1046,928),5191=>array(73,0,1058,928),5192=>array(73,0,802,927),5193=>array(60,326,520,727),5194=>array(60,326,172,734),5196=>array(92,-14,720,729),5197=>array(92,0,720,1056),5198=>array(92,0,720,743),5199=>array(92,0,720,928),5200=>array(73,0,759,729),5201=>array(73,0,759,928),5202=>array(73,0,759,927),5204=>array(73,0,759,729),5205=>array(56,0,742,729),5206=>array(56,0,742,928),5207=>array(92,-14,964,729),5208=>array(92,-14,964,729),5209=>array(92,0,964,743),5210=>array(92,0,964,743),5211=>array(92,0,964,928),5212=>array(92,0,964,928),5213=>array(92,0,1003,729),5214=>array(73,0,970,729),5215=>array(92,0,1003,928),5216=>array(73,0,970,928),5217=>array(92,0,986,729),5218=>array(56,0,968,729),5219=>array(92,0,986,928),5220=>array(56,0,968,928),5221=>array(92,0,986,729),5222=>array(60,326,427,733),5223=>array(92,-14,949,734),5224=>array(92,0,949,743),5225=>array(73,0,967,734),5226=>array(56,0,960,734),5227=>array(41,0,651,743),5228=>array(92,0,702,1056),5229=>array(92,0,702,743),5230=>array(92,0,702,928),5231=>array(41,-14,651,729),5232=>array(41,-14,651,928),5233=>array(41,-14,708,927),5234=>array(92,-14,702,729),5235=>array(92,-14,702,928),5236=>array(92,0,937,743),5237=>array(41,0,891,743),5238=>array(92,0,939,743),5239=>array(92,0,891,743),5240=>array(92,0,939,928),5241=>array(92,0,891,928),5242=>array(92,-14,937,729),5243=>array(41,-14,891,729),5244=>array(92,-14,937,928),5245=>array(41,-14,891,928),5246=>array(92,-14,939,729),5247=>array(92,-14,891,729),5248=>array(92,-14,939,928),5249=>array(92,-14,891,928),5250=>array(92,-14,939,729),5251=>array(60,319,445,734),5252=>array(60,319,445,734),5253=>array(41,0,881,743),5254=>array(92,0,881,743),5255=>array(41,-14,881,734),5256=>array(92,-14,881,734),5257=>array(41,0,651,743),5258=>array(92,0,702,1056),5259=>array(92,0,702,743),5260=>array(92,0,702,928),5261=>array(41,-14,651,729),5262=>array(41,-14,651,928),5263=>array(41,-14,714,927),5264=>array(92,-14,702,729),5265=>array(92,-14,702,928),5266=>array(92,0,937,743),5267=>array(41,0,891,743),5268=>array(92,0,988,743),5269=>array(92,0,891,743),5270=>array(92,0,988,928),5271=>array(92,0,891,928),5272=>array(92,-14,937,729),5273=>array(41,-14,891,729),5274=>array(92,-14,937,928),5275=>array(41,-14,891,928),5276=>array(92,-14,988,729),5277=>array(92,-14,891,729),5278=>array(92,-14,988,928),5279=>array(92,-14,891,928),5280=>array(92,-14,988,729),5281=>array(60,319,445,734),5282=>array(60,319,445,734),5283=>array(27,0,535,729),5284=>array(92,0,599,1056),5285=>array(92,0,599,729),5286=>array(92,0,599,928),5287=>array(27,0,535,729),5288=>array(27,0,535,928),5289=>array(27,0,598,927),5290=>array(92,0,599,729),5291=>array(92,0,599,928),5292=>array(92,0,790,729),5293=>array(27,0,771,729),5294=>array(92,0,836,729),5295=>array(92,0,790,729),5296=>array(92,0,836,928),5297=>array(92,0,790,928),5298=>array(92,0,790,729),5299=>array(27,0,790,729),5300=>array(92,0,790,928),5301=>array(27,0,790,928),5302=>array(92,0,836,729),5303=>array(92,0,790,729),5304=>array(92,0,836,928),5305=>array(92,0,790,928),5306=>array(92,0,836,729),5307=>array(60,326,380,734),5308=>array(60,326,492,733),5309=>array(60,326,380,734),5312=>array(84,-14,947,468),5313=>array(41,-14,904,786),5314=>array(41,-14,904,468),5315=>array(41,-14,904,667),5316=>array(27,0,890,482),5317=>array(27,0,890,667),5318=>array(27,0,890,667),5319=>array(41,0,904,482),5320=>array(41,0,904,667),5321=>array(92,-14,1197,468),5322=>array(84,-14,1163,468),5323=>array(92,0,1172,482),5324=>array(41,0,1144,482),5325=>array(92,0,1172,667),5326=>array(41,0,1144,667),5327=>array(41,0,904,667),5328=>array(60,477,604,742),5329=>array(60,319,440,734),5330=>array(60,477,604,742),5331=>array(84,0,947,468),5332=>array(41,0,904,786),5333=>array(41,0,904,468),5334=>array(41,0,904,667),5335=>array(27,0,890,468),5336=>array(27,0,890,667),5337=>array(27,0,890,667),5338=>array(41,0,904,468),5339=>array(41,0,904,667),5340=>array(92,0,1190,468),5341=>array(84,0,1163,468),5342=>array(92,0,1199,468),5343=>array(41,0,1144,468),5344=>array(92,0,1199,667),5345=>array(41,0,1144,667),5346=>array(92,0,1187,468),5347=>array(27,0,1130,468),5348=>array(92,0,1187,667),5349=>array(27,0,1130,667),5350=>array(92,0,1199,468),5351=>array(41,0,1144,468),5352=>array(92,0,1199,667),5353=>array(41,0,1144,667),5354=>array(60,477,604,734),5356=>array(73,0,802,729),5357=>array(41,0,638,729),5358=>array(92,0,736,1056),5359=>array(92,0,689,729),5360=>array(92,0,689,928),5361=>array(41,0,638,729),5362=>array(41,0,638,928),5363=>array(41,0,694,927),5364=>array(92,0,689,729),5365=>array(92,0,689,928),5366=>array(92,0,906,729),5367=>array(41,0,875,729),5368=>array(92,0,926,729),5369=>array(92,0,905,729),5370=>array(92,0,926,928),5371=>array(92,0,905,928),5372=>array(92,0,906,729),5373=>array(41,0,875,729),5374=>array(92,0,906,928),5375=>array(41,0,875,928),5376=>array(92,0,926,729),5377=>array(92,0,905,729),5378=>array(92,0,926,928),5379=>array(92,0,905,928),5380=>array(92,0,926,729),5381=>array(60,326,437,734),5382=>array(60,319,404,742),5383=>array(60,326,437,734),5392=>array(41,-14,882,743),5393=>array(41,-14,882,743),5394=>array(41,-14,882,928),5395=>array(41,-14,1095,482),5396=>array(41,-14,1095,667),5397=>array(41,-14,1095,482),5398=>array(41,-14,1095,667),5399=>array(92,-14,1168,743),5400=>array(41,-14,1118,743),5401=>array(92,-14,1168,743),5402=>array(41,-14,1118,743),5403=>array(92,-14,1168,928),5404=>array(41,-14,1118,928),5405=>array(92,-14,1390,482),5406=>array(41,-14,1336,482),5407=>array(92,-14,1390,667),5408=>array(41,-14,1336,667),5409=>array(92,-14,1390,482),5410=>array(41,-14,1336,482),5411=>array(92,-14,1390,667),5412=>array(41,-14,1336,667),5413=>array(60,469,690,747),5414=>array(84,0,684,729),5415=>array(92,0,692,1056),5416=>array(92,0,692,729),5417=>array(92,0,692,928),5418=>array(84,0,684,729),5419=>array(84,0,684,928),5420=>array(84,0,750,927),5421=>array(92,0,692,729),5422=>array(92,0,692,928),5423=>array(92,0,911,729),5424=>array(84,0,919,729),5425=>array(92,0,929,729),5426=>array(92,0,912,729),5427=>array(92,0,929,928),5428=>array(92,0,912,928),5429=>array(92,0,911,729),5430=>array(84,0,919,729),5431=>array(92,0,911,928),5432=>array(84,0,919,928),5433=>array(92,0,929,729),5434=>array(92,0,912,729),5435=>array(92,0,929,928),5436=>array(92,0,912,928),5437=>array(92,0,929,928),5438=>array(60,326,438,734),5440=>array(60,392,338,670),5441=>array(60,326,454,734),5442=>array(92,-14,949,468),5443=>array(84,-14,941,468),5444=>array(27,0,884,482),5445=>array(92,0,949,786),5446=>array(92,0,949,482),5447=>array(92,0,949,667),5448=>array(92,0,692,729),5449=>array(92,0,692,928),5450=>array(92,0,692,729),5451=>array(41,0,641,729),5452=>array(41,0,641,928),5453=>array(41,0,641,729),5454=>array(92,0,911,928),5455=>array(41,0,875,928),5456=>array(60,326,438,727),5458=>array(73,0,802,729),5459=>array(51,0,769,743),5460=>array(51,-14,769,1056),5461=>array(51,-14,769,729),5462=>array(51,-14,769,928),5463=>array(73,0,844,663),5464=>array(73,0,844,928),5465=>array(84,0,855,663),5466=>array(84,0,855,928),5467=>array(92,0,1099,928),5468=>array(84,0,1058,928),5469=>array(60,311,546,675),5470=>array(92,-14,720,743),5471=>array(92,-14,720,743),5472=>array(92,-14,720,743),5473=>array(92,-14,720,743),5474=>array(92,-14,720,928),5475=>array(92,-14,720,928),5476=>array(54,0,759,729),5477=>array(54,0,759,928),5478=>array(56,0,762,729),5479=>array(56,0,762,928),5480=>array(92,0,1006,928),5481=>array(56,0,968,928),5482=>array(60,326,512,733),5492=>array(41,0,893,743),5493=>array(84,0,936,743),5494=>array(84,0,936,928),5495=>array(41,-14,893,729),5496=>array(41,-14,893,928),5497=>array(84,-14,936,729),5498=>array(84,-14,936,928),5499=>array(60,319,562,734),5500=>array(92,0,745,729),5501=>array(60,326,454,734),5502=>array(60,0,1197,1056),5503=>array(60,0,1197,743),5504=>array(60,0,1197,928),5505=>array(60,-14,1146,729),5506=>array(60,-14,1146,928),5507=>array(60,-14,1197,729),5508=>array(60,-14,1197,928),5509=>array(60,319,939,734),5514=>array(41,0,893,743),5515=>array(84,0,936,743),5516=>array(41,-14,893,729),5517=>array(84,-14,936,729),5518=>array(60,0,1550,1056),5519=>array(60,0,1550,743),5520=>array(60,0,1550,928),5521=>array(60,-14,1203,741),5522=>array(60,-14,1203,928),5523=>array(60,-14,1550,741),5524=>array(60,-14,1550,928),5525=>array(60,335,792,741),5526=>array(60,335,1217,741),5536=>array(41,0,904,709),5537=>array(41,0,904,709),5538=>array(27,-242,890,468),5539=>array(27,-242,890,667),5540=>array(41,-242,904,468),5541=>array(41,-242,904,667),5542=>array(60,344,604,734),5543=>array(84,0,771,729),5544=>array(5,0,692,729),5545=>array(5,0,692,928),5546=>array(84,0,771,729),5547=>array(84,0,771,928),5548=>array(5,0,692,729),5549=>array(5,0,692,928),5550=>array(15,326,438,734),5551=>array(92,-14,702,729),5598=>array(92,0,778,729),5601=>array(52,0,738,729),5702=>array(60,326,439,734),5703=>array(60,240,439,820),5742=>array(10,0,403,306),5743=>array(60,0,1146,743),5744=>array(60,0,1499,743),5745=>array(60,0,1975,743),5746=>array(60,0,1975,928),5747=>array(60,-14,1628,741),5748=>array(60,-14,1586,928),5749=>array(60,-14,1975,741),5750=>array(60,-14,1975,928),5760=>array(-10,219,553,354),5761=>array(-10,-125,646,354),5762=>array(-10,-125,955,354),5763=>array(-10,-125,1264,354),5764=>array(-10,-125,1572,354),5765=>array(-10,-125,1881,354),5766=>array(-10,219,637,697),5767=>array(-10,219,945,697),5768=>array(-10,219,1264,697),5769=>array(-10,219,1569,697),5770=>array(-10,219,1881,697),5771=>array(-10,-125,579,697),5772=>array(-10,-125,888,697),5773=>array(-10,-125,1198,697),5774=>array(-10,-125,1507,697),5775=>array(-10,-125,1817,697),5776=>array(-10,41,646,532),5777=>array(-10,41,955,532),5778=>array(-10,41,1264,532),5779=>array(-10,41,1572,532),5780=>array(-10,41,1881,532),5781=>array(-10,-125,579,697),5782=>array(-10,-125,948,697),5783=>array(-10,-109,798,354),5784=>array(-10,-254,1244,354),5785=>array(-10,219,1569,928),5786=>array(-10,14,750,354),5787=>array(55,-49,648,622),5788=>array(-10,-49,583,622),7424=>array(15,0,637,547),7425=>array(0,0,755,547),7426=>array(43,-14,1000,560),7427=>array(20,0,564,547),7428=>array(43,-14,526,560),7429=>array(84,-1,611,547),7430=>array(20,-1,611,547),7431=>array(92,0,480,547),7432=>array(54,-14,493,560),7433=>array(84,-213,259,547),7434=>array(44,-14,416,547),7435=>array(84,0,684,547),7436=>array(-18,0,499,547),7437=>array(84,0,733,547),7438=>array(84,0,617,547),7439=>array(43,-14,644,560),7440=>array(43,-14,526,560),7441=>array(43,-27,617,573),7442=>array(43,31,617,515),7443=>array(13,-28,653,579),7444=>array(43,-14,1046,560),7446=>array(43,273,644,560),7447=>array(44,-14,646,273),7448=>array(51,0,515,547),7449=>array(21,0,560,547),7450=>array(21,0,560,547),7451=>array(4,0,575,547),7452=>array(84,-14,607,547),7453=>array(85,10,646,560),7454=>array(69,10,857,561),7455=>array(19,-238,651,560),7456=>array(15,0,637,547),7457=>array(35,0,889,547),7458=>array(45,0,534,547),7459=>array(57,-14,581,547),7462=>array(84,0,499,547),7463=>array(15,0,637,547),7464=>array(84,0,607,547),7465=>array(51,0,515,547),7466=>array(84,0,698,547),7467=>array(55,0,648,547),7468=>array(3,326,484,734),7469=>array(0,326,638,734),7470=>array(58,326,436,734),7472=>array(58,326,490,734),7473=>array(58,326,384,734),7474=>array(58,326,384,734),7475=>array(31,318,471,742),7476=>array(58,326,469,734),7477=>array(58,326,176,734),7478=>array(-35,214,176,734),7479=>array(58,326,507,734),7480=>array(58,326,384,734),7481=>array(58,326,569,734),7482=>array(58,326,469,734),7483=>array(58,326,469,734),7484=>array(31,318,504,742),7485=>array(39,318,471,742),7486=>array(58,326,436,734),7487=>array(58,326,473,734),7488=>array(3,326,426,734),7489=>array(58,318,454,734),7490=>array(19,326,675,734),7491=>array(53,318,402,640),7492=>array(53,318,402,640),7493=>array(53,318,423,640),7494=>array(53,318,656,640),7495=>array(53,318,423,751),7496=>array(53,318,423,751),7497=>array(53,318,423,640),7498=>array(53,318,423,640),7499=>array(53,318,330,640),7500=>array(53,318,330,640),7501=>array(53,205,423,639),7502=>array(53,207,164,632),7503=>array(53,326,431,751),7504=>array(53,326,607,640),7505=>array(53,205,399,640),7506=>array(53,318,432,640),7507=>array(53,318,357,640),7508=>array(53,479,432,640),7509=>array(53,318,432,479),7510=>array(53,209,423,640),7511=>array(53,326,332,719),7512=>array(53,318,399,632),7513=>array(53,332,407,640),7514=>array(53,318,607,632),7515=>array(53,326,445,632),7517=>array(53,209,423,759),7518=>array(10,209,420,632),7519=>array(27,318,406,756),7520=>array(41,209,457,635),7521=>array(16,209,391,632),7522=>array(53,0,164,425),7523=>array(54,0,314,313),7524=>array(53,-8,399,306),7525=>array(53,0,445,306),7526=>array(53,-117,423,433),7527=>array(10,-117,420,306),7528=>array(53,-117,423,314),7529=>array(41,-117,457,309),7530=>array(16,-117,391,306),7543=>array(84,-216,671,559),7544=>array(58,326,469,734),7547=>array(84,0,461,547),7549=>array(5,-208,742,560),7557=>array(84,-216,434,760),7579=>array(53,318,423,640),7580=>array(53,318,357,640),7581=>array(53,288,357,640),7582=>array(53,318,432,751),7583=>array(53,318,330,640),7584=>array(53,326,321,751),7585=>array(53,205,292,632),7586=>array(53,205,423,632),7587=>array(53,207,399,632),7588=>array(53,326,291,751),7589=>array(53,326,226,632),7590=>array(53,326,291,632),7591=>array(53,326,291,632),7592=>array(53,205,375,751),7593=>array(53,205,270,751),7594=>array(53,205,274,751),7595=>array(53,326,314,632),7596=>array(53,205,608,640),7597=>array(53,209,607,632),7598=>array(53,205,506,640),7599=>array(53,205,505,640),7600=>array(53,326,393,632),7601=>array(53,318,432,640),7602=>array(53,209,486,751),7603=>array(53,205,366,640),7604=>array(53,205,340,751),7605=>array(53,205,332,719),7606=>array(53,318,527,632),7607=>array(53,298,438,632),7608=>array(53,318,383,632),7609=>array(53,326,395,632),7610=>array(53,326,445,632),7611=>array(53,326,361,632),7612=>array(53,205,468,632),7613=>array(53,288,414,632),7614=>array(53,206,399,632),7615=>array(53,320,370,756),7620=>array(-467,616,-35,800),7621=>array(-467,616,-35,800),7622=>array(-467,616,-35,800),7623=>array(-467,616,-35,800),7624=>array(-513,616,11,800),7625=>array(-513,616,11,800),7680=>array(5,-240,769,729),7681=>array(43,-240,596,560),7682=>array(92,0,692,928),7683=>array(84,-14,671,913),7684=>array(92,-212,692,729),7685=>array(84,-212,671,760),7686=>array(92,-184,692,729),7687=>array(84,-184,671,760),7688=>array(50,-196,670,927),7689=>array(43,-196,526,800),7690=>array(92,0,778,927),7691=>array(45,-14,632,942),7692=>array(92,-212,778,729),7693=>array(45,-212,632,760),7694=>array(92,-184,778,729),7695=>array(45,-184,632,760),7696=>array(92,-192,778,729),7697=>array(45,-196,632,760),7698=>array(92,-240,778,729),7699=>array(45,-240,632,760),7700=>array(92,0,610,1057),7701=>array(43,-14,630,927),7702=>array(92,0,610,1057),7703=>array(43,-14,630,927),7704=>array(92,-203,610,729),7705=>array(43,-203,630,560),7706=>array(92,-195,610,729),7707=>array(43,-195,630,560),7708=>array(92,-196,610,927),7709=>array(43,-196,630,784),7710=>array(92,0,599,928),7711=>array(19,0,444,942),7712=>array(50,-14,747,901),7713=>array(45,-216,632,760),7714=>array(92,0,745,928),7715=>array(84,0,634,913),7716=>array(92,-212,745,729),7717=>array(84,-212,634,760),7718=>array(92,0,745,927),7719=>array(23,0,634,927),7720=>array(45,-196,745,729),7721=>array(38,-196,634,760),7722=>array(92,-236,745,729),7723=>array(84,-236,634,760),7724=>array(16,-195,355,729),7725=>array(1,-195,341,760),7726=>array(40,0,378,1057),7727=>array(16,0,354,917),7728=>array(92,0,805,927),7729=>array(84,0,684,982),7730=>array(92,-212,805,729),7731=>array(84,-212,684,760),7732=>array(92,-184,805,729),7733=>array(84,-184,684,760),7734=>array(92,-212,610,729),7735=>array(83,-212,259,760),7736=>array(32,-212,610,942),7737=>array(18,-212,325,914),7738=>array(92,-184,610,729),7739=>array(20,-184,328,760),7740=>array(92,-240,610,729),7741=>array(-13,-240,355,760),7742=>array(92,0,903,927),7743=>array(83,0,963,800),7744=>array(92,0,903,928),7745=>array(83,0,963,760),7746=>array(92,-212,903,729),7747=>array(83,-212,963,560),7748=>array(92,0,745,928),7749=>array(84,0,634,760),7750=>array(92,-212,745,729),7751=>array(84,-212,634,560),7752=>array(92,-184,745,729),7753=>array(84,-184,634,560),7754=>array(92,-240,745,729),7755=>array(84,-240,634,560),7756=>array(50,-14,800,1057),7757=>array(43,-14,644,916),7758=>array(50,-14,800,1043),7759=>array(43,-14,644,900),7760=>array(50,-14,800,1057),7761=>array(43,-14,644,927),7762=>array(50,-14,800,1057),7763=>array(43,-14,644,927),7764=>array(92,0,692,927),7765=>array(84,-208,671,800),7766=>array(92,0,692,928),7767=>array(84,-208,671,760),7768=>array(92,0,750,928),7769=>array(84,0,490,760),7770=>array(92,-212,750,729),7771=>array(83,-212,490,560),7772=>array(92,-212,750,914),7773=>array(83,-212,490,759),7774=>array(92,-184,750,729),7775=>array(33,-184,490,560),7776=>array(72,-14,647,928),7777=>array(52,-14,548,760),7778=>array(72,-212,647,742),7779=>array(52,-212,548,560),7780=>array(72,-14,647,928),7781=>array(52,-14,548,816),7782=>array(72,-14,647,1053),7783=>array(52,-14,548,1002),7784=>array(72,-212,647,928),7785=>array(52,-212,548,762),7786=>array(5,0,677,927),7787=>array(13,0,455,942),7788=>array(5,-212,677,729),7789=>array(13,-212,455,702),7790=>array(5,-184,677,729),7791=>array(13,-184,455,702),7792=>array(5,-240,677,729),7793=>array(13,-240,455,702),7794=>array(92,-212,720,729),7795=>array(78,-212,628,547),7796=>array(92,-196,720,729),7797=>array(78,-195,628,547),7798=>array(92,-203,720,729),7799=>array(78,-203,628,547),7800=>array(92,-14,720,1057),7801=>array(78,-14,628,916),7802=>array(92,-14,720,1043),7803=>array(78,-14,628,887),7804=>array(5,0,769,928),7805=>array(15,0,637,778),7806=>array(5,-212,769,729),7807=>array(15,-212,637,547),7808=>array(30,0,1072,931),7809=>array(35,0,889,803),7810=>array(30,0,1072,931),7811=>array(35,0,889,803),7812=>array(30,0,1072,927),7813=>array(35,0,889,774),7814=>array(30,0,1072,927),7815=>array(35,0,889,760),7816=>array(30,-212,1072,729),7817=>array(35,-212,889,547),7818=>array(19,0,751,928),7819=>array(15,0,630,760),7820=>array(19,0,751,927),7821=>array(15,0,630,774),7822=>array(-10,0,734,928),7823=>array(12,-216,634,760),7824=>array(45,0,680,927),7825=>array(45,0,534,798),7826=>array(45,-212,680,729),7827=>array(45,-212,534,547),7828=>array(45,-184,680,729),7829=>array(45,-184,534,547),7830=>array(84,-184,634,760),7831=>array(13,0,455,927),7832=>array(35,0,889,888),7833=>array(12,-216,634,888),7834=>array(43,-14,758,760),7835=>array(19,0,444,942),7836=>array(-18,0,444,760),7837=>array(19,0,444,760),7838=>array(92,-14,823,743),7839=>array(43,-14,645,768),7840=>array(5,-212,769,729),7841=>array(43,-212,596,560),7842=>array(5,0,769,1025),7843=>array(43,-14,596,843),7844=>array(5,0,769,1054),7845=>array(43,-14,652,873),7846=>array(5,0,769,1054),7847=>array(43,-14,597,874),7848=>array(5,0,769,1093),7849=>array(43,-14,672,912),7850=>array(5,0,769,1068),7851=>array(43,-14,596,887),7852=>array(5,-212,769,927),7853=>array(43,-212,596,800),7854=>array(5,0,769,1057),7855=>array(43,-14,596,891),7856=>array(5,0,769,1057),7857=>array(43,-14,596,894),7858=>array(5,0,769,1123),7859=>array(43,-14,596,959),7860=>array(5,0,769,1068),7861=>array(43,-14,596,905),7862=>array(5,-212,769,935),7863=>array(43,-212,596,780),7864=>array(92,-212,610,729),7865=>array(43,-212,630,560),7866=>array(92,0,610,1025),7867=>array(43,-14,630,843),7868=>array(92,0,610,928),7869=>array(43,-14,630,778),7870=>array(92,0,684,1054),7871=>array(43,-14,688,873),7872=>array(92,0,621,1054),7873=>array(43,-14,630,874),7874=>array(92,0,686,1093),7875=>array(43,-14,681,912),7876=>array(92,0,610,1068),7877=>array(43,-14,630,887),7878=>array(92,-212,610,927),7879=>array(43,-212,630,800),7880=>array(66,0,313,1025),7881=>array(52,0,300,842),7882=>array(92,-212,280,729),7883=>array(83,-212,259,760),7884=>array(50,-212,800,742),7885=>array(43,-212,644,560),7886=>array(50,-14,800,1025),7887=>array(43,-14,644,843),7888=>array(50,-14,800,1054),7889=>array(43,-14,679,873),7890=>array(50,-14,800,1054),7891=>array(43,-14,644,874),7892=>array(50,-14,800,1093),7893=>array(43,-14,685,912),7894=>array(50,-14,800,1068),7895=>array(43,-14,644,887),7896=>array(50,-212,800,927),7897=>array(43,-212,644,800),7898=>array(53,-14,854,927),7899=>array(46,-14,708,800),7900=>array(53,-14,854,927),7901=>array(46,-14,708,800),7902=>array(53,-14,854,1025),7903=>array(46,-14,708,843),7904=>array(53,-14,854,928),7905=>array(46,-14,708,778),7906=>array(53,-212,854,761),7907=>array(46,-212,708,609),7908=>array(92,-212,720,729),7909=>array(78,-212,628,547),7910=>array(92,-14,720,1025),7911=>array(78,-14,628,843),7912=>array(91,-14,833,927),7913=>array(75,-14,733,800),7914=>array(91,-14,833,927),7915=>array(75,-14,733,800),7916=>array(91,-14,833,1025),7917=>array(75,-14,733,843),7918=>array(91,-14,833,928),7919=>array(75,-14,733,778),7920=>array(91,-212,833,761),7921=>array(75,-212,733,609),7922=>array(-10,0,734,931),7923=>array(12,-216,634,803),7924=>array(-10,-212,734,729),7925=>array(12,-216,634,547),7926=>array(-10,0,734,1029),7927=>array(12,-216,634,843),7928=>array(-10,0,734,928),7929=>array(12,-216,634,778),7930=>array(92,0,925,729),7931=>array(9,0,635,760),7936=>array(48,-13,645,785),7937=>array(48,-13,645,785),7938=>array(48,-13,645,800),7939=>array(48,-13,645,800),7940=>array(48,-13,645,800),7941=>array(48,-13,645,800),7942=>array(48,-13,645,928),7943=>array(48,-13,645,928),7944=>array(5,0,769,785),7945=>array(5,0,769,785),7946=>array(2,0,1036,800),7947=>array(3,0,1039,800),7948=>array(1,0,930,800),7949=>array(2,0,958,800),7950=>array(4,0,831,928),7951=>array(3,0,854,928),7952=>array(54,-14,493,785),7953=>array(54,-14,493,785),7954=>array(54,-14,498,800),7955=>array(54,-14,493,800),7956=>array(54,-14,531,800),7957=>array(54,-14,516,800),7960=>array(3,0,718,785),7961=>array(4,0,721,785),7962=>array(2,0,1026,800),7963=>array(3,0,1023,800),7964=>array(1,0,950,800),7965=>array(2,0,979,800),7968=>array(84,-208,634,785),7969=>array(84,-208,634,785),7970=>array(84,-208,634,800),7971=>array(84,-208,634,800),7972=>array(84,-208,634,800),7973=>array(84,-208,634,800),7974=>array(84,-208,634,928),7975=>array(84,-208,634,928),7976=>array(3,0,854,785),7977=>array(4,0,859,785),7978=>array(2,0,1159,800),7979=>array(3,0,1158,800),7980=>array(1,0,1088,800),7981=>array(2,0,1114,800),7982=>array(4,0,962,928),7983=>array(3,0,971,928),7984=>array(78,-19,348,785),7985=>array(78,-19,348,785),7986=>array(-27,-19,407,800),7987=>array(-58,-19,376,800),7988=>array(31,-19,446,800),7989=>array(-6,-19,438,800),7990=>array(-2,-19,348,928),7991=>array(-5,-19,348,928),7992=>array(3,0,391,785),7993=>array(4,0,397,785),7994=>array(2,0,685,800),7995=>array(3,0,693,800),7996=>array(1,0,620,800),7997=>array(2,0,646,800),7998=>array(4,0,512,928),7999=>array(3,0,512,928),8000=>array(43,-14,644,785),8001=>array(43,-14,644,785),8002=>array(43,-14,644,800),8003=>array(43,-14,644,800),8004=>array(43,-14,644,800),8005=>array(43,-14,644,800),8008=>array(3,-14,841,785),8009=>array(4,-14,883,785),8010=>array(2,-14,1171,800),8011=>array(3,-14,1173,800),8012=>array(1,-14,1002,800),8013=>array(2,-14,1032,800),8016=>array(78,-10,629,785),8017=>array(78,-10,629,785),8018=>array(78,-10,629,800),8019=>array(78,-10,629,800),8020=>array(78,-10,629,800),8021=>array(78,-10,629,800),8022=>array(78,-10,629,928),8023=>array(78,-10,629,928),8025=>array(4,0,940,785),8027=>array(3,0,1194,800),8029=>array(2,0,1208,800),8031=>array(3,0,1059,928),8032=>array(43,-13,826,785),8033=>array(43,-13,826,785),8034=>array(43,-13,826,800),8035=>array(43,-13,826,800),8036=>array(43,-13,826,800),8037=>array(43,-13,826,800),8038=>array(43,-13,826,928),8039=>array(43,-13,826,928),8040=>array(3,0,881,785),8041=>array(4,0,931,785),8042=>array(2,0,1219,800),8043=>array(3,-3,1224,800),8044=>array(1,0,1048,800),8045=>array(2,0,1078,800),8046=>array(4,0,1000,928),8047=>array(3,0,1048,928),8048=>array(48,-13,645,800),8049=>array(48,-13,645,800),8050=>array(54,-14,493,800),8051=>array(54,-14,493,800),8052=>array(84,-208,634,800),8053=>array(84,-208,634,800),8054=>array(-26,-19,348,800),8055=>array(77,-19,353,800),8056=>array(43,-14,644,800),8057=>array(43,-14,644,800),8058=>array(78,-10,629,800),8059=>array(78,-10,629,800),8060=>array(43,-13,826,800),8061=>array(43,-13,826,800),8064=>array(48,-208,645,785),8065=>array(48,-208,645,785),8066=>array(48,-208,645,800),8067=>array(48,-208,645,800),8068=>array(48,-208,645,800),8069=>array(48,-208,645,800),8070=>array(48,-208,645,928),8071=>array(48,-208,645,928),8072=>array(5,-208,769,785),8073=>array(5,-208,769,785),8074=>array(2,-208,1036,800),8075=>array(3,-208,1039,800),8076=>array(1,-208,930,800),8077=>array(2,-208,958,800),8078=>array(4,-208,831,928),8079=>array(3,-208,854,928),8080=>array(84,-208,634,785),8081=>array(84,-208,634,785),8082=>array(84,-208,634,800),8083=>array(84,-208,634,800),8084=>array(84,-208,634,800),8085=>array(84,-208,634,800),8086=>array(84,-208,634,928),8087=>array(84,-208,634,928),8088=>array(3,-208,854,785),8089=>array(4,-208,859,785),8090=>array(2,-208,1159,800),8091=>array(3,-208,1158,800),8092=>array(1,-208,1088,800),8093=>array(2,-208,1114,800),8094=>array(4,-208,962,928),8095=>array(3,-208,971,928),8096=>array(43,-208,826,785),8097=>array(43,-208,826,785),8098=>array(43,-208,826,800),8099=>array(43,-208,826,800),8100=>array(43,-208,826,800),8101=>array(43,-208,826,800),8102=>array(43,-208,826,928),8103=>array(43,-208,826,928),8104=>array(3,-208,881,785),8105=>array(4,-208,931,785),8106=>array(2,-208,1219,800),8107=>array(3,-208,1224,800),8108=>array(1,-208,1048,800),8109=>array(2,-208,1078,800),8110=>array(4,-208,1000,928),8111=>array(3,-208,1048,928),8112=>array(48,-13,645,784),8113=>array(48,-13,645,760),8114=>array(48,-208,645,800),8115=>array(48,-208,645,559),8116=>array(48,-208,645,800),8118=>array(48,-13,645,778),8119=>array(48,-208,645,778),8120=>array(5,0,769,927),8121=>array(5,0,769,914),8122=>array(-1,0,872,800),8123=>array(26,0,792,800),8124=>array(5,-208,769,729),8125=>array(183,595,317,785),8126=>array(202,-208,333,-45),8127=>array(183,595,317,785),8128=>array(80,638,420,778),8129=>array(80,654,420,928),8130=>array(84,-208,634,800),8131=>array(84,-208,634,560),8132=>array(84,-208,634,800),8134=>array(84,-208,634,778),8135=>array(84,-208,634,778),8136=>array(-1,0,856,800),8137=>array(-24,0,771,800),8138=>array(-1,0,988,800),8139=>array(-18,0,915,800),8140=>array(92,-208,745,729),8141=>array(34,595,468,800),8142=>array(63,595,478,800),8143=>array(80,595,420,928),8144=>array(3,-19,348,784),8145=>array(20,-19,348,760),8146=>array(-36,-19,348,978),8147=>array(23,-19,372,978),8150=>array(4,-19,348,778),8151=>array(-6,-19,348,928),8152=>array(21,0,350,927),8153=>array(32,0,339,914),8154=>array(-1,0,529,800),8155=>array(-21,0,450,800),8157=>array(40,595,474,800),8158=>array(45,595,489,800),8159=>array(80,595,420,928),8160=>array(78,-10,629,784),8161=>array(78,-10,629,760),8162=>array(78,-10,629,978),8163=>array(78,-10,629,978),8164=>array(84,-208,671,785),8165=>array(84,-208,671,785),8166=>array(78,-10,629,778),8167=>array(78,-10,629,928),8168=>array(-10,0,734,927),8169=>array(-10,0,734,914),8170=>array(-1,0,1030,800),8171=>array(-27,0,992,800),8172=>array(4,0,797,785),8173=>array(46,654,404,978),8174=>array(96,654,445,978),8175=>array(46,616,322,800),8178=>array(43,-208,826,800),8179=>array(43,-208,826,547),8180=>array(43,-208,826,800),8182=>array(43,-13,826,778),8183=>array(43,-208,826,778),8184=>array(-1,-14,1015,800),8185=>array(-19,-14,836,800),8186=>array(-1,0,1057,800),8187=>array(-30,0,867,800),8188=>array(27,-208,823,742),8189=>array(178,616,454,800),8190=>array(183,595,317,785),8208=>array(54,217,361,359),8209=>array(54,217,361,359),8210=>array(54,211,642,337),8211=>array(54,211,446,337),8212=>array(54,211,946,337),8213=>array(0,211,1000,337),8214=>array(127,-236,399,764),8215=>array(0,-236,500,-9),8216=>array(103,418,318,729),8217=>array(63,418,278,729),8218=>array(72,-122,287,189),8219=>array(63,418,278,729),8220=>array(103,418,565,729),8221=>array(92,418,554,729),8222=>array(72,-122,534,189),8223=>array(92,418,554,729),8224=>array(26,-96,470,729),8225=>array(25,-96,470,729),8226=>array(144,196,495,547),8227=>array(144,157,534,586),8228=>array(79,0,255,189),8229=>array(79,0,588,189),8230=>array(79,0,921,189),8231=>array(86,253,262,442),8240=>array(32,-14,1417,742),8241=>array(32,-14,1864,742),8242=>array(20,547,240,729),8243=>array(20,547,423,729),8244=>array(20,547,606,729),8245=>array(20,547,240,729),8246=>array(20,547,425,729),8247=>array(20,547,606,729),8248=>array(101,-238,632,29),8249=>array(77,67,318,519),8250=>array(94,67,335,519),8251=>array(72,0,900,829),8252=>array(69,0,558,729),8253=>array(69,0,515,742),8254=>array(0,663,500,755),8255=>array(-31,-237,859,-79),8256=>array(-31,769,859,927),8257=>array(-52,-235,296,231),8258=>array(20,-37,1003,832),8259=>array(96,220,404,358),8260=>array(-199,-14,366,742),8261=>array(86,-132,389,760),8262=>array(68,-132,371,760),8263=>array(34,0,996,742),8264=>array(69,0,760,742),8265=>array(69,0,760,742),8266=>array(49,-125,464,546),8267=>array(93,-96,579,729),8268=>array(75,189,425,541),8269=>array(75,189,425,541),8270=>array(20,0,503,464),8271=>array(104,-142,329,547),8272=>array(-31,-237,859,927),8273=>array(53,-14,439,797),8274=>array(30,-93,529,729),8275=>array(49,212,951,415),8276=>array(-31,-240,859,-82),8277=>array(152,98,686,631),8278=>array(110,93,574,645),8279=>array(20,547,789,729),8280=>array(76,21,762,708),8281=>array(126,71,712,657),8282=>array(102,0,280,729),8283=>array(49,-170,822,898),8284=>array(55,0,783,729),8285=>array(102,0,278,683),8286=>array(102,0,278,683),8304=>array(29,319,398,742),8305=>array(53,326,164,751),8308=>array(27,326,397,734),8309=>array(47,319,384,734),8310=>array(38,319,394,742),8311=>array(41,326,378,734),8312=>array(38,319,389,742),8313=>array(32,319,388,742),8314=>array(67,326,461,677),8315=>array(67,469,461,534),8316=>array(67,407,461,596),8317=>array(54,252,237,751),8318=>array(50,252,234,751),8319=>array(54,326,406,640),8320=>array(29,-7,398,416),8321=>array(60,0,382,408),8322=>array(53,0,382,416),8323=>array(44,-7,384,416),8324=>array(27,0,397,408),8325=>array(47,-7,384,408),8326=>array(38,-7,394,416),8327=>array(41,0,378,408),8328=>array(38,-7,389,416),8329=>array(32,-7,388,416),8330=>array(67,0,461,351),8331=>array(67,143,461,208),8332=>array(67,81,461,270),8333=>array(54,-74,237,425),8334=>array(50,-74,234,425),8336=>array(53,-8,402,313),8337=>array(53,-8,423,313),8338=>array(53,-8,432,313),8339=>array(10,0,403,306),8340=>array(53,-8,423,313),8341=>array(54,0,406,425),8342=>array(53,0,431,425),8343=>array(54,0,166,425),8344=>array(53,0,607,313),8345=>array(54,0,406,313),8346=>array(53,-117,423,313),8347=>array(33,-8,351,313),8348=>array(53,0,332,393),8352=>array(38,0,892,729),8353=>array(50,-44,634,778),8354=>array(29,-14,667,742),8355=>array(75,0,663,729),8356=>array(61,0,613,742),8357=>array(83,-93,963,640),8358=>array(43,0,794,729),8359=>array(92,-14,1470,729),8360=>array(92,-14,1157,729),8361=>array(13,0,1088,729),8362=>array(39,-14,859,729),8363=>array(30,-182,692,760),8364=>array(-19,-14,629,742),8365=>array(29,0,695,729),8366=>array(12,0,684,729),8367=>array(92,-223,1247,742),8368=>array(14,-14,648,742),8369=>array(34,0,696,729),8370=>array(50,-81,643,809),8371=>array(5,0,691,729),8372=>array(43,-14,816,742),8373=>array(72,-147,629,760),8376=>array(12,0,684,729),8377=>array(50,0,647,729),8378=>array(5,0,745,729),8400=>array(-498,628,-26,760),8401=>array(-470,628,1,760),8406=>array(-470,560,-26,760),8407=>array(-470,560,-26,760),8411=>array(-501,654,-1,774),8412=>array(-595,654,99,774),8417=>array(-470,560,-26,760),8448=>array(20,-24,1083,752),8449=>array(20,-24,1137,752),8450=>array(50,-14,670,742),8451=>array(87,-14,1147,749),8452=>array(64,0,832,729),8453=>array(20,-24,1064,752),8454=>array(20,-24,1117,752),8455=>array(67,-14,616,742),8456=>array(64,-146,684,611),8457=>array(87,0,1002,749),8459=>array(36,-14,1063,746),8460=>array(6,-125,809,747),8461=>array(100,0,788,729),8462=>array(31,0,654,760),8463=>array(10,0,625,760),8464=>array(36,-14,533,742),8465=>array(52,-14,659,743),8466=>array(37,-14,787,742),8467=>array(-14,-14,401,742),8468=>array(9,-14,936,760),8469=>array(92,0,745,729),8470=>array(34,0,1154,729),8471=>array(138,0,862,725),8472=>array(54,-221,658,495),8473=>array(92,0,709,729),8474=>array(50,-146,800,742),8475=>array(31,-14,904,768),8476=>array(41,-14,803,743),8477=>array(98,0,793,729),8478=>array(37,0,859,729),8479=>array(81,-112,694,887),8480=>array(127,444,792,731),8481=>array(3,0,1249,547),8482=>array(144,447,790,729),8483=>array(11,-113,729,885),8484=>array(45,0,709,729),8485=>array(26,-230,540,777),8486=>array(27,0,823,742),8487=>array(27,-14,823,728),8488=>array(-5,-159,670,729),8489=>array(1,0,271,566),8490=>array(92,0,805,729),8491=>array(5,0,769,928),8492=>array(41,-1,853,772),8493=>array(63,-19,767,742),8494=>array(61,-12,793,647),8495=>array(41,-14,591,533),8496=>array(72,-14,668,742),8497=>array(37,-14,860,773),8498=>array(92,0,599,729),8499=>array(38,-18,1156,751),8500=>array(29,-12,436,420),8501=>array(50,-14,761,742),8502=>array(19,-14,687,742),8503=>array(31,-35,439,742),8504=>array(63,-41,633,742),8505=>array(34,0,355,760),8506=>array(44,-27,932,723),8507=>array(69,0,1352,547),8508=>array(34,-14,765,547),8509=>array(-40,-208,700,561),8510=>array(92,0,627,729),8511=>array(92,0,771,729),8512=>array(12,-192,820,719),8513=>array(25,-14,723,742),8514=>array(9,0,527,729),8515=>array(43,0,561,729),8516=>array(0,0,744,729),8517=>array(21,0,786,729),8518=>array(34,-14,752,760),8519=>array(33,-14,635,560),8520=>array(15,0,353,760),8521=>array(-143,-216,354,760),8523=>array(41,-14,811,742),8526=>array(55,0,470,547),8528=>array(49,-14,983,742),8529=>array(49,-14,993,742),8530=>array(49,-14,1441,742),8531=>array(49,-14,989,742),8532=>array(53,-14,989,742),8533=>array(49,-14,989,742),8534=>array(53,-14,989,742),8535=>array(44,-14,989,742),8536=>array(27,-14,989,742),8537=>array(49,-14,999,742),8538=>array(47,-14,999,742),8539=>array(49,-14,994,742),8540=>array(44,-14,994,742),8541=>array(47,-14,994,742),8542=>array(41,-14,994,742),8543=>array(49,-14,814,742),8544=>array(92,0,280,729),8545=>array(92,0,566,729),8546=>array(92,0,853,729),8547=>array(92,0,1094,729),8548=>array(5,0,769,729),8549=>array(5,0,1007,729),8550=>array(5,0,1293,729),8551=>array(5,0,1580,729),8552=>array(92,0,1101,729),8553=>array(19,0,751,729),8554=>array(19,0,1028,729),8555=>array(19,0,1314,729),8556=>array(92,0,610,729),8557=>array(50,-14,670,742),8558=>array(92,0,778,729),8559=>array(92,0,903,729),8560=>array(84,0,259,760),8561=>array(84,0,523,760),8562=>array(84,0,788,760),8563=>array(84,0,946,760),8564=>array(15,0,637,547),8565=>array(15,0,878,760),8566=>array(15,0,1143,760),8567=>array(15,0,1407,760),8568=>array(84,0,954,760),8569=>array(15,0,630,547),8570=>array(15,0,885,760),8571=>array(15,0,1149,760),8572=>array(84,0,259,760),8573=>array(43,-14,526,560),8574=>array(45,-14,632,760),8575=>array(83,0,963,560),8576=>array(52,0,1236,729),8577=>array(92,0,778,729),8578=>array(52,0,1236,729),8579=>array(50,-14,670,742),8580=>array(43,-14,526,560),8581=>array(50,-208,670,742),8585=>array(29,-14,989,742),8592=>array(49,87,781,540),8593=>array(193,0,646,732),8594=>array(57,87,789,540),8595=>array(193,-3,646,729),8596=>array(49,87,789,540),8597=>array(193,-3,646,732),8598=>array(136,66,720,650),8599=>array(136,66,720,650),8600=>array(136,66,720,650),8601=>array(136,66,720,650),8602=>array(49,87,781,540),8603=>array(57,87,789,540),8604=>array(13,84,833,431),8605=>array(5,84,825,431),8606=>array(49,87,781,540),8607=>array(189,0,641,732),8608=>array(57,87,789,540),8609=>array(194,-3,646,729),8610=>array(49,87,793,540),8611=>array(45,87,789,540),8612=>array(49,87,781,540),8613=>array(193,0,646,732),8614=>array(57,87,789,540),8615=>array(193,0,646,732),8616=>array(193,0,646,732),8617=>array(49,87,781,565),8618=>array(57,87,789,565),8619=>array(49,87,781,565),8620=>array(57,87,789,565),8621=>array(49,87,789,540),8622=>array(49,86,789,541),8623=>array(123,-4,714,733),8624=>array(169,0,646,755),8625=>array(192,0,669,755),8626=>array(169,-26,646,729),8627=>array(192,-26,669,729),8628=>array(233,-3,772,621),8629=>array(49,87,673,626),8630=>array(11,198,816,685),8631=>array(22,198,828,685),8632=>array(118,13,788,729),8633=>array(49,-108,789,735),8634=>array(86,45,767,691),8635=>array(71,45,751,691),8636=>array(49,255,781,540),8637=>array(49,87,781,372),8638=>array(361,0,646,732),8639=>array(193,0,478,732),8640=>array(57,255,789,540),8641=>array(57,87,789,372),8642=>array(361,0,646,732),8643=>array(193,0,478,732),8644=>array(49,-59,789,686),8645=>array(47,-3,792,732),8646=>array(49,-59,789,686),8647=>array(49,-59,781,686),8648=>array(46,0,792,732),8649=>array(57,-59,789,686),8650=>array(46,-3,792,729),8651=>array(49,-5,789,632),8652=>array(49,-5,789,632),8653=>array(49,87,781,540),8654=>array(49,87,789,540),8655=>array(57,87,789,540),8656=>array(49,87,781,540),8657=>array(193,0,645,732),8658=>array(57,87,789,540),8659=>array(193,-3,645,729),8660=>array(49,87,789,540),8661=>array(193,-8,645,732),8662=>array(132,-26,755,596),8663=>array(88,-26,711,597),8664=>array(88,16,711,639),8665=>array(132,16,755,639),8666=>array(49,87,781,540),8667=>array(57,87,789,540),8668=>array(44,87,776,540),8669=>array(57,87,789,540),8670=>array(193,0,646,732),8671=>array(193,-3,646,729),8672=>array(49,87,781,540),8673=>array(193,0,646,732),8674=>array(57,87,789,540),8675=>array(193,-3,646,729),8676=>array(49,87,781,540),8677=>array(57,87,789,540),8678=>array(27,46,781,581),8679=>array(151,0,687,754),8680=>array(35,46,789,581),8681=>array(151,-25,687,729),8682=>array(151,0,687,754),8683=>array(151,0,687,754),8684=>array(151,0,687,754),8685=>array(151,0,687,754),8686=>array(151,0,687,754),8687=>array(151,0,687,754),8688=>array(35,46,789,581),8689=>array(60,0,788,729),8690=>array(60,0,788,729),8691=>array(151,-25,687,754),8692=>array(57,87,789,540),8693=>array(47,-3,792,732),8694=>array(57,-223,789,850),8695=>array(49,87,781,540),8696=>array(57,87,789,540),8697=>array(49,87,789,540),8698=>array(49,87,781,540),8699=>array(57,87,789,540),8700=>array(49,87,789,540),8701=>array(27,96,781,531),8702=>array(57,96,811,531),8703=>array(27,96,811,531),8704=>array(5,0,769,729),8705=>array(48,-14,629,742),8706=>array(29,-14,515,674),8707=>array(92,0,610,729),8708=>array(92,-46,610,775),8709=>array(47,-15,810,715),8710=>array(0,0,697,719),8711=>array(0,0,697,719),8712=>array(73,-2,824,730),8713=>array(73,-46,824,775),8714=>array(106,58,644,568),8715=>array(73,-2,824,730),8716=>array(73,-46,824,775),8717=>array(106,58,644,568),8718=>array(98,0,539,553),8719=>array(73,-192,712,719),8720=>array(73,-193,712,718),8721=>array(20,-192,697,719),8722=>array(106,256,732,371),8723=>array(106,0,732,627),8724=>array(49,0,647,729),8725=>array(0,-93,365,729),8726=>array(165,-49,530,772),8727=>array(118,0,720,626),8728=>array(150,151,475,477),8729=>array(102,253,278,442),8730=>array(37,-20,669,837),8731=>array(37,-20,669,933),8732=>array(36,-20,669,924),8733=>array(92,89,617,505),8734=>array(92,89,741,505),8735=>array(106,67,732,693),8736=>array(77,0,820,729),8737=>array(77,-44,820,729),8738=>array(116,-0,732,726),8739=>array(207,-207,322,773),8740=>array(48,-207,482,773),8741=>array(112,-207,417,773),8742=>array(48,-207,482,773),8743=>array(151,0,661,579),8744=>array(151,0,661,579),8745=>array(151,0,661,579),8746=>array(151,0,661,579),8747=>array(15,-227,548,754),8748=>array(15,-227,914,754),8749=>array(15,-227,1280,754),8750=>array(14,-227,548,754),8751=>array(38,-227,938,754),8752=>array(23,-227,1290,754),8753=>array(15,-227,616,754),8754=>array(14,-227,600,754),8755=>array(14,-227,588,754),8756=>array(60,78,637,647),8757=>array(60,78,637,647),8758=>array(59,79,235,647),8759=>array(60,78,637,647),8760=>array(106,256,732,631),8761=>array(106,45,800,584),8762=>array(106,-4,732,631),8763=>array(106,-34,732,660),8764=>array(106,212,732,415),8765=>array(106,212,732,415),8766=>array(65,131,772,497),8767=>array(106,42,732,584),8768=>array(85,0,289,626),8769=>array(106,76,732,551),8770=>array(106,110,732,482),8771=>array(106,144,732,517),8772=>array(106,0,732,637),8773=>array(106,37,732,628),8774=>array(106,-31,732,628),8775=>array(106,-86,732,726),8776=>array(106,110,732,517),8777=>array(106,8,732,614),8778=>array(106,37,732,628),8779=>array(106,-13,732,628),8780=>array(106,37,732,628),8781=>array(105,105,732,585),8782=>array(106,26,732,656),8783=>array(106,172,732,656),8784=>array(106,144,732,744),8785=>array(106,-117,732,743),8786=>array(105,-92,732,719),8787=>array(104,-92,731,719),8788=>array(98,102,965,520),8789=>array(96,102,966,520),8790=>array(106,144,732,482),8791=>array(106,144,732,839),8792=>array(106,144,732,704),8793=>array(106,144,732,840),8794=>array(106,144,732,840),8795=>array(106,144,732,959),8796=>array(106,144,732,952),8797=>array(106,144,732,762),8798=>array(106,144,732,786),8799=>array(106,144,732,903),8800=>array(106,-5,732,631),8801=>array(106,38,732,588),8802=>array(106,-69,732,695),8803=>array(106,-74,732,700),8804=>array(106,0,732,582),8805=>array(106,0,732,582),8806=>array(106,-106,732,617),8807=>array(106,-106,732,617),8808=>array(106,-185,732,617),8809=>array(106,-185,732,617),8810=>array(72,-34,974,660),8811=>array(72,-34,974,660),8812=>array(86,-132,414,759),8813=>array(105,-10,732,700),8814=>array(106,-4,732,690),8815=>array(106,-63,732,631),8816=>array(106,-112,732,645),8817=>array(106,-112,732,645),8818=>array(106,-84,732,582),8819=>array(106,-84,732,582),8820=>array(106,-112,732,645),8821=>array(106,-112,732,645),8822=>array(102,-119,732,678),8823=>array(102,-119,732,678),8824=>array(102,-221,732,779),8825=>array(102,-221,732,779),8826=>array(106,-55,732,681),8827=>array(106,-55,732,681),8828=>array(106,-177,732,684),8829=>array(106,-177,732,684),8830=>array(106,-132,732,684),8831=>array(106,-132,732,684),8832=>array(106,-89,732,781),8833=>array(106,-89,732,781),8834=>array(99,67,739,559),8835=>array(99,65,739,559),8836=>array(99,-96,739,726),8837=>array(99,-100,739,722),8838=>array(99,0,739,636),8839=>array(99,0,739,635),8840=>array(99,-124,739,759),8841=>array(99,-124,739,759),8842=>array(99,-97,739,636),8843=>array(99,-97,739,635),8844=>array(151,0,661,579),8845=>array(151,0,661,579),8846=>array(151,0,661,579),8847=>array(106,0,732,584),8848=>array(106,0,732,584),8849=>array(106,-115,732,667),8850=>array(106,-115,732,667),8851=>array(106,0,690,626),8852=>array(106,0,690,626),8853=>array(91,-14,747,643),8854=>array(91,-14,747,643),8855=>array(91,-14,747,643),8856=>array(91,-13,747,642),8857=>array(91,-14,747,643),8858=>array(91,-14,747,643),8859=>array(91,-14,747,643),8860=>array(91,-14,747,643),8861=>array(91,-14,747,643),8862=>array(77,-29,761,657),8863=>array(77,-29,761,657),8864=>array(77,-29,761,657),8865=>array(77,-29,761,657),8866=>array(85,0,829,705),8867=>array(85,0,829,705),8868=>array(85,0,829,705),8869=>array(85,0,829,705),8870=>array(85,0,457,705),8871=>array(85,0,457,705),8872=>array(85,0,829,705),8873=>array(85,0,829,705),8874=>array(85,0,829,705),8875=>array(85,0,829,705),8876=>array(85,-100,829,805),8877=>array(85,-100,829,805),8878=>array(85,-100,829,805),8879=>array(85,-100,829,805),8880=>array(106,-54,724,681),8881=>array(114,-54,732,681),8882=>array(106,-1,732,628),8883=>array(106,-1,732,628),8884=>array(106,-80,732,706),8885=>array(106,-80,732,706),8886=>array(60,151,940,477),8887=>array(60,151,940,477),8888=>array(60,151,778,477),8889=>array(43,-63,794,689),8890=>array(63,0,480,705),8891=>array(103,0,709,759),8892=>array(103,0,709,759),8893=>array(103,0,709,759),8894=>array(106,0,732,626),8895=>array(106,0,732,626),8896=>array(0,-192,843,719),8897=>array(0,-192,843,719),8898=>array(48,-192,794,719),8899=>array(48,-192,794,719),8900=>array(3,-233,491,807),8901=>array(102,253,278,442),8902=>array(83,112,543,549),8903=>array(106,-56,732,683),8904=>array(106,-48,894,674),8905=>array(106,-48,894,675),8906=>array(106,-48,894,675),8907=>array(106,-48,894,675),8908=>array(106,-48,894,675),8909=>array(106,144,732,517),8910=>array(49,0,763,579),8911=>array(49,0,763,579),8912=>array(93,-22,732,649),8913=>array(106,-22,745,649),8914=>array(83,0,755,639),8915=>array(83,-14,755,625),8916=>array(186,0,652,729),8917=>array(106,-100,732,729),8918=>array(106,30,732,597),8919=>array(106,30,732,597),8920=>array(72,-34,1350,660),8921=>array(72,-34,1350,660),8922=>array(106,-211,732,837),8923=>array(106,-211,732,837),8924=>array(106,0,732,582),8925=>array(106,0,732,582),8926=>array(106,-177,732,684),8927=>array(106,-177,732,684),8928=>array(106,-197,732,808),8929=>array(106,-263,732,742),8930=>array(106,-191,732,817),8931=>array(106,-191,732,817),8932=>array(106,-146,732,636),8933=>array(106,-146,732,636),8934=>array(106,-168,732,582),8935=>array(106,-168,732,582),8936=>array(106,-216,732,684),8937=>array(106,-216,732,684),8938=>array(106,-138,732,808),8939=>array(106,-138,732,808),8940=>array(106,-224,732,894),8941=>array(106,-224,732,894),8942=>array(412,-40,588,735),8943=>array(79,253,921,442),8944=>array(79,-40,921,735),8945=>array(79,-40,921,735),8946=>array(72,-2,1085,730),8947=>array(73,-2,824,730),8948=>array(106,58,644,568),8949=>array(73,-2,824,984),8950=>array(73,-2,824,919),8951=>array(106,58,644,741),8952=>array(73,-207,824,730),8953=>array(73,-2,824,730),8954=>array(72,-2,1085,730),8955=>array(73,-2,824,730),8956=>array(106,58,644,568),8957=>array(72,-2,824,919),8958=>array(106,58,644,741),8959=>array(106,0,791,732),8960=>array(31,-22,572,519),8961=>array(56,152,540,453),8962=>array(64,0,651,596),8963=>array(193,470,646,732),8964=>array(193,0,646,263),8965=>array(193,-12,646,423),8966=>array(193,-12,646,552),8967=>array(139,-39,349,798),8968=>array(86,-132,389,760),8969=>array(68,-132,371,760),8970=>array(86,-132,389,760),8971=>array(68,-132,371,760),8972=>array(352,-77,759,331),8973=>array(49,-77,457,331),8974=>array(352,226,759,634),8975=>array(49,226,457,634),8976=>array(106,140,732,444),8977=>array(3,113,536,646),8984=>array(84,0,843,759),8985=>array(106,140,732,444),8988=>array(86,425,403,760),8989=>array(65,425,383,760),8990=>array(86,-126,403,208),8991=>array(65,-126,383,208),8992=>array(235,-250,586,926),8993=>array(22,-240,373,940),8996=>array(76,215,1076,575),8997=>array(76,0,1076,575),8998=>array(76,0,1414,760),8999=>array(76,0,1076,760),9000=>array(59,0,1385,729),9003=>array(0,0,1338,760),9004=>array(73,-91,800,748),9075=>array(78,-19,348,547),9076=>array(84,-208,671,562),9077=>array(43,-13,826,547),9082=>array(48,-13,645,559),9085=>array(13,-228,850,99),9095=>array(76,0,1100,743),9108=>array(17,0,856,727),9115=>array(63,-252,438,928),9116=>array(63,-252,205,940),9117=>array(63,-240,438,940),9118=>array(63,-252,438,928),9119=>array(295,-252,438,940),9120=>array(63,-240,438,940),9121=>array(63,-252,438,928),9122=>array(63,-252,205,940),9123=>array(63,-240,438,940),9124=>array(63,-252,438,928),9125=>array(295,-252,438,940),9126=>array(63,-240,438,940),9127=>array(306,-261,668,928),9128=>array(82,-247,444,934),9129=>array(306,-240,668,934),9130=>array(306,-256,444,934),9131=>array(82,-261,444,928),9132=>array(306,-247,668,934),9133=>array(82,-240,444,934),9134=>array(235,-250,373,940),9166=>array(27,46,781,729),9167=>array(91,0,854,596),9187=>array(73,-91,800,748),9189=>array(3,75,766,444),9192=>array(39,-129,665,294),9250=>array(-81,-14,671,760),9251=>array(64,-228,651,99),9312=>array(59,-15,788,715),9313=>array(59,-15,788,715),9314=>array(59,-15,788,715),9315=>array(59,-15,788,715),9316=>array(59,-15,788,715),9317=>array(59,-15,788,715),9318=>array(59,-15,788,715),9319=>array(59,-15,788,715),9320=>array(59,-15,788,715),9321=>array(59,-15,788,715),9600=>array(-10,260,779,770),9601=>array(-10,-250,779,-123),9602=>array(-10,-250,779,-5),9603=>array(-10,-250,779,132),9604=>array(-10,-250,779,260),9605=>array(-10,-250,779,387),9606=>array(-10,-250,779,515),9607=>array(-10,-250,779,642),9608=>array(-10,-250,779,770),9609=>array(-10,-250,680,770),9610=>array(-10,-250,582,770),9611=>array(-10,-250,483,770),9612=>array(-10,-250,384,770),9613=>array(-10,-250,286,770),9614=>array(-10,-250,187,770),9615=>array(-10,-250,88,770),9616=>array(384,-250,778,770),9617=>array(-10,-250,680,770),9618=>array(-10,-250,779,770),9619=>array(-10,-250,779,770),9620=>array(-10,642,779,770),9621=>array(680,-250,778,770),9622=>array(-10,-250,385,260),9623=>array(384,-250,779,260),9624=>array(-10,260,385,770),9625=>array(-10,-250,779,770),9626=>array(-10,-250,779,770),9627=>array(-10,-250,779,770),9628=>array(-10,-250,779,770),9629=>array(384,260,779,770),9630=>array(-10,-250,779,770),9631=>array(-10,-250,779,770),9632=>array(91,-124,854,643),9633=>array(91,-124,854,643),9634=>array(91,-124,854,643),9635=>array(91,-124,854,643),9636=>array(91,-124,854,643),9637=>array(91,-124,854,643),9638=>array(91,-124,854,643),9639=>array(91,-124,854,643),9640=>array(91,-124,854,643),9641=>array(91,-124,854,643),9642=>array(91,11,587,509),9643=>array(91,11,587,509),9644=>array(91,75,854,444),9645=>array(91,75,854,444),9646=>array(91,-122,459,642),9647=>array(91,-122,459,642),9648=>array(3,75,766,444),9649=>array(3,75,766,444),9650=>array(3,-124,766,643),9651=>array(3,-124,766,643),9652=>array(3,11,499,509),9653=>array(3,11,499,509),9654=>array(3,-124,766,643),9655=>array(3,-124,766,643),9656=>array(3,11,499,509),9657=>array(3,11,499,509),9658=>array(3,11,766,509),9659=>array(3,11,766,509),9660=>array(3,-124,766,643),9661=>array(3,-124,766,643),9662=>array(3,11,499,509),9663=>array(3,11,499,509),9664=>array(3,-124,766,643),9665=>array(3,-124,766,643),9666=>array(3,11,499,509),9667=>array(3,11,499,509),9668=>array(3,11,766,509),9669=>array(3,11,766,509),9670=>array(3,-124,766,643),9671=>array(3,-124,766,643),9672=>array(3,-124,766,643),9673=>array(55,-125,818,645),9674=>array(3,-233,491,807),9675=>array(55,-125,818,645),9676=>array(56,-125,817,644),9677=>array(55,-125,818,645),9678=>array(55,-125,818,645),9679=>array(55,-123,818,641),9680=>array(55,-123,818,641),9681=>array(55,-123,818,641),9682=>array(55,-123,818,641),9683=>array(55,-123,818,641),9684=>array(55,-123,818,641),9685=>array(55,-123,818,641),9686=>array(55,-125,436,645),9687=>array(91,-125,472,645),9688=>array(91,-10,750,770),9689=>array(91,-250,879,770),9690=>array(91,260,879,770),9691=>array(91,-250,879,260),9692=>array(3,260,385,645),9693=>array(3,260,384,645),9694=>array(3,-125,384,260),9695=>array(3,-125,385,260),9696=>array(3,260,766,645),9697=>array(3,-125,766,260),9698=>array(3,-124,766,643),9699=>array(3,-124,766,643),9700=>array(3,-124,766,643),9701=>array(3,-124,766,643),9702=>array(144,196,495,547),9703=>array(91,-124,854,643),9704=>array(91,-124,854,643),9705=>array(91,-124,854,643),9706=>array(91,-124,854,643),9707=>array(91,-124,854,643),9708=>array(3,-124,766,643),9709=>array(3,-124,766,643),9710=>array(3,-124,766,643),9711=>array(55,-250,1064,770),9712=>array(91,-124,854,643),9713=>array(91,-124,854,643),9714=>array(91,-124,854,643),9715=>array(91,-124,854,643),9716=>array(55,-123,818,641),9717=>array(55,-123,818,641),9718=>array(55,-123,818,641),9719=>array(55,-123,818,641),9720=>array(3,-124,766,643),9721=>array(3,-124,766,643),9722=>array(3,-124,766,643),9723=>array(91,-66,739,585),9724=>array(91,-66,739,585),9725=>array(91,-17,642,537),9726=>array(91,-17,642,537),9727=>array(3,-124,766,643),9728=>array(83,0,813,729),9729=>array(51,-2,949,360),9730=>array(49,0,848,729),9731=>array(83,-0,813,927),9732=>array(64,0,833,880),9733=>array(65,-4,832,723),9734=>array(65,-4,832,723),9735=>array(83,2,490,729),9736=>array(83,0,813,731),9737=>array(83,0,813,730),9738=>array(61,0,828,727),9739=>array(61,0,828,723),9740=>array(61,-1,610,722),9741=>array(61,0,952,723),9742=>array(68,0,1177,729),9743=>array(71,0,1180,729),9744=>array(90,0,807,729),9745=>array(89,0,808,729),9746=>array(89,0,808,729),9747=>array(75,78,457,656),9748=>array(49,0,870,933),9749=>array(74,0,822,731),9750=>array(84,0,813,731),9751=>array(84,0,813,727),9752=>array(78,0,819,729),9753=>array(83,140,813,574),9754=>array(84,113,813,569),9755=>array(84,113,813,569),9756=>array(87,104,810,569),9757=>array(72,0,537,724),9758=>array(86,103,810,569),9759=>array(72,-3,537,720),9760=>array(61,0,835,730),9761=>array(84,0,813,730),9762=>array(83,0,813,730),9763=>array(49,0,848,730),9764=>array(49,-2,620,727),9765=>array(83,0,663,731),9766=>array(83,-1,566,731),9767=>array(83,0,701,911),9768=>array(83,0,462,730),9769=>array(83,-1,813,729),9770=>array(87,0,810,730),9771=>array(83,0,814,731),9772=>array(83,0,627,731),9773=>array(83,0,813,730),9774=>array(83,0,813,730),9775=>array(83,0,813,730),9776=>array(83,0,813,729),9777=>array(83,0,814,729),9778=>array(83,0,813,729),9779=>array(83,0,813,729),9780=>array(83,0,813,729),9781=>array(83,0,813,729),9782=>array(83,0,813,729),9783=>array(83,0,813,729),9784=>array(80,3,817,721),9785=>array(83,-73,959,804),9786=>array(83,-73,959,804),9787=>array(83,-73,959,804),9788=>array(83,0,813,730),9789=>array(358,0,814,730),9790=>array(83,0,539,730),9791=>array(85,-102,528,732),9792=>array(85,-125,647,731),9793=>array(85,-14,647,843),9794=>array(79,-14,831,720),9795=>array(166,0,730,730),9796=>array(219,0,677,730),9797=>array(121,0,774,730),9798=>array(127,0,769,730),9799=>array(240,0,656,730),9800=>array(45,0,851,731),9801=>array(89,0,807,730),9802=>array(94,0,802,731),9803=>array(113,31,784,679),9804=>array(140,0,756,730),9805=>array(53,-180,843,730),9806=>array(83,52,813,653),9807=>array(34,-96,863,730),9808=>array(83,-0,813,730),9809=>array(94,0,802,730),9810=>array(86,153,810,579),9811=>array(157,0,739,730),9812=>array(98,0,798,730),9813=>array(110,0,786,730),9814=>array(167,-1,729,729),9815=>array(214,0,683,730),9816=>array(165,0,732,730),9817=>array(148,-0,748,730),9818=>array(98,0,798,730),9819=>array(110,0,786,730),9820=>array(167,-1,729,729),9821=>array(214,0,683,730),9822=>array(162,0,734,730),9823=>array(148,-0,748,730),9824=>array(158,0,738,729),9825=>array(90,0,806,727),9826=>array(168,0,728,729),9827=>array(111,0,785,729),9828=>array(157,0,739,729),9829=>array(89,0,808,729),9830=>array(168,0,728,729),9831=>array(111,0,785,732),9832=>array(105,-1,791,729),9833=>array(84,-5,339,729),9834=>array(84,-5,554,729),9835=>array(184,-102,712,729),9836=>array(92,-5,804,729),9837=>array(88,-3,392,731),9838=>array(84,0,273,731),9839=>array(84,0,400,731),9840=>array(84,0,664,731),9841=>array(64,0,701,731),9842=>array(84,0,813,709),9843=>array(76,16,820,731),9844=>array(76,16,820,731),9845=>array(76,16,820,731),9846=>array(76,16,820,731),9847=>array(76,16,820,731),9848=>array(76,16,820,731),9849=>array(76,16,820,731),9850=>array(76,16,820,731),9851=>array(84,0,812,704),9852=>array(83,0,814,731),9853=>array(83,0,814,731),9854=>array(83,0,814,731),9855=>array(149,1,747,731),9856=>array(73,0,797,725),9857=>array(73,0,797,725),9858=>array(73,0,797,725),9859=>array(73,0,797,725),9860=>array(73,0,797,725),9861=>array(73,0,797,725),9862=>array(83,0,813,731),9863=>array(83,0,813,731),9864=>array(83,0,813,731),9865=>array(83,0,813,731),9866=>array(83,0,813,98),9867=>array(83,0,813,98),9868=>array(83,0,813,413),9869=>array(83,0,813,413),9870=>array(83,0,813,413),9871=>array(83,0,813,413),9872=>array(168,3,728,731),9873=>array(168,3,728,731),9874=>array(52,0,844,731),9875=>array(97,-10,799,732),9876=>array(131,0,765,729),9877=>array(61,-10,479,732),9878=>array(59,-10,837,732),9879=>array(61,0,835,732),9880=>array(145,0,750,732),9881=>array(95,-17,802,727),9882=>array(128,-9,768,733),9883=>array(127,0,769,728),9884=>array(127,0,769,729),9888=>array(49,0,848,729),9889=>array(83,2,619,730),9890=>array(85,-125,919,731),9891=>array(79,-206,1023,720),9892=>array(85,-186,1109,856),9893=>array(85,-125,837,917),9894=>array(131,-14,727,869),9895=>array(101,-170,741,884),9896=>array(188,-14,650,869),9897=>array(4,133,829,596),9898=>array(188,133,650,597),9899=>array(188,133,650,597),9900=>array(249,194,589,536),9901=>array(175,194,663,536),9902=>array(41,169,797,560),9903=>array(5,194,833,536),9904=>array(103,237,757,540),9905=>array(211,42,626,698),9906=>array(85,-125,647,731),9907=>array(168,-125,646,731),9908=>array(86,-125,646,731),9909=>array(86,-125,646,731),9910=>array(59,-118,791,643),9911=>array(194,-104,595,710),9912=>array(158,-125,543,731),9920=>array(42,4,796,553),9921=>array(42,4,796,724),9922=>array(42,4,796,553),9923=>array(42,4,796,724),9954=>array(85,-14,647,843),9985=>array(11,190,803,635),9986=>array(42,141,784,588),9987=>array(11,94,803,539),9988=>array(36,119,824,613),9990=>array(42,-14,796,742),9991=>array(42,-14,796,742),9992=>array(59,21,782,708),9993=>array(64,107,773,622),9996=>array(212,0,561,742),9997=>array(21,83,802,678),9998=>array(89,75,724,710),9999=>array(26,198,819,530),10000=>array(89,75,724,710),10001=>array(43,185,757,544),10002=>array(67,209,757,520),10003=>array(150,97,667,630),10004=>array(116,87,721,631),10005=>array(126,72,711,657),10006=>array(85,31,752,698),10007=>array(118,-9,701,732),10008=>array(123,0,754,739),10009=>array(55,0,783,729),10010=>array(55,0,783,729),10011=>array(55,0,783,729),10012=>array(55,0,783,729),10013=>array(165,0,673,729),10014=>array(131,0,678,729),10015=>array(155,0,683,729),10016=>array(55,0,783,729),10017=>array(91,-13,747,744),10018=>array(41,-14,797,742),10019=>array(42,-12,796,742),10020=>array(41,-14,797,742),10021=>array(41,-13,797,743),10022=>array(42,-14,796,745),10023=>array(42,-14,796,745),10025=>array(23,-9,814,743),10026=>array(42,-14,796,742),10027=>array(23,-9,814,743),10028=>array(23,-9,814,743),10029=>array(23,-9,814,743),10030=>array(23,-9,814,743),10031=>array(23,-9,814,743),10032=>array(24,12,815,714),10033=>array(64,0,773,729),10034=>array(74,0,764,729),10035=>array(55,0,783,729),10036=>array(31,-14,787,742),10037=>array(41,-14,797,742),10038=>array(91,-14,747,742),10039=>array(41,-14,797,742),10040=>array(41,-14,797,742),10041=>array(41,-14,797,742),10042=>array(55,0,783,729),10043=>array(82,-14,756,742),10044=>array(82,-14,756,742),10045=>array(84,-14,753,742),10046=>array(79,-14,759,742),10047=>array(54,0,784,709),10048=>array(54,0,784,709),10049=>array(41,-14,797,742),10050=>array(42,-14,796,742),10051=>array(79,-14,759,742),10052=>array(89,0,749,729),10053=>array(76,0,762,729),10054=>array(63,2,773,729),10055=>array(79,-13,759,742),10056=>array(47,-13,791,730),10057=>array(47,-13,791,730),10058=>array(41,-13,797,743),10059=>array(41,-13,797,743),10061=>array(50,-10,847,738),10063=>array(60,-49,837,729),10064=>array(60,0,837,777),10065=>array(60,-49,837,729),10066=>array(60,0,837,777),10070=>array(83,-2,813,728),10072=>array(377,-240,460,760),10073=>array(336,-240,502,760),10074=>array(253,-240,585,760),10075=>array(85,395,288,729),10076=>array(59,395,262,729),10077=>array(85,395,528,729),10078=>array(59,395,502,729),10081=>array(155,-93,772,851),10082=>array(202,-17,636,742),10083=>array(163,-17,675,742),10084=>array(54,83,784,645),10085=>array(168,-1,729,729),10086=>array(62,21,724,702),10087=>array(78,169,759,564),10088=>array(196,-139,648,769),10089=>array(196,-139,648,769),10090=>array(264,-132,574,758),10091=>array(264,-132,574,758),10092=>array(215,-240,607,760),10093=>array(232,-240,623,760),10094=>array(142,-240,685,760),10095=>array(153,-240,696,760),10096=>array(167,-240,656,760),10097=>array(183,-240,672,760),10098=>array(346,-241,535,760),10099=>array(303,-241,492,760),10100=>array(175,-163,634,760),10101=>array(204,-163,663,760),10102=>array(59,-15,788,715),10103=>array(59,-15,788,715),10104=>array(59,-15,788,715),10105=>array(59,-15,788,715),10106=>array(59,-15,788,715),10107=>array(59,-15,788,715),10108=>array(59,-15,788,715),10109=>array(59,-15,788,715),10110=>array(59,-15,788,715),10111=>array(59,-15,788,715),10112=>array(4,-52,833,780),10113=>array(4,-52,833,780),10114=>array(4,-52,833,780),10115=>array(4,-52,833,780),10116=>array(4,-52,833,780),10117=>array(4,-52,833,780),10118=>array(4,-52,833,780),10119=>array(4,-52,833,780),10120=>array(4,-52,833,780),10121=>array(4,-52,833,780),10122=>array(4,-52,833,780),10123=>array(4,-52,833,780),10124=>array(4,-52,833,780),10125=>array(4,-52,833,780),10126=>array(4,-52,833,780),10127=>array(4,-52,833,780),10128=>array(4,-52,833,780),10129=>array(4,-52,833,780),10130=>array(4,-52,833,780),10131=>array(4,-52,833,780),10132=>array(57,75,789,552),10136=>array(123,55,682,614),10137=>array(57,100,789,527),10138=>array(123,13,682,572),10139=>array(57,129,789,498),10140=>array(57,57,764,570),10141=>array(57,100,789,527),10142=>array(57,100,789,527),10143=>array(57,100,789,527),10144=>array(57,100,789,527),10145=>array(57,46,811,581),10146=>array(111,94,789,533),10147=>array(111,94,789,533),10148=>array(111,-4,789,631),10149=>array(57,100,789,548),10150=>array(57,79,789,527),10151=>array(240,-7,606,634),10152=>array(57,100,789,527),10153=>array(57,75,765,552),10154=>array(57,75,765,552),10155=>array(21,12,794,586),10156=>array(21,12,794,586),10157=>array(135,0,774,574),10158=>array(135,0,774,574),10159=>array(62,49,799,574),10161=>array(62,49,799,574),10162=>array(154,-20,721,585),10163=>array(63,157,789,470),10164=>array(81,55,682,655),10165=>array(57,173,789,454),10166=>array(82,-29,682,572),10167=>array(82,55,682,655),10168=>array(57,172,789,455),10169=>array(82,-28,682,572),10170=>array(56,84,789,543),10171=>array(73,140,779,487),10172=>array(79,167,774,460),10173=>array(79,118,774,509),10174=>array(57,81,789,546),10181=>array(54,-163,405,769),10182=>array(52,-163,403,769),10208=>array(3,-233,491,807),10214=>array(86,-132,419,760),10215=>array(86,-132,419,760),10216=>array(104,-132,377,759),10217=>array(80,-132,353,759),10218=>array(104,-132,641,759),10219=>array(80,-132,616,759),10224=>array(41,0,797,732),10225=>array(42,-3,798,729),10226=>array(9,45,816,685),10227=>array(22,45,830,685),10228=>array(57,-14,1108,643),10229=>array(49,87,1376,540),10230=>array(57,87,1385,540),10231=>array(49,87,1385,540),10232=>array(49,87,1376,540),10233=>array(57,87,1385,540),10234=>array(49,87,1385,540),10235=>array(49,87,1376,540),10236=>array(57,87,1385,540),10237=>array(49,87,1376,540),10238=>array(57,87,1385,540),10239=>array(57,87,1385,540),10241=>array(146,586,342,781),10242=>array(146,325,342,521),10243=>array(146,325,342,781),10244=>array(146,65,342,261),10245=>array(146,65,342,781),10246=>array(146,65,342,521),10247=>array(146,65,342,781),10248=>array(439,586,635,781),10249=>array(146,586,635,781),10250=>array(146,325,635,781),10251=>array(146,325,635,781),10252=>array(146,65,635,781),10253=>array(146,65,635,781),10254=>array(146,65,635,781),10255=>array(146,65,635,781),10256=>array(439,325,635,521),10257=>array(146,325,635,781),10258=>array(146,325,635,521),10259=>array(146,325,635,781),10260=>array(146,65,635,521),10261=>array(146,65,635,781),10262=>array(146,65,635,521),10263=>array(146,65,635,781),10264=>array(439,325,635,781),10265=>array(146,325,635,781),10266=>array(146,325,635,781),10267=>array(146,325,635,781),10268=>array(146,65,635,781),10269=>array(146,65,635,781),10270=>array(146,65,635,781),10271=>array(146,65,635,781),10272=>array(439,65,635,261),10273=>array(146,65,635,781),10274=>array(146,65,635,521),10275=>array(146,65,635,781),10276=>array(146,65,635,261),10277=>array(146,65,635,781),10278=>array(146,65,635,521),10279=>array(146,65,635,781),10280=>array(439,65,635,781),10281=>array(146,65,635,781),10282=>array(146,65,635,781),10283=>array(146,65,635,781),10284=>array(146,65,635,781),10285=>array(146,65,635,781),10286=>array(146,65,635,781),10287=>array(146,65,635,781),10288=>array(439,65,635,521),10289=>array(146,65,635,781),10290=>array(146,65,635,521),10291=>array(146,65,635,781),10292=>array(146,65,635,521),10293=>array(146,65,635,781),10294=>array(146,65,635,521),10295=>array(146,65,635,781),10296=>array(439,65,635,781),10297=>array(146,65,635,781),10298=>array(146,65,635,781),10299=>array(146,65,635,781),10300=>array(146,65,635,781),10301=>array(146,65,635,781),10302=>array(146,65,635,781),10303=>array(146,65,635,781),10304=>array(146,-195,342,0),10305=>array(146,-195,342,781),10306=>array(146,-195,342,521),10307=>array(146,-195,342,781),10308=>array(146,-195,342,261),10309=>array(146,-195,342,781),10310=>array(146,-195,342,521),10311=>array(146,-195,342,781),10312=>array(146,-195,635,781),10313=>array(146,-195,635,781),10314=>array(146,-195,635,781),10315=>array(146,-195,635,781),10316=>array(146,-195,635,781),10317=>array(146,-195,635,781),10318=>array(146,-195,635,781),10319=>array(146,-195,635,781),10320=>array(146,-195,635,521),10321=>array(146,-195,635,781),10322=>array(146,-195,635,521),10323=>array(146,-195,635,781),10324=>array(146,-195,635,521),10325=>array(146,-195,635,781),10326=>array(146,-195,635,521),10327=>array(146,-195,635,781),10328=>array(146,-195,635,781),10329=>array(146,-195,635,781),10330=>array(146,-195,635,781),10331=>array(146,-195,635,781),10332=>array(146,-195,635,781),10333=>array(146,-195,635,781),10334=>array(146,-195,635,781),10335=>array(146,-195,635,781),10336=>array(146,-195,635,261),10337=>array(146,-195,635,781),10338=>array(146,-195,635,521),10339=>array(146,-195,635,781),10340=>array(146,-195,635,261),10341=>array(146,-195,635,781),10342=>array(146,-195,635,521),10343=>array(146,-195,635,781),10344=>array(146,-195,635,781),10345=>array(146,-195,635,781),10346=>array(146,-195,635,781),10347=>array(146,-195,635,781),10348=>array(146,-195,635,781),10349=>array(146,-195,635,781),10350=>array(146,-195,635,781),10351=>array(146,-195,635,781),10352=>array(146,-195,635,521),10353=>array(146,-195,635,781),10354=>array(146,-195,635,521),10355=>array(146,-195,635,781),10356=>array(146,-195,635,521),10357=>array(146,-195,635,781),10358=>array(146,-195,635,521),10359=>array(146,-195,635,781),10360=>array(146,-195,635,781),10361=>array(146,-195,635,781),10362=>array(146,-195,635,781),10363=>array(146,-195,635,781),10364=>array(146,-195,635,781),10365=>array(146,-195,635,781),10366=>array(146,-195,635,781),10367=>array(146,-195,635,781),10368=>array(439,-195,635,0),10369=>array(146,-195,635,781),10370=>array(146,-195,635,521),10371=>array(146,-195,635,781),10372=>array(146,-195,635,261),10373=>array(146,-195,635,781),10374=>array(146,-195,635,521),10375=>array(146,-195,635,781),10376=>array(439,-195,635,781),10377=>array(146,-195,635,781),10378=>array(146,-195,635,781),10379=>array(146,-195,635,781),10380=>array(146,-195,635,781),10381=>array(146,-195,635,781),10382=>array(146,-195,635,781),10383=>array(146,-195,635,781),10384=>array(439,-195,635,521),10385=>array(146,-195,635,781),10386=>array(146,-195,635,521),10387=>array(146,-195,635,781),10388=>array(146,-195,635,521),10389=>array(146,-195,635,781),10390=>array(146,-195,635,521),10391=>array(146,-195,635,781),10392=>array(439,-195,635,781),10393=>array(146,-195,635,781),10394=>array(146,-195,635,781),10395=>array(146,-195,635,781),10396=>array(146,-195,635,781),10397=>array(146,-195,635,781),10398=>array(146,-195,635,781),10399=>array(146,-195,635,781),10400=>array(439,-195,635,261),10401=>array(146,-195,635,781),10402=>array(146,-195,635,521),10403=>array(146,-195,635,781),10404=>array(146,-195,635,261),10405=>array(146,-195,635,781),10406=>array(146,-195,635,521),10407=>array(146,-195,635,781),10408=>array(439,-195,635,781),10409=>array(146,-195,635,781),10410=>array(146,-195,635,781),10411=>array(146,-195,635,781),10412=>array(146,-195,635,781),10413=>array(146,-195,635,781),10414=>array(146,-195,635,781),10415=>array(146,-195,635,781),10416=>array(439,-195,635,521),10417=>array(146,-195,635,781),10418=>array(146,-195,635,521),10419=>array(146,-195,635,781),10420=>array(146,-195,635,521),10421=>array(146,-195,635,781),10422=>array(146,-195,635,521),10423=>array(146,-195,635,781),10424=>array(439,-195,635,781),10425=>array(146,-195,635,781),10426=>array(146,-195,635,781),10427=>array(146,-195,635,781),10428=>array(146,-195,635,781),10429=>array(146,-195,635,781),10430=>array(146,-195,635,781),10431=>array(146,-195,635,781),10432=>array(146,-195,635,0),10433=>array(146,-195,635,781),10434=>array(146,-195,635,521),10435=>array(146,-195,635,781),10436=>array(146,-195,635,261),10437=>array(146,-195,635,781),10438=>array(146,-195,635,521),10439=>array(146,-195,635,781),10440=>array(146,-195,635,781),10441=>array(146,-195,635,781),10442=>array(146,-195,635,781),10443=>array(146,-195,635,781),10444=>array(146,-195,635,781),10445=>array(146,-195,635,781),10446=>array(146,-195,635,781),10447=>array(146,-195,635,781),10448=>array(146,-195,635,521),10449=>array(146,-195,635,781),10450=>array(146,-195,635,521),10451=>array(146,-195,635,781),10452=>array(146,-195,635,521),10453=>array(146,-195,635,781),10454=>array(146,-195,635,521),10455=>array(146,-195,635,781),10456=>array(146,-195,635,781),10457=>array(146,-195,635,781),10458=>array(146,-195,635,781),10459=>array(146,-195,635,781),10460=>array(146,-195,635,781),10461=>array(146,-195,635,781),10462=>array(146,-195,635,781),10463=>array(146,-195,635,781),10464=>array(146,-195,635,261),10465=>array(146,-195,635,781),10466=>array(146,-195,635,521),10467=>array(146,-195,635,781),10468=>array(146,-195,635,261),10469=>array(146,-195,635,781),10470=>array(146,-195,635,521),10471=>array(146,-195,635,781),10472=>array(146,-195,635,781),10473=>array(146,-195,635,781),10474=>array(146,-195,635,781),10475=>array(146,-195,635,781),10476=>array(146,-195,635,781),10477=>array(146,-195,635,781),10478=>array(146,-195,635,781),10479=>array(146,-195,635,781),10480=>array(146,-195,635,521),10481=>array(146,-195,635,781),10482=>array(146,-195,635,521),10483=>array(146,-195,635,781),10484=>array(146,-195,635,521),10485=>array(146,-195,635,781),10486=>array(146,-195,635,521),10487=>array(146,-195,635,781),10488=>array(146,-195,635,781),10489=>array(146,-195,635,781),10490=>array(146,-195,635,781),10491=>array(146,-195,635,781),10492=>array(146,-195,635,781),10493=>array(146,-195,635,781),10494=>array(146,-195,635,781),10495=>array(146,-195,635,781),10502=>array(49,87,781,540),10503=>array(57,87,789,540),10506=>array(132,0,707,732),10507=>array(132,0,707,732),10560=>array(86,45,726,853),10561=>array(86,45,726,853),10627=>array(125,-163,628,760),10628=>array(125,-163,628,760),10702=>array(106,-258,732,800),10703=>array(106,-1,940,628),10704=>array(106,-1,940,628),10705=>array(106,-48,894,674),10706=>array(106,-48,894,674),10707=>array(106,-48,894,674),10708=>array(106,-48,894,675),10709=>array(106,-48,894,675),10731=>array(3,-233,491,807),10746=>array(106,0,732,627),10747=>array(106,0,732,627),10752=>array(28,-211,972,734),10753=>array(28,-211,972,734),10754=>array(28,-211,972,734),10764=>array(15,-227,1646,754),10765=>array(14,-227,548,754),10766=>array(14,-227,548,754),10767=>array(14,-227,548,754),10768=>array(14,-227,548,754),10769=>array(14,-227,576,754),10770=>array(14,-227,548,754),10771=>array(14,-227,548,754),10772=>array(14,-228,651,754),10773=>array(14,-227,548,754),10774=>array(14,-227,548,754),10775=>array(-30,-227,556,754),10776=>array(14,-227,548,754),10777=>array(14,-227,548,754),10778=>array(14,-227,548,754),10779=>array(15,-227,548,898),10780=>array(15,-372,548,754),10799=>array(125,20,713,607),10858=>array(106,212,732,660),10859=>array(106,-34,732,660),10877=>array(106,-150,732,632),10878=>array(106,-150,732,632),10879=>array(106,-150,732,632),10880=>array(106,-150,732,632),10881=>array(106,-150,732,688),10882=>array(106,-150,732,688),10883=>array(106,-150,732,827),10884=>array(106,-150,732,827),10885=>array(106,-217,732,630),10886=>array(106,-217,732,630),10887=>array(106,-124,732,582),10888=>array(106,-124,732,582),10889=>array(106,-281,732,630),10890=>array(106,-281,732,630),10891=>array(106,-303,732,814),10892=>array(106,-303,732,814),10893=>array(106,-183,732,653),10894=>array(106,-183,732,653),10895=>array(106,-245,732,765),10896=>array(106,-245,732,765),10897=>array(106,-278,732,782),10898=>array(106,-278,732,782),10899=>array(106,-263,732,771),10900=>array(106,-263,732,771),10901=>array(106,-50,732,733),10902=>array(106,-50,732,733),10903=>array(106,-50,732,733),10904=>array(106,-50,732,733),10905=>array(106,-45,732,678),10906=>array(106,-45,732,678),10907=>array(106,-81,732,724),10908=>array(106,-81,732,724),10909=>array(106,13,732,680),10910=>array(106,13,732,680),10911=>array(106,-239,732,746),10912=>array(106,-239,732,746),10926=>array(106,22,732,656),10927=>array(106,-83,732,684),10928=>array(106,-83,732,684),10929=>array(106,-246,732,684),10930=>array(106,-246,732,684),10931=>array(106,-205,732,672),10932=>array(106,-205,732,672),10933=>array(106,-304,732,672),10934=>array(106,-304,732,672),10935=>array(106,-252,732,713),10936=>array(106,-252,732,713),10937=>array(106,-316,732,713),10938=>array(106,-316,732,713),11001=>array(106,-195,732,609),11002=>array(106,-195,732,609),11008=>array(123,-23,744,598),11009=>array(94,-23,715,598),11010=>array(123,-23,744,598),11011=>array(94,-23,715,598),11012=>array(27,46,789,581),11013=>array(27,46,781,581),11014=>array(151,0,687,754),11015=>array(151,-25,687,729),11016=>array(123,-23,744,598),11017=>array(94,-23,715,598),11018=>array(123,-23,744,598),11019=>array(94,-23,715,598),11020=>array(27,46,789,581),11021=>array(151,-25,687,754),11022=>array(57,-25,800,372),11023=>array(57,255,800,652),11024=>array(38,-25,781,372),11025=>array(38,255,781,652),11026=>array(91,-124,854,643),11027=>array(91,-124,854,643),11028=>array(91,-124,854,643),11029=>array(91,-124,854,643),11030=>array(3,-124,766,643),11031=>array(3,-124,766,643),11032=>array(3,-124,766,643),11033=>array(3,-124,766,643),11034=>array(91,-124,854,643),11039=>array(18,-26,852,767),11040=>array(18,-26,852,767),11041=>array(73,-91,800,748),11042=>array(73,-91,800,748),11043=>array(17,-35,856,692),11044=>array(55,-250,1064,770),11091=>array(38,-47,832,788),11092=>array(38,-47,832,788),11360=>array(5,0,610,729),11361=>array(5,0,355,760),11362=>array(-17,0,610,729),11363=>array(6,0,692,729),11364=>array(92,-200,750,729),11365=>array(32,-46,639,594),11366=>array(13,-93,455,822),11367=>array(92,-157,932,729),11368=>array(84,-138,809,760),11369=>array(92,-157,805,729),11370=>array(84,-138,684,760),11371=>array(45,-157,768,729),11372=>array(45,-138,622,547),11373=>array(48,-14,769,741),11374=>array(92,-200,903,729),11375=>array(5,0,769,729),11376=>array(48,-14,769,741),11377=>array(15,0,778,560),11378=>array(30,0,1221,742),11379=>array(35,0,1056,560),11380=>array(38,0,637,586),11381=>array(92,0,606,729),11382=>array(84,0,481,547),11383=>array(64,0,725,552),11385=>array(84,-13,490,760),11386=>array(43,-14,644,560),11387=>array(78,0,467,547),11388=>array(-21,-121,166,425),11389=>array(3,326,484,734),11390=>array(72,-240,670,742),11391=>array(45,-240,680,729),11520=>array(45,-64,609,547),11521=>array(16,-232,625,546),11522=>array(41,-232,629,547),11523=>array(42,-10,585,807),11524=>array(40,-228,613,546),11525=>array(41,-228,988,546),11526=>array(20,-8,668,816),11527=>array(42,-9,974,547),11528=>array(39,0,589,547),11529=>array(41,-227,614,816),11530=>array(39,-9,985,546),11531=>array(42,-8,649,816),11532=>array(39,0,627,816),11533=>array(41,-8,988,546),11534=>array(41,-8,629,546),11535=>array(41,-228,846,816),11536=>array(42,-9,976,816),11537=>array(41,-9,630,816),11538=>array(46,-232,610,546),11539=>array(41,-228,984,661),11540=>array(45,-228,958,546),11541=>array(39,-228,978,816),11542=>array(44,0,628,546),11543=>array(41,-228,630,547),11544=>array(41,-232,627,546),11545=>array(44,-228,628,816),11546=>array(42,-232,610,547),11547=>array(43,-9,658,816),11548=>array(44,-228,989,547),11549=>array(44,-232,619,546),11550=>array(46,-232,639,546),11551=>array(44,-228,615,567),11552=>array(44,-9,1004,546),11553=>array(44,-228,619,816),11554=>array(42,-9,601,626),11555=>array(44,-228,622,816),11556=>array(42,-228,684,546),11557=>array(45,-8,959,816),11568=>array(55,-14,636,380),11569=>array(50,-14,892,742),11570=>array(50,-14,892,742),11571=>array(51,0,674,729),11572=>array(51,0,674,729),11573=>array(56,0,669,729),11574=>array(48,0,627,729),11575=>array(5,0,769,729),11576=>array(5,0,769,729),11577=>array(92,0,610,729),11578=>array(92,0,610,729),11579=>array(73,-14,729,742),11580=>array(73,0,916,729),11581=>array(92,0,754,729),11582=>array(92,0,549,729),11583=>array(92,0,754,729),11584=>array(50,-14,892,742),11585=>array(50,-84,892,815),11586=>array(92,0,281,729),11587=>array(21,0,720,729),11588=>array(92,0,745,729),11589=>array(-30,0,944,729),11590=>array(92,0,598,729),11591=>array(92,0,709,729),11592=>array(73,256,607,445),11593=>array(92,0,610,729),11594=>array(73,0,529,729),11595=>array(64,-14,892,742),11596=>array(82,0,695,729),11597=>array(92,0,745,729),11598=>array(92,0,610,729),11599=>array(92,0,280,729),11600=>array(82,0,695,729),11601=>array(92,0,281,729),11602=>array(42,-14,684,729),11603=>array(55,-14,636,742),11604=>array(50,-14,892,742),11605=>array(50,-95,892,742),11606=>array(92,0,745,729),11607=>array(92,0,281,729),11608=>array(92,0,744,729),11609=>array(50,-14,892,742),11610=>array(50,-14,892,823),11611=>array(50,-14,718,742),11612=>array(79,0,797,729),11613=>array(19,0,751,729),11614=>array(50,-14,718,742),11615=>array(92,0,610,729),11616=>array(5,0,769,729),11617=>array(92,0,745,729),11618=>array(92,0,599,729),11619=>array(50,0,800,729),11620=>array(92,0,654,729),11621=>array(50,0,800,729),11631=>array(64,490,651,729),11800=>array(69,-14,515,728),11807=>array(106,-34,732,415),11810=>array(86,403,389,760),11811=>array(68,403,371,760),11812=>array(86,-132,389,225),11813=>array(68,-132,371,225),11822=>array(69,0,515,742),19904=>array(83,-158,813,729),19905=>array(83,-158,813,729),19906=>array(83,-158,813,729),19907=>array(83,-158,813,729),19908=>array(83,-158,813,729),19909=>array(83,-158,813,729),19910=>array(83,-158,813,729),19911=>array(83,-158,813,729),19912=>array(83,-158,813,729),19913=>array(83,-158,814,729),19914=>array(83,-158,813,729),19915=>array(83,-158,813,729),19916=>array(83,-158,813,729),19917=>array(83,-158,813,729),19918=>array(83,-158,813,729),19919=>array(83,-158,813,729),19920=>array(83,-158,814,729),19921=>array(83,-158,813,729),19922=>array(83,-158,814,729),19923=>array(83,-158,813,729),19924=>array(83,-158,813,729),19925=>array(83,-158,813,729),19926=>array(83,-158,813,729),19927=>array(83,-158,813,729),19928=>array(83,-158,813,729),19929=>array(83,-158,813,729),19930=>array(83,-158,813,729),19931=>array(83,-158,814,729),19932=>array(83,-158,813,729),19933=>array(83,-158,813,729),19934=>array(83,-158,814,729),19935=>array(83,-158,813,729),19936=>array(83,-158,813,729),19937=>array(83,-158,813,729),19938=>array(83,-158,813,729),19939=>array(83,-158,813,729),19940=>array(83,-158,813,729),19941=>array(83,-158,814,729),19942=>array(83,-158,813,729),19943=>array(83,-158,813,729),19944=>array(83,-158,814,729),19945=>array(83,-158,813,729),19946=>array(83,-158,814,729),19947=>array(83,-158,813,729),19948=>array(83,-158,814,729),19949=>array(83,-158,813,729),19950=>array(83,-158,814,729),19951=>array(83,-158,813,729),19952=>array(83,-158,814,729),19953=>array(83,-158,813,729),19954=>array(83,-158,813,729),19955=>array(83,-158,813,729),19956=>array(83,-158,813,729),19957=>array(83,-158,814,729),19958=>array(83,-158,813,729),19959=>array(83,-158,813,729),19960=>array(83,-158,813,729),19961=>array(83,-158,814,729),19962=>array(83,-158,813,729),19963=>array(83,-158,814,729),19964=>array(83,-158,814,729),19965=>array(83,-158,813,729),19966=>array(83,-158,813,729),19967=>array(83,-158,813,729),42192=>array(92,0,692,729),42193=>array(92,0,692,729),42194=>array(41,0,641,729),42195=>array(92,0,778,729),42196=>array(5,0,677,729),42197=>array(5,0,677,729),42198=>array(50,-14,747,742),42199=>array(92,0,805,729),42200=>array(-30,0,683,729),42201=>array(0,-14,439,729),42202=>array(50,-14,670,742),42203=>array(50,-14,670,742),42204=>array(45,0,680,729),42205=>array(92,0,599,729),42206=>array(92,0,599,729),42207=>array(92,0,903,729),42208=>array(92,0,745,729),42209=>array(92,0,610,729),42210=>array(72,-14,647,742),42211=>array(92,0,750,729),42212=>array(20,0,678,729),42213=>array(5,0,769,729),42214=>array(5,0,769,729),42215=>array(92,0,745,729),42216=>array(25,-14,723,742),42217=>array(91,0,530,743),42218=>array(30,0,1072,729),42219=>array(19,0,751,729),42220=>array(-10,0,734,729),42221=>array(70,0,670,729),42222=>array(5,0,769,729),42223=>array(5,0,769,729),42224=>array(92,0,610,729),42225=>array(73,0,591,729),42226=>array(92,0,280,729),42227=>array(50,-14,800,742),42228=>array(92,-14,720,729),42229=>array(92,0,720,743),42230=>array(9,0,527,729),42231=>array(52,0,738,729),42232=>array(73,0,249,189),42233=>array(24,-142,249,189),42234=>array(73,0,601,189),42235=>array(73,-142,601,189),42236=>array(24,-142,249,547),42237=>array(73,0,249,547),42238=>array(73,0,515,405),42239=>array(73,134,515,492),42564=>array(26,-14,601,742),42565=>array(15,-14,511,560),42566=>array(92,0,428,729),42567=>array(83,0,356,547),42572=>array(57,-14,1348,654),42573=>array(47,-13,1126,547),42576=>array(49,0,1142,729),42577=>array(20,0,946,547),42580=>array(55,-14,1082,742),42581=>array(44,-14,888,560),42582=>array(92,0,1088,729),42583=>array(84,-14,880,560),42594=>array(60,-157,1058,729),42595=>array(56,-138,900,547),42596=>array(46,0,1069,729),42597=>array(55,0,888,547),42598=>array(92,0,1233,729),42599=>array(84,0,973,547),42600=>array(50,-14,800,742),42601=>array(43,-14,644,560),42602=>array(50,-14,987,742),42603=>array(43,-14,825,560),42604=>array(50,-14,1356,742),42605=>array(43,-14,1063,560),42606=>array(28,-208,933,743),42634=>array(5,-200,883,729),42635=>array(4,-216,709,547),42636=>array(5,0,677,729),42637=>array(4,0,575,547),42644=>array(81,0,716,729),42645=>array(84,0,634,760),42760=>array(96,0,404,693),42761=>array(96,0,404,693),42762=>array(96,0,404,693),42763=>array(96,0,404,693),42764=>array(96,0,404,693),42765=>array(96,0,404,693),42766=>array(96,0,404,693),42767=>array(96,0,404,693),42768=>array(96,0,404,693),42769=>array(96,0,404,693),42770=>array(96,0,404,693),42771=>array(96,0,404,693),42772=>array(96,0,404,693),42773=>array(96,0,404,693),42774=>array(96,0,404,693),42779=>array(58,326,342,736),42780=>array(58,324,342,734),42781=>array(88,326,199,734),42782=>array(88,326,199,734),42783=>array(88,0,199,408),42786=>array(67,0,409,729),42787=>array(67,0,355,547),42788=>array(56,224,479,742),42789=>array(56,42,479,560),42790=>array(92,-200,745,729),42791=>array(84,-216,634,760),42792=>array(5,-216,986,729),42793=>array(13,-215,810,702),42794=>array(67,-14,616,742),42795=>array(54,-202,493,560),42800=>array(92,0,473,547),42801=>array(52,-14,548,560),42802=>array(5,0,1344,729),42803=>array(43,-14,973,560),42804=>array(5,-14,1234,742),42805=>array(43,-14,1021,560),42806=>array(5,-14,1124,729),42807=>array(43,-14,970,560),42808=>array(5,0,1074,729),42809=>array(43,-14,907,560),42810=>array(5,0,1074,729),42811=>array(43,-14,907,560),42812=>array(5,-216,1030,729),42813=>array(43,-216,907,560),42814=>array(33,-14,653,742),42815=>array(43,-14,526,560),42816=>array(5,0,812,729),42817=>array(6,0,708,760),42822=>array(92,0,822,729),42823=>array(84,0,458,760),42824=>array(41,0,655,729),42825=>array(59,0,473,760),42826=>array(16,-14,902,742),42827=>array(5,-14,809,560),42830=>array(50,-14,1356,742),42831=>array(43,-14,1063,560),42832=>array(16,0,692,729),42833=>array(5,-208,671,560),42834=>array(34,0,907,729),42835=>array(34,-208,892,560),42838=>array(50,-188,800,742),42839=>array(45,-208,711,559),42852=>array(16,0,692,729),42853=>array(5,-208,671,760),42854=>array(16,0,692,729),42855=>array(5,-208,671,760),42880=>array(27,0,545,729),42881=>array(84,-208,259,547),42882=>array(84,-208,730,742),42883=>array(84,-208,634,560),42889=>array(112,0,288,547),42890=>array(83,141,303,405),42891=>array(140,245,316,729),42892=>array(95,458,211,729),42893=>array(81,0,716,729),42894=>array(84,-216,680,760),42896=>array(92,-157,868,729),42897=>array(84,-138,725,560),42912=>array(-11,-14,832,742),42913=>array(-11,-216,727,559),42914=>array(-11,0,805,729),42915=>array(-11,0,684,760),42916=>array(-11,0,848,729),42917=>array(-11,0,723,560),42918=>array(-11,0,781,729),42919=>array(-11,0,504,560),42920=>array(-11,-14,731,742),42921=>array(-11,-14,606,560),42922=>array(-68,0,794,729),43002=>array(84,0,972,547),43003=>array(84,0,591,729),43004=>array(41,0,641,729),43005=>array(92,0,903,729),43006=>array(92,0,280,928),43007=>array(31,0,1294,729),61184=>array(91,602,317,693),61185=>array(48,451,338,693),61186=>array(26,301,363,693),61187=>array(17,150,373,693),61188=>array(13,0,378,693),61189=>array(48,451,338,693),61190=>array(91,451,317,543),61191=>array(48,301,338,543),61192=>array(26,150,363,543),61193=>array(17,0,373,543),61194=>array(26,301,363,693),61195=>array(48,301,338,543),61196=>array(91,301,317,393),61197=>array(48,150,338,393),61198=>array(26,0,363,393),61199=>array(17,150,373,693),61200=>array(26,149,363,542),61201=>array(48,150,338,393),61202=>array(91,150,317,242),61203=>array(48,0,338,242),61204=>array(13,0,378,693),61205=>array(17,0,373,543),61206=>array(26,0,363,393),61207=>array(48,0,338,242),61208=>array(91,0,317,92),61209=>array(96,0,188,693),62464=>array(49,-14,563,819),62465=>array(49,-15,563,823),62466=>array(49,-14,604,828),62467=>array(49,0,853,828),62468=>array(49,-15,563,828),62469=>array(49,-15,563,828),62470=>array(29,-15,612,828),62471=>array(49,-14,846,828),62472=>array(49,0,541,828),62473=>array(49,-14,563,820),62474=>array(49,-6,1114,828),62475=>array(49,-14,563,828),62476=>array(63,-15,578,820),62477=>array(54,0,839,828),62478=>array(49,-15,563,819),62479=>array(49,-15,563,840),62480=>array(49,0,875,828),62481=>array(63,-14,578,819),62482=>array(44,-14,699,828),62483=>array(34,-14,570,828),62484=>array(49,-14,837,828),62485=>array(49,-14,563,819),62486=>array(49,0,858,828),62487=>array(49,-14,563,820),62488=>array(44,-14,558,828),62489=>array(64,0,579,828),62490=>array(50,-15,628,820),62491=>array(49,-14,563,819),62492=>array(63,-14,577,828),62493=>array(49,-14,581,820),62494=>array(63,-14,578,819),62495=>array(24,-14,546,828),62496=>array(49,-15,563,828),62497=>array(63,-15,577,828),62498=>array(49,-73,563,828),62499=>array(49,-15,563,830),62500=>array(49,-15,569,828),62501=>array(49,-14,627,828),62502=>array(49,-14,914,828),62504=>array(45,-228,960,816),62505=>array(54,-223,791,843),62506=>array(54,-14,510,761),62507=>array(54,-14,510,773),62508=>array(54,-14,510,866),62509=>array(54,-14,510,812),62510=>array(54,-14,510,877),62511=>array(54,-14,510,803),62512=>array(54,-232,501,761),62513=>array(54,-232,501,793),62514=>array(54,-232,501,891),62515=>array(54,-232,501,803),62516=>array(54,0,520,761),62517=>array(54,0,520,793),62518=>array(54,0,520,803),62519=>array(54,-0,770,761),62520=>array(54,-0,770,773),62521=>array(54,-0,770,884),62522=>array(54,-0,770,793),62523=>array(54,-0,770,803),62524=>array(54,-232,557,761),62525=>array(54,-232,557,773),62526=>array(54,-232,557,894),62527=>array(54,-232,557,793),62528=>array(54,-232,557,803),62529=>array(54,-232,557,844),63173=>array(43,-14,644,760),64256=>array(19,0,819,760),64257=>array(21,0,657,760),64258=>array(19,0,657,760),64259=>array(19,0,1031,760),64260=>array(19,0,1032,760),64261=>array(19,0,785,760),64262=>array(52,-14,997,742),64275=>array(74,-14,1300,760),64276=>array(78,-14,1301,760),64277=>array(78,-208,1300,760),64278=>array(78,-208,1300,760),64279=>array(78,-208,1629,760),64285=>array(66,32,228,547),64286=>array(182,635,510,780),64287=>array(66,32,500,547),64288=>array(38,0,590,547),64289=>array(85,0,855,547),64290=>array(43,0,731,547),64291=>array(91,0,778,547),64292=>array(43,0,730,547),64293=>array(43,0,730,739),64294=>array(91,0,778,547),64295=>array(43,0,730,547),64296=>array(47,-4,730,547),64297=>array(106,256,732,627),64298=>array(20,0,750,710),64299=>array(20,0,750,723),64300=>array(20,0,750,710),64301=>array(20,0,750,710),64302=>array(84,-171,644,547),64303=>array(84,-217,644,547),64304=>array(84,-171,644,547),64305=>array(43,0,567,547),64306=>array(43,-9,418,547),64307=>array(43,0,545,547),64308=>array(91,0,596,547),64309=>array(43,0,346,547),64310=>array(43,0,442,547),64312=>array(90,-13,624,553),64313=>array(43,164,369,547),64314=>array(43,-240,487,547),64315=>array(43,0,511,547),64316=>array(43,0,527,711),64318=>array(43,0,633,554),64320=>array(43,0,362,547),64321=>array(90,-13,624,547),64323=>array(91,-240,584,547),64324=>array(91,0,603,547),64326=>array(33,0,564,547),64327=>array(91,-240,660,546),64328=>array(43,0,511,547),64329=>array(20,0,750,547),64330=>array(10,-4,592,547),64331=>array(91,0,252,710),64332=>array(43,0,567,710),64333=>array(43,0,511,710),64334=>array(91,0,603,710),64335=>array(43,0,652,729),64338=>array(63,-244,921,327),64339=>array(63,-244,1068,327),64340=>array(-10,-244,292,293),64341=>array(-10,-244,418,293),64342=>array(63,-244,921,327),64343=>array(63,-244,1068,327),64344=>array(-10,-244,302,293),64345=>array(-10,-244,418,293),64346=>array(63,-244,921,327),64347=>array(63,-244,1068,327),64348=>array(-10,-244,302,293),64349=>array(-10,-244,418,293),64350=>array(63,-5,921,566),64351=>array(63,-5,1068,566),64352=>array(-10,0,292,640),64353=>array(-10,0,418,640),64354=>array(63,-5,921,566),64355=>array(63,-5,1068,566),64356=>array(-10,0,302,640),64357=>array(-10,0,418,640),64358=>array(63,-5,921,599),64359=>array(63,-5,1068,599),64360=>array(-10,0,333,672),64361=>array(-10,0,418,672),64362=>array(63,-24,1082,786),64363=>array(63,-29,1201,786),64364=>array(-10,0,575,786),64365=>array(-10,0,729,786),64366=>array(63,-24,1082,786),64367=>array(63,-29,1201,786),64368=>array(-10,0,575,786),64369=>array(-10,0,729,786),64370=>array(77,-244,720,425),64371=>array(77,-244,730,425),64372=>array(-10,-244,628,405),64373=>array(-10,-244,730,405),64374=>array(77,-244,720,425),64375=>array(77,-244,730,425),64376=>array(-10,-117,628,405),64377=>array(-10,-117,730,405),64378=>array(77,-244,720,425),64379=>array(77,-244,730,425),64380=>array(-10,-244,628,405),64381=>array(-10,-244,730,405),64382=>array(77,-244,720,425),64383=>array(77,-244,730,425),64384=>array(-10,-244,628,405),64385=>array(-10,-244,730,405),64386=>array(61,-146,442,415),64387=>array(61,-146,587,415),64388=>array(61,-15,442,586),64389=>array(61,-15,587,586),64390=>array(61,-15,442,708),64391=>array(61,-15,587,708),64392=>array(61,-15,442,746),64393=>array(61,-15,587,746),64394=>array(-42,-244,508,615),64395=>array(-42,-244,632,615),64396=>array(-42,-244,520,648),64397=>array(-42,-244,632,648),64398=>array(63,-39,1024,760),64399=>array(63,-39,1034,760),64400=>array(-10,0,582,760),64401=>array(-10,0,591,760),64402=>array(63,-39,1024,910),64403=>array(63,-39,1034,910),64404=>array(-10,0,582,910),64405=>array(-10,0,591,910),64406=>array(63,-293,1024,910),64407=>array(63,-293,1034,910),64408=>array(-10,-269,582,910),64409=>array(-10,-269,591,910),64410=>array(63,-39,1024,910),64411=>array(63,-39,1034,910),64412=>array(-10,0,582,910),64413=>array(-10,0,591,910),64414=>array(62,-165,779,366),64415=>array(62,-244,910,287),64416=>array(62,-165,779,636),64417=>array(62,-244,910,514),64418=>array(-10,0,333,672),64419=>array(-10,0,418,672),64426=>array(70,-33,877,506),64427=>array(70,-244,890,369),64428=>array(-10,-33,633,506),64429=>array(-10,-244,670,369),64467=>array(70,-27,814,854),64468=>array(70,-27,941,854),64469=>array(-10,0,582,928),64470=>array(-10,0,591,928),64473=>array(-42,-244,547,556),64474=>array(-42,-244,637,556),64488=>array(-10,0,292,293),64489=>array(-10,0,418,293),64508=>array(63,-107,863,462),64509=>array(63,-126,1021,291),64510=>array(-10,-166,302,293),64511=>array(-10,-166,418,293),65056=>array(-419,735,0,880),65057=>array(0,735,419,880),65058=>array(-362,756,0,894),65059=>array(0,756,362,894),65136=>array(28,591,313,825),65137=>array(-10,0,352,825),65138=>array(28,591,313,881),65139=>array(51,0,356,177),65140=>array(28,-239,313,-5),65142=>array(28,591,313,723),65143=>array(-10,0,352,723),65144=>array(28,590,313,881),65145=>array(-10,0,352,881),65146=>array(28,-137,313,-5),65147=>array(-10,-137,352,125),65148=>array(9,599,333,869),65149=>array(-10,0,352,869),65150=>array(36,610,304,878),65151=>array(-10,0,352,878),65152=>array(73,20,437,493),65153=>array(-20,0,362,955),65154=>array(-20,0,385,955),65155=>array(75,0,259,993),65156=>array(75,0,385,993),65157=>array(-42,-244,547,603),65158=>array(-42,-244,637,603),65159=>array(76,-245,259,760),65160=>array(76,-245,385,760),65161=>array(63,-107,863,603),65162=>array(63,-126,1021,480),65163=>array(-10,0,292,627),65164=>array(-10,0,418,627),65165=>array(84,0,259,760),65166=>array(84,0,385,760),65167=>array(63,-149,921,327),65168=>array(63,-149,1068,327),65169=>array(-10,-173,292,293),65170=>array(-10,-173,418,293),65171=>array(48,-30,540,513),65172=>array(65,0,616,513),65173=>array(63,-5,921,415),65174=>array(63,-5,1068,415),65175=>array(-10,0,302,488),65176=>array(-10,0,418,488),65177=>array(63,-5,921,537),65178=>array(63,-5,1068,537),65179=>array(-10,0,302,610),65180=>array(-10,0,418,610),65181=>array(77,-244,720,425),65182=>array(77,-244,730,425),65183=>array(-10,-173,628,405),65184=>array(-10,-173,730,405),65185=>array(77,-244,720,425),65186=>array(77,-244,730,425),65187=>array(-10,0,628,405),65188=>array(-10,0,730,405),65189=>array(77,-244,720,579),65190=>array(77,-244,730,579),65191=>array(-10,0,628,530),65192=>array(-10,0,730,530),65193=>array(61,-15,442,415),65194=>array(61,-15,587,415),65195=>array(61,-15,442,579),65196=>array(61,-15,587,579),65197=>array(-42,-244,508,269),65198=>array(-42,-244,632,269),65199=>array(-42,-244,508,457),65200=>array(-42,-244,632,457),65201=>array(63,-244,1297,366),65202=>array(63,-244,1423,366),65203=>array(-10,-14,901,366),65204=>array(-10,-14,1027,366),65205=>array(63,-244,1297,586),65206=>array(63,-244,1423,586),65207=>array(-10,-14,901,586),65208=>array(-10,-14,1027,586),65209=>array(63,-244,1265,362),65210=>array(63,-244,1374,362),65211=>array(-10,0,886,362),65212=>array(-10,0,995,362),65213=>array(63,-244,1265,457),65214=>array(63,-244,1374,457),65215=>array(-10,0,886,481),65216=>array(-10,0,995,481),65217=>array(70,0,971,760),65218=>array(70,0,1081,760),65219=>array(-10,0,875,760),65220=>array(-10,0,984,760),65221=>array(70,0,971,760),65222=>array(70,0,1081,760),65223=>array(-10,0,875,760),65224=>array(-10,0,984,760),65225=>array(87,-244,720,521),65226=>array(57,-244,693,382),65227=>array(-10,0,583,521),65228=>array(-10,0,574,382),65229=>array(87,-244,720,652),65230=>array(57,-244,693,530),65231=>array(-10,0,583,652),65232=>array(-10,0,574,530),65233=>array(63,-24,1082,627),65234=>array(63,-29,1201,627),65235=>array(-10,0,575,627),65236=>array(-10,0,729,627),65237=>array(52,-215,825,635),65238=>array(52,-244,911,476),65239=>array(-10,0,575,635),65240=>array(-10,0,729,635),65241=>array(70,-27,814,760),65242=>array(70,-27,941,760),65243=>array(-10,0,582,760),65244=>array(-10,0,591,760),65245=>array(70,-142,778,760),65246=>array(70,-142,902,760),65247=>array(-10,0,292,760),65248=>array(-10,0,418,760),65249=>array(68,-244,660,369),65250=>array(68,-244,794,311),65251=>array(-10,-23,546,311),65252=>array(-10,-23,680,311),65253=>array(62,-165,779,457),65254=>array(62,-244,910,383),65255=>array(-10,0,292,481),65256=>array(-10,0,418,481),65257=>array(48,-30,540,358),65258=>array(65,0,616,366),65259=>array(-10,-33,633,506),65260=>array(-10,-244,670,369),65261=>array(-42,-244,547,322),65262=>array(-42,-244,637,322),65263=>array(63,-107,863,462),65264=>array(63,-126,1021,291),65265=>array(63,-244,863,462),65266=>array(63,-244,1021,291),65267=>array(-10,-166,302,293),65268=>array(-10,-166,418,293),65269=>array(-62,-15,643,882),65270=>array(-62,-15,769,882),65271=>array(33,-15,643,944),65272=>array(33,-15,769,944),65273=>array(41,-245,643,760),65274=>array(41,-245,769,760),65275=>array(41,-15,643,760),65276=>array(41,-15,769,760),65533=>array(24,-139,1089,926),65535=>array(50,-177,550,705)); -$cw=array(0=>600,32=>348,33=>456,34=>521,35=>838,36=>696,37=>1002,38=>872,39=>306,40=>457,41=>457,42=>523,43=>838,44=>380,45=>415,46=>380,47=>365,48=>696,49=>696,50=>696,51=>696,52=>696,53=>696,54=>696,55=>696,56=>696,57=>696,58=>400,59=>400,60=>838,61=>838,62=>838,63=>580,64=>1000,65=>774,66=>762,67=>734,68=>830,69=>683,70=>683,71=>821,72=>837,73=>372,74=>372,75=>775,76=>637,77=>995,78=>837,79=>850,80=>733,81=>850,82=>770,83=>720,84=>682,85=>812,86=>774,87=>1103,88=>771,89=>724,90=>725,91=>457,92=>365,93=>457,94=>838,95=>500,96=>500,97=>675,98=>716,99=>593,100=>716,101=>678,102=>435,103=>716,104=>712,105=>343,106=>343,107=>665,108=>343,109=>1042,110=>712,111=>687,112=>716,113=>716,114=>493,115=>595,116=>478,117=>712,118=>652,119=>924,120=>645,121=>652,122=>582,123=>712,124=>365,125=>712,126=>838,160=>348,161=>456,162=>696,163=>696,164=>636,165=>696,166=>365,167=>500,168=>500,169=>1000,170=>564,171=>646,172=>838,173=>415,174=>1000,175=>500,176=>500,177=>838,178=>438,179=>438,180=>500,181=>736,182=>636,183=>380,184=>500,185=>438,186=>564,187=>646,188=>1035,189=>1035,190=>1035,191=>580,192=>774,193=>774,194=>774,195=>774,196=>774,197=>774,198=>1085,199=>734,200=>683,201=>683,202=>683,203=>683,204=>372,205=>372,206=>372,207=>372,208=>838,209=>837,210=>850,211=>850,212=>850,213=>850,214=>850,215=>838,216=>850,217=>812,218=>812,219=>812,220=>812,221=>724,222=>738,223=>719,224=>675,225=>675,226=>675,227=>675,228=>675,229=>675,230=>1048,231=>593,232=>678,233=>678,234=>678,235=>678,236=>343,237=>343,238=>343,239=>343,240=>687,241=>712,242=>687,243=>687,244=>687,245=>687,246=>687,247=>838,248=>687,249=>712,250=>712,251=>712,252=>712,253=>652,254=>716,255=>652,256=>774,257=>675,258=>774,259=>675,260=>774,261=>675,262=>734,263=>593,264=>734,265=>593,266=>734,267=>593,268=>734,269=>593,270=>830,271=>716,272=>838,273=>716,274=>683,275=>678,276=>683,277=>678,278=>683,279=>678,280=>683,281=>678,282=>683,283=>678,284=>821,285=>716,286=>821,287=>716,288=>821,289=>716,290=>821,291=>716,292=>837,293=>712,294=>974,295=>790,296=>372,297=>343,298=>372,299=>343,300=>372,301=>343,302=>372,303=>343,304=>372,305=>343,306=>744,307=>686,308=>372,309=>343,310=>775,311=>665,312=>665,313=>637,314=>343,315=>637,316=>343,317=>637,318=>479,319=>637,320=>557,321=>642,322=>371,323=>837,324=>712,325=>837,326=>712,327=>837,328=>712,329=>983,330=>837,331=>712,332=>850,333=>687,334=>850,335=>687,336=>850,337=>687,338=>1167,339=>1094,340=>770,341=>493,342=>770,343=>493,344=>770,345=>493,346=>720,347=>595,348=>720,349=>595,350=>720,351=>595,352=>720,353=>595,354=>682,355=>478,356=>682,357=>478,358=>682,359=>478,360=>812,361=>712,362=>812,363=>712,364=>812,365=>712,366=>812,367=>712,368=>812,369=>712,370=>812,371=>712,372=>1103,373=>924,374=>724,375=>652,376=>724,377=>725,378=>582,379=>725,380=>582,381=>725,382=>582,383=>435,384=>716,385=>811,386=>762,387=>716,388=>762,389=>716,390=>734,391=>734,392=>593,393=>838,394=>879,395=>757,396=>716,397=>688,398=>683,399=>849,400=>696,401=>683,402=>435,403=>821,404=>793,405=>1045,406=>436,407=>389,408=>775,409=>665,410=>360,411=>592,412=>1042,413=>837,414=>712,415=>850,416=>874,417=>687,418=>1083,419=>912,420=>782,421=>716,422=>770,423=>720,424=>595,425=>683,426=>552,427=>478,428=>707,429=>478,430=>682,431=>835,432=>712,433=>850,434=>813,435=>797,436=>778,437=>725,438=>582,439=>772,440=>772,441=>641,442=>582,443=>696,444=>772,445=>641,446=>573,447=>716,448=>372,449=>659,450=>544,451=>372,452=>1555,453=>1412,454=>1298,455=>1009,456=>980,457=>686,458=>1209,459=>1180,460=>1055,461=>774,462=>675,463=>372,464=>343,465=>850,466=>687,467=>812,468=>712,469=>812,470=>712,471=>812,472=>712,473=>812,474=>712,475=>812,476=>712,477=>678,478=>774,479=>675,480=>774,481=>675,482=>1085,483=>1048,484=>821,485=>716,486=>821,487=>716,488=>775,489=>665,490=>850,491=>687,492=>850,493=>687,494=>772,495=>582,496=>343,497=>1555,498=>1412,499=>1298,500=>821,501=>716,502=>1289,503=>787,504=>837,505=>712,506=>774,507=>675,508=>1085,509=>1048,510=>850,511=>687,512=>774,513=>675,514=>774,515=>675,516=>683,517=>678,518=>683,519=>678,520=>372,521=>343,522=>372,523=>343,524=>850,525=>687,526=>850,527=>687,528=>770,529=>493,530=>770,531=>493,532=>812,533=>712,534=>812,535=>712,536=>720,537=>595,538=>682,539=>478,540=>690,541=>607,542=>837,543=>712,544=>837,545=>865,546=>809,547=>659,548=>725,549=>582,550=>774,551=>675,552=>683,553=>678,554=>850,555=>687,556=>850,557=>687,558=>850,559=>687,560=>850,561=>687,562=>724,563=>652,564=>492,565=>867,566=>512,567=>343,568=>1088,569=>1088,570=>774,571=>734,572=>593,573=>637,574=>682,575=>595,576=>582,577=>782,578=>614,579=>762,580=>812,581=>774,582=>683,583=>678,584=>372,585=>343,586=>860,587=>791,588=>770,589=>493,590=>724,591=>652,592=>675,593=>716,594=>716,595=>716,596=>593,597=>593,598=>717,599=>792,600=>678,601=>678,602=>876,603=>557,604=>545,605=>815,606=>731,607=>343,608=>792,609=>716,610=>627,611=>644,612=>635,613=>712,614=>712,615=>712,616=>545,617=>440,618=>545,619=>559,620=>693,621=>343,622=>841,623=>1042,624=>1042,625=>1042,626=>712,627=>793,628=>707,629=>687,630=>909,631=>681,632=>796,633=>538,634=>538,635=>650,636=>493,637=>493,638=>596,639=>596,640=>642,641=>642,642=>595,643=>415,644=>435,645=>605,646=>552,647=>478,648=>478,649=>920,650=>772,651=>670,652=>652,653=>924,654=>652,655=>724,656=>694,657=>684,658=>641,659=>641,660=>573,661=>573,662=>573,663=>573,664=>850,665=>633,666=>731,667=>685,668=>691,669=>343,670=>732,671=>539,672=>792,673=>573,674=>573,675=>1156,676=>1214,677=>1155,678=>975,679=>769,680=>929,681=>1026,682=>862,683=>780,684=>591,685=>415,686=>677,687=>789,688=>456,689=>456,690=>219,691=>315,692=>315,693=>315,694=>411,695=>591,696=>417,697=>302,698=>521,699=>380,700=>380,701=>380,702=>366,703=>366,704=>326,705=>326,706=>500,707=>500,708=>500,709=>500,710=>500,711=>500,712=>306,713=>500,714=>500,715=>500,716=>306,717=>500,718=>500,719=>500,720=>337,721=>337,722=>366,723=>366,724=>500,725=>500,726=>416,727=>328,728=>500,729=>500,730=>500,731=>500,732=>500,733=>500,734=>351,735=>500,736=>412,737=>219,738=>381,739=>413,740=>326,741=>500,742=>500,743=>500,744=>500,745=>500,748=>500,749=>500,750=>657,755=>500,759=>500,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0,844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0,860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>698,881=>565,882=>1022,883=>836,884=>302,885=>302,886=>837,887=>701,890=>500,891=>593,892=>550,893=>549,894=>400,900=>441,901=>500,902=>797,903=>380,904=>846,905=>1009,906=>563,908=>891,910=>980,911=>894,912=>390,913=>774,914=>762,915=>637,916=>774,917=>683,918=>725,919=>837,920=>850,921=>372,922=>775,923=>774,924=>995,925=>837,926=>632,927=>850,928=>837,929=>733,931=>683,932=>682,933=>724,934=>850,935=>771,936=>850,937=>850,938=>372,939=>724,940=>687,941=>557,942=>712,943=>390,944=>675,945=>687,946=>716,947=>681,948=>687,949=>557,950=>591,951=>712,952=>687,953=>390,954=>710,955=>633,956=>736,957=>681,958=>591,959=>687,960=>791,961=>716,962=>593,963=>779,964=>638,965=>675,966=>782,967=>645,968=>794,969=>869,970=>390,971=>675,972=>687,973=>675,974=>869,975=>775,976=>651,977=>661,978=>746,979=>981,980=>746,981=>796,982=>869,983=>744,984=>850,985=>687,986=>734,987=>593,988=>683,989=>494,990=>702,991=>660,992=>919,993=>627,994=>1093,995=>837,996=>832,997=>716,998=>928,999=>744,1000=>733,1001=>650,1002=>789,1003=>671,1004=>752,1005=>716,1006=>682,1007=>590,1008=>744,1009=>716,1010=>593,1011=>343,1012=>850,1013=>645,1014=>644,1015=>738,1016=>716,1017=>734,1018=>995,1019=>732,1020=>716,1021=>698,1022=>734,1023=>698,1024=>683,1025=>683,1026=>878,1027=>637,1028=>734,1029=>720,1030=>372,1031=>372,1032=>372,1033=>1154,1034=>1130,1035=>878,1036=>817,1037=>837,1038=>771,1039=>837,1040=>774,1041=>762,1042=>762,1043=>637,1044=>891,1045=>683,1046=>1224,1047=>710,1048=>837,1049=>837,1050=>817,1051=>831,1052=>995,1053=>837,1054=>850,1055=>837,1056=>733,1057=>734,1058=>682,1059=>771,1060=>992,1061=>771,1062=>928,1063=>808,1064=>1235,1065=>1326,1066=>939,1067=>1036,1068=>762,1069=>734,1070=>1174,1071=>770,1072=>675,1073=>698,1074=>633,1075=>522,1076=>808,1077=>678,1078=>995,1079=>581,1080=>701,1081=>701,1082=>679,1083=>732,1084=>817,1085=>691,1086=>687,1087=>691,1088=>716,1089=>593,1090=>580,1091=>652,1092=>992,1093=>645,1094=>741,1095=>687,1096=>1062,1097=>1105,1098=>751,1099=>904,1100=>632,1101=>593,1102=>972,1103=>642,1104=>678,1105=>678,1106=>714,1107=>522,1108=>593,1109=>595,1110=>343,1111=>343,1112=>343,1113=>991,1114=>956,1115=>734,1116=>679,1117=>701,1118=>652,1119=>691,1120=>1093,1121=>869,1122=>840,1123=>736,1124=>1012,1125=>839,1126=>992,1127=>832,1128=>1358,1129=>1121,1130=>850,1131=>687,1132=>1236,1133=>1007,1134=>696,1135=>557,1136=>1075,1137=>1061,1138=>850,1139=>687,1140=>850,1141=>695,1142=>850,1143=>695,1144=>1148,1145=>1043,1146=>1074,1147=>863,1148=>1405,1149=>1173,1150=>1093,1151=>869,1152=>734,1153=>593,1154=>652,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>418,1161=>418,1162=>957,1163=>807,1164=>762,1165=>611,1166=>733,1167=>716,1168=>637,1169=>522,1170=>666,1171=>543,1172=>808,1173=>669,1174=>1224,1175=>995,1176=>710,1177=>581,1178=>775,1179=>679,1180=>817,1181=>679,1182=>817,1183=>679,1184=>1015,1185=>826,1186=>956,1187=>808,1188=>1103,1189=>874,1190=>1273,1191=>1017,1192=>952,1193=>858,1194=>734,1195=>593,1196=>682,1197=>580,1198=>724,1199=>652,1200=>724,1201=>652,1202=>771,1203=>645,1204=>1112,1205=>1000,1206=>808,1207=>687,1208=>808,1209=>687,1210=>808,1211=>712,1212=>1026,1213=>810,1214=>1026,1215=>810,1216=>372,1217=>1224,1218=>995,1219=>775,1220=>630,1221=>951,1222=>805,1223=>837,1224=>691,1225=>957,1226=>807,1227=>808,1228=>687,1229=>1115,1230=>933,1231=>343,1232=>774,1233=>675,1234=>774,1235=>675,1236=>1085,1237=>1048,1238=>683,1239=>678,1240=>849,1241=>678,1242=>849,1243=>678,1244=>1224,1245=>995,1246=>710,1247=>581,1248=>772,1249=>641,1250=>837,1251=>701,1252=>837,1253=>701,1254=>850,1255=>687,1256=>850,1257=>687,1258=>850,1259=>687,1260=>734,1261=>593,1262=>771,1263=>652,1264=>771,1265=>652,1266=>771,1267=>652,1268=>808,1269=>687,1270=>637,1271=>522,1272=>1036,1273=>904,1274=>666,1275=>543,1276=>771,1277=>645,1278=>771,1279=>645,1280=>762,1281=>608,1282=>1159,1283=>893,1284=>1119,1285=>920,1286=>828,1287=>693,1288=>1242,1289=>1017,1290=>1289,1291=>1013,1292=>839,1293=>638,1294=>938,1295=>803,1296=>696,1297=>557,1298=>831,1299=>732,1300=>1286,1301=>1068,1302=>1065,1303=>979,1304=>1082,1305=>1013,1306=>850,1307=>716,1308=>1103,1309=>924,1310=>817,1311=>679,1312=>1267,1313=>1059,1314=>1273,1315=>1017,1316=>957,1317=>807,1329=>813,1330=>729,1331=>728,1332=>731,1333=>729,1334=>733,1335=>652,1336=>720,1337=>903,1338=>728,1339=>666,1340=>558,1341=>961,1342=>788,1343=>713,1344=>651,1345=>730,1346=>715,1347=>704,1348=>780,1349=>689,1350=>715,1351=>708,1352=>731,1353=>677,1354=>867,1355=>711,1356=>780,1357=>731,1358=>715,1359=>693,1360=>666,1361=>698,1362=>576,1363=>833,1364=>698,1365=>763,1366=>855,1369=>330,1370=>342,1371=>308,1372=>374,1373=>313,1374=>461,1375=>468,1377=>938,1378=>642,1379=>704,1380=>708,1381=>642,1382=>644,1383=>565,1384=>642,1385=>756,1386=>704,1387=>643,1388=>310,1389=>984,1390=>638,1391=>643,1392=>643,1393=>603,1394=>643,1395=>642,1396=>643,1397=>309,1398=>643,1399=>486,1400=>643,1401=>366,1402=>938,1403=>573,1404=>666,1405=>643,1406=>643,1407=>934,1408=>643,1409=>643,1410=>479,1411=>934,1412=>648,1413=>620,1414=>813,1415=>812,1417=>360,1418=>374,1456=>0,1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0,1467=>0,1468=>0,1469=>0,1470=>415,1471=>0,1472=>372,1473=>0,1474=>0,1475=>372,1478=>497,1479=>0,1488=>728,1489=>610,1490=>447,1491=>588,1492=>687,1493=>343,1494=>400,1495=>687,1496=>679,1497=>294,1498=>578,1499=>566,1500=>605,1501=>696,1502=>724,1503=>343,1504=>453,1505=>680,1506=>666,1507=>675,1508=>658,1509=>661,1510=>653,1511=>736,1512=>602,1513=>758,1514=>683,1520=>664,1521=>567,1522=>519,1523=>444,1524=>710,1542=>667,1543=>667,1545=>884,1546=>1157,1548=>380,1557=>0,1563=>400,1567=>580,1569=>511,1570=>343,1571=>343,1572=>622,1573=>343,1574=>917,1575=>343,1576=>1005,1577=>590,1578=>1005,1579=>1005,1580=>721,1581=>721,1582=>721,1583=>513,1584=>513,1585=>576,1586=>576,1587=>1380,1588=>1380,1589=>1345,1590=>1345,1591=>1039,1592=>1039,1593=>683,1594=>683,1600=>342,1601=>1162,1602=>894,1603=>917,1604=>868,1605=>733,1606=>854,1607=>590,1608=>622,1609=>917,1610=>917,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1619=>0,1620=>0,1621=>0,1623=>0,1626=>500,1632=>610,1633=>610,1634=>610,1635=>610,1636=>610,1637=>610,1638=>610,1639=>610,1640=>610,1641=>610,1642=>610,1643=>374,1644=>380,1645=>545,1646=>1005,1647=>894,1648=>0,1652=>292,1657=>1005,1658=>1005,1659=>1005,1660=>1005,1661=>1005,1662=>1005,1663=>1005,1664=>1005,1665=>721,1666=>721,1667=>721,1668=>721,1669=>721,1670=>721,1671=>721,1672=>445,1673=>445,1674=>445,1675=>445,1676=>445,1677=>445,1678=>445,1679=>445,1680=>445,1681=>576,1682=>576,1683=>576,1684=>576,1685=>681,1686=>576,1687=>576,1688=>576,1689=>576,1690=>1380,1691=>1380,1692=>1380,1693=>1345,1694=>1345,1695=>1039,1696=>683,1697=>1162,1698=>1162,1699=>1162,1700=>1162,1701=>1162,1702=>1162,1703=>894,1704=>894,1705=>1024,1706=>1271,1707=>1024,1708=>917,1709=>917,1710=>917,1711=>1024,1712=>1024,1713=>1024,1714=>1024,1715=>1024,1716=>1024,1717=>868,1718=>868,1719=>868,1720=>868,1721=>854,1722=>854,1723=>854,1724=>854,1725=>854,1726=>938,1727=>721,1734=>622,1740=>917,1742=>917,1749=>590,1776=>610,1777=>610,1778=>610,1779=>610,1780=>610,1781=>610,1782=>610,1783=>610,1784=>610,1785=>610,1984=>696,1985=>696,1986=>696,1987=>696,1988=>696,1989=>696,1990=>696,1991=>696,1992=>696,1993=>696,1994=>343,1995=>547,1996=>543,1997=>652,1998=>691,1999=>691,2000=>594,2001=>691,2002=>904,2003=>551,2004=>551,2005=>627,2006=>688,2007=>444,2008=>1022,2009=>506,2010=>826,2011=>691,2012=>652,2013=>912,2014=>627,2015=>707,2016=>506,2017=>652,2018=>574,2019=>627,2020=>627,2021=>627,2022=>574,2023=>574,2027=>0,2028=>0,2029=>0,2030=>0,2031=>0,2032=>0,2033=>0,2034=>0,2035=>0,2036=>380,2037=>380,2040=>691,2041=>691,2042=>415,3647=>696,3713=>790,3714=>748,3716=>749,3719=>569,3720=>742,3722=>744,3725=>761,3732=>706,3733=>704,3734=>747,3735=>819,3737=>730,3738=>727,3739=>727,3740=>922,3741=>827,3742=>866,3743=>866,3745=>836,3746=>761,3747=>770,3749=>769,3751=>713,3754=>827,3755=>1031,3757=>724,3758=>784,3759=>934,3760=>688,3761=>0,3762=>610,3763=>610,3764=>0,3765=>0,3766=>0,3767=>0,3768=>0,3769=>0,3771=>0,3772=>0,3773=>670,3776=>516,3777=>860,3778=>516,3779=>650,3780=>632,3782=>759,3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>771,3793=>771,3794=>693,3795=>836,3796=>729,3797=>729,3798=>849,3799=>790,3800=>759,3801=>910,3804=>1363,3805=>1363,4256=>874,4257=>733,4258=>679,4259=>834,4260=>615,4261=>768,4262=>753,4263=>914,4264=>453,4265=>620,4266=>843,4267=>882,4268=>625,4269=>854,4270=>781,4271=>629,4272=>912,4273=>621,4274=>620,4275=>854,4276=>866,4277=>724,4278=>630,4279=>621,4280=>625,4281=>620,4282=>818,4283=>874,4284=>615,4285=>623,4286=>625,4287=>725,4288=>844,4289=>596,4290=>688,4291=>596,4292=>594,4293=>738,4304=>554,4305=>563,4306=>622,4307=>834,4308=>555,4309=>564,4310=>551,4311=>828,4312=>563,4313=>556,4314=>1074,4315=>568,4316=>568,4317=>814,4318=>554,4319=>563,4320=>823,4321=>568,4322=>700,4323=>591,4324=>852,4325=>560,4326=>814,4327=>563,4328=>553,4329=>568,4330=>622,4331=>568,4332=>553,4333=>566,4334=>568,4335=>540,4336=>554,4337=>559,4338=>553,4339=>554,4340=>553,4341=>587,4342=>853,4343=>604,4344=>563,4345=>622,4346=>554,4347=>448,4348=>324,5121=>774,5122=>774,5123=>774,5124=>774,5125=>905,5126=>905,5127=>905,5129=>905,5130=>905,5131=>905,5132=>1018,5133=>1009,5134=>1018,5135=>1009,5136=>1018,5137=>1009,5138=>1149,5139=>1140,5140=>1149,5141=>1140,5142=>905,5143=>1149,5144=>1142,5145=>1149,5146=>1142,5147=>905,5149=>310,5150=>529,5151=>425,5152=>425,5153=>395,5154=>395,5155=>395,5156=>395,5157=>564,5158=>470,5159=>310,5160=>395,5161=>395,5162=>395,5163=>1213,5164=>986,5165=>1216,5166=>1297,5167=>774,5168=>774,5169=>774,5170=>774,5171=>886,5172=>886,5173=>886,5175=>886,5176=>886,5177=>886,5178=>1018,5179=>1009,5180=>1018,5181=>1009,5182=>1018,5183=>1009,5184=>1149,5185=>1140,5186=>1149,5187=>1140,5188=>1149,5189=>1142,5190=>1149,5191=>1142,5192=>886,5193=>576,5194=>229,5196=>812,5197=>812,5198=>812,5199=>812,5200=>815,5201=>815,5202=>815,5204=>815,5205=>815,5206=>815,5207=>1056,5208=>1048,5209=>1056,5210=>1048,5211=>1056,5212=>1048,5213=>1060,5214=>1054,5215=>1060,5216=>1054,5217=>1060,5218=>1052,5219=>1060,5220=>1052,5221=>1060,5222=>483,5223=>1005,5224=>1005,5225=>1023,5226=>1017,5227=>743,5228=>743,5229=>743,5230=>743,5231=>743,5232=>743,5233=>743,5234=>743,5235=>743,5236=>1029,5237=>975,5238=>980,5239=>975,5240=>980,5241=>975,5242=>1029,5243=>975,5244=>1029,5245=>975,5246=>980,5247=>975,5248=>980,5249=>975,5250=>980,5251=>501,5252=>501,5253=>938,5254=>938,5255=>938,5256=>938,5257=>743,5258=>743,5259=>743,5260=>743,5261=>743,5262=>743,5263=>743,5264=>743,5265=>743,5266=>1029,5267=>975,5268=>1029,5269=>975,5270=>1029,5271=>975,5272=>1029,5273=>975,5274=>1029,5275=>975,5276=>1029,5277=>975,5278=>1029,5279=>975,5280=>1029,5281=>501,5282=>501,5283=>626,5284=>626,5285=>626,5286=>626,5287=>626,5288=>626,5289=>626,5290=>626,5291=>626,5292=>881,5293=>854,5294=>863,5295=>874,5296=>863,5297=>874,5298=>881,5299=>874,5300=>881,5301=>874,5302=>863,5303=>874,5304=>863,5305=>874,5306=>863,5307=>436,5308=>548,5309=>436,5312=>988,5313=>988,5314=>988,5315=>988,5316=>931,5317=>931,5318=>931,5319=>931,5320=>931,5321=>1238,5322=>1247,5323=>1200,5324=>1228,5325=>1200,5326=>1228,5327=>931,5328=>660,5329=>497,5330=>660,5331=>988,5332=>988,5333=>988,5334=>988,5335=>931,5336=>931,5337=>931,5338=>931,5339=>931,5340=>1231,5341=>1247,5342=>1283,5343=>1228,5344=>1283,5345=>1228,5346=>1228,5347=>1214,5348=>1228,5349=>1214,5350=>1283,5351=>1228,5352=>1283,5353=>1228,5354=>660,5356=>886,5357=>730,5358=>730,5359=>730,5360=>730,5361=>730,5362=>730,5363=>730,5364=>730,5365=>730,5366=>998,5367=>958,5368=>967,5369=>989,5370=>967,5371=>989,5372=>998,5373=>958,5374=>998,5375=>958,5376=>967,5377=>989,5378=>967,5379=>989,5380=>967,5381=>493,5382=>460,5383=>493,5392=>923,5393=>923,5394=>923,5395=>1136,5396=>1136,5397=>1136,5398=>1136,5399=>1209,5400=>1202,5401=>1209,5402=>1202,5403=>1209,5404=>1202,5405=>1431,5406=>1420,5407=>1431,5408=>1420,5409=>1431,5410=>1420,5411=>1431,5412=>1420,5413=>746,5414=>776,5415=>776,5416=>776,5417=>776,5418=>776,5419=>776,5420=>776,5421=>776,5422=>776,5423=>1003,5424=>1003,5425=>1013,5426=>996,5427=>1013,5428=>996,5429=>1003,5430=>1003,5431=>1003,5432=>1003,5433=>1013,5434=>996,5435=>1013,5436=>996,5437=>1013,5438=>495,5440=>395,5441=>510,5442=>1033,5443=>1033,5444=>976,5445=>976,5446=>976,5447=>976,5448=>733,5449=>733,5450=>733,5451=>733,5452=>733,5453=>733,5454=>1003,5455=>959,5456=>495,5458=>886,5459=>774,5460=>774,5461=>774,5462=>774,5463=>928,5464=>928,5465=>928,5466=>928,5467=>1172,5468=>1142,5469=>602,5470=>812,5471=>812,5472=>812,5473=>812,5474=>812,5475=>812,5476=>815,5477=>815,5478=>815,5479=>815,5480=>1060,5481=>1052,5482=>548,5492=>977,5493=>977,5494=>977,5495=>977,5496=>977,5497=>977,5498=>977,5499=>618,5500=>837,5501=>510,5502=>1238,5503=>1238,5504=>1238,5505=>1238,5506=>1238,5507=>1238,5508=>1238,5509=>989,5514=>977,5515=>977,5516=>977,5517=>977,5518=>1591,5519=>1591,5520=>1591,5521=>1295,5522=>1295,5523=>1591,5524=>1591,5525=>848,5526=>1273,5536=>988,5537=>988,5538=>931,5539=>931,5540=>931,5541=>931,5542=>660,5543=>776,5544=>776,5545=>776,5546=>776,5547=>776,5548=>776,5549=>776,5550=>495,5551=>743,5598=>830,5601=>830,5702=>496,5703=>496,5742=>413,5743=>1238,5744=>1591,5745=>2016,5746=>2016,5747=>1720,5748=>1678,5749=>2016,5750=>2016,5760=>543,5761=>637,5762=>945,5763=>1254,5764=>1563,5765=>1871,5766=>627,5767=>936,5768=>1254,5769=>1559,5770=>1871,5771=>569,5772=>877,5773=>1187,5774=>1497,5775=>1807,5776=>637,5777=>945,5778=>1240,5779=>1555,5780=>1871,5781=>569,5782=>569,5783=>789,5784=>1234,5785=>1559,5786=>740,5787=>638,5788=>638,7424=>652,7425=>833,7426=>1048,7427=>608,7428=>593,7429=>676,7430=>676,7431=>559,7432=>557,7433=>343,7434=>494,7435=>665,7436=>539,7437=>817,7438=>701,7439=>687,7440=>593,7441=>660,7442=>660,7443=>660,7444=>1094,7446=>687,7447=>687,7448=>556,7449=>642,7450=>642,7451=>580,7452=>634,7453=>737,7454=>948,7455=>695,7456=>652,7457=>924,7458=>582,7459=>646,7462=>539,7463=>652,7464=>691,7465=>556,7466=>781,7467=>732,7468=>487,7469=>683,7470=>480,7472=>523,7473=>430,7474=>430,7475=>517,7476=>527,7477=>234,7478=>234,7479=>488,7480=>401,7481=>626,7482=>527,7483=>527,7484=>535,7485=>509,7486=>461,7487=>485,7488=>430,7489=>511,7490=>695,7491=>458,7492=>458,7493=>479,7494=>712,7495=>479,7496=>479,7497=>479,7498=>479,7499=>386,7500=>386,7501=>479,7502=>219,7503=>487,7504=>664,7505=>456,7506=>488,7507=>414,7508=>488,7509=>488,7510=>479,7511=>388,7512=>456,7513=>462,7514=>664,7515=>501,7517=>451,7518=>429,7519=>433,7520=>493,7521=>406,7522=>219,7523=>315,7524=>456,7525=>501,7526=>451,7527=>429,7528=>451,7529=>493,7530=>406,7543=>716,7544=>527,7547=>545,7549=>747,7557=>514,7579=>479,7580=>414,7581=>414,7582=>488,7583=>386,7584=>377,7585=>348,7586=>479,7587=>456,7588=>347,7589=>281,7590=>347,7591=>347,7592=>431,7593=>326,7594=>330,7595=>370,7596=>664,7597=>664,7598=>562,7599=>562,7600=>448,7601=>488,7602=>542,7603=>422,7604=>396,7605=>388,7606=>583,7607=>494,7608=>399,7609=>451,7610=>501,7611=>417,7612=>523,7613=>470,7614=>455,7615=>425,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0,7680=>774,7681=>675,7682=>762,7683=>716,7684=>762,7685=>716,7686=>762,7687=>716,7688=>734,7689=>593,7690=>830,7691=>716,7692=>830,7693=>716,7694=>830,7695=>716,7696=>830,7697=>716,7698=>830,7699=>716,7700=>683,7701=>678,7702=>683,7703=>678,7704=>683,7705=>678,7706=>683,7707=>678,7708=>683,7709=>678,7710=>683,7711=>435,7712=>821,7713=>716,7714=>837,7715=>712,7716=>837,7717=>712,7718=>837,7719=>712,7720=>837,7721=>712,7722=>837,7723=>712,7724=>372,7725=>343,7726=>372,7727=>343,7728=>775,7729=>665,7730=>775,7731=>665,7732=>775,7733=>665,7734=>637,7735=>343,7736=>637,7737=>343,7738=>637,7739=>343,7740=>637,7741=>343,7742=>995,7743=>1042,7744=>995,7745=>1042,7746=>995,7747=>1042,7748=>837,7749=>712,7750=>837,7751=>712,7752=>837,7753=>712,7754=>837,7755=>712,7756=>850,7757=>687,7758=>850,7759=>687,7760=>850,7761=>687,7762=>850,7763=>687,7764=>733,7765=>716,7766=>733,7767=>716,7768=>770,7769=>493,7770=>770,7771=>493,7772=>770,7773=>493,7774=>770,7775=>493,7776=>720,7777=>595,7778=>720,7779=>595,7780=>720,7781=>595,7782=>720,7783=>595,7784=>720,7785=>595,7786=>682,7787=>478,7788=>682,7789=>478,7790=>682,7791=>478,7792=>682,7793=>478,7794=>812,7795=>712,7796=>812,7797=>712,7798=>812,7799=>712,7800=>812,7801=>712,7802=>812,7803=>712,7804=>774,7805=>652,7806=>774,7807=>652,7808=>1103,7809=>924,7810=>1103,7811=>924,7812=>1103,7813=>924,7814=>1103,7815=>924,7816=>1103,7817=>924,7818=>771,7819=>645,7820=>771,7821=>645,7822=>724,7823=>652,7824=>725,7825=>582,7826=>725,7827=>582,7828=>725,7829=>582,7830=>712,7831=>478,7832=>924,7833=>652,7834=>675,7835=>435,7836=>435,7837=>435,7838=>896,7839=>687,7840=>774,7841=>675,7842=>774,7843=>675,7844=>774,7845=>675,7846=>774,7847=>675,7848=>774,7849=>675,7850=>774,7851=>675,7852=>774,7853=>675,7854=>774,7855=>675,7856=>774,7857=>675,7858=>774,7859=>675,7860=>774,7861=>675,7862=>774,7863=>675,7864=>683,7865=>678,7866=>683,7867=>678,7868=>683,7869=>678,7870=>683,7871=>678,7872=>683,7873=>678,7874=>683,7875=>678,7876=>683,7877=>678,7878=>683,7879=>678,7880=>372,7881=>343,7882=>372,7883=>343,7884=>850,7885=>687,7886=>850,7887=>687,7888=>850,7889=>687,7890=>850,7891=>687,7892=>850,7893=>687,7894=>850,7895=>687,7896=>850,7897=>687,7898=>874,7899=>687,7900=>874,7901=>687,7902=>874,7903=>687,7904=>874,7905=>687,7906=>874,7907=>687,7908=>812,7909=>712,7910=>812,7911=>712,7912=>835,7913=>712,7914=>835,7915=>712,7916=>835,7917=>712,7918=>835,7919=>712,7920=>835,7921=>712,7922=>724,7923=>652,7924=>724,7925=>652,7926=>724,7927=>652,7928=>724,7929=>652,7930=>953,7931=>644,7936=>687,7937=>687,7938=>687,7939=>687,7940=>687,7941=>687,7942=>687,7943=>687,7944=>774,7945=>774,7946=>1041,7947=>1043,7948=>935,7949=>963,7950=>835,7951=>859,7952=>557,7953=>557,7954=>557,7955=>557,7956=>557,7957=>557,7960=>792,7961=>794,7962=>1100,7963=>1096,7964=>1023,7965=>1052,7968=>712,7969=>712,7970=>712,7971=>712,7972=>712,7973=>712,7974=>712,7975=>712,7976=>945,7977=>951,7978=>1250,7979=>1250,7980=>1180,7981=>1206,7982=>1054,7983=>1063,7984=>390,7985=>390,7986=>390,7987=>390,7988=>390,7989=>390,7990=>390,7991=>390,7992=>483,7993=>489,7994=>777,7995=>785,7996=>712,7997=>738,7998=>604,7999=>604,8000=>687,8001=>687,8002=>687,8003=>687,8004=>687,8005=>687,8008=>892,8009=>933,8010=>1221,8011=>1224,8012=>1053,8013=>1082,8016=>675,8017=>675,8018=>675,8019=>675,8020=>675,8021=>675,8022=>675,8023=>675,8025=>930,8027=>1184,8029=>1199,8031=>1049,8032=>869,8033=>869,8034=>869,8035=>869,8036=>869,8037=>869,8038=>869,8039=>869,8040=>909,8041=>958,8042=>1246,8043=>1251,8044=>1076,8045=>1105,8046=>1028,8047=>1076,8048=>687,8049=>687,8050=>557,8051=>557,8052=>712,8053=>712,8054=>390,8055=>390,8056=>687,8057=>687,8058=>675,8059=>675,8060=>869,8061=>869,8064=>687,8065=>687,8066=>687,8067=>687,8068=>687,8069=>687,8070=>687,8071=>687,8072=>774,8073=>774,8074=>1041,8075=>1043,8076=>935,8077=>963,8078=>835,8079=>859,8080=>712,8081=>712,8082=>712,8083=>712,8084=>712,8085=>712,8086=>712,8087=>712,8088=>945,8089=>951,8090=>1250,8091=>1250,8092=>1180,8093=>1206,8094=>1054,8095=>1063,8096=>869,8097=>869,8098=>869,8099=>869,8100=>869,8101=>869,8102=>869,8103=>869,8104=>909,8105=>958,8106=>1246,8107=>1251,8108=>1076,8109=>1105,8110=>1028,8111=>1076,8112=>687,8113=>687,8114=>687,8115=>687,8116=>687,8118=>687,8119=>687,8120=>774,8121=>774,8122=>876,8123=>797,8124=>774,8125=>500,8126=>500,8127=>500,8128=>500,8129=>500,8130=>712,8131=>712,8132=>712,8134=>712,8135=>712,8136=>929,8137=>846,8138=>1080,8139=>1009,8140=>837,8141=>500,8142=>500,8143=>500,8144=>390,8145=>390,8146=>390,8147=>390,8150=>390,8151=>390,8152=>372,8153=>372,8154=>621,8155=>563,8157=>500,8158=>500,8159=>500,8160=>675,8161=>675,8162=>675,8163=>675,8164=>716,8165=>716,8166=>675,8167=>675,8168=>724,8169=>724,8170=>1020,8171=>980,8172=>838,8173=>500,8174=>500,8175=>500,8178=>869,8179=>869,8180=>869,8182=>869,8183=>869,8184=>1065,8185=>891,8186=>1084,8187=>894,8188=>850,8189=>500,8190=>500,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>330,8197=>250,8198=>167,8199=>696,8200=>380,8201=>200,8202=>100,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>415,8209=>415,8210=>696,8211=>500,8212=>1000,8213=>1000,8214=>500,8215=>500,8216=>380,8217=>380,8218=>380,8219=>380,8220=>657,8221=>657,8222=>657,8223=>657,8224=>500,8225=>500,8226=>639,8227=>639,8228=>333,8229=>667,8230=>1000,8231=>348,8232=>0,8233=>0,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>200,8240=>1440,8241=>1887,8242=>264,8243=>447,8244=>630,8245=>264,8246=>447,8247=>630,8248=>733,8249=>412,8250=>412,8251=>972,8252=>627,8253=>580,8254=>500,8255=>828,8256=>828,8257=>329,8258=>1023,8259=>500,8260=>167,8261=>457,8262=>457,8263=>1030,8264=>829,8265=>829,8266=>513,8267=>636,8268=>500,8269=>500,8270=>523,8271=>400,8272=>828,8273=>523,8274=>556,8275=>1000,8276=>828,8277=>838,8278=>684,8279=>813,8280=>838,8281=>838,8282=>380,8283=>872,8284=>838,8285=>380,8286=>380,8287=>222,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0,8303=>0,8304=>438,8305=>219,8308=>438,8309=>438,8310=>438,8311=>438,8312=>438,8313=>438,8314=>528,8315=>528,8316=>528,8317=>288,8318=>288,8319=>456,8320=>438,8321=>438,8322=>438,8323=>438,8324=>438,8325=>438,8326=>438,8327=>438,8328=>438,8329=>438,8330=>528,8331=>528,8332=>528,8333=>288,8334=>288,8336=>458,8337=>479,8338=>488,8339=>413,8340=>479,8341=>456,8342=>487,8343=>219,8344=>664,8345=>456,8346=>479,8347=>381,8348=>388,8352=>929,8353=>696,8354=>696,8355=>696,8356=>696,8357=>1042,8358=>837,8359=>1518,8360=>1205,8361=>1103,8362=>904,8363=>696,8364=>696,8365=>696,8366=>696,8367=>1392,8368=>696,8369=>696,8370=>696,8371=>696,8372=>859,8373=>696,8376=>696,8377=>696,8378=>769,8400=>0,8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>1120,8449=>1170,8450=>734,8451=>1211,8452=>896,8453=>1091,8454=>1144,8455=>614,8456=>698,8457=>1086,8459=>1073,8460=>913,8461=>888,8462=>712,8463=>712,8464=>597,8465=>697,8466=>856,8467=>472,8468=>974,8469=>837,8470=>1203,8471=>1000,8472=>697,8473=>750,8474=>850,8475=>938,8476=>814,8477=>801,8478=>896,8479=>710,8480=>1020,8481=>1281,8482=>1000,8483=>755,8484=>754,8485=>578,8486=>850,8487=>850,8488=>763,8489=>338,8490=>775,8491=>774,8492=>928,8493=>818,8494=>854,8495=>636,8496=>729,8497=>808,8498=>683,8499=>1184,8500=>465,8501=>794,8502=>731,8503=>494,8504=>684,8505=>380,8506=>945,8507=>1348,8508=>790,8509=>737,8510=>654,8511=>863,8512=>840,8513=>775,8514=>557,8515=>637,8516=>760,8517=>830,8518=>716,8519=>678,8520=>343,8521=>343,8523=>872,8526=>547,8528=>1035,8529=>1035,8530=>1483,8531=>1035,8532=>1035,8533=>1035,8534=>1035,8535=>1035,8536=>1035,8537=>1035,8538=>1035,8539=>1035,8540=>1035,8541=>1035,8542=>1035,8543=>615,8544=>372,8545=>659,8546=>945,8547=>1099,8548=>774,8549=>1099,8550=>1386,8551=>1672,8552=>1121,8553=>771,8554=>1120,8555=>1407,8556=>637,8557=>734,8558=>830,8559=>995,8560=>343,8561=>607,8562=>872,8563=>984,8564=>652,8565=>962,8566=>1227,8567=>1491,8568=>969,8569=>645,8570=>969,8571=>1233,8572=>343,8573=>593,8574=>716,8575=>1042,8576=>1289,8577=>830,8578=>1289,8579=>734,8580=>593,8581=>734,8585=>1035,8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838,8598=>838,8599=>838,8600=>838,8601=>838,8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838,8608=>838,8609=>838,8610=>838,8611=>838,8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838,8618=>838,8619=>838,8620=>838,8621=>838,8622=>838,8623=>838,8624=>838,8625=>838,8626=>838,8627=>838,8628=>838,8629=>838,8630=>838,8631=>838,8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838,8638=>838,8639=>838,8640=>838,8641=>838,8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838,8648=>838,8649=>838,8650=>838,8651=>838,8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838,8658=>838,8659=>838,8660=>838,8661=>838,8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838,8668=>838,8669=>838,8670=>838,8671=>838,8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838,8678=>838,8679=>838,8680=>838,8681=>838,8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838,8688=>838,8689=>838,8690=>838,8691=>838,8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838,8698=>838,8699=>838,8700=>838,8701=>838,8702=>838,8703=>838,8704=>774,8705=>696,8706=>544,8707=>683,8708=>683,8709=>856,8710=>697,8711=>697,8712=>896,8713=>896,8714=>750,8715=>896,8716=>896,8717=>750,8718=>636,8719=>787,8720=>787,8721=>718,8722=>838,8723=>838,8724=>696,8725=>365,8726=>696,8727=>838,8728=>626,8729=>380,8730=>667,8731=>667,8732=>667,8733=>712,8734=>833,8735=>838,8736=>896,8737=>896,8738=>838,8739=>500,8740=>500,8741=>500,8742=>500,8743=>812,8744=>812,8745=>812,8746=>812,8747=>610,8748=>929,8749=>1295,8750=>563,8751=>977,8752=>1313,8753=>563,8754=>563,8755=>563,8756=>696,8757=>696,8758=>294,8759=>696,8760=>838,8761=>838,8762=>838,8763=>838,8764=>838,8765=>838,8766=>838,8767=>838,8768=>375,8769=>838,8770=>838,8771=>838,8772=>838,8773=>838,8774=>838,8775=>838,8776=>838,8777=>838,8778=>838,8779=>838,8780=>838,8781=>838,8782=>838,8783=>838,8784=>838,8785=>838,8786=>838,8787=>838,8788=>1063,8789=>1063,8790=>838,8791=>838,8792=>838,8793=>838,8794=>838,8795=>838,8796=>838,8797=>838,8798=>838,8799=>838,8800=>838,8801=>838,8802=>838,8803=>838,8804=>838,8805=>838,8806=>838,8807=>838,8808=>841,8809=>841,8810=>1047,8811=>1047,8812=>500,8813=>838,8814=>838,8815=>838,8816=>838,8817=>838,8818=>838,8819=>838,8820=>838,8821=>838,8822=>838,8823=>838,8824=>838,8825=>838,8826=>838,8827=>838,8828=>838,8829=>838,8830=>838,8831=>838,8832=>838,8833=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838,8840=>838,8841=>838,8842=>838,8843=>838,8844=>812,8845=>812,8846=>812,8847=>838,8848=>838,8849=>838,8850=>838,8851=>796,8852=>796,8853=>838,8854=>838,8855=>838,8856=>838,8857=>838,8858=>838,8859=>838,8860=>838,8861=>838,8862=>838,8863=>838,8864=>838,8865=>838,8866=>914,8867=>914,8868=>914,8869=>914,8870=>542,8871=>542,8872=>914,8873=>914,8874=>914,8875=>914,8876=>914,8877=>914,8878=>914,8879=>914,8880=>838,8881=>838,8882=>838,8883=>838,8884=>838,8885=>838,8886=>1000,8887=>1000,8888=>838,8889=>838,8890=>542,8891=>812,8892=>812,8893=>812,8894=>838,8895=>838,8896=>843,8897=>843,8898=>843,8899=>843,8900=>494,8901=>380,8902=>626,8903=>838,8904=>1000,8905=>1000,8906=>1000,8907=>1000,8908=>1000,8909=>838,8910=>812,8911=>812,8912=>838,8913=>838,8914=>838,8915=>838,8916=>838,8917=>838,8918=>838,8919=>838,8920=>1422,8921=>1422,8922=>838,8923=>838,8924=>838,8925=>838,8926=>838,8927=>838,8928=>838,8929=>838,8930=>838,8931=>838,8932=>838,8933=>838,8934=>838,8935=>838,8936=>838,8937=>838,8938=>838,8939=>838,8940=>838,8941=>838,8942=>1000,8943=>1000,8944=>1000,8945=>1000,8946=>1158,8947=>896,8948=>750,8949=>896,8950=>896,8951=>750,8952=>896,8953=>896,8954=>1158,8955=>896,8956=>750,8957=>896,8958=>750,8959=>896,8960=>602,8961=>602,8962=>716,8963=>838,8964=>838,8965=>838,8966=>838,8967=>488,8968=>457,8969=>457,8970=>457,8971=>457,8972=>809,8973=>809,8974=>809,8975=>809,8976=>838,8977=>539,8984=>928,8985=>838,8988=>469,8989=>469,8990=>469,8991=>469,8992=>610,8993=>610,8996=>1152,8997=>1152,8998=>1414,8999=>1152,9000=>1443,9003=>1414,9004=>873,9075=>390,9076=>716,9077=>869,9082=>687,9085=>863,9095=>1152,9108=>873,9115=>500,9116=>500,9117=>500,9118=>500,9119=>500,9120=>500,9121=>500,9122=>500,9123=>500,9124=>500,9125=>500,9126=>500,9127=>750,9128=>750,9129=>750,9130=>750,9131=>750,9132=>750,9133=>750,9134=>610,9166=>838,9167=>945,9187=>873,9189=>769,9192=>696,9250=>716,9251=>716,9312=>847,9313=>847,9314=>847,9315=>847,9316=>847,9317=>847,9318=>847,9319=>847,9320=>847,9321=>847,9600=>769,9601=>769,9602=>769,9603=>769,9604=>769,9605=>769,9606=>769,9607=>769,9608=>769,9609=>769,9610=>769,9611=>769,9612=>769,9613=>769,9614=>769,9615=>769,9616=>769,9617=>769,9618=>769,9619=>769,9620=>769,9621=>769,9622=>769,9623=>769,9624=>769,9625=>769,9626=>769,9627=>769,9628=>769,9629=>769,9630=>769,9631=>769,9632=>945,9633=>945,9634=>945,9635=>945,9636=>945,9637=>945,9638=>945,9639=>945,9640=>945,9641=>945,9642=>678,9643=>678,9644=>945,9645=>945,9646=>550,9647=>550,9648=>769,9649=>769,9650=>769,9651=>769,9652=>502,9653=>502,9654=>769,9655=>769,9656=>502,9657=>502,9658=>769,9659=>769,9660=>769,9661=>769,9662=>502,9663=>502,9664=>769,9665=>769,9666=>502,9667=>502,9668=>769,9669=>769,9670=>769,9671=>769,9672=>769,9673=>873,9674=>494,9675=>873,9676=>873,9677=>873,9678=>873,9679=>873,9680=>873,9681=>873,9682=>873,9683=>873,9684=>873,9685=>873,9686=>527,9687=>527,9688=>840,9689=>970,9690=>970,9691=>970,9692=>387,9693=>387,9694=>387,9695=>387,9696=>769,9697=>769,9698=>769,9699=>769,9700=>769,9701=>769,9702=>639,9703=>945,9704=>945,9705=>945,9706=>945,9707=>945,9708=>769,9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945,9714=>945,9715=>945,9716=>873,9717=>873,9718=>873,9719=>873,9720=>769,9721=>769,9722=>769,9723=>830,9724=>830,9725=>732,9726=>732,9727=>769,9728=>896,9729=>1000,9730=>896,9731=>896,9732=>896,9733=>896,9734=>896,9735=>573,9736=>896,9737=>896,9738=>888,9739=>888,9740=>671,9741=>1013,9742=>1246,9743=>1250,9744=>896,9745=>896,9746=>896,9747=>532,9748=>896,9749=>896,9750=>896,9751=>896,9752=>896,9753=>896,9754=>896,9755=>896,9756=>896,9757=>609,9758=>896,9759=>609,9760=>896,9761=>896,9762=>896,9763=>896,9764=>669,9765=>746,9766=>649,9767=>784,9768=>545,9769=>896,9770=>896,9771=>896,9772=>710,9773=>896,9774=>896,9775=>896,9776=>896,9777=>896,9778=>896,9779=>896,9780=>896,9781=>896,9782=>896,9783=>896,9784=>896,9785=>1042,9786=>1042,9787=>1042,9788=>896,9789=>896,9790=>896,9791=>614,9792=>732,9793=>732,9794=>896,9795=>896,9796=>896,9797=>896,9798=>896,9799=>896,9800=>896,9801=>896,9802=>896,9803=>896,9804=>896,9805=>896,9806=>896,9807=>896,9808=>896,9809=>896,9810=>896,9811=>896,9812=>896,9813=>896,9814=>896,9815=>896,9816=>896,9817=>896,9818=>896,9819=>896,9820=>896,9821=>896,9822=>896,9823=>896,9824=>896,9825=>896,9826=>896,9827=>896,9828=>896,9829=>896,9830=>896,9831=>896,9832=>896,9833=>472,9834=>638,9835=>896,9836=>896,9837=>472,9838=>357,9839=>484,9840=>748,9841=>766,9842=>896,9843=>896,9844=>896,9845=>896,9846=>896,9847=>896,9848=>896,9849=>896,9850=>896,9851=>896,9852=>896,9853=>896,9854=>896,9855=>896,9856=>869,9857=>869,9858=>869,9859=>869,9860=>869,9861=>869,9862=>896,9863=>896,9864=>896,9865=>896,9866=>896,9867=>896,9868=>896,9869=>896,9870=>896,9871=>896,9872=>896,9873=>896,9874=>896,9875=>896,9876=>896,9877=>541,9878=>896,9879=>896,9880=>896,9881=>896,9882=>896,9883=>896,9884=>896,9888=>896,9889=>702,9890=>1004,9891=>1089,9892=>1175,9893=>903,9894=>838,9895=>838,9896=>838,9897=>838,9898=>838,9899=>838,9900=>838,9901=>838,9902=>838,9903=>838,9904=>844,9905=>838,9906=>732,9907=>732,9908=>732,9909=>732,9910=>850,9911=>732,9912=>732,9920=>838,9921=>838,9922=>838,9923=>838,9954=>732,9985=>838,9986=>838,9987=>838,9988=>838,9990=>838,9991=>838,9992=>838,9993=>838,9996=>838,9997=>838,9998=>838,9999=>838,10000=>838,10001=>838,10002=>838,10003=>838,10004=>838,10005=>838,10006=>838,10007=>838,10008=>838,10009=>838,10010=>838,10011=>838,10012=>838,10013=>838,10014=>838,10015=>838,10016=>838,10017=>838,10018=>838,10019=>838,10020=>838,10021=>838,10022=>838,10023=>838,10025=>838,10026=>838,10027=>838,10028=>838,10029=>838,10030=>838,10031=>838,10032=>838,10033=>838,10034=>838,10035=>838,10036=>838,10037=>838,10038=>838,10039=>838,10040=>838,10041=>838,10042=>838,10043=>838,10044=>838,10045=>838,10046=>838,10047=>838,10048=>838,10049=>838,10050=>838,10051=>838,10052=>838,10053=>838,10054=>838,10055=>838,10056=>838,10057=>838,10058=>838,10059=>838,10061=>896,10063=>896,10064=>896,10065=>896,10066=>896,10070=>896,10072=>838,10073=>838,10074=>838,10075=>347,10076=>347,10077=>587,10078=>587,10081=>838,10082=>838,10083=>838,10084=>838,10085=>838,10086=>838,10087=>838,10088=>838,10089=>838,10090=>838,10091=>838,10092=>838,10093=>838,10094=>838,10095=>838,10096=>838,10097=>838,10098=>838,10099=>838,10100=>838,10101=>838,10102=>847,10103=>847,10104=>847,10105=>847,10106=>847,10107=>847,10108=>847,10109=>847,10110=>847,10111=>847,10112=>838,10113=>838,10114=>838,10115=>838,10116=>838,10117=>838,10118=>838,10119=>838,10120=>838,10121=>838,10122=>838,10123=>838,10124=>838,10125=>838,10126=>838,10127=>838,10128=>838,10129=>838,10130=>838,10131=>838,10132=>838,10136=>838,10137=>838,10138=>838,10139=>838,10140=>838,10141=>838,10142=>838,10143=>838,10144=>838,10145=>838,10146=>838,10147=>838,10148=>838,10149=>838,10150=>838,10151=>838,10152=>838,10153=>838,10154=>838,10155=>838,10156=>838,10157=>838,10158=>838,10159=>838,10161=>838,10162=>838,10163=>838,10164=>838,10165=>838,10166=>838,10167=>838,10168=>838,10169=>838,10170=>838,10171=>838,10172=>838,10173=>838,10174=>838,10181=>457,10182=>457,10208=>494,10214=>487,10215=>487,10216=>457,10217=>457,10218=>721,10219=>721,10224=>838,10225=>838,10226=>838,10227=>838,10228=>1157,10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434,10237=>1434,10238=>1434,10239=>1434,10240=>781,10241=>781,10242=>781,10243=>781,10244=>781,10245=>781,10246=>781,10247=>781,10248=>781,10249=>781,10250=>781,10251=>781,10252=>781,10253=>781,10254=>781,10255=>781,10256=>781,10257=>781,10258=>781,10259=>781,10260=>781,10261=>781,10262=>781,10263=>781,10264=>781,10265=>781,10266=>781,10267=>781,10268=>781,10269=>781,10270=>781,10271=>781,10272=>781,10273=>781,10274=>781,10275=>781,10276=>781,10277=>781,10278=>781,10279=>781,10280=>781,10281=>781,10282=>781,10283=>781,10284=>781,10285=>781,10286=>781,10287=>781,10288=>781,10289=>781,10290=>781,10291=>781,10292=>781,10293=>781,10294=>781,10295=>781,10296=>781,10297=>781,10298=>781,10299=>781,10300=>781,10301=>781,10302=>781,10303=>781,10304=>781,10305=>781,10306=>781,10307=>781,10308=>781,10309=>781,10310=>781,10311=>781,10312=>781,10313=>781,10314=>781,10315=>781,10316=>781,10317=>781,10318=>781,10319=>781,10320=>781,10321=>781,10322=>781,10323=>781,10324=>781,10325=>781,10326=>781,10327=>781,10328=>781,10329=>781,10330=>781,10331=>781,10332=>781,10333=>781,10334=>781,10335=>781,10336=>781,10337=>781,10338=>781,10339=>781,10340=>781,10341=>781,10342=>781,10343=>781,10344=>781,10345=>781,10346=>781,10347=>781,10348=>781,10349=>781,10350=>781,10351=>781,10352=>781,10353=>781,10354=>781,10355=>781,10356=>781,10357=>781,10358=>781,10359=>781,10360=>781,10361=>781,10362=>781,10363=>781,10364=>781,10365=>781,10366=>781,10367=>781,10368=>781,10369=>781,10370=>781,10371=>781,10372=>781,10373=>781,10374=>781,10375=>781,10376=>781,10377=>781,10378=>781,10379=>781,10380=>781,10381=>781,10382=>781,10383=>781,10384=>781,10385=>781,10386=>781,10387=>781,10388=>781,10389=>781,10390=>781,10391=>781,10392=>781,10393=>781,10394=>781,10395=>781,10396=>781,10397=>781,10398=>781,10399=>781,10400=>781,10401=>781,10402=>781,10403=>781,10404=>781,10405=>781,10406=>781,10407=>781,10408=>781,10409=>781,10410=>781,10411=>781,10412=>781,10413=>781,10414=>781,10415=>781,10416=>781,10417=>781,10418=>781,10419=>781,10420=>781,10421=>781,10422=>781,10423=>781,10424=>781,10425=>781,10426=>781,10427=>781,10428=>781,10429=>781,10430=>781,10431=>781,10432=>781,10433=>781,10434=>781,10435=>781,10436=>781,10437=>781,10438=>781,10439=>781,10440=>781,10441=>781,10442=>781,10443=>781,10444=>781,10445=>781,10446=>781,10447=>781,10448=>781,10449=>781,10450=>781,10451=>781,10452=>781,10453=>781,10454=>781,10455=>781,10456=>781,10457=>781,10458=>781,10459=>781,10460=>781,10461=>781,10462=>781,10463=>781,10464=>781,10465=>781,10466=>781,10467=>781,10468=>781,10469=>781,10470=>781,10471=>781,10472=>781,10473=>781,10474=>781,10475=>781,10476=>781,10477=>781,10478=>781,10479=>781,10480=>781,10481=>781,10482=>781,10483=>781,10484=>781,10485=>781,10486=>781,10487=>781,10488=>781,10489=>781,10490=>781,10491=>781,10492=>781,10493=>781,10494=>781,10495=>781,10502=>838,10503=>838,10506=>838,10507=>838,10560=>838,10561=>838,10627=>753,10628=>753,10702=>838,10703=>1046,10704=>1046,10705=>1000,10706=>1000,10707=>1000,10708=>1000,10709=>1000,10731=>494,10746=>838,10747=>838,10752=>1000,10753=>1000,10754=>1000,10764=>1661,10765=>563,10766=>563,10767=>563,10768=>563,10769=>563,10770=>563,10771=>563,10772=>563,10773=>563,10774=>563,10775=>563,10776=>563,10777=>563,10778=>563,10779=>563,10780=>563,10799=>838,10858=>838,10859=>838,10877=>838,10878=>838,10879=>838,10880=>838,10881=>838,10882=>838,10883=>838,10884=>838,10885=>838,10886=>838,10887=>838,10888=>838,10889=>838,10890=>838,10891=>838,10892=>838,10893=>838,10894=>838,10895=>838,10896=>838,10897=>838,10898=>838,10899=>838,10900=>838,10901=>838,10902=>838,10903=>838,10904=>838,10905=>838,10906=>838,10907=>838,10908=>838,10909=>838,10910=>838,10911=>838,10912=>838,10926=>838,10927=>838,10928=>838,10929=>838,10930=>838,10931=>838,10932=>838,10933=>838,10934=>838,10935=>838,10936=>838,10937=>838,10938=>838,11001=>838,11002=>838,11008=>838,11009=>838,11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838,11016=>838,11017=>838,11018=>838,11019=>838,11020=>838,11021=>838,11022=>838,11023=>838,11024=>838,11025=>838,11026=>945,11027=>945,11028=>945,11029=>945,11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11039=>869,11040=>869,11041=>873,11042=>873,11043=>873,11044=>1119,11091=>869,11092=>869,11360=>637,11361=>360,11362=>637,11363=>733,11364=>770,11365=>675,11366=>478,11367=>956,11368=>712,11369=>775,11370=>665,11371=>725,11372=>582,11373=>860,11374=>995,11375=>774,11376=>860,11377=>778,11378=>1221,11379=>1056,11380=>652,11381=>698,11382=>565,11383=>782,11385=>538,11386=>687,11387=>559,11388=>219,11389=>487,11390=>720,11391=>725,11520=>663,11521=>676,11522=>661,11523=>629,11524=>661,11525=>1032,11526=>718,11527=>1032,11528=>648,11529=>667,11530=>1032,11531=>673,11532=>677,11533=>1036,11534=>680,11535=>886,11536=>1032,11537=>683,11538=>674,11539=>1035,11540=>1033,11541=>1027,11542=>676,11543=>673,11544=>667,11545=>667,11546=>660,11547=>671,11548=>1039,11549=>673,11550=>692,11551=>659,11552=>1048,11553=>660,11554=>654,11555=>670,11556=>733,11557=>1017,11568=>691,11569=>941,11570=>941,11571=>725,11572=>725,11573=>725,11574=>676,11575=>774,11576=>774,11577=>683,11578=>683,11579=>802,11580=>989,11581=>761,11582=>623,11583=>761,11584=>941,11585=>941,11586=>373,11587=>740,11588=>837,11589=>914,11590=>672,11591=>737,11592=>680,11593=>683,11594=>602,11595=>1039,11596=>778,11597=>837,11598=>683,11599=>372,11600=>778,11601=>373,11602=>725,11603=>691,11604=>941,11605=>941,11606=>837,11607=>373,11608=>836,11609=>941,11610=>941,11611=>734,11612=>876,11613=>771,11614=>734,11615=>683,11616=>774,11617=>837,11618=>683,11619=>850,11620=>697,11621=>850,11631=>716,11800=>580,11807=>838,11810=>457,11811=>457,11812=>457,11813=>457,11822=>580,19904=>896,19905=>896,19906=>896,19907=>896,19908=>896,19909=>896,19910=>896,19911=>896,19912=>896,19913=>896,19914=>896,19915=>896,19916=>896,19917=>896,19918=>896,19919=>896,19920=>896,19921=>896,19922=>896,19923=>896,19924=>896,19925=>896,19926=>896,19927=>896,19928=>896,19929=>896,19930=>896,19931=>896,19932=>896,19933=>896,19934=>896,19935=>896,19936=>896,19937=>896,19938=>896,19939=>896,19940=>896,19941=>896,19942=>896,19943=>896,19944=>896,19945=>896,19946=>896,19947=>896,19948=>896,19949=>896,19950=>896,19951=>896,19952=>896,19953=>896,19954=>896,19955=>896,19956=>896,19957=>896,19958=>896,19959=>896,19960=>896,19961=>896,19962=>896,19963=>896,19964=>896,19965=>896,19966=>896,19967=>896,42192=>762,42193=>733,42194=>733,42195=>830,42196=>682,42197=>682,42198=>821,42199=>775,42200=>775,42201=>530,42202=>734,42203=>734,42204=>725,42205=>683,42206=>683,42207=>995,42208=>837,42209=>637,42210=>720,42211=>770,42212=>770,42213=>774,42214=>774,42215=>837,42216=>775,42217=>530,42218=>1103,42219=>771,42220=>724,42221=>762,42222=>774,42223=>774,42224=>683,42225=>683,42226=>372,42227=>850,42228=>812,42229=>812,42230=>557,42231=>830,42232=>322,42233=>322,42234=>674,42235=>674,42236=>322,42237=>322,42238=>588,42239=>588,42564=>720,42565=>595,42566=>436,42567=>440,42572=>1405,42573=>1173,42576=>1234,42577=>1027,42580=>1174,42581=>972,42582=>1093,42583=>958,42594=>1085,42595=>924,42596=>1096,42597=>912,42598=>1260,42599=>997,42600=>850,42601=>687,42602=>1037,42603=>868,42604=>1406,42605=>1106,42606=>961,42634=>963,42635=>787,42636=>682,42637=>580,42644=>808,42645=>712,42760=>500,42761=>500,42762=>500,42763=>500,42764=>500,42765=>500,42766=>500,42767=>500,42768=>500,42769=>500,42770=>500,42771=>500,42772=>500,42773=>500,42774=>500,42779=>400,42780=>400,42781=>287,42782=>287,42783=>287,42786=>444,42787=>390,42788=>540,42789=>540,42790=>837,42791=>712,42792=>1031,42793=>857,42794=>696,42795=>557,42800=>559,42801=>595,42802=>1349,42803=>1052,42804=>1284,42805=>1064,42806=>1216,42807=>1054,42808=>1079,42809=>922,42810=>1079,42811=>922,42812=>1035,42813=>922,42814=>698,42815=>549,42816=>656,42817=>688,42822=>850,42823=>542,42824=>683,42825=>531,42826=>918,42827=>814,42830=>1406,42831=>1106,42832=>733,42833=>716,42834=>948,42835=>937,42838=>850,42839=>716,42852=>738,42853=>716,42854=>738,42855=>716,42880=>637,42881=>343,42882=>837,42883=>712,42889=>400,42890=>386,42891=>456,42892=>306,42893=>808,42894=>693,42896=>928,42897=>768,42912=>821,42913=>716,42914=>775,42915=>665,42916=>837,42917=>712,42918=>770,42919=>493,42920=>720,42921=>595,42922=>886,43002=>1062,43003=>683,43004=>733,43005=>995,43006=>372,43007=>1325,61184=>216,61185=>242,61186=>267,61187=>277,61188=>282,61189=>242,61190=>216,61191=>242,61192=>267,61193=>277,61194=>267,61195=>242,61196=>216,61197=>242,61198=>267,61199=>277,61200=>267,61201=>242,61202=>216,61203=>242,61204=>282,61205=>277,61206=>267,61207=>242,61208=>216,61209=>282,62464=>612,62465=>612,62466=>653,62467=>902,62468=>622,62469=>622,62470=>661,62471=>895,62472=>589,62473=>622,62474=>1163,62475=>626,62476=>627,62477=>893,62478=>612,62479=>626,62480=>924,62481=>627,62482=>744,62483=>634,62484=>886,62485=>626,62486=>907,62487=>626,62488=>621,62489=>628,62490=>677,62491=>626,62492=>621,62493=>630,62494=>627,62495=>571,62496=>622,62497=>631,62498=>612,62499=>611,62500=>618,62501=>671,62502=>963,62504=>1023,62505=>844,62506=>563,62507=>563,62508=>563,62509=>563,62510=>563,62511=>563,62512=>555,62513=>555,62514=>555,62515=>555,62516=>573,62517=>573,62518=>573,62519=>824,62520=>824,62521=>824,62522=>824,62523=>824,62524=>611,62525=>611,62526=>611,62527=>611,62528=>611,62529=>611,63173=>687,64256=>810,64257=>741,64258=>741,64259=>1115,64260=>1116,64261=>808,64262=>1020,64275=>1388,64276=>1384,64277=>1378,64278=>1384,64279=>1713,64285=>294,64286=>0,64287=>519,64288=>665,64289=>939,64290=>788,64291=>920,64292=>786,64293=>857,64294=>869,64295=>821,64296=>890,64297=>838,64298=>758,64299=>758,64300=>758,64301=>758,64302=>728,64303=>728,64304=>728,64305=>610,64306=>447,64307=>588,64308=>687,64309=>437,64310=>485,64312=>679,64313=>435,64314=>578,64315=>566,64316=>605,64318=>724,64320=>453,64321=>680,64323=>675,64324=>658,64326=>653,64327=>736,64328=>602,64329=>758,64330=>683,64331=>343,64332=>610,64333=>566,64334=>658,64335=>710,64338=>1005,64339=>1059,64340=>375,64341=>408,64342=>1005,64343=>1059,64344=>375,64345=>408,64346=>1005,64347=>1059,64348=>375,64349=>408,64350=>1005,64351=>1059,64352=>375,64353=>408,64354=>1005,64355=>1059,64356=>375,64357=>408,64358=>1005,64359=>1059,64360=>375,64361=>408,64362=>1162,64363=>1191,64364=>655,64365=>720,64366=>1162,64367=>1191,64368=>655,64369=>720,64370=>721,64371=>721,64372=>721,64373=>721,64374=>721,64375=>721,64376=>721,64377=>721,64378=>721,64379=>721,64380=>721,64381=>721,64382=>721,64383=>721,64384=>721,64385=>721,64386=>513,64387=>578,64388=>513,64389=>578,64390=>513,64391=>578,64392=>513,64393=>578,64394=>576,64395=>622,64396=>576,64397=>622,64398=>1024,64399=>1024,64400=>582,64401=>582,64402=>1024,64403=>1024,64404=>582,64405=>582,64406=>1024,64407=>1024,64408=>582,64409=>582,64410=>1024,64411=>1024,64412=>582,64413=>582,64414=>854,64415=>900,64416=>854,64417=>900,64418=>375,64419=>408,64426=>938,64427=>880,64428=>693,64429=>660,64467=>824,64468=>843,64469=>476,64470=>552,64473=>622,64474=>627,64488=>375,64489=>408,64508=>917,64509=>1012,64510=>375,64511=>408,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0,65059=>0,65136=>342,65137=>342,65138=>342,65139=>346,65140=>342,65142=>342,65143=>342,65144=>342,65145=>342,65146=>342,65147=>342,65148=>342,65149=>342,65150=>342,65151=>342,65152=>511,65153=>343,65154=>375,65155=>343,65156=>375,65157=>622,65158=>627,65159=>343,65160=>375,65161=>917,65162=>917,65163=>375,65164=>408,65165=>343,65166=>375,65167=>1005,65168=>1059,65169=>375,65170=>408,65171=>590,65172=>606,65173=>1005,65174=>1059,65175=>375,65176=>408,65177=>1005,65178=>1059,65179=>375,65180=>408,65181=>721,65182=>721,65183=>721,65184=>721,65185=>721,65186=>721,65187=>721,65188=>721,65189=>721,65190=>721,65191=>721,65192=>721,65193=>513,65194=>578,65195=>513,65196=>578,65197=>576,65198=>622,65199=>576,65200=>622,65201=>1380,65202=>1414,65203=>983,65204=>1018,65205=>1380,65206=>1414,65207=>983,65208=>1018,65209=>1345,65210=>1364,65211=>966,65212=>985,65213=>1345,65214=>1364,65215=>966,65216=>985,65217=>1039,65218=>1071,65219=>942,65220=>974,65221=>1039,65222=>1071,65223=>942,65224=>974,65225=>683,65226=>683,65227=>683,65228=>564,65229=>683,65230=>683,65231=>683,65232=>564,65233=>1162,65234=>1191,65235=>655,65236=>720,65237=>894,65238=>901,65239=>655,65240=>720,65241=>917,65242=>931,65243=>582,65244=>582,65245=>868,65246=>893,65247=>375,65248=>408,65249=>733,65250=>784,65251=>619,65252=>670,65253=>854,65254=>900,65255=>375,65256=>408,65257=>590,65258=>606,65259=>693,65260=>660,65261=>622,65262=>627,65263=>917,65264=>1012,65265=>917,65266=>1012,65267=>375,65268=>408,65269=>745,65270=>759,65271=>745,65272=>759,65273=>745,65274=>759,65275=>745,65276=>759,65279=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1113,65535=>600); -// --- EOF --- diff --git a/#pma/libraries/tcpdf/fonts/dejavusansb.z b/#pma/libraries/tcpdf/fonts/dejavusansb.z deleted file mode 100644 index 07031ce3..00000000 Binary files a/#pma/libraries/tcpdf/fonts/dejavusansb.z and /dev/null differ diff --git a/#pma/libraries/tcpdf/fonts/helvetica.php b/#pma/libraries/tcpdf/fonts/helvetica.php deleted file mode 100644 index d1aa6d85..00000000 --- a/#pma/libraries/tcpdf/fonts/helvetica.php +++ /dev/null @@ -1,13 +0,0 @@ -32,'FontBBox'=>'[-166 -225 1000 931]','ItalicAngle'=>0,'Ascent'=>931,'Descent'=>-225,'Leading'=>0,'CapHeight'=>718,'XHeight'=>523,'StemV'=>88,'StemH'=>76,'AvgWidth'=>513,'MaxWidth'=>1015,'MissingWidth'=>513); -$cw=array(0=>500,1=>500,2=>500,3=>500,4=>500,5=>500,6=>500,7=>500,8=>500,9=>500,10=>500,11=>500,12=>500,13=>500,14=>500,15=>500,16=>500,17=>500,18=>500,19=>500,20=>500,21=>500,22=>500,23=>500,24=>500,25=>500,26=>500,27=>500,28=>500,29=>500,30=>500,31=>500,32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556,64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778,80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>277,94=>469,95=>556,96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556,112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,127=>500,128=>655,129=>500,130=>222,131=>278,132=>333,133=>1000,134=>556,135=>556,136=>333,137=>1000,138=>667,139=>250,140=>1000,141=>500,142=>611,143=>500,144=>500,145=>222,146=>221,147=>333,148=>333,149=>350,150=>556,151=>1000,152=>333,153=>1000,154=>500,155=>250,156=>938,157=>500,158=>500,159=>667,160=>278,161=>278,162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>448,172=>584,173=>333,174=>737,175=>333,176=>606,177=>584,178=>350,179=>350,180=>333,181=>556,182=>537,183=>278,184=>333,185=>350,186=>365,187=>448,188=>869,189=>869,190=>879,191=>556,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>666,223=>611,224=>556,225=>556,226=>556,227=>556,228=>556,229=>556,230=>896,231=>500,232=>556,233=>556,234=>556,235=>556,236=>251,237=>251,238=>251,239=>251,240=>556,241=>556,242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>555,255=>500); - -// --- EOF --- diff --git a/#pma/libraries/tcpdf/include/tcpdf_colors.php b/#pma/libraries/tcpdf/include/tcpdf_colors.php deleted file mode 100644 index 77f1c4cc..00000000 --- a/#pma/libraries/tcpdf/include/tcpdf_colors.php +++ /dev/null @@ -1,462 +0,0 @@ -. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : Array of WEB safe colors -// -//============================================================+ - -/** - * @file - * PHP color class for TCPDF - * @author Nicola Asuni - * @package com.tecnick.tcpdf - */ - -/** - * @class TCPDF_COLORS - * PHP color class for TCPDF - * @package com.tecnick.tcpdf - * @version 1.0.004 - * @author Nicola Asuni - info@tecnick.com - */ -class TCPDF_COLORS { - - /** - * Array of WEB safe colors - * @public static - */ - public static $webcolor = array ( - 'aliceblue' => 'f0f8ff', - 'antiquewhite' => 'faebd7', - 'aqua' => '00ffff', - 'aquamarine' => '7fffd4', - 'azure' => 'f0ffff', - 'beige' => 'f5f5dc', - 'bisque' => 'ffe4c4', - 'black' => '000000', - 'blanchedalmond' => 'ffebcd', - 'blue' => '0000ff', - 'blueviolet' => '8a2be2', - 'brown' => 'a52a2a', - 'burlywood' => 'deb887', - 'cadetblue' => '5f9ea0', - 'chartreuse' => '7fff00', - 'chocolate' => 'd2691e', - 'coral' => 'ff7f50', - 'cornflowerblue' => '6495ed', - 'cornsilk' => 'fff8dc', - 'crimson' => 'dc143c', - 'cyan' => '00ffff', - 'darkblue' => '00008b', - 'darkcyan' => '008b8b', - 'darkgoldenrod' => 'b8860b', - 'dkgray' => 'a9a9a9', - 'darkgray' => 'a9a9a9', - 'darkgrey' => 'a9a9a9', - 'darkgreen' => '006400', - 'darkkhaki' => 'bdb76b', - 'darkmagenta' => '8b008b', - 'darkolivegreen' => '556b2f', - 'darkorange' => 'ff8c00', - 'darkorchid' => '9932cc', - 'darkred' => '8b0000', - 'darksalmon' => 'e9967a', - 'darkseagreen' => '8fbc8f', - 'darkslateblue' => '483d8b', - 'darkslategray' => '2f4f4f', - 'darkslategrey' => '2f4f4f', - 'darkturquoise' => '00ced1', - 'darkviolet' => '9400d3', - 'deeppink' => 'ff1493', - 'deepskyblue' => '00bfff', - 'dimgray' => '696969', - 'dimgrey' => '696969', - 'dodgerblue' => '1e90ff', - 'firebrick' => 'b22222', - 'floralwhite' => 'fffaf0', - 'forestgreen' => '228b22', - 'fuchsia' => 'ff00ff', - 'gainsboro' => 'dcdcdc', - 'ghostwhite' => 'f8f8ff', - 'gold' => 'ffd700', - 'goldenrod' => 'daa520', - 'gray' => '808080', - 'grey' => '808080', - 'green' => '008000', - 'greenyellow' => 'adff2f', - 'honeydew' => 'f0fff0', - 'hotpink' => 'ff69b4', - 'indianred' => 'cd5c5c', - 'indigo' => '4b0082', - 'ivory' => 'fffff0', - 'khaki' => 'f0e68c', - 'lavender' => 'e6e6fa', - 'lavenderblush' => 'fff0f5', - 'lawngreen' => '7cfc00', - 'lemonchiffon' => 'fffacd', - 'lightblue' => 'add8e6', - 'lightcoral' => 'f08080', - 'lightcyan' => 'e0ffff', - 'lightgoldenrodyellow' => 'fafad2', - 'ltgray' => 'd3d3d3', - 'lightgray' => 'd3d3d3', - 'lightgrey' => 'd3d3d3', - 'lightgreen' => '90ee90', - 'lightpink' => 'ffb6c1', - 'lightsalmon' => 'ffa07a', - 'lightseagreen' => '20b2aa', - 'lightskyblue' => '87cefa', - 'lightslategray' => '778899', - 'lightslategrey' => '778899', - 'lightsteelblue' => 'b0c4de', - 'lightyellow' => 'ffffe0', - 'lime' => '00ff00', - 'limegreen' => '32cd32', - 'linen' => 'faf0e6', - 'magenta' => 'ff00ff', - 'maroon' => '800000', - 'mediumaquamarine' => '66cdaa', - 'mediumblue' => '0000cd', - 'mediumorchid' => 'ba55d3', - 'mediumpurple' => '9370d8', - 'mediumseagreen' => '3cb371', - 'mediumslateblue' => '7b68ee', - 'mediumspringgreen' => '00fa9a', - 'mediumturquoise' => '48d1cc', - 'mediumvioletred' => 'c71585', - 'midnightblue' => '191970', - 'mintcream' => 'f5fffa', - 'mistyrose' => 'ffe4e1', - 'moccasin' => 'ffe4b5', - 'navajowhite' => 'ffdead', - 'navy' => '000080', - 'oldlace' => 'fdf5e6', - 'olive' => '808000', - 'olivedrab' => '6b8e23', - 'orange' => 'ffa500', - 'orangered' => 'ff4500', - 'orchid' => 'da70d6', - 'palegoldenrod' => 'eee8aa', - 'palegreen' => '98fb98', - 'paleturquoise' => 'afeeee', - 'palevioletred' => 'd87093', - 'papayawhip' => 'ffefd5', - 'peachpuff' => 'ffdab9', - 'peru' => 'cd853f', - 'pink' => 'ffc0cb', - 'plum' => 'dda0dd', - 'powderblue' => 'b0e0e6', - 'purple' => '800080', - 'red' => 'ff0000', - 'rosybrown' => 'bc8f8f', - 'royalblue' => '4169e1', - 'saddlebrown' => '8b4513', - 'salmon' => 'fa8072', - 'sandybrown' => 'f4a460', - 'seagreen' => '2e8b57', - 'seashell' => 'fff5ee', - 'sienna' => 'a0522d', - 'silver' => 'c0c0c0', - 'skyblue' => '87ceeb', - 'slateblue' => '6a5acd', - 'slategray' => '708090', - 'slategrey' => '708090', - 'snow' => 'fffafa', - 'springgreen' => '00ff7f', - 'steelblue' => '4682b4', - 'tan' => 'd2b48c', - 'teal' => '008080', - 'thistle' => 'd8bfd8', - 'tomato' => 'ff6347', - 'turquoise' => '40e0d0', - 'violet' => 'ee82ee', - 'wheat' => 'f5deb3', - 'white' => 'ffffff', - 'whitesmoke' => 'f5f5f5', - 'yellow' => 'ffff00', - 'yellowgreen' => '9acd32' - ); // end of web colors - - /** - * Array of valid JavaScript color names - * @public static - */ - public static $jscolor = array ('transparent', 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'dkGray', 'gray', 'ltGray'); - - /** - * Array of Spot colors (C,M,Y,K,name) - * Color keys must be in lowercase and without spaces. - * As long as no open standard for spot colours exists, you have to buy a colour book by one of the colour manufacturers and insert the values and names of spot colours directly. - * Common industry standard spot colors are: ANPA-COLOR, DIC, FOCOLTONE, GCMI, HKS, PANTONE, TOYO, TRUMATCH. - * @public static - */ - public static $spotcolor = array ( - // special registration colors - 'none' => array( 0, 0, 0, 0, 'None'), - 'all' => array(100, 100, 100, 100, 'All'), - // standard CMYK colors - 'cyan' => array(100, 0, 0, 0, 'Cyan'), - 'magenta' => array( 0, 100, 0, 0, 'Magenta'), - 'yellow' => array( 0, 0, 100, 0, 'Yellow'), - 'key' => array( 0, 0, 0, 100, 'Key'), - // alias - 'white' => array( 0, 0, 0, 0, 'White'), - 'black' => array( 0, 0, 0, 100, 'Black'), - // standard RGB colors - 'red' => array( 0, 100, 100, 0, 'Red'), - 'green' => array(100, 0, 100, 0, 'Green'), - 'blue' => array(100, 100, 0, 0, 'Blue'), - // Add here standard spot colors or dynamically define them with AddSpotColor() - // ... - ); // end of spot colors - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * Return the Spot color array. - * @param $name (string) Name of the spot color. - * @param $spotc (array) Reference to an array of spot colors. - * @return (array) Spot color array or false if not defined. - * @since 5.9.125 (2011-10-03) - * @public static - */ - public static function getSpotColor($name, &$spotc) { - if (isset($spotc[$name])) { - return $spotc[$name]; - } - $color = preg_replace('/[\s]*/', '', $name); // remove extra spaces - $color = strtolower($color); - if (isset(self::$spotcolor[$color])) { - if (!isset($spotc[$name])) { - $i = (1 + count($spotc)); - $spotc[$name] = array('C' => self::$spotcolor[$color][0], 'M' => self::$spotcolor[$color][1], 'Y' => self::$spotcolor[$color][2], 'K' => self::$spotcolor[$color][3], 'name' => self::$spotcolor[$color][4], 'i' => $i); - } - return $spotc[self::$spotcolor[$color][4]]; - } - return false; - } - - /** - * Returns an array (RGB or CMYK) from an html color name, or a six-digit (i.e. #3FE5AA), or three-digit (i.e. #7FF) hexadecimal color, or a javascript color array, or javascript color name. - * @param $hcolor (string) HTML color. - * @param $spotc (array) Reference to an array of spot colors. - * @param $defcol (array) Color to return in case of error. - * @return array RGB or CMYK color, or false in case of error. - * @public static - */ - public static function convertHTMLColorToDec($hcolor, &$spotc, $defcol=array('R'=>128,'G'=>128,'B'=>128)) { - $color = preg_replace('/[\s]*/', '', $hcolor); // remove extra spaces - $color = strtolower($color); - // check for javascript color array syntax - if (strpos($color, '[') !== false) { - if (preg_match('/[\[][\"\'](t|g|rgb|cmyk)[\"\'][\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\]]/', $color, $m) > 0) { - $returncolor = array(); - switch ($m[1]) { - case 'cmyk': { - // RGB - $returncolor['C'] = max(0, min(100, (floatval($m[2]) * 100))); - $returncolor['M'] = max(0, min(100, (floatval($m[3]) * 100))); - $returncolor['Y'] = max(0, min(100, (floatval($m[4]) * 100))); - $returncolor['K'] = max(0, min(100, (floatval($m[5]) * 100))); - break; - } - case 'rgb': { - // RGB - $returncolor['R'] = max(0, min(255, (floatval($m[2]) * 255))); - $returncolor['G'] = max(0, min(255, (floatval($m[3]) * 255))); - $returncolor['B'] = max(0, min(255, (floatval($m[4]) * 255))); - break; - } - case 'g': { - // grayscale - $returncolor['G'] = max(0, min(255, (floatval($m[2]) * 255))); - break; - } - case 't': - default: { - // transparent (empty array) - break; - } - } - return $returncolor; - } - } elseif ((substr($color, 0, 4) != 'cmyk') AND (substr($color, 0, 3) != 'rgb') AND (($dotpos = strpos($color, '.')) !== false)) { - // remove class parent (i.e.: color.red) - $color = substr($color, ($dotpos + 1)); - if ($color == 'transparent') { - // transparent (empty array) - return array(); - } - } - if (strlen($color) == 0) { - return $defcol; - } - // RGB ARRAY - if (substr($color, 0, 3) == 'rgb') { - $codes = substr($color, 4); - $codes = str_replace(')', '', $codes); - $returncolor = explode(',', $codes); - foreach ($returncolor as $key => $val) { - if (strpos($val, '%') > 0) { - // percentage - $returncolor[$key] = (255 * intval($val) / 100); - } else { - $returncolor[$key] = intval($val); - } - // normalize value - $returncolor[$key] = max(0, min(255, $returncolor[$key])); - } - return $returncolor; - } - // CMYK ARRAY - if (substr($color, 0, 4) == 'cmyk') { - $codes = substr($color, 5); - $codes = str_replace(')', '', $codes); - $returncolor = explode(',', $codes); - foreach ($returncolor as $key => $val) { - if (strpos($val, '%') !== false) { - // percentage - $returncolor[$key] = (100 * intval($val) / 100); - } else { - $returncolor[$key] = intval($val); - } - // normalize value - $returncolor[$key] = max(0, min(100, $returncolor[$key])); - } - return $returncolor; - } - if ($color[0] != '#') { - // COLOR NAME - if (isset(self::$webcolor[$color])) { - // web color - $color_code = self::$webcolor[$color]; - } else { - // spot color - $returncolor = self::getSpotColor($color, $spotc); - if ($returncolor === false) { - $returncolor = $defcol; - } - return $returncolor; - } - } else { - $color_code = substr($color, 1); - } - // HEXADECIMAL REPRESENTATION - switch (strlen($color_code)) { - case 3: { - // 3-digit RGB hexadecimal representation - $r = substr($color_code, 0, 1); - $g = substr($color_code, 1, 1); - $b = substr($color_code, 2, 1); - $returncolor = array(); - $returncolor['R'] = max(0, min(255, hexdec($r.$r))); - $returncolor['G'] = max(0, min(255, hexdec($g.$g))); - $returncolor['B'] = max(0, min(255, hexdec($b.$b))); - break; - } - case 6: { - // 6-digit RGB hexadecimal representation - $returncolor = array(); - $returncolor['R'] = max(0, min(255, hexdec(substr($color_code, 0, 2)))); - $returncolor['G'] = max(0, min(255, hexdec(substr($color_code, 2, 2)))); - $returncolor['B'] = max(0, min(255, hexdec(substr($color_code, 4, 2)))); - break; - } - case 8: { - // 8-digit CMYK hexadecimal representation - $returncolor = array(); - $returncolor['C'] = max(0, min(100, round(hexdec(substr($color_code, 0, 2)) / 2.55))); - $returncolor['M'] = max(0, min(100, round(hexdec(substr($color_code, 2, 2)) / 2.55))); - $returncolor['Y'] = max(0, min(100, round(hexdec(substr($color_code, 4, 2)) / 2.55))); - $returncolor['K'] = max(0, min(100, round(hexdec(substr($color_code, 6, 2)) / 2.55))); - break; - } - default: { - $returncolor = $defcol; - break; - } - } - return $returncolor; - } - - /** - * Convert a color array into a string representation. - * @param $c (array) Array of colors. - * @return (string) The color array representation. - * @since 5.9.137 (2011-12-01) - * @public static - */ - public static function getColorStringFromArray($c) { - $c = array_values($c); - $color = '['; - switch (count($c)) { - case 4: { - // CMYK - $color .= sprintf('%F %F %F %F', (max(0, min(100, floatval($c[0]))) / 100), (max(0, min(100, floatval($c[1]))) / 100), (max(0, min(100, floatval($c[2]))) / 100), (max(0, min(100, floatval($c[3]))) / 100)); - break; - } - case 3: { - // RGB - $color .= sprintf('%F %F %F', (max(0, min(255, floatval($c[0]))) / 255), (max(0, min(255, floatval($c[1]))) / 255), (max(0, min(255, floatval($c[2]))) / 255)); - break; - } - case 1: { - // grayscale - $color .= sprintf('%F', (max(0, min(255, floatval($c[0]))) / 255)); - break; - } - } - $color .= ']'; - return $color; - } - - /** - * Convert color to javascript color. - * @param $color (string) color name or "#RRGGBB" - * @protected - * @since 2.1.002 (2008-02-12) - * @public static - */ - public static function _JScolor($color) { - if (substr($color, 0, 1) == '#') { - return sprintf("['RGB',%F,%F,%F]", (hexdec(substr($color, 1, 2)) / 255), (hexdec(substr($color, 3, 2)) / 255), (hexdec(substr($color, 5, 2)) / 255)); - } - if (!in_array($color, self::$jscolor)) { - // default transparent color - $color = $jscolor[0]; - } - return 'color.'.$color; - } - - -} // END OF TCPDF_COLORS CLASS - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/#pma/libraries/tcpdf/include/tcpdf_font_data.php b/#pma/libraries/tcpdf/include/tcpdf_font_data.php deleted file mode 100644 index 974e72ec..00000000 --- a/#pma/libraries/tcpdf/include/tcpdf_font_data.php +++ /dev/null @@ -1,18447 +0,0 @@ -. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : Unicode data and encoding maps for TCPDF. -// -//============================================================+ - -/** - * @file - * Unicode data and encoding maps for TCPDF. - * @author Nicola Asuni - * @package com.tecnick.tcpdf - */ - -/** - * @class TCPDF_FONT_DATA - * Unicode data and encoding maps for TCPDF. - * @package com.tecnick.tcpdf - * @version 1.0.001 - * @author Nicola Asuni - info@tecnick.com - */ -class TCPDF_FONT_DATA { - -/** - * Unicode code for Left-to-Right Mark. - * @public - */ -public static $uni_LRM = 8206; - -/** - * Unicode code for Right-to-Left Mark. - * @public - */ -public static $uni_RLM = 8207; - -/** - * Unicode code for Left-to-Right Embedding. - * @public - */ -public static $uni_LRE = 8234; - -/** - * Unicode code for Right-to-Left Embedding. - * @public - */ -public static $uni_RLE = 8235; - -/** - * Unicode code for Pop Directional Format. - * @public - */ -public static $uni_PDF = 8236; - -/** - * Unicode code for Left-to-Right Override. - * @public - */ -public static $uni_LRO = 8237; - -/** - * Unicode code for Right-to-Left Override. - * @public - */ -public static $uni_RLO = 8238; - -/** - * Pattern to test RTL (Righ-To-Left) strings using regular expressions. - * @public - */ -public static $uni_RE_PATTERN_RTL = "/( - \xD6\xBE # R - | \xD7[\x80\x83\x86\x90-\xAA\xB0-\xB4] # R - | \xDF[\x80-\xAA\xB4\xB5\xBA] # R - | \xE2\x80\x8F # R - | \xEF\xAC[\x9D\x9F\xA0-\xA8\xAA-\xB6\xB8-\xBC\xBE] # R - | \xEF\xAD[\x80\x81\x83\x84\x86-\x8F] # R - | \xF0\x90\xA0[\x80-\x85\x88\x8A-\xB5\xB7\xB8\xBC\xBF] # R - | \xF0\x90\xA4[\x80-\x99] # R - | \xF0\x90\xA8[\x80\x90-\x93\x95-\x97\x99-\xB3] # R - | \xF0\x90\xA9[\x80-\x87\x90-\x98] # R - | \xE2\x80[\xAB\xAE] # RLE & RLO - )/x"; - -/** - * Pattern to test Arabic strings using regular expressions. Source: http://www.w3.org/International/questions/qa-forms-utf-8 - * @public - */ -public static $uni_RE_PATTERN_ARABIC = "/( - \xD8[\x80-\x83\x8B\x8D\x9B\x9E\x9F\xA1-\xBA] # AL - | \xD9[\x80-\x8A\xAD-\xAF\xB1-\xBF] # AL - | \xDA[\x80-\xBF] # AL - | \xDB[\x80-\x95\x9D\xA5\xA6\xAE\xAF\xBA-\xBF] # AL - | \xDC[\x80-\x8D\x90\x92-\xAF] # AL - | \xDD[\x8D-\xAD] # AL - | \xDE[\x80-\xA5\xB1] # AL - | \xEF\xAD[\x90-\xBF] # AL - | \xEF\xAE[\x80-\xB1] # AL - | \xEF\xAF[\x93-\xBF] # AL - | \xEF[\xB0-\xB3][\x80-\xBF] # AL - | \xEF\xB4[\x80-\xBD] # AL - | \xEF\xB5[\x90-\xBF] # AL - | \xEF\xB6[\x80-\x8F\x92-\xBF] # AL - | \xEF\xB7[\x80-\x87\xB0-\xBC] # AL - | \xEF\xB9[\xB0-\xB4\xB6-\xBF] # AL - | \xEF\xBA[\x80-\xBF] # AL - | \xEF\xBB[\x80-\xBC] # AL - | \xD9[\xA0-\xA9\xAB\xAC] # AN - )/x"; - -/** - * Array of Unicode types. - * @public - */ -public static $uni_type = array( -0=>'BN', -1=>'BN', -2=>'BN', -3=>'BN', -4=>'BN', -5=>'BN', -6=>'BN', -7=>'BN', -8=>'BN', -9=>'S', -10=>'B', -11=>'S', -12=>'WS', -13=>'B', -14=>'BN', -15=>'BN', -16=>'BN', -17=>'BN', -18=>'BN', -19=>'BN', -20=>'BN', -21=>'BN', -22=>'BN', -23=>'BN', -24=>'BN', -25=>'BN', -26=>'BN', -27=>'BN', -28=>'B', -29=>'B', -30=>'B', -31=>'S', -32=>'WS', -33=>'ON', -34=>'ON', -35=>'ET', -36=>'ET', -37=>'ET', -38=>'ON', -39=>'ON', -40=>'ON', -41=>'ON', -42=>'ON', -43=>'ES', -44=>'CS', -45=>'ES', -46=>'CS', -47=>'CS', -48=>'EN', -49=>'EN', -50=>'EN', -51=>'EN', -52=>'EN', -53=>'EN', -54=>'EN', -55=>'EN', -56=>'EN', -57=>'EN', -58=>'CS', -59=>'ON', -60=>'ON', -61=>'ON', -62=>'ON', -63=>'ON', -64=>'ON', -65=>'L', -66=>'L', -67=>'L', -68=>'L', -69=>'L', -70=>'L', -71=>'L', -72=>'L', -73=>'L', -74=>'L', -75=>'L', -76=>'L', -77=>'L', -78=>'L', -79=>'L', -80=>'L', -81=>'L', -82=>'L', -83=>'L', -84=>'L', -85=>'L', -86=>'L', -87=>'L', -88=>'L', -89=>'L', -90=>'L', -91=>'ON', -92=>'ON', -93=>'ON', -94=>'ON', -95=>'ON', -96=>'ON', -97=>'L', -98=>'L', -99=>'L', -100=>'L', -101=>'L', -102=>'L', -103=>'L', -104=>'L', -105=>'L', -106=>'L', -107=>'L', -108=>'L', -109=>'L', -110=>'L', -111=>'L', -112=>'L', -113=>'L', -114=>'L', -115=>'L', -116=>'L', -117=>'L', -118=>'L', -119=>'L', -120=>'L', -121=>'L', -122=>'L', -123=>'ON', -124=>'ON', -125=>'ON', -126=>'ON', -127=>'BN', -128=>'BN', -129=>'BN', -130=>'BN', -131=>'BN', -132=>'BN', -133=>'B', -134=>'BN', -135=>'BN', -136=>'BN', -137=>'BN', -138=>'BN', -139=>'BN', -140=>'BN', -141=>'BN', -142=>'BN', -143=>'BN', -144=>'BN', -145=>'BN', -146=>'BN', -147=>'BN', -148=>'BN', -149=>'BN', -150=>'BN', -151=>'BN', -152=>'BN', -153=>'BN', -154=>'BN', -155=>'BN', -156=>'BN', -157=>'BN', -158=>'BN', -159=>'BN', -160=>'CS', -161=>'ON', -162=>'ET', -163=>'ET', -164=>'ET', -165=>'ET', -166=>'ON', -167=>'ON', -168=>'ON', -169=>'ON', -170=>'L', -171=>'ON', -172=>'ON', -173=>'BN', -174=>'ON', -175=>'ON', -176=>'ET', -177=>'ET', -178=>'EN', -179=>'EN', -180=>'ON', -181=>'L', -182=>'ON', -183=>'ON', -184=>'ON', -185=>'EN', -186=>'L', -187=>'ON', -188=>'ON', -189=>'ON', -190=>'ON', -191=>'ON', -192=>'L', -193=>'L', -194=>'L', -195=>'L', -196=>'L', -197=>'L', -198=>'L', -199=>'L', -200=>'L', -201=>'L', -202=>'L', -203=>'L', -204=>'L', -205=>'L', -206=>'L', -207=>'L', -208=>'L', -209=>'L', -210=>'L', -211=>'L', -212=>'L', -213=>'L', -214=>'L', -215=>'ON', -216=>'L', -217=>'L', -218=>'L', -219=>'L', -220=>'L', -221=>'L', -222=>'L', -223=>'L', -224=>'L', -225=>'L', -226=>'L', -227=>'L', -228=>'L', -229=>'L', -230=>'L', -231=>'L', -232=>'L', -233=>'L', -234=>'L', -235=>'L', -236=>'L', -237=>'L', -238=>'L', -239=>'L', -240=>'L', -241=>'L', -242=>'L', -243=>'L', -244=>'L', -245=>'L', -246=>'L', -247=>'ON', -248=>'L', -249=>'L', -250=>'L', -251=>'L', -252=>'L', -253=>'L', -254=>'L', -255=>'L', -256=>'L', -257=>'L', -258=>'L', -259=>'L', -260=>'L', -261=>'L', -262=>'L', -263=>'L', -264=>'L', -265=>'L', -266=>'L', -267=>'L', -268=>'L', -269=>'L', -270=>'L', -271=>'L', -272=>'L', -273=>'L', -274=>'L', -275=>'L', -276=>'L', -277=>'L', -278=>'L', -279=>'L', -280=>'L', -281=>'L', -282=>'L', -283=>'L', -284=>'L', -285=>'L', -286=>'L', -287=>'L', -288=>'L', -289=>'L', -290=>'L', -291=>'L', -292=>'L', -293=>'L', -294=>'L', -295=>'L', -296=>'L', -297=>'L', -298=>'L', -299=>'L', -300=>'L', -301=>'L', -302=>'L', -303=>'L', -304=>'L', -305=>'L', -306=>'L', -307=>'L', -308=>'L', -309=>'L', -310=>'L', -311=>'L', -312=>'L', -313=>'L', -314=>'L', -315=>'L', -316=>'L', -317=>'L', -318=>'L', -319=>'L', -320=>'L', -321=>'L', -322=>'L', -323=>'L', -324=>'L', -325=>'L', -326=>'L', -327=>'L', -328=>'L', -329=>'L', -330=>'L', -331=>'L', -332=>'L', -333=>'L', -334=>'L', -335=>'L', -336=>'L', -337=>'L', -338=>'L', -339=>'L', -340=>'L', -341=>'L', -342=>'L', -343=>'L', -344=>'L', -345=>'L', -346=>'L', -347=>'L', -348=>'L', -349=>'L', -350=>'L', -351=>'L', -352=>'L', -353=>'L', -354=>'L', -355=>'L', -356=>'L', -357=>'L', -358=>'L', -359=>'L', -360=>'L', -361=>'L', -362=>'L', -363=>'L', -364=>'L', -365=>'L', -366=>'L', -367=>'L', -368=>'L', -369=>'L', -370=>'L', -371=>'L', -372=>'L', -373=>'L', -374=>'L', -375=>'L', -376=>'L', -377=>'L', -378=>'L', -379=>'L', -380=>'L', -381=>'L', -382=>'L', -383=>'L', -384=>'L', -385=>'L', -386=>'L', -387=>'L', -388=>'L', -389=>'L', -390=>'L', -391=>'L', -392=>'L', -393=>'L', -394=>'L', -395=>'L', -396=>'L', -397=>'L', -398=>'L', -399=>'L', -400=>'L', -401=>'L', -402=>'L', -403=>'L', -404=>'L', -405=>'L', -406=>'L', -407=>'L', -408=>'L', -409=>'L', -410=>'L', -411=>'L', -412=>'L', -413=>'L', -414=>'L', -415=>'L', -416=>'L', -417=>'L', -418=>'L', -419=>'L', -420=>'L', -421=>'L', -422=>'L', -423=>'L', -424=>'L', -425=>'L', -426=>'L', -427=>'L', -428=>'L', -429=>'L', -430=>'L', -431=>'L', -432=>'L', -433=>'L', -434=>'L', -435=>'L', -436=>'L', -437=>'L', -438=>'L', -439=>'L', -440=>'L', -441=>'L', -442=>'L', -443=>'L', -444=>'L', -445=>'L', -446=>'L', -447=>'L', -448=>'L', -449=>'L', -450=>'L', -451=>'L', -452=>'L', -453=>'L', -454=>'L', -455=>'L', -456=>'L', -457=>'L', -458=>'L', -459=>'L', -460=>'L', -461=>'L', -462=>'L', -463=>'L', -464=>'L', -465=>'L', -466=>'L', -467=>'L', -468=>'L', -469=>'L', -470=>'L', -471=>'L', -472=>'L', -473=>'L', -474=>'L', -475=>'L', -476=>'L', -477=>'L', -478=>'L', -479=>'L', -480=>'L', -481=>'L', -482=>'L', -483=>'L', -484=>'L', -485=>'L', -486=>'L', -487=>'L', -488=>'L', -489=>'L', -490=>'L', -491=>'L', -492=>'L', -493=>'L', -494=>'L', -495=>'L', -496=>'L', -497=>'L', -498=>'L', -499=>'L', -500=>'L', -501=>'L', -502=>'L', -503=>'L', -504=>'L', -505=>'L', -506=>'L', -507=>'L', -508=>'L', -509=>'L', -510=>'L', -511=>'L', -512=>'L', -513=>'L', -514=>'L', -515=>'L', -516=>'L', -517=>'L', -518=>'L', -519=>'L', -520=>'L', -521=>'L', -522=>'L', -523=>'L', -524=>'L', -525=>'L', -526=>'L', -527=>'L', -528=>'L', -529=>'L', -530=>'L', -531=>'L', -532=>'L', -533=>'L', -534=>'L', -535=>'L', -536=>'L', -537=>'L', -538=>'L', -539=>'L', -540=>'L', -541=>'L', -542=>'L', -543=>'L', -544=>'L', -545=>'L', -546=>'L', -547=>'L', -548=>'L', -549=>'L', -550=>'L', -551=>'L', -552=>'L', -553=>'L', -554=>'L', -555=>'L', -556=>'L', -557=>'L', -558=>'L', -559=>'L', -560=>'L', -561=>'L', -562=>'L', -563=>'L', -564=>'L', -565=>'L', -566=>'L', -567=>'L', -568=>'L', -569=>'L', -570=>'L', -571=>'L', -572=>'L', -573=>'L', -574=>'L', -575=>'L', -576=>'L', -577=>'L', -578=>'L', -579=>'L', -580=>'L', -581=>'L', -582=>'L', -583=>'L', -584=>'L', -585=>'L', -586=>'L', -587=>'L', -588=>'L', -589=>'L', -590=>'L', -591=>'L', -592=>'L', -593=>'L', -594=>'L', -595=>'L', -596=>'L', -597=>'L', -598=>'L', -599=>'L', -600=>'L', -601=>'L', -602=>'L', -603=>'L', -604=>'L', -605=>'L', -606=>'L', -607=>'L', -608=>'L', -609=>'L', -610=>'L', -611=>'L', -612=>'L', -613=>'L', -614=>'L', -615=>'L', -616=>'L', -617=>'L', -618=>'L', -619=>'L', -620=>'L', -621=>'L', -622=>'L', -623=>'L', -624=>'L', -625=>'L', -626=>'L', -627=>'L', -628=>'L', -629=>'L', -630=>'L', -631=>'L', -632=>'L', -633=>'L', -634=>'L', -635=>'L', -636=>'L', -637=>'L', -638=>'L', -639=>'L', -640=>'L', -641=>'L', -642=>'L', -643=>'L', -644=>'L', -645=>'L', -646=>'L', -647=>'L', -648=>'L', -649=>'L', -650=>'L', -651=>'L', -652=>'L', -653=>'L', -654=>'L', -655=>'L', -656=>'L', -657=>'L', -658=>'L', -659=>'L', -660=>'L', -661=>'L', -662=>'L', -663=>'L', -664=>'L', -665=>'L', -666=>'L', -667=>'L', -668=>'L', -669=>'L', -670=>'L', -671=>'L', -672=>'L', -673=>'L', -674=>'L', -675=>'L', -676=>'L', -677=>'L', -678=>'L', -679=>'L', -680=>'L', -681=>'L', -682=>'L', -683=>'L', -684=>'L', -685=>'L', -686=>'L', -687=>'L', -688=>'L', -689=>'L', -690=>'L', -691=>'L', -692=>'L', -693=>'L', -694=>'L', -695=>'L', -696=>'L', -697=>'ON', -698=>'ON', -699=>'L', -700=>'L', -701=>'L', -702=>'L', -703=>'L', -704=>'L', -705=>'L', -706=>'ON', -707=>'ON', -708=>'ON', -709=>'ON', -710=>'ON', -711=>'ON', -712=>'ON', -713=>'ON', -714=>'ON', -715=>'ON', -716=>'ON', -717=>'ON', -718=>'ON', -719=>'ON', -720=>'L', -721=>'L', -722=>'ON', -723=>'ON', -724=>'ON', -725=>'ON', -726=>'ON', -727=>'ON', -728=>'ON', -729=>'ON', -730=>'ON', -731=>'ON', -732=>'ON', -733=>'ON', -734=>'ON', -735=>'ON', -736=>'L', -737=>'L', -738=>'L', -739=>'L', -740=>'L', -741=>'ON', -742=>'ON', -743=>'ON', -744=>'ON', -745=>'ON', -746=>'ON', -747=>'ON', -748=>'ON', -749=>'ON', -750=>'L', -751=>'ON', -752=>'ON', -753=>'ON', -754=>'ON', -755=>'ON', -756=>'ON', -757=>'ON', -758=>'ON', -759=>'ON', -760=>'ON', -761=>'ON', -762=>'ON', -763=>'ON', -764=>'ON', -765=>'ON', -766=>'ON', -767=>'ON', -768=>'NSM', -769=>'NSM', -770=>'NSM', -771=>'NSM', -772=>'NSM', -773=>'NSM', -774=>'NSM', -775=>'NSM', -776=>'NSM', -777=>'NSM', -778=>'NSM', -779=>'NSM', -780=>'NSM', -781=>'NSM', -782=>'NSM', -783=>'NSM', -784=>'NSM', -785=>'NSM', -786=>'NSM', -787=>'NSM', -788=>'NSM', -789=>'NSM', -790=>'NSM', -791=>'NSM', -792=>'NSM', -793=>'NSM', -794=>'NSM', -795=>'NSM', -796=>'NSM', -797=>'NSM', -798=>'NSM', -799=>'NSM', -800=>'NSM', -801=>'NSM', -802=>'NSM', -803=>'NSM', -804=>'NSM', -805=>'NSM', -806=>'NSM', -807=>'NSM', -808=>'NSM', -809=>'NSM', -810=>'NSM', -811=>'NSM', -812=>'NSM', -813=>'NSM', -814=>'NSM', -815=>'NSM', -816=>'NSM', -817=>'NSM', -818=>'NSM', -819=>'NSM', -820=>'NSM', -821=>'NSM', -822=>'NSM', -823=>'NSM', -824=>'NSM', -825=>'NSM', -826=>'NSM', -827=>'NSM', -828=>'NSM', -829=>'NSM', -830=>'NSM', -831=>'NSM', -832=>'NSM', -833=>'NSM', -834=>'NSM', -835=>'NSM', -836=>'NSM', -837=>'NSM', -838=>'NSM', -839=>'NSM', -840=>'NSM', -841=>'NSM', -842=>'NSM', -843=>'NSM', -844=>'NSM', -845=>'NSM', -846=>'NSM', -847=>'NSM', -848=>'NSM', -849=>'NSM', -850=>'NSM', -851=>'NSM', -852=>'NSM', -853=>'NSM', -854=>'NSM', -855=>'NSM', -856=>'NSM', -857=>'NSM', -858=>'NSM', -859=>'NSM', -860=>'NSM', -861=>'NSM', -862=>'NSM', -863=>'NSM', -864=>'NSM', -865=>'NSM', -866=>'NSM', -867=>'NSM', -868=>'NSM', -869=>'NSM', -870=>'NSM', -871=>'NSM', -872=>'NSM', -873=>'NSM', -874=>'NSM', -875=>'NSM', -876=>'NSM', -877=>'NSM', -878=>'NSM', -879=>'NSM', -884=>'ON', -885=>'ON', -890=>'L', -891=>'L', -892=>'L', -893=>'L', -894=>'ON', -900=>'ON', -901=>'ON', -902=>'L', -903=>'ON', -904=>'L', -905=>'L', -906=>'L', -908=>'L', -910=>'L', -911=>'L', -912=>'L', -913=>'L', -914=>'L', -915=>'L', -916=>'L', -917=>'L', -918=>'L', -919=>'L', -920=>'L', -921=>'L', -922=>'L', -923=>'L', -924=>'L', -925=>'L', -926=>'L', -927=>'L', -928=>'L', -929=>'L', -931=>'L', -932=>'L', -933=>'L', -934=>'L', -935=>'L', -936=>'L', -937=>'L', -938=>'L', -939=>'L', -940=>'L', -941=>'L', -942=>'L', -943=>'L', -944=>'L', -945=>'L', -946=>'L', -947=>'L', -948=>'L', -949=>'L', -950=>'L', -951=>'L', -952=>'L', -953=>'L', -954=>'L', -955=>'L', -956=>'L', -957=>'L', -958=>'L', -959=>'L', -960=>'L', -961=>'L', -962=>'L', -963=>'L', -964=>'L', -965=>'L', -966=>'L', -967=>'L', -968=>'L', -969=>'L', -970=>'L', -971=>'L', -972=>'L', -973=>'L', -974=>'L', -976=>'L', -977=>'L', -978=>'L', -979=>'L', -980=>'L', -981=>'L', -982=>'L', -983=>'L', -984=>'L', -985=>'L', -986=>'L', -987=>'L', -988=>'L', -989=>'L', -990=>'L', -991=>'L', -992=>'L', -993=>'L', -994=>'L', -995=>'L', -996=>'L', -997=>'L', -998=>'L', -999=>'L', -1000=>'L', -1001=>'L', -1002=>'L', -1003=>'L', -1004=>'L', -1005=>'L', -1006=>'L', -1007=>'L', -1008=>'L', -1009=>'L', -1010=>'L', -1011=>'L', -1012=>'L', -1013=>'L', -1014=>'ON', -1015=>'L', -1016=>'L', -1017=>'L', -1018=>'L', -1019=>'L', -1020=>'L', -1021=>'L', -1022=>'L', -1023=>'L', -1024=>'L', -1025=>'L', -1026=>'L', -1027=>'L', -1028=>'L', -1029=>'L', -1030=>'L', -1031=>'L', -1032=>'L', -1033=>'L', -1034=>'L', -1035=>'L', -1036=>'L', -1037=>'L', -1038=>'L', -1039=>'L', -1040=>'L', -1041=>'L', -1042=>'L', -1043=>'L', -1044=>'L', -1045=>'L', -1046=>'L', -1047=>'L', -1048=>'L', -1049=>'L', -1050=>'L', -1051=>'L', -1052=>'L', -1053=>'L', -1054=>'L', -1055=>'L', -1056=>'L', -1057=>'L', -1058=>'L', -1059=>'L', -1060=>'L', -1061=>'L', -1062=>'L', -1063=>'L', -1064=>'L', -1065=>'L', -1066=>'L', -1067=>'L', -1068=>'L', -1069=>'L', -1070=>'L', -1071=>'L', -1072=>'L', -1073=>'L', -1074=>'L', -1075=>'L', -1076=>'L', -1077=>'L', -1078=>'L', -1079=>'L', -1080=>'L', -1081=>'L', -1082=>'L', -1083=>'L', -1084=>'L', -1085=>'L', -1086=>'L', -1087=>'L', -1088=>'L', -1089=>'L', -1090=>'L', -1091=>'L', -1092=>'L', -1093=>'L', -1094=>'L', -1095=>'L', -1096=>'L', -1097=>'L', -1098=>'L', -1099=>'L', -1100=>'L', -1101=>'L', -1102=>'L', -1103=>'L', -1104=>'L', -1105=>'L', -1106=>'L', -1107=>'L', -1108=>'L', -1109=>'L', -1110=>'L', -1111=>'L', -1112=>'L', -1113=>'L', -1114=>'L', -1115=>'L', -1116=>'L', -1117=>'L', -1118=>'L', -1119=>'L', -1120=>'L', -1121=>'L', -1122=>'L', -1123=>'L', -1124=>'L', -1125=>'L', -1126=>'L', -1127=>'L', -1128=>'L', -1129=>'L', -1130=>'L', -1131=>'L', -1132=>'L', -1133=>'L', -1134=>'L', -1135=>'L', -1136=>'L', -1137=>'L', -1138=>'L', -1139=>'L', -1140=>'L', -1141=>'L', -1142=>'L', -1143=>'L', -1144=>'L', -1145=>'L', -1146=>'L', -1147=>'L', -1148=>'L', -1149=>'L', -1150=>'L', -1151=>'L', -1152=>'L', -1153=>'L', -1154=>'L', -1155=>'NSM', -1156=>'NSM', -1157=>'NSM', -1158=>'NSM', -1160=>'NSM', -1161=>'NSM', -1162=>'L', -1163=>'L', -1164=>'L', -1165=>'L', -1166=>'L', -1167=>'L', -1168=>'L', -1169=>'L', -1170=>'L', -1171=>'L', -1172=>'L', -1173=>'L', -1174=>'L', -1175=>'L', -1176=>'L', -1177=>'L', -1178=>'L', -1179=>'L', -1180=>'L', -1181=>'L', -1182=>'L', -1183=>'L', -1184=>'L', -1185=>'L', -1186=>'L', -1187=>'L', -1188=>'L', -1189=>'L', -1190=>'L', -1191=>'L', -1192=>'L', -1193=>'L', -1194=>'L', -1195=>'L', -1196=>'L', -1197=>'L', -1198=>'L', -1199=>'L', -1200=>'L', -1201=>'L', -1202=>'L', -1203=>'L', -1204=>'L', -1205=>'L', -1206=>'L', -1207=>'L', -1208=>'L', -1209=>'L', -1210=>'L', -1211=>'L', -1212=>'L', -1213=>'L', -1214=>'L', -1215=>'L', -1216=>'L', -1217=>'L', -1218=>'L', -1219=>'L', -1220=>'L', -1221=>'L', -1222=>'L', -1223=>'L', -1224=>'L', -1225=>'L', -1226=>'L', -1227=>'L', -1228=>'L', -1229=>'L', -1230=>'L', -1231=>'L', -1232=>'L', -1233=>'L', -1234=>'L', -1235=>'L', -1236=>'L', -1237=>'L', -1238=>'L', -1239=>'L', -1240=>'L', -1241=>'L', -1242=>'L', -1243=>'L', -1244=>'L', -1245=>'L', -1246=>'L', -1247=>'L', -1248=>'L', -1249=>'L', -1250=>'L', -1251=>'L', -1252=>'L', -1253=>'L', -1254=>'L', -1255=>'L', -1256=>'L', -1257=>'L', -1258=>'L', -1259=>'L', -1260=>'L', -1261=>'L', -1262=>'L', -1263=>'L', -1264=>'L', -1265=>'L', -1266=>'L', -1267=>'L', -1268=>'L', -1269=>'L', -1270=>'L', -1271=>'L', -1272=>'L', -1273=>'L', -1274=>'L', -1275=>'L', -1276=>'L', -1277=>'L', -1278=>'L', -1279=>'L', -1280=>'L', -1281=>'L', -1282=>'L', -1283=>'L', -1284=>'L', -1285=>'L', -1286=>'L', -1287=>'L', -1288=>'L', -1289=>'L', -1290=>'L', -1291=>'L', -1292=>'L', -1293=>'L', -1294=>'L', -1295=>'L', -1296=>'L', -1297=>'L', -1298=>'L', -1299=>'L', -1329=>'L', -1330=>'L', -1331=>'L', -1332=>'L', -1333=>'L', -1334=>'L', -1335=>'L', -1336=>'L', -1337=>'L', -1338=>'L', -1339=>'L', -1340=>'L', -1341=>'L', -1342=>'L', -1343=>'L', -1344=>'L', -1345=>'L', -1346=>'L', -1347=>'L', -1348=>'L', -1349=>'L', -1350=>'L', -1351=>'L', -1352=>'L', -1353=>'L', -1354=>'L', -1355=>'L', -1356=>'L', -1357=>'L', -1358=>'L', -1359=>'L', -1360=>'L', -1361=>'L', -1362=>'L', -1363=>'L', -1364=>'L', -1365=>'L', -1366=>'L', -1369=>'L', -1370=>'L', -1371=>'L', -1372=>'L', -1373=>'L', -1374=>'L', -1375=>'L', -1377=>'L', -1378=>'L', -1379=>'L', -1380=>'L', -1381=>'L', -1382=>'L', -1383=>'L', -1384=>'L', -1385=>'L', -1386=>'L', -1387=>'L', -1388=>'L', -1389=>'L', -1390=>'L', -1391=>'L', -1392=>'L', -1393=>'L', -1394=>'L', -1395=>'L', -1396=>'L', -1397=>'L', -1398=>'L', -1399=>'L', -1400=>'L', -1401=>'L', -1402=>'L', -1403=>'L', -1404=>'L', -1405=>'L', -1406=>'L', -1407=>'L', -1408=>'L', -1409=>'L', -1410=>'L', -1411=>'L', -1412=>'L', -1413=>'L', -1414=>'L', -1415=>'L', -1417=>'L', -1418=>'ON', -1425=>'NSM', -1426=>'NSM', -1427=>'NSM', -1428=>'NSM', -1429=>'NSM', -1430=>'NSM', -1431=>'NSM', -1432=>'NSM', -1433=>'NSM', -1434=>'NSM', -1435=>'NSM', -1436=>'NSM', -1437=>'NSM', -1438=>'NSM', -1439=>'NSM', -1440=>'NSM', -1441=>'NSM', -1442=>'NSM', -1443=>'NSM', -1444=>'NSM', -1445=>'NSM', -1446=>'NSM', -1447=>'NSM', -1448=>'NSM', -1449=>'NSM', -1450=>'NSM', -1451=>'NSM', -1452=>'NSM', -1453=>'NSM', -1454=>'NSM', -1455=>'NSM', -1456=>'NSM', -1457=>'NSM', -1458=>'NSM', -1459=>'NSM', -1460=>'NSM', -1461=>'NSM', -1462=>'NSM', -1463=>'NSM', -1464=>'NSM', -1465=>'NSM', -1466=>'NSM', -1467=>'NSM', -1468=>'NSM', -1469=>'NSM', -1470=>'R', -1471=>'NSM', -1472=>'R', -1473=>'NSM', -1474=>'NSM', -1475=>'R', -1476=>'NSM', -1477=>'NSM', -1478=>'R', -1479=>'NSM', -1488=>'R', -1489=>'R', -1490=>'R', -1491=>'R', -1492=>'R', -1493=>'R', -1494=>'R', -1495=>'R', -1496=>'R', -1497=>'R', -1498=>'R', -1499=>'R', -1500=>'R', -1501=>'R', -1502=>'R', -1503=>'R', -1504=>'R', -1505=>'R', -1506=>'R', -1507=>'R', -1508=>'R', -1509=>'R', -1510=>'R', -1511=>'R', -1512=>'R', -1513=>'R', -1514=>'R', -1520=>'R', -1521=>'R', -1522=>'R', -1523=>'R', -1524=>'R', -1536=>'AL', -1537=>'AL', -1538=>'AL', -1539=>'AL', -1547=>'AL', -1548=>'CS', -1549=>'AL', -1550=>'ON', -1551=>'ON', -1552=>'NSM', -1553=>'NSM', -1554=>'NSM', -1555=>'NSM', -1556=>'NSM', -1557=>'NSM', -1563=>'AL', -1566=>'AL', -1567=>'AL', -1569=>'AL', -1570=>'AL', -1571=>'AL', -1572=>'AL', -1573=>'AL', -1574=>'AL', -1575=>'AL', -1576=>'AL', -1577=>'AL', -1578=>'AL', -1579=>'AL', -1580=>'AL', -1581=>'AL', -1582=>'AL', -1583=>'AL', -1584=>'AL', -1585=>'AL', -1586=>'AL', -1587=>'AL', -1588=>'AL', -1589=>'AL', -1590=>'AL', -1591=>'AL', -1592=>'AL', -1593=>'AL', -1594=>'AL', -1600=>'AL', -1601=>'AL', -1602=>'AL', -1603=>'AL', -1604=>'AL', -1605=>'AL', -1606=>'AL', -1607=>'AL', -1608=>'AL', -1609=>'AL', -1610=>'AL', -1611=>'NSM', -1612=>'NSM', -1613=>'NSM', -1614=>'NSM', -1615=>'NSM', -1616=>'NSM', -1617=>'NSM', -1618=>'NSM', -1619=>'NSM', -1620=>'NSM', -1621=>'NSM', -1622=>'NSM', -1623=>'NSM', -1624=>'NSM', -1625=>'NSM', -1626=>'NSM', -1627=>'NSM', -1628=>'NSM', -1629=>'NSM', -1630=>'NSM', -1632=>'AN', -1633=>'AN', -1634=>'AN', -1635=>'AN', -1636=>'AN', -1637=>'AN', -1638=>'AN', -1639=>'AN', -1640=>'AN', -1641=>'AN', -1642=>'ET', -1643=>'AN', -1644=>'AN', -1645=>'AL', -1646=>'AL', -1647=>'AL', -1648=>'NSM', -1649=>'AL', -1650=>'AL', -1651=>'AL', -1652=>'AL', -1653=>'AL', -1654=>'AL', -1655=>'AL', -1656=>'AL', -1657=>'AL', -1658=>'AL', -1659=>'AL', -1660=>'AL', -1661=>'AL', -1662=>'AL', -1663=>'AL', -1664=>'AL', -1665=>'AL', -1666=>'AL', -1667=>'AL', -1668=>'AL', -1669=>'AL', -1670=>'AL', -1671=>'AL', -1672=>'AL', -1673=>'AL', -1674=>'AL', -1675=>'AL', -1676=>'AL', -1677=>'AL', -1678=>'AL', -1679=>'AL', -1680=>'AL', -1681=>'AL', -1682=>'AL', -1683=>'AL', -1684=>'AL', -1685=>'AL', -1686=>'AL', -1687=>'AL', -1688=>'AL', -1689=>'AL', -1690=>'AL', -1691=>'AL', -1692=>'AL', -1693=>'AL', -1694=>'AL', -1695=>'AL', -1696=>'AL', -1697=>'AL', -1698=>'AL', -1699=>'AL', -1700=>'AL', -1701=>'AL', -1702=>'AL', -1703=>'AL', -1704=>'AL', -1705=>'AL', -1706=>'AL', -1707=>'AL', -1708=>'AL', -1709=>'AL', -1710=>'AL', -1711=>'AL', -1712=>'AL', -1713=>'AL', -1714=>'AL', -1715=>'AL', -1716=>'AL', -1717=>'AL', -1718=>'AL', -1719=>'AL', -1720=>'AL', -1721=>'AL', -1722=>'AL', -1723=>'AL', -1724=>'AL', -1725=>'AL', -1726=>'AL', -1727=>'AL', -1728=>'AL', -1729=>'AL', -1730=>'AL', -1731=>'AL', -1732=>'AL', -1733=>'AL', -1734=>'AL', -1735=>'AL', -1736=>'AL', -1737=>'AL', -1738=>'AL', -1739=>'AL', -1740=>'AL', -1741=>'AL', -1742=>'AL', -1743=>'AL', -1744=>'AL', -1745=>'AL', -1746=>'AL', -1747=>'AL', -1748=>'AL', -1749=>'AL', -1750=>'NSM', -1751=>'NSM', -1752=>'NSM', -1753=>'NSM', -1754=>'NSM', -1755=>'NSM', -1756=>'NSM', -1757=>'AL', -1758=>'NSM', -1759=>'NSM', -1760=>'NSM', -1761=>'NSM', -1762=>'NSM', -1763=>'NSM', -1764=>'NSM', -1765=>'AL', -1766=>'AL', -1767=>'NSM', -1768=>'NSM', -1769=>'ON', -1770=>'NSM', -1771=>'NSM', -1772=>'NSM', -1773=>'NSM', -1774=>'AL', -1775=>'AL', -1776=>'EN', -1777=>'EN', -1778=>'EN', -1779=>'EN', -1780=>'EN', -1781=>'EN', -1782=>'EN', -1783=>'EN', -1784=>'EN', -1785=>'EN', -1786=>'AL', -1787=>'AL', -1788=>'AL', -1789=>'AL', -1790=>'AL', -1791=>'AL', -1792=>'AL', -1793=>'AL', -1794=>'AL', -1795=>'AL', -1796=>'AL', -1797=>'AL', -1798=>'AL', -1799=>'AL', -1800=>'AL', -1801=>'AL', -1802=>'AL', -1803=>'AL', -1804=>'AL', -1805=>'AL', -1807=>'BN', -1808=>'AL', -1809=>'NSM', -1810=>'AL', -1811=>'AL', -1812=>'AL', -1813=>'AL', -1814=>'AL', -1815=>'AL', -1816=>'AL', -1817=>'AL', -1818=>'AL', -1819=>'AL', -1820=>'AL', -1821=>'AL', -1822=>'AL', -1823=>'AL', -1824=>'AL', -1825=>'AL', -1826=>'AL', -1827=>'AL', -1828=>'AL', -1829=>'AL', -1830=>'AL', -1831=>'AL', -1832=>'AL', -1833=>'AL', -1834=>'AL', -1835=>'AL', -1836=>'AL', -1837=>'AL', -1838=>'AL', -1839=>'AL', -1840=>'NSM', -1841=>'NSM', -1842=>'NSM', -1843=>'NSM', -1844=>'NSM', -1845=>'NSM', -1846=>'NSM', -1847=>'NSM', -1848=>'NSM', -1849=>'NSM', -1850=>'NSM', -1851=>'NSM', -1852=>'NSM', -1853=>'NSM', -1854=>'NSM', -1855=>'NSM', -1856=>'NSM', -1857=>'NSM', -1858=>'NSM', -1859=>'NSM', -1860=>'NSM', -1861=>'NSM', -1862=>'NSM', -1863=>'NSM', -1864=>'NSM', -1865=>'NSM', -1866=>'NSM', -1869=>'AL', -1870=>'AL', -1871=>'AL', -1872=>'AL', -1873=>'AL', -1874=>'AL', -1875=>'AL', -1876=>'AL', -1877=>'AL', -1878=>'AL', -1879=>'AL', -1880=>'AL', -1881=>'AL', -1882=>'AL', -1883=>'AL', -1884=>'AL', -1885=>'AL', -1886=>'AL', -1887=>'AL', -1888=>'AL', -1889=>'AL', -1890=>'AL', -1891=>'AL', -1892=>'AL', -1893=>'AL', -1894=>'AL', -1895=>'AL', -1896=>'AL', -1897=>'AL', -1898=>'AL', -1899=>'AL', -1900=>'AL', -1901=>'AL', -1920=>'AL', -1921=>'AL', -1922=>'AL', -1923=>'AL', -1924=>'AL', -1925=>'AL', -1926=>'AL', -1927=>'AL', -1928=>'AL', -1929=>'AL', -1930=>'AL', -1931=>'AL', -1932=>'AL', -1933=>'AL', -1934=>'AL', -1935=>'AL', -1936=>'AL', -1937=>'AL', -1938=>'AL', -1939=>'AL', -1940=>'AL', -1941=>'AL', -1942=>'AL', -1943=>'AL', -1944=>'AL', -1945=>'AL', -1946=>'AL', -1947=>'AL', -1948=>'AL', -1949=>'AL', -1950=>'AL', -1951=>'AL', -1952=>'AL', -1953=>'AL', -1954=>'AL', -1955=>'AL', -1956=>'AL', -1957=>'AL', -1958=>'NSM', -1959=>'NSM', -1960=>'NSM', -1961=>'NSM', -1962=>'NSM', -1963=>'NSM', -1964=>'NSM', -1965=>'NSM', -1966=>'NSM', -1967=>'NSM', -1968=>'NSM', -1969=>'AL', -1984=>'R', -1985=>'R', -1986=>'R', -1987=>'R', -1988=>'R', -1989=>'R', -1990=>'R', -1991=>'R', -1992=>'R', -1993=>'R', -1994=>'R', -1995=>'R', -1996=>'R', -1997=>'R', -1998=>'R', -1999=>'R', -2000=>'R', -2001=>'R', -2002=>'R', -2003=>'R', -2004=>'R', -2005=>'R', -2006=>'R', -2007=>'R', -2008=>'R', -2009=>'R', -2010=>'R', -2011=>'R', -2012=>'R', -2013=>'R', -2014=>'R', -2015=>'R', -2016=>'R', -2017=>'R', -2018=>'R', -2019=>'R', -2020=>'R', -2021=>'R', -2022=>'R', -2023=>'R', -2024=>'R', -2025=>'R', -2026=>'R', -2027=>'NSM', -2028=>'NSM', -2029=>'NSM', -2030=>'NSM', -2031=>'NSM', -2032=>'NSM', -2033=>'NSM', -2034=>'NSM', -2035=>'NSM', -2036=>'R', -2037=>'R', -2038=>'ON', -2039=>'ON', -2040=>'ON', -2041=>'ON', -2042=>'R', -2305=>'NSM', -2306=>'NSM', -2307=>'L', -2308=>'L', -2309=>'L', -2310=>'L', -2311=>'L', -2312=>'L', -2313=>'L', -2314=>'L', -2315=>'L', -2316=>'L', -2317=>'L', -2318=>'L', -2319=>'L', -2320=>'L', -2321=>'L', -2322=>'L', -2323=>'L', -2324=>'L', -2325=>'L', -2326=>'L', -2327=>'L', -2328=>'L', -2329=>'L', -2330=>'L', -2331=>'L', -2332=>'L', -2333=>'L', -2334=>'L', -2335=>'L', -2336=>'L', -2337=>'L', -2338=>'L', -2339=>'L', -2340=>'L', -2341=>'L', -2342=>'L', -2343=>'L', -2344=>'L', -2345=>'L', -2346=>'L', -2347=>'L', -2348=>'L', -2349=>'L', -2350=>'L', -2351=>'L', -2352=>'L', -2353=>'L', -2354=>'L', -2355=>'L', -2356=>'L', -2357=>'L', -2358=>'L', -2359=>'L', -2360=>'L', -2361=>'L', -2364=>'NSM', -2365=>'L', -2366=>'L', -2367=>'L', -2368=>'L', -2369=>'NSM', -2370=>'NSM', -2371=>'NSM', -2372=>'NSM', -2373=>'NSM', -2374=>'NSM', -2375=>'NSM', -2376=>'NSM', -2377=>'L', -2378=>'L', -2379=>'L', -2380=>'L', -2381=>'NSM', -2384=>'L', -2385=>'NSM', -2386=>'NSM', -2387=>'NSM', -2388=>'NSM', -2392=>'L', -2393=>'L', -2394=>'L', -2395=>'L', -2396=>'L', -2397=>'L', -2398=>'L', -2399=>'L', -2400=>'L', -2401=>'L', -2402=>'NSM', -2403=>'NSM', -2404=>'L', -2405=>'L', -2406=>'L', -2407=>'L', -2408=>'L', -2409=>'L', -2410=>'L', -2411=>'L', -2412=>'L', -2413=>'L', -2414=>'L', -2415=>'L', -2416=>'L', -2427=>'L', -2428=>'L', -2429=>'L', -2430=>'L', -2431=>'L', -2433=>'NSM', -2434=>'L', -2435=>'L', -2437=>'L', -2438=>'L', -2439=>'L', -2440=>'L', -2441=>'L', -2442=>'L', -2443=>'L', -2444=>'L', -2447=>'L', -2448=>'L', -2451=>'L', -2452=>'L', -2453=>'L', -2454=>'L', -2455=>'L', -2456=>'L', -2457=>'L', -2458=>'L', -2459=>'L', -2460=>'L', -2461=>'L', -2462=>'L', -2463=>'L', -2464=>'L', -2465=>'L', -2466=>'L', -2467=>'L', -2468=>'L', -2469=>'L', -2470=>'L', -2471=>'L', -2472=>'L', -2474=>'L', -2475=>'L', -2476=>'L', -2477=>'L', -2478=>'L', -2479=>'L', -2480=>'L', -2482=>'L', -2486=>'L', -2487=>'L', -2488=>'L', -2489=>'L', -2492=>'NSM', -2493=>'L', -2494=>'L', -2495=>'L', -2496=>'L', -2497=>'NSM', -2498=>'NSM', -2499=>'NSM', -2500=>'NSM', -2503=>'L', -2504=>'L', -2507=>'L', -2508=>'L', -2509=>'NSM', -2510=>'L', -2519=>'L', -2524=>'L', -2525=>'L', -2527=>'L', -2528=>'L', -2529=>'L', -2530=>'NSM', -2531=>'NSM', -2534=>'L', -2535=>'L', -2536=>'L', -2537=>'L', -2538=>'L', -2539=>'L', -2540=>'L', -2541=>'L', -2542=>'L', -2543=>'L', -2544=>'L', -2545=>'L', -2546=>'ET', -2547=>'ET', -2548=>'L', -2549=>'L', -2550=>'L', -2551=>'L', -2552=>'L', -2553=>'L', -2554=>'L', -2561=>'NSM', -2562=>'NSM', -2563=>'L', -2565=>'L', -2566=>'L', -2567=>'L', -2568=>'L', -2569=>'L', -2570=>'L', -2575=>'L', -2576=>'L', -2579=>'L', -2580=>'L', -2581=>'L', -2582=>'L', -2583=>'L', -2584=>'L', -2585=>'L', -2586=>'L', -2587=>'L', -2588=>'L', -2589=>'L', -2590=>'L', -2591=>'L', -2592=>'L', -2593=>'L', -2594=>'L', -2595=>'L', -2596=>'L', -2597=>'L', -2598=>'L', -2599=>'L', -2600=>'L', -2602=>'L', -2603=>'L', -2604=>'L', -2605=>'L', -2606=>'L', -2607=>'L', -2608=>'L', -2610=>'L', -2611=>'L', -2613=>'L', -2614=>'L', -2616=>'L', -2617=>'L', -2620=>'NSM', -2622=>'L', -2623=>'L', -2624=>'L', -2625=>'NSM', -2626=>'NSM', -2631=>'NSM', -2632=>'NSM', -2635=>'NSM', -2636=>'NSM', -2637=>'NSM', -2649=>'L', -2650=>'L', -2651=>'L', -2652=>'L', -2654=>'L', -2662=>'L', -2663=>'L', -2664=>'L', -2665=>'L', -2666=>'L', -2667=>'L', -2668=>'L', -2669=>'L', -2670=>'L', -2671=>'L', -2672=>'NSM', -2673=>'NSM', -2674=>'L', -2675=>'L', -2676=>'L', -2689=>'NSM', -2690=>'NSM', -2691=>'L', -2693=>'L', -2694=>'L', -2695=>'L', -2696=>'L', -2697=>'L', -2698=>'L', -2699=>'L', -2700=>'L', -2701=>'L', -2703=>'L', -2704=>'L', -2705=>'L', -2707=>'L', -2708=>'L', -2709=>'L', -2710=>'L', -2711=>'L', -2712=>'L', -2713=>'L', -2714=>'L', -2715=>'L', -2716=>'L', -2717=>'L', -2718=>'L', -2719=>'L', -2720=>'L', -2721=>'L', -2722=>'L', -2723=>'L', -2724=>'L', -2725=>'L', -2726=>'L', -2727=>'L', -2728=>'L', -2730=>'L', -2731=>'L', -2732=>'L', -2733=>'L', -2734=>'L', -2735=>'L', -2736=>'L', -2738=>'L', -2739=>'L', -2741=>'L', -2742=>'L', -2743=>'L', -2744=>'L', -2745=>'L', -2748=>'NSM', -2749=>'L', -2750=>'L', -2751=>'L', -2752=>'L', -2753=>'NSM', -2754=>'NSM', -2755=>'NSM', -2756=>'NSM', -2757=>'NSM', -2759=>'NSM', -2760=>'NSM', -2761=>'L', -2763=>'L', -2764=>'L', -2765=>'NSM', -2768=>'L', -2784=>'L', -2785=>'L', -2786=>'NSM', -2787=>'NSM', -2790=>'L', -2791=>'L', -2792=>'L', -2793=>'L', -2794=>'L', -2795=>'L', -2796=>'L', -2797=>'L', -2798=>'L', -2799=>'L', -2801=>'ET', -2817=>'NSM', -2818=>'L', -2819=>'L', -2821=>'L', -2822=>'L', -2823=>'L', -2824=>'L', -2825=>'L', -2826=>'L', -2827=>'L', -2828=>'L', -2831=>'L', -2832=>'L', -2835=>'L', -2836=>'L', -2837=>'L', -2838=>'L', -2839=>'L', -2840=>'L', -2841=>'L', -2842=>'L', -2843=>'L', -2844=>'L', -2845=>'L', -2846=>'L', -2847=>'L', -2848=>'L', -2849=>'L', -2850=>'L', -2851=>'L', -2852=>'L', -2853=>'L', -2854=>'L', -2855=>'L', -2856=>'L', -2858=>'L', -2859=>'L', -2860=>'L', -2861=>'L', -2862=>'L', -2863=>'L', -2864=>'L', -2866=>'L', -2867=>'L', -2869=>'L', -2870=>'L', -2871=>'L', -2872=>'L', -2873=>'L', -2876=>'NSM', -2877=>'L', -2878=>'L', -2879=>'NSM', -2880=>'L', -2881=>'NSM', -2882=>'NSM', -2883=>'NSM', -2887=>'L', -2888=>'L', -2891=>'L', -2892=>'L', -2893=>'NSM', -2902=>'NSM', -2903=>'L', -2908=>'L', -2909=>'L', -2911=>'L', -2912=>'L', -2913=>'L', -2918=>'L', -2919=>'L', -2920=>'L', -2921=>'L', -2922=>'L', -2923=>'L', -2924=>'L', -2925=>'L', -2926=>'L', -2927=>'L', -2928=>'L', -2929=>'L', -2946=>'NSM', -2947=>'L', -2949=>'L', -2950=>'L', -2951=>'L', -2952=>'L', -2953=>'L', -2954=>'L', -2958=>'L', -2959=>'L', -2960=>'L', -2962=>'L', -2963=>'L', -2964=>'L', -2965=>'L', -2969=>'L', -2970=>'L', -2972=>'L', -2974=>'L', -2975=>'L', -2979=>'L', -2980=>'L', -2984=>'L', -2985=>'L', -2986=>'L', -2990=>'L', -2991=>'L', -2992=>'L', -2993=>'L', -2994=>'L', -2995=>'L', -2996=>'L', -2997=>'L', -2998=>'L', -2999=>'L', -3000=>'L', -3001=>'L', -3006=>'L', -3007=>'L', -3008=>'NSM', -3009=>'L', -3010=>'L', -3014=>'L', -3015=>'L', -3016=>'L', -3018=>'L', -3019=>'L', -3020=>'L', -3021=>'NSM', -3031=>'L', -3046=>'L', -3047=>'L', -3048=>'L', -3049=>'L', -3050=>'L', -3051=>'L', -3052=>'L', -3053=>'L', -3054=>'L', -3055=>'L', -3056=>'L', -3057=>'L', -3058=>'L', -3059=>'ON', -3060=>'ON', -3061=>'ON', -3062=>'ON', -3063=>'ON', -3064=>'ON', -3065=>'ET', -3066=>'ON', -3073=>'L', -3074=>'L', -3075=>'L', -3077=>'L', -3078=>'L', -3079=>'L', -3080=>'L', -3081=>'L', -3082=>'L', -3083=>'L', -3084=>'L', -3086=>'L', -3087=>'L', -3088=>'L', -3090=>'L', -3091=>'L', -3092=>'L', -3093=>'L', -3094=>'L', -3095=>'L', -3096=>'L', -3097=>'L', -3098=>'L', -3099=>'L', -3100=>'L', -3101=>'L', -3102=>'L', -3103=>'L', -3104=>'L', -3105=>'L', -3106=>'L', -3107=>'L', -3108=>'L', -3109=>'L', -3110=>'L', -3111=>'L', -3112=>'L', -3114=>'L', -3115=>'L', -3116=>'L', -3117=>'L', -3118=>'L', -3119=>'L', -3120=>'L', -3121=>'L', -3122=>'L', -3123=>'L', -3125=>'L', -3126=>'L', -3127=>'L', -3128=>'L', -3129=>'L', -3134=>'NSM', -3135=>'NSM', -3136=>'NSM', -3137=>'L', -3138=>'L', -3139=>'L', -3140=>'L', -3142=>'NSM', -3143=>'NSM', -3144=>'NSM', -3146=>'NSM', -3147=>'NSM', -3148=>'NSM', -3149=>'NSM', -3157=>'NSM', -3158=>'NSM', -3168=>'L', -3169=>'L', -3174=>'L', -3175=>'L', -3176=>'L', -3177=>'L', -3178=>'L', -3179=>'L', -3180=>'L', -3181=>'L', -3182=>'L', -3183=>'L', -3202=>'L', -3203=>'L', -3205=>'L', -3206=>'L', -3207=>'L', -3208=>'L', -3209=>'L', -3210=>'L', -3211=>'L', -3212=>'L', -3214=>'L', -3215=>'L', -3216=>'L', -3218=>'L', -3219=>'L', -3220=>'L', -3221=>'L', -3222=>'L', -3223=>'L', -3224=>'L', -3225=>'L', -3226=>'L', -3227=>'L', -3228=>'L', -3229=>'L', -3230=>'L', -3231=>'L', -3232=>'L', -3233=>'L', -3234=>'L', -3235=>'L', -3236=>'L', -3237=>'L', -3238=>'L', -3239=>'L', -3240=>'L', -3242=>'L', -3243=>'L', -3244=>'L', -3245=>'L', -3246=>'L', -3247=>'L', -3248=>'L', -3249=>'L', -3250=>'L', -3251=>'L', -3253=>'L', -3254=>'L', -3255=>'L', -3256=>'L', -3257=>'L', -3260=>'NSM', -3261=>'L', -3262=>'L', -3263=>'L', -3264=>'L', -3265=>'L', -3266=>'L', -3267=>'L', -3268=>'L', -3270=>'L', -3271=>'L', -3272=>'L', -3274=>'L', -3275=>'L', -3276=>'NSM', -3277=>'NSM', -3285=>'L', -3286=>'L', -3294=>'L', -3296=>'L', -3297=>'L', -3298=>'NSM', -3299=>'NSM', -3302=>'L', -3303=>'L', -3304=>'L', -3305=>'L', -3306=>'L', -3307=>'L', -3308=>'L', -3309=>'L', -3310=>'L', -3311=>'L', -3313=>'ON', -3314=>'ON', -3330=>'L', -3331=>'L', -3333=>'L', -3334=>'L', -3335=>'L', -3336=>'L', -3337=>'L', -3338=>'L', -3339=>'L', -3340=>'L', -3342=>'L', -3343=>'L', -3344=>'L', -3346=>'L', -3347=>'L', -3348=>'L', -3349=>'L', -3350=>'L', -3351=>'L', -3352=>'L', -3353=>'L', -3354=>'L', -3355=>'L', -3356=>'L', -3357=>'L', -3358=>'L', -3359=>'L', -3360=>'L', -3361=>'L', -3362=>'L', -3363=>'L', -3364=>'L', -3365=>'L', -3366=>'L', -3367=>'L', -3368=>'L', -3370=>'L', -3371=>'L', -3372=>'L', -3373=>'L', -3374=>'L', -3375=>'L', -3376=>'L', -3377=>'L', -3378=>'L', -3379=>'L', -3380=>'L', -3381=>'L', -3382=>'L', -3383=>'L', -3384=>'L', -3385=>'L', -3390=>'L', -3391=>'L', -3392=>'L', -3393=>'NSM', -3394=>'NSM', -3395=>'NSM', -3398=>'L', -3399=>'L', -3400=>'L', -3402=>'L', -3403=>'L', -3404=>'L', -3405=>'NSM', -3415=>'L', -3424=>'L', -3425=>'L', -3430=>'L', -3431=>'L', -3432=>'L', -3433=>'L', -3434=>'L', -3435=>'L', -3436=>'L', -3437=>'L', -3438=>'L', -3439=>'L', -3458=>'L', -3459=>'L', -3461=>'L', -3462=>'L', -3463=>'L', -3464=>'L', -3465=>'L', -3466=>'L', -3467=>'L', -3468=>'L', -3469=>'L', -3470=>'L', -3471=>'L', -3472=>'L', -3473=>'L', -3474=>'L', -3475=>'L', -3476=>'L', -3477=>'L', -3478=>'L', -3482=>'L', -3483=>'L', -3484=>'L', -3485=>'L', -3486=>'L', -3487=>'L', -3488=>'L', -3489=>'L', -3490=>'L', -3491=>'L', -3492=>'L', -3493=>'L', -3494=>'L', -3495=>'L', -3496=>'L', -3497=>'L', -3498=>'L', -3499=>'L', -3500=>'L', -3501=>'L', -3502=>'L', -3503=>'L', -3504=>'L', -3505=>'L', -3507=>'L', -3508=>'L', -3509=>'L', -3510=>'L', -3511=>'L', -3512=>'L', -3513=>'L', -3514=>'L', -3515=>'L', -3517=>'L', -3520=>'L', -3521=>'L', -3522=>'L', -3523=>'L', -3524=>'L', -3525=>'L', -3526=>'L', -3530=>'NSM', -3535=>'L', -3536=>'L', -3537=>'L', -3538=>'NSM', -3539=>'NSM', -3540=>'NSM', -3542=>'NSM', -3544=>'L', -3545=>'L', -3546=>'L', -3547=>'L', -3548=>'L', -3549=>'L', -3550=>'L', -3551=>'L', -3570=>'L', -3571=>'L', -3572=>'L', -3585=>'L', -3586=>'L', -3587=>'L', -3588=>'L', -3589=>'L', -3590=>'L', -3591=>'L', -3592=>'L', -3593=>'L', -3594=>'L', -3595=>'L', -3596=>'L', -3597=>'L', -3598=>'L', -3599=>'L', -3600=>'L', -3601=>'L', -3602=>'L', -3603=>'L', -3604=>'L', -3605=>'L', -3606=>'L', -3607=>'L', -3608=>'L', -3609=>'L', -3610=>'L', -3611=>'L', -3612=>'L', -3613=>'L', -3614=>'L', -3615=>'L', -3616=>'L', -3617=>'L', -3618=>'L', -3619=>'L', -3620=>'L', -3621=>'L', -3622=>'L', -3623=>'L', -3624=>'L', -3625=>'L', -3626=>'L', -3627=>'L', -3628=>'L', -3629=>'L', -3630=>'L', -3631=>'L', -3632=>'L', -3633=>'NSM', -3634=>'L', -3635=>'L', -3636=>'NSM', -3637=>'NSM', -3638=>'NSM', -3639=>'NSM', -3640=>'NSM', -3641=>'NSM', -3642=>'NSM', -3647=>'ET', -3648=>'L', -3649=>'L', -3650=>'L', -3651=>'L', -3652=>'L', -3653=>'L', -3654=>'L', -3655=>'NSM', -3656=>'NSM', -3657=>'NSM', -3658=>'NSM', -3659=>'NSM', -3660=>'NSM', -3661=>'NSM', -3662=>'NSM', -3663=>'L', -3664=>'L', -3665=>'L', -3666=>'L', -3667=>'L', -3668=>'L', -3669=>'L', -3670=>'L', -3671=>'L', -3672=>'L', -3673=>'L', -3674=>'L', -3675=>'L', -3713=>'L', -3714=>'L', -3716=>'L', -3719=>'L', -3720=>'L', -3722=>'L', -3725=>'L', -3732=>'L', -3733=>'L', -3734=>'L', -3735=>'L', -3737=>'L', -3738=>'L', -3739=>'L', -3740=>'L', -3741=>'L', -3742=>'L', -3743=>'L', -3745=>'L', -3746=>'L', -3747=>'L', -3749=>'L', -3751=>'L', -3754=>'L', -3755=>'L', -3757=>'L', -3758=>'L', -3759=>'L', -3760=>'L', -3761=>'NSM', -3762=>'L', -3763=>'L', -3764=>'NSM', -3765=>'NSM', -3766=>'NSM', -3767=>'NSM', -3768=>'NSM', -3769=>'NSM', -3771=>'NSM', -3772=>'NSM', -3773=>'L', -3776=>'L', -3777=>'L', -3778=>'L', -3779=>'L', -3780=>'L', -3782=>'L', -3784=>'NSM', -3785=>'NSM', -3786=>'NSM', -3787=>'NSM', -3788=>'NSM', -3789=>'NSM', -3792=>'L', -3793=>'L', -3794=>'L', -3795=>'L', -3796=>'L', -3797=>'L', -3798=>'L', -3799=>'L', -3800=>'L', -3801=>'L', -3804=>'L', -3805=>'L', -3840=>'L', -3841=>'L', -3842=>'L', -3843=>'L', -3844=>'L', -3845=>'L', -3846=>'L', -3847=>'L', -3848=>'L', -3849=>'L', -3850=>'L', -3851=>'L', -3852=>'L', -3853=>'L', -3854=>'L', -3855=>'L', -3856=>'L', -3857=>'L', -3858=>'L', -3859=>'L', -3860=>'L', -3861=>'L', -3862=>'L', -3863=>'L', -3864=>'NSM', -3865=>'NSM', -3866=>'L', -3867=>'L', -3868=>'L', -3869=>'L', -3870=>'L', -3871=>'L', -3872=>'L', -3873=>'L', -3874=>'L', -3875=>'L', -3876=>'L', -3877=>'L', -3878=>'L', -3879=>'L', -3880=>'L', -3881=>'L', -3882=>'L', -3883=>'L', -3884=>'L', -3885=>'L', -3886=>'L', -3887=>'L', -3888=>'L', -3889=>'L', -3890=>'L', -3891=>'L', -3892=>'L', -3893=>'NSM', -3894=>'L', -3895=>'NSM', -3896=>'L', -3897=>'NSM', -3898=>'ON', -3899=>'ON', -3900=>'ON', -3901=>'ON', -3902=>'L', -3903=>'L', -3904=>'L', -3905=>'L', -3906=>'L', -3907=>'L', -3908=>'L', -3909=>'L', -3910=>'L', -3911=>'L', -3913=>'L', -3914=>'L', -3915=>'L', -3916=>'L', -3917=>'L', -3918=>'L', -3919=>'L', -3920=>'L', -3921=>'L', -3922=>'L', -3923=>'L', -3924=>'L', -3925=>'L', -3926=>'L', -3927=>'L', -3928=>'L', -3929=>'L', -3930=>'L', -3931=>'L', -3932=>'L', -3933=>'L', -3934=>'L', -3935=>'L', -3936=>'L', -3937=>'L', -3938=>'L', -3939=>'L', -3940=>'L', -3941=>'L', -3942=>'L', -3943=>'L', -3944=>'L', -3945=>'L', -3946=>'L', -3953=>'NSM', -3954=>'NSM', -3955=>'NSM', -3956=>'NSM', -3957=>'NSM', -3958=>'NSM', -3959=>'NSM', -3960=>'NSM', -3961=>'NSM', -3962=>'NSM', -3963=>'NSM', -3964=>'NSM', -3965=>'NSM', -3966=>'NSM', -3967=>'L', -3968=>'NSM', -3969=>'NSM', -3970=>'NSM', -3971=>'NSM', -3972=>'NSM', -3973=>'L', -3974=>'NSM', -3975=>'NSM', -3976=>'L', -3977=>'L', -3978=>'L', -3979=>'L', -3984=>'NSM', -3985=>'NSM', -3986=>'NSM', -3987=>'NSM', -3988=>'NSM', -3989=>'NSM', -3990=>'NSM', -3991=>'NSM', -3993=>'NSM', -3994=>'NSM', -3995=>'NSM', -3996=>'NSM', -3997=>'NSM', -3998=>'NSM', -3999=>'NSM', -4000=>'NSM', -4001=>'NSM', -4002=>'NSM', -4003=>'NSM', -4004=>'NSM', -4005=>'NSM', -4006=>'NSM', -4007=>'NSM', -4008=>'NSM', -4009=>'NSM', -4010=>'NSM', -4011=>'NSM', -4012=>'NSM', -4013=>'NSM', -4014=>'NSM', -4015=>'NSM', -4016=>'NSM', -4017=>'NSM', -4018=>'NSM', -4019=>'NSM', -4020=>'NSM', -4021=>'NSM', -4022=>'NSM', -4023=>'NSM', -4024=>'NSM', -4025=>'NSM', -4026=>'NSM', -4027=>'NSM', -4028=>'NSM', -4030=>'L', -4031=>'L', -4032=>'L', -4033=>'L', -4034=>'L', -4035=>'L', -4036=>'L', -4037=>'L', -4038=>'NSM', -4039=>'L', -4040=>'L', -4041=>'L', -4042=>'L', -4043=>'L', -4044=>'L', -4047=>'L', -4048=>'L', -4049=>'L', -4096=>'L', -4097=>'L', -4098=>'L', -4099=>'L', -4100=>'L', -4101=>'L', -4102=>'L', -4103=>'L', -4104=>'L', -4105=>'L', -4106=>'L', -4107=>'L', -4108=>'L', -4109=>'L', -4110=>'L', -4111=>'L', -4112=>'L', -4113=>'L', -4114=>'L', -4115=>'L', -4116=>'L', -4117=>'L', -4118=>'L', -4119=>'L', -4120=>'L', -4121=>'L', -4122=>'L', -4123=>'L', -4124=>'L', -4125=>'L', -4126=>'L', -4127=>'L', -4128=>'L', -4129=>'L', -4131=>'L', -4132=>'L', -4133=>'L', -4134=>'L', -4135=>'L', -4137=>'L', -4138=>'L', -4140=>'L', -4141=>'NSM', -4142=>'NSM', -4143=>'NSM', -4144=>'NSM', -4145=>'L', -4146=>'NSM', -4150=>'NSM', -4151=>'NSM', -4152=>'L', -4153=>'NSM', -4160=>'L', -4161=>'L', -4162=>'L', -4163=>'L', -4164=>'L', -4165=>'L', -4166=>'L', -4167=>'L', -4168=>'L', -4169=>'L', -4170=>'L', -4171=>'L', -4172=>'L', -4173=>'L', -4174=>'L', -4175=>'L', -4176=>'L', -4177=>'L', -4178=>'L', -4179=>'L', -4180=>'L', -4181=>'L', -4182=>'L', -4183=>'L', -4184=>'NSM', -4185=>'NSM', -4256=>'L', -4257=>'L', -4258=>'L', -4259=>'L', -4260=>'L', -4261=>'L', -4262=>'L', -4263=>'L', -4264=>'L', -4265=>'L', -4266=>'L', -4267=>'L', -4268=>'L', -4269=>'L', -4270=>'L', -4271=>'L', -4272=>'L', -4273=>'L', -4274=>'L', -4275=>'L', -4276=>'L', -4277=>'L', -4278=>'L', -4279=>'L', -4280=>'L', -4281=>'L', -4282=>'L', -4283=>'L', -4284=>'L', -4285=>'L', -4286=>'L', -4287=>'L', -4288=>'L', -4289=>'L', -4290=>'L', -4291=>'L', -4292=>'L', -4293=>'L', -4304=>'L', -4305=>'L', -4306=>'L', -4307=>'L', -4308=>'L', -4309=>'L', -4310=>'L', -4311=>'L', -4312=>'L', -4313=>'L', -4314=>'L', -4315=>'L', -4316=>'L', -4317=>'L', -4318=>'L', -4319=>'L', -4320=>'L', -4321=>'L', -4322=>'L', -4323=>'L', -4324=>'L', -4325=>'L', -4326=>'L', -4327=>'L', -4328=>'L', -4329=>'L', -4330=>'L', -4331=>'L', -4332=>'L', -4333=>'L', -4334=>'L', -4335=>'L', -4336=>'L', -4337=>'L', -4338=>'L', -4339=>'L', -4340=>'L', -4341=>'L', -4342=>'L', -4343=>'L', -4344=>'L', -4345=>'L', -4346=>'L', -4347=>'L', -4348=>'L', -4352=>'L', -4353=>'L', -4354=>'L', -4355=>'L', -4356=>'L', -4357=>'L', -4358=>'L', -4359=>'L', -4360=>'L', -4361=>'L', -4362=>'L', -4363=>'L', -4364=>'L', -4365=>'L', -4366=>'L', -4367=>'L', -4368=>'L', -4369=>'L', -4370=>'L', -4371=>'L', -4372=>'L', -4373=>'L', -4374=>'L', -4375=>'L', -4376=>'L', -4377=>'L', -4378=>'L', -4379=>'L', -4380=>'L', -4381=>'L', -4382=>'L', -4383=>'L', -4384=>'L', -4385=>'L', -4386=>'L', -4387=>'L', -4388=>'L', -4389=>'L', -4390=>'L', -4391=>'L', -4392=>'L', -4393=>'L', -4394=>'L', -4395=>'L', -4396=>'L', -4397=>'L', -4398=>'L', -4399=>'L', -4400=>'L', -4401=>'L', -4402=>'L', -4403=>'L', -4404=>'L', -4405=>'L', -4406=>'L', -4407=>'L', -4408=>'L', -4409=>'L', -4410=>'L', -4411=>'L', -4412=>'L', -4413=>'L', -4414=>'L', -4415=>'L', -4416=>'L', -4417=>'L', -4418=>'L', -4419=>'L', -4420=>'L', -4421=>'L', -4422=>'L', -4423=>'L', -4424=>'L', -4425=>'L', -4426=>'L', -4427=>'L', -4428=>'L', -4429=>'L', -4430=>'L', -4431=>'L', -4432=>'L', -4433=>'L', -4434=>'L', -4435=>'L', -4436=>'L', -4437=>'L', -4438=>'L', -4439=>'L', -4440=>'L', -4441=>'L', -4447=>'L', -4448=>'L', -4449=>'L', -4450=>'L', -4451=>'L', -4452=>'L', -4453=>'L', -4454=>'L', -4455=>'L', -4456=>'L', -4457=>'L', -4458=>'L', -4459=>'L', -4460=>'L', -4461=>'L', -4462=>'L', -4463=>'L', -4464=>'L', -4465=>'L', -4466=>'L', -4467=>'L', -4468=>'L', -4469=>'L', -4470=>'L', -4471=>'L', -4472=>'L', -4473=>'L', -4474=>'L', -4475=>'L', -4476=>'L', -4477=>'L', -4478=>'L', -4479=>'L', -4480=>'L', -4481=>'L', -4482=>'L', -4483=>'L', -4484=>'L', -4485=>'L', -4486=>'L', -4487=>'L', -4488=>'L', -4489=>'L', -4490=>'L', -4491=>'L', -4492=>'L', -4493=>'L', -4494=>'L', -4495=>'L', -4496=>'L', -4497=>'L', -4498=>'L', -4499=>'L', -4500=>'L', -4501=>'L', -4502=>'L', -4503=>'L', -4504=>'L', -4505=>'L', -4506=>'L', -4507=>'L', -4508=>'L', -4509=>'L', -4510=>'L', -4511=>'L', -4512=>'L', -4513=>'L', -4514=>'L', -4520=>'L', -4521=>'L', -4522=>'L', -4523=>'L', -4524=>'L', -4525=>'L', -4526=>'L', -4527=>'L', -4528=>'L', -4529=>'L', -4530=>'L', -4531=>'L', -4532=>'L', -4533=>'L', -4534=>'L', -4535=>'L', -4536=>'L', -4537=>'L', -4538=>'L', -4539=>'L', -4540=>'L', -4541=>'L', -4542=>'L', -4543=>'L', -4544=>'L', -4545=>'L', -4546=>'L', -4547=>'L', -4548=>'L', -4549=>'L', -4550=>'L', -4551=>'L', -4552=>'L', -4553=>'L', -4554=>'L', -4555=>'L', -4556=>'L', -4557=>'L', -4558=>'L', -4559=>'L', -4560=>'L', -4561=>'L', -4562=>'L', -4563=>'L', -4564=>'L', -4565=>'L', -4566=>'L', -4567=>'L', -4568=>'L', -4569=>'L', -4570=>'L', -4571=>'L', -4572=>'L', -4573=>'L', -4574=>'L', -4575=>'L', -4576=>'L', -4577=>'L', -4578=>'L', -4579=>'L', -4580=>'L', -4581=>'L', -4582=>'L', -4583=>'L', -4584=>'L', -4585=>'L', -4586=>'L', -4587=>'L', -4588=>'L', -4589=>'L', -4590=>'L', -4591=>'L', -4592=>'L', -4593=>'L', -4594=>'L', -4595=>'L', -4596=>'L', -4597=>'L', -4598=>'L', -4599=>'L', -4600=>'L', -4601=>'L', -4608=>'L', -4609=>'L', -4610=>'L', -4611=>'L', -4612=>'L', -4613=>'L', -4614=>'L', -4615=>'L', -4616=>'L', -4617=>'L', -4618=>'L', -4619=>'L', -4620=>'L', -4621=>'L', -4622=>'L', -4623=>'L', -4624=>'L', -4625=>'L', -4626=>'L', -4627=>'L', -4628=>'L', -4629=>'L', -4630=>'L', -4631=>'L', -4632=>'L', -4633=>'L', -4634=>'L', -4635=>'L', -4636=>'L', -4637=>'L', -4638=>'L', -4639=>'L', -4640=>'L', -4641=>'L', -4642=>'L', -4643=>'L', -4644=>'L', -4645=>'L', -4646=>'L', -4647=>'L', -4648=>'L', -4649=>'L', -4650=>'L', -4651=>'L', -4652=>'L', -4653=>'L', -4654=>'L', -4655=>'L', -4656=>'L', -4657=>'L', -4658=>'L', -4659=>'L', -4660=>'L', -4661=>'L', -4662=>'L', -4663=>'L', -4664=>'L', -4665=>'L', -4666=>'L', -4667=>'L', -4668=>'L', -4669=>'L', -4670=>'L', -4671=>'L', -4672=>'L', -4673=>'L', -4674=>'L', -4675=>'L', -4676=>'L', -4677=>'L', -4678=>'L', -4679=>'L', -4680=>'L', -4682=>'L', -4683=>'L', -4684=>'L', -4685=>'L', -4688=>'L', -4689=>'L', -4690=>'L', -4691=>'L', -4692=>'L', -4693=>'L', -4694=>'L', -4696=>'L', -4698=>'L', -4699=>'L', -4700=>'L', -4701=>'L', -4704=>'L', -4705=>'L', -4706=>'L', -4707=>'L', -4708=>'L', -4709=>'L', -4710=>'L', -4711=>'L', -4712=>'L', -4713=>'L', -4714=>'L', -4715=>'L', -4716=>'L', -4717=>'L', -4718=>'L', -4719=>'L', -4720=>'L', -4721=>'L', -4722=>'L', -4723=>'L', -4724=>'L', -4725=>'L', -4726=>'L', -4727=>'L', -4728=>'L', -4729=>'L', -4730=>'L', -4731=>'L', -4732=>'L', -4733=>'L', -4734=>'L', -4735=>'L', -4736=>'L', -4737=>'L', -4738=>'L', -4739=>'L', -4740=>'L', -4741=>'L', -4742=>'L', -4743=>'L', -4744=>'L', -4746=>'L', -4747=>'L', -4748=>'L', -4749=>'L', -4752=>'L', -4753=>'L', -4754=>'L', -4755=>'L', -4756=>'L', -4757=>'L', -4758=>'L', -4759=>'L', -4760=>'L', -4761=>'L', -4762=>'L', -4763=>'L', -4764=>'L', -4765=>'L', -4766=>'L', -4767=>'L', -4768=>'L', -4769=>'L', -4770=>'L', -4771=>'L', -4772=>'L', -4773=>'L', -4774=>'L', -4775=>'L', -4776=>'L', -4777=>'L', -4778=>'L', -4779=>'L', -4780=>'L', -4781=>'L', -4782=>'L', -4783=>'L', -4784=>'L', -4786=>'L', -4787=>'L', -4788=>'L', -4789=>'L', -4792=>'L', -4793=>'L', -4794=>'L', -4795=>'L', -4796=>'L', -4797=>'L', -4798=>'L', -4800=>'L', -4802=>'L', -4803=>'L', -4804=>'L', -4805=>'L', -4808=>'L', -4809=>'L', -4810=>'L', -4811=>'L', -4812=>'L', -4813=>'L', -4814=>'L', -4815=>'L', -4816=>'L', -4817=>'L', -4818=>'L', -4819=>'L', -4820=>'L', -4821=>'L', -4822=>'L', -4824=>'L', -4825=>'L', -4826=>'L', -4827=>'L', -4828=>'L', -4829=>'L', -4830=>'L', -4831=>'L', -4832=>'L', -4833=>'L', -4834=>'L', -4835=>'L', -4836=>'L', -4837=>'L', -4838=>'L', -4839=>'L', -4840=>'L', -4841=>'L', -4842=>'L', -4843=>'L', -4844=>'L', -4845=>'L', -4846=>'L', -4847=>'L', -4848=>'L', -4849=>'L', -4850=>'L', -4851=>'L', -4852=>'L', -4853=>'L', -4854=>'L', -4855=>'L', -4856=>'L', -4857=>'L', -4858=>'L', -4859=>'L', -4860=>'L', -4861=>'L', -4862=>'L', -4863=>'L', -4864=>'L', -4865=>'L', -4866=>'L', -4867=>'L', -4868=>'L', -4869=>'L', -4870=>'L', -4871=>'L', -4872=>'L', -4873=>'L', -4874=>'L', -4875=>'L', -4876=>'L', -4877=>'L', -4878=>'L', -4879=>'L', -4880=>'L', -4882=>'L', -4883=>'L', -4884=>'L', -4885=>'L', -4888=>'L', -4889=>'L', -4890=>'L', -4891=>'L', -4892=>'L', -4893=>'L', -4894=>'L', -4895=>'L', -4896=>'L', -4897=>'L', -4898=>'L', -4899=>'L', -4900=>'L', -4901=>'L', -4902=>'L', -4903=>'L', -4904=>'L', -4905=>'L', -4906=>'L', -4907=>'L', -4908=>'L', -4909=>'L', -4910=>'L', -4911=>'L', -4912=>'L', -4913=>'L', -4914=>'L', -4915=>'L', -4916=>'L', -4917=>'L', -4918=>'L', -4919=>'L', -4920=>'L', -4921=>'L', -4922=>'L', -4923=>'L', -4924=>'L', -4925=>'L', -4926=>'L', -4927=>'L', -4928=>'L', -4929=>'L', -4930=>'L', -4931=>'L', -4932=>'L', -4933=>'L', -4934=>'L', -4935=>'L', -4936=>'L', -4937=>'L', -4938=>'L', -4939=>'L', -4940=>'L', -4941=>'L', -4942=>'L', -4943=>'L', -4944=>'L', -4945=>'L', -4946=>'L', -4947=>'L', -4948=>'L', -4949=>'L', -4950=>'L', -4951=>'L', -4952=>'L', -4953=>'L', -4954=>'L', -4959=>'NSM', -4960=>'L', -4961=>'L', -4962=>'L', -4963=>'L', -4964=>'L', -4965=>'L', -4966=>'L', -4967=>'L', -4968=>'L', -4969=>'L', -4970=>'L', -4971=>'L', -4972=>'L', -4973=>'L', -4974=>'L', -4975=>'L', -4976=>'L', -4977=>'L', -4978=>'L', -4979=>'L', -4980=>'L', -4981=>'L', -4982=>'L', -4983=>'L', -4984=>'L', -4985=>'L', -4986=>'L', -4987=>'L', -4988=>'L', -4992=>'L', -4993=>'L', -4994=>'L', -4995=>'L', -4996=>'L', -4997=>'L', -4998=>'L', -4999=>'L', -5000=>'L', -5001=>'L', -5002=>'L', -5003=>'L', -5004=>'L', -5005=>'L', -5006=>'L', -5007=>'L', -5008=>'ON', -5009=>'ON', -5010=>'ON', -5011=>'ON', -5012=>'ON', -5013=>'ON', -5014=>'ON', -5015=>'ON', -5016=>'ON', -5017=>'ON', -5024=>'L', -5025=>'L', -5026=>'L', -5027=>'L', -5028=>'L', -5029=>'L', -5030=>'L', -5031=>'L', -5032=>'L', -5033=>'L', -5034=>'L', -5035=>'L', -5036=>'L', -5037=>'L', -5038=>'L', -5039=>'L', -5040=>'L', -5041=>'L', -5042=>'L', -5043=>'L', -5044=>'L', -5045=>'L', -5046=>'L', -5047=>'L', -5048=>'L', -5049=>'L', -5050=>'L', -5051=>'L', -5052=>'L', -5053=>'L', -5054=>'L', -5055=>'L', -5056=>'L', -5057=>'L', -5058=>'L', -5059=>'L', -5060=>'L', -5061=>'L', -5062=>'L', -5063=>'L', -5064=>'L', -5065=>'L', -5066=>'L', -5067=>'L', -5068=>'L', -5069=>'L', -5070=>'L', -5071=>'L', -5072=>'L', -5073=>'L', -5074=>'L', -5075=>'L', -5076=>'L', -5077=>'L', -5078=>'L', -5079=>'L', -5080=>'L', -5081=>'L', -5082=>'L', -5083=>'L', -5084=>'L', -5085=>'L', -5086=>'L', -5087=>'L', -5088=>'L', -5089=>'L', -5090=>'L', -5091=>'L', -5092=>'L', -5093=>'L', -5094=>'L', -5095=>'L', -5096=>'L', -5097=>'L', -5098=>'L', -5099=>'L', -5100=>'L', -5101=>'L', -5102=>'L', -5103=>'L', -5104=>'L', -5105=>'L', -5106=>'L', -5107=>'L', -5108=>'L', -5121=>'L', -5122=>'L', -5123=>'L', -5124=>'L', -5125=>'L', -5126=>'L', -5127=>'L', -5128=>'L', -5129=>'L', -5130=>'L', -5131=>'L', -5132=>'L', -5133=>'L', -5134=>'L', -5135=>'L', -5136=>'L', -5137=>'L', -5138=>'L', -5139=>'L', -5140=>'L', -5141=>'L', -5142=>'L', -5143=>'L', -5144=>'L', -5145=>'L', -5146=>'L', -5147=>'L', -5148=>'L', -5149=>'L', -5150=>'L', -5151=>'L', -5152=>'L', -5153=>'L', -5154=>'L', -5155=>'L', -5156=>'L', -5157=>'L', -5158=>'L', -5159=>'L', -5160=>'L', -5161=>'L', -5162=>'L', -5163=>'L', -5164=>'L', -5165=>'L', -5166=>'L', -5167=>'L', -5168=>'L', -5169=>'L', -5170=>'L', -5171=>'L', -5172=>'L', -5173=>'L', -5174=>'L', -5175=>'L', -5176=>'L', -5177=>'L', -5178=>'L', -5179=>'L', -5180=>'L', -5181=>'L', -5182=>'L', -5183=>'L', -5184=>'L', -5185=>'L', -5186=>'L', -5187=>'L', -5188=>'L', -5189=>'L', -5190=>'L', -5191=>'L', -5192=>'L', -5193=>'L', -5194=>'L', -5195=>'L', -5196=>'L', -5197=>'L', -5198=>'L', -5199=>'L', -5200=>'L', -5201=>'L', -5202=>'L', -5203=>'L', -5204=>'L', -5205=>'L', -5206=>'L', -5207=>'L', -5208=>'L', -5209=>'L', -5210=>'L', -5211=>'L', -5212=>'L', -5213=>'L', -5214=>'L', -5215=>'L', -5216=>'L', -5217=>'L', -5218=>'L', -5219=>'L', -5220=>'L', -5221=>'L', -5222=>'L', -5223=>'L', -5224=>'L', -5225=>'L', -5226=>'L', -5227=>'L', -5228=>'L', -5229=>'L', -5230=>'L', -5231=>'L', -5232=>'L', -5233=>'L', -5234=>'L', -5235=>'L', -5236=>'L', -5237=>'L', -5238=>'L', -5239=>'L', -5240=>'L', -5241=>'L', -5242=>'L', -5243=>'L', -5244=>'L', -5245=>'L', -5246=>'L', -5247=>'L', -5248=>'L', -5249=>'L', -5250=>'L', -5251=>'L', -5252=>'L', -5253=>'L', -5254=>'L', -5255=>'L', -5256=>'L', -5257=>'L', -5258=>'L', -5259=>'L', -5260=>'L', -5261=>'L', -5262=>'L', -5263=>'L', -5264=>'L', -5265=>'L', -5266=>'L', -5267=>'L', -5268=>'L', -5269=>'L', -5270=>'L', -5271=>'L', -5272=>'L', -5273=>'L', -5274=>'L', -5275=>'L', -5276=>'L', -5277=>'L', -5278=>'L', -5279=>'L', -5280=>'L', -5281=>'L', -5282=>'L', -5283=>'L', -5284=>'L', -5285=>'L', -5286=>'L', -5287=>'L', -5288=>'L', -5289=>'L', -5290=>'L', -5291=>'L', -5292=>'L', -5293=>'L', -5294=>'L', -5295=>'L', -5296=>'L', -5297=>'L', -5298=>'L', -5299=>'L', -5300=>'L', -5301=>'L', -5302=>'L', -5303=>'L', -5304=>'L', -5305=>'L', -5306=>'L', -5307=>'L', -5308=>'L', -5309=>'L', -5310=>'L', -5311=>'L', -5312=>'L', -5313=>'L', -5314=>'L', -5315=>'L', -5316=>'L', -5317=>'L', -5318=>'L', -5319=>'L', -5320=>'L', -5321=>'L', -5322=>'L', -5323=>'L', -5324=>'L', -5325=>'L', -5326=>'L', -5327=>'L', -5328=>'L', -5329=>'L', -5330=>'L', -5331=>'L', -5332=>'L', -5333=>'L', -5334=>'L', -5335=>'L', -5336=>'L', -5337=>'L', -5338=>'L', -5339=>'L', -5340=>'L', -5341=>'L', -5342=>'L', -5343=>'L', -5344=>'L', -5345=>'L', -5346=>'L', -5347=>'L', -5348=>'L', -5349=>'L', -5350=>'L', -5351=>'L', -5352=>'L', -5353=>'L', -5354=>'L', -5355=>'L', -5356=>'L', -5357=>'L', -5358=>'L', -5359=>'L', -5360=>'L', -5361=>'L', -5362=>'L', -5363=>'L', -5364=>'L', -5365=>'L', -5366=>'L', -5367=>'L', -5368=>'L', -5369=>'L', -5370=>'L', -5371=>'L', -5372=>'L', -5373=>'L', -5374=>'L', -5375=>'L', -5376=>'L', -5377=>'L', -5378=>'L', -5379=>'L', -5380=>'L', -5381=>'L', -5382=>'L', -5383=>'L', -5384=>'L', -5385=>'L', -5386=>'L', -5387=>'L', -5388=>'L', -5389=>'L', -5390=>'L', -5391=>'L', -5392=>'L', -5393=>'L', -5394=>'L', -5395=>'L', -5396=>'L', -5397=>'L', -5398=>'L', -5399=>'L', -5400=>'L', -5401=>'L', -5402=>'L', -5403=>'L', -5404=>'L', -5405=>'L', -5406=>'L', -5407=>'L', -5408=>'L', -5409=>'L', -5410=>'L', -5411=>'L', -5412=>'L', -5413=>'L', -5414=>'L', -5415=>'L', -5416=>'L', -5417=>'L', -5418=>'L', -5419=>'L', -5420=>'L', -5421=>'L', -5422=>'L', -5423=>'L', -5424=>'L', -5425=>'L', -5426=>'L', -5427=>'L', -5428=>'L', -5429=>'L', -5430=>'L', -5431=>'L', -5432=>'L', -5433=>'L', -5434=>'L', -5435=>'L', -5436=>'L', -5437=>'L', -5438=>'L', -5439=>'L', -5440=>'L', -5441=>'L', -5442=>'L', -5443=>'L', -5444=>'L', -5445=>'L', -5446=>'L', -5447=>'L', -5448=>'L', -5449=>'L', -5450=>'L', -5451=>'L', -5452=>'L', -5453=>'L', -5454=>'L', -5455=>'L', -5456=>'L', -5457=>'L', -5458=>'L', -5459=>'L', -5460=>'L', -5461=>'L', -5462=>'L', -5463=>'L', -5464=>'L', -5465=>'L', -5466=>'L', -5467=>'L', -5468=>'L', -5469=>'L', -5470=>'L', -5471=>'L', -5472=>'L', -5473=>'L', -5474=>'L', -5475=>'L', -5476=>'L', -5477=>'L', -5478=>'L', -5479=>'L', -5480=>'L', -5481=>'L', -5482=>'L', -5483=>'L', -5484=>'L', -5485=>'L', -5486=>'L', -5487=>'L', -5488=>'L', -5489=>'L', -5490=>'L', -5491=>'L', -5492=>'L', -5493=>'L', -5494=>'L', -5495=>'L', -5496=>'L', -5497=>'L', -5498=>'L', -5499=>'L', -5500=>'L', -5501=>'L', -5502=>'L', -5503=>'L', -5504=>'L', -5505=>'L', -5506=>'L', -5507=>'L', -5508=>'L', -5509=>'L', -5510=>'L', -5511=>'L', -5512=>'L', -5513=>'L', -5514=>'L', -5515=>'L', -5516=>'L', -5517=>'L', -5518=>'L', -5519=>'L', -5520=>'L', -5521=>'L', -5522=>'L', -5523=>'L', -5524=>'L', -5525=>'L', -5526=>'L', -5527=>'L', -5528=>'L', -5529=>'L', -5530=>'L', -5531=>'L', -5532=>'L', -5533=>'L', -5534=>'L', -5535=>'L', -5536=>'L', -5537=>'L', -5538=>'L', -5539=>'L', -5540=>'L', -5541=>'L', -5542=>'L', -5543=>'L', -5544=>'L', -5545=>'L', -5546=>'L', -5547=>'L', -5548=>'L', -5549=>'L', -5550=>'L', -5551=>'L', -5552=>'L', -5553=>'L', -5554=>'L', -5555=>'L', -5556=>'L', -5557=>'L', -5558=>'L', -5559=>'L', -5560=>'L', -5561=>'L', -5562=>'L', -5563=>'L', -5564=>'L', -5565=>'L', -5566=>'L', -5567=>'L', -5568=>'L', -5569=>'L', -5570=>'L', -5571=>'L', -5572=>'L', -5573=>'L', -5574=>'L', -5575=>'L', -5576=>'L', -5577=>'L', -5578=>'L', -5579=>'L', -5580=>'L', -5581=>'L', -5582=>'L', -5583=>'L', -5584=>'L', -5585=>'L', -5586=>'L', -5587=>'L', -5588=>'L', -5589=>'L', -5590=>'L', -5591=>'L', -5592=>'L', -5593=>'L', -5594=>'L', -5595=>'L', -5596=>'L', -5597=>'L', -5598=>'L', -5599=>'L', -5600=>'L', -5601=>'L', -5602=>'L', -5603=>'L', -5604=>'L', -5605=>'L', -5606=>'L', -5607=>'L', -5608=>'L', -5609=>'L', -5610=>'L', -5611=>'L', -5612=>'L', -5613=>'L', -5614=>'L', -5615=>'L', -5616=>'L', -5617=>'L', -5618=>'L', -5619=>'L', -5620=>'L', -5621=>'L', -5622=>'L', -5623=>'L', -5624=>'L', -5625=>'L', -5626=>'L', -5627=>'L', -5628=>'L', -5629=>'L', -5630=>'L', -5631=>'L', -5632=>'L', -5633=>'L', -5634=>'L', -5635=>'L', -5636=>'L', -5637=>'L', -5638=>'L', -5639=>'L', -5640=>'L', -5641=>'L', -5642=>'L', -5643=>'L', -5644=>'L', -5645=>'L', -5646=>'L', -5647=>'L', -5648=>'L', -5649=>'L', -5650=>'L', -5651=>'L', -5652=>'L', -5653=>'L', -5654=>'L', -5655=>'L', -5656=>'L', -5657=>'L', -5658=>'L', -5659=>'L', -5660=>'L', -5661=>'L', -5662=>'L', -5663=>'L', -5664=>'L', -5665=>'L', -5666=>'L', -5667=>'L', -5668=>'L', -5669=>'L', -5670=>'L', -5671=>'L', -5672=>'L', -5673=>'L', -5674=>'L', -5675=>'L', -5676=>'L', -5677=>'L', -5678=>'L', -5679=>'L', -5680=>'L', -5681=>'L', -5682=>'L', -5683=>'L', -5684=>'L', -5685=>'L', -5686=>'L', -5687=>'L', -5688=>'L', -5689=>'L', -5690=>'L', -5691=>'L', -5692=>'L', -5693=>'L', -5694=>'L', -5695=>'L', -5696=>'L', -5697=>'L', -5698=>'L', -5699=>'L', -5700=>'L', -5701=>'L', -5702=>'L', -5703=>'L', -5704=>'L', -5705=>'L', -5706=>'L', -5707=>'L', -5708=>'L', -5709=>'L', -5710=>'L', -5711=>'L', -5712=>'L', -5713=>'L', -5714=>'L', -5715=>'L', -5716=>'L', -5717=>'L', -5718=>'L', -5719=>'L', -5720=>'L', -5721=>'L', -5722=>'L', -5723=>'L', -5724=>'L', -5725=>'L', -5726=>'L', -5727=>'L', -5728=>'L', -5729=>'L', -5730=>'L', -5731=>'L', -5732=>'L', -5733=>'L', -5734=>'L', -5735=>'L', -5736=>'L', -5737=>'L', -5738=>'L', -5739=>'L', -5740=>'L', -5741=>'L', -5742=>'L', -5743=>'L', -5744=>'L', -5745=>'L', -5746=>'L', -5747=>'L', -5748=>'L', -5749=>'L', -5750=>'L', -5760=>'WS', -5761=>'L', -5762=>'L', -5763=>'L', -5764=>'L', -5765=>'L', -5766=>'L', -5767=>'L', -5768=>'L', -5769=>'L', -5770=>'L', -5771=>'L', -5772=>'L', -5773=>'L', -5774=>'L', -5775=>'L', -5776=>'L', -5777=>'L', -5778=>'L', -5779=>'L', -5780=>'L', -5781=>'L', -5782=>'L', -5783=>'L', -5784=>'L', -5785=>'L', -5786=>'L', -5787=>'ON', -5788=>'ON', -5792=>'L', -5793=>'L', -5794=>'L', -5795=>'L', -5796=>'L', -5797=>'L', -5798=>'L', -5799=>'L', -5800=>'L', -5801=>'L', -5802=>'L', -5803=>'L', -5804=>'L', -5805=>'L', -5806=>'L', -5807=>'L', -5808=>'L', -5809=>'L', -5810=>'L', -5811=>'L', -5812=>'L', -5813=>'L', -5814=>'L', -5815=>'L', -5816=>'L', -5817=>'L', -5818=>'L', -5819=>'L', -5820=>'L', -5821=>'L', -5822=>'L', -5823=>'L', -5824=>'L', -5825=>'L', -5826=>'L', -5827=>'L', -5828=>'L', -5829=>'L', -5830=>'L', -5831=>'L', -5832=>'L', -5833=>'L', -5834=>'L', -5835=>'L', -5836=>'L', -5837=>'L', -5838=>'L', -5839=>'L', -5840=>'L', -5841=>'L', -5842=>'L', -5843=>'L', -5844=>'L', -5845=>'L', -5846=>'L', -5847=>'L', -5848=>'L', -5849=>'L', -5850=>'L', -5851=>'L', -5852=>'L', -5853=>'L', -5854=>'L', -5855=>'L', -5856=>'L', -5857=>'L', -5858=>'L', -5859=>'L', -5860=>'L', -5861=>'L', -5862=>'L', -5863=>'L', -5864=>'L', -5865=>'L', -5866=>'L', -5867=>'L', -5868=>'L', -5869=>'L', -5870=>'L', -5871=>'L', -5872=>'L', -5888=>'L', -5889=>'L', -5890=>'L', -5891=>'L', -5892=>'L', -5893=>'L', -5894=>'L', -5895=>'L', -5896=>'L', -5897=>'L', -5898=>'L', -5899=>'L', -5900=>'L', -5902=>'L', -5903=>'L', -5904=>'L', -5905=>'L', -5906=>'NSM', -5907=>'NSM', -5908=>'NSM', -5920=>'L', -5921=>'L', -5922=>'L', -5923=>'L', -5924=>'L', -5925=>'L', -5926=>'L', -5927=>'L', -5928=>'L', -5929=>'L', -5930=>'L', -5931=>'L', -5932=>'L', -5933=>'L', -5934=>'L', -5935=>'L', -5936=>'L', -5937=>'L', -5938=>'NSM', -5939=>'NSM', -5940=>'NSM', -5941=>'L', -5942=>'L', -5952=>'L', -5953=>'L', -5954=>'L', -5955=>'L', -5956=>'L', -5957=>'L', -5958=>'L', -5959=>'L', -5960=>'L', -5961=>'L', -5962=>'L', -5963=>'L', -5964=>'L', -5965=>'L', -5966=>'L', -5967=>'L', -5968=>'L', -5969=>'L', -5970=>'NSM', -5971=>'NSM', -5984=>'L', -5985=>'L', -5986=>'L', -5987=>'L', -5988=>'L', -5989=>'L', -5990=>'L', -5991=>'L', -5992=>'L', -5993=>'L', -5994=>'L', -5995=>'L', -5996=>'L', -5998=>'L', -5999=>'L', -6000=>'L', -6002=>'NSM', -6003=>'NSM', -6016=>'L', -6017=>'L', -6018=>'L', -6019=>'L', -6020=>'L', -6021=>'L', -6022=>'L', -6023=>'L', -6024=>'L', -6025=>'L', -6026=>'L', -6027=>'L', -6028=>'L', -6029=>'L', -6030=>'L', -6031=>'L', -6032=>'L', -6033=>'L', -6034=>'L', -6035=>'L', -6036=>'L', -6037=>'L', -6038=>'L', -6039=>'L', -6040=>'L', -6041=>'L', -6042=>'L', -6043=>'L', -6044=>'L', -6045=>'L', -6046=>'L', -6047=>'L', -6048=>'L', -6049=>'L', -6050=>'L', -6051=>'L', -6052=>'L', -6053=>'L', -6054=>'L', -6055=>'L', -6056=>'L', -6057=>'L', -6058=>'L', -6059=>'L', -6060=>'L', -6061=>'L', -6062=>'L', -6063=>'L', -6064=>'L', -6065=>'L', -6066=>'L', -6067=>'L', -6068=>'L', -6069=>'L', -6070=>'L', -6071=>'NSM', -6072=>'NSM', -6073=>'NSM', -6074=>'NSM', -6075=>'NSM', -6076=>'NSM', -6077=>'NSM', -6078=>'L', -6079=>'L', -6080=>'L', -6081=>'L', -6082=>'L', -6083=>'L', -6084=>'L', -6085=>'L', -6086=>'NSM', -6087=>'L', -6088=>'L', -6089=>'NSM', -6090=>'NSM', -6091=>'NSM', -6092=>'NSM', -6093=>'NSM', -6094=>'NSM', -6095=>'NSM', -6096=>'NSM', -6097=>'NSM', -6098=>'NSM', -6099=>'NSM', -6100=>'L', -6101=>'L', -6102=>'L', -6103=>'L', -6104=>'L', -6105=>'L', -6106=>'L', -6107=>'ET', -6108=>'L', -6109=>'NSM', -6112=>'L', -6113=>'L', -6114=>'L', -6115=>'L', -6116=>'L', -6117=>'L', -6118=>'L', -6119=>'L', -6120=>'L', -6121=>'L', -6128=>'ON', -6129=>'ON', -6130=>'ON', -6131=>'ON', -6132=>'ON', -6133=>'ON', -6134=>'ON', -6135=>'ON', -6136=>'ON', -6137=>'ON', -6144=>'ON', -6145=>'ON', -6146=>'ON', -6147=>'ON', -6148=>'ON', -6149=>'ON', -6150=>'ON', -6151=>'ON', -6152=>'ON', -6153=>'ON', -6154=>'ON', -6155=>'NSM', -6156=>'NSM', -6157=>'NSM', -6158=>'WS', -6160=>'L', -6161=>'L', -6162=>'L', -6163=>'L', -6164=>'L', -6165=>'L', -6166=>'L', -6167=>'L', -6168=>'L', -6169=>'L', -6176=>'L', -6177=>'L', -6178=>'L', -6179=>'L', -6180=>'L', -6181=>'L', -6182=>'L', -6183=>'L', -6184=>'L', -6185=>'L', -6186=>'L', -6187=>'L', -6188=>'L', -6189=>'L', -6190=>'L', -6191=>'L', -6192=>'L', -6193=>'L', -6194=>'L', -6195=>'L', -6196=>'L', -6197=>'L', -6198=>'L', -6199=>'L', -6200=>'L', -6201=>'L', -6202=>'L', -6203=>'L', -6204=>'L', -6205=>'L', -6206=>'L', -6207=>'L', -6208=>'L', -6209=>'L', -6210=>'L', -6211=>'L', -6212=>'L', -6213=>'L', -6214=>'L', -6215=>'L', -6216=>'L', -6217=>'L', -6218=>'L', -6219=>'L', -6220=>'L', -6221=>'L', -6222=>'L', -6223=>'L', -6224=>'L', -6225=>'L', -6226=>'L', -6227=>'L', -6228=>'L', -6229=>'L', -6230=>'L', -6231=>'L', -6232=>'L', -6233=>'L', -6234=>'L', -6235=>'L', -6236=>'L', -6237=>'L', -6238=>'L', -6239=>'L', -6240=>'L', -6241=>'L', -6242=>'L', -6243=>'L', -6244=>'L', -6245=>'L', -6246=>'L', -6247=>'L', -6248=>'L', -6249=>'L', -6250=>'L', -6251=>'L', -6252=>'L', -6253=>'L', -6254=>'L', -6255=>'L', -6256=>'L', -6257=>'L', -6258=>'L', -6259=>'L', -6260=>'L', -6261=>'L', -6262=>'L', -6263=>'L', -6272=>'L', -6273=>'L', -6274=>'L', -6275=>'L', -6276=>'L', -6277=>'L', -6278=>'L', -6279=>'L', -6280=>'L', -6281=>'L', -6282=>'L', -6283=>'L', -6284=>'L', -6285=>'L', -6286=>'L', -6287=>'L', -6288=>'L', -6289=>'L', -6290=>'L', -6291=>'L', -6292=>'L', -6293=>'L', -6294=>'L', -6295=>'L', -6296=>'L', -6297=>'L', -6298=>'L', -6299=>'L', -6300=>'L', -6301=>'L', -6302=>'L', -6303=>'L', -6304=>'L', -6305=>'L', -6306=>'L', -6307=>'L', -6308=>'L', -6309=>'L', -6310=>'L', -6311=>'L', -6312=>'L', -6313=>'NSM', -6400=>'L', -6401=>'L', -6402=>'L', -6403=>'L', -6404=>'L', -6405=>'L', -6406=>'L', -6407=>'L', -6408=>'L', -6409=>'L', -6410=>'L', -6411=>'L', -6412=>'L', -6413=>'L', -6414=>'L', -6415=>'L', -6416=>'L', -6417=>'L', -6418=>'L', -6419=>'L', -6420=>'L', -6421=>'L', -6422=>'L', -6423=>'L', -6424=>'L', -6425=>'L', -6426=>'L', -6427=>'L', -6428=>'L', -6432=>'NSM', -6433=>'NSM', -6434=>'NSM', -6435=>'L', -6436=>'L', -6437=>'L', -6438=>'L', -6439=>'NSM', -6440=>'NSM', -6441=>'NSM', -6442=>'NSM', -6443=>'NSM', -6448=>'L', -6449=>'L', -6450=>'NSM', -6451=>'L', -6452=>'L', -6453=>'L', -6454=>'L', -6455=>'L', -6456=>'L', -6457=>'NSM', -6458=>'NSM', -6459=>'NSM', -6464=>'ON', -6468=>'ON', -6469=>'ON', -6470=>'L', -6471=>'L', -6472=>'L', -6473=>'L', -6474=>'L', -6475=>'L', -6476=>'L', -6477=>'L', -6478=>'L', -6479=>'L', -6480=>'L', -6481=>'L', -6482=>'L', -6483=>'L', -6484=>'L', -6485=>'L', -6486=>'L', -6487=>'L', -6488=>'L', -6489=>'L', -6490=>'L', -6491=>'L', -6492=>'L', -6493=>'L', -6494=>'L', -6495=>'L', -6496=>'L', -6497=>'L', -6498=>'L', -6499=>'L', -6500=>'L', -6501=>'L', -6502=>'L', -6503=>'L', -6504=>'L', -6505=>'L', -6506=>'L', -6507=>'L', -6508=>'L', -6509=>'L', -6512=>'L', -6513=>'L', -6514=>'L', -6515=>'L', -6516=>'L', -6528=>'L', -6529=>'L', -6530=>'L', -6531=>'L', -6532=>'L', -6533=>'L', -6534=>'L', -6535=>'L', -6536=>'L', -6537=>'L', -6538=>'L', -6539=>'L', -6540=>'L', -6541=>'L', -6542=>'L', -6543=>'L', -6544=>'L', -6545=>'L', -6546=>'L', -6547=>'L', -6548=>'L', -6549=>'L', -6550=>'L', -6551=>'L', -6552=>'L', -6553=>'L', -6554=>'L', -6555=>'L', -6556=>'L', -6557=>'L', -6558=>'L', -6559=>'L', -6560=>'L', -6561=>'L', -6562=>'L', -6563=>'L', -6564=>'L', -6565=>'L', -6566=>'L', -6567=>'L', -6568=>'L', -6569=>'L', -6576=>'L', -6577=>'L', -6578=>'L', -6579=>'L', -6580=>'L', -6581=>'L', -6582=>'L', -6583=>'L', -6584=>'L', -6585=>'L', -6586=>'L', -6587=>'L', -6588=>'L', -6589=>'L', -6590=>'L', -6591=>'L', -6592=>'L', -6593=>'L', -6594=>'L', -6595=>'L', -6596=>'L', -6597=>'L', -6598=>'L', -6599=>'L', -6600=>'L', -6601=>'L', -6608=>'L', -6609=>'L', -6610=>'L', -6611=>'L', -6612=>'L', -6613=>'L', -6614=>'L', -6615=>'L', -6616=>'L', -6617=>'L', -6622=>'ON', -6623=>'ON', -6624=>'ON', -6625=>'ON', -6626=>'ON', -6627=>'ON', -6628=>'ON', -6629=>'ON', -6630=>'ON', -6631=>'ON', -6632=>'ON', -6633=>'ON', -6634=>'ON', -6635=>'ON', -6636=>'ON', -6637=>'ON', -6638=>'ON', -6639=>'ON', -6640=>'ON', -6641=>'ON', -6642=>'ON', -6643=>'ON', -6644=>'ON', -6645=>'ON', -6646=>'ON', -6647=>'ON', -6648=>'ON', -6649=>'ON', -6650=>'ON', -6651=>'ON', -6652=>'ON', -6653=>'ON', -6654=>'ON', -6655=>'ON', -6656=>'L', -6657=>'L', -6658=>'L', -6659=>'L', -6660=>'L', -6661=>'L', -6662=>'L', -6663=>'L', -6664=>'L', -6665=>'L', -6666=>'L', -6667=>'L', -6668=>'L', -6669=>'L', -6670=>'L', -6671=>'L', -6672=>'L', -6673=>'L', -6674=>'L', -6675=>'L', -6676=>'L', -6677=>'L', -6678=>'L', -6679=>'NSM', -6680=>'NSM', -6681=>'L', -6682=>'L', -6683=>'L', -6686=>'L', -6687=>'L', -6912=>'NSM', -6913=>'NSM', -6914=>'NSM', -6915=>'NSM', -6916=>'L', -6917=>'L', -6918=>'L', -6919=>'L', -6920=>'L', -6921=>'L', -6922=>'L', -6923=>'L', -6924=>'L', -6925=>'L', -6926=>'L', -6927=>'L', -6928=>'L', -6929=>'L', -6930=>'L', -6931=>'L', -6932=>'L', -6933=>'L', -6934=>'L', -6935=>'L', -6936=>'L', -6937=>'L', -6938=>'L', -6939=>'L', -6940=>'L', -6941=>'L', -6942=>'L', -6943=>'L', -6944=>'L', -6945=>'L', -6946=>'L', -6947=>'L', -6948=>'L', -6949=>'L', -6950=>'L', -6951=>'L', -6952=>'L', -6953=>'L', -6954=>'L', -6955=>'L', -6956=>'L', -6957=>'L', -6958=>'L', -6959=>'L', -6960=>'L', -6961=>'L', -6962=>'L', -6963=>'L', -6964=>'NSM', -6965=>'L', -6966=>'NSM', -6967=>'NSM', -6968=>'NSM', -6969=>'NSM', -6970=>'NSM', -6971=>'L', -6972=>'NSM', -6973=>'L', -6974=>'L', -6975=>'L', -6976=>'L', -6977=>'L', -6978=>'NSM', -6979=>'L', -6980=>'L', -6981=>'L', -6982=>'L', -6983=>'L', -6984=>'L', -6985=>'L', -6986=>'L', -6987=>'L', -6992=>'L', -6993=>'L', -6994=>'L', -6995=>'L', -6996=>'L', -6997=>'L', -6998=>'L', -6999=>'L', -7000=>'L', -7001=>'L', -7002=>'L', -7003=>'L', -7004=>'L', -7005=>'L', -7006=>'L', -7007=>'L', -7008=>'L', -7009=>'L', -7010=>'L', -7011=>'L', -7012=>'L', -7013=>'L', -7014=>'L', -7015=>'L', -7016=>'L', -7017=>'L', -7018=>'L', -7019=>'NSM', -7020=>'NSM', -7021=>'NSM', -7022=>'NSM', -7023=>'NSM', -7024=>'NSM', -7025=>'NSM', -7026=>'NSM', -7027=>'NSM', -7028=>'L', -7029=>'L', -7030=>'L', -7031=>'L', -7032=>'L', -7033=>'L', -7034=>'L', -7035=>'L', -7036=>'L', -7424=>'L', -7425=>'L', -7426=>'L', -7427=>'L', -7428=>'L', -7429=>'L', -7430=>'L', -7431=>'L', -7432=>'L', -7433=>'L', -7434=>'L', -7435=>'L', -7436=>'L', -7437=>'L', -7438=>'L', -7439=>'L', -7440=>'L', -7441=>'L', -7442=>'L', -7443=>'L', -7444=>'L', -7445=>'L', -7446=>'L', -7447=>'L', -7448=>'L', -7449=>'L', -7450=>'L', -7451=>'L', -7452=>'L', -7453=>'L', -7454=>'L', -7455=>'L', -7456=>'L', -7457=>'L', -7458=>'L', -7459=>'L', -7460=>'L', -7461=>'L', -7462=>'L', -7463=>'L', -7464=>'L', -7465=>'L', -7466=>'L', -7467=>'L', -7468=>'L', -7469=>'L', -7470=>'L', -7471=>'L', -7472=>'L', -7473=>'L', -7474=>'L', -7475=>'L', -7476=>'L', -7477=>'L', -7478=>'L', -7479=>'L', -7480=>'L', -7481=>'L', -7482=>'L', -7483=>'L', -7484=>'L', -7485=>'L', -7486=>'L', -7487=>'L', -7488=>'L', -7489=>'L', -7490=>'L', -7491=>'L', -7492=>'L', -7493=>'L', -7494=>'L', -7495=>'L', -7496=>'L', -7497=>'L', -7498=>'L', -7499=>'L', -7500=>'L', -7501=>'L', -7502=>'L', -7503=>'L', -7504=>'L', -7505=>'L', -7506=>'L', -7507=>'L', -7508=>'L', -7509=>'L', -7510=>'L', -7511=>'L', -7512=>'L', -7513=>'L', -7514=>'L', -7515=>'L', -7516=>'L', -7517=>'L', -7518=>'L', -7519=>'L', -7520=>'L', -7521=>'L', -7522=>'L', -7523=>'L', -7524=>'L', -7525=>'L', -7526=>'L', -7527=>'L', -7528=>'L', -7529=>'L', -7530=>'L', -7531=>'L', -7532=>'L', -7533=>'L', -7534=>'L', -7535=>'L', -7536=>'L', -7537=>'L', -7538=>'L', -7539=>'L', -7540=>'L', -7541=>'L', -7542=>'L', -7543=>'L', -7544=>'L', -7545=>'L', -7546=>'L', -7547=>'L', -7548=>'L', -7549=>'L', -7550=>'L', -7551=>'L', -7552=>'L', -7553=>'L', -7554=>'L', -7555=>'L', -7556=>'L', -7557=>'L', -7558=>'L', -7559=>'L', -7560=>'L', -7561=>'L', -7562=>'L', -7563=>'L', -7564=>'L', -7565=>'L', -7566=>'L', -7567=>'L', -7568=>'L', -7569=>'L', -7570=>'L', -7571=>'L', -7572=>'L', -7573=>'L', -7574=>'L', -7575=>'L', -7576=>'L', -7577=>'L', -7578=>'L', -7579=>'L', -7580=>'L', -7581=>'L', -7582=>'L', -7583=>'L', -7584=>'L', -7585=>'L', -7586=>'L', -7587=>'L', -7588=>'L', -7589=>'L', -7590=>'L', -7591=>'L', -7592=>'L', -7593=>'L', -7594=>'L', -7595=>'L', -7596=>'L', -7597=>'L', -7598=>'L', -7599=>'L', -7600=>'L', -7601=>'L', -7602=>'L', -7603=>'L', -7604=>'L', -7605=>'L', -7606=>'L', -7607=>'L', -7608=>'L', -7609=>'L', -7610=>'L', -7611=>'L', -7612=>'L', -7613=>'L', -7614=>'L', -7615=>'L', -7616=>'NSM', -7617=>'NSM', -7618=>'NSM', -7619=>'NSM', -7620=>'NSM', -7621=>'NSM', -7622=>'NSM', -7623=>'NSM', -7624=>'NSM', -7625=>'NSM', -7626=>'NSM', -7678=>'NSM', -7679=>'NSM', -7680=>'L', -7681=>'L', -7682=>'L', -7683=>'L', -7684=>'L', -7685=>'L', -7686=>'L', -7687=>'L', -7688=>'L', -7689=>'L', -7690=>'L', -7691=>'L', -7692=>'L', -7693=>'L', -7694=>'L', -7695=>'L', -7696=>'L', -7697=>'L', -7698=>'L', -7699=>'L', -7700=>'L', -7701=>'L', -7702=>'L', -7703=>'L', -7704=>'L', -7705=>'L', -7706=>'L', -7707=>'L', -7708=>'L', -7709=>'L', -7710=>'L', -7711=>'L', -7712=>'L', -7713=>'L', -7714=>'L', -7715=>'L', -7716=>'L', -7717=>'L', -7718=>'L', -7719=>'L', -7720=>'L', -7721=>'L', -7722=>'L', -7723=>'L', -7724=>'L', -7725=>'L', -7726=>'L', -7727=>'L', -7728=>'L', -7729=>'L', -7730=>'L', -7731=>'L', -7732=>'L', -7733=>'L', -7734=>'L', -7735=>'L', -7736=>'L', -7737=>'L', -7738=>'L', -7739=>'L', -7740=>'L', -7741=>'L', -7742=>'L', -7743=>'L', -7744=>'L', -7745=>'L', -7746=>'L', -7747=>'L', -7748=>'L', -7749=>'L', -7750=>'L', -7751=>'L', -7752=>'L', -7753=>'L', -7754=>'L', -7755=>'L', -7756=>'L', -7757=>'L', -7758=>'L', -7759=>'L', -7760=>'L', -7761=>'L', -7762=>'L', -7763=>'L', -7764=>'L', -7765=>'L', -7766=>'L', -7767=>'L', -7768=>'L', -7769=>'L', -7770=>'L', -7771=>'L', -7772=>'L', -7773=>'L', -7774=>'L', -7775=>'L', -7776=>'L', -7777=>'L', -7778=>'L', -7779=>'L', -7780=>'L', -7781=>'L', -7782=>'L', -7783=>'L', -7784=>'L', -7785=>'L', -7786=>'L', -7787=>'L', -7788=>'L', -7789=>'L', -7790=>'L', -7791=>'L', -7792=>'L', -7793=>'L', -7794=>'L', -7795=>'L', -7796=>'L', -7797=>'L', -7798=>'L', -7799=>'L', -7800=>'L', -7801=>'L', -7802=>'L', -7803=>'L', -7804=>'L', -7805=>'L', -7806=>'L', -7807=>'L', -7808=>'L', -7809=>'L', -7810=>'L', -7811=>'L', -7812=>'L', -7813=>'L', -7814=>'L', -7815=>'L', -7816=>'L', -7817=>'L', -7818=>'L', -7819=>'L', -7820=>'L', -7821=>'L', -7822=>'L', -7823=>'L', -7824=>'L', -7825=>'L', -7826=>'L', -7827=>'L', -7828=>'L', -7829=>'L', -7830=>'L', -7831=>'L', -7832=>'L', -7833=>'L', -7834=>'L', -7835=>'L', -7840=>'L', -7841=>'L', -7842=>'L', -7843=>'L', -7844=>'L', -7845=>'L', -7846=>'L', -7847=>'L', -7848=>'L', -7849=>'L', -7850=>'L', -7851=>'L', -7852=>'L', -7853=>'L', -7854=>'L', -7855=>'L', -7856=>'L', -7857=>'L', -7858=>'L', -7859=>'L', -7860=>'L', -7861=>'L', -7862=>'L', -7863=>'L', -7864=>'L', -7865=>'L', -7866=>'L', -7867=>'L', -7868=>'L', -7869=>'L', -7870=>'L', -7871=>'L', -7872=>'L', -7873=>'L', -7874=>'L', -7875=>'L', -7876=>'L', -7877=>'L', -7878=>'L', -7879=>'L', -7880=>'L', -7881=>'L', -7882=>'L', -7883=>'L', -7884=>'L', -7885=>'L', -7886=>'L', -7887=>'L', -7888=>'L', -7889=>'L', -7890=>'L', -7891=>'L', -7892=>'L', -7893=>'L', -7894=>'L', -7895=>'L', -7896=>'L', -7897=>'L', -7898=>'L', -7899=>'L', -7900=>'L', -7901=>'L', -7902=>'L', -7903=>'L', -7904=>'L', -7905=>'L', -7906=>'L', -7907=>'L', -7908=>'L', -7909=>'L', -7910=>'L', -7911=>'L', -7912=>'L', -7913=>'L', -7914=>'L', -7915=>'L', -7916=>'L', -7917=>'L', -7918=>'L', -7919=>'L', -7920=>'L', -7921=>'L', -7922=>'L', -7923=>'L', -7924=>'L', -7925=>'L', -7926=>'L', -7927=>'L', -7928=>'L', -7929=>'L', -7936=>'L', -7937=>'L', -7938=>'L', -7939=>'L', -7940=>'L', -7941=>'L', -7942=>'L', -7943=>'L', -7944=>'L', -7945=>'L', -7946=>'L', -7947=>'L', -7948=>'L', -7949=>'L', -7950=>'L', -7951=>'L', -7952=>'L', -7953=>'L', -7954=>'L', -7955=>'L', -7956=>'L', -7957=>'L', -7960=>'L', -7961=>'L', -7962=>'L', -7963=>'L', -7964=>'L', -7965=>'L', -7968=>'L', -7969=>'L', -7970=>'L', -7971=>'L', -7972=>'L', -7973=>'L', -7974=>'L', -7975=>'L', -7976=>'L', -7977=>'L', -7978=>'L', -7979=>'L', -7980=>'L', -7981=>'L', -7982=>'L', -7983=>'L', -7984=>'L', -7985=>'L', -7986=>'L', -7987=>'L', -7988=>'L', -7989=>'L', -7990=>'L', -7991=>'L', -7992=>'L', -7993=>'L', -7994=>'L', -7995=>'L', -7996=>'L', -7997=>'L', -7998=>'L', -7999=>'L', -8000=>'L', -8001=>'L', -8002=>'L', -8003=>'L', -8004=>'L', -8005=>'L', -8008=>'L', -8009=>'L', -8010=>'L', -8011=>'L', -8012=>'L', -8013=>'L', -8016=>'L', -8017=>'L', -8018=>'L', -8019=>'L', -8020=>'L', -8021=>'L', -8022=>'L', -8023=>'L', -8025=>'L', -8027=>'L', -8029=>'L', -8031=>'L', -8032=>'L', -8033=>'L', -8034=>'L', -8035=>'L', -8036=>'L', -8037=>'L', -8038=>'L', -8039=>'L', -8040=>'L', -8041=>'L', -8042=>'L', -8043=>'L', -8044=>'L', -8045=>'L', -8046=>'L', -8047=>'L', -8048=>'L', -8049=>'L', -8050=>'L', -8051=>'L', -8052=>'L', -8053=>'L', -8054=>'L', -8055=>'L', -8056=>'L', -8057=>'L', -8058=>'L', -8059=>'L', -8060=>'L', -8061=>'L', -8064=>'L', -8065=>'L', -8066=>'L', -8067=>'L', -8068=>'L', -8069=>'L', -8070=>'L', -8071=>'L', -8072=>'L', -8073=>'L', -8074=>'L', -8075=>'L', -8076=>'L', -8077=>'L', -8078=>'L', -8079=>'L', -8080=>'L', -8081=>'L', -8082=>'L', -8083=>'L', -8084=>'L', -8085=>'L', -8086=>'L', -8087=>'L', -8088=>'L', -8089=>'L', -8090=>'L', -8091=>'L', -8092=>'L', -8093=>'L', -8094=>'L', -8095=>'L', -8096=>'L', -8097=>'L', -8098=>'L', -8099=>'L', -8100=>'L', -8101=>'L', -8102=>'L', -8103=>'L', -8104=>'L', -8105=>'L', -8106=>'L', -8107=>'L', -8108=>'L', -8109=>'L', -8110=>'L', -8111=>'L', -8112=>'L', -8113=>'L', -8114=>'L', -8115=>'L', -8116=>'L', -8118=>'L', -8119=>'L', -8120=>'L', -8121=>'L', -8122=>'L', -8123=>'L', -8124=>'L', -8125=>'ON', -8126=>'L', -8127=>'ON', -8128=>'ON', -8129=>'ON', -8130=>'L', -8131=>'L', -8132=>'L', -8134=>'L', -8135=>'L', -8136=>'L', -8137=>'L', -8138=>'L', -8139=>'L', -8140=>'L', -8141=>'ON', -8142=>'ON', -8143=>'ON', -8144=>'L', -8145=>'L', -8146=>'L', -8147=>'L', -8150=>'L', -8151=>'L', -8152=>'L', -8153=>'L', -8154=>'L', -8155=>'L', -8157=>'ON', -8158=>'ON', -8159=>'ON', -8160=>'L', -8161=>'L', -8162=>'L', -8163=>'L', -8164=>'L', -8165=>'L', -8166=>'L', -8167=>'L', -8168=>'L', -8169=>'L', -8170=>'L', -8171=>'L', -8172=>'L', -8173=>'ON', -8174=>'ON', -8175=>'ON', -8178=>'L', -8179=>'L', -8180=>'L', -8182=>'L', -8183=>'L', -8184=>'L', -8185=>'L', -8186=>'L', -8187=>'L', -8188=>'L', -8189=>'ON', -8190=>'ON', -8192=>'WS', -8193=>'WS', -8194=>'WS', -8195=>'WS', -8196=>'WS', -8197=>'WS', -8198=>'WS', -8199=>'WS', -8200=>'WS', -8201=>'WS', -8202=>'WS', -8203=>'BN', -8204=>'BN', -8205=>'BN', -8206=>'L', -8207=>'R', -8208=>'ON', -8209=>'ON', -8210=>'ON', -8211=>'ON', -8212=>'ON', -8213=>'ON', -8214=>'ON', -8215=>'ON', -8216=>'ON', -8217=>'ON', -8218=>'ON', -8219=>'ON', -8220=>'ON', -8221=>'ON', -8222=>'ON', -8223=>'ON', -8224=>'ON', -8225=>'ON', -8226=>'ON', -8227=>'ON', -8228=>'ON', -8229=>'ON', -8230=>'ON', -8231=>'ON', -8232=>'WS', -8233=>'B', -8234=>'LRE', -8235=>'RLE', -8236=>'PDF', -8237=>'LRO', -8238=>'RLO', -8239=>'CS', -8240=>'ET', -8241=>'ET', -8242=>'ET', -8243=>'ET', -8244=>'ET', -8245=>'ON', -8246=>'ON', -8247=>'ON', -8248=>'ON', -8249=>'ON', -8250=>'ON', -8251=>'ON', -8252=>'ON', -8253=>'ON', -8254=>'ON', -8255=>'ON', -8256=>'ON', -8257=>'ON', -8258=>'ON', -8259=>'ON', -8260=>'CS', -8261=>'ON', -8262=>'ON', -8263=>'ON', -8264=>'ON', -8265=>'ON', -8266=>'ON', -8267=>'ON', -8268=>'ON', -8269=>'ON', -8270=>'ON', -8271=>'ON', -8272=>'ON', -8273=>'ON', -8274=>'ON', -8275=>'ON', -8276=>'ON', -8277=>'ON', -8278=>'ON', -8279=>'ON', -8280=>'ON', -8281=>'ON', -8282=>'ON', -8283=>'ON', -8284=>'ON', -8285=>'ON', -8286=>'ON', -8287=>'WS', -8288=>'BN', -8289=>'BN', -8290=>'BN', -8291=>'BN', -8298=>'BN', -8299=>'BN', -8300=>'BN', -8301=>'BN', -8302=>'BN', -8303=>'BN', -8304=>'EN', -8305=>'L', -8308=>'EN', -8309=>'EN', -8310=>'EN', -8311=>'EN', -8312=>'EN', -8313=>'EN', -8314=>'ES', -8315=>'ES', -8316=>'ON', -8317=>'ON', -8318=>'ON', -8319=>'L', -8320=>'EN', -8321=>'EN', -8322=>'EN', -8323=>'EN', -8324=>'EN', -8325=>'EN', -8326=>'EN', -8327=>'EN', -8328=>'EN', -8329=>'EN', -8330=>'ES', -8331=>'ES', -8332=>'ON', -8333=>'ON', -8334=>'ON', -8336=>'L', -8337=>'L', -8338=>'L', -8339=>'L', -8340=>'L', -8352=>'ET', -8353=>'ET', -8354=>'ET', -8355=>'ET', -8356=>'ET', -8357=>'ET', -8358=>'ET', -8359=>'ET', -8360=>'ET', -8361=>'ET', -8362=>'ET', -8363=>'ET', -8364=>'ET', -8365=>'ET', -8366=>'ET', -8367=>'ET', -8368=>'ET', -8369=>'ET', -8370=>'ET', -8371=>'ET', -8372=>'ET', -8373=>'ET', -8400=>'NSM', -8401=>'NSM', -8402=>'NSM', -8403=>'NSM', -8404=>'NSM', -8405=>'NSM', -8406=>'NSM', -8407=>'NSM', -8408=>'NSM', -8409=>'NSM', -8410=>'NSM', -8411=>'NSM', -8412=>'NSM', -8413=>'NSM', -8414=>'NSM', -8415=>'NSM', -8416=>'NSM', -8417=>'NSM', -8418=>'NSM', -8419=>'NSM', -8420=>'NSM', -8421=>'NSM', -8422=>'NSM', -8423=>'NSM', -8424=>'NSM', -8425=>'NSM', -8426=>'NSM', -8427=>'NSM', -8428=>'NSM', -8429=>'NSM', -8430=>'NSM', -8431=>'NSM', -8448=>'ON', -8449=>'ON', -8450=>'L', -8451=>'ON', -8452=>'ON', -8453=>'ON', -8454=>'ON', -8455=>'L', -8456=>'ON', -8457=>'ON', -8458=>'L', -8459=>'L', -8460=>'L', -8461=>'L', -8462=>'L', -8463=>'L', -8464=>'L', -8465=>'L', -8466=>'L', -8467=>'L', -8468=>'ON', -8469=>'L', -8470=>'ON', -8471=>'ON', -8472=>'ON', -8473=>'L', -8474=>'L', -8475=>'L', -8476=>'L', -8477=>'L', -8478=>'ON', -8479=>'ON', -8480=>'ON', -8481=>'ON', -8482=>'ON', -8483=>'ON', -8484=>'L', -8485=>'ON', -8486=>'L', -8487=>'ON', -8488=>'L', -8489=>'ON', -8490=>'L', -8491=>'L', -8492=>'L', -8493=>'L', -8494=>'ET', -8495=>'L', -8496=>'L', -8497=>'L', -8498=>'L', -8499=>'L', -8500=>'L', -8501=>'L', -8502=>'L', -8503=>'L', -8504=>'L', -8505=>'L', -8506=>'ON', -8507=>'ON', -8508=>'L', -8509=>'L', -8510=>'L', -8511=>'L', -8512=>'ON', -8513=>'ON', -8514=>'ON', -8515=>'ON', -8516=>'ON', -8517=>'L', -8518=>'L', -8519=>'L', -8520=>'L', -8521=>'L', -8522=>'ON', -8523=>'ON', -8524=>'ON', -8525=>'ON', -8526=>'L', -8531=>'ON', -8532=>'ON', -8533=>'ON', -8534=>'ON', -8535=>'ON', -8536=>'ON', -8537=>'ON', -8538=>'ON', -8539=>'ON', -8540=>'ON', -8541=>'ON', -8542=>'ON', -8543=>'ON', -8544=>'L', -8545=>'L', -8546=>'L', -8547=>'L', -8548=>'L', -8549=>'L', -8550=>'L', -8551=>'L', -8552=>'L', -8553=>'L', -8554=>'L', -8555=>'L', -8556=>'L', -8557=>'L', -8558=>'L', -8559=>'L', -8560=>'L', -8561=>'L', -8562=>'L', -8563=>'L', -8564=>'L', -8565=>'L', -8566=>'L', -8567=>'L', -8568=>'L', -8569=>'L', -8570=>'L', -8571=>'L', -8572=>'L', -8573=>'L', -8574=>'L', -8575=>'L', -8576=>'L', -8577=>'L', -8578=>'L', -8579=>'L', -8580=>'L', -8592=>'ON', -8593=>'ON', -8594=>'ON', -8595=>'ON', -8596=>'ON', -8597=>'ON', -8598=>'ON', -8599=>'ON', -8600=>'ON', -8601=>'ON', -8602=>'ON', -8603=>'ON', -8604=>'ON', -8605=>'ON', -8606=>'ON', -8607=>'ON', -8608=>'ON', -8609=>'ON', -8610=>'ON', -8611=>'ON', -8612=>'ON', -8613=>'ON', -8614=>'ON', -8615=>'ON', -8616=>'ON', -8617=>'ON', -8618=>'ON', -8619=>'ON', -8620=>'ON', -8621=>'ON', -8622=>'ON', -8623=>'ON', -8624=>'ON', -8625=>'ON', -8626=>'ON', -8627=>'ON', -8628=>'ON', -8629=>'ON', -8630=>'ON', -8631=>'ON', -8632=>'ON', -8633=>'ON', -8634=>'ON', -8635=>'ON', -8636=>'ON', -8637=>'ON', -8638=>'ON', -8639=>'ON', -8640=>'ON', -8641=>'ON', -8642=>'ON', -8643=>'ON', -8644=>'ON', -8645=>'ON', -8646=>'ON', -8647=>'ON', -8648=>'ON', -8649=>'ON', -8650=>'ON', -8651=>'ON', -8652=>'ON', -8653=>'ON', -8654=>'ON', -8655=>'ON', -8656=>'ON', -8657=>'ON', -8658=>'ON', -8659=>'ON', -8660=>'ON', -8661=>'ON', -8662=>'ON', -8663=>'ON', -8664=>'ON', -8665=>'ON', -8666=>'ON', -8667=>'ON', -8668=>'ON', -8669=>'ON', -8670=>'ON', -8671=>'ON', -8672=>'ON', -8673=>'ON', -8674=>'ON', -8675=>'ON', -8676=>'ON', -8677=>'ON', -8678=>'ON', -8679=>'ON', -8680=>'ON', -8681=>'ON', -8682=>'ON', -8683=>'ON', -8684=>'ON', -8685=>'ON', -8686=>'ON', -8687=>'ON', -8688=>'ON', -8689=>'ON', -8690=>'ON', -8691=>'ON', -8692=>'ON', -8693=>'ON', -8694=>'ON', -8695=>'ON', -8696=>'ON', -8697=>'ON', -8698=>'ON', -8699=>'ON', -8700=>'ON', -8701=>'ON', -8702=>'ON', -8703=>'ON', -8704=>'ON', -8705=>'ON', -8706=>'ON', -8707=>'ON', -8708=>'ON', -8709=>'ON', -8710=>'ON', -8711=>'ON', -8712=>'ON', -8713=>'ON', -8714=>'ON', -8715=>'ON', -8716=>'ON', -8717=>'ON', -8718=>'ON', -8719=>'ON', -8720=>'ON', -8721=>'ON', -8722=>'ES', -8723=>'ET', -8724=>'ON', -8725=>'ON', -8726=>'ON', -8727=>'ON', -8728=>'ON', -8729=>'ON', -8730=>'ON', -8731=>'ON', -8732=>'ON', -8733=>'ON', -8734=>'ON', -8735=>'ON', -8736=>'ON', -8737=>'ON', -8738=>'ON', -8739=>'ON', -8740=>'ON', -8741=>'ON', -8742=>'ON', -8743=>'ON', -8744=>'ON', -8745=>'ON', -8746=>'ON', -8747=>'ON', -8748=>'ON', -8749=>'ON', -8750=>'ON', -8751=>'ON', -8752=>'ON', -8753=>'ON', -8754=>'ON', -8755=>'ON', -8756=>'ON', -8757=>'ON', -8758=>'ON', -8759=>'ON', -8760=>'ON', -8761=>'ON', -8762=>'ON', -8763=>'ON', -8764=>'ON', -8765=>'ON', -8766=>'ON', -8767=>'ON', -8768=>'ON', -8769=>'ON', -8770=>'ON', -8771=>'ON', -8772=>'ON', -8773=>'ON', -8774=>'ON', -8775=>'ON', -8776=>'ON', -8777=>'ON', -8778=>'ON', -8779=>'ON', -8780=>'ON', -8781=>'ON', -8782=>'ON', -8783=>'ON', -8784=>'ON', -8785=>'ON', -8786=>'ON', -8787=>'ON', -8788=>'ON', -8789=>'ON', -8790=>'ON', -8791=>'ON', -8792=>'ON', -8793=>'ON', -8794=>'ON', -8795=>'ON', -8796=>'ON', -8797=>'ON', -8798=>'ON', -8799=>'ON', -8800=>'ON', -8801=>'ON', -8802=>'ON', -8803=>'ON', -8804=>'ON', -8805=>'ON', -8806=>'ON', -8807=>'ON', -8808=>'ON', -8809=>'ON', -8810=>'ON', -8811=>'ON', -8812=>'ON', -8813=>'ON', -8814=>'ON', -8815=>'ON', -8816=>'ON', -8817=>'ON', -8818=>'ON', -8819=>'ON', -8820=>'ON', -8821=>'ON', -8822=>'ON', -8823=>'ON', -8824=>'ON', -8825=>'ON', -8826=>'ON', -8827=>'ON', -8828=>'ON', -8829=>'ON', -8830=>'ON', -8831=>'ON', -8832=>'ON', -8833=>'ON', -8834=>'ON', -8835=>'ON', -8836=>'ON', -8837=>'ON', -8838=>'ON', -8839=>'ON', -8840=>'ON', -8841=>'ON', -8842=>'ON', -8843=>'ON', -8844=>'ON', -8845=>'ON', -8846=>'ON', -8847=>'ON', -8848=>'ON', -8849=>'ON', -8850=>'ON', -8851=>'ON', -8852=>'ON', -8853=>'ON', -8854=>'ON', -8855=>'ON', -8856=>'ON', -8857=>'ON', -8858=>'ON', -8859=>'ON', -8860=>'ON', -8861=>'ON', -8862=>'ON', -8863=>'ON', -8864=>'ON', -8865=>'ON', -8866=>'ON', -8867=>'ON', -8868=>'ON', -8869=>'ON', -8870=>'ON', -8871=>'ON', -8872=>'ON', -8873=>'ON', -8874=>'ON', -8875=>'ON', -8876=>'ON', -8877=>'ON', -8878=>'ON', -8879=>'ON', -8880=>'ON', -8881=>'ON', -8882=>'ON', -8883=>'ON', -8884=>'ON', -8885=>'ON', -8886=>'ON', -8887=>'ON', -8888=>'ON', -8889=>'ON', -8890=>'ON', -8891=>'ON', -8892=>'ON', -8893=>'ON', -8894=>'ON', -8895=>'ON', -8896=>'ON', -8897=>'ON', -8898=>'ON', -8899=>'ON', -8900=>'ON', -8901=>'ON', -8902=>'ON', -8903=>'ON', -8904=>'ON', -8905=>'ON', -8906=>'ON', -8907=>'ON', -8908=>'ON', -8909=>'ON', -8910=>'ON', -8911=>'ON', -8912=>'ON', -8913=>'ON', -8914=>'ON', -8915=>'ON', -8916=>'ON', -8917=>'ON', -8918=>'ON', -8919=>'ON', -8920=>'ON', -8921=>'ON', -8922=>'ON', -8923=>'ON', -8924=>'ON', -8925=>'ON', -8926=>'ON', -8927=>'ON', -8928=>'ON', -8929=>'ON', -8930=>'ON', -8931=>'ON', -8932=>'ON', -8933=>'ON', -8934=>'ON', -8935=>'ON', -8936=>'ON', -8937=>'ON', -8938=>'ON', -8939=>'ON', -8940=>'ON', -8941=>'ON', -8942=>'ON', -8943=>'ON', -8944=>'ON', -8945=>'ON', -8946=>'ON', -8947=>'ON', -8948=>'ON', -8949=>'ON', -8950=>'ON', -8951=>'ON', -8952=>'ON', -8953=>'ON', -8954=>'ON', -8955=>'ON', -8956=>'ON', -8957=>'ON', -8958=>'ON', -8959=>'ON', -8960=>'ON', -8961=>'ON', -8962=>'ON', -8963=>'ON', -8964=>'ON', -8965=>'ON', -8966=>'ON', -8967=>'ON', -8968=>'ON', -8969=>'ON', -8970=>'ON', -8971=>'ON', -8972=>'ON', -8973=>'ON', -8974=>'ON', -8975=>'ON', -8976=>'ON', -8977=>'ON', -8978=>'ON', -8979=>'ON', -8980=>'ON', -8981=>'ON', -8982=>'ON', -8983=>'ON', -8984=>'ON', -8985=>'ON', -8986=>'ON', -8987=>'ON', -8988=>'ON', -8989=>'ON', -8990=>'ON', -8991=>'ON', -8992=>'ON', -8993=>'ON', -8994=>'ON', -8995=>'ON', -8996=>'ON', -8997=>'ON', -8998=>'ON', -8999=>'ON', -9000=>'ON', -9001=>'ON', -9002=>'ON', -9003=>'ON', -9004=>'ON', -9005=>'ON', -9006=>'ON', -9007=>'ON', -9008=>'ON', -9009=>'ON', -9010=>'ON', -9011=>'ON', -9012=>'ON', -9013=>'ON', -9014=>'L', -9015=>'L', -9016=>'L', -9017=>'L', -9018=>'L', -9019=>'L', -9020=>'L', -9021=>'L', -9022=>'L', -9023=>'L', -9024=>'L', -9025=>'L', -9026=>'L', -9027=>'L', -9028=>'L', -9029=>'L', -9030=>'L', -9031=>'L', -9032=>'L', -9033=>'L', -9034=>'L', -9035=>'L', -9036=>'L', -9037=>'L', -9038=>'L', -9039=>'L', -9040=>'L', -9041=>'L', -9042=>'L', -9043=>'L', -9044=>'L', -9045=>'L', -9046=>'L', -9047=>'L', -9048=>'L', -9049=>'L', -9050=>'L', -9051=>'L', -9052=>'L', -9053=>'L', -9054=>'L', -9055=>'L', -9056=>'L', -9057=>'L', -9058=>'L', -9059=>'L', -9060=>'L', -9061=>'L', -9062=>'L', -9063=>'L', -9064=>'L', -9065=>'L', -9066=>'L', -9067=>'L', -9068=>'L', -9069=>'L', -9070=>'L', -9071=>'L', -9072=>'L', -9073=>'L', -9074=>'L', -9075=>'L', -9076=>'L', -9077=>'L', -9078=>'L', -9079=>'L', -9080=>'L', -9081=>'L', -9082=>'L', -9083=>'ON', -9084=>'ON', -9085=>'ON', -9086=>'ON', -9087=>'ON', -9088=>'ON', -9089=>'ON', -9090=>'ON', -9091=>'ON', -9092=>'ON', -9093=>'ON', -9094=>'ON', -9095=>'ON', -9096=>'ON', -9097=>'ON', -9098=>'ON', -9099=>'ON', -9100=>'ON', -9101=>'ON', -9102=>'ON', -9103=>'ON', -9104=>'ON', -9105=>'ON', -9106=>'ON', -9107=>'ON', -9108=>'ON', -9109=>'L', -9110=>'ON', -9111=>'ON', -9112=>'ON', -9113=>'ON', -9114=>'ON', -9115=>'ON', -9116=>'ON', -9117=>'ON', -9118=>'ON', -9119=>'ON', -9120=>'ON', -9121=>'ON', -9122=>'ON', -9123=>'ON', -9124=>'ON', -9125=>'ON', -9126=>'ON', -9127=>'ON', -9128=>'ON', -9129=>'ON', -9130=>'ON', -9131=>'ON', -9132=>'ON', -9133=>'ON', -9134=>'ON', -9135=>'ON', -9136=>'ON', -9137=>'ON', -9138=>'ON', -9139=>'ON', -9140=>'ON', -9141=>'ON', -9142=>'ON', -9143=>'ON', -9144=>'ON', -9145=>'ON', -9146=>'ON', -9147=>'ON', -9148=>'ON', -9149=>'ON', -9150=>'ON', -9151=>'ON', -9152=>'ON', -9153=>'ON', -9154=>'ON', -9155=>'ON', -9156=>'ON', -9157=>'ON', -9158=>'ON', -9159=>'ON', -9160=>'ON', -9161=>'ON', -9162=>'ON', -9163=>'ON', -9164=>'ON', -9165=>'ON', -9166=>'ON', -9167=>'ON', -9168=>'ON', -9169=>'ON', -9170=>'ON', -9171=>'ON', -9172=>'ON', -9173=>'ON', -9174=>'ON', -9175=>'ON', -9176=>'ON', -9177=>'ON', -9178=>'ON', -9179=>'ON', -9180=>'ON', -9181=>'ON', -9182=>'ON', -9183=>'ON', -9184=>'ON', -9185=>'ON', -9186=>'ON', -9187=>'ON', -9188=>'ON', -9189=>'ON', -9190=>'ON', -9191=>'ON', -9216=>'ON', -9217=>'ON', -9218=>'ON', -9219=>'ON', -9220=>'ON', -9221=>'ON', -9222=>'ON', -9223=>'ON', -9224=>'ON', -9225=>'ON', -9226=>'ON', -9227=>'ON', -9228=>'ON', -9229=>'ON', -9230=>'ON', -9231=>'ON', -9232=>'ON', -9233=>'ON', -9234=>'ON', -9235=>'ON', -9236=>'ON', -9237=>'ON', -9238=>'ON', -9239=>'ON', -9240=>'ON', -9241=>'ON', -9242=>'ON', -9243=>'ON', -9244=>'ON', -9245=>'ON', -9246=>'ON', -9247=>'ON', -9248=>'ON', -9249=>'ON', -9250=>'ON', -9251=>'ON', -9252=>'ON', -9253=>'ON', -9254=>'ON', -9280=>'ON', -9281=>'ON', -9282=>'ON', -9283=>'ON', -9284=>'ON', -9285=>'ON', -9286=>'ON', -9287=>'ON', -9288=>'ON', -9289=>'ON', -9290=>'ON', -9312=>'ON', -9313=>'ON', -9314=>'ON', -9315=>'ON', -9316=>'ON', -9317=>'ON', -9318=>'ON', -9319=>'ON', -9320=>'ON', -9321=>'ON', -9322=>'ON', -9323=>'ON', -9324=>'ON', -9325=>'ON', -9326=>'ON', -9327=>'ON', -9328=>'ON', -9329=>'ON', -9330=>'ON', -9331=>'ON', -9332=>'ON', -9333=>'ON', -9334=>'ON', -9335=>'ON', -9336=>'ON', -9337=>'ON', -9338=>'ON', -9339=>'ON', -9340=>'ON', -9341=>'ON', -9342=>'ON', -9343=>'ON', -9344=>'ON', -9345=>'ON', -9346=>'ON', -9347=>'ON', -9348=>'ON', -9349=>'ON', -9350=>'ON', -9351=>'ON', -9352=>'EN', -9353=>'EN', -9354=>'EN', -9355=>'EN', -9356=>'EN', -9357=>'EN', -9358=>'EN', -9359=>'EN', -9360=>'EN', -9361=>'EN', -9362=>'EN', -9363=>'EN', -9364=>'EN', -9365=>'EN', -9366=>'EN', -9367=>'EN', -9368=>'EN', -9369=>'EN', -9370=>'EN', -9371=>'EN', -9372=>'L', -9373=>'L', -9374=>'L', -9375=>'L', -9376=>'L', -9377=>'L', -9378=>'L', -9379=>'L', -9380=>'L', -9381=>'L', -9382=>'L', -9383=>'L', -9384=>'L', -9385=>'L', -9386=>'L', -9387=>'L', -9388=>'L', -9389=>'L', -9390=>'L', -9391=>'L', -9392=>'L', -9393=>'L', -9394=>'L', -9395=>'L', -9396=>'L', -9397=>'L', -9398=>'L', -9399=>'L', -9400=>'L', -9401=>'L', -9402=>'L', -9403=>'L', -9404=>'L', -9405=>'L', -9406=>'L', -9407=>'L', -9408=>'L', -9409=>'L', -9410=>'L', -9411=>'L', -9412=>'L', -9413=>'L', -9414=>'L', -9415=>'L', -9416=>'L', -9417=>'L', -9418=>'L', -9419=>'L', -9420=>'L', -9421=>'L', -9422=>'L', -9423=>'L', -9424=>'L', -9425=>'L', -9426=>'L', -9427=>'L', -9428=>'L', -9429=>'L', -9430=>'L', -9431=>'L', -9432=>'L', -9433=>'L', -9434=>'L', -9435=>'L', -9436=>'L', -9437=>'L', -9438=>'L', -9439=>'L', -9440=>'L', -9441=>'L', -9442=>'L', -9443=>'L', -9444=>'L', -9445=>'L', -9446=>'L', -9447=>'L', -9448=>'L', -9449=>'L', -9450=>'ON', -9451=>'ON', -9452=>'ON', -9453=>'ON', -9454=>'ON', -9455=>'ON', -9456=>'ON', -9457=>'ON', -9458=>'ON', -9459=>'ON', -9460=>'ON', -9461=>'ON', -9462=>'ON', -9463=>'ON', -9464=>'ON', -9465=>'ON', -9466=>'ON', -9467=>'ON', -9468=>'ON', -9469=>'ON', -9470=>'ON', -9471=>'ON', -9472=>'ON', -9473=>'ON', -9474=>'ON', -9475=>'ON', -9476=>'ON', -9477=>'ON', -9478=>'ON', -9479=>'ON', -9480=>'ON', -9481=>'ON', -9482=>'ON', -9483=>'ON', -9484=>'ON', -9485=>'ON', -9486=>'ON', -9487=>'ON', -9488=>'ON', -9489=>'ON', -9490=>'ON', -9491=>'ON', -9492=>'ON', -9493=>'ON', -9494=>'ON', -9495=>'ON', -9496=>'ON', -9497=>'ON', -9498=>'ON', -9499=>'ON', -9500=>'ON', -9501=>'ON', -9502=>'ON', -9503=>'ON', -9504=>'ON', -9505=>'ON', -9506=>'ON', -9507=>'ON', -9508=>'ON', -9509=>'ON', -9510=>'ON', -9511=>'ON', -9512=>'ON', -9513=>'ON', -9514=>'ON', -9515=>'ON', -9516=>'ON', -9517=>'ON', -9518=>'ON', -9519=>'ON', -9520=>'ON', -9521=>'ON', -9522=>'ON', -9523=>'ON', -9524=>'ON', -9525=>'ON', -9526=>'ON', -9527=>'ON', -9528=>'ON', -9529=>'ON', -9530=>'ON', -9531=>'ON', -9532=>'ON', -9533=>'ON', -9534=>'ON', -9535=>'ON', -9536=>'ON', -9537=>'ON', -9538=>'ON', -9539=>'ON', -9540=>'ON', -9541=>'ON', -9542=>'ON', -9543=>'ON', -9544=>'ON', -9545=>'ON', -9546=>'ON', -9547=>'ON', -9548=>'ON', -9549=>'ON', -9550=>'ON', -9551=>'ON', -9552=>'ON', -9553=>'ON', -9554=>'ON', -9555=>'ON', -9556=>'ON', -9557=>'ON', -9558=>'ON', -9559=>'ON', -9560=>'ON', -9561=>'ON', -9562=>'ON', -9563=>'ON', -9564=>'ON', -9565=>'ON', -9566=>'ON', -9567=>'ON', -9568=>'ON', -9569=>'ON', -9570=>'ON', -9571=>'ON', -9572=>'ON', -9573=>'ON', -9574=>'ON', -9575=>'ON', -9576=>'ON', -9577=>'ON', -9578=>'ON', -9579=>'ON', -9580=>'ON', -9581=>'ON', -9582=>'ON', -9583=>'ON', -9584=>'ON', -9585=>'ON', -9586=>'ON', -9587=>'ON', -9588=>'ON', -9589=>'ON', -9590=>'ON', -9591=>'ON', -9592=>'ON', -9593=>'ON', -9594=>'ON', -9595=>'ON', -9596=>'ON', -9597=>'ON', -9598=>'ON', -9599=>'ON', -9600=>'ON', -9601=>'ON', -9602=>'ON', -9603=>'ON', -9604=>'ON', -9605=>'ON', -9606=>'ON', -9607=>'ON', -9608=>'ON', -9609=>'ON', -9610=>'ON', -9611=>'ON', -9612=>'ON', -9613=>'ON', -9614=>'ON', -9615=>'ON', -9616=>'ON', -9617=>'ON', -9618=>'ON', -9619=>'ON', -9620=>'ON', -9621=>'ON', -9622=>'ON', -9623=>'ON', -9624=>'ON', -9625=>'ON', -9626=>'ON', -9627=>'ON', -9628=>'ON', -9629=>'ON', -9630=>'ON', -9631=>'ON', -9632=>'ON', -9633=>'ON', -9634=>'ON', -9635=>'ON', -9636=>'ON', -9637=>'ON', -9638=>'ON', -9639=>'ON', -9640=>'ON', -9641=>'ON', -9642=>'ON', -9643=>'ON', -9644=>'ON', -9645=>'ON', -9646=>'ON', -9647=>'ON', -9648=>'ON', -9649=>'ON', -9650=>'ON', -9651=>'ON', -9652=>'ON', -9653=>'ON', -9654=>'ON', -9655=>'ON', -9656=>'ON', -9657=>'ON', -9658=>'ON', -9659=>'ON', -9660=>'ON', -9661=>'ON', -9662=>'ON', -9663=>'ON', -9664=>'ON', -9665=>'ON', -9666=>'ON', -9667=>'ON', -9668=>'ON', -9669=>'ON', -9670=>'ON', -9671=>'ON', -9672=>'ON', -9673=>'ON', -9674=>'ON', -9675=>'ON', -9676=>'ON', -9677=>'ON', -9678=>'ON', -9679=>'ON', -9680=>'ON', -9681=>'ON', -9682=>'ON', -9683=>'ON', -9684=>'ON', -9685=>'ON', -9686=>'ON', -9687=>'ON', -9688=>'ON', -9689=>'ON', -9690=>'ON', -9691=>'ON', -9692=>'ON', -9693=>'ON', -9694=>'ON', -9695=>'ON', -9696=>'ON', -9697=>'ON', -9698=>'ON', -9699=>'ON', -9700=>'ON', -9701=>'ON', -9702=>'ON', -9703=>'ON', -9704=>'ON', -9705=>'ON', -9706=>'ON', -9707=>'ON', -9708=>'ON', -9709=>'ON', -9710=>'ON', -9711=>'ON', -9712=>'ON', -9713=>'ON', -9714=>'ON', -9715=>'ON', -9716=>'ON', -9717=>'ON', -9718=>'ON', -9719=>'ON', -9720=>'ON', -9721=>'ON', -9722=>'ON', -9723=>'ON', -9724=>'ON', -9725=>'ON', -9726=>'ON', -9727=>'ON', -9728=>'ON', -9729=>'ON', -9730=>'ON', -9731=>'ON', -9732=>'ON', -9733=>'ON', -9734=>'ON', -9735=>'ON', -9736=>'ON', -9737=>'ON', -9738=>'ON', -9739=>'ON', -9740=>'ON', -9741=>'ON', -9742=>'ON', -9743=>'ON', -9744=>'ON', -9745=>'ON', -9746=>'ON', -9747=>'ON', -9748=>'ON', -9749=>'ON', -9750=>'ON', -9751=>'ON', -9752=>'ON', -9753=>'ON', -9754=>'ON', -9755=>'ON', -9756=>'ON', -9757=>'ON', -9758=>'ON', -9759=>'ON', -9760=>'ON', -9761=>'ON', -9762=>'ON', -9763=>'ON', -9764=>'ON', -9765=>'ON', -9766=>'ON', -9767=>'ON', -9768=>'ON', -9769=>'ON', -9770=>'ON', -9771=>'ON', -9772=>'ON', -9773=>'ON', -9774=>'ON', -9775=>'ON', -9776=>'ON', -9777=>'ON', -9778=>'ON', -9779=>'ON', -9780=>'ON', -9781=>'ON', -9782=>'ON', -9783=>'ON', -9784=>'ON', -9785=>'ON', -9786=>'ON', -9787=>'ON', -9788=>'ON', -9789=>'ON', -9790=>'ON', -9791=>'ON', -9792=>'ON', -9793=>'ON', -9794=>'ON', -9795=>'ON', -9796=>'ON', -9797=>'ON', -9798=>'ON', -9799=>'ON', -9800=>'ON', -9801=>'ON', -9802=>'ON', -9803=>'ON', -9804=>'ON', -9805=>'ON', -9806=>'ON', -9807=>'ON', -9808=>'ON', -9809=>'ON', -9810=>'ON', -9811=>'ON', -9812=>'ON', -9813=>'ON', -9814=>'ON', -9815=>'ON', -9816=>'ON', -9817=>'ON', -9818=>'ON', -9819=>'ON', -9820=>'ON', -9821=>'ON', -9822=>'ON', -9823=>'ON', -9824=>'ON', -9825=>'ON', -9826=>'ON', -9827=>'ON', -9828=>'ON', -9829=>'ON', -9830=>'ON', -9831=>'ON', -9832=>'ON', -9833=>'ON', -9834=>'ON', -9835=>'ON', -9836=>'ON', -9837=>'ON', -9838=>'ON', -9839=>'ON', -9840=>'ON', -9841=>'ON', -9842=>'ON', -9843=>'ON', -9844=>'ON', -9845=>'ON', -9846=>'ON', -9847=>'ON', -9848=>'ON', -9849=>'ON', -9850=>'ON', -9851=>'ON', -9852=>'ON', -9853=>'ON', -9854=>'ON', -9855=>'ON', -9856=>'ON', -9857=>'ON', -9858=>'ON', -9859=>'ON', -9860=>'ON', -9861=>'ON', -9862=>'ON', -9863=>'ON', -9864=>'ON', -9865=>'ON', -9866=>'ON', -9867=>'ON', -9868=>'ON', -9869=>'ON', -9870=>'ON', -9871=>'ON', -9872=>'ON', -9873=>'ON', -9874=>'ON', -9875=>'ON', -9876=>'ON', -9877=>'ON', -9878=>'ON', -9879=>'ON', -9880=>'ON', -9881=>'ON', -9882=>'ON', -9883=>'ON', -9884=>'ON', -9888=>'ON', -9889=>'ON', -9890=>'ON', -9891=>'ON', -9892=>'ON', -9893=>'ON', -9894=>'ON', -9895=>'ON', -9896=>'ON', -9897=>'ON', -9898=>'ON', -9899=>'ON', -9900=>'L', -9901=>'ON', -9902=>'ON', -9903=>'ON', -9904=>'ON', -9905=>'ON', -9906=>'ON', -9985=>'ON', -9986=>'ON', -9987=>'ON', -9988=>'ON', -9990=>'ON', -9991=>'ON', -9992=>'ON', -9993=>'ON', -9996=>'ON', -9997=>'ON', -9998=>'ON', -9999=>'ON', -10000=>'ON', -10001=>'ON', -10002=>'ON', -10003=>'ON', -10004=>'ON', -10005=>'ON', -10006=>'ON', -10007=>'ON', -10008=>'ON', -10009=>'ON', -10010=>'ON', -10011=>'ON', -10012=>'ON', -10013=>'ON', -10014=>'ON', -10015=>'ON', -10016=>'ON', -10017=>'ON', -10018=>'ON', -10019=>'ON', -10020=>'ON', -10021=>'ON', -10022=>'ON', -10023=>'ON', -10025=>'ON', -10026=>'ON', -10027=>'ON', -10028=>'ON', -10029=>'ON', -10030=>'ON', -10031=>'ON', -10032=>'ON', -10033=>'ON', -10034=>'ON', -10035=>'ON', -10036=>'ON', -10037=>'ON', -10038=>'ON', -10039=>'ON', -10040=>'ON', -10041=>'ON', -10042=>'ON', -10043=>'ON', -10044=>'ON', -10045=>'ON', -10046=>'ON', -10047=>'ON', -10048=>'ON', -10049=>'ON', -10050=>'ON', -10051=>'ON', -10052=>'ON', -10053=>'ON', -10054=>'ON', -10055=>'ON', -10056=>'ON', -10057=>'ON', -10058=>'ON', -10059=>'ON', -10061=>'ON', -10063=>'ON', -10064=>'ON', -10065=>'ON', -10066=>'ON', -10070=>'ON', -10072=>'ON', -10073=>'ON', -10074=>'ON', -10075=>'ON', -10076=>'ON', -10077=>'ON', -10078=>'ON', -10081=>'ON', -10082=>'ON', -10083=>'ON', -10084=>'ON', -10085=>'ON', -10086=>'ON', -10087=>'ON', -10088=>'ON', -10089=>'ON', -10090=>'ON', -10091=>'ON', -10092=>'ON', -10093=>'ON', -10094=>'ON', -10095=>'ON', -10096=>'ON', -10097=>'ON', -10098=>'ON', -10099=>'ON', -10100=>'ON', -10101=>'ON', -10102=>'ON', -10103=>'ON', -10104=>'ON', -10105=>'ON', -10106=>'ON', -10107=>'ON', -10108=>'ON', -10109=>'ON', -10110=>'ON', -10111=>'ON', -10112=>'ON', -10113=>'ON', -10114=>'ON', -10115=>'ON', -10116=>'ON', -10117=>'ON', -10118=>'ON', -10119=>'ON', -10120=>'ON', -10121=>'ON', -10122=>'ON', -10123=>'ON', -10124=>'ON', -10125=>'ON', -10126=>'ON', -10127=>'ON', -10128=>'ON', -10129=>'ON', -10130=>'ON', -10131=>'ON', -10132=>'ON', -10136=>'ON', -10137=>'ON', -10138=>'ON', -10139=>'ON', -10140=>'ON', -10141=>'ON', -10142=>'ON', -10143=>'ON', -10144=>'ON', -10145=>'ON', -10146=>'ON', -10147=>'ON', -10148=>'ON', -10149=>'ON', -10150=>'ON', -10151=>'ON', -10152=>'ON', -10153=>'ON', -10154=>'ON', -10155=>'ON', -10156=>'ON', -10157=>'ON', -10158=>'ON', -10159=>'ON', -10161=>'ON', -10162=>'ON', -10163=>'ON', -10164=>'ON', -10165=>'ON', -10166=>'ON', -10167=>'ON', -10168=>'ON', -10169=>'ON', -10170=>'ON', -10171=>'ON', -10172=>'ON', -10173=>'ON', -10174=>'ON', -10176=>'ON', -10177=>'ON', -10178=>'ON', -10179=>'ON', -10180=>'ON', -10181=>'ON', -10182=>'ON', -10183=>'ON', -10184=>'ON', -10185=>'ON', -10186=>'ON', -10192=>'ON', -10193=>'ON', -10194=>'ON', -10195=>'ON', -10196=>'ON', -10197=>'ON', -10198=>'ON', -10199=>'ON', -10200=>'ON', -10201=>'ON', -10202=>'ON', -10203=>'ON', -10204=>'ON', -10205=>'ON', -10206=>'ON', -10207=>'ON', -10208=>'ON', -10209=>'ON', -10210=>'ON', -10211=>'ON', -10212=>'ON', -10213=>'ON', -10214=>'ON', -10215=>'ON', -10216=>'ON', -10217=>'ON', -10218=>'ON', -10219=>'ON', -10224=>'ON', -10225=>'ON', -10226=>'ON', -10227=>'ON', -10228=>'ON', -10229=>'ON', -10230=>'ON', -10231=>'ON', -10232=>'ON', -10233=>'ON', -10234=>'ON', -10235=>'ON', -10236=>'ON', -10237=>'ON', -10238=>'ON', -10239=>'ON', -10240=>'L', -10241=>'L', -10242=>'L', -10243=>'L', -10244=>'L', -10245=>'L', -10246=>'L', -10247=>'L', -10248=>'L', -10249=>'L', -10250=>'L', -10251=>'L', -10252=>'L', -10253=>'L', -10254=>'L', -10255=>'L', -10256=>'L', -10257=>'L', -10258=>'L', -10259=>'L', -10260=>'L', -10261=>'L', -10262=>'L', -10263=>'L', -10264=>'L', -10265=>'L', -10266=>'L', -10267=>'L', -10268=>'L', -10269=>'L', -10270=>'L', -10271=>'L', -10272=>'L', -10273=>'L', -10274=>'L', -10275=>'L', -10276=>'L', -10277=>'L', -10278=>'L', -10279=>'L', -10280=>'L', -10281=>'L', -10282=>'L', -10283=>'L', -10284=>'L', -10285=>'L', -10286=>'L', -10287=>'L', -10288=>'L', -10289=>'L', -10290=>'L', -10291=>'L', -10292=>'L', -10293=>'L', -10294=>'L', -10295=>'L', -10296=>'L', -10297=>'L', -10298=>'L', -10299=>'L', -10300=>'L', -10301=>'L', -10302=>'L', -10303=>'L', -10304=>'L', -10305=>'L', -10306=>'L', -10307=>'L', -10308=>'L', -10309=>'L', -10310=>'L', -10311=>'L', -10312=>'L', -10313=>'L', -10314=>'L', -10315=>'L', -10316=>'L', -10317=>'L', -10318=>'L', -10319=>'L', -10320=>'L', -10321=>'L', -10322=>'L', -10323=>'L', -10324=>'L', -10325=>'L', -10326=>'L', -10327=>'L', -10328=>'L', -10329=>'L', -10330=>'L', -10331=>'L', -10332=>'L', -10333=>'L', -10334=>'L', -10335=>'L', -10336=>'L', -10337=>'L', -10338=>'L', -10339=>'L', -10340=>'L', -10341=>'L', -10342=>'L', -10343=>'L', -10344=>'L', -10345=>'L', -10346=>'L', -10347=>'L', -10348=>'L', -10349=>'L', -10350=>'L', -10351=>'L', -10352=>'L', -10353=>'L', -10354=>'L', -10355=>'L', -10356=>'L', -10357=>'L', -10358=>'L', -10359=>'L', -10360=>'L', -10361=>'L', -10362=>'L', -10363=>'L', -10364=>'L', -10365=>'L', -10366=>'L', -10367=>'L', -10368=>'L', -10369=>'L', -10370=>'L', -10371=>'L', -10372=>'L', -10373=>'L', -10374=>'L', -10375=>'L', -10376=>'L', -10377=>'L', -10378=>'L', -10379=>'L', -10380=>'L', -10381=>'L', -10382=>'L', -10383=>'L', -10384=>'L', -10385=>'L', -10386=>'L', -10387=>'L', -10388=>'L', -10389=>'L', -10390=>'L', -10391=>'L', -10392=>'L', -10393=>'L', -10394=>'L', -10395=>'L', -10396=>'L', -10397=>'L', -10398=>'L', -10399=>'L', -10400=>'L', -10401=>'L', -10402=>'L', -10403=>'L', -10404=>'L', -10405=>'L', -10406=>'L', -10407=>'L', -10408=>'L', -10409=>'L', -10410=>'L', -10411=>'L', -10412=>'L', -10413=>'L', -10414=>'L', -10415=>'L', -10416=>'L', -10417=>'L', -10418=>'L', -10419=>'L', -10420=>'L', -10421=>'L', -10422=>'L', -10423=>'L', -10424=>'L', -10425=>'L', -10426=>'L', -10427=>'L', -10428=>'L', -10429=>'L', -10430=>'L', -10431=>'L', -10432=>'L', -10433=>'L', -10434=>'L', -10435=>'L', -10436=>'L', -10437=>'L', -10438=>'L', -10439=>'L', -10440=>'L', -10441=>'L', -10442=>'L', -10443=>'L', -10444=>'L', -10445=>'L', -10446=>'L', -10447=>'L', -10448=>'L', -10449=>'L', -10450=>'L', -10451=>'L', -10452=>'L', -10453=>'L', -10454=>'L', -10455=>'L', -10456=>'L', -10457=>'L', -10458=>'L', -10459=>'L', -10460=>'L', -10461=>'L', -10462=>'L', -10463=>'L', -10464=>'L', -10465=>'L', -10466=>'L', -10467=>'L', -10468=>'L', -10469=>'L', -10470=>'L', -10471=>'L', -10472=>'L', -10473=>'L', -10474=>'L', -10475=>'L', -10476=>'L', -10477=>'L', -10478=>'L', -10479=>'L', -10480=>'L', -10481=>'L', -10482=>'L', -10483=>'L', -10484=>'L', -10485=>'L', -10486=>'L', -10487=>'L', -10488=>'L', -10489=>'L', -10490=>'L', -10491=>'L', -10492=>'L', -10493=>'L', -10494=>'L', -10495=>'L', -10496=>'ON', -10497=>'ON', -10498=>'ON', -10499=>'ON', -10500=>'ON', -10501=>'ON', -10502=>'ON', -10503=>'ON', -10504=>'ON', -10505=>'ON', -10506=>'ON', -10507=>'ON', -10508=>'ON', -10509=>'ON', -10510=>'ON', -10511=>'ON', -10512=>'ON', -10513=>'ON', -10514=>'ON', -10515=>'ON', -10516=>'ON', -10517=>'ON', -10518=>'ON', -10519=>'ON', -10520=>'ON', -10521=>'ON', -10522=>'ON', -10523=>'ON', -10524=>'ON', -10525=>'ON', -10526=>'ON', -10527=>'ON', -10528=>'ON', -10529=>'ON', -10530=>'ON', -10531=>'ON', -10532=>'ON', -10533=>'ON', -10534=>'ON', -10535=>'ON', -10536=>'ON', -10537=>'ON', -10538=>'ON', -10539=>'ON', -10540=>'ON', -10541=>'ON', -10542=>'ON', -10543=>'ON', -10544=>'ON', -10545=>'ON', -10546=>'ON', -10547=>'ON', -10548=>'ON', -10549=>'ON', -10550=>'ON', -10551=>'ON', -10552=>'ON', -10553=>'ON', -10554=>'ON', -10555=>'ON', -10556=>'ON', -10557=>'ON', -10558=>'ON', -10559=>'ON', -10560=>'ON', -10561=>'ON', -10562=>'ON', -10563=>'ON', -10564=>'ON', -10565=>'ON', -10566=>'ON', -10567=>'ON', -10568=>'ON', -10569=>'ON', -10570=>'ON', -10571=>'ON', -10572=>'ON', -10573=>'ON', -10574=>'ON', -10575=>'ON', -10576=>'ON', -10577=>'ON', -10578=>'ON', -10579=>'ON', -10580=>'ON', -10581=>'ON', -10582=>'ON', -10583=>'ON', -10584=>'ON', -10585=>'ON', -10586=>'ON', -10587=>'ON', -10588=>'ON', -10589=>'ON', -10590=>'ON', -10591=>'ON', -10592=>'ON', -10593=>'ON', -10594=>'ON', -10595=>'ON', -10596=>'ON', -10597=>'ON', -10598=>'ON', -10599=>'ON', -10600=>'ON', -10601=>'ON', -10602=>'ON', -10603=>'ON', -10604=>'ON', -10605=>'ON', -10606=>'ON', -10607=>'ON', -10608=>'ON', -10609=>'ON', -10610=>'ON', -10611=>'ON', -10612=>'ON', -10613=>'ON', -10614=>'ON', -10615=>'ON', -10616=>'ON', -10617=>'ON', -10618=>'ON', -10619=>'ON', -10620=>'ON', -10621=>'ON', -10622=>'ON', -10623=>'ON', -10624=>'ON', -10625=>'ON', -10626=>'ON', -10627=>'ON', -10628=>'ON', -10629=>'ON', -10630=>'ON', -10631=>'ON', -10632=>'ON', -10633=>'ON', -10634=>'ON', -10635=>'ON', -10636=>'ON', -10637=>'ON', -10638=>'ON', -10639=>'ON', -10640=>'ON', -10641=>'ON', -10642=>'ON', -10643=>'ON', -10644=>'ON', -10645=>'ON', -10646=>'ON', -10647=>'ON', -10648=>'ON', -10649=>'ON', -10650=>'ON', -10651=>'ON', -10652=>'ON', -10653=>'ON', -10654=>'ON', -10655=>'ON', -10656=>'ON', -10657=>'ON', -10658=>'ON', -10659=>'ON', -10660=>'ON', -10661=>'ON', -10662=>'ON', -10663=>'ON', -10664=>'ON', -10665=>'ON', -10666=>'ON', -10667=>'ON', -10668=>'ON', -10669=>'ON', -10670=>'ON', -10671=>'ON', -10672=>'ON', -10673=>'ON', -10674=>'ON', -10675=>'ON', -10676=>'ON', -10677=>'ON', -10678=>'ON', -10679=>'ON', -10680=>'ON', -10681=>'ON', -10682=>'ON', -10683=>'ON', -10684=>'ON', -10685=>'ON', -10686=>'ON', -10687=>'ON', -10688=>'ON', -10689=>'ON', -10690=>'ON', -10691=>'ON', -10692=>'ON', -10693=>'ON', -10694=>'ON', -10695=>'ON', -10696=>'ON', -10697=>'ON', -10698=>'ON', -10699=>'ON', -10700=>'ON', -10701=>'ON', -10702=>'ON', -10703=>'ON', -10704=>'ON', -10705=>'ON', -10706=>'ON', -10707=>'ON', -10708=>'ON', -10709=>'ON', -10710=>'ON', -10711=>'ON', -10712=>'ON', -10713=>'ON', -10714=>'ON', -10715=>'ON', -10716=>'ON', -10717=>'ON', -10718=>'ON', -10719=>'ON', -10720=>'ON', -10721=>'ON', -10722=>'ON', -10723=>'ON', -10724=>'ON', -10725=>'ON', -10726=>'ON', -10727=>'ON', -10728=>'ON', -10729=>'ON', -10730=>'ON', -10731=>'ON', -10732=>'ON', -10733=>'ON', -10734=>'ON', -10735=>'ON', -10736=>'ON', -10737=>'ON', -10738=>'ON', -10739=>'ON', -10740=>'ON', -10741=>'ON', -10742=>'ON', -10743=>'ON', -10744=>'ON', -10745=>'ON', -10746=>'ON', -10747=>'ON', -10748=>'ON', -10749=>'ON', -10750=>'ON', -10751=>'ON', -10752=>'ON', -10753=>'ON', -10754=>'ON', -10755=>'ON', -10756=>'ON', -10757=>'ON', -10758=>'ON', -10759=>'ON', -10760=>'ON', -10761=>'ON', -10762=>'ON', -10763=>'ON', -10764=>'ON', -10765=>'ON', -10766=>'ON', -10767=>'ON', -10768=>'ON', -10769=>'ON', -10770=>'ON', -10771=>'ON', -10772=>'ON', -10773=>'ON', -10774=>'ON', -10775=>'ON', -10776=>'ON', -10777=>'ON', -10778=>'ON', -10779=>'ON', -10780=>'ON', -10781=>'ON', -10782=>'ON', -10783=>'ON', -10784=>'ON', -10785=>'ON', -10786=>'ON', -10787=>'ON', -10788=>'ON', -10789=>'ON', -10790=>'ON', -10791=>'ON', -10792=>'ON', -10793=>'ON', -10794=>'ON', -10795=>'ON', -10796=>'ON', -10797=>'ON', -10798=>'ON', -10799=>'ON', -10800=>'ON', -10801=>'ON', -10802=>'ON', -10803=>'ON', -10804=>'ON', -10805=>'ON', -10806=>'ON', -10807=>'ON', -10808=>'ON', -10809=>'ON', -10810=>'ON', -10811=>'ON', -10812=>'ON', -10813=>'ON', -10814=>'ON', -10815=>'ON', -10816=>'ON', -10817=>'ON', -10818=>'ON', -10819=>'ON', -10820=>'ON', -10821=>'ON', -10822=>'ON', -10823=>'ON', -10824=>'ON', -10825=>'ON', -10826=>'ON', -10827=>'ON', -10828=>'ON', -10829=>'ON', -10830=>'ON', -10831=>'ON', -10832=>'ON', -10833=>'ON', -10834=>'ON', -10835=>'ON', -10836=>'ON', -10837=>'ON', -10838=>'ON', -10839=>'ON', -10840=>'ON', -10841=>'ON', -10842=>'ON', -10843=>'ON', -10844=>'ON', -10845=>'ON', -10846=>'ON', -10847=>'ON', -10848=>'ON', -10849=>'ON', -10850=>'ON', -10851=>'ON', -10852=>'ON', -10853=>'ON', -10854=>'ON', -10855=>'ON', -10856=>'ON', -10857=>'ON', -10858=>'ON', -10859=>'ON', -10860=>'ON', -10861=>'ON', -10862=>'ON', -10863=>'ON', -10864=>'ON', -10865=>'ON', -10866=>'ON', -10867=>'ON', -10868=>'ON', -10869=>'ON', -10870=>'ON', -10871=>'ON', -10872=>'ON', -10873=>'ON', -10874=>'ON', -10875=>'ON', -10876=>'ON', -10877=>'ON', -10878=>'ON', -10879=>'ON', -10880=>'ON', -10881=>'ON', -10882=>'ON', -10883=>'ON', -10884=>'ON', -10885=>'ON', -10886=>'ON', -10887=>'ON', -10888=>'ON', -10889=>'ON', -10890=>'ON', -10891=>'ON', -10892=>'ON', -10893=>'ON', -10894=>'ON', -10895=>'ON', -10896=>'ON', -10897=>'ON', -10898=>'ON', -10899=>'ON', -10900=>'ON', -10901=>'ON', -10902=>'ON', -10903=>'ON', -10904=>'ON', -10905=>'ON', -10906=>'ON', -10907=>'ON', -10908=>'ON', -10909=>'ON', -10910=>'ON', -10911=>'ON', -10912=>'ON', -10913=>'ON', -10914=>'ON', -10915=>'ON', -10916=>'ON', -10917=>'ON', -10918=>'ON', -10919=>'ON', -10920=>'ON', -10921=>'ON', -10922=>'ON', -10923=>'ON', -10924=>'ON', -10925=>'ON', -10926=>'ON', -10927=>'ON', -10928=>'ON', -10929=>'ON', -10930=>'ON', -10931=>'ON', -10932=>'ON', -10933=>'ON', -10934=>'ON', -10935=>'ON', -10936=>'ON', -10937=>'ON', -10938=>'ON', -10939=>'ON', -10940=>'ON', -10941=>'ON', -10942=>'ON', -10943=>'ON', -10944=>'ON', -10945=>'ON', -10946=>'ON', -10947=>'ON', -10948=>'ON', -10949=>'ON', -10950=>'ON', -10951=>'ON', -10952=>'ON', -10953=>'ON', -10954=>'ON', -10955=>'ON', -10956=>'ON', -10957=>'ON', -10958=>'ON', -10959=>'ON', -10960=>'ON', -10961=>'ON', -10962=>'ON', -10963=>'ON', -10964=>'ON', -10965=>'ON', -10966=>'ON', -10967=>'ON', -10968=>'ON', -10969=>'ON', -10970=>'ON', -10971=>'ON', -10972=>'ON', -10973=>'ON', -10974=>'ON', -10975=>'ON', -10976=>'ON', -10977=>'ON', -10978=>'ON', -10979=>'ON', -10980=>'ON', -10981=>'ON', -10982=>'ON', -10983=>'ON', -10984=>'ON', -10985=>'ON', -10986=>'ON', -10987=>'ON', -10988=>'ON', -10989=>'ON', -10990=>'ON', -10991=>'ON', -10992=>'ON', -10993=>'ON', -10994=>'ON', -10995=>'ON', -10996=>'ON', -10997=>'ON', -10998=>'ON', -10999=>'ON', -11000=>'ON', -11001=>'ON', -11002=>'ON', -11003=>'ON', -11004=>'ON', -11005=>'ON', -11006=>'ON', -11007=>'ON', -11008=>'ON', -11009=>'ON', -11010=>'ON', -11011=>'ON', -11012=>'ON', -11013=>'ON', -11014=>'ON', -11015=>'ON', -11016=>'ON', -11017=>'ON', -11018=>'ON', -11019=>'ON', -11020=>'ON', -11021=>'ON', -11022=>'ON', -11023=>'ON', -11024=>'ON', -11025=>'ON', -11026=>'ON', -11027=>'ON', -11028=>'ON', -11029=>'ON', -11030=>'ON', -11031=>'ON', -11032=>'ON', -11033=>'ON', -11034=>'ON', -11040=>'ON', -11041=>'ON', -11042=>'ON', -11043=>'ON', -11264=>'L', -11265=>'L', -11266=>'L', -11267=>'L', -11268=>'L', -11269=>'L', -11270=>'L', -11271=>'L', -11272=>'L', -11273=>'L', -11274=>'L', -11275=>'L', -11276=>'L', -11277=>'L', -11278=>'L', -11279=>'L', -11280=>'L', -11281=>'L', -11282=>'L', -11283=>'L', -11284=>'L', -11285=>'L', -11286=>'L', -11287=>'L', -11288=>'L', -11289=>'L', -11290=>'L', -11291=>'L', -11292=>'L', -11293=>'L', -11294=>'L', -11295=>'L', -11296=>'L', -11297=>'L', -11298=>'L', -11299=>'L', -11300=>'L', -11301=>'L', -11302=>'L', -11303=>'L', -11304=>'L', -11305=>'L', -11306=>'L', -11307=>'L', -11308=>'L', -11309=>'L', -11310=>'L', -11312=>'L', -11313=>'L', -11314=>'L', -11315=>'L', -11316=>'L', -11317=>'L', -11318=>'L', -11319=>'L', -11320=>'L', -11321=>'L', -11322=>'L', -11323=>'L', -11324=>'L', -11325=>'L', -11326=>'L', -11327=>'L', -11328=>'L', -11329=>'L', -11330=>'L', -11331=>'L', -11332=>'L', -11333=>'L', -11334=>'L', -11335=>'L', -11336=>'L', -11337=>'L', -11338=>'L', -11339=>'L', -11340=>'L', -11341=>'L', -11342=>'L', -11343=>'L', -11344=>'L', -11345=>'L', -11346=>'L', -11347=>'L', -11348=>'L', -11349=>'L', -11350=>'L', -11351=>'L', -11352=>'L', -11353=>'L', -11354=>'L', -11355=>'L', -11356=>'L', -11357=>'L', -11358=>'L', -11360=>'L', -11361=>'L', -11362=>'L', -11363=>'L', -11364=>'L', -11365=>'L', -11366=>'L', -11367=>'L', -11368=>'L', -11369=>'L', -11370=>'L', -11371=>'L', -11372=>'L', -11380=>'L', -11381=>'L', -11382=>'L', -11383=>'L', -11392=>'L', -11393=>'L', -11394=>'L', -11395=>'L', -11396=>'L', -11397=>'L', -11398=>'L', -11399=>'L', -11400=>'L', -11401=>'L', -11402=>'L', -11403=>'L', -11404=>'L', -11405=>'L', -11406=>'L', -11407=>'L', -11408=>'L', -11409=>'L', -11410=>'L', -11411=>'L', -11412=>'L', -11413=>'L', -11414=>'L', -11415=>'L', -11416=>'L', -11417=>'L', -11418=>'L', -11419=>'L', -11420=>'L', -11421=>'L', -11422=>'L', -11423=>'L', -11424=>'L', -11425=>'L', -11426=>'L', -11427=>'L', -11428=>'L', -11429=>'L', -11430=>'L', -11431=>'L', -11432=>'L', -11433=>'L', -11434=>'L', -11435=>'L', -11436=>'L', -11437=>'L', -11438=>'L', -11439=>'L', -11440=>'L', -11441=>'L', -11442=>'L', -11443=>'L', -11444=>'L', -11445=>'L', -11446=>'L', -11447=>'L', -11448=>'L', -11449=>'L', -11450=>'L', -11451=>'L', -11452=>'L', -11453=>'L', -11454=>'L', -11455=>'L', -11456=>'L', -11457=>'L', -11458=>'L', -11459=>'L', -11460=>'L', -11461=>'L', -11462=>'L', -11463=>'L', -11464=>'L', -11465=>'L', -11466=>'L', -11467=>'L', -11468=>'L', -11469=>'L', -11470=>'L', -11471=>'L', -11472=>'L', -11473=>'L', -11474=>'L', -11475=>'L', -11476=>'L', -11477=>'L', -11478=>'L', -11479=>'L', -11480=>'L', -11481=>'L', -11482=>'L', -11483=>'L', -11484=>'L', -11485=>'L', -11486=>'L', -11487=>'L', -11488=>'L', -11489=>'L', -11490=>'L', -11491=>'L', -11492=>'L', -11493=>'ON', -11494=>'ON', -11495=>'ON', -11496=>'ON', -11497=>'ON', -11498=>'ON', -11513=>'ON', -11514=>'ON', -11515=>'ON', -11516=>'ON', -11517=>'ON', -11518=>'ON', -11519=>'ON', -11520=>'L', -11521=>'L', -11522=>'L', -11523=>'L', -11524=>'L', -11525=>'L', -11526=>'L', -11527=>'L', -11528=>'L', -11529=>'L', -11530=>'L', -11531=>'L', -11532=>'L', -11533=>'L', -11534=>'L', -11535=>'L', -11536=>'L', -11537=>'L', -11538=>'L', -11539=>'L', -11540=>'L', -11541=>'L', -11542=>'L', -11543=>'L', -11544=>'L', -11545=>'L', -11546=>'L', -11547=>'L', -11548=>'L', -11549=>'L', -11550=>'L', -11551=>'L', -11552=>'L', -11553=>'L', -11554=>'L', -11555=>'L', -11556=>'L', -11557=>'L', -11568=>'L', -11569=>'L', -11570=>'L', -11571=>'L', -11572=>'L', -11573=>'L', -11574=>'L', -11575=>'L', -11576=>'L', -11577=>'L', -11578=>'L', -11579=>'L', -11580=>'L', -11581=>'L', -11582=>'L', -11583=>'L', -11584=>'L', -11585=>'L', -11586=>'L', -11587=>'L', -11588=>'L', -11589=>'L', -11590=>'L', -11591=>'L', -11592=>'L', -11593=>'L', -11594=>'L', -11595=>'L', -11596=>'L', -11597=>'L', -11598=>'L', -11599=>'L', -11600=>'L', -11601=>'L', -11602=>'L', -11603=>'L', -11604=>'L', -11605=>'L', -11606=>'L', -11607=>'L', -11608=>'L', -11609=>'L', -11610=>'L', -11611=>'L', -11612=>'L', -11613=>'L', -11614=>'L', -11615=>'L', -11616=>'L', -11617=>'L', -11618=>'L', -11619=>'L', -11620=>'L', -11621=>'L', -11631=>'L', -11648=>'L', -11649=>'L', -11650=>'L', -11651=>'L', -11652=>'L', -11653=>'L', -11654=>'L', -11655=>'L', -11656=>'L', -11657=>'L', -11658=>'L', -11659=>'L', -11660=>'L', -11661=>'L', -11662=>'L', -11663=>'L', -11664=>'L', -11665=>'L', -11666=>'L', -11667=>'L', -11668=>'L', -11669=>'L', -11670=>'L', -11680=>'L', -11681=>'L', -11682=>'L', -11683=>'L', -11684=>'L', -11685=>'L', -11686=>'L', -11688=>'L', -11689=>'L', -11690=>'L', -11691=>'L', -11692=>'L', -11693=>'L', -11694=>'L', -11696=>'L', -11697=>'L', -11698=>'L', -11699=>'L', -11700=>'L', -11701=>'L', -11702=>'L', -11704=>'L', -11705=>'L', -11706=>'L', -11707=>'L', -11708=>'L', -11709=>'L', -11710=>'L', -11712=>'L', -11713=>'L', -11714=>'L', -11715=>'L', -11716=>'L', -11717=>'L', -11718=>'L', -11720=>'L', -11721=>'L', -11722=>'L', -11723=>'L', -11724=>'L', -11725=>'L', -11726=>'L', -11728=>'L', -11729=>'L', -11730=>'L', -11731=>'L', -11732=>'L', -11733=>'L', -11734=>'L', -11736=>'L', -11737=>'L', -11738=>'L', -11739=>'L', -11740=>'L', -11741=>'L', -11742=>'L', -11776=>'ON', -11777=>'ON', -11778=>'ON', -11779=>'ON', -11780=>'ON', -11781=>'ON', -11782=>'ON', -11783=>'ON', -11784=>'ON', -11785=>'ON', -11786=>'ON', -11787=>'ON', -11788=>'ON', -11789=>'ON', -11790=>'ON', -11791=>'ON', -11792=>'ON', -11793=>'ON', -11794=>'ON', -11795=>'ON', -11796=>'ON', -11797=>'ON', -11798=>'ON', -11799=>'ON', -11804=>'ON', -11805=>'ON', -11904=>'ON', -11905=>'ON', -11906=>'ON', -11907=>'ON', -11908=>'ON', -11909=>'ON', -11910=>'ON', -11911=>'ON', -11912=>'ON', -11913=>'ON', -11914=>'ON', -11915=>'ON', -11916=>'ON', -11917=>'ON', -11918=>'ON', -11919=>'ON', -11920=>'ON', -11921=>'ON', -11922=>'ON', -11923=>'ON', -11924=>'ON', -11925=>'ON', -11926=>'ON', -11927=>'ON', -11928=>'ON', -11929=>'ON', -11931=>'ON', -11932=>'ON', -11933=>'ON', -11934=>'ON', -11935=>'ON', -11936=>'ON', -11937=>'ON', -11938=>'ON', -11939=>'ON', -11940=>'ON', -11941=>'ON', -11942=>'ON', -11943=>'ON', -11944=>'ON', -11945=>'ON', -11946=>'ON', -11947=>'ON', -11948=>'ON', -11949=>'ON', -11950=>'ON', -11951=>'ON', -11952=>'ON', -11953=>'ON', -11954=>'ON', -11955=>'ON', -11956=>'ON', -11957=>'ON', -11958=>'ON', -11959=>'ON', -11960=>'ON', -11961=>'ON', -11962=>'ON', -11963=>'ON', -11964=>'ON', -11965=>'ON', -11966=>'ON', -11967=>'ON', -11968=>'ON', -11969=>'ON', -11970=>'ON', -11971=>'ON', -11972=>'ON', -11973=>'ON', -11974=>'ON', -11975=>'ON', -11976=>'ON', -11977=>'ON', -11978=>'ON', -11979=>'ON', -11980=>'ON', -11981=>'ON', -11982=>'ON', -11983=>'ON', -11984=>'ON', -11985=>'ON', -11986=>'ON', -11987=>'ON', -11988=>'ON', -11989=>'ON', -11990=>'ON', -11991=>'ON', -11992=>'ON', -11993=>'ON', -11994=>'ON', -11995=>'ON', -11996=>'ON', -11997=>'ON', -11998=>'ON', -11999=>'ON', -12000=>'ON', -12001=>'ON', -12002=>'ON', -12003=>'ON', -12004=>'ON', -12005=>'ON', -12006=>'ON', -12007=>'ON', -12008=>'ON', -12009=>'ON', -12010=>'ON', -12011=>'ON', -12012=>'ON', -12013=>'ON', -12014=>'ON', -12015=>'ON', -12016=>'ON', -12017=>'ON', -12018=>'ON', -12019=>'ON', -12032=>'ON', -12033=>'ON', -12034=>'ON', -12035=>'ON', -12036=>'ON', -12037=>'ON', -12038=>'ON', -12039=>'ON', -12040=>'ON', -12041=>'ON', -12042=>'ON', -12043=>'ON', -12044=>'ON', -12045=>'ON', -12046=>'ON', -12047=>'ON', -12048=>'ON', -12049=>'ON', -12050=>'ON', -12051=>'ON', -12052=>'ON', -12053=>'ON', -12054=>'ON', -12055=>'ON', -12056=>'ON', -12057=>'ON', -12058=>'ON', -12059=>'ON', -12060=>'ON', -12061=>'ON', -12062=>'ON', -12063=>'ON', -12064=>'ON', -12065=>'ON', -12066=>'ON', -12067=>'ON', -12068=>'ON', -12069=>'ON', -12070=>'ON', -12071=>'ON', -12072=>'ON', -12073=>'ON', -12074=>'ON', -12075=>'ON', -12076=>'ON', -12077=>'ON', -12078=>'ON', -12079=>'ON', -12080=>'ON', -12081=>'ON', -12082=>'ON', -12083=>'ON', -12084=>'ON', -12085=>'ON', -12086=>'ON', -12087=>'ON', -12088=>'ON', -12089=>'ON', -12090=>'ON', -12091=>'ON', -12092=>'ON', -12093=>'ON', -12094=>'ON', -12095=>'ON', -12096=>'ON', -12097=>'ON', -12098=>'ON', -12099=>'ON', -12100=>'ON', -12101=>'ON', -12102=>'ON', -12103=>'ON', -12104=>'ON', -12105=>'ON', -12106=>'ON', -12107=>'ON', -12108=>'ON', -12109=>'ON', -12110=>'ON', -12111=>'ON', -12112=>'ON', -12113=>'ON', -12114=>'ON', -12115=>'ON', -12116=>'ON', -12117=>'ON', -12118=>'ON', -12119=>'ON', -12120=>'ON', -12121=>'ON', -12122=>'ON', -12123=>'ON', -12124=>'ON', -12125=>'ON', -12126=>'ON', -12127=>'ON', -12128=>'ON', -12129=>'ON', -12130=>'ON', -12131=>'ON', -12132=>'ON', -12133=>'ON', -12134=>'ON', -12135=>'ON', -12136=>'ON', -12137=>'ON', -12138=>'ON', -12139=>'ON', -12140=>'ON', -12141=>'ON', -12142=>'ON', -12143=>'ON', -12144=>'ON', -12145=>'ON', -12146=>'ON', -12147=>'ON', -12148=>'ON', -12149=>'ON', -12150=>'ON', -12151=>'ON', -12152=>'ON', -12153=>'ON', -12154=>'ON', -12155=>'ON', -12156=>'ON', -12157=>'ON', -12158=>'ON', -12159=>'ON', -12160=>'ON', -12161=>'ON', -12162=>'ON', -12163=>'ON', -12164=>'ON', -12165=>'ON', -12166=>'ON', -12167=>'ON', -12168=>'ON', -12169=>'ON', -12170=>'ON', -12171=>'ON', -12172=>'ON', -12173=>'ON', -12174=>'ON', -12175=>'ON', -12176=>'ON', -12177=>'ON', -12178=>'ON', -12179=>'ON', -12180=>'ON', -12181=>'ON', -12182=>'ON', -12183=>'ON', -12184=>'ON', -12185=>'ON', -12186=>'ON', -12187=>'ON', -12188=>'ON', -12189=>'ON', -12190=>'ON', -12191=>'ON', -12192=>'ON', -12193=>'ON', -12194=>'ON', -12195=>'ON', -12196=>'ON', -12197=>'ON', -12198=>'ON', -12199=>'ON', -12200=>'ON', -12201=>'ON', -12202=>'ON', -12203=>'ON', -12204=>'ON', -12205=>'ON', -12206=>'ON', -12207=>'ON', -12208=>'ON', -12209=>'ON', -12210=>'ON', -12211=>'ON', -12212=>'ON', -12213=>'ON', -12214=>'ON', -12215=>'ON', -12216=>'ON', -12217=>'ON', -12218=>'ON', -12219=>'ON', -12220=>'ON', -12221=>'ON', -12222=>'ON', -12223=>'ON', -12224=>'ON', -12225=>'ON', -12226=>'ON', -12227=>'ON', -12228=>'ON', -12229=>'ON', -12230=>'ON', -12231=>'ON', -12232=>'ON', -12233=>'ON', -12234=>'ON', -12235=>'ON', -12236=>'ON', -12237=>'ON', -12238=>'ON', -12239=>'ON', -12240=>'ON', -12241=>'ON', -12242=>'ON', -12243=>'ON', -12244=>'ON', -12245=>'ON', -12272=>'ON', -12273=>'ON', -12274=>'ON', -12275=>'ON', -12276=>'ON', -12277=>'ON', -12278=>'ON', -12279=>'ON', -12280=>'ON', -12281=>'ON', -12282=>'ON', -12283=>'ON', -12288=>'WS', -12289=>'ON', -12290=>'ON', -12291=>'ON', -12292=>'ON', -12293=>'L', -12294=>'L', -12295=>'L', -12296=>'ON', -12297=>'ON', -12298=>'ON', -12299=>'ON', -12300=>'ON', -12301=>'ON', -12302=>'ON', -12303=>'ON', -12304=>'ON', -12305=>'ON', -12306=>'ON', -12307=>'ON', -12308=>'ON', -12309=>'ON', -12310=>'ON', -12311=>'ON', -12312=>'ON', -12313=>'ON', -12314=>'ON', -12315=>'ON', -12316=>'ON', -12317=>'ON', -12318=>'ON', -12319=>'ON', -12320=>'ON', -12321=>'L', -12322=>'L', -12323=>'L', -12324=>'L', -12325=>'L', -12326=>'L', -12327=>'L', -12328=>'L', -12329=>'L', -12330=>'NSM', -12331=>'NSM', -12332=>'NSM', -12333=>'NSM', -12334=>'NSM', -12335=>'NSM', -12336=>'ON', -12337=>'L', -12338=>'L', -12339=>'L', -12340=>'L', -12341=>'L', -12342=>'ON', -12343=>'ON', -12344=>'L', -12345=>'L', -12346=>'L', -12347=>'L', -12348=>'L', -12349=>'ON', -12350=>'ON', -12351=>'ON', -12353=>'L', -12354=>'L', -12355=>'L', -12356=>'L', -12357=>'L', -12358=>'L', -12359=>'L', -12360=>'L', -12361=>'L', -12362=>'L', -12363=>'L', -12364=>'L', -12365=>'L', -12366=>'L', -12367=>'L', -12368=>'L', -12369=>'L', -12370=>'L', -12371=>'L', -12372=>'L', -12373=>'L', -12374=>'L', -12375=>'L', -12376=>'L', -12377=>'L', -12378=>'L', -12379=>'L', -12380=>'L', -12381=>'L', -12382=>'L', -12383=>'L', -12384=>'L', -12385=>'L', -12386=>'L', -12387=>'L', -12388=>'L', -12389=>'L', -12390=>'L', -12391=>'L', -12392=>'L', -12393=>'L', -12394=>'L', -12395=>'L', -12396=>'L', -12397=>'L', -12398=>'L', -12399=>'L', -12400=>'L', -12401=>'L', -12402=>'L', -12403=>'L', -12404=>'L', -12405=>'L', -12406=>'L', -12407=>'L', -12408=>'L', -12409=>'L', -12410=>'L', -12411=>'L', -12412=>'L', -12413=>'L', -12414=>'L', -12415=>'L', -12416=>'L', -12417=>'L', -12418=>'L', -12419=>'L', -12420=>'L', -12421=>'L', -12422=>'L', -12423=>'L', -12424=>'L', -12425=>'L', -12426=>'L', -12427=>'L', -12428=>'L', -12429=>'L', -12430=>'L', -12431=>'L', -12432=>'L', -12433=>'L', -12434=>'L', -12435=>'L', -12436=>'L', -12437=>'L', -12438=>'L', -12441=>'NSM', -12442=>'NSM', -12443=>'ON', -12444=>'ON', -12445=>'L', -12446=>'L', -12447=>'L', -12448=>'ON', -12449=>'L', -12450=>'L', -12451=>'L', -12452=>'L', -12453=>'L', -12454=>'L', -12455=>'L', -12456=>'L', -12457=>'L', -12458=>'L', -12459=>'L', -12460=>'L', -12461=>'L', -12462=>'L', -12463=>'L', -12464=>'L', -12465=>'L', -12466=>'L', -12467=>'L', -12468=>'L', -12469=>'L', -12470=>'L', -12471=>'L', -12472=>'L', -12473=>'L', -12474=>'L', -12475=>'L', -12476=>'L', -12477=>'L', -12478=>'L', -12479=>'L', -12480=>'L', -12481=>'L', -12482=>'L', -12483=>'L', -12484=>'L', -12485=>'L', -12486=>'L', -12487=>'L', -12488=>'L', -12489=>'L', -12490=>'L', -12491=>'L', -12492=>'L', -12493=>'L', -12494=>'L', -12495=>'L', -12496=>'L', -12497=>'L', -12498=>'L', -12499=>'L', -12500=>'L', -12501=>'L', -12502=>'L', -12503=>'L', -12504=>'L', -12505=>'L', -12506=>'L', -12507=>'L', -12508=>'L', -12509=>'L', -12510=>'L', -12511=>'L', -12512=>'L', -12513=>'L', -12514=>'L', -12515=>'L', -12516=>'L', -12517=>'L', -12518=>'L', -12519=>'L', -12520=>'L', -12521=>'L', -12522=>'L', -12523=>'L', -12524=>'L', -12525=>'L', -12526=>'L', -12527=>'L', -12528=>'L', -12529=>'L', -12530=>'L', -12531=>'L', -12532=>'L', -12533=>'L', -12534=>'L', -12535=>'L', -12536=>'L', -12537=>'L', -12538=>'L', -12539=>'ON', -12540=>'L', -12541=>'L', -12542=>'L', -12543=>'L', -12549=>'L', -12550=>'L', -12551=>'L', -12552=>'L', -12553=>'L', -12554=>'L', -12555=>'L', -12556=>'L', -12557=>'L', -12558=>'L', -12559=>'L', -12560=>'L', -12561=>'L', -12562=>'L', -12563=>'L', -12564=>'L', -12565=>'L', -12566=>'L', -12567=>'L', -12568=>'L', -12569=>'L', -12570=>'L', -12571=>'L', -12572=>'L', -12573=>'L', -12574=>'L', -12575=>'L', -12576=>'L', -12577=>'L', -12578=>'L', -12579=>'L', -12580=>'L', -12581=>'L', -12582=>'L', -12583=>'L', -12584=>'L', -12585=>'L', -12586=>'L', -12587=>'L', -12588=>'L', -12593=>'L', -12594=>'L', -12595=>'L', -12596=>'L', -12597=>'L', -12598=>'L', -12599=>'L', -12600=>'L', -12601=>'L', -12602=>'L', -12603=>'L', -12604=>'L', -12605=>'L', -12606=>'L', -12607=>'L', -12608=>'L', -12609=>'L', -12610=>'L', -12611=>'L', -12612=>'L', -12613=>'L', -12614=>'L', -12615=>'L', -12616=>'L', -12617=>'L', -12618=>'L', -12619=>'L', -12620=>'L', -12621=>'L', -12622=>'L', -12623=>'L', -12624=>'L', -12625=>'L', -12626=>'L', -12627=>'L', -12628=>'L', -12629=>'L', -12630=>'L', -12631=>'L', -12632=>'L', -12633=>'L', -12634=>'L', -12635=>'L', -12636=>'L', -12637=>'L', -12638=>'L', -12639=>'L', -12640=>'L', -12641=>'L', -12642=>'L', -12643=>'L', -12644=>'L', -12645=>'L', -12646=>'L', -12647=>'L', -12648=>'L', -12649=>'L', -12650=>'L', -12651=>'L', -12652=>'L', -12653=>'L', -12654=>'L', -12655=>'L', -12656=>'L', -12657=>'L', -12658=>'L', -12659=>'L', -12660=>'L', -12661=>'L', -12662=>'L', -12663=>'L', -12664=>'L', -12665=>'L', -12666=>'L', -12667=>'L', -12668=>'L', -12669=>'L', -12670=>'L', -12671=>'L', -12672=>'L', -12673=>'L', -12674=>'L', -12675=>'L', -12676=>'L', -12677=>'L', -12678=>'L', -12679=>'L', -12680=>'L', -12681=>'L', -12682=>'L', -12683=>'L', -12684=>'L', -12685=>'L', -12686=>'L', -12688=>'L', -12689=>'L', -12690=>'L', -12691=>'L', -12692=>'L', -12693=>'L', -12694=>'L', -12695=>'L', -12696=>'L', -12697=>'L', -12698=>'L', -12699=>'L', -12700=>'L', -12701=>'L', -12702=>'L', -12703=>'L', -12704=>'L', -12705=>'L', -12706=>'L', -12707=>'L', -12708=>'L', -12709=>'L', -12710=>'L', -12711=>'L', -12712=>'L', -12713=>'L', -12714=>'L', -12715=>'L', -12716=>'L', -12717=>'L', -12718=>'L', -12719=>'L', -12720=>'L', -12721=>'L', -12722=>'L', -12723=>'L', -12724=>'L', -12725=>'L', -12726=>'L', -12727=>'L', -12736=>'ON', -12737=>'ON', -12738=>'ON', -12739=>'ON', -12740=>'ON', -12741=>'ON', -12742=>'ON', -12743=>'ON', -12744=>'ON', -12745=>'ON', -12746=>'ON', -12747=>'ON', -12748=>'ON', -12749=>'ON', -12750=>'ON', -12751=>'ON', -12784=>'L', -12785=>'L', -12786=>'L', -12787=>'L', -12788=>'L', -12789=>'L', -12790=>'L', -12791=>'L', -12792=>'L', -12793=>'L', -12794=>'L', -12795=>'L', -12796=>'L', -12797=>'L', -12798=>'L', -12799=>'L', -12800=>'L', -12801=>'L', -12802=>'L', -12803=>'L', -12804=>'L', -12805=>'L', -12806=>'L', -12807=>'L', -12808=>'L', -12809=>'L', -12810=>'L', -12811=>'L', -12812=>'L', -12813=>'L', -12814=>'L', -12815=>'L', -12816=>'L', -12817=>'L', -12818=>'L', -12819=>'L', -12820=>'L', -12821=>'L', -12822=>'L', -12823=>'L', -12824=>'L', -12825=>'L', -12826=>'L', -12827=>'L', -12828=>'L', -12829=>'ON', -12830=>'ON', -12832=>'L', -12833=>'L', -12834=>'L', -12835=>'L', -12836=>'L', -12837=>'L', -12838=>'L', -12839=>'L', -12840=>'L', -12841=>'L', -12842=>'L', -12843=>'L', -12844=>'L', -12845=>'L', -12846=>'L', -12847=>'L', -12848=>'L', -12849=>'L', -12850=>'L', -12851=>'L', -12852=>'L', -12853=>'L', -12854=>'L', -12855=>'L', -12856=>'L', -12857=>'L', -12858=>'L', -12859=>'L', -12860=>'L', -12861=>'L', -12862=>'L', -12863=>'L', -12864=>'L', -12865=>'L', -12866=>'L', -12867=>'L', -12880=>'ON', -12881=>'ON', -12882=>'ON', -12883=>'ON', -12884=>'ON', -12885=>'ON', -12886=>'ON', -12887=>'ON', -12888=>'ON', -12889=>'ON', -12890=>'ON', -12891=>'ON', -12892=>'ON', -12893=>'ON', -12894=>'ON', -12895=>'ON', -12896=>'L', -12897=>'L', -12898=>'L', -12899=>'L', -12900=>'L', -12901=>'L', -12902=>'L', -12903=>'L', -12904=>'L', -12905=>'L', -12906=>'L', -12907=>'L', -12908=>'L', -12909=>'L', -12910=>'L', -12911=>'L', -12912=>'L', -12913=>'L', -12914=>'L', -12915=>'L', -12916=>'L', -12917=>'L', -12918=>'L', -12919=>'L', -12920=>'L', -12921=>'L', -12922=>'L', -12923=>'L', -12924=>'ON', -12925=>'ON', -12926=>'ON', -12927=>'L', -12928=>'L', -12929=>'L', -12930=>'L', -12931=>'L', -12932=>'L', -12933=>'L', -12934=>'L', -12935=>'L', -12936=>'L', -12937=>'L', -12938=>'L', -12939=>'L', -12940=>'L', -12941=>'L', -12942=>'L', -12943=>'L', -12944=>'L', -12945=>'L', -12946=>'L', -12947=>'L', -12948=>'L', -12949=>'L', -12950=>'L', -12951=>'L', -12952=>'L', -12953=>'L', -12954=>'L', -12955=>'L', -12956=>'L', -12957=>'L', -12958=>'L', -12959=>'L', -12960=>'L', -12961=>'L', -12962=>'L', -12963=>'L', -12964=>'L', -12965=>'L', -12966=>'L', -12967=>'L', -12968=>'L', -12969=>'L', -12970=>'L', -12971=>'L', -12972=>'L', -12973=>'L', -12974=>'L', -12975=>'L', -12976=>'L', -12977=>'ON', -12978=>'ON', -12979=>'ON', -12980=>'ON', -12981=>'ON', -12982=>'ON', -12983=>'ON', -12984=>'ON', -12985=>'ON', -12986=>'ON', -12987=>'ON', -12988=>'ON', -12989=>'ON', -12990=>'ON', -12991=>'ON', -12992=>'L', -12993=>'L', -12994=>'L', -12995=>'L', -12996=>'L', -12997=>'L', -12998=>'L', -12999=>'L', -13000=>'L', -13001=>'L', -13002=>'L', -13003=>'L', -13004=>'ON', -13005=>'ON', -13006=>'ON', -13007=>'ON', -13008=>'L', -13009=>'L', -13010=>'L', -13011=>'L', -13012=>'L', -13013=>'L', -13014=>'L', -13015=>'L', -13016=>'L', -13017=>'L', -13018=>'L', -13019=>'L', -13020=>'L', -13021=>'L', -13022=>'L', -13023=>'L', -13024=>'L', -13025=>'L', -13026=>'L', -13027=>'L', -13028=>'L', -13029=>'L', -13030=>'L', -13031=>'L', -13032=>'L', -13033=>'L', -13034=>'L', -13035=>'L', -13036=>'L', -13037=>'L', -13038=>'L', -13039=>'L', -13040=>'L', -13041=>'L', -13042=>'L', -13043=>'L', -13044=>'L', -13045=>'L', -13046=>'L', -13047=>'L', -13048=>'L', -13049=>'L', -13050=>'L', -13051=>'L', -13052=>'L', -13053=>'L', -13054=>'L', -13056=>'L', -13057=>'L', -13058=>'L', -13059=>'L', -13060=>'L', -13061=>'L', -13062=>'L', -13063=>'L', -13064=>'L', -13065=>'L', -13066=>'L', -13067=>'L', -13068=>'L', -13069=>'L', -13070=>'L', -13071=>'L', -13072=>'L', -13073=>'L', -13074=>'L', -13075=>'L', -13076=>'L', -13077=>'L', -13078=>'L', -13079=>'L', -13080=>'L', -13081=>'L', -13082=>'L', -13083=>'L', -13084=>'L', -13085=>'L', -13086=>'L', -13087=>'L', -13088=>'L', -13089=>'L', -13090=>'L', -13091=>'L', -13092=>'L', -13093=>'L', -13094=>'L', -13095=>'L', -13096=>'L', -13097=>'L', -13098=>'L', -13099=>'L', -13100=>'L', -13101=>'L', -13102=>'L', -13103=>'L', -13104=>'L', -13105=>'L', -13106=>'L', -13107=>'L', -13108=>'L', -13109=>'L', -13110=>'L', -13111=>'L', -13112=>'L', -13113=>'L', -13114=>'L', -13115=>'L', -13116=>'L', -13117=>'L', -13118=>'L', -13119=>'L', -13120=>'L', -13121=>'L', -13122=>'L', -13123=>'L', -13124=>'L', -13125=>'L', -13126=>'L', -13127=>'L', -13128=>'L', -13129=>'L', -13130=>'L', -13131=>'L', -13132=>'L', -13133=>'L', -13134=>'L', -13135=>'L', -13136=>'L', -13137=>'L', -13138=>'L', -13139=>'L', -13140=>'L', -13141=>'L', -13142=>'L', -13143=>'L', -13144=>'L', -13145=>'L', -13146=>'L', -13147=>'L', -13148=>'L', -13149=>'L', -13150=>'L', -13151=>'L', -13152=>'L', -13153=>'L', -13154=>'L', -13155=>'L', -13156=>'L', -13157=>'L', -13158=>'L', -13159=>'L', -13160=>'L', -13161=>'L', -13162=>'L', -13163=>'L', -13164=>'L', -13165=>'L', -13166=>'L', -13167=>'L', -13168=>'L', -13169=>'L', -13170=>'L', -13171=>'L', -13172=>'L', -13173=>'L', -13174=>'L', -13175=>'ON', -13176=>'ON', -13177=>'ON', -13178=>'ON', -13179=>'L', -13180=>'L', -13181=>'L', -13182=>'L', -13183=>'L', -13184=>'L', -13185=>'L', -13186=>'L', -13187=>'L', -13188=>'L', -13189=>'L', -13190=>'L', -13191=>'L', -13192=>'L', -13193=>'L', -13194=>'L', -13195=>'L', -13196=>'L', -13197=>'L', -13198=>'L', -13199=>'L', -13200=>'L', -13201=>'L', -13202=>'L', -13203=>'L', -13204=>'L', -13205=>'L', -13206=>'L', -13207=>'L', -13208=>'L', -13209=>'L', -13210=>'L', -13211=>'L', -13212=>'L', -13213=>'L', -13214=>'L', -13215=>'L', -13216=>'L', -13217=>'L', -13218=>'L', -13219=>'L', -13220=>'L', -13221=>'L', -13222=>'L', -13223=>'L', -13224=>'L', -13225=>'L', -13226=>'L', -13227=>'L', -13228=>'L', -13229=>'L', -13230=>'L', -13231=>'L', -13232=>'L', -13233=>'L', -13234=>'L', -13235=>'L', -13236=>'L', -13237=>'L', -13238=>'L', -13239=>'L', -13240=>'L', -13241=>'L', -13242=>'L', -13243=>'L', -13244=>'L', -13245=>'L', -13246=>'L', -13247=>'L', -13248=>'L', -13249=>'L', -13250=>'L', -13251=>'L', -13252=>'L', -13253=>'L', -13254=>'L', -13255=>'L', -13256=>'L', -13257=>'L', -13258=>'L', -13259=>'L', -13260=>'L', -13261=>'L', -13262=>'L', -13263=>'L', -13264=>'L', -13265=>'L', -13266=>'L', -13267=>'L', -13268=>'L', -13269=>'L', -13270=>'L', -13271=>'L', -13272=>'L', -13273=>'L', -13274=>'L', -13275=>'L', -13276=>'L', -13277=>'L', -13278=>'ON', -13279=>'ON', -13280=>'L', -13281=>'L', -13282=>'L', -13283=>'L', -13284=>'L', -13285=>'L', -13286=>'L', -13287=>'L', -13288=>'L', -13289=>'L', -13290=>'L', -13291=>'L', -13292=>'L', -13293=>'L', -13294=>'L', -13295=>'L', -13296=>'L', -13297=>'L', -13298=>'L', -13299=>'L', -13300=>'L', -13301=>'L', -13302=>'L', -13303=>'L', -13304=>'L', -13305=>'L', -13306=>'L', -13307=>'L', -13308=>'L', -13309=>'L', -13310=>'L', -13311=>'ON', -13312=>'L', -19893=>'L', -19904=>'ON', -19905=>'ON', -19906=>'ON', -19907=>'ON', -19908=>'ON', -19909=>'ON', -19910=>'ON', -19911=>'ON', -19912=>'ON', -19913=>'ON', -19914=>'ON', -19915=>'ON', -19916=>'ON', -19917=>'ON', -19918=>'ON', -19919=>'ON', -19920=>'ON', -19921=>'ON', -19922=>'ON', -19923=>'ON', -19924=>'ON', -19925=>'ON', -19926=>'ON', -19927=>'ON', -19928=>'ON', -19929=>'ON', -19930=>'ON', -19931=>'ON', -19932=>'ON', -19933=>'ON', -19934=>'ON', -19935=>'ON', -19936=>'ON', -19937=>'ON', -19938=>'ON', -19939=>'ON', -19940=>'ON', -19941=>'ON', -19942=>'ON', -19943=>'ON', -19944=>'ON', -19945=>'ON', -19946=>'ON', -19947=>'ON', -19948=>'ON', -19949=>'ON', -19950=>'ON', -19951=>'ON', -19952=>'ON', -19953=>'ON', -19954=>'ON', -19955=>'ON', -19956=>'ON', -19957=>'ON', -19958=>'ON', -19959=>'ON', -19960=>'ON', -19961=>'ON', -19962=>'ON', -19963=>'ON', -19964=>'ON', -19965=>'ON', -19966=>'ON', -19967=>'ON', -19968=>'L', -40891=>'L', -40960=>'L', -40961=>'L', -40962=>'L', -40963=>'L', -40964=>'L', -40965=>'L', -40966=>'L', -40967=>'L', -40968=>'L', -40969=>'L', -40970=>'L', -40971=>'L', -40972=>'L', -40973=>'L', -40974=>'L', -40975=>'L', -40976=>'L', -40977=>'L', -40978=>'L', -40979=>'L', -40980=>'L', -40981=>'L', -40982=>'L', -40983=>'L', -40984=>'L', -40985=>'L', -40986=>'L', -40987=>'L', -40988=>'L', -40989=>'L', -40990=>'L', -40991=>'L', -40992=>'L', -40993=>'L', -40994=>'L', -40995=>'L', -40996=>'L', -40997=>'L', -40998=>'L', -40999=>'L', -41000=>'L', -41001=>'L', -41002=>'L', -41003=>'L', -41004=>'L', -41005=>'L', -41006=>'L', -41007=>'L', -41008=>'L', -41009=>'L', -41010=>'L', -41011=>'L', -41012=>'L', -41013=>'L', -41014=>'L', -41015=>'L', -41016=>'L', -41017=>'L', -41018=>'L', -41019=>'L', -41020=>'L', -41021=>'L', -41022=>'L', -41023=>'L', -41024=>'L', -41025=>'L', -41026=>'L', -41027=>'L', -41028=>'L', -41029=>'L', -41030=>'L', -41031=>'L', -41032=>'L', -41033=>'L', -41034=>'L', -41035=>'L', -41036=>'L', -41037=>'L', -41038=>'L', -41039=>'L', -41040=>'L', -41041=>'L', -41042=>'L', -41043=>'L', -41044=>'L', -41045=>'L', -41046=>'L', -41047=>'L', -41048=>'L', -41049=>'L', -41050=>'L', -41051=>'L', -41052=>'L', -41053=>'L', -41054=>'L', -41055=>'L', -41056=>'L', -41057=>'L', -41058=>'L', -41059=>'L', -41060=>'L', -41061=>'L', -41062=>'L', -41063=>'L', -41064=>'L', -41065=>'L', -41066=>'L', -41067=>'L', -41068=>'L', -41069=>'L', -41070=>'L', -41071=>'L', -41072=>'L', -41073=>'L', -41074=>'L', -41075=>'L', -41076=>'L', -41077=>'L', -41078=>'L', -41079=>'L', -41080=>'L', -41081=>'L', -41082=>'L', -41083=>'L', -41084=>'L', -41085=>'L', -41086=>'L', -41087=>'L', -41088=>'L', -41089=>'L', -41090=>'L', -41091=>'L', -41092=>'L', -41093=>'L', -41094=>'L', -41095=>'L', -41096=>'L', -41097=>'L', -41098=>'L', -41099=>'L', -41100=>'L', -41101=>'L', -41102=>'L', -41103=>'L', -41104=>'L', -41105=>'L', -41106=>'L', -41107=>'L', -41108=>'L', -41109=>'L', -41110=>'L', -41111=>'L', -41112=>'L', -41113=>'L', -41114=>'L', -41115=>'L', -41116=>'L', -41117=>'L', -41118=>'L', -41119=>'L', -41120=>'L', -41121=>'L', -41122=>'L', -41123=>'L', -41124=>'L', -41125=>'L', -41126=>'L', -41127=>'L', -41128=>'L', -41129=>'L', -41130=>'L', -41131=>'L', -41132=>'L', -41133=>'L', -41134=>'L', -41135=>'L', -41136=>'L', -41137=>'L', -41138=>'L', -41139=>'L', -41140=>'L', -41141=>'L', -41142=>'L', -41143=>'L', -41144=>'L', -41145=>'L', -41146=>'L', -41147=>'L', -41148=>'L', -41149=>'L', -41150=>'L', -41151=>'L', -41152=>'L', -41153=>'L', -41154=>'L', -41155=>'L', -41156=>'L', -41157=>'L', -41158=>'L', -41159=>'L', -41160=>'L', -41161=>'L', -41162=>'L', -41163=>'L', -41164=>'L', -41165=>'L', -41166=>'L', -41167=>'L', -41168=>'L', -41169=>'L', -41170=>'L', -41171=>'L', -41172=>'L', -41173=>'L', -41174=>'L', -41175=>'L', -41176=>'L', -41177=>'L', -41178=>'L', -41179=>'L', -41180=>'L', -41181=>'L', -41182=>'L', -41183=>'L', -41184=>'L', -41185=>'L', -41186=>'L', -41187=>'L', -41188=>'L', -41189=>'L', -41190=>'L', -41191=>'L', -41192=>'L', -41193=>'L', -41194=>'L', -41195=>'L', -41196=>'L', -41197=>'L', -41198=>'L', -41199=>'L', -41200=>'L', -41201=>'L', -41202=>'L', -41203=>'L', -41204=>'L', -41205=>'L', -41206=>'L', -41207=>'L', -41208=>'L', -41209=>'L', -41210=>'L', -41211=>'L', -41212=>'L', -41213=>'L', -41214=>'L', -41215=>'L', -41216=>'L', -41217=>'L', -41218=>'L', -41219=>'L', -41220=>'L', -41221=>'L', -41222=>'L', -41223=>'L', -41224=>'L', -41225=>'L', -41226=>'L', -41227=>'L', -41228=>'L', -41229=>'L', -41230=>'L', -41231=>'L', -41232=>'L', -41233=>'L', -41234=>'L', -41235=>'L', -41236=>'L', -41237=>'L', -41238=>'L', -41239=>'L', -41240=>'L', -41241=>'L', -41242=>'L', -41243=>'L', -41244=>'L', -41245=>'L', -41246=>'L', -41247=>'L', -41248=>'L', -41249=>'L', -41250=>'L', -41251=>'L', -41252=>'L', -41253=>'L', -41254=>'L', -41255=>'L', -41256=>'L', -41257=>'L', -41258=>'L', -41259=>'L', -41260=>'L', -41261=>'L', -41262=>'L', -41263=>'L', -41264=>'L', -41265=>'L', -41266=>'L', -41267=>'L', -41268=>'L', -41269=>'L', -41270=>'L', -41271=>'L', -41272=>'L', -41273=>'L', -41274=>'L', -41275=>'L', -41276=>'L', -41277=>'L', -41278=>'L', -41279=>'L', -41280=>'L', -41281=>'L', -41282=>'L', -41283=>'L', -41284=>'L', -41285=>'L', -41286=>'L', -41287=>'L', -41288=>'L', -41289=>'L', -41290=>'L', -41291=>'L', -41292=>'L', -41293=>'L', -41294=>'L', -41295=>'L', -41296=>'L', -41297=>'L', -41298=>'L', -41299=>'L', -41300=>'L', -41301=>'L', -41302=>'L', -41303=>'L', -41304=>'L', -41305=>'L', -41306=>'L', -41307=>'L', -41308=>'L', -41309=>'L', -41310=>'L', -41311=>'L', -41312=>'L', -41313=>'L', -41314=>'L', -41315=>'L', -41316=>'L', -41317=>'L', -41318=>'L', -41319=>'L', -41320=>'L', -41321=>'L', -41322=>'L', -41323=>'L', -41324=>'L', -41325=>'L', -41326=>'L', -41327=>'L', -41328=>'L', -41329=>'L', -41330=>'L', -41331=>'L', -41332=>'L', -41333=>'L', -41334=>'L', -41335=>'L', -41336=>'L', -41337=>'L', -41338=>'L', -41339=>'L', -41340=>'L', -41341=>'L', -41342=>'L', -41343=>'L', -41344=>'L', -41345=>'L', -41346=>'L', -41347=>'L', -41348=>'L', -41349=>'L', -41350=>'L', -41351=>'L', -41352=>'L', -41353=>'L', -41354=>'L', -41355=>'L', -41356=>'L', -41357=>'L', -41358=>'L', -41359=>'L', -41360=>'L', -41361=>'L', -41362=>'L', -41363=>'L', -41364=>'L', -41365=>'L', -41366=>'L', -41367=>'L', -41368=>'L', -41369=>'L', -41370=>'L', -41371=>'L', -41372=>'L', -41373=>'L', -41374=>'L', -41375=>'L', -41376=>'L', -41377=>'L', -41378=>'L', -41379=>'L', -41380=>'L', -41381=>'L', -41382=>'L', -41383=>'L', -41384=>'L', -41385=>'L', -41386=>'L', -41387=>'L', -41388=>'L', -41389=>'L', -41390=>'L', -41391=>'L', -41392=>'L', -41393=>'L', -41394=>'L', -41395=>'L', -41396=>'L', -41397=>'L', -41398=>'L', -41399=>'L', -41400=>'L', -41401=>'L', -41402=>'L', -41403=>'L', -41404=>'L', -41405=>'L', -41406=>'L', -41407=>'L', -41408=>'L', -41409=>'L', -41410=>'L', -41411=>'L', -41412=>'L', -41413=>'L', -41414=>'L', -41415=>'L', -41416=>'L', -41417=>'L', -41418=>'L', -41419=>'L', -41420=>'L', -41421=>'L', -41422=>'L', -41423=>'L', -41424=>'L', -41425=>'L', -41426=>'L', -41427=>'L', -41428=>'L', -41429=>'L', -41430=>'L', -41431=>'L', -41432=>'L', -41433=>'L', -41434=>'L', -41435=>'L', -41436=>'L', -41437=>'L', -41438=>'L', -41439=>'L', -41440=>'L', -41441=>'L', -41442=>'L', -41443=>'L', -41444=>'L', -41445=>'L', -41446=>'L', -41447=>'L', -41448=>'L', -41449=>'L', -41450=>'L', -41451=>'L', -41452=>'L', -41453=>'L', -41454=>'L', -41455=>'L', -41456=>'L', -41457=>'L', -41458=>'L', -41459=>'L', -41460=>'L', -41461=>'L', -41462=>'L', -41463=>'L', -41464=>'L', -41465=>'L', -41466=>'L', -41467=>'L', -41468=>'L', -41469=>'L', -41470=>'L', -41471=>'L', -41472=>'L', -41473=>'L', -41474=>'L', -41475=>'L', -41476=>'L', -41477=>'L', -41478=>'L', -41479=>'L', -41480=>'L', -41481=>'L', -41482=>'L', -41483=>'L', -41484=>'L', -41485=>'L', -41486=>'L', -41487=>'L', -41488=>'L', -41489=>'L', -41490=>'L', -41491=>'L', -41492=>'L', -41493=>'L', -41494=>'L', -41495=>'L', -41496=>'L', -41497=>'L', -41498=>'L', -41499=>'L', -41500=>'L', -41501=>'L', -41502=>'L', -41503=>'L', -41504=>'L', -41505=>'L', -41506=>'L', -41507=>'L', -41508=>'L', -41509=>'L', -41510=>'L', -41511=>'L', -41512=>'L', -41513=>'L', -41514=>'L', -41515=>'L', -41516=>'L', -41517=>'L', -41518=>'L', -41519=>'L', -41520=>'L', -41521=>'L', -41522=>'L', -41523=>'L', -41524=>'L', -41525=>'L', -41526=>'L', -41527=>'L', -41528=>'L', -41529=>'L', -41530=>'L', -41531=>'L', -41532=>'L', -41533=>'L', -41534=>'L', -41535=>'L', -41536=>'L', -41537=>'L', -41538=>'L', -41539=>'L', -41540=>'L', -41541=>'L', -41542=>'L', -41543=>'L', -41544=>'L', -41545=>'L', -41546=>'L', -41547=>'L', -41548=>'L', -41549=>'L', -41550=>'L', -41551=>'L', -41552=>'L', -41553=>'L', -41554=>'L', -41555=>'L', -41556=>'L', -41557=>'L', -41558=>'L', -41559=>'L', -41560=>'L', -41561=>'L', -41562=>'L', -41563=>'L', -41564=>'L', -41565=>'L', -41566=>'L', -41567=>'L', -41568=>'L', -41569=>'L', -41570=>'L', -41571=>'L', -41572=>'L', -41573=>'L', -41574=>'L', -41575=>'L', -41576=>'L', -41577=>'L', -41578=>'L', -41579=>'L', -41580=>'L', -41581=>'L', -41582=>'L', -41583=>'L', -41584=>'L', -41585=>'L', -41586=>'L', -41587=>'L', -41588=>'L', -41589=>'L', -41590=>'L', -41591=>'L', -41592=>'L', -41593=>'L', -41594=>'L', -41595=>'L', -41596=>'L', -41597=>'L', -41598=>'L', -41599=>'L', -41600=>'L', -41601=>'L', -41602=>'L', -41603=>'L', -41604=>'L', -41605=>'L', -41606=>'L', -41607=>'L', -41608=>'L', -41609=>'L', -41610=>'L', -41611=>'L', -41612=>'L', -41613=>'L', -41614=>'L', -41615=>'L', -41616=>'L', -41617=>'L', -41618=>'L', -41619=>'L', -41620=>'L', -41621=>'L', -41622=>'L', -41623=>'L', -41624=>'L', -41625=>'L', -41626=>'L', -41627=>'L', -41628=>'L', -41629=>'L', -41630=>'L', -41631=>'L', -41632=>'L', -41633=>'L', -41634=>'L', -41635=>'L', -41636=>'L', -41637=>'L', -41638=>'L', -41639=>'L', -41640=>'L', -41641=>'L', -41642=>'L', -41643=>'L', -41644=>'L', -41645=>'L', -41646=>'L', -41647=>'L', -41648=>'L', -41649=>'L', -41650=>'L', -41651=>'L', -41652=>'L', -41653=>'L', -41654=>'L', -41655=>'L', -41656=>'L', -41657=>'L', -41658=>'L', -41659=>'L', -41660=>'L', -41661=>'L', -41662=>'L', -41663=>'L', -41664=>'L', -41665=>'L', -41666=>'L', -41667=>'L', -41668=>'L', -41669=>'L', -41670=>'L', -41671=>'L', -41672=>'L', -41673=>'L', -41674=>'L', -41675=>'L', -41676=>'L', -41677=>'L', -41678=>'L', -41679=>'L', -41680=>'L', -41681=>'L', -41682=>'L', -41683=>'L', -41684=>'L', -41685=>'L', -41686=>'L', -41687=>'L', -41688=>'L', -41689=>'L', -41690=>'L', -41691=>'L', -41692=>'L', -41693=>'L', -41694=>'L', -41695=>'L', -41696=>'L', -41697=>'L', -41698=>'L', -41699=>'L', -41700=>'L', -41701=>'L', -41702=>'L', -41703=>'L', -41704=>'L', -41705=>'L', -41706=>'L', -41707=>'L', -41708=>'L', -41709=>'L', -41710=>'L', -41711=>'L', -41712=>'L', -41713=>'L', -41714=>'L', -41715=>'L', -41716=>'L', -41717=>'L', -41718=>'L', -41719=>'L', -41720=>'L', -41721=>'L', -41722=>'L', -41723=>'L', -41724=>'L', -41725=>'L', -41726=>'L', -41727=>'L', -41728=>'L', -41729=>'L', -41730=>'L', -41731=>'L', -41732=>'L', -41733=>'L', -41734=>'L', -41735=>'L', -41736=>'L', -41737=>'L', -41738=>'L', -41739=>'L', -41740=>'L', -41741=>'L', -41742=>'L', -41743=>'L', -41744=>'L', -41745=>'L', -41746=>'L', -41747=>'L', -41748=>'L', -41749=>'L', -41750=>'L', -41751=>'L', -41752=>'L', -41753=>'L', -41754=>'L', -41755=>'L', -41756=>'L', -41757=>'L', -41758=>'L', -41759=>'L', -41760=>'L', -41761=>'L', -41762=>'L', -41763=>'L', -41764=>'L', -41765=>'L', -41766=>'L', -41767=>'L', -41768=>'L', -41769=>'L', -41770=>'L', -41771=>'L', -41772=>'L', -41773=>'L', -41774=>'L', -41775=>'L', -41776=>'L', -41777=>'L', -41778=>'L', -41779=>'L', -41780=>'L', -41781=>'L', -41782=>'L', -41783=>'L', -41784=>'L', -41785=>'L', -41786=>'L', -41787=>'L', -41788=>'L', -41789=>'L', -41790=>'L', -41791=>'L', -41792=>'L', -41793=>'L', -41794=>'L', -41795=>'L', -41796=>'L', -41797=>'L', -41798=>'L', -41799=>'L', -41800=>'L', -41801=>'L', -41802=>'L', -41803=>'L', -41804=>'L', -41805=>'L', -41806=>'L', -41807=>'L', -41808=>'L', -41809=>'L', -41810=>'L', -41811=>'L', -41812=>'L', -41813=>'L', -41814=>'L', -41815=>'L', -41816=>'L', -41817=>'L', -41818=>'L', -41819=>'L', -41820=>'L', -41821=>'L', -41822=>'L', -41823=>'L', -41824=>'L', -41825=>'L', -41826=>'L', -41827=>'L', -41828=>'L', -41829=>'L', -41830=>'L', -41831=>'L', -41832=>'L', -41833=>'L', -41834=>'L', -41835=>'L', -41836=>'L', -41837=>'L', -41838=>'L', -41839=>'L', -41840=>'L', -41841=>'L', -41842=>'L', -41843=>'L', -41844=>'L', -41845=>'L', -41846=>'L', -41847=>'L', -41848=>'L', -41849=>'L', -41850=>'L', -41851=>'L', -41852=>'L', -41853=>'L', -41854=>'L', -41855=>'L', -41856=>'L', -41857=>'L', -41858=>'L', -41859=>'L', -41860=>'L', -41861=>'L', -41862=>'L', -41863=>'L', -41864=>'L', -41865=>'L', -41866=>'L', -41867=>'L', -41868=>'L', -41869=>'L', -41870=>'L', -41871=>'L', -41872=>'L', -41873=>'L', -41874=>'L', -41875=>'L', -41876=>'L', -41877=>'L', -41878=>'L', -41879=>'L', -41880=>'L', -41881=>'L', -41882=>'L', -41883=>'L', -41884=>'L', -41885=>'L', -41886=>'L', -41887=>'L', -41888=>'L', -41889=>'L', -41890=>'L', -41891=>'L', -41892=>'L', -41893=>'L', -41894=>'L', -41895=>'L', -41896=>'L', -41897=>'L', -41898=>'L', -41899=>'L', -41900=>'L', -41901=>'L', -41902=>'L', -41903=>'L', -41904=>'L', -41905=>'L', -41906=>'L', -41907=>'L', -41908=>'L', -41909=>'L', -41910=>'L', -41911=>'L', -41912=>'L', -41913=>'L', -41914=>'L', -41915=>'L', -41916=>'L', -41917=>'L', -41918=>'L', -41919=>'L', -41920=>'L', -41921=>'L', -41922=>'L', -41923=>'L', -41924=>'L', -41925=>'L', -41926=>'L', -41927=>'L', -41928=>'L', -41929=>'L', -41930=>'L', -41931=>'L', -41932=>'L', -41933=>'L', -41934=>'L', -41935=>'L', -41936=>'L', -41937=>'L', -41938=>'L', -41939=>'L', -41940=>'L', -41941=>'L', -41942=>'L', -41943=>'L', -41944=>'L', -41945=>'L', -41946=>'L', -41947=>'L', -41948=>'L', -41949=>'L', -41950=>'L', -41951=>'L', -41952=>'L', -41953=>'L', -41954=>'L', -41955=>'L', -41956=>'L', -41957=>'L', -41958=>'L', -41959=>'L', -41960=>'L', -41961=>'L', -41962=>'L', -41963=>'L', -41964=>'L', -41965=>'L', -41966=>'L', -41967=>'L', -41968=>'L', -41969=>'L', -41970=>'L', -41971=>'L', -41972=>'L', -41973=>'L', -41974=>'L', -41975=>'L', -41976=>'L', -41977=>'L', -41978=>'L', -41979=>'L', -41980=>'L', -41981=>'L', -41982=>'L', -41983=>'L', -41984=>'L', -41985=>'L', -41986=>'L', -41987=>'L', -41988=>'L', -41989=>'L', -41990=>'L', -41991=>'L', -41992=>'L', -41993=>'L', -41994=>'L', -41995=>'L', -41996=>'L', -41997=>'L', -41998=>'L', -41999=>'L', -42000=>'L', -42001=>'L', -42002=>'L', -42003=>'L', -42004=>'L', -42005=>'L', -42006=>'L', -42007=>'L', -42008=>'L', -42009=>'L', -42010=>'L', -42011=>'L', -42012=>'L', -42013=>'L', -42014=>'L', -42015=>'L', -42016=>'L', -42017=>'L', -42018=>'L', -42019=>'L', -42020=>'L', -42021=>'L', -42022=>'L', -42023=>'L', -42024=>'L', -42025=>'L', -42026=>'L', -42027=>'L', -42028=>'L', -42029=>'L', -42030=>'L', -42031=>'L', -42032=>'L', -42033=>'L', -42034=>'L', -42035=>'L', -42036=>'L', -42037=>'L', -42038=>'L', -42039=>'L', -42040=>'L', -42041=>'L', -42042=>'L', -42043=>'L', -42044=>'L', -42045=>'L', -42046=>'L', -42047=>'L', -42048=>'L', -42049=>'L', -42050=>'L', -42051=>'L', -42052=>'L', -42053=>'L', -42054=>'L', -42055=>'L', -42056=>'L', -42057=>'L', -42058=>'L', -42059=>'L', -42060=>'L', -42061=>'L', -42062=>'L', -42063=>'L', -42064=>'L', -42065=>'L', -42066=>'L', -42067=>'L', -42068=>'L', -42069=>'L', -42070=>'L', -42071=>'L', -42072=>'L', -42073=>'L', -42074=>'L', -42075=>'L', -42076=>'L', -42077=>'L', -42078=>'L', -42079=>'L', -42080=>'L', -42081=>'L', -42082=>'L', -42083=>'L', -42084=>'L', -42085=>'L', -42086=>'L', -42087=>'L', -42088=>'L', -42089=>'L', -42090=>'L', -42091=>'L', -42092=>'L', -42093=>'L', -42094=>'L', -42095=>'L', -42096=>'L', -42097=>'L', -42098=>'L', -42099=>'L', -42100=>'L', -42101=>'L', -42102=>'L', -42103=>'L', -42104=>'L', -42105=>'L', -42106=>'L', -42107=>'L', -42108=>'L', -42109=>'L', -42110=>'L', -42111=>'L', -42112=>'L', -42113=>'L', -42114=>'L', -42115=>'L', -42116=>'L', -42117=>'L', -42118=>'L', -42119=>'L', -42120=>'L', -42121=>'L', -42122=>'L', -42123=>'L', -42124=>'L', -42128=>'ON', -42129=>'ON', -42130=>'ON', -42131=>'ON', -42132=>'ON', -42133=>'ON', -42134=>'ON', -42135=>'ON', -42136=>'ON', -42137=>'ON', -42138=>'ON', -42139=>'ON', -42140=>'ON', -42141=>'ON', -42142=>'ON', -42143=>'ON', -42144=>'ON', -42145=>'ON', -42146=>'ON', -42147=>'ON', -42148=>'ON', -42149=>'ON', -42150=>'ON', -42151=>'ON', -42152=>'ON', -42153=>'ON', -42154=>'ON', -42155=>'ON', -42156=>'ON', -42157=>'ON', -42158=>'ON', -42159=>'ON', -42160=>'ON', -42161=>'ON', -42162=>'ON', -42163=>'ON', -42164=>'ON', -42165=>'ON', -42166=>'ON', -42167=>'ON', -42168=>'ON', -42169=>'ON', -42170=>'ON', -42171=>'ON', -42172=>'ON', -42173=>'ON', -42174=>'ON', -42175=>'ON', -42176=>'ON', -42177=>'ON', -42178=>'ON', -42179=>'ON', -42180=>'ON', -42181=>'ON', -42182=>'ON', -42752=>'ON', -42753=>'ON', -42754=>'ON', -42755=>'ON', -42756=>'ON', -42757=>'ON', -42758=>'ON', -42759=>'ON', -42760=>'ON', -42761=>'ON', -42762=>'ON', -42763=>'ON', -42764=>'ON', -42765=>'ON', -42766=>'ON', -42767=>'ON', -42768=>'ON', -42769=>'ON', -42770=>'ON', -42771=>'ON', -42772=>'ON', -42773=>'ON', -42774=>'ON', -42775=>'ON', -42776=>'ON', -42777=>'ON', -42778=>'ON', -42784=>'ON', -42785=>'ON', -43008=>'L', -43009=>'L', -43010=>'NSM', -43011=>'L', -43012=>'L', -43013=>'L', -43014=>'NSM', -43015=>'L', -43016=>'L', -43017=>'L', -43018=>'L', -43019=>'NSM', -43020=>'L', -43021=>'L', -43022=>'L', -43023=>'L', -43024=>'L', -43025=>'L', -43026=>'L', -43027=>'L', -43028=>'L', -43029=>'L', -43030=>'L', -43031=>'L', -43032=>'L', -43033=>'L', -43034=>'L', -43035=>'L', -43036=>'L', -43037=>'L', -43038=>'L', -43039=>'L', -43040=>'L', -43041=>'L', -43042=>'L', -43043=>'L', -43044=>'L', -43045=>'NSM', -43046=>'NSM', -43047=>'L', -43048=>'ON', -43049=>'ON', -43050=>'ON', -43051=>'ON', -43072=>'L', -43073=>'L', -43074=>'L', -43075=>'L', -43076=>'L', -43077=>'L', -43078=>'L', -43079=>'L', -43080=>'L', -43081=>'L', -43082=>'L', -43083=>'L', -43084=>'L', -43085=>'L', -43086=>'L', -43087=>'L', -43088=>'L', -43089=>'L', -43090=>'L', -43091=>'L', -43092=>'L', -43093=>'L', -43094=>'L', -43095=>'L', -43096=>'L', -43097=>'L', -43098=>'L', -43099=>'L', -43100=>'L', -43101=>'L', -43102=>'L', -43103=>'L', -43104=>'L', -43105=>'L', -43106=>'L', -43107=>'L', -43108=>'L', -43109=>'L', -43110=>'L', -43111=>'L', -43112=>'L', -43113=>'L', -43114=>'L', -43115=>'L', -43116=>'L', -43117=>'L', -43118=>'L', -43119=>'L', -43120=>'L', -43121=>'L', -43122=>'L', -43123=>'L', -43124=>'ON', -43125=>'ON', -43126=>'ON', -43127=>'ON', -44032=>'L', -55203=>'L', -55296=>'L', -56191=>'L', -56192=>'L', -56319=>'L', -56320=>'L', -57343=>'L', -57344=>'L', -63743=>'L', -63744=>'L', -63745=>'L', -63746=>'L', -63747=>'L', -63748=>'L', -63749=>'L', -63750=>'L', -63751=>'L', -63752=>'L', -63753=>'L', -63754=>'L', -63755=>'L', -63756=>'L', -63757=>'L', -63758=>'L', -63759=>'L', -63760=>'L', -63761=>'L', -63762=>'L', -63763=>'L', -63764=>'L', -63765=>'L', -63766=>'L', -63767=>'L', -63768=>'L', -63769=>'L', -63770=>'L', -63771=>'L', -63772=>'L', -63773=>'L', -63774=>'L', -63775=>'L', -63776=>'L', -63777=>'L', -63778=>'L', -63779=>'L', -63780=>'L', -63781=>'L', -63782=>'L', -63783=>'L', -63784=>'L', -63785=>'L', -63786=>'L', -63787=>'L', -63788=>'L', -63789=>'L', -63790=>'L', -63791=>'L', -63792=>'L', -63793=>'L', -63794=>'L', -63795=>'L', -63796=>'L', -63797=>'L', -63798=>'L', -63799=>'L', -63800=>'L', -63801=>'L', -63802=>'L', -63803=>'L', -63804=>'L', -63805=>'L', -63806=>'L', -63807=>'L', -63808=>'L', -63809=>'L', -63810=>'L', -63811=>'L', -63812=>'L', -63813=>'L', -63814=>'L', -63815=>'L', -63816=>'L', -63817=>'L', -63818=>'L', -63819=>'L', -63820=>'L', -63821=>'L', -63822=>'L', -63823=>'L', -63824=>'L', -63825=>'L', -63826=>'L', -63827=>'L', -63828=>'L', -63829=>'L', -63830=>'L', -63831=>'L', -63832=>'L', -63833=>'L', -63834=>'L', -63835=>'L', -63836=>'L', -63837=>'L', -63838=>'L', -63839=>'L', -63840=>'L', -63841=>'L', -63842=>'L', -63843=>'L', -63844=>'L', -63845=>'L', -63846=>'L', -63847=>'L', -63848=>'L', -63849=>'L', -63850=>'L', -63851=>'L', -63852=>'L', -63853=>'L', -63854=>'L', -63855=>'L', -63856=>'L', -63857=>'L', -63858=>'L', -63859=>'L', -63860=>'L', -63861=>'L', -63862=>'L', -63863=>'L', -63864=>'L', -63865=>'L', -63866=>'L', -63867=>'L', -63868=>'L', -63869=>'L', -63870=>'L', -63871=>'L', -63872=>'L', -63873=>'L', -63874=>'L', -63875=>'L', -63876=>'L', -63877=>'L', -63878=>'L', -63879=>'L', -63880=>'L', -63881=>'L', -63882=>'L', -63883=>'L', -63884=>'L', -63885=>'L', -63886=>'L', -63887=>'L', -63888=>'L', -63889=>'L', -63890=>'L', -63891=>'L', -63892=>'L', -63893=>'L', -63894=>'L', -63895=>'L', -63896=>'L', -63897=>'L', -63898=>'L', -63899=>'L', -63900=>'L', -63901=>'L', -63902=>'L', -63903=>'L', -63904=>'L', -63905=>'L', -63906=>'L', -63907=>'L', -63908=>'L', -63909=>'L', -63910=>'L', -63911=>'L', -63912=>'L', -63913=>'L', -63914=>'L', -63915=>'L', -63916=>'L', -63917=>'L', -63918=>'L', -63919=>'L', -63920=>'L', -63921=>'L', -63922=>'L', -63923=>'L', -63924=>'L', -63925=>'L', -63926=>'L', -63927=>'L', -63928=>'L', -63929=>'L', -63930=>'L', -63931=>'L', -63932=>'L', -63933=>'L', -63934=>'L', -63935=>'L', -63936=>'L', -63937=>'L', -63938=>'L', -63939=>'L', -63940=>'L', -63941=>'L', -63942=>'L', -63943=>'L', -63944=>'L', -63945=>'L', -63946=>'L', -63947=>'L', -63948=>'L', -63949=>'L', -63950=>'L', -63951=>'L', -63952=>'L', -63953=>'L', -63954=>'L', -63955=>'L', -63956=>'L', -63957=>'L', -63958=>'L', -63959=>'L', -63960=>'L', -63961=>'L', -63962=>'L', -63963=>'L', -63964=>'L', -63965=>'L', -63966=>'L', -63967=>'L', -63968=>'L', -63969=>'L', -63970=>'L', -63971=>'L', -63972=>'L', -63973=>'L', -63974=>'L', -63975=>'L', -63976=>'L', -63977=>'L', -63978=>'L', -63979=>'L', -63980=>'L', -63981=>'L', -63982=>'L', -63983=>'L', -63984=>'L', -63985=>'L', -63986=>'L', -63987=>'L', -63988=>'L', -63989=>'L', -63990=>'L', -63991=>'L', -63992=>'L', -63993=>'L', -63994=>'L', -63995=>'L', -63996=>'L', -63997=>'L', -63998=>'L', -63999=>'L', -64000=>'L', -64001=>'L', -64002=>'L', -64003=>'L', -64004=>'L', -64005=>'L', -64006=>'L', -64007=>'L', -64008=>'L', -64009=>'L', -64010=>'L', -64011=>'L', -64012=>'L', -64013=>'L', -64014=>'L', -64015=>'L', -64016=>'L', -64017=>'L', -64018=>'L', -64019=>'L', -64020=>'L', -64021=>'L', -64022=>'L', -64023=>'L', -64024=>'L', -64025=>'L', -64026=>'L', -64027=>'L', -64028=>'L', -64029=>'L', -64030=>'L', -64031=>'L', -64032=>'L', -64033=>'L', -64034=>'L', -64035=>'L', -64036=>'L', -64037=>'L', -64038=>'L', -64039=>'L', -64040=>'L', -64041=>'L', -64042=>'L', -64043=>'L', -64044=>'L', -64045=>'L', -64048=>'L', -64049=>'L', -64050=>'L', -64051=>'L', -64052=>'L', -64053=>'L', -64054=>'L', -64055=>'L', -64056=>'L', -64057=>'L', -64058=>'L', -64059=>'L', -64060=>'L', -64061=>'L', -64062=>'L', -64063=>'L', -64064=>'L', -64065=>'L', -64066=>'L', -64067=>'L', -64068=>'L', -64069=>'L', -64070=>'L', -64071=>'L', -64072=>'L', -64073=>'L', -64074=>'L', -64075=>'L', -64076=>'L', -64077=>'L', -64078=>'L', -64079=>'L', -64080=>'L', -64081=>'L', -64082=>'L', -64083=>'L', -64084=>'L', -64085=>'L', -64086=>'L', -64087=>'L', -64088=>'L', -64089=>'L', -64090=>'L', -64091=>'L', -64092=>'L', -64093=>'L', -64094=>'L', -64095=>'L', -64096=>'L', -64097=>'L', -64098=>'L', -64099=>'L', -64100=>'L', -64101=>'L', -64102=>'L', -64103=>'L', -64104=>'L', -64105=>'L', -64106=>'L', -64112=>'L', -64113=>'L', -64114=>'L', -64115=>'L', -64116=>'L', -64117=>'L', -64118=>'L', -64119=>'L', -64120=>'L', -64121=>'L', -64122=>'L', -64123=>'L', -64124=>'L', -64125=>'L', -64126=>'L', -64127=>'L', -64128=>'L', -64129=>'L', -64130=>'L', -64131=>'L', -64132=>'L', -64133=>'L', -64134=>'L', -64135=>'L', -64136=>'L', -64137=>'L', -64138=>'L', -64139=>'L', -64140=>'L', -64141=>'L', -64142=>'L', -64143=>'L', -64144=>'L', -64145=>'L', -64146=>'L', -64147=>'L', -64148=>'L', -64149=>'L', -64150=>'L', -64151=>'L', -64152=>'L', -64153=>'L', -64154=>'L', -64155=>'L', -64156=>'L', -64157=>'L', -64158=>'L', -64159=>'L', -64160=>'L', -64161=>'L', -64162=>'L', -64163=>'L', -64164=>'L', -64165=>'L', -64166=>'L', -64167=>'L', -64168=>'L', -64169=>'L', -64170=>'L', -64171=>'L', -64172=>'L', -64173=>'L', -64174=>'L', -64175=>'L', -64176=>'L', -64177=>'L', -64178=>'L', -64179=>'L', -64180=>'L', -64181=>'L', -64182=>'L', -64183=>'L', -64184=>'L', -64185=>'L', -64186=>'L', -64187=>'L', -64188=>'L', -64189=>'L', -64190=>'L', -64191=>'L', -64192=>'L', -64193=>'L', -64194=>'L', -64195=>'L', -64196=>'L', -64197=>'L', -64198=>'L', -64199=>'L', -64200=>'L', -64201=>'L', -64202=>'L', -64203=>'L', -64204=>'L', -64205=>'L', -64206=>'L', -64207=>'L', -64208=>'L', -64209=>'L', -64210=>'L', -64211=>'L', -64212=>'L', -64213=>'L', -64214=>'L', -64215=>'L', -64216=>'L', -64217=>'L', -64256=>'L', -64257=>'L', -64258=>'L', -64259=>'L', -64260=>'L', -64261=>'L', -64262=>'L', -64275=>'L', -64276=>'L', -64277=>'L', -64278=>'L', -64279=>'L', -64285=>'R', -64286=>'NSM', -64287=>'R', -64288=>'R', -64289=>'R', -64290=>'R', -64291=>'R', -64292=>'R', -64293=>'R', -64294=>'R', -64295=>'R', -64296=>'R', -64297=>'ES', -64298=>'R', -64299=>'R', -64300=>'R', -64301=>'R', -64302=>'R', -64303=>'R', -64304=>'R', -64305=>'R', -64306=>'R', -64307=>'R', -64308=>'R', -64309=>'R', -64310=>'R', -64312=>'R', -64313=>'R', -64314=>'R', -64315=>'R', -64316=>'R', -64318=>'R', -64320=>'R', -64321=>'R', -64323=>'R', -64324=>'R', -64326=>'R', -64327=>'R', -64328=>'R', -64329=>'R', -64330=>'R', -64331=>'R', -64332=>'R', -64333=>'R', -64334=>'R', -64335=>'R', -64336=>'AL', -64337=>'AL', -64338=>'AL', -64339=>'AL', -64340=>'AL', -64341=>'AL', -64342=>'AL', -64343=>'AL', -64344=>'AL', -64345=>'AL', -64346=>'AL', -64347=>'AL', -64348=>'AL', -64349=>'AL', -64350=>'AL', -64351=>'AL', -64352=>'AL', -64353=>'AL', -64354=>'AL', -64355=>'AL', -64356=>'AL', -64357=>'AL', -64358=>'AL', -64359=>'AL', -64360=>'AL', -64361=>'AL', -64362=>'AL', -64363=>'AL', -64364=>'AL', -64365=>'AL', -64366=>'AL', -64367=>'AL', -64368=>'AL', -64369=>'AL', -64370=>'AL', -64371=>'AL', -64372=>'AL', -64373=>'AL', -64374=>'AL', -64375=>'AL', -64376=>'AL', -64377=>'AL', -64378=>'AL', -64379=>'AL', -64380=>'AL', -64381=>'AL', -64382=>'AL', -64383=>'AL', -64384=>'AL', -64385=>'AL', -64386=>'AL', -64387=>'AL', -64388=>'AL', -64389=>'AL', -64390=>'AL', -64391=>'AL', -64392=>'AL', -64393=>'AL', -64394=>'AL', -64395=>'AL', -64396=>'AL', -64397=>'AL', -64398=>'AL', -64399=>'AL', -64400=>'AL', -64401=>'AL', -64402=>'AL', -64403=>'AL', -64404=>'AL', -64405=>'AL', -64406=>'AL', -64407=>'AL', -64408=>'AL', -64409=>'AL', -64410=>'AL', -64411=>'AL', -64412=>'AL', -64413=>'AL', -64414=>'AL', -64415=>'AL', -64416=>'AL', -64417=>'AL', -64418=>'AL', -64419=>'AL', -64420=>'AL', -64421=>'AL', -64422=>'AL', -64423=>'AL', -64424=>'AL', -64425=>'AL', -64426=>'AL', -64427=>'AL', -64428=>'AL', -64429=>'AL', -64430=>'AL', -64431=>'AL', -64432=>'AL', -64433=>'AL', -64467=>'AL', -64468=>'AL', -64469=>'AL', -64470=>'AL', -64471=>'AL', -64472=>'AL', -64473=>'AL', -64474=>'AL', -64475=>'AL', -64476=>'AL', -64477=>'AL', -64478=>'AL', -64479=>'AL', -64480=>'AL', -64481=>'AL', -64482=>'AL', -64483=>'AL', -64484=>'AL', -64485=>'AL', -64486=>'AL', -64487=>'AL', -64488=>'AL', -64489=>'AL', -64490=>'AL', -64491=>'AL', -64492=>'AL', -64493=>'AL', -64494=>'AL', -64495=>'AL', -64496=>'AL', -64497=>'AL', -64498=>'AL', -64499=>'AL', -64500=>'AL', -64501=>'AL', -64502=>'AL', -64503=>'AL', -64504=>'AL', -64505=>'AL', -64506=>'AL', -64507=>'AL', -64508=>'AL', -64509=>'AL', -64510=>'AL', -64511=>'AL', -64512=>'AL', -64513=>'AL', -64514=>'AL', -64515=>'AL', -64516=>'AL', -64517=>'AL', -64518=>'AL', -64519=>'AL', -64520=>'AL', -64521=>'AL', -64522=>'AL', -64523=>'AL', -64524=>'AL', -64525=>'AL', -64526=>'AL', -64527=>'AL', -64528=>'AL', -64529=>'AL', -64530=>'AL', -64531=>'AL', -64532=>'AL', -64533=>'AL', -64534=>'AL', -64535=>'AL', -64536=>'AL', -64537=>'AL', -64538=>'AL', -64539=>'AL', -64540=>'AL', -64541=>'AL', -64542=>'AL', -64543=>'AL', -64544=>'AL', -64545=>'AL', -64546=>'AL', -64547=>'AL', -64548=>'AL', -64549=>'AL', -64550=>'AL', -64551=>'AL', -64552=>'AL', -64553=>'AL', -64554=>'AL', -64555=>'AL', -64556=>'AL', -64557=>'AL', -64558=>'AL', -64559=>'AL', -64560=>'AL', -64561=>'AL', -64562=>'AL', -64563=>'AL', -64564=>'AL', -64565=>'AL', -64566=>'AL', -64567=>'AL', -64568=>'AL', -64569=>'AL', -64570=>'AL', -64571=>'AL', -64572=>'AL', -64573=>'AL', -64574=>'AL', -64575=>'AL', -64576=>'AL', -64577=>'AL', -64578=>'AL', -64579=>'AL', -64580=>'AL', -64581=>'AL', -64582=>'AL', -64583=>'AL', -64584=>'AL', -64585=>'AL', -64586=>'AL', -64587=>'AL', -64588=>'AL', -64589=>'AL', -64590=>'AL', -64591=>'AL', -64592=>'AL', -64593=>'AL', -64594=>'AL', -64595=>'AL', -64596=>'AL', -64597=>'AL', -64598=>'AL', -64599=>'AL', -64600=>'AL', -64601=>'AL', -64602=>'AL', -64603=>'AL', -64604=>'AL', -64605=>'AL', -64606=>'AL', -64607=>'AL', -64608=>'AL', -64609=>'AL', -64610=>'AL', -64611=>'AL', -64612=>'AL', -64613=>'AL', -64614=>'AL', -64615=>'AL', -64616=>'AL', -64617=>'AL', -64618=>'AL', -64619=>'AL', -64620=>'AL', -64621=>'AL', -64622=>'AL', -64623=>'AL', -64624=>'AL', -64625=>'AL', -64626=>'AL', -64627=>'AL', -64628=>'AL', -64629=>'AL', -64630=>'AL', -64631=>'AL', -64632=>'AL', -64633=>'AL', -64634=>'AL', -64635=>'AL', -64636=>'AL', -64637=>'AL', -64638=>'AL', -64639=>'AL', -64640=>'AL', -64641=>'AL', -64642=>'AL', -64643=>'AL', -64644=>'AL', -64645=>'AL', -64646=>'AL', -64647=>'AL', -64648=>'AL', -64649=>'AL', -64650=>'AL', -64651=>'AL', -64652=>'AL', -64653=>'AL', -64654=>'AL', -64655=>'AL', -64656=>'AL', -64657=>'AL', -64658=>'AL', -64659=>'AL', -64660=>'AL', -64661=>'AL', -64662=>'AL', -64663=>'AL', -64664=>'AL', -64665=>'AL', -64666=>'AL', -64667=>'AL', -64668=>'AL', -64669=>'AL', -64670=>'AL', -64671=>'AL', -64672=>'AL', -64673=>'AL', -64674=>'AL', -64675=>'AL', -64676=>'AL', -64677=>'AL', -64678=>'AL', -64679=>'AL', -64680=>'AL', -64681=>'AL', -64682=>'AL', -64683=>'AL', -64684=>'AL', -64685=>'AL', -64686=>'AL', -64687=>'AL', -64688=>'AL', -64689=>'AL', -64690=>'AL', -64691=>'AL', -64692=>'AL', -64693=>'AL', -64694=>'AL', -64695=>'AL', -64696=>'AL', -64697=>'AL', -64698=>'AL', -64699=>'AL', -64700=>'AL', -64701=>'AL', -64702=>'AL', -64703=>'AL', -64704=>'AL', -64705=>'AL', -64706=>'AL', -64707=>'AL', -64708=>'AL', -64709=>'AL', -64710=>'AL', -64711=>'AL', -64712=>'AL', -64713=>'AL', -64714=>'AL', -64715=>'AL', -64716=>'AL', -64717=>'AL', -64718=>'AL', -64719=>'AL', -64720=>'AL', -64721=>'AL', -64722=>'AL', -64723=>'AL', -64724=>'AL', -64725=>'AL', -64726=>'AL', -64727=>'AL', -64728=>'AL', -64729=>'AL', -64730=>'AL', -64731=>'AL', -64732=>'AL', -64733=>'AL', -64734=>'AL', -64735=>'AL', -64736=>'AL', -64737=>'AL', -64738=>'AL', -64739=>'AL', -64740=>'AL', -64741=>'AL', -64742=>'AL', -64743=>'AL', -64744=>'AL', -64745=>'AL', -64746=>'AL', -64747=>'AL', -64748=>'AL', -64749=>'AL', -64750=>'AL', -64751=>'AL', -64752=>'AL', -64753=>'AL', -64754=>'AL', -64755=>'AL', -64756=>'AL', -64757=>'AL', -64758=>'AL', -64759=>'AL', -64760=>'AL', -64761=>'AL', -64762=>'AL', -64763=>'AL', -64764=>'AL', -64765=>'AL', -64766=>'AL', -64767=>'AL', -64768=>'AL', -64769=>'AL', -64770=>'AL', -64771=>'AL', -64772=>'AL', -64773=>'AL', -64774=>'AL', -64775=>'AL', -64776=>'AL', -64777=>'AL', -64778=>'AL', -64779=>'AL', -64780=>'AL', -64781=>'AL', -64782=>'AL', -64783=>'AL', -64784=>'AL', -64785=>'AL', -64786=>'AL', -64787=>'AL', -64788=>'AL', -64789=>'AL', -64790=>'AL', -64791=>'AL', -64792=>'AL', -64793=>'AL', -64794=>'AL', -64795=>'AL', -64796=>'AL', -64797=>'AL', -64798=>'AL', -64799=>'AL', -64800=>'AL', -64801=>'AL', -64802=>'AL', -64803=>'AL', -64804=>'AL', -64805=>'AL', -64806=>'AL', -64807=>'AL', -64808=>'AL', -64809=>'AL', -64810=>'AL', -64811=>'AL', -64812=>'AL', -64813=>'AL', -64814=>'AL', -64815=>'AL', -64816=>'AL', -64817=>'AL', -64818=>'AL', -64819=>'AL', -64820=>'AL', -64821=>'AL', -64822=>'AL', -64823=>'AL', -64824=>'AL', -64825=>'AL', -64826=>'AL', -64827=>'AL', -64828=>'AL', -64829=>'AL', -64830=>'ON', -64831=>'ON', -64848=>'AL', -64849=>'AL', -64850=>'AL', -64851=>'AL', -64852=>'AL', -64853=>'AL', -64854=>'AL', -64855=>'AL', -64856=>'AL', -64857=>'AL', -64858=>'AL', -64859=>'AL', -64860=>'AL', -64861=>'AL', -64862=>'AL', -64863=>'AL', -64864=>'AL', -64865=>'AL', -64866=>'AL', -64867=>'AL', -64868=>'AL', -64869=>'AL', -64870=>'AL', -64871=>'AL', -64872=>'AL', -64873=>'AL', -64874=>'AL', -64875=>'AL', -64876=>'AL', -64877=>'AL', -64878=>'AL', -64879=>'AL', -64880=>'AL', -64881=>'AL', -64882=>'AL', -64883=>'AL', -64884=>'AL', -64885=>'AL', -64886=>'AL', -64887=>'AL', -64888=>'AL', -64889=>'AL', -64890=>'AL', -64891=>'AL', -64892=>'AL', -64893=>'AL', -64894=>'AL', -64895=>'AL', -64896=>'AL', -64897=>'AL', -64898=>'AL', -64899=>'AL', -64900=>'AL', -64901=>'AL', -64902=>'AL', -64903=>'AL', -64904=>'AL', -64905=>'AL', -64906=>'AL', -64907=>'AL', -64908=>'AL', -64909=>'AL', -64910=>'AL', -64911=>'AL', -64914=>'AL', -64915=>'AL', -64916=>'AL', -64917=>'AL', -64918=>'AL', -64919=>'AL', -64920=>'AL', -64921=>'AL', -64922=>'AL', -64923=>'AL', -64924=>'AL', -64925=>'AL', -64926=>'AL', -64927=>'AL', -64928=>'AL', -64929=>'AL', -64930=>'AL', -64931=>'AL', -64932=>'AL', -64933=>'AL', -64934=>'AL', -64935=>'AL', -64936=>'AL', -64937=>'AL', -64938=>'AL', -64939=>'AL', -64940=>'AL', -64941=>'AL', -64942=>'AL', -64943=>'AL', -64944=>'AL', -64945=>'AL', -64946=>'AL', -64947=>'AL', -64948=>'AL', -64949=>'AL', -64950=>'AL', -64951=>'AL', -64952=>'AL', -64953=>'AL', -64954=>'AL', -64955=>'AL', -64956=>'AL', -64957=>'AL', -64958=>'AL', -64959=>'AL', -64960=>'AL', -64961=>'AL', -64962=>'AL', -64963=>'AL', -64964=>'AL', -64965=>'AL', -64966=>'AL', -64967=>'AL', -65008=>'AL', -65009=>'AL', -65010=>'AL', -65011=>'AL', -65012=>'AL', -65013=>'AL', -65014=>'AL', -65015=>'AL', -65016=>'AL', -65017=>'AL', -65018=>'AL', -65019=>'AL', -65020=>'AL', -65021=>'ON', -65024=>'NSM', -65025=>'NSM', -65026=>'NSM', -65027=>'NSM', -65028=>'NSM', -65029=>'NSM', -65030=>'NSM', -65031=>'NSM', -65032=>'NSM', -65033=>'NSM', -65034=>'NSM', -65035=>'NSM', -65036=>'NSM', -65037=>'NSM', -65038=>'NSM', -65039=>'NSM', -65040=>'ON', -65041=>'ON', -65042=>'ON', -65043=>'ON', -65044=>'ON', -65045=>'ON', -65046=>'ON', -65047=>'ON', -65048=>'ON', -65049=>'ON', -65056=>'NSM', -65057=>'NSM', -65058=>'NSM', -65059=>'NSM', -65072=>'ON', -65073=>'ON', -65074=>'ON', -65075=>'ON', -65076=>'ON', -65077=>'ON', -65078=>'ON', -65079=>'ON', -65080=>'ON', -65081=>'ON', -65082=>'ON', -65083=>'ON', -65084=>'ON', -65085=>'ON', -65086=>'ON', -65087=>'ON', -65088=>'ON', -65089=>'ON', -65090=>'ON', -65091=>'ON', -65092=>'ON', -65093=>'ON', -65094=>'ON', -65095=>'ON', -65096=>'ON', -65097=>'ON', -65098=>'ON', -65099=>'ON', -65100=>'ON', -65101=>'ON', -65102=>'ON', -65103=>'ON', -65104=>'CS', -65105=>'ON', -65106=>'CS', -65108=>'ON', -65109=>'CS', -65110=>'ON', -65111=>'ON', -65112=>'ON', -65113=>'ON', -65114=>'ON', -65115=>'ON', -65116=>'ON', -65117=>'ON', -65118=>'ON', -65119=>'ET', -65120=>'ON', -65121=>'ON', -65122=>'ES', -65123=>'ES', -65124=>'ON', -65125=>'ON', -65126=>'ON', -65128=>'ON', -65129=>'ET', -65130=>'ET', -65131=>'ON', -65136=>'AL', -65137=>'AL', -65138=>'AL', -65139=>'AL', -65140=>'AL', -65142=>'AL', -65143=>'AL', -65144=>'AL', -65145=>'AL', -65146=>'AL', -65147=>'AL', -65148=>'AL', -65149=>'AL', -65150=>'AL', -65151=>'AL', -65152=>'AL', -65153=>'AL', -65154=>'AL', -65155=>'AL', -65156=>'AL', -65157=>'AL', -65158=>'AL', -65159=>'AL', -65160=>'AL', -65161=>'AL', -65162=>'AL', -65163=>'AL', -65164=>'AL', -65165=>'AL', -65166=>'AL', -65167=>'AL', -65168=>'AL', -65169=>'AL', -65170=>'AL', -65171=>'AL', -65172=>'AL', -65173=>'AL', -65174=>'AL', -65175=>'AL', -65176=>'AL', -65177=>'AL', -65178=>'AL', -65179=>'AL', -65180=>'AL', -65181=>'AL', -65182=>'AL', -65183=>'AL', -65184=>'AL', -65185=>'AL', -65186=>'AL', -65187=>'AL', -65188=>'AL', -65189=>'AL', -65190=>'AL', -65191=>'AL', -65192=>'AL', -65193=>'AL', -65194=>'AL', -65195=>'AL', -65196=>'AL', -65197=>'AL', -65198=>'AL', -65199=>'AL', -65200=>'AL', -65201=>'AL', -65202=>'AL', -65203=>'AL', -65204=>'AL', -65205=>'AL', -65206=>'AL', -65207=>'AL', -65208=>'AL', -65209=>'AL', -65210=>'AL', -65211=>'AL', -65212=>'AL', -65213=>'AL', -65214=>'AL', -65215=>'AL', -65216=>'AL', -65217=>'AL', -65218=>'AL', -65219=>'AL', -65220=>'AL', -65221=>'AL', -65222=>'AL', -65223=>'AL', -65224=>'AL', -65225=>'AL', -65226=>'AL', -65227=>'AL', -65228=>'AL', -65229=>'AL', -65230=>'AL', -65231=>'AL', -65232=>'AL', -65233=>'AL', -65234=>'AL', -65235=>'AL', -65236=>'AL', -65237=>'AL', -65238=>'AL', -65239=>'AL', -65240=>'AL', -65241=>'AL', -65242=>'AL', -65243=>'AL', -65244=>'AL', -65245=>'AL', -65246=>'AL', -65247=>'AL', -65248=>'AL', -65249=>'AL', -65250=>'AL', -65251=>'AL', -65252=>'AL', -65253=>'AL', -65254=>'AL', -65255=>'AL', -65256=>'AL', -65257=>'AL', -65258=>'AL', -65259=>'AL', -65260=>'AL', -65261=>'AL', -65262=>'AL', -65263=>'AL', -65264=>'AL', -65265=>'AL', -65266=>'AL', -65267=>'AL', -65268=>'AL', -65269=>'AL', -65270=>'AL', -65271=>'AL', -65272=>'AL', -65273=>'AL', -65274=>'AL', -65275=>'AL', -65276=>'AL', -65279=>'BN', -65281=>'ON', -65282=>'ON', -65283=>'ET', -65284=>'ET', -65285=>'ET', -65286=>'ON', -65287=>'ON', -65288=>'ON', -65289=>'ON', -65290=>'ON', -65291=>'ES', -65292=>'CS', -65293=>'ES', -65294=>'CS', -65295=>'CS', -65296=>'EN', -65297=>'EN', -65298=>'EN', -65299=>'EN', -65300=>'EN', -65301=>'EN', -65302=>'EN', -65303=>'EN', -65304=>'EN', -65305=>'EN', -65306=>'CS', -65307=>'ON', -65308=>'ON', -65309=>'ON', -65310=>'ON', -65311=>'ON', -65312=>'ON', -65313=>'L', -65314=>'L', -65315=>'L', -65316=>'L', -65317=>'L', -65318=>'L', -65319=>'L', -65320=>'L', -65321=>'L', -65322=>'L', -65323=>'L', -65324=>'L', -65325=>'L', -65326=>'L', -65327=>'L', -65328=>'L', -65329=>'L', -65330=>'L', -65331=>'L', -65332=>'L', -65333=>'L', -65334=>'L', -65335=>'L', -65336=>'L', -65337=>'L', -65338=>'L', -65339=>'ON', -65340=>'ON', -65341=>'ON', -65342=>'ON', -65343=>'ON', -65344=>'ON', -65345=>'L', -65346=>'L', -65347=>'L', -65348=>'L', -65349=>'L', -65350=>'L', -65351=>'L', -65352=>'L', -65353=>'L', -65354=>'L', -65355=>'L', -65356=>'L', -65357=>'L', -65358=>'L', -65359=>'L', -65360=>'L', -65361=>'L', -65362=>'L', -65363=>'L', -65364=>'L', -65365=>'L', -65366=>'L', -65367=>'L', -65368=>'L', -65369=>'L', -65370=>'L', -65371=>'ON', -65372=>'ON', -65373=>'ON', -65374=>'ON', -65375=>'ON', -65376=>'ON', -65377=>'ON', -65378=>'ON', -65379=>'ON', -65380=>'ON', -65381=>'ON', -65382=>'L', -65383=>'L', -65384=>'L', -65385=>'L', -65386=>'L', -65387=>'L', -65388=>'L', -65389=>'L', -65390=>'L', -65391=>'L', -65392=>'L', -65393=>'L', -65394=>'L', -65395=>'L', -65396=>'L', -65397=>'L', -65398=>'L', -65399=>'L', -65400=>'L', -65401=>'L', -65402=>'L', -65403=>'L', -65404=>'L', -65405=>'L', -65406=>'L', -65407=>'L', -65408=>'L', -65409=>'L', -65410=>'L', -65411=>'L', -65412=>'L', -65413=>'L', -65414=>'L', -65415=>'L', -65416=>'L', -65417=>'L', -65418=>'L', -65419=>'L', -65420=>'L', -65421=>'L', -65422=>'L', -65423=>'L', -65424=>'L', -65425=>'L', -65426=>'L', -65427=>'L', -65428=>'L', -65429=>'L', -65430=>'L', -65431=>'L', -65432=>'L', -65433=>'L', -65434=>'L', -65435=>'L', -65436=>'L', -65437=>'L', -65438=>'L', -65439=>'L', -65440=>'L', -65441=>'L', -65442=>'L', -65443=>'L', -65444=>'L', -65445=>'L', -65446=>'L', -65447=>'L', -65448=>'L', -65449=>'L', -65450=>'L', -65451=>'L', -65452=>'L', -65453=>'L', -65454=>'L', -65455=>'L', -65456=>'L', -65457=>'L', -65458=>'L', -65459=>'L', -65460=>'L', -65461=>'L', -65462=>'L', -65463=>'L', -65464=>'L', -65465=>'L', -65466=>'L', -65467=>'L', -65468=>'L', -65469=>'L', -65470=>'L', -65474=>'L', -65475=>'L', -65476=>'L', -65477=>'L', -65478=>'L', -65479=>'L', -65482=>'L', -65483=>'L', -65484=>'L', -65485=>'L', -65486=>'L', -65487=>'L', -65490=>'L', -65491=>'L', -65492=>'L', -65493=>'L', -65494=>'L', -65495=>'L', -65498=>'L', -65499=>'L', -65500=>'L', -65504=>'ET', -65505=>'ET', -65506=>'ON', -65507=>'ON', -65508=>'ON', -65509=>'ET', -65510=>'ET', -65512=>'ON', -65513=>'ON', -65514=>'ON', -65515=>'ON', -65516=>'ON', -65517=>'ON', -65518=>'ON', -65529=>'ON', -65530=>'ON', -65531=>'ON', -65532=>'ON', -65533=>'ON', -65536=>'L', -65537=>'L', -65538=>'L', -65539=>'L', -65540=>'L', -65541=>'L', -65542=>'L', -65543=>'L', -65544=>'L', -65545=>'L', -65546=>'L', -65547=>'L', -65549=>'L', -65550=>'L', -65551=>'L', -65552=>'L', -65553=>'L', -65554=>'L', -65555=>'L', -65556=>'L', -65557=>'L', -65558=>'L', -65559=>'L', -65560=>'L', -65561=>'L', -65562=>'L', -65563=>'L', -65564=>'L', -65565=>'L', -65566=>'L', -65567=>'L', -65568=>'L', -65569=>'L', -65570=>'L', -65571=>'L', -65572=>'L', -65573=>'L', -65574=>'L', -65576=>'L', -65577=>'L', -65578=>'L', -65579=>'L', -65580=>'L', -65581=>'L', -65582=>'L', -65583=>'L', -65584=>'L', -65585=>'L', -65586=>'L', -65587=>'L', -65588=>'L', -65589=>'L', -65590=>'L', -65591=>'L', -65592=>'L', -65593=>'L', -65594=>'L', -65596=>'L', -65597=>'L', -65599=>'L', -65600=>'L', -65601=>'L', -65602=>'L', -65603=>'L', -65604=>'L', -65605=>'L', -65606=>'L', -65607=>'L', -65608=>'L', -65609=>'L', -65610=>'L', -65611=>'L', -65612=>'L', -65613=>'L', -65616=>'L', -65617=>'L', -65618=>'L', -65619=>'L', -65620=>'L', -65621=>'L', -65622=>'L', -65623=>'L', -65624=>'L', -65625=>'L', -65626=>'L', -65627=>'L', -65628=>'L', -65629=>'L', -65664=>'L', -65665=>'L', -65666=>'L', -65667=>'L', -65668=>'L', -65669=>'L', -65670=>'L', -65671=>'L', -65672=>'L', -65673=>'L', -65674=>'L', -65675=>'L', -65676=>'L', -65677=>'L', -65678=>'L', -65679=>'L', -65680=>'L', -65681=>'L', -65682=>'L', -65683=>'L', -65684=>'L', -65685=>'L', -65686=>'L', -65687=>'L', -65688=>'L', -65689=>'L', -65690=>'L', -65691=>'L', -65692=>'L', -65693=>'L', -65694=>'L', -65695=>'L', -65696=>'L', -65697=>'L', -65698=>'L', -65699=>'L', -65700=>'L', -65701=>'L', -65702=>'L', -65703=>'L', -65704=>'L', -65705=>'L', -65706=>'L', -65707=>'L', -65708=>'L', -65709=>'L', -65710=>'L', -65711=>'L', -65712=>'L', -65713=>'L', -65714=>'L', -65715=>'L', -65716=>'L', -65717=>'L', -65718=>'L', -65719=>'L', -65720=>'L', -65721=>'L', -65722=>'L', -65723=>'L', -65724=>'L', -65725=>'L', -65726=>'L', -65727=>'L', -65728=>'L', -65729=>'L', -65730=>'L', -65731=>'L', -65732=>'L', -65733=>'L', -65734=>'L', -65735=>'L', -65736=>'L', -65737=>'L', -65738=>'L', -65739=>'L', -65740=>'L', -65741=>'L', -65742=>'L', -65743=>'L', -65744=>'L', -65745=>'L', -65746=>'L', -65747=>'L', -65748=>'L', -65749=>'L', -65750=>'L', -65751=>'L', -65752=>'L', -65753=>'L', -65754=>'L', -65755=>'L', -65756=>'L', -65757=>'L', -65758=>'L', -65759=>'L', -65760=>'L', -65761=>'L', -65762=>'L', -65763=>'L', -65764=>'L', -65765=>'L', -65766=>'L', -65767=>'L', -65768=>'L', -65769=>'L', -65770=>'L', -65771=>'L', -65772=>'L', -65773=>'L', -65774=>'L', -65775=>'L', -65776=>'L', -65777=>'L', -65778=>'L', -65779=>'L', -65780=>'L', -65781=>'L', -65782=>'L', -65783=>'L', -65784=>'L', -65785=>'L', -65786=>'L', -65792=>'L', -65793=>'ON', -65794=>'L', -65799=>'L', -65800=>'L', -65801=>'L', -65802=>'L', -65803=>'L', -65804=>'L', -65805=>'L', -65806=>'L', -65807=>'L', -65808=>'L', -65809=>'L', -65810=>'L', -65811=>'L', -65812=>'L', -65813=>'L', -65814=>'L', -65815=>'L', -65816=>'L', -65817=>'L', -65818=>'L', -65819=>'L', -65820=>'L', -65821=>'L', -65822=>'L', -65823=>'L', -65824=>'L', -65825=>'L', -65826=>'L', -65827=>'L', -65828=>'L', -65829=>'L', -65830=>'L', -65831=>'L', -65832=>'L', -65833=>'L', -65834=>'L', -65835=>'L', -65836=>'L', -65837=>'L', -65838=>'L', -65839=>'L', -65840=>'L', -65841=>'L', -65842=>'L', -65843=>'L', -65847=>'L', -65848=>'L', -65849=>'L', -65850=>'L', -65851=>'L', -65852=>'L', -65853=>'L', -65854=>'L', -65855=>'L', -65856=>'ON', -65857=>'ON', -65858=>'ON', -65859=>'ON', -65860=>'ON', -65861=>'ON', -65862=>'ON', -65863=>'ON', -65864=>'ON', -65865=>'ON', -65866=>'ON', -65867=>'ON', -65868=>'ON', -65869=>'ON', -65870=>'ON', -65871=>'ON', -65872=>'ON', -65873=>'ON', -65874=>'ON', -65875=>'ON', -65876=>'ON', -65877=>'ON', -65878=>'ON', -65879=>'ON', -65880=>'ON', -65881=>'ON', -65882=>'ON', -65883=>'ON', -65884=>'ON', -65885=>'ON', -65886=>'ON', -65887=>'ON', -65888=>'ON', -65889=>'ON', -65890=>'ON', -65891=>'ON', -65892=>'ON', -65893=>'ON', -65894=>'ON', -65895=>'ON', -65896=>'ON', -65897=>'ON', -65898=>'ON', -65899=>'ON', -65900=>'ON', -65901=>'ON', -65902=>'ON', -65903=>'ON', -65904=>'ON', -65905=>'ON', -65906=>'ON', -65907=>'ON', -65908=>'ON', -65909=>'ON', -65910=>'ON', -65911=>'ON', -65912=>'ON', -65913=>'ON', -65914=>'ON', -65915=>'ON', -65916=>'ON', -65917=>'ON', -65918=>'ON', -65919=>'ON', -65920=>'ON', -65921=>'ON', -65922=>'ON', -65923=>'ON', -65924=>'ON', -65925=>'ON', -65926=>'ON', -65927=>'ON', -65928=>'ON', -65929=>'ON', -65930=>'ON', -66304=>'L', -66305=>'L', -66306=>'L', -66307=>'L', -66308=>'L', -66309=>'L', -66310=>'L', -66311=>'L', -66312=>'L', -66313=>'L', -66314=>'L', -66315=>'L', -66316=>'L', -66317=>'L', -66318=>'L', -66319=>'L', -66320=>'L', -66321=>'L', -66322=>'L', -66323=>'L', -66324=>'L', -66325=>'L', -66326=>'L', -66327=>'L', -66328=>'L', -66329=>'L', -66330=>'L', -66331=>'L', -66332=>'L', -66333=>'L', -66334=>'L', -66336=>'L', -66337=>'L', -66338=>'L', -66339=>'L', -66352=>'L', -66353=>'L', -66354=>'L', -66355=>'L', -66356=>'L', -66357=>'L', -66358=>'L', -66359=>'L', -66360=>'L', -66361=>'L', -66362=>'L', -66363=>'L', -66364=>'L', -66365=>'L', -66366=>'L', -66367=>'L', -66368=>'L', -66369=>'L', -66370=>'L', -66371=>'L', -66372=>'L', -66373=>'L', -66374=>'L', -66375=>'L', -66376=>'L', -66377=>'L', -66378=>'L', -66432=>'L', -66433=>'L', -66434=>'L', -66435=>'L', -66436=>'L', -66437=>'L', -66438=>'L', -66439=>'L', -66440=>'L', -66441=>'L', -66442=>'L', -66443=>'L', -66444=>'L', -66445=>'L', -66446=>'L', -66447=>'L', -66448=>'L', -66449=>'L', -66450=>'L', -66451=>'L', -66452=>'L', -66453=>'L', -66454=>'L', -66455=>'L', -66456=>'L', -66457=>'L', -66458=>'L', -66459=>'L', -66460=>'L', -66461=>'L', -66463=>'L', -66464=>'L', -66465=>'L', -66466=>'L', -66467=>'L', -66468=>'L', -66469=>'L', -66470=>'L', -66471=>'L', -66472=>'L', -66473=>'L', -66474=>'L', -66475=>'L', -66476=>'L', -66477=>'L', -66478=>'L', -66479=>'L', -66480=>'L', -66481=>'L', -66482=>'L', -66483=>'L', -66484=>'L', -66485=>'L', -66486=>'L', -66487=>'L', -66488=>'L', -66489=>'L', -66490=>'L', -66491=>'L', -66492=>'L', -66493=>'L', -66494=>'L', -66495=>'L', -66496=>'L', -66497=>'L', -66498=>'L', -66499=>'L', -66504=>'L', -66505=>'L', -66506=>'L', -66507=>'L', -66508=>'L', -66509=>'L', -66510=>'L', -66511=>'L', -66512=>'L', -66513=>'L', -66514=>'L', -66515=>'L', -66516=>'L', -66517=>'L', -66560=>'L', -66561=>'L', -66562=>'L', -66563=>'L', -66564=>'L', -66565=>'L', -66566=>'L', -66567=>'L', -66568=>'L', -66569=>'L', -66570=>'L', -66571=>'L', -66572=>'L', -66573=>'L', -66574=>'L', -66575=>'L', -66576=>'L', -66577=>'L', -66578=>'L', -66579=>'L', -66580=>'L', -66581=>'L', -66582=>'L', -66583=>'L', -66584=>'L', -66585=>'L', -66586=>'L', -66587=>'L', -66588=>'L', -66589=>'L', -66590=>'L', -66591=>'L', -66592=>'L', -66593=>'L', -66594=>'L', -66595=>'L', -66596=>'L', -66597=>'L', -66598=>'L', -66599=>'L', -66600=>'L', -66601=>'L', -66602=>'L', -66603=>'L', -66604=>'L', -66605=>'L', -66606=>'L', -66607=>'L', -66608=>'L', -66609=>'L', -66610=>'L', -66611=>'L', -66612=>'L', -66613=>'L', -66614=>'L', -66615=>'L', -66616=>'L', -66617=>'L', -66618=>'L', -66619=>'L', -66620=>'L', -66621=>'L', -66622=>'L', -66623=>'L', -66624=>'L', -66625=>'L', -66626=>'L', -66627=>'L', -66628=>'L', -66629=>'L', -66630=>'L', -66631=>'L', -66632=>'L', -66633=>'L', -66634=>'L', -66635=>'L', -66636=>'L', -66637=>'L', -66638=>'L', -66639=>'L', -66640=>'L', -66641=>'L', -66642=>'L', -66643=>'L', -66644=>'L', -66645=>'L', -66646=>'L', -66647=>'L', -66648=>'L', -66649=>'L', -66650=>'L', -66651=>'L', -66652=>'L', -66653=>'L', -66654=>'L', -66655=>'L', -66656=>'L', -66657=>'L', -66658=>'L', -66659=>'L', -66660=>'L', -66661=>'L', -66662=>'L', -66663=>'L', -66664=>'L', -66665=>'L', -66666=>'L', -66667=>'L', -66668=>'L', -66669=>'L', -66670=>'L', -66671=>'L', -66672=>'L', -66673=>'L', -66674=>'L', -66675=>'L', -66676=>'L', -66677=>'L', -66678=>'L', -66679=>'L', -66680=>'L', -66681=>'L', -66682=>'L', -66683=>'L', -66684=>'L', -66685=>'L', -66686=>'L', -66687=>'L', -66688=>'L', -66689=>'L', -66690=>'L', -66691=>'L', -66692=>'L', -66693=>'L', -66694=>'L', -66695=>'L', -66696=>'L', -66697=>'L', -66698=>'L', -66699=>'L', -66700=>'L', -66701=>'L', -66702=>'L', -66703=>'L', -66704=>'L', -66705=>'L', -66706=>'L', -66707=>'L', -66708=>'L', -66709=>'L', -66710=>'L', -66711=>'L', -66712=>'L', -66713=>'L', -66714=>'L', -66715=>'L', -66716=>'L', -66717=>'L', -66720=>'L', -66721=>'L', -66722=>'L', -66723=>'L', -66724=>'L', -66725=>'L', -66726=>'L', -66727=>'L', -66728=>'L', -66729=>'L', -67584=>'R', -67585=>'R', -67586=>'R', -67587=>'R', -67588=>'R', -67589=>'R', -67592=>'R', -67594=>'R', -67595=>'R', -67596=>'R', -67597=>'R', -67598=>'R', -67599=>'R', -67600=>'R', -67601=>'R', -67602=>'R', -67603=>'R', -67604=>'R', -67605=>'R', -67606=>'R', -67607=>'R', -67608=>'R', -67609=>'R', -67610=>'R', -67611=>'R', -67612=>'R', -67613=>'R', -67614=>'R', -67615=>'R', -67616=>'R', -67617=>'R', -67618=>'R', -67619=>'R', -67620=>'R', -67621=>'R', -67622=>'R', -67623=>'R', -67624=>'R', -67625=>'R', -67626=>'R', -67627=>'R', -67628=>'R', -67629=>'R', -67630=>'R', -67631=>'R', -67632=>'R', -67633=>'R', -67634=>'R', -67635=>'R', -67636=>'R', -67637=>'R', -67639=>'R', -67640=>'R', -67644=>'R', -67647=>'R', -67840=>'R', -67841=>'R', -67842=>'R', -67843=>'R', -67844=>'R', -67845=>'R', -67846=>'R', -67847=>'R', -67848=>'R', -67849=>'R', -67850=>'R', -67851=>'R', -67852=>'R', -67853=>'R', -67854=>'R', -67855=>'R', -67856=>'R', -67857=>'R', -67858=>'R', -67859=>'R', -67860=>'R', -67861=>'R', -67862=>'R', -67863=>'R', -67864=>'R', -67865=>'R', -67871=>'ON', -68096=>'R', -68097=>'NSM', -68098=>'NSM', -68099=>'NSM', -68101=>'NSM', -68102=>'NSM', -68108=>'NSM', -68109=>'NSM', -68110=>'NSM', -68111=>'NSM', -68112=>'R', -68113=>'R', -68114=>'R', -68115=>'R', -68117=>'R', -68118=>'R', -68119=>'R', -68121=>'R', -68122=>'R', -68123=>'R', -68124=>'R', -68125=>'R', -68126=>'R', -68127=>'R', -68128=>'R', -68129=>'R', -68130=>'R', -68131=>'R', -68132=>'R', -68133=>'R', -68134=>'R', -68135=>'R', -68136=>'R', -68137=>'R', -68138=>'R', -68139=>'R', -68140=>'R', -68141=>'R', -68142=>'R', -68143=>'R', -68144=>'R', -68145=>'R', -68146=>'R', -68147=>'R', -68152=>'NSM', -68153=>'NSM', -68154=>'NSM', -68159=>'NSM', -68160=>'R', -68161=>'R', -68162=>'R', -68163=>'R', -68164=>'R', -68165=>'R', -68166=>'R', -68167=>'R', -68176=>'R', -68177=>'R', -68178=>'R', -68179=>'R', -68180=>'R', -68181=>'R', -68182=>'R', -68183=>'R', -68184=>'R', -73728=>'L', -73729=>'L', -73730=>'L', -73731=>'L', -73732=>'L', -73733=>'L', -73734=>'L', -73735=>'L', -73736=>'L', -73737=>'L', -73738=>'L', -73739=>'L', -73740=>'L', -73741=>'L', -73742=>'L', -73743=>'L', -73744=>'L', -73745=>'L', -73746=>'L', -73747=>'L', -73748=>'L', -73749=>'L', -73750=>'L', -73751=>'L', -73752=>'L', -73753=>'L', -73754=>'L', -73755=>'L', -73756=>'L', -73757=>'L', -73758=>'L', -73759=>'L', -73760=>'L', -73761=>'L', -73762=>'L', -73763=>'L', -73764=>'L', -73765=>'L', -73766=>'L', -73767=>'L', -73768=>'L', -73769=>'L', -73770=>'L', -73771=>'L', -73772=>'L', -73773=>'L', -73774=>'L', -73775=>'L', -73776=>'L', -73777=>'L', -73778=>'L', -73779=>'L', -73780=>'L', -73781=>'L', -73782=>'L', -73783=>'L', -73784=>'L', -73785=>'L', -73786=>'L', -73787=>'L', -73788=>'L', -73789=>'L', -73790=>'L', -73791=>'L', -73792=>'L', -73793=>'L', -73794=>'L', -73795=>'L', -73796=>'L', -73797=>'L', -73798=>'L', -73799=>'L', -73800=>'L', -73801=>'L', -73802=>'L', -73803=>'L', -73804=>'L', -73805=>'L', -73806=>'L', -73807=>'L', -73808=>'L', -73809=>'L', -73810=>'L', -73811=>'L', -73812=>'L', -73813=>'L', -73814=>'L', -73815=>'L', -73816=>'L', -73817=>'L', -73818=>'L', -73819=>'L', -73820=>'L', -73821=>'L', -73822=>'L', -73823=>'L', -73824=>'L', -73825=>'L', -73826=>'L', -73827=>'L', -73828=>'L', -73829=>'L', -73830=>'L', -73831=>'L', -73832=>'L', -73833=>'L', -73834=>'L', -73835=>'L', -73836=>'L', -73837=>'L', -73838=>'L', -73839=>'L', -73840=>'L', -73841=>'L', -73842=>'L', -73843=>'L', -73844=>'L', -73845=>'L', -73846=>'L', -73847=>'L', -73848=>'L', -73849=>'L', -73850=>'L', -73851=>'L', -73852=>'L', -73853=>'L', -73854=>'L', -73855=>'L', -73856=>'L', -73857=>'L', -73858=>'L', -73859=>'L', -73860=>'L', -73861=>'L', -73862=>'L', -73863=>'L', -73864=>'L', -73865=>'L', -73866=>'L', -73867=>'L', -73868=>'L', -73869=>'L', -73870=>'L', -73871=>'L', -73872=>'L', -73873=>'L', -73874=>'L', -73875=>'L', -73876=>'L', -73877=>'L', -73878=>'L', -73879=>'L', -73880=>'L', -73881=>'L', -73882=>'L', -73883=>'L', -73884=>'L', -73885=>'L', -73886=>'L', -73887=>'L', -73888=>'L', -73889=>'L', -73890=>'L', -73891=>'L', -73892=>'L', -73893=>'L', -73894=>'L', -73895=>'L', -73896=>'L', -73897=>'L', -73898=>'L', -73899=>'L', -73900=>'L', -73901=>'L', -73902=>'L', -73903=>'L', -73904=>'L', -73905=>'L', -73906=>'L', -73907=>'L', -73908=>'L', -73909=>'L', -73910=>'L', -73911=>'L', -73912=>'L', -73913=>'L', -73914=>'L', -73915=>'L', -73916=>'L', -73917=>'L', -73918=>'L', -73919=>'L', -73920=>'L', -73921=>'L', -73922=>'L', -73923=>'L', -73924=>'L', -73925=>'L', -73926=>'L', -73927=>'L', -73928=>'L', -73929=>'L', -73930=>'L', -73931=>'L', -73932=>'L', -73933=>'L', -73934=>'L', -73935=>'L', -73936=>'L', -73937=>'L', -73938=>'L', -73939=>'L', -73940=>'L', -73941=>'L', -73942=>'L', -73943=>'L', -73944=>'L', -73945=>'L', -73946=>'L', -73947=>'L', -73948=>'L', -73949=>'L', -73950=>'L', -73951=>'L', -73952=>'L', -73953=>'L', -73954=>'L', -73955=>'L', -73956=>'L', -73957=>'L', -73958=>'L', -73959=>'L', -73960=>'L', -73961=>'L', -73962=>'L', -73963=>'L', -73964=>'L', -73965=>'L', -73966=>'L', -73967=>'L', -73968=>'L', -73969=>'L', -73970=>'L', -73971=>'L', -73972=>'L', -73973=>'L', -73974=>'L', -73975=>'L', -73976=>'L', -73977=>'L', -73978=>'L', -73979=>'L', -73980=>'L', -73981=>'L', -73982=>'L', -73983=>'L', -73984=>'L', -73985=>'L', -73986=>'L', -73987=>'L', -73988=>'L', -73989=>'L', -73990=>'L', -73991=>'L', -73992=>'L', -73993=>'L', -73994=>'L', -73995=>'L', -73996=>'L', -73997=>'L', -73998=>'L', -73999=>'L', -74000=>'L', -74001=>'L', -74002=>'L', -74003=>'L', -74004=>'L', -74005=>'L', -74006=>'L', -74007=>'L', -74008=>'L', -74009=>'L', -74010=>'L', -74011=>'L', -74012=>'L', -74013=>'L', -74014=>'L', -74015=>'L', -74016=>'L', -74017=>'L', -74018=>'L', -74019=>'L', -74020=>'L', -74021=>'L', -74022=>'L', -74023=>'L', -74024=>'L', -74025=>'L', -74026=>'L', -74027=>'L', -74028=>'L', -74029=>'L', -74030=>'L', -74031=>'L', -74032=>'L', -74033=>'L', -74034=>'L', -74035=>'L', -74036=>'L', -74037=>'L', -74038=>'L', -74039=>'L', -74040=>'L', -74041=>'L', -74042=>'L', -74043=>'L', -74044=>'L', -74045=>'L', -74046=>'L', -74047=>'L', -74048=>'L', -74049=>'L', -74050=>'L', -74051=>'L', -74052=>'L', -74053=>'L', -74054=>'L', -74055=>'L', -74056=>'L', -74057=>'L', -74058=>'L', -74059=>'L', -74060=>'L', -74061=>'L', -74062=>'L', -74063=>'L', -74064=>'L', -74065=>'L', -74066=>'L', -74067=>'L', -74068=>'L', -74069=>'L', -74070=>'L', -74071=>'L', -74072=>'L', -74073=>'L', -74074=>'L', -74075=>'L', -74076=>'L', -74077=>'L', -74078=>'L', -74079=>'L', -74080=>'L', -74081=>'L', -74082=>'L', -74083=>'L', -74084=>'L', -74085=>'L', -74086=>'L', -74087=>'L', -74088=>'L', -74089=>'L', -74090=>'L', -74091=>'L', -74092=>'L', -74093=>'L', -74094=>'L', -74095=>'L', -74096=>'L', -74097=>'L', -74098=>'L', -74099=>'L', -74100=>'L', -74101=>'L', -74102=>'L', -74103=>'L', -74104=>'L', -74105=>'L', -74106=>'L', -74107=>'L', -74108=>'L', -74109=>'L', -74110=>'L', -74111=>'L', -74112=>'L', -74113=>'L', -74114=>'L', -74115=>'L', -74116=>'L', -74117=>'L', -74118=>'L', -74119=>'L', -74120=>'L', -74121=>'L', -74122=>'L', -74123=>'L', -74124=>'L', -74125=>'L', -74126=>'L', -74127=>'L', -74128=>'L', -74129=>'L', -74130=>'L', -74131=>'L', -74132=>'L', -74133=>'L', -74134=>'L', -74135=>'L', -74136=>'L', -74137=>'L', -74138=>'L', -74139=>'L', -74140=>'L', -74141=>'L', -74142=>'L', -74143=>'L', -74144=>'L', -74145=>'L', -74146=>'L', -74147=>'L', -74148=>'L', -74149=>'L', -74150=>'L', -74151=>'L', -74152=>'L', -74153=>'L', -74154=>'L', -74155=>'L', -74156=>'L', -74157=>'L', -74158=>'L', -74159=>'L', -74160=>'L', -74161=>'L', -74162=>'L', -74163=>'L', -74164=>'L', -74165=>'L', -74166=>'L', -74167=>'L', -74168=>'L', -74169=>'L', -74170=>'L', -74171=>'L', -74172=>'L', -74173=>'L', -74174=>'L', -74175=>'L', -74176=>'L', -74177=>'L', -74178=>'L', -74179=>'L', -74180=>'L', -74181=>'L', -74182=>'L', -74183=>'L', -74184=>'L', -74185=>'L', -74186=>'L', -74187=>'L', -74188=>'L', -74189=>'L', -74190=>'L', -74191=>'L', -74192=>'L', -74193=>'L', -74194=>'L', -74195=>'L', -74196=>'L', -74197=>'L', -74198=>'L', -74199=>'L', -74200=>'L', -74201=>'L', -74202=>'L', -74203=>'L', -74204=>'L', -74205=>'L', -74206=>'L', -74207=>'L', -74208=>'L', -74209=>'L', -74210=>'L', -74211=>'L', -74212=>'L', -74213=>'L', -74214=>'L', -74215=>'L', -74216=>'L', -74217=>'L', -74218=>'L', -74219=>'L', -74220=>'L', -74221=>'L', -74222=>'L', -74223=>'L', -74224=>'L', -74225=>'L', -74226=>'L', -74227=>'L', -74228=>'L', -74229=>'L', -74230=>'L', -74231=>'L', -74232=>'L', -74233=>'L', -74234=>'L', -74235=>'L', -74236=>'L', -74237=>'L', -74238=>'L', -74239=>'L', -74240=>'L', -74241=>'L', -74242=>'L', -74243=>'L', -74244=>'L', -74245=>'L', -74246=>'L', -74247=>'L', -74248=>'L', -74249=>'L', -74250=>'L', -74251=>'L', -74252=>'L', -74253=>'L', -74254=>'L', -74255=>'L', -74256=>'L', -74257=>'L', -74258=>'L', -74259=>'L', -74260=>'L', -74261=>'L', -74262=>'L', -74263=>'L', -74264=>'L', -74265=>'L', -74266=>'L', -74267=>'L', -74268=>'L', -74269=>'L', -74270=>'L', -74271=>'L', -74272=>'L', -74273=>'L', -74274=>'L', -74275=>'L', -74276=>'L', -74277=>'L', -74278=>'L', -74279=>'L', -74280=>'L', -74281=>'L', -74282=>'L', -74283=>'L', -74284=>'L', -74285=>'L', -74286=>'L', -74287=>'L', -74288=>'L', -74289=>'L', -74290=>'L', -74291=>'L', -74292=>'L', -74293=>'L', -74294=>'L', -74295=>'L', -74296=>'L', -74297=>'L', -74298=>'L', -74299=>'L', -74300=>'L', -74301=>'L', -74302=>'L', -74303=>'L', -74304=>'L', -74305=>'L', -74306=>'L', -74307=>'L', -74308=>'L', -74309=>'L', -74310=>'L', -74311=>'L', -74312=>'L', -74313=>'L', -74314=>'L', -74315=>'L', -74316=>'L', -74317=>'L', -74318=>'L', -74319=>'L', -74320=>'L', -74321=>'L', -74322=>'L', -74323=>'L', -74324=>'L', -74325=>'L', -74326=>'L', -74327=>'L', -74328=>'L', -74329=>'L', -74330=>'L', -74331=>'L', -74332=>'L', -74333=>'L', -74334=>'L', -74335=>'L', -74336=>'L', -74337=>'L', -74338=>'L', -74339=>'L', -74340=>'L', -74341=>'L', -74342=>'L', -74343=>'L', -74344=>'L', -74345=>'L', -74346=>'L', -74347=>'L', -74348=>'L', -74349=>'L', -74350=>'L', -74351=>'L', -74352=>'L', -74353=>'L', -74354=>'L', -74355=>'L', -74356=>'L', -74357=>'L', -74358=>'L', -74359=>'L', -74360=>'L', -74361=>'L', -74362=>'L', -74363=>'L', -74364=>'L', -74365=>'L', -74366=>'L', -74367=>'L', -74368=>'L', -74369=>'L', -74370=>'L', -74371=>'L', -74372=>'L', -74373=>'L', -74374=>'L', -74375=>'L', -74376=>'L', -74377=>'L', -74378=>'L', -74379=>'L', -74380=>'L', -74381=>'L', -74382=>'L', -74383=>'L', -74384=>'L', -74385=>'L', -74386=>'L', -74387=>'L', -74388=>'L', -74389=>'L', -74390=>'L', -74391=>'L', -74392=>'L', -74393=>'L', -74394=>'L', -74395=>'L', -74396=>'L', -74397=>'L', -74398=>'L', -74399=>'L', -74400=>'L', -74401=>'L', -74402=>'L', -74403=>'L', -74404=>'L', -74405=>'L', -74406=>'L', -74407=>'L', -74408=>'L', -74409=>'L', -74410=>'L', -74411=>'L', -74412=>'L', -74413=>'L', -74414=>'L', -74415=>'L', -74416=>'L', -74417=>'L', -74418=>'L', -74419=>'L', -74420=>'L', -74421=>'L', -74422=>'L', -74423=>'L', -74424=>'L', -74425=>'L', -74426=>'L', -74427=>'L', -74428=>'L', -74429=>'L', -74430=>'L', -74431=>'L', -74432=>'L', -74433=>'L', -74434=>'L', -74435=>'L', -74436=>'L', -74437=>'L', -74438=>'L', -74439=>'L', -74440=>'L', -74441=>'L', -74442=>'L', -74443=>'L', -74444=>'L', -74445=>'L', -74446=>'L', -74447=>'L', -74448=>'L', -74449=>'L', -74450=>'L', -74451=>'L', -74452=>'L', -74453=>'L', -74454=>'L', -74455=>'L', -74456=>'L', -74457=>'L', -74458=>'L', -74459=>'L', -74460=>'L', -74461=>'L', -74462=>'L', -74463=>'L', -74464=>'L', -74465=>'L', -74466=>'L', -74467=>'L', -74468=>'L', -74469=>'L', -74470=>'L', -74471=>'L', -74472=>'L', -74473=>'L', -74474=>'L', -74475=>'L', -74476=>'L', -74477=>'L', -74478=>'L', -74479=>'L', -74480=>'L', -74481=>'L', -74482=>'L', -74483=>'L', -74484=>'L', -74485=>'L', -74486=>'L', -74487=>'L', -74488=>'L', -74489=>'L', -74490=>'L', -74491=>'L', -74492=>'L', -74493=>'L', -74494=>'L', -74495=>'L', -74496=>'L', -74497=>'L', -74498=>'L', -74499=>'L', -74500=>'L', -74501=>'L', -74502=>'L', -74503=>'L', -74504=>'L', -74505=>'L', -74506=>'L', -74507=>'L', -74508=>'L', -74509=>'L', -74510=>'L', -74511=>'L', -74512=>'L', -74513=>'L', -74514=>'L', -74515=>'L', -74516=>'L', -74517=>'L', -74518=>'L', -74519=>'L', -74520=>'L', -74521=>'L', -74522=>'L', -74523=>'L', -74524=>'L', -74525=>'L', -74526=>'L', -74527=>'L', -74528=>'L', -74529=>'L', -74530=>'L', -74531=>'L', -74532=>'L', -74533=>'L', -74534=>'L', -74535=>'L', -74536=>'L', -74537=>'L', -74538=>'L', -74539=>'L', -74540=>'L', -74541=>'L', -74542=>'L', -74543=>'L', -74544=>'L', -74545=>'L', -74546=>'L', -74547=>'L', -74548=>'L', -74549=>'L', -74550=>'L', -74551=>'L', -74552=>'L', -74553=>'L', -74554=>'L', -74555=>'L', -74556=>'L', -74557=>'L', -74558=>'L', -74559=>'L', -74560=>'L', -74561=>'L', -74562=>'L', -74563=>'L', -74564=>'L', -74565=>'L', -74566=>'L', -74567=>'L', -74568=>'L', -74569=>'L', -74570=>'L', -74571=>'L', -74572=>'L', -74573=>'L', -74574=>'L', -74575=>'L', -74576=>'L', -74577=>'L', -74578=>'L', -74579=>'L', -74580=>'L', -74581=>'L', -74582=>'L', -74583=>'L', -74584=>'L', -74585=>'L', -74586=>'L', -74587=>'L', -74588=>'L', -74589=>'L', -74590=>'L', -74591=>'L', -74592=>'L', -74593=>'L', -74594=>'L', -74595=>'L', -74596=>'L', -74597=>'L', -74598=>'L', -74599=>'L', -74600=>'L', -74601=>'L', -74602=>'L', -74603=>'L', -74604=>'L', -74605=>'L', -74606=>'L', -74752=>'L', -74753=>'L', -74754=>'L', -74755=>'L', -74756=>'L', -74757=>'L', -74758=>'L', -74759=>'L', -74760=>'L', -74761=>'L', -74762=>'L', -74763=>'L', -74764=>'L', -74765=>'L', -74766=>'L', -74767=>'L', -74768=>'L', -74769=>'L', -74770=>'L', -74771=>'L', -74772=>'L', -74773=>'L', -74774=>'L', -74775=>'L', -74776=>'L', -74777=>'L', -74778=>'L', -74779=>'L', -74780=>'L', -74781=>'L', -74782=>'L', -74783=>'L', -74784=>'L', -74785=>'L', -74786=>'L', -74787=>'L', -74788=>'L', -74789=>'L', -74790=>'L', -74791=>'L', -74792=>'L', -74793=>'L', -74794=>'L', -74795=>'L', -74796=>'L', -74797=>'L', -74798=>'L', -74799=>'L', -74800=>'L', -74801=>'L', -74802=>'L', -74803=>'L', -74804=>'L', -74805=>'L', -74806=>'L', -74807=>'L', -74808=>'L', -74809=>'L', -74810=>'L', -74811=>'L', -74812=>'L', -74813=>'L', -74814=>'L', -74815=>'L', -74816=>'L', -74817=>'L', -74818=>'L', -74819=>'L', -74820=>'L', -74821=>'L', -74822=>'L', -74823=>'L', -74824=>'L', -74825=>'L', -74826=>'L', -74827=>'L', -74828=>'L', -74829=>'L', -74830=>'L', -74831=>'L', -74832=>'L', -74833=>'L', -74834=>'L', -74835=>'L', -74836=>'L', -74837=>'L', -74838=>'L', -74839=>'L', -74840=>'L', -74841=>'L', -74842=>'L', -74843=>'L', -74844=>'L', -74845=>'L', -74846=>'L', -74847=>'L', -74848=>'L', -74849=>'L', -74850=>'L', -74864=>'L', -74865=>'L', -74866=>'L', -74867=>'L', -118784=>'L', -118785=>'L', -118786=>'L', -118787=>'L', -118788=>'L', -118789=>'L', -118790=>'L', -118791=>'L', -118792=>'L', -118793=>'L', -118794=>'L', -118795=>'L', -118796=>'L', -118797=>'L', -118798=>'L', -118799=>'L', -118800=>'L', -118801=>'L', -118802=>'L', -118803=>'L', -118804=>'L', -118805=>'L', -118806=>'L', -118807=>'L', -118808=>'L', -118809=>'L', -118810=>'L', -118811=>'L', -118812=>'L', -118813=>'L', -118814=>'L', -118815=>'L', -118816=>'L', -118817=>'L', -118818=>'L', -118819=>'L', -118820=>'L', -118821=>'L', -118822=>'L', -118823=>'L', -118824=>'L', -118825=>'L', -118826=>'L', -118827=>'L', -118828=>'L', -118829=>'L', -118830=>'L', -118831=>'L', -118832=>'L', -118833=>'L', -118834=>'L', -118835=>'L', -118836=>'L', -118837=>'L', -118838=>'L', -118839=>'L', -118840=>'L', -118841=>'L', -118842=>'L', -118843=>'L', -118844=>'L', -118845=>'L', -118846=>'L', -118847=>'L', -118848=>'L', -118849=>'L', -118850=>'L', -118851=>'L', -118852=>'L', -118853=>'L', -118854=>'L', -118855=>'L', -118856=>'L', -118857=>'L', -118858=>'L', -118859=>'L', -118860=>'L', -118861=>'L', -118862=>'L', -118863=>'L', -118864=>'L', -118865=>'L', -118866=>'L', -118867=>'L', -118868=>'L', -118869=>'L', -118870=>'L', -118871=>'L', -118872=>'L', -118873=>'L', -118874=>'L', -118875=>'L', -118876=>'L', -118877=>'L', -118878=>'L', -118879=>'L', -118880=>'L', -118881=>'L', -118882=>'L', -118883=>'L', -118884=>'L', -118885=>'L', -118886=>'L', -118887=>'L', -118888=>'L', -118889=>'L', -118890=>'L', -118891=>'L', -118892=>'L', -118893=>'L', -118894=>'L', -118895=>'L', -118896=>'L', -118897=>'L', -118898=>'L', -118899=>'L', -118900=>'L', -118901=>'L', -118902=>'L', -118903=>'L', -118904=>'L', -118905=>'L', -118906=>'L', -118907=>'L', -118908=>'L', -118909=>'L', -118910=>'L', -118911=>'L', -118912=>'L', -118913=>'L', -118914=>'L', -118915=>'L', -118916=>'L', -118917=>'L', -118918=>'L', -118919=>'L', -118920=>'L', -118921=>'L', -118922=>'L', -118923=>'L', -118924=>'L', -118925=>'L', -118926=>'L', -118927=>'L', -118928=>'L', -118929=>'L', -118930=>'L', -118931=>'L', -118932=>'L', -118933=>'L', -118934=>'L', -118935=>'L', -118936=>'L', -118937=>'L', -118938=>'L', -118939=>'L', -118940=>'L', -118941=>'L', -118942=>'L', -118943=>'L', -118944=>'L', -118945=>'L', -118946=>'L', -118947=>'L', -118948=>'L', -118949=>'L', -118950=>'L', -118951=>'L', -118952=>'L', -118953=>'L', -118954=>'L', -118955=>'L', -118956=>'L', -118957=>'L', -118958=>'L', -118959=>'L', -118960=>'L', -118961=>'L', -118962=>'L', -118963=>'L', -118964=>'L', -118965=>'L', -118966=>'L', -118967=>'L', -118968=>'L', -118969=>'L', -118970=>'L', -118971=>'L', -118972=>'L', -118973=>'L', -118974=>'L', -118975=>'L', -118976=>'L', -118977=>'L', -118978=>'L', -118979=>'L', -118980=>'L', -118981=>'L', -118982=>'L', -118983=>'L', -118984=>'L', -118985=>'L', -118986=>'L', -118987=>'L', -118988=>'L', -118989=>'L', -118990=>'L', -118991=>'L', -118992=>'L', -118993=>'L', -118994=>'L', -118995=>'L', -118996=>'L', -118997=>'L', -118998=>'L', -118999=>'L', -119000=>'L', -119001=>'L', -119002=>'L', -119003=>'L', -119004=>'L', -119005=>'L', -119006=>'L', -119007=>'L', -119008=>'L', -119009=>'L', -119010=>'L', -119011=>'L', -119012=>'L', -119013=>'L', -119014=>'L', -119015=>'L', -119016=>'L', -119017=>'L', -119018=>'L', -119019=>'L', -119020=>'L', -119021=>'L', -119022=>'L', -119023=>'L', -119024=>'L', -119025=>'L', -119026=>'L', -119027=>'L', -119028=>'L', -119029=>'L', -119040=>'L', -119041=>'L', -119042=>'L', -119043=>'L', -119044=>'L', -119045=>'L', -119046=>'L', -119047=>'L', -119048=>'L', -119049=>'L', -119050=>'L', -119051=>'L', -119052=>'L', -119053=>'L', -119054=>'L', -119055=>'L', -119056=>'L', -119057=>'L', -119058=>'L', -119059=>'L', -119060=>'L', -119061=>'L', -119062=>'L', -119063=>'L', -119064=>'L', -119065=>'L', -119066=>'L', -119067=>'L', -119068=>'L', -119069=>'L', -119070=>'L', -119071=>'L', -119072=>'L', -119073=>'L', -119074=>'L', -119075=>'L', -119076=>'L', -119077=>'L', -119078=>'L', -119082=>'L', -119083=>'L', -119084=>'L', -119085=>'L', -119086=>'L', -119087=>'L', -119088=>'L', -119089=>'L', -119090=>'L', -119091=>'L', -119092=>'L', -119093=>'L', -119094=>'L', -119095=>'L', -119096=>'L', -119097=>'L', -119098=>'L', -119099=>'L', -119100=>'L', -119101=>'L', -119102=>'L', -119103=>'L', -119104=>'L', -119105=>'L', -119106=>'L', -119107=>'L', -119108=>'L', -119109=>'L', -119110=>'L', -119111=>'L', -119112=>'L', -119113=>'L', -119114=>'L', -119115=>'L', -119116=>'L', -119117=>'L', -119118=>'L', -119119=>'L', -119120=>'L', -119121=>'L', -119122=>'L', -119123=>'L', -119124=>'L', -119125=>'L', -119126=>'L', -119127=>'L', -119128=>'L', -119129=>'L', -119130=>'L', -119131=>'L', -119132=>'L', -119133=>'L', -119134=>'L', -119135=>'L', -119136=>'L', -119137=>'L', -119138=>'L', -119139=>'L', -119140=>'L', -119141=>'L', -119142=>'L', -119143=>'NSM', -119144=>'NSM', -119145=>'NSM', -119146=>'L', -119147=>'L', -119148=>'L', -119149=>'L', -119150=>'L', -119151=>'L', -119152=>'L', -119153=>'L', -119154=>'L', -119155=>'BN', -119156=>'BN', -119157=>'BN', -119158=>'BN', -119159=>'BN', -119160=>'BN', -119161=>'BN', -119162=>'BN', -119163=>'NSM', -119164=>'NSM', -119165=>'NSM', -119166=>'NSM', -119167=>'NSM', -119168=>'NSM', -119169=>'NSM', -119170=>'NSM', -119171=>'L', -119172=>'L', -119173=>'NSM', -119174=>'NSM', -119175=>'NSM', -119176=>'NSM', -119177=>'NSM', -119178=>'NSM', -119179=>'NSM', -119180=>'L', -119181=>'L', -119182=>'L', -119183=>'L', -119184=>'L', -119185=>'L', -119186=>'L', -119187=>'L', -119188=>'L', -119189=>'L', -119190=>'L', -119191=>'L', -119192=>'L', -119193=>'L', -119194=>'L', -119195=>'L', -119196=>'L', -119197=>'L', -119198=>'L', -119199=>'L', -119200=>'L', -119201=>'L', -119202=>'L', -119203=>'L', -119204=>'L', -119205=>'L', -119206=>'L', -119207=>'L', -119208=>'L', -119209=>'L', -119210=>'NSM', -119211=>'NSM', -119212=>'NSM', -119213=>'NSM', -119214=>'L', -119215=>'L', -119216=>'L', -119217=>'L', -119218=>'L', -119219=>'L', -119220=>'L', -119221=>'L', -119222=>'L', -119223=>'L', -119224=>'L', -119225=>'L', -119226=>'L', -119227=>'L', -119228=>'L', -119229=>'L', -119230=>'L', -119231=>'L', -119232=>'L', -119233=>'L', -119234=>'L', -119235=>'L', -119236=>'L', -119237=>'L', -119238=>'L', -119239=>'L', -119240=>'L', -119241=>'L', -119242=>'L', -119243=>'L', -119244=>'L', -119245=>'L', -119246=>'L', -119247=>'L', -119248=>'L', -119249=>'L', -119250=>'L', -119251=>'L', -119252=>'L', -119253=>'L', -119254=>'L', -119255=>'L', -119256=>'L', -119257=>'L', -119258=>'L', -119259=>'L', -119260=>'L', -119261=>'L', -119296=>'ON', -119297=>'ON', -119298=>'ON', -119299=>'ON', -119300=>'ON', -119301=>'ON', -119302=>'ON', -119303=>'ON', -119304=>'ON', -119305=>'ON', -119306=>'ON', -119307=>'ON', -119308=>'ON', -119309=>'ON', -119310=>'ON', -119311=>'ON', -119312=>'ON', -119313=>'ON', -119314=>'ON', -119315=>'ON', -119316=>'ON', -119317=>'ON', -119318=>'ON', -119319=>'ON', -119320=>'ON', -119321=>'ON', -119322=>'ON', -119323=>'ON', -119324=>'ON', -119325=>'ON', -119326=>'ON', -119327=>'ON', -119328=>'ON', -119329=>'ON', -119330=>'ON', -119331=>'ON', -119332=>'ON', -119333=>'ON', -119334=>'ON', -119335=>'ON', -119336=>'ON', -119337=>'ON', -119338=>'ON', -119339=>'ON', -119340=>'ON', -119341=>'ON', -119342=>'ON', -119343=>'ON', -119344=>'ON', -119345=>'ON', -119346=>'ON', -119347=>'ON', -119348=>'ON', -119349=>'ON', -119350=>'ON', -119351=>'ON', -119352=>'ON', -119353=>'ON', -119354=>'ON', -119355=>'ON', -119356=>'ON', -119357=>'ON', -119358=>'ON', -119359=>'ON', -119360=>'ON', -119361=>'ON', -119362=>'NSM', -119363=>'NSM', -119364=>'NSM', -119365=>'ON', -119552=>'ON', -119553=>'ON', -119554=>'ON', -119555=>'ON', -119556=>'ON', -119557=>'ON', -119558=>'ON', -119559=>'ON', -119560=>'ON', -119561=>'ON', -119562=>'ON', -119563=>'ON', -119564=>'ON', -119565=>'ON', -119566=>'ON', -119567=>'ON', -119568=>'ON', -119569=>'ON', -119570=>'ON', -119571=>'ON', -119572=>'ON', -119573=>'ON', -119574=>'ON', -119575=>'ON', -119576=>'ON', -119577=>'ON', -119578=>'ON', -119579=>'ON', -119580=>'ON', -119581=>'ON', -119582=>'ON', -119583=>'ON', -119584=>'ON', -119585=>'ON', -119586=>'ON', -119587=>'ON', -119588=>'ON', -119589=>'ON', -119590=>'ON', -119591=>'ON', -119592=>'ON', -119593=>'ON', -119594=>'ON', -119595=>'ON', -119596=>'ON', -119597=>'ON', -119598=>'ON', -119599=>'ON', -119600=>'ON', -119601=>'ON', -119602=>'ON', -119603=>'ON', -119604=>'ON', -119605=>'ON', -119606=>'ON', -119607=>'ON', -119608=>'ON', -119609=>'ON', -119610=>'ON', -119611=>'ON', -119612=>'ON', -119613=>'ON', -119614=>'ON', -119615=>'ON', -119616=>'ON', -119617=>'ON', -119618=>'ON', -119619=>'ON', -119620=>'ON', -119621=>'ON', -119622=>'ON', -119623=>'ON', -119624=>'ON', -119625=>'ON', -119626=>'ON', -119627=>'ON', -119628=>'ON', -119629=>'ON', -119630=>'ON', -119631=>'ON', -119632=>'ON', -119633=>'ON', -119634=>'ON', -119635=>'ON', -119636=>'ON', -119637=>'ON', -119638=>'ON', -119648=>'L', -119649=>'L', -119650=>'L', -119651=>'L', -119652=>'L', -119653=>'L', -119654=>'L', -119655=>'L', -119656=>'L', -119657=>'L', -119658=>'L', -119659=>'L', -119660=>'L', -119661=>'L', -119662=>'L', -119663=>'L', -119664=>'L', -119665=>'L', -119808=>'L', -119809=>'L', -119810=>'L', -119811=>'L', -119812=>'L', -119813=>'L', -119814=>'L', -119815=>'L', -119816=>'L', -119817=>'L', -119818=>'L', -119819=>'L', -119820=>'L', -119821=>'L', -119822=>'L', -119823=>'L', -119824=>'L', -119825=>'L', -119826=>'L', -119827=>'L', -119828=>'L', -119829=>'L', -119830=>'L', -119831=>'L', -119832=>'L', -119833=>'L', -119834=>'L', -119835=>'L', -119836=>'L', -119837=>'L', -119838=>'L', -119839=>'L', -119840=>'L', -119841=>'L', -119842=>'L', -119843=>'L', -119844=>'L', -119845=>'L', -119846=>'L', -119847=>'L', -119848=>'L', -119849=>'L', -119850=>'L', -119851=>'L', -119852=>'L', -119853=>'L', -119854=>'L', -119855=>'L', -119856=>'L', -119857=>'L', -119858=>'L', -119859=>'L', -119860=>'L', -119861=>'L', -119862=>'L', -119863=>'L', -119864=>'L', -119865=>'L', -119866=>'L', -119867=>'L', -119868=>'L', -119869=>'L', -119870=>'L', -119871=>'L', -119872=>'L', -119873=>'L', -119874=>'L', -119875=>'L', -119876=>'L', -119877=>'L', -119878=>'L', -119879=>'L', -119880=>'L', -119881=>'L', -119882=>'L', -119883=>'L', -119884=>'L', -119885=>'L', -119886=>'L', -119887=>'L', -119888=>'L', -119889=>'L', -119890=>'L', -119891=>'L', -119892=>'L', -119894=>'L', -119895=>'L', -119896=>'L', -119897=>'L', -119898=>'L', -119899=>'L', -119900=>'L', -119901=>'L', -119902=>'L', -119903=>'L', -119904=>'L', -119905=>'L', -119906=>'L', -119907=>'L', -119908=>'L', -119909=>'L', -119910=>'L', -119911=>'L', -119912=>'L', -119913=>'L', -119914=>'L', -119915=>'L', -119916=>'L', -119917=>'L', -119918=>'L', -119919=>'L', -119920=>'L', -119921=>'L', -119922=>'L', -119923=>'L', -119924=>'L', -119925=>'L', -119926=>'L', -119927=>'L', -119928=>'L', -119929=>'L', -119930=>'L', -119931=>'L', -119932=>'L', -119933=>'L', -119934=>'L', -119935=>'L', -119936=>'L', -119937=>'L', -119938=>'L', -119939=>'L', -119940=>'L', -119941=>'L', -119942=>'L', -119943=>'L', -119944=>'L', -119945=>'L', -119946=>'L', -119947=>'L', -119948=>'L', -119949=>'L', -119950=>'L', -119951=>'L', -119952=>'L', -119953=>'L', -119954=>'L', -119955=>'L', -119956=>'L', -119957=>'L', -119958=>'L', -119959=>'L', -119960=>'L', -119961=>'L', -119962=>'L', -119963=>'L', -119964=>'L', -119966=>'L', -119967=>'L', -119970=>'L', -119973=>'L', -119974=>'L', -119977=>'L', -119978=>'L', -119979=>'L', -119980=>'L', -119982=>'L', -119983=>'L', -119984=>'L', -119985=>'L', -119986=>'L', -119987=>'L', -119988=>'L', -119989=>'L', -119990=>'L', -119991=>'L', -119992=>'L', -119993=>'L', -119995=>'L', -119997=>'L', -119998=>'L', -119999=>'L', -120000=>'L', -120001=>'L', -120002=>'L', -120003=>'L', -120005=>'L', -120006=>'L', -120007=>'L', -120008=>'L', -120009=>'L', -120010=>'L', -120011=>'L', -120012=>'L', -120013=>'L', -120014=>'L', -120015=>'L', -120016=>'L', -120017=>'L', -120018=>'L', -120019=>'L', -120020=>'L', -120021=>'L', -120022=>'L', -120023=>'L', -120024=>'L', -120025=>'L', -120026=>'L', -120027=>'L', -120028=>'L', -120029=>'L', -120030=>'L', -120031=>'L', -120032=>'L', -120033=>'L', -120034=>'L', -120035=>'L', -120036=>'L', -120037=>'L', -120038=>'L', -120039=>'L', -120040=>'L', -120041=>'L', -120042=>'L', -120043=>'L', -120044=>'L', -120045=>'L', -120046=>'L', -120047=>'L', -120048=>'L', -120049=>'L', -120050=>'L', -120051=>'L', -120052=>'L', -120053=>'L', -120054=>'L', -120055=>'L', -120056=>'L', -120057=>'L', -120058=>'L', -120059=>'L', -120060=>'L', -120061=>'L', -120062=>'L', -120063=>'L', -120064=>'L', -120065=>'L', -120066=>'L', -120067=>'L', -120068=>'L', -120069=>'L', -120071=>'L', -120072=>'L', -120073=>'L', -120074=>'L', -120077=>'L', -120078=>'L', -120079=>'L', -120080=>'L', -120081=>'L', -120082=>'L', -120083=>'L', -120084=>'L', -120086=>'L', -120087=>'L', -120088=>'L', -120089=>'L', -120090=>'L', -120091=>'L', -120092=>'L', -120094=>'L', -120095=>'L', -120096=>'L', -120097=>'L', -120098=>'L', -120099=>'L', -120100=>'L', -120101=>'L', -120102=>'L', -120103=>'L', -120104=>'L', -120105=>'L', -120106=>'L', -120107=>'L', -120108=>'L', -120109=>'L', -120110=>'L', -120111=>'L', -120112=>'L', -120113=>'L', -120114=>'L', -120115=>'L', -120116=>'L', -120117=>'L', -120118=>'L', -120119=>'L', -120120=>'L', -120121=>'L', -120123=>'L', -120124=>'L', -120125=>'L', -120126=>'L', -120128=>'L', -120129=>'L', -120130=>'L', -120131=>'L', -120132=>'L', -120134=>'L', -120138=>'L', -120139=>'L', -120140=>'L', -120141=>'L', -120142=>'L', -120143=>'L', -120144=>'L', -120146=>'L', -120147=>'L', -120148=>'L', -120149=>'L', -120150=>'L', -120151=>'L', -120152=>'L', -120153=>'L', -120154=>'L', -120155=>'L', -120156=>'L', -120157=>'L', -120158=>'L', -120159=>'L', -120160=>'L', -120161=>'L', -120162=>'L', -120163=>'L', -120164=>'L', -120165=>'L', -120166=>'L', -120167=>'L', -120168=>'L', -120169=>'L', -120170=>'L', -120171=>'L', -120172=>'L', -120173=>'L', -120174=>'L', -120175=>'L', -120176=>'L', -120177=>'L', -120178=>'L', -120179=>'L', -120180=>'L', -120181=>'L', -120182=>'L', -120183=>'L', -120184=>'L', -120185=>'L', -120186=>'L', -120187=>'L', -120188=>'L', -120189=>'L', -120190=>'L', -120191=>'L', -120192=>'L', -120193=>'L', -120194=>'L', -120195=>'L', -120196=>'L', -120197=>'L', -120198=>'L', -120199=>'L', -120200=>'L', -120201=>'L', -120202=>'L', -120203=>'L', -120204=>'L', -120205=>'L', -120206=>'L', -120207=>'L', -120208=>'L', -120209=>'L', -120210=>'L', -120211=>'L', -120212=>'L', -120213=>'L', -120214=>'L', -120215=>'L', -120216=>'L', -120217=>'L', -120218=>'L', -120219=>'L', -120220=>'L', -120221=>'L', -120222=>'L', -120223=>'L', -120224=>'L', -120225=>'L', -120226=>'L', -120227=>'L', -120228=>'L', -120229=>'L', -120230=>'L', -120231=>'L', -120232=>'L', -120233=>'L', -120234=>'L', -120235=>'L', -120236=>'L', -120237=>'L', -120238=>'L', -120239=>'L', -120240=>'L', -120241=>'L', -120242=>'L', -120243=>'L', -120244=>'L', -120245=>'L', -120246=>'L', -120247=>'L', -120248=>'L', -120249=>'L', -120250=>'L', -120251=>'L', -120252=>'L', -120253=>'L', -120254=>'L', -120255=>'L', -120256=>'L', -120257=>'L', -120258=>'L', -120259=>'L', -120260=>'L', -120261=>'L', -120262=>'L', -120263=>'L', -120264=>'L', -120265=>'L', -120266=>'L', -120267=>'L', -120268=>'L', -120269=>'L', -120270=>'L', -120271=>'L', -120272=>'L', -120273=>'L', -120274=>'L', -120275=>'L', -120276=>'L', -120277=>'L', -120278=>'L', -120279=>'L', -120280=>'L', -120281=>'L', -120282=>'L', -120283=>'L', -120284=>'L', -120285=>'L', -120286=>'L', -120287=>'L', -120288=>'L', -120289=>'L', -120290=>'L', -120291=>'L', -120292=>'L', -120293=>'L', -120294=>'L', -120295=>'L', -120296=>'L', -120297=>'L', -120298=>'L', -120299=>'L', -120300=>'L', -120301=>'L', -120302=>'L', -120303=>'L', -120304=>'L', -120305=>'L', -120306=>'L', -120307=>'L', -120308=>'L', -120309=>'L', -120310=>'L', -120311=>'L', -120312=>'L', -120313=>'L', -120314=>'L', -120315=>'L', -120316=>'L', -120317=>'L', -120318=>'L', -120319=>'L', -120320=>'L', -120321=>'L', -120322=>'L', -120323=>'L', -120324=>'L', -120325=>'L', -120326=>'L', -120327=>'L', -120328=>'L', -120329=>'L', -120330=>'L', -120331=>'L', -120332=>'L', -120333=>'L', -120334=>'L', -120335=>'L', -120336=>'L', -120337=>'L', -120338=>'L', -120339=>'L', -120340=>'L', -120341=>'L', -120342=>'L', -120343=>'L', -120344=>'L', -120345=>'L', -120346=>'L', -120347=>'L', -120348=>'L', -120349=>'L', -120350=>'L', -120351=>'L', -120352=>'L', -120353=>'L', -120354=>'L', -120355=>'L', -120356=>'L', -120357=>'L', -120358=>'L', -120359=>'L', -120360=>'L', -120361=>'L', -120362=>'L', -120363=>'L', -120364=>'L', -120365=>'L', -120366=>'L', -120367=>'L', -120368=>'L', -120369=>'L', -120370=>'L', -120371=>'L', -120372=>'L', -120373=>'L', -120374=>'L', -120375=>'L', -120376=>'L', -120377=>'L', -120378=>'L', -120379=>'L', -120380=>'L', -120381=>'L', -120382=>'L', -120383=>'L', -120384=>'L', -120385=>'L', -120386=>'L', -120387=>'L', -120388=>'L', -120389=>'L', -120390=>'L', -120391=>'L', -120392=>'L', -120393=>'L', -120394=>'L', -120395=>'L', -120396=>'L', -120397=>'L', -120398=>'L', -120399=>'L', -120400=>'L', -120401=>'L', -120402=>'L', -120403=>'L', -120404=>'L', -120405=>'L', -120406=>'L', -120407=>'L', -120408=>'L', -120409=>'L', -120410=>'L', -120411=>'L', -120412=>'L', -120413=>'L', -120414=>'L', -120415=>'L', -120416=>'L', -120417=>'L', -120418=>'L', -120419=>'L', -120420=>'L', -120421=>'L', -120422=>'L', -120423=>'L', -120424=>'L', -120425=>'L', -120426=>'L', -120427=>'L', -120428=>'L', -120429=>'L', -120430=>'L', -120431=>'L', -120432=>'L', -120433=>'L', -120434=>'L', -120435=>'L', -120436=>'L', -120437=>'L', -120438=>'L', -120439=>'L', -120440=>'L', -120441=>'L', -120442=>'L', -120443=>'L', -120444=>'L', -120445=>'L', -120446=>'L', -120447=>'L', -120448=>'L', -120449=>'L', -120450=>'L', -120451=>'L', -120452=>'L', -120453=>'L', -120454=>'L', -120455=>'L', -120456=>'L', -120457=>'L', -120458=>'L', -120459=>'L', -120460=>'L', -120461=>'L', -120462=>'L', -120463=>'L', -120464=>'L', -120465=>'L', -120466=>'L', -120467=>'L', -120468=>'L', -120469=>'L', -120470=>'L', -120471=>'L', -120472=>'L', -120473=>'L', -120474=>'L', -120475=>'L', -120476=>'L', -120477=>'L', -120478=>'L', -120479=>'L', -120480=>'L', -120481=>'L', -120482=>'L', -120483=>'L', -120484=>'L', -120485=>'L', -120488=>'L', -120489=>'L', -120490=>'L', -120491=>'L', -120492=>'L', -120493=>'L', -120494=>'L', -120495=>'L', -120496=>'L', -120497=>'L', -120498=>'L', -120499=>'L', -120500=>'L', -120501=>'L', -120502=>'L', -120503=>'L', -120504=>'L', -120505=>'L', -120506=>'L', -120507=>'L', -120508=>'L', -120509=>'L', -120510=>'L', -120511=>'L', -120512=>'L', -120513=>'L', -120514=>'L', -120515=>'L', -120516=>'L', -120517=>'L', -120518=>'L', -120519=>'L', -120520=>'L', -120521=>'L', -120522=>'L', -120523=>'L', -120524=>'L', -120525=>'L', -120526=>'L', -120527=>'L', -120528=>'L', -120529=>'L', -120530=>'L', -120531=>'L', -120532=>'L', -120533=>'L', -120534=>'L', -120535=>'L', -120536=>'L', -120537=>'L', -120538=>'L', -120539=>'L', -120540=>'L', -120541=>'L', -120542=>'L', -120543=>'L', -120544=>'L', -120545=>'L', -120546=>'L', -120547=>'L', -120548=>'L', -120549=>'L', -120550=>'L', -120551=>'L', -120552=>'L', -120553=>'L', -120554=>'L', -120555=>'L', -120556=>'L', -120557=>'L', -120558=>'L', -120559=>'L', -120560=>'L', -120561=>'L', -120562=>'L', -120563=>'L', -120564=>'L', -120565=>'L', -120566=>'L', -120567=>'L', -120568=>'L', -120569=>'L', -120570=>'L', -120571=>'L', -120572=>'L', -120573=>'L', -120574=>'L', -120575=>'L', -120576=>'L', -120577=>'L', -120578=>'L', -120579=>'L', -120580=>'L', -120581=>'L', -120582=>'L', -120583=>'L', -120584=>'L', -120585=>'L', -120586=>'L', -120587=>'L', -120588=>'L', -120589=>'L', -120590=>'L', -120591=>'L', -120592=>'L', -120593=>'L', -120594=>'L', -120595=>'L', -120596=>'L', -120597=>'L', -120598=>'L', -120599=>'L', -120600=>'L', -120601=>'L', -120602=>'L', -120603=>'L', -120604=>'L', -120605=>'L', -120606=>'L', -120607=>'L', -120608=>'L', -120609=>'L', -120610=>'L', -120611=>'L', -120612=>'L', -120613=>'L', -120614=>'L', -120615=>'L', -120616=>'L', -120617=>'L', -120618=>'L', -120619=>'L', -120620=>'L', -120621=>'L', -120622=>'L', -120623=>'L', -120624=>'L', -120625=>'L', -120626=>'L', -120627=>'L', -120628=>'L', -120629=>'L', -120630=>'L', -120631=>'L', -120632=>'L', -120633=>'L', -120634=>'L', -120635=>'L', -120636=>'L', -120637=>'L', -120638=>'L', -120639=>'L', -120640=>'L', -120641=>'L', -120642=>'L', -120643=>'L', -120644=>'L', -120645=>'L', -120646=>'L', -120647=>'L', -120648=>'L', -120649=>'L', -120650=>'L', -120651=>'L', -120652=>'L', -120653=>'L', -120654=>'L', -120655=>'L', -120656=>'L', -120657=>'L', -120658=>'L', -120659=>'L', -120660=>'L', -120661=>'L', -120662=>'L', -120663=>'L', -120664=>'L', -120665=>'L', -120666=>'L', -120667=>'L', -120668=>'L', -120669=>'L', -120670=>'L', -120671=>'L', -120672=>'L', -120673=>'L', -120674=>'L', -120675=>'L', -120676=>'L', -120677=>'L', -120678=>'L', -120679=>'L', -120680=>'L', -120681=>'L', -120682=>'L', -120683=>'L', -120684=>'L', -120685=>'L', -120686=>'L', -120687=>'L', -120688=>'L', -120689=>'L', -120690=>'L', -120691=>'L', -120692=>'L', -120693=>'L', -120694=>'L', -120695=>'L', -120696=>'L', -120697=>'L', -120698=>'L', -120699=>'L', -120700=>'L', -120701=>'L', -120702=>'L', -120703=>'L', -120704=>'L', -120705=>'L', -120706=>'L', -120707=>'L', -120708=>'L', -120709=>'L', -120710=>'L', -120711=>'L', -120712=>'L', -120713=>'L', -120714=>'L', -120715=>'L', -120716=>'L', -120717=>'L', -120718=>'L', -120719=>'L', -120720=>'L', -120721=>'L', -120722=>'L', -120723=>'L', -120724=>'L', -120725=>'L', -120726=>'L', -120727=>'L', -120728=>'L', -120729=>'L', -120730=>'L', -120731=>'L', -120732=>'L', -120733=>'L', -120734=>'L', -120735=>'L', -120736=>'L', -120737=>'L', -120738=>'L', -120739=>'L', -120740=>'L', -120741=>'L', -120742=>'L', -120743=>'L', -120744=>'L', -120745=>'L', -120746=>'L', -120747=>'L', -120748=>'L', -120749=>'L', -120750=>'L', -120751=>'L', -120752=>'L', -120753=>'L', -120754=>'L', -120755=>'L', -120756=>'L', -120757=>'L', -120758=>'L', -120759=>'L', -120760=>'L', -120761=>'L', -120762=>'L', -120763=>'L', -120764=>'L', -120765=>'L', -120766=>'L', -120767=>'L', -120768=>'L', -120769=>'L', -120770=>'L', -120771=>'L', -120772=>'L', -120773=>'L', -120774=>'L', -120775=>'L', -120776=>'L', -120777=>'L', -120778=>'L', -120779=>'L', -120782=>'EN', -120783=>'EN', -120784=>'EN', -120785=>'EN', -120786=>'EN', -120787=>'EN', -120788=>'EN', -120789=>'EN', -120790=>'EN', -120791=>'EN', -120792=>'EN', -120793=>'EN', -120794=>'EN', -120795=>'EN', -120796=>'EN', -120797=>'EN', -120798=>'EN', -120799=>'EN', -120800=>'EN', -120801=>'EN', -120802=>'EN', -120803=>'EN', -120804=>'EN', -120805=>'EN', -120806=>'EN', -120807=>'EN', -120808=>'EN', -120809=>'EN', -120810=>'EN', -120811=>'EN', -120812=>'EN', -120813=>'EN', -120814=>'EN', -120815=>'EN', -120816=>'EN', -120817=>'EN', -120818=>'EN', -120819=>'EN', -120820=>'EN', -120821=>'EN', -120822=>'EN', -120823=>'EN', -120824=>'EN', -120825=>'EN', -120826=>'EN', -120827=>'EN', -120828=>'EN', -120829=>'EN', -120830=>'EN', -120831=>'EN', -131072=>'L', -173782=>'L', -194560=>'L', -194561=>'L', -194562=>'L', -194563=>'L', -194564=>'L', -194565=>'L', -194566=>'L', -194567=>'L', -194568=>'L', -194569=>'L', -194570=>'L', -194571=>'L', -194572=>'L', -194573=>'L', -194574=>'L', -194575=>'L', -194576=>'L', -194577=>'L', -194578=>'L', -194579=>'L', -194580=>'L', -194581=>'L', -194582=>'L', -194583=>'L', -194584=>'L', -194585=>'L', -194586=>'L', -194587=>'L', -194588=>'L', -194589=>'L', -194590=>'L', -194591=>'L', -194592=>'L', -194593=>'L', -194594=>'L', -194595=>'L', -194596=>'L', -194597=>'L', -194598=>'L', -194599=>'L', -194600=>'L', -194601=>'L', -194602=>'L', -194603=>'L', -194604=>'L', -194605=>'L', -194606=>'L', -194607=>'L', -194608=>'L', -194609=>'L', -194610=>'L', -194611=>'L', -194612=>'L', -194613=>'L', -194614=>'L', -194615=>'L', -194616=>'L', -194617=>'L', -194618=>'L', -194619=>'L', -194620=>'L', -194621=>'L', -194622=>'L', -194623=>'L', -194624=>'L', -194625=>'L', -194626=>'L', -194627=>'L', -194628=>'L', -194629=>'L', -194630=>'L', -194631=>'L', -194632=>'L', -194633=>'L', -194634=>'L', -194635=>'L', -194636=>'L', -194637=>'L', -194638=>'L', -194639=>'L', -194640=>'L', -194641=>'L', -194642=>'L', -194643=>'L', -194644=>'L', -194645=>'L', -194646=>'L', -194647=>'L', -194648=>'L', -194649=>'L', -194650=>'L', -194651=>'L', -194652=>'L', -194653=>'L', -194654=>'L', -194655=>'L', -194656=>'L', -194657=>'L', -194658=>'L', -194659=>'L', -194660=>'L', -194661=>'L', -194662=>'L', -194663=>'L', -194664=>'L', -194665=>'L', -194666=>'L', -194667=>'L', -194668=>'L', -194669=>'L', -194670=>'L', -194671=>'L', -194672=>'L', -194673=>'L', -194674=>'L', -194675=>'L', -194676=>'L', -194677=>'L', -194678=>'L', -194679=>'L', -194680=>'L', -194681=>'L', -194682=>'L', -194683=>'L', -194684=>'L', -194685=>'L', -194686=>'L', -194687=>'L', -194688=>'L', -194689=>'L', -194690=>'L', -194691=>'L', -194692=>'L', -194693=>'L', -194694=>'L', -194695=>'L', -194696=>'L', -194697=>'L', -194698=>'L', -194699=>'L', -194700=>'L', -194701=>'L', -194702=>'L', -194703=>'L', -194704=>'L', -194705=>'L', -194706=>'L', -194707=>'L', -194708=>'L', -194709=>'L', -194710=>'L', -194711=>'L', -194712=>'L', -194713=>'L', -194714=>'L', -194715=>'L', -194716=>'L', -194717=>'L', -194718=>'L', -194719=>'L', -194720=>'L', -194721=>'L', -194722=>'L', -194723=>'L', -194724=>'L', -194725=>'L', -194726=>'L', -194727=>'L', -194728=>'L', -194729=>'L', -194730=>'L', -194731=>'L', -194732=>'L', -194733=>'L', -194734=>'L', -194735=>'L', -194736=>'L', -194737=>'L', -194738=>'L', -194739=>'L', -194740=>'L', -194741=>'L', -194742=>'L', -194743=>'L', -194744=>'L', -194745=>'L', -194746=>'L', -194747=>'L', -194748=>'L', -194749=>'L', -194750=>'L', -194751=>'L', -194752=>'L', -194753=>'L', -194754=>'L', -194755=>'L', -194756=>'L', -194757=>'L', -194758=>'L', -194759=>'L', -194760=>'L', -194761=>'L', -194762=>'L', -194763=>'L', -194764=>'L', -194765=>'L', -194766=>'L', -194767=>'L', -194768=>'L', -194769=>'L', -194770=>'L', -194771=>'L', -194772=>'L', -194773=>'L', -194774=>'L', -194775=>'L', -194776=>'L', -194777=>'L', -194778=>'L', -194779=>'L', -194780=>'L', -194781=>'L', -194782=>'L', -194783=>'L', -194784=>'L', -194785=>'L', -194786=>'L', -194787=>'L', -194788=>'L', -194789=>'L', -194790=>'L', -194791=>'L', -194792=>'L', -194793=>'L', -194794=>'L', -194795=>'L', -194796=>'L', -194797=>'L', -194798=>'L', -194799=>'L', -194800=>'L', -194801=>'L', -194802=>'L', -194803=>'L', -194804=>'L', -194805=>'L', -194806=>'L', -194807=>'L', -194808=>'L', -194809=>'L', -194810=>'L', -194811=>'L', -194812=>'L', -194813=>'L', -194814=>'L', -194815=>'L', -194816=>'L', -194817=>'L', -194818=>'L', -194819=>'L', -194820=>'L', -194821=>'L', -194822=>'L', -194823=>'L', -194824=>'L', -194825=>'L', -194826=>'L', -194827=>'L', -194828=>'L', -194829=>'L', -194830=>'L', -194831=>'L', -194832=>'L', -194833=>'L', -194834=>'L', -194835=>'L', -194836=>'L', -194837=>'L', -194838=>'L', -194839=>'L', -194840=>'L', -194841=>'L', -194842=>'L', -194843=>'L', -194844=>'L', -194845=>'L', -194846=>'L', -194847=>'L', -194848=>'L', -194849=>'L', -194850=>'L', -194851=>'L', -194852=>'L', -194853=>'L', -194854=>'L', -194855=>'L', -194856=>'L', -194857=>'L', -194858=>'L', -194859=>'L', -194860=>'L', -194861=>'L', -194862=>'L', -194863=>'L', -194864=>'L', -194865=>'L', -194866=>'L', -194867=>'L', -194868=>'L', -194869=>'L', -194870=>'L', -194871=>'L', -194872=>'L', -194873=>'L', -194874=>'L', -194875=>'L', -194876=>'L', -194877=>'L', -194878=>'L', -194879=>'L', -194880=>'L', -194881=>'L', -194882=>'L', -194883=>'L', -194884=>'L', -194885=>'L', -194886=>'L', -194887=>'L', -194888=>'L', -194889=>'L', -194890=>'L', -194891=>'L', -194892=>'L', -194893=>'L', -194894=>'L', -194895=>'L', -194896=>'L', -194897=>'L', -194898=>'L', -194899=>'L', -194900=>'L', -194901=>'L', -194902=>'L', -194903=>'L', -194904=>'L', -194905=>'L', -194906=>'L', -194907=>'L', -194908=>'L', -194909=>'L', -194910=>'L', -194911=>'L', -194912=>'L', -194913=>'L', -194914=>'L', -194915=>'L', -194916=>'L', -194917=>'L', -194918=>'L', -194919=>'L', -194920=>'L', -194921=>'L', -194922=>'L', -194923=>'L', -194924=>'L', -194925=>'L', -194926=>'L', -194927=>'L', -194928=>'L', -194929=>'L', -194930=>'L', -194931=>'L', -194932=>'L', -194933=>'L', -194934=>'L', -194935=>'L', -194936=>'L', -194937=>'L', -194938=>'L', -194939=>'L', -194940=>'L', -194941=>'L', -194942=>'L', -194943=>'L', -194944=>'L', -194945=>'L', -194946=>'L', -194947=>'L', -194948=>'L', -194949=>'L', -194950=>'L', -194951=>'L', -194952=>'L', -194953=>'L', -194954=>'L', -194955=>'L', -194956=>'L', -194957=>'L', -194958=>'L', -194959=>'L', -194960=>'L', -194961=>'L', -194962=>'L', -194963=>'L', -194964=>'L', -194965=>'L', -194966=>'L', -194967=>'L', -194968=>'L', -194969=>'L', -194970=>'L', -194971=>'L', -194972=>'L', -194973=>'L', -194974=>'L', -194975=>'L', -194976=>'L', -194977=>'L', -194978=>'L', -194979=>'L', -194980=>'L', -194981=>'L', -194982=>'L', -194983=>'L', -194984=>'L', -194985=>'L', -194986=>'L', -194987=>'L', -194988=>'L', -194989=>'L', -194990=>'L', -194991=>'L', -194992=>'L', -194993=>'L', -194994=>'L', -194995=>'L', -194996=>'L', -194997=>'L', -194998=>'L', -194999=>'L', -195000=>'L', -195001=>'L', -195002=>'L', -195003=>'L', -195004=>'L', -195005=>'L', -195006=>'L', -195007=>'L', -195008=>'L', -195009=>'L', -195010=>'L', -195011=>'L', -195012=>'L', -195013=>'L', -195014=>'L', -195015=>'L', -195016=>'L', -195017=>'L', -195018=>'L', -195019=>'L', -195020=>'L', -195021=>'L', -195022=>'L', -195023=>'L', -195024=>'L', -195025=>'L', -195026=>'L', -195027=>'L', -195028=>'L', -195029=>'L', -195030=>'L', -195031=>'L', -195032=>'L', -195033=>'L', -195034=>'L', -195035=>'L', -195036=>'L', -195037=>'L', -195038=>'L', -195039=>'L', -195040=>'L', -195041=>'L', -195042=>'L', -195043=>'L', -195044=>'L', -195045=>'L', -195046=>'L', -195047=>'L', -195048=>'L', -195049=>'L', -195050=>'L', -195051=>'L', -195052=>'L', -195053=>'L', -195054=>'L', -195055=>'L', -195056=>'L', -195057=>'L', -195058=>'L', -195059=>'L', -195060=>'L', -195061=>'L', -195062=>'L', -195063=>'L', -195064=>'L', -195065=>'L', -195066=>'L', -195067=>'L', -195068=>'L', -195069=>'L', -195070=>'L', -195071=>'L', -195072=>'L', -195073=>'L', -195074=>'L', -195075=>'L', -195076=>'L', -195077=>'L', -195078=>'L', -195079=>'L', -195080=>'L', -195081=>'L', -195082=>'L', -195083=>'L', -195084=>'L', -195085=>'L', -195086=>'L', -195087=>'L', -195088=>'L', -195089=>'L', -195090=>'L', -195091=>'L', -195092=>'L', -195093=>'L', -195094=>'L', -195095=>'L', -195096=>'L', -195097=>'L', -195098=>'L', -195099=>'L', -195100=>'L', -195101=>'L', -917505=>'BN', -917536=>'BN', -917537=>'BN', -917538=>'BN', -917539=>'BN', -917540=>'BN', -917541=>'BN', -917542=>'BN', -917543=>'BN', -917544=>'BN', -917545=>'BN', -917546=>'BN', -917547=>'BN', -917548=>'BN', -917549=>'BN', -917550=>'BN', -917551=>'BN', -917552=>'BN', -917553=>'BN', -917554=>'BN', -917555=>'BN', -917556=>'BN', -917557=>'BN', -917558=>'BN', -917559=>'BN', -917560=>'BN', -917561=>'BN', -917562=>'BN', -917563=>'BN', -917564=>'BN', -917565=>'BN', -917566=>'BN', -917567=>'BN', -917568=>'BN', -917569=>'BN', -917570=>'BN', -917571=>'BN', -917572=>'BN', -917573=>'BN', -917574=>'BN', -917575=>'BN', -917576=>'BN', -917577=>'BN', -917578=>'BN', -917579=>'BN', -917580=>'BN', -917581=>'BN', -917582=>'BN', -917583=>'BN', -917584=>'BN', -917585=>'BN', -917586=>'BN', -917587=>'BN', -917588=>'BN', -917589=>'BN', -917590=>'BN', -917591=>'BN', -917592=>'BN', -917593=>'BN', -917594=>'BN', -917595=>'BN', -917596=>'BN', -917597=>'BN', -917598=>'BN', -917599=>'BN', -917600=>'BN', -917601=>'BN', -917602=>'BN', -917603=>'BN', -917604=>'BN', -917605=>'BN', -917606=>'BN', -917607=>'BN', -917608=>'BN', -917609=>'BN', -917610=>'BN', -917611=>'BN', -917612=>'BN', -917613=>'BN', -917614=>'BN', -917615=>'BN', -917616=>'BN', -917617=>'BN', -917618=>'BN', -917619=>'BN', -917620=>'BN', -917621=>'BN', -917622=>'BN', -917623=>'BN', -917624=>'BN', -917625=>'BN', -917626=>'BN', -917627=>'BN', -917628=>'BN', -917629=>'BN', -917630=>'BN', -917631=>'BN', -917760=>'NSM', -917761=>'NSM', -917762=>'NSM', -917763=>'NSM', -917764=>'NSM', -917765=>'NSM', -917766=>'NSM', -917767=>'NSM', -917768=>'NSM', -917769=>'NSM', -917770=>'NSM', -917771=>'NSM', -917772=>'NSM', -917773=>'NSM', -917774=>'NSM', -917775=>'NSM', -917776=>'NSM', -917777=>'NSM', -917778=>'NSM', -917779=>'NSM', -917780=>'NSM', -917781=>'NSM', -917782=>'NSM', -917783=>'NSM', -917784=>'NSM', -917785=>'NSM', -917786=>'NSM', -917787=>'NSM', -917788=>'NSM', -917789=>'NSM', -917790=>'NSM', -917791=>'NSM', -917792=>'NSM', -917793=>'NSM', -917794=>'NSM', -917795=>'NSM', -917796=>'NSM', -917797=>'NSM', -917798=>'NSM', -917799=>'NSM', -917800=>'NSM', -917801=>'NSM', -917802=>'NSM', -917803=>'NSM', -917804=>'NSM', -917805=>'NSM', -917806=>'NSM', -917807=>'NSM', -917808=>'NSM', -917809=>'NSM', -917810=>'NSM', -917811=>'NSM', -917812=>'NSM', -917813=>'NSM', -917814=>'NSM', -917815=>'NSM', -917816=>'NSM', -917817=>'NSM', -917818=>'NSM', -917819=>'NSM', -917820=>'NSM', -917821=>'NSM', -917822=>'NSM', -917823=>'NSM', -917824=>'NSM', -917825=>'NSM', -917826=>'NSM', -917827=>'NSM', -917828=>'NSM', -917829=>'NSM', -917830=>'NSM', -917831=>'NSM', -917832=>'NSM', -917833=>'NSM', -917834=>'NSM', -917835=>'NSM', -917836=>'NSM', -917837=>'NSM', -917838=>'NSM', -917839=>'NSM', -917840=>'NSM', -917841=>'NSM', -917842=>'NSM', -917843=>'NSM', -917844=>'NSM', -917845=>'NSM', -917846=>'NSM', -917847=>'NSM', -917848=>'NSM', -917849=>'NSM', -917850=>'NSM', -917851=>'NSM', -917852=>'NSM', -917853=>'NSM', -917854=>'NSM', -917855=>'NSM', -917856=>'NSM', -917857=>'NSM', -917858=>'NSM', -917859=>'NSM', -917860=>'NSM', -917861=>'NSM', -917862=>'NSM', -917863=>'NSM', -917864=>'NSM', -917865=>'NSM', -917866=>'NSM', -917867=>'NSM', -917868=>'NSM', -917869=>'NSM', -917870=>'NSM', -917871=>'NSM', -917872=>'NSM', -917873=>'NSM', -917874=>'NSM', -917875=>'NSM', -917876=>'NSM', -917877=>'NSM', -917878=>'NSM', -917879=>'NSM', -917880=>'NSM', -917881=>'NSM', -917882=>'NSM', -917883=>'NSM', -917884=>'NSM', -917885=>'NSM', -917886=>'NSM', -917887=>'NSM', -917888=>'NSM', -917889=>'NSM', -917890=>'NSM', -917891=>'NSM', -917892=>'NSM', -917893=>'NSM', -917894=>'NSM', -917895=>'NSM', -917896=>'NSM', -917897=>'NSM', -917898=>'NSM', -917899=>'NSM', -917900=>'NSM', -917901=>'NSM', -917902=>'NSM', -917903=>'NSM', -917904=>'NSM', -917905=>'NSM', -917906=>'NSM', -917907=>'NSM', -917908=>'NSM', -917909=>'NSM', -917910=>'NSM', -917911=>'NSM', -917912=>'NSM', -917913=>'NSM', -917914=>'NSM', -917915=>'NSM', -917916=>'NSM', -917917=>'NSM', -917918=>'NSM', -917919=>'NSM', -917920=>'NSM', -917921=>'NSM', -917922=>'NSM', -917923=>'NSM', -917924=>'NSM', -917925=>'NSM', -917926=>'NSM', -917927=>'NSM', -917928=>'NSM', -917929=>'NSM', -917930=>'NSM', -917931=>'NSM', -917932=>'NSM', -917933=>'NSM', -917934=>'NSM', -917935=>'NSM', -917936=>'NSM', -917937=>'NSM', -917938=>'NSM', -917939=>'NSM', -917940=>'NSM', -917941=>'NSM', -917942=>'NSM', -917943=>'NSM', -917944=>'NSM', -917945=>'NSM', -917946=>'NSM', -917947=>'NSM', -917948=>'NSM', -917949=>'NSM', -917950=>'NSM', -917951=>'NSM', -917952=>'NSM', -917953=>'NSM', -917954=>'NSM', -917955=>'NSM', -917956=>'NSM', -917957=>'NSM', -917958=>'NSM', -917959=>'NSM', -917960=>'NSM', -917961=>'NSM', -917962=>'NSM', -917963=>'NSM', -917964=>'NSM', -917965=>'NSM', -917966=>'NSM', -917967=>'NSM', -917968=>'NSM', -917969=>'NSM', -917970=>'NSM', -917971=>'NSM', -917972=>'NSM', -917973=>'NSM', -917974=>'NSM', -917975=>'NSM', -917976=>'NSM', -917977=>'NSM', -917978=>'NSM', -917979=>'NSM', -917980=>'NSM', -917981=>'NSM', -917982=>'NSM', -917983=>'NSM', -917984=>'NSM', -917985=>'NSM', -917986=>'NSM', -917987=>'NSM', -917988=>'NSM', -917989=>'NSM', -917990=>'NSM', -917991=>'NSM', -917992=>'NSM', -917993=>'NSM', -917994=>'NSM', -917995=>'NSM', -917996=>'NSM', -917997=>'NSM', -917998=>'NSM', -917999=>'NSM', -983040=>'L', -1048573=>'L', -1048576=>'L', -1114109=>'L' -); - -/** - * Mirror unicode characters. For information on bidi mirroring, see UAX #9: Bidirectional Algorithm, at http://www.unicode.org/unicode/reports/tr9/ - * @public - */ -public static $uni_mirror = array ( -0x0028=>0x0029, -0x0029=>0x0028, -0x003C=>0x003E, -0x003E=>0x003C, -0x005B=>0x005D, -0x005D=>0x005B, -0x007B=>0x007D, -0x007D=>0x007B, -0x00AB=>0x00BB, -0x00BB=>0x00AB, -0x0F3A=>0x0F3B, -0x0F3B=>0x0F3A, -0x0F3C=>0x0F3D, -0x0F3D=>0x0F3C, -0x169B=>0x169C, -0x169C=>0x169B, -0x2018=>0x2019, -0x2019=>0x2018, -0x201C=>0x201D, -0x201D=>0x201C, -0x2039=>0x203A, -0x203A=>0x2039, -0x2045=>0x2046, -0x2046=>0x2045, -0x207D=>0x207E, -0x207E=>0x207D, -0x208D=>0x208E, -0x208E=>0x208D, -0x2208=>0x220B, -0x2209=>0x220C, -0x220A=>0x220D, -0x220B=>0x2208, -0x220C=>0x2209, -0x220D=>0x220A, -0x2215=>0x29F5, -0x223C=>0x223D, -0x223D=>0x223C, -0x2243=>0x22CD, -0x2252=>0x2253, -0x2253=>0x2252, -0x2254=>0x2255, -0x2255=>0x2254, -0x2264=>0x2265, -0x2265=>0x2264, -0x2266=>0x2267, -0x2267=>0x2266, -0x2268=>0x2269, -0x2269=>0x2268, -0x226A=>0x226B, -0x226B=>0x226A, -0x226E=>0x226F, -0x226F=>0x226E, -0x2270=>0x2271, -0x2271=>0x2270, -0x2272=>0x2273, -0x2273=>0x2272, -0x2274=>0x2275, -0x2275=>0x2274, -0x2276=>0x2277, -0x2277=>0x2276, -0x2278=>0x2279, -0x2279=>0x2278, -0x227A=>0x227B, -0x227B=>0x227A, -0x227C=>0x227D, -0x227D=>0x227C, -0x227E=>0x227F, -0x227F=>0x227E, -0x2280=>0x2281, -0x2281=>0x2280, -0x2282=>0x2283, -0x2283=>0x2282, -0x2284=>0x2285, -0x2285=>0x2284, -0x2286=>0x2287, -0x2287=>0x2286, -0x2288=>0x2289, -0x2289=>0x2288, -0x228A=>0x228B, -0x228B=>0x228A, -0x228F=>0x2290, -0x2290=>0x228F, -0x2291=>0x2292, -0x2292=>0x2291, -0x2298=>0x29B8, -0x22A2=>0x22A3, -0x22A3=>0x22A2, -0x22A6=>0x2ADE, -0x22A8=>0x2AE4, -0x22A9=>0x2AE3, -0x22AB=>0x2AE5, -0x22B0=>0x22B1, -0x22B1=>0x22B0, -0x22B2=>0x22B3, -0x22B3=>0x22B2, -0x22B4=>0x22B5, -0x22B5=>0x22B4, -0x22B6=>0x22B7, -0x22B7=>0x22B6, -0x22C9=>0x22CA, -0x22CA=>0x22C9, -0x22CB=>0x22CC, -0x22CC=>0x22CB, -0x22CD=>0x2243, -0x22D0=>0x22D1, -0x22D1=>0x22D0, -0x22D6=>0x22D7, -0x22D7=>0x22D6, -0x22D8=>0x22D9, -0x22D9=>0x22D8, -0x22DA=>0x22DB, -0x22DB=>0x22DA, -0x22DC=>0x22DD, -0x22DD=>0x22DC, -0x22DE=>0x22DF, -0x22DF=>0x22DE, -0x22E0=>0x22E1, -0x22E1=>0x22E0, -0x22E2=>0x22E3, -0x22E3=>0x22E2, -0x22E4=>0x22E5, -0x22E5=>0x22E4, -0x22E6=>0x22E7, -0x22E7=>0x22E6, -0x22E8=>0x22E9, -0x22E9=>0x22E8, -0x22EA=>0x22EB, -0x22EB=>0x22EA, -0x22EC=>0x22ED, -0x22ED=>0x22EC, -0x22F0=>0x22F1, -0x22F1=>0x22F0, -0x22F2=>0x22FA, -0x22F3=>0x22FB, -0x22F4=>0x22FC, -0x22F6=>0x22FD, -0x22F7=>0x22FE, -0x22FA=>0x22F2, -0x22FB=>0x22F3, -0x22FC=>0x22F4, -0x22FD=>0x22F6, -0x22FE=>0x22F7, -0x2308=>0x2309, -0x2309=>0x2308, -0x230A=>0x230B, -0x230B=>0x230A, -0x2329=>0x232A, -0x232A=>0x2329, -0x2768=>0x2769, -0x2769=>0x2768, -0x276A=>0x276B, -0x276B=>0x276A, -0x276C=>0x276D, -0x276D=>0x276C, -0x276E=>0x276F, -0x276F=>0x276E, -0x2770=>0x2771, -0x2771=>0x2770, -0x2772=>0x2773, -0x2773=>0x2772, -0x2774=>0x2775, -0x2775=>0x2774, -0x27C3=>0x27C4, -0x27C4=>0x27C3, -0x27C5=>0x27C6, -0x27C6=>0x27C5, -0x27D5=>0x27D6, -0x27D6=>0x27D5, -0x27DD=>0x27DE, -0x27DE=>0x27DD, -0x27E2=>0x27E3, -0x27E3=>0x27E2, -0x27E4=>0x27E5, -0x27E5=>0x27E4, -0x27E6=>0x27E7, -0x27E7=>0x27E6, -0x27E8=>0x27E9, -0x27E9=>0x27E8, -0x27EA=>0x27EB, -0x27EB=>0x27EA, -0x2983=>0x2984, -0x2984=>0x2983, -0x2985=>0x2986, -0x2986=>0x2985, -0x2987=>0x2988, -0x2988=>0x2987, -0x2989=>0x298A, -0x298A=>0x2989, -0x298B=>0x298C, -0x298C=>0x298B, -0x298D=>0x2990, -0x298E=>0x298F, -0x298F=>0x298E, -0x2990=>0x298D, -0x2991=>0x2992, -0x2992=>0x2991, -0x2993=>0x2994, -0x2994=>0x2993, -0x2995=>0x2996, -0x2996=>0x2995, -0x2997=>0x2998, -0x2998=>0x2997, -0x29B8=>0x2298, -0x29C0=>0x29C1, -0x29C1=>0x29C0, -0x29C4=>0x29C5, -0x29C5=>0x29C4, -0x29CF=>0x29D0, -0x29D0=>0x29CF, -0x29D1=>0x29D2, -0x29D2=>0x29D1, -0x29D4=>0x29D5, -0x29D5=>0x29D4, -0x29D8=>0x29D9, -0x29D9=>0x29D8, -0x29DA=>0x29DB, -0x29DB=>0x29DA, -0x29F5=>0x2215, -0x29F8=>0x29F9, -0x29F9=>0x29F8, -0x29FC=>0x29FD, -0x29FD=>0x29FC, -0x2A2B=>0x2A2C, -0x2A2C=>0x2A2B, -0x2A2D=>0x2A2E, -0x2A2E=>0x2A2D, -0x2A34=>0x2A35, -0x2A35=>0x2A34, -0x2A3C=>0x2A3D, -0x2A3D=>0x2A3C, -0x2A64=>0x2A65, -0x2A65=>0x2A64, -0x2A79=>0x2A7A, -0x2A7A=>0x2A79, -0x2A7D=>0x2A7E, -0x2A7E=>0x2A7D, -0x2A7F=>0x2A80, -0x2A80=>0x2A7F, -0x2A81=>0x2A82, -0x2A82=>0x2A81, -0x2A83=>0x2A84, -0x2A84=>0x2A83, -0x2A8B=>0x2A8C, -0x2A8C=>0x2A8B, -0x2A91=>0x2A92, -0x2A92=>0x2A91, -0x2A93=>0x2A94, -0x2A94=>0x2A93, -0x2A95=>0x2A96, -0x2A96=>0x2A95, -0x2A97=>0x2A98, -0x2A98=>0x2A97, -0x2A99=>0x2A9A, -0x2A9A=>0x2A99, -0x2A9B=>0x2A9C, -0x2A9C=>0x2A9B, -0x2AA1=>0x2AA2, -0x2AA2=>0x2AA1, -0x2AA6=>0x2AA7, -0x2AA7=>0x2AA6, -0x2AA8=>0x2AA9, -0x2AA9=>0x2AA8, -0x2AAA=>0x2AAB, -0x2AAB=>0x2AAA, -0x2AAC=>0x2AAD, -0x2AAD=>0x2AAC, -0x2AAF=>0x2AB0, -0x2AB0=>0x2AAF, -0x2AB3=>0x2AB4, -0x2AB4=>0x2AB3, -0x2ABB=>0x2ABC, -0x2ABC=>0x2ABB, -0x2ABD=>0x2ABE, -0x2ABE=>0x2ABD, -0x2ABF=>0x2AC0, -0x2AC0=>0x2ABF, -0x2AC1=>0x2AC2, -0x2AC2=>0x2AC1, -0x2AC3=>0x2AC4, -0x2AC4=>0x2AC3, -0x2AC5=>0x2AC6, -0x2AC6=>0x2AC5, -0x2ACD=>0x2ACE, -0x2ACE=>0x2ACD, -0x2ACF=>0x2AD0, -0x2AD0=>0x2ACF, -0x2AD1=>0x2AD2, -0x2AD2=>0x2AD1, -0x2AD3=>0x2AD4, -0x2AD4=>0x2AD3, -0x2AD5=>0x2AD6, -0x2AD6=>0x2AD5, -0x2ADE=>0x22A6, -0x2AE3=>0x22A9, -0x2AE4=>0x22A8, -0x2AE5=>0x22AB, -0x2AEC=>0x2AED, -0x2AED=>0x2AEC, -0x2AF7=>0x2AF8, -0x2AF8=>0x2AF7, -0x2AF9=>0x2AFA, -0x2AFA=>0x2AF9, -0x2E02=>0x2E03, -0x2E03=>0x2E02, -0x2E04=>0x2E05, -0x2E05=>0x2E04, -0x2E09=>0x2E0A, -0x2E0A=>0x2E09, -0x2E0C=>0x2E0D, -0x2E0D=>0x2E0C, -0x2E1C=>0x2E1D, -0x2E1D=>0x2E1C, -0x3008=>0x3009, -0x3009=>0x3008, -0x300A=>0x300B, -0x300B=>0x300A, -0x300C=>0x300D, -0x300D=>0x300C, -0x300E=>0x300F, -0x300F=>0x300E, -0x3010=>0x3011, -0x3011=>0x3010, -0x3014=>0x3015, -0x3015=>0x3014, -0x3016=>0x3017, -0x3017=>0x3016, -0x3018=>0x3019, -0x3019=>0x3018, -0x301A=>0x301B, -0x301B=>0x301A, -0x301D=>0x301E, -0x301E=>0x301D, -0xFE59=>0xFE5A, -0xFE5A=>0xFE59, -0xFE5B=>0xFE5C, -0xFE5C=>0xFE5B, -0xFE5D=>0xFE5E, -0xFE5E=>0xFE5D, -0xFE64=>0xFE65, -0xFE65=>0xFE64, -0xFF08=>0xFF09, -0xFF09=>0xFF08, -0xFF1C=>0xFF1E, -0xFF1E=>0xFF1C, -0xFF3B=>0xFF3D, -0xFF3D=>0xFF3B, -0xFF5B=>0xFF5D, -0xFF5D=>0xFF5B, -0xFF5F=>0xFF60, -0xFF60=>0xFF5F, -0xFF62=>0xFF63, -0xFF63=>0xFF62); - -/** - * Arabic shape substitutions: char code => (isolated, final, initial, medial). - * @public - */ -public static $uni_arabicsubst = array( -1569=>array(65152), -1570=>array(65153, 65154, 65153, 65154), -1571=>array(65155, 65156, 65155, 65156), -1572=>array(65157, 65158), -1573=>array(65159, 65160, 65159, 65160), -1574=>array(65161, 65162, 65163, 65164), -1575=>array(65165, 65166, 65165, 65166), -1576=>array(65167, 65168, 65169, 65170), -1577=>array(65171, 65172), -1578=>array(65173, 65174, 65175, 65176), -1579=>array(65177, 65178, 65179, 65180), -1580=>array(65181, 65182, 65183, 65184), -1581=>array(65185, 65186, 65187, 65188), -1582=>array(65189, 65190, 65191, 65192), -1583=>array(65193, 65194, 65193, 65194), -1584=>array(65195, 65196, 65195, 65196), -1585=>array(65197, 65198, 65197, 65198), -1586=>array(65199, 65200, 65199, 65200), -1587=>array(65201, 65202, 65203, 65204), -1588=>array(65205, 65206, 65207, 65208), -1589=>array(65209, 65210, 65211, 65212), -1590=>array(65213, 65214, 65215, 65216), -1591=>array(65217, 65218, 65219, 65220), -1592=>array(65221, 65222, 65223, 65224), -1593=>array(65225, 65226, 65227, 65228), -1594=>array(65229, 65230, 65231, 65232), -1601=>array(65233, 65234, 65235, 65236), -1602=>array(65237, 65238, 65239, 65240), -1603=>array(65241, 65242, 65243, 65244), -1604=>array(65245, 65246, 65247, 65248), -1605=>array(65249, 65250, 65251, 65252), -1606=>array(65253, 65254, 65255, 65256), -1607=>array(65257, 65258, 65259, 65260), -1608=>array(65261, 65262, 65261, 65262), -1609=>array(65263, 65264, 64488, 64489), -1610=>array(65265, 65266, 65267, 65268), -1649=>array(64336, 64337), -1655=>array(64477), -1657=>array(64358, 64359, 64360, 64361), -1658=>array(64350, 64351, 64352, 64353), -1659=>array(64338, 64339, 64340, 64341), -1662=>array(64342, 64343, 64344, 64345), -1663=>array(64354, 64355, 64356, 64357), -1664=>array(64346, 64347, 64348, 64349), -1667=>array(64374, 64375, 64376, 64377), -1668=>array(64370, 64371, 64372, 64373), -1670=>array(64378, 64379, 64380, 64381), -1671=>array(64382, 64383, 64384, 64385), -1672=>array(64392, 64393), -1676=>array(64388, 64389), -1677=>array(64386, 64387), -1678=>array(64390, 64391), -1681=>array(64396, 64397), -1688=>array(64394, 64395, 64394, 64395), -1700=>array(64362, 64363, 64364, 64365), -1702=>array(64366, 64367, 64368, 64369), -1705=>array(64398, 64399, 64400, 64401), -1709=>array(64467, 64468, 64469, 64470), -1711=>array(64402, 64403, 64404, 64405), -1713=>array(64410, 64411, 64412, 64413), -1715=>array(64406, 64407, 64408, 64409), -1722=>array(64414, 64415), -1723=>array(64416, 64417, 64418, 64419), -1726=>array(64426, 64427, 64428, 64429), -1728=>array(64420, 64421), -1729=>array(64422, 64423, 64424, 64425), -1733=>array(64480, 64481), -1734=>array(64473, 64474), -1735=>array(64471, 64472), -1736=>array(64475, 64476), -1737=>array(64482, 64483), -1739=>array(64478, 64479), -1740=>array(64508, 64509, 64510, 64511), -1744=>array(64484, 64485, 64486, 64487), -1746=>array(64430, 64431), -1747=>array(64432, 64433) -); - -/** - * Arabic laa letter: (char code => isolated, final, initial, medial). - * @public - */ -public static $uni_laa_array = array ( -1570 =>array(65269, 65270, 65269, 65270), -1571 =>array(65271, 65272, 65271, 65272), -1573 =>array(65273, 65274, 65273, 65274), -1575 =>array(65275, 65276, 65275, 65276) -); - -/** - * Array of character substitutions for sequences of two diacritics symbols. - * Putting the combining mark and character in the same glyph allows us to avoid the two marks overlapping each other in an illegible manner. - * second NSM char code => substitution char - * @public - */ -public static $uni_diacritics = array ( -1612=>64606, # Shadda + Dammatan -1613=>64607, # Shadda + Kasratan -1614=>64608, # Shadda + Fatha -1615=>64609, # Shadda + Damma -1616=>64610 # Shadda + Kasra -); - -/** - * Array of character substitutions from UTF-8 Unicode to Latin1. - * @public - */ -public static $uni_utf8tolatin = array ( -8364=>128, # Euro1 -338=>140, # OE -352=>138, # Scaron -376=>159, # Ydieresis -381=>142, # Zcaron2 -8226=>149, # bullet3 -710=>136, # circumflex -8224=>134, # dagger -8225=>135, # daggerdbl -8230=>133, # ellipsis -8212=>151, # emdash -8211=>150, # endash -402=>131, # florin -8249=>139, # guilsinglleft -8250=>155, # guilsinglright -339=>156, # oe -8240=>137, # perthousand -8222=>132, # quotedblbase -8220=>147, # quotedblleft -8221=>148, # quotedblright -8216=>145, # quoteleft -8217=>146, # quoteright -8218=>130, # quotesinglbase -353=>154, # scaron -732=>152, # tilde -8482=>153, # trademark -382=>158 # zcaron2 -); - -/** - * Array of Encoding Maps. - * @public static - */ -public static $encmap = array( - -// encoding map for: cp874 -'cp874' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'ellipsis',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'kokaithai',162=>'khokhaithai',163=>'khokhuatthai',164=>'khokhwaithai',165=>'khokhonthai',166=>'khorakhangthai',167=>'ngonguthai',168=>'chochanthai',169=>'chochingthai',170=>'chochangthai',171=>'sosothai',172=>'chochoethai',173=>'yoyingthai',174=>'dochadathai',175=>'topatakthai',176=>'thothanthai',177=>'thonangmonthothai',178=>'thophuthaothai',179=>'nonenthai',180=>'dodekthai',181=>'totaothai',182=>'thothungthai',183=>'thothahanthai',184=>'thothongthai',185=>'nonuthai',186=>'bobaimaithai',187=>'poplathai',188=>'phophungthai',189=>'fofathai',190=>'phophanthai',191=>'fofanthai',192=>'phosamphaothai',193=>'momathai',194=>'yoyakthai',195=>'roruathai',196=>'ruthai',197=>'lolingthai',198=>'luthai',199=>'wowaenthai',200=>'sosalathai',201=>'sorusithai',202=>'sosuathai',203=>'hohipthai',204=>'lochulathai',205=>'oangthai',206=>'honokhukthai',207=>'paiyannoithai',208=>'saraathai',209=>'maihanakatthai',210=>'saraaathai',211=>'saraamthai',212=>'saraithai',213=>'saraiithai',214=>'sarauethai',215=>'saraueethai',216=>'sarauthai',217=>'sarauuthai',218=>'phinthuthai',219=>'.notdef',220=>'.notdef',221=>'.notdef',222=>'.notdef',223=>'bahtthai',224=>'saraethai',225=>'saraaethai',226=>'saraothai',227=>'saraaimaimuanthai',228=>'saraaimaimalaithai',229=>'lakkhangyaothai',230=>'maiyamokthai',231=>'maitaikhuthai',232=>'maiekthai',233=>'maithothai',234=>'maitrithai',235=>'maichattawathai',236=>'thanthakhatthai',237=>'nikhahitthai',238=>'yamakkanthai',239=>'fongmanthai',240=>'zerothai',241=>'onethai',242=>'twothai',243=>'threethai',244=>'fourthai',245=>'fivethai',246=>'sixthai',247=>'seventhai',248=>'eightthai',249=>'ninethai',250=>'angkhankhuthai',251=>'khomutthai',252=>'.notdef',253=>'.notdef',254=>'.notdef',255=>'.notdef'), - -// encoding map for: cp1250 -'cp1250' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'.notdef',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'.notdef',137=>'perthousand',138=>'Scaron',139=>'guilsinglleft',140=>'Sacute',141=>'Tcaron',142=>'Zcaron',143=>'Zacute',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'trademark',154=>'scaron',155=>'guilsinglright',156=>'sacute',157=>'tcaron',158=>'zcaron',159=>'zacute',160=>'space',161=>'caron',162=>'breve',163=>'Lslash',164=>'currency',165=>'Aogonek',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'Scedilla',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'Zdotaccent',176=>'degree',177=>'plusminus',178=>'ogonek',179=>'lslash',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'aogonek',186=>'scedilla',187=>'guillemotright',188=>'Lcaron',189=>'hungarumlaut',190=>'lcaron',191=>'zdotaccent',192=>'Racute',193=>'Aacute',194=>'Acircumflex',195=>'Abreve',196=>'Adieresis',197=>'Lacute',198=>'Cacute',199=>'Ccedilla',200=>'Ccaron',201=>'Eacute',202=>'Eogonek',203=>'Edieresis',204=>'Ecaron',205=>'Iacute',206=>'Icircumflex',207=>'Dcaron',208=>'Dcroat',209=>'Nacute',210=>'Ncaron',211=>'Oacute',212=>'Ocircumflex',213=>'Ohungarumlaut',214=>'Odieresis',215=>'multiply',216=>'Rcaron',217=>'Uring',218=>'Uacute',219=>'Uhungarumlaut',220=>'Udieresis',221=>'Yacute',222=>'Tcommaaccent',223=>'germandbls',224=>'racute',225=>'aacute',226=>'acircumflex',227=>'abreve',228=>'adieresis',229=>'lacute',230=>'cacute',231=>'ccedilla',232=>'ccaron',233=>'eacute',234=>'eogonek',235=>'edieresis',236=>'ecaron',237=>'iacute',238=>'icircumflex',239=>'dcaron',240=>'dcroat',241=>'nacute',242=>'ncaron',243=>'oacute',244=>'ocircumflex',245=>'ohungarumlaut',246=>'odieresis',247=>'divide',248=>'rcaron',249=>'uring',250=>'uacute',251=>'uhungarumlaut',252=>'udieresis',253=>'yacute',254=>'tcommaaccent',255=>'dotaccent'), - -// encoding map for: cp1251 -'cp1251' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'afii10051',129=>'afii10052',130=>'quotesinglbase',131=>'afii10100',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'Euro',137=>'perthousand',138=>'afii10058',139=>'guilsinglleft',140=>'afii10059',141=>'afii10061',142=>'afii10060',143=>'afii10145',144=>'afii10099',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'trademark',154=>'afii10106',155=>'guilsinglright',156=>'afii10107',157=>'afii10109',158=>'afii10108',159=>'afii10193',160=>'space',161=>'afii10062',162=>'afii10110',163=>'afii10057',164=>'currency',165=>'afii10050',166=>'brokenbar',167=>'section',168=>'afii10023',169=>'copyright',170=>'afii10053',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'afii10056',176=>'degree',177=>'plusminus',178=>'afii10055',179=>'afii10103',180=>'afii10098',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'afii10071',185=>'afii61352',186=>'afii10101',187=>'guillemotright',188=>'afii10105',189=>'afii10054',190=>'afii10102',191=>'afii10104',192=>'afii10017',193=>'afii10018',194=>'afii10019',195=>'afii10020',196=>'afii10021',197=>'afii10022',198=>'afii10024',199=>'afii10025',200=>'afii10026',201=>'afii10027',202=>'afii10028',203=>'afii10029',204=>'afii10030',205=>'afii10031',206=>'afii10032',207=>'afii10033',208=>'afii10034',209=>'afii10035',210=>'afii10036',211=>'afii10037',212=>'afii10038',213=>'afii10039',214=>'afii10040',215=>'afii10041',216=>'afii10042',217=>'afii10043',218=>'afii10044',219=>'afii10045',220=>'afii10046',221=>'afii10047',222=>'afii10048',223=>'afii10049',224=>'afii10065',225=>'afii10066',226=>'afii10067',227=>'afii10068',228=>'afii10069',229=>'afii10070',230=>'afii10072',231=>'afii10073',232=>'afii10074',233=>'afii10075',234=>'afii10076',235=>'afii10077',236=>'afii10078',237=>'afii10079',238=>'afii10080',239=>'afii10081',240=>'afii10082',241=>'afii10083',242=>'afii10084',243=>'afii10085',244=>'afii10086',245=>'afii10087',246=>'afii10088',247=>'afii10089',248=>'afii10090',249=>'afii10091',250=>'afii10092',251=>'afii10093',252=>'afii10094',253=>'afii10095',254=>'afii10096',255=>'afii10097'), - -// encoding map for: cp1252 -'cp1252' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'circumflex',137=>'perthousand',138=>'Scaron',139=>'guilsinglleft',140=>'OE',141=>'.notdef',142=>'Zcaron',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'tilde',153=>'trademark',154=>'scaron',155=>'guilsinglright',156=>'oe',157=>'.notdef',158=>'zcaron',159=>'Ydieresis',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Eth',209=>'Ntilde',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Yacute',222=>'Thorn',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'eth',241=>'ntilde',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'yacute',254=>'thorn',255=>'ydieresis'), - -// encoding map for: cp1253 -'cp1253' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'.notdef',137=>'perthousand',138=>'.notdef',139=>'guilsinglleft',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'trademark',154=>'.notdef',155=>'guilsinglright',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'dieresistonos',162=>'Alphatonos',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'.notdef',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'afii00208',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'tonos',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'Epsilontonos',185=>'Etatonos',186=>'Iotatonos',187=>'guillemotright',188=>'Omicrontonos',189=>'onehalf',190=>'Upsilontonos',191=>'Omegatonos',192=>'iotadieresistonos',193=>'Alpha',194=>'Beta',195=>'Gamma',196=>'Delta',197=>'Epsilon',198=>'Zeta',199=>'Eta',200=>'Theta',201=>'Iota',202=>'Kappa',203=>'Lambda',204=>'Mu',205=>'Nu',206=>'Xi',207=>'Omicron',208=>'Pi',209=>'Rho',210=>'.notdef',211=>'Sigma',212=>'Tau',213=>'Upsilon',214=>'Phi',215=>'Chi',216=>'Psi',217=>'Omega',218=>'Iotadieresis',219=>'Upsilondieresis',220=>'alphatonos',221=>'epsilontonos',222=>'etatonos',223=>'iotatonos',224=>'upsilondieresistonos',225=>'alpha',226=>'beta',227=>'gamma',228=>'delta',229=>'epsilon',230=>'zeta',231=>'eta',232=>'theta',233=>'iota',234=>'kappa',235=>'lambda',236=>'mu',237=>'nu',238=>'xi',239=>'omicron',240=>'pi',241=>'rho',242=>'sigma1',243=>'sigma',244=>'tau',245=>'upsilon',246=>'phi',247=>'chi',248=>'psi',249=>'omega',250=>'iotadieresis',251=>'upsilondieresis',252=>'omicrontonos',253=>'upsilontonos',254=>'omegatonos',255=>'.notdef'), - -// encoding map for: cp1254 -'cp1254' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'circumflex',137=>'perthousand',138=>'Scaron',139=>'guilsinglleft',140=>'OE',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'tilde',153=>'trademark',154=>'scaron',155=>'guilsinglright',156=>'oe',157=>'.notdef',158=>'.notdef',159=>'Ydieresis',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Gbreve',209=>'Ntilde',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Idotaccent',222=>'Scedilla',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'gbreve',241=>'ntilde',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'dotlessi',254=>'scedilla',255=>'ydieresis'), - -// encoding map for: cp1255 -'cp1255' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'circumflex',137=>'perthousand',138=>'.notdef',139=>'guilsinglleft',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'tilde',153=>'trademark',154=>'.notdef',155=>'guilsinglright',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'afii57636',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'multiply',171=>'guillemotleft',172=>'logicalnot',173=>'sfthyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'middot',184=>'cedilla',185=>'onesuperior',186=>'divide',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'afii57799',193=>'afii57801',194=>'afii57800',195=>'afii57802',196=>'afii57793',197=>'afii57794',198=>'afii57795',199=>'afii57798',200=>'afii57797',201=>'afii57806',202=>'.notdef',203=>'afii57796',204=>'afii57807',205=>'afii57839',206=>'afii57645',207=>'afii57841',208=>'afii57842',209=>'afii57804',210=>'afii57803',211=>'afii57658',212=>'afii57716',213=>'afii57717',214=>'afii57718',215=>'gereshhebrew',216=>'gershayimhebrew',217=>'.notdef',218=>'.notdef',219=>'.notdef',220=>'.notdef',221=>'.notdef',222=>'.notdef',223=>'.notdef',224=>'afii57664',225=>'afii57665',226=>'afii57666',227=>'afii57667',228=>'afii57668',229=>'afii57669',230=>'afii57670',231=>'afii57671',232=>'afii57672',233=>'afii57673',234=>'afii57674',235=>'afii57675',236=>'afii57676',237=>'afii57677',238=>'afii57678',239=>'afii57679',240=>'afii57680',241=>'afii57681',242=>'afii57682',243=>'afii57683',244=>'afii57684',245=>'afii57685',246=>'afii57686',247=>'afii57687',248=>'afii57688',249=>'afii57689',250=>'afii57690',251=>'.notdef',252=>'.notdef',253=>'afii299',254=>'afii300',255=>'.notdef'), - -// encoding map for: cp1256 -'cp1256' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'afii57506',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'circumflex',137=>'perthousand',138=>'afii57511',139=>'guilsinglleft',140=>'OE',141=>'afii57507',142=>'afii57508',143=>'afii57512',144=>'afii57509',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'trademark',154=>'afii57513',155=>'guilsinglright',156=>'oe',157=>'afii61664',158=>'afii301',159=>'afii57514',160=>'space',161=>'afii57388',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'.notdef',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'afii57403',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'afii57407',192=>'.notdef',193=>'afii57409',194=>'afii57410',195=>'afii57411',196=>'afii57412',197=>'afii57413',198=>'afii57414',199=>'afii57415',200=>'afii57416',201=>'afii57417',202=>'afii57418',203=>'afii57419',204=>'afii57420',205=>'afii57421',206=>'afii57422',207=>'afii57423',208=>'afii57424',209=>'afii57425',210=>'afii57426',211=>'afii57427',212=>'afii57428',213=>'afii57429',214=>'afii57430',215=>'multiply',216=>'afii57431',217=>'afii57432',218=>'afii57433',219=>'afii57434',220=>'afii57440',221=>'afii57441',222=>'afii57442',223=>'afii57443',224=>'agrave',225=>'afii57444',226=>'acircumflex',227=>'afii57445',228=>'afii57446',229=>'afii57470',230=>'afii57448',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'afii57449',237=>'afii57450',238=>'icircumflex',239=>'idieresis',240=>'afii57451',241=>'afii57452',242=>'afii57453',243=>'afii57454',244=>'ocircumflex',245=>'afii57455',246=>'afii57456',247=>'divide',248=>'afii57457',249=>'ugrave',250=>'afii57458',251=>'ucircumflex',252=>'udieresis',253=>'afii299',254=>'afii300',255=>'afii57519'), - -// encoding map for: cp1257 -'cp1257' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'.notdef',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'.notdef',137=>'perthousand',138=>'.notdef',139=>'guilsinglleft',140=>'.notdef',141=>'dieresis',142=>'caron',143=>'cedilla',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'trademark',154=>'.notdef',155=>'guilsinglright',156=>'.notdef',157=>'macron',158=>'ogonek',159=>'.notdef',160=>'space',161=>'.notdef',162=>'cent',163=>'sterling',164=>'currency',165=>'.notdef',166=>'brokenbar',167=>'section',168=>'Oslash',169=>'copyright',170=>'Rcommaaccent',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'AE',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'oslash',185=>'onesuperior',186=>'rcommaaccent',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'ae',192=>'Aogonek',193=>'Iogonek',194=>'Amacron',195=>'Cacute',196=>'Adieresis',197=>'Aring',198=>'Eogonek',199=>'Emacron',200=>'Ccaron',201=>'Eacute',202=>'Zacute',203=>'Edotaccent',204=>'Gcommaaccent',205=>'Kcommaaccent',206=>'Imacron',207=>'Lcommaaccent',208=>'Scaron',209=>'Nacute',210=>'Ncommaaccent',211=>'Oacute',212=>'Omacron',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Uogonek',217=>'Lslash',218=>'Sacute',219=>'Umacron',220=>'Udieresis',221=>'Zdotaccent',222=>'Zcaron',223=>'germandbls',224=>'aogonek',225=>'iogonek',226=>'amacron',227=>'cacute',228=>'adieresis',229=>'aring',230=>'eogonek',231=>'emacron',232=>'ccaron',233=>'eacute',234=>'zacute',235=>'edotaccent',236=>'gcommaaccent',237=>'kcommaaccent',238=>'imacron',239=>'lcommaaccent',240=>'scaron',241=>'nacute',242=>'ncommaaccent',243=>'oacute',244=>'omacron',245=>'otilde',246=>'odieresis',247=>'divide',248=>'uogonek',249=>'lslash',250=>'sacute',251=>'umacron',252=>'udieresis',253=>'zdotaccent',254=>'zcaron',255=>'dotaccent'), - -// encoding map for: cp1258 -'cp1258' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'circumflex',137=>'perthousand',138=>'.notdef',139=>'guilsinglleft',140=>'OE',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'tilde',153=>'trademark',154=>'.notdef',155=>'guilsinglright',156=>'oe',157=>'.notdef',158=>'.notdef',159=>'Ydieresis',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Abreve',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'gravecomb',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Dcroat',209=>'Ntilde',210=>'hookabovecomb',211=>'Oacute',212=>'Ocircumflex',213=>'Ohorn',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Uhorn',222=>'tildecomb',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'abreve',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'acutecomb',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'dcroat',241=>'ntilde',242=>'dotbelowcomb',243=>'oacute',244=>'ocircumflex',245=>'ohorn',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'uhorn',254=>'dong',255=>'ydieresis'), - -// encoding map for: iso-8859-1 -'iso-8859-1' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Eth',209=>'Ntilde',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Yacute',222=>'Thorn',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'eth',241=>'ntilde',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'yacute',254=>'thorn',255=>'ydieresis'), - -// encoding map for: iso-8859-2 -'iso-8859-2' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'Aogonek',162=>'breve',163=>'Lslash',164=>'currency',165=>'Lcaron',166=>'Sacute',167=>'section',168=>'dieresis',169=>'Scaron',170=>'Scedilla',171=>'Tcaron',172=>'Zacute',173=>'hyphen',174=>'Zcaron',175=>'Zdotaccent',176=>'degree',177=>'aogonek',178=>'ogonek',179=>'lslash',180=>'acute',181=>'lcaron',182=>'sacute',183=>'caron',184=>'cedilla',185=>'scaron',186=>'scedilla',187=>'tcaron',188=>'zacute',189=>'hungarumlaut',190=>'zcaron',191=>'zdotaccent',192=>'Racute',193=>'Aacute',194=>'Acircumflex',195=>'Abreve',196=>'Adieresis',197=>'Lacute',198=>'Cacute',199=>'Ccedilla',200=>'Ccaron',201=>'Eacute',202=>'Eogonek',203=>'Edieresis',204=>'Ecaron',205=>'Iacute',206=>'Icircumflex',207=>'Dcaron',208=>'Dcroat',209=>'Nacute',210=>'Ncaron',211=>'Oacute',212=>'Ocircumflex',213=>'Ohungarumlaut',214=>'Odieresis',215=>'multiply',216=>'Rcaron',217=>'Uring',218=>'Uacute',219=>'Uhungarumlaut',220=>'Udieresis',221=>'Yacute',222=>'Tcommaaccent',223=>'germandbls',224=>'racute',225=>'aacute',226=>'acircumflex',227=>'abreve',228=>'adieresis',229=>'lacute',230=>'cacute',231=>'ccedilla',232=>'ccaron',233=>'eacute',234=>'eogonek',235=>'edieresis',236=>'ecaron',237=>'iacute',238=>'icircumflex',239=>'dcaron',240=>'dcroat',241=>'nacute',242=>'ncaron',243=>'oacute',244=>'ocircumflex',245=>'ohungarumlaut',246=>'odieresis',247=>'divide',248=>'rcaron',249=>'uring',250=>'uacute',251=>'uhungarumlaut',252=>'udieresis',253=>'yacute',254=>'tcommaaccent',255=>'dotaccent'), - -// encoding map for: iso-8859-4 -'iso-8859-4' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'Aogonek',162=>'kgreenlandic',163=>'Rcommaaccent',164=>'currency',165=>'Itilde',166=>'Lcommaaccent',167=>'section',168=>'dieresis',169=>'Scaron',170=>'Emacron',171=>'Gcommaaccent',172=>'Tbar',173=>'hyphen',174=>'Zcaron',175=>'macron',176=>'degree',177=>'aogonek',178=>'ogonek',179=>'rcommaaccent',180=>'acute',181=>'itilde',182=>'lcommaaccent',183=>'caron',184=>'cedilla',185=>'scaron',186=>'emacron',187=>'gcommaaccent',188=>'tbar',189=>'Eng',190=>'zcaron',191=>'eng',192=>'Amacron',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Iogonek',200=>'Ccaron',201=>'Eacute',202=>'Eogonek',203=>'Edieresis',204=>'Edotaccent',205=>'Iacute',206=>'Icircumflex',207=>'Imacron',208=>'Dcroat',209=>'Ncommaaccent',210=>'Omacron',211=>'Kcommaaccent',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Uogonek',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Utilde',222=>'Umacron',223=>'germandbls',224=>'amacron',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'iogonek',232=>'ccaron',233=>'eacute',234=>'eogonek',235=>'edieresis',236=>'edotaccent',237=>'iacute',238=>'icircumflex',239=>'imacron',240=>'dcroat',241=>'ncommaaccent',242=>'omacron',243=>'kcommaaccent',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'uogonek',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'utilde',254=>'umacron',255=>'dotaccent'), - -// encoding map for: iso-8859-5 -'iso-8859-5' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'afii10023',162=>'afii10051',163=>'afii10052',164=>'afii10053',165=>'afii10054',166=>'afii10055',167=>'afii10056',168=>'afii10057',169=>'afii10058',170=>'afii10059',171=>'afii10060',172=>'afii10061',173=>'hyphen',174=>'afii10062',175=>'afii10145',176=>'afii10017',177=>'afii10018',178=>'afii10019',179=>'afii10020',180=>'afii10021',181=>'afii10022',182=>'afii10024',183=>'afii10025',184=>'afii10026',185=>'afii10027',186=>'afii10028',187=>'afii10029',188=>'afii10030',189=>'afii10031',190=>'afii10032',191=>'afii10033',192=>'afii10034',193=>'afii10035',194=>'afii10036',195=>'afii10037',196=>'afii10038',197=>'afii10039',198=>'afii10040',199=>'afii10041',200=>'afii10042',201=>'afii10043',202=>'afii10044',203=>'afii10045',204=>'afii10046',205=>'afii10047',206=>'afii10048',207=>'afii10049',208=>'afii10065',209=>'afii10066',210=>'afii10067',211=>'afii10068',212=>'afii10069',213=>'afii10070',214=>'afii10072',215=>'afii10073',216=>'afii10074',217=>'afii10075',218=>'afii10076',219=>'afii10077',220=>'afii10078',221=>'afii10079',222=>'afii10080',223=>'afii10081',224=>'afii10082',225=>'afii10083',226=>'afii10084',227=>'afii10085',228=>'afii10086',229=>'afii10087',230=>'afii10088',231=>'afii10089',232=>'afii10090',233=>'afii10091',234=>'afii10092',235=>'afii10093',236=>'afii10094',237=>'afii10095',238=>'afii10096',239=>'afii10097',240=>'afii61352',241=>'afii10071',242=>'afii10099',243=>'afii10100',244=>'afii10101',245=>'afii10102',246=>'afii10103',247=>'afii10104',248=>'afii10105',249=>'afii10106',250=>'afii10107',251=>'afii10108',252=>'afii10109',253=>'section',254=>'afii10110',255=>'afii10193'), - -// encoding map for: iso-8859-7 -'iso-8859-7' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'quoteleft',162=>'quoteright',163=>'sterling',164=>'.notdef',165=>'.notdef',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'.notdef',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'.notdef',175=>'afii00208',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'tonos',181=>'dieresistonos',182=>'Alphatonos',183=>'periodcentered',184=>'Epsilontonos',185=>'Etatonos',186=>'Iotatonos',187=>'guillemotright',188=>'Omicrontonos',189=>'onehalf',190=>'Upsilontonos',191=>'Omegatonos',192=>'iotadieresistonos',193=>'Alpha',194=>'Beta',195=>'Gamma',196=>'Delta',197=>'Epsilon',198=>'Zeta',199=>'Eta',200=>'Theta',201=>'Iota',202=>'Kappa',203=>'Lambda',204=>'Mu',205=>'Nu',206=>'Xi',207=>'Omicron',208=>'Pi',209=>'Rho',210=>'.notdef',211=>'Sigma',212=>'Tau',213=>'Upsilon',214=>'Phi',215=>'Chi',216=>'Psi',217=>'Omega',218=>'Iotadieresis',219=>'Upsilondieresis',220=>'alphatonos',221=>'epsilontonos',222=>'etatonos',223=>'iotatonos',224=>'upsilondieresistonos',225=>'alpha',226=>'beta',227=>'gamma',228=>'delta',229=>'epsilon',230=>'zeta',231=>'eta',232=>'theta',233=>'iota',234=>'kappa',235=>'lambda',236=>'mu',237=>'nu',238=>'xi',239=>'omicron',240=>'pi',241=>'rho',242=>'sigma1',243=>'sigma',244=>'tau',245=>'upsilon',246=>'phi',247=>'chi',248=>'psi',249=>'omega',250=>'iotadieresis',251=>'upsilondieresis',252=>'omicrontonos',253=>'upsilontonos',254=>'omegatonos',255=>'.notdef'), - -// encoding map for: iso-8859-9 -'iso-8859-9' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Gbreve',209=>'Ntilde',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Idotaccent',222=>'Scedilla',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'gbreve',241=>'ntilde',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'dotlessi',254=>'scedilla',255=>'ydieresis'), - -// encoding map for: iso-8859-11 -'iso-8859-11' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'kokaithai',162=>'khokhaithai',163=>'khokhuatthai',164=>'khokhwaithai',165=>'khokhonthai',166=>'khorakhangthai',167=>'ngonguthai',168=>'chochanthai',169=>'chochingthai',170=>'chochangthai',171=>'sosothai',172=>'chochoethai',173=>'yoyingthai',174=>'dochadathai',175=>'topatakthai',176=>'thothanthai',177=>'thonangmonthothai',178=>'thophuthaothai',179=>'nonenthai',180=>'dodekthai',181=>'totaothai',182=>'thothungthai',183=>'thothahanthai',184=>'thothongthai',185=>'nonuthai',186=>'bobaimaithai',187=>'poplathai',188=>'phophungthai',189=>'fofathai',190=>'phophanthai',191=>'fofanthai',192=>'phosamphaothai',193=>'momathai',194=>'yoyakthai',195=>'roruathai',196=>'ruthai',197=>'lolingthai',198=>'luthai',199=>'wowaenthai',200=>'sosalathai',201=>'sorusithai',202=>'sosuathai',203=>'hohipthai',204=>'lochulathai',205=>'oangthai',206=>'honokhukthai',207=>'paiyannoithai',208=>'saraathai',209=>'maihanakatthai',210=>'saraaathai',211=>'saraamthai',212=>'saraithai',213=>'saraiithai',214=>'sarauethai',215=>'saraueethai',216=>'sarauthai',217=>'sarauuthai',218=>'phinthuthai',219=>'.notdef',220=>'.notdef',221=>'.notdef',222=>'.notdef',223=>'bahtthai',224=>'saraethai',225=>'saraaethai',226=>'saraothai',227=>'saraaimaimuanthai',228=>'saraaimaimalaithai',229=>'lakkhangyaothai',230=>'maiyamokthai',231=>'maitaikhuthai',232=>'maiekthai',233=>'maithothai',234=>'maitrithai',235=>'maichattawathai',236=>'thanthakhatthai',237=>'nikhahitthai',238=>'yamakkanthai',239=>'fongmanthai',240=>'zerothai',241=>'onethai',242=>'twothai',243=>'threethai',244=>'fourthai',245=>'fivethai',246=>'sixthai',247=>'seventhai',248=>'eightthai',249=>'ninethai',250=>'angkhankhuthai',251=>'khomutthai',252=>'.notdef',253=>'.notdef',254=>'.notdef',255=>'.notdef'), - -// encoding map for: iso-8859-15 -'iso-8859-15' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'Euro',165=>'yen',166=>'Scaron',167=>'section',168=>'scaron',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'Zcaron',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'zcaron',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'OE',189=>'oe',190=>'Ydieresis',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Eth',209=>'Ntilde',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Yacute',222=>'Thorn',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'eth',241=>'ntilde',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'yacute',254=>'thorn',255=>'ydieresis'), - -// encoding map for: iso-8859-16 -'iso-8859-16' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'Aogonek',162=>'aogonek',163=>'Lslash',164=>'Euro',165=>'quotedblbase',166=>'Scaron',167=>'section',168=>'scaron',169=>'copyright',170=>'Scommaaccent',171=>'guillemotleft',172=>'Zacute',173=>'hyphen',174=>'zacute',175=>'Zdotaccent',176=>'degree',177=>'plusminus',178=>'Ccaron',179=>'lslash',180=>'Zcaron',181=>'quotedblright',182=>'paragraph',183=>'periodcentered',184=>'zcaron',185=>'ccaron',186=>'scommaaccent',187=>'guillemotright',188=>'OE',189=>'oe',190=>'Ydieresis',191=>'zdotaccent',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Abreve',196=>'Adieresis',197=>'Cacute',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Dcroat',209=>'Nacute',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Ohungarumlaut',214=>'Odieresis',215=>'Sacute',216=>'Uhungarumlaut',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Eogonek',222=>'Tcommaaccent',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'abreve',228=>'adieresis',229=>'cacute',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'dcroat',241=>'nacute',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'ohungarumlaut',246=>'odieresis',247=>'sacute',248=>'uhungarumlaut',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'eogonek',254=>'tcommaaccent',255=>'ydieresis'), - -// encoding map for: koi8-r -'koi8-r' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'SF100000',129=>'SF110000',130=>'SF010000',131=>'SF030000',132=>'SF020000',133=>'SF040000',134=>'SF080000',135=>'SF090000',136=>'SF060000',137=>'SF070000',138=>'SF050000',139=>'upblock',140=>'dnblock',141=>'block',142=>'lfblock',143=>'rtblock',144=>'ltshade',145=>'shade',146=>'dkshade',147=>'integraltp',148=>'filledbox',149=>'periodcentered',150=>'radical',151=>'approxequal',152=>'lessequal',153=>'greaterequal',154=>'space',155=>'integralbt',156=>'degree',157=>'twosuperior',158=>'periodcentered',159=>'divide',160=>'SF430000',161=>'SF240000',162=>'SF510000',163=>'afii10071',164=>'SF520000',165=>'SF390000',166=>'SF220000',167=>'SF210000',168=>'SF250000',169=>'SF500000',170=>'SF490000',171=>'SF380000',172=>'SF280000',173=>'SF270000',174=>'SF260000',175=>'SF360000',176=>'SF370000',177=>'SF420000',178=>'SF190000',179=>'afii10023',180=>'SF200000',181=>'SF230000',182=>'SF470000',183=>'SF480000',184=>'SF410000',185=>'SF450000',186=>'SF460000',187=>'SF400000',188=>'SF540000',189=>'SF530000',190=>'SF440000',191=>'copyright',192=>'afii10096',193=>'afii10065',194=>'afii10066',195=>'afii10088',196=>'afii10069',197=>'afii10070',198=>'afii10086',199=>'afii10068',200=>'afii10087',201=>'afii10074',202=>'afii10075',203=>'afii10076',204=>'afii10077',205=>'afii10078',206=>'afii10079',207=>'afii10080',208=>'afii10081',209=>'afii10097',210=>'afii10082',211=>'afii10083',212=>'afii10084',213=>'afii10085',214=>'afii10072',215=>'afii10067',216=>'afii10094',217=>'afii10093',218=>'afii10073',219=>'afii10090',220=>'afii10095',221=>'afii10091',222=>'afii10089',223=>'afii10092',224=>'afii10048',225=>'afii10017',226=>'afii10018',227=>'afii10040',228=>'afii10021',229=>'afii10022',230=>'afii10038',231=>'afii10020',232=>'afii10039',233=>'afii10026',234=>'afii10027',235=>'afii10028',236=>'afii10029',237=>'afii10030',238=>'afii10031',239=>'afii10032',240=>'afii10033',241=>'afii10049',242=>'afii10034',243=>'afii10035',244=>'afii10036',245=>'afii10037',246=>'afii10024',247=>'afii10019',248=>'afii10046',249=>'afii10045',250=>'afii10025',251=>'afii10042',252=>'afii10047',253=>'afii10043',254=>'afii10041',255=>'afii10044'), - -// encoding map for: koi8-u -'koi8-u' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'SF100000',129=>'SF110000',130=>'SF010000',131=>'SF030000',132=>'SF020000',133=>'SF040000',134=>'SF080000',135=>'SF090000',136=>'SF060000',137=>'SF070000',138=>'SF050000',139=>'upblock',140=>'dnblock',141=>'block',142=>'lfblock',143=>'rtblock',144=>'ltshade',145=>'shade',146=>'dkshade',147=>'integraltp',148=>'filledbox',149=>'bullet',150=>'radical',151=>'approxequal',152=>'lessequal',153=>'greaterequal',154=>'space',155=>'integralbt',156=>'degree',157=>'twosuperior',158=>'periodcentered',159=>'divide',160=>'SF430000',161=>'SF240000',162=>'SF510000',163=>'afii10071',164=>'afii10101',165=>'SF390000',166=>'afii10103',167=>'afii10104',168=>'SF250000',169=>'SF500000',170=>'SF490000',171=>'SF380000',172=>'SF280000',173=>'afii10098',174=>'SF260000',175=>'SF360000',176=>'SF370000',177=>'SF420000',178=>'SF190000',179=>'afii10023',180=>'afii10053',181=>'SF230000',182=>'afii10055',183=>'afii10056',184=>'SF410000',185=>'SF450000',186=>'SF460000',187=>'SF400000',188=>'SF540000',189=>'afii10050',190=>'SF440000',191=>'copyright',192=>'afii10096',193=>'afii10065',194=>'afii10066',195=>'afii10088',196=>'afii10069',197=>'afii10070',198=>'afii10086',199=>'afii10068',200=>'afii10087',201=>'afii10074',202=>'afii10075',203=>'afii10076',204=>'afii10077',205=>'afii10078',206=>'afii10079',207=>'afii10080',208=>'afii10081',209=>'afii10097',210=>'afii10082',211=>'afii10083',212=>'afii10084',213=>'afii10085',214=>'afii10072',215=>'afii10067',216=>'afii10094',217=>'afii10093',218=>'afii10073',219=>'afii10090',220=>'afii10095',221=>'afii10091',222=>'afii10089',223=>'afii10092',224=>'afii10048',225=>'afii10017',226=>'afii10018',227=>'afii10040',228=>'afii10021',229=>'afii10022',230=>'afii10038',231=>'afii10020',232=>'afii10039',233=>'afii10026',234=>'afii10027',235=>'afii10028',236=>'afii10029',237=>'afii10030',238=>'afii10031',239=>'afii10032',240=>'afii10033',241=>'afii10049',242=>'afii10034',243=>'afii10035',244=>'afii10036',245=>'afii10037',246=>'afii10024',247=>'afii10019',248=>'afii10046',249=>'afii10045',250=>'afii10025',251=>'afii10042',252=>'afii10047',253=>'afii10043',254=>'afii10041',255=>'afii10044'), - -// encoding map for: symbol -'symbol' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'universal',35=>'numbersign',36=>'existential',37=>'percent',38=>'ampersand',39=>'suchthat',40=>'parenleft',41=>'parenright',42=>'asteriskmath',43=>'plus',44=>'comma',45=>'minus',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'congruent',65=>'Alpha',66=>'Beta',67=>'Chi',68=>'Delta',69=>'Epsilon',70=>'Phi',71=>'Gamma',72=>'Eta',73=>'Iota',74=>'theta1',75=>'Kappa',76=>'Lambda',77=>'Mu',78=>'Nu',79=>'Omicron',80=>'Pi',81=>'Theta',82=>'Rho',83=>'Sigma',84=>'Tau',85=>'Upsilon',86=>'sigma1',87=>'Omega',88=>'Xi',89=>'Psi',90=>'Zeta',91=>'bracketleft',92=>'therefore',93=>'bracketright',94=>'perpendicular',95=>'underscore',96=>'radicalex',97=>'alpha',98=>'beta',99=>'chi',100=>'delta',101=>'epsilon',102=>'phi',103=>'gamma',104=>'eta',105=>'iota',106=>'phi1',107=>'kappa',108=>'lambda',109=>'mu',110=>'nu',111=>'omicron',112=>'pi',113=>'theta',114=>'rho',115=>'sigma',116=>'tau',117=>'upsilon',118=>'omega1',119=>'omega',120=>'xi',121=>'psi',122=>'zeta',123=>'braceleft',124=>'bar',125=>'braceright',126=>'similar',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'Euro',161=>'Upsilon1',162=>'minute',163=>'lessequal',164=>'fraction',165=>'infinity',166=>'florin',167=>'club',168=>'diamond',169=>'heart',170=>'spade',171=>'arrowboth',172=>'arrowleft',173=>'arrowup',174=>'arrowright',175=>'arrowdown',176=>'degree',177=>'plusminus',178=>'second',179=>'greaterequal',180=>'multiply',181=>'proportional',182=>'partialdiff',183=>'bullet',184=>'divide',185=>'notequal',186=>'equivalence',187=>'approxequal',188=>'ellipsis',189=>'arrowvertex',190=>'arrowhorizex',191=>'carriagereturn',192=>'aleph',193=>'Ifraktur',194=>'Rfraktur',195=>'weierstrass',196=>'circlemultiply',197=>'circleplus',198=>'emptyset',199=>'intersection',200=>'union',201=>'propersuperset',202=>'reflexsuperset',203=>'notsubset',204=>'propersubset',205=>'reflexsubset',206=>'element',207=>'notelement',208=>'angle',209=>'gradient',210=>'registerserif',211=>'copyrightserif',212=>'trademarkserif',213=>'product',214=>'radical',215=>'dotmath',216=>'logicalnot',217=>'logicaland',218=>'logicalor',219=>'arrowdblboth',220=>'arrowdblleft',221=>'arrowdblup',222=>'arrowdblright',223=>'arrowdbldown',224=>'lozenge',225=>'angleleft',226=>'registersans',227=>'copyrightsans',228=>'trademarksans',229=>'summation',230=>'parenlefttp',231=>'parenleftex',232=>'parenleftbt',233=>'bracketlefttp',234=>'bracketleftex',235=>'bracketleftbt',236=>'bracelefttp',237=>'braceleftmid',238=>'braceleftbt',239=>'braceex',240=>'.notdef',241=>'angleright',242=>'integral',243=>'integraltp',244=>'integralex',245=>'integralbt',246=>'parenrighttp',247=>'parenrightex',248=>'parenrightbt',249=>'bracketrighttp',250=>'bracketrightex',251=>'bracketrightbt',252=>'bracerighttp',253=>'bracerightmid',254=>'bracerightbt',255=>'.notdef',1226=>'registered',1227=>'copyright',1228=>'trademark') - -); // end of encoding maps - -/** - * ToUnicode map for Identity-H stream - * @public static - */ -public static $uni_identity_h = "/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n/WMode 0 def\n1 begincodespacerange\n<0000> \nendcodespacerange\n100 beginbfrange\n<0000> <00ff> <0000>\n<0100> <01ff> <0100>\n<0200> <02ff> <0200>\n<0300> <03ff> <0300>\n<0400> <04ff> <0400>\n<0500> <05ff> <0500>\n<0600> <06ff> <0600>\n<0700> <07ff> <0700>\n<0800> <08ff> <0800>\n<0900> <09ff> <0900>\n<0a00> <0aff> <0a00>\n<0b00> <0bff> <0b00>\n<0c00> <0cff> <0c00>\n<0d00> <0dff> <0d00>\n<0e00> <0eff> <0e00>\n<0f00> <0fff> <0f00>\n<1000> <10ff> <1000>\n<1100> <11ff> <1100>\n<1200> <12ff> <1200>\n<1300> <13ff> <1300>\n<1400> <14ff> <1400>\n<1500> <15ff> <1500>\n<1600> <16ff> <1600>\n<1700> <17ff> <1700>\n<1800> <18ff> <1800>\n<1900> <19ff> <1900>\n<1a00> <1aff> <1a00>\n<1b00> <1bff> <1b00>\n<1c00> <1cff> <1c00>\n<1d00> <1dff> <1d00>\n<1e00> <1eff> <1e00>\n<1f00> <1fff> <1f00>\n<2000> <20ff> <2000>\n<2100> <21ff> <2100>\n<2200> <22ff> <2200>\n<2300> <23ff> <2300>\n<2400> <24ff> <2400>\n<2500> <25ff> <2500>\n<2600> <26ff> <2600>\n<2700> <27ff> <2700>\n<2800> <28ff> <2800>\n<2900> <29ff> <2900>\n<2a00> <2aff> <2a00>\n<2b00> <2bff> <2b00>\n<2c00> <2cff> <2c00>\n<2d00> <2dff> <2d00>\n<2e00> <2eff> <2e00>\n<2f00> <2fff> <2f00>\n<3000> <30ff> <3000>\n<3100> <31ff> <3100>\n<3200> <32ff> <3200>\n<3300> <33ff> <3300>\n<3400> <34ff> <3400>\n<3500> <35ff> <3500>\n<3600> <36ff> <3600>\n<3700> <37ff> <3700>\n<3800> <38ff> <3800>\n<3900> <39ff> <3900>\n<3a00> <3aff> <3a00>\n<3b00> <3bff> <3b00>\n<3c00> <3cff> <3c00>\n<3d00> <3dff> <3d00>\n<3e00> <3eff> <3e00>\n<3f00> <3fff> <3f00>\n<4000> <40ff> <4000>\n<4100> <41ff> <4100>\n<4200> <42ff> <4200>\n<4300> <43ff> <4300>\n<4400> <44ff> <4400>\n<4500> <45ff> <4500>\n<4600> <46ff> <4600>\n<4700> <47ff> <4700>\n<4800> <48ff> <4800>\n<4900> <49ff> <4900>\n<4a00> <4aff> <4a00>\n<4b00> <4bff> <4b00>\n<4c00> <4cff> <4c00>\n<4d00> <4dff> <4d00>\n<4e00> <4eff> <4e00>\n<4f00> <4fff> <4f00>\n<5000> <50ff> <5000>\n<5100> <51ff> <5100>\n<5200> <52ff> <5200>\n<5300> <53ff> <5300>\n<5400> <54ff> <5400>\n<5500> <55ff> <5500>\n<5600> <56ff> <5600>\n<5700> <57ff> <5700>\n<5800> <58ff> <5800>\n<5900> <59ff> <5900>\n<5a00> <5aff> <5a00>\n<5b00> <5bff> <5b00>\n<5c00> <5cff> <5c00>\n<5d00> <5dff> <5d00>\n<5e00> <5eff> <5e00>\n<5f00> <5fff> <5f00>\n<6000> <60ff> <6000>\n<6100> <61ff> <6100>\n<6200> <62ff> <6200>\n<6300> <63ff> <6300>\nendbfrange\n100 beginbfrange\n<6400> <64ff> <6400>\n<6500> <65ff> <6500>\n<6600> <66ff> <6600>\n<6700> <67ff> <6700>\n<6800> <68ff> <6800>\n<6900> <69ff> <6900>\n<6a00> <6aff> <6a00>\n<6b00> <6bff> <6b00>\n<6c00> <6cff> <6c00>\n<6d00> <6dff> <6d00>\n<6e00> <6eff> <6e00>\n<6f00> <6fff> <6f00>\n<7000> <70ff> <7000>\n<7100> <71ff> <7100>\n<7200> <72ff> <7200>\n<7300> <73ff> <7300>\n<7400> <74ff> <7400>\n<7500> <75ff> <7500>\n<7600> <76ff> <7600>\n<7700> <77ff> <7700>\n<7800> <78ff> <7800>\n<7900> <79ff> <7900>\n<7a00> <7aff> <7a00>\n<7b00> <7bff> <7b00>\n<7c00> <7cff> <7c00>\n<7d00> <7dff> <7d00>\n<7e00> <7eff> <7e00>\n<7f00> <7fff> <7f00>\n<8000> <80ff> <8000>\n<8100> <81ff> <8100>\n<8200> <82ff> <8200>\n<8300> <83ff> <8300>\n<8400> <84ff> <8400>\n<8500> <85ff> <8500>\n<8600> <86ff> <8600>\n<8700> <87ff> <8700>\n<8800> <88ff> <8800>\n<8900> <89ff> <8900>\n<8a00> <8aff> <8a00>\n<8b00> <8bff> <8b00>\n<8c00> <8cff> <8c00>\n<8d00> <8dff> <8d00>\n<8e00> <8eff> <8e00>\n<8f00> <8fff> <8f00>\n<9000> <90ff> <9000>\n<9100> <91ff> <9100>\n<9200> <92ff> <9200>\n<9300> <93ff> <9300>\n<9400> <94ff> <9400>\n<9500> <95ff> <9500>\n<9600> <96ff> <9600>\n<9700> <97ff> <9700>\n<9800> <98ff> <9800>\n<9900> <99ff> <9900>\n<9a00> <9aff> <9a00>\n<9b00> <9bff> <9b00>\n<9c00> <9cff> <9c00>\n<9d00> <9dff> <9d00>\n<9e00> <9eff> <9e00>\n<9f00> <9fff> <9f00>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nendbfrange\n56 beginbfrange\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nendbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"; - -} // END OF TCPDF_FONT_DATA CLASS - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/#pma/libraries/tcpdf/include/tcpdf_fonts.php b/#pma/libraries/tcpdf/include/tcpdf_fonts.php deleted file mode 100644 index 70ca8939..00000000 --- a/#pma/libraries/tcpdf/include/tcpdf_fonts.php +++ /dev/null @@ -1,2649 +0,0 @@ -. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description :Font methods for TCPDF library. -// -//============================================================+ - -/** - * @file - * Unicode data and font methods for TCPDF library. - * @author Nicola Asuni - * @package com.tecnick.tcpdf - */ - -/** - * @class TCPDF_FONTS - * Font methods for TCPDF library. - * @package com.tecnick.tcpdf - * @version 1.1.0 - * @author Nicola Asuni - info@tecnick.com - */ -class TCPDF_FONTS { - - /** - * Static cache used for speed up uniord performances - * @protected - */ - protected static $cache_uniord = array(); - - /** - * Convert and add the selected TrueType or Type1 font to the fonts folder (that must be writeable). - * @param $fontfile (string) Font file (full path). - * @param $fonttype (string) Font type. Leave empty for autodetect mode. Valid values are: TrueTypeUnicode, TrueType, Type1, CID0JP = CID-0 Japanese, CID0KR = CID-0 Korean, CID0CS = CID-0 Chinese Simplified, CID0CT = CID-0 Chinese Traditional. - * @param $enc (string) Name of the encoding table to use. Leave empty for default mode. Omit this parameter for TrueType Unicode and symbolic fonts like Symbol or ZapfDingBats. - * @param $flags (int) Unsigned 32-bit integer containing flags specifying various characteristics of the font (PDF32000:2008 - 9.8.2 Font Descriptor Flags): +1 for fixed font; +4 for symbol or +32 for non-symbol; +64 for italic. Fixed and Italic mode are generally autodetected so you have to set it to 32 = non-symbolic font (default) or 4 = symbolic font. - * @param $outpath (string) Output path for generated font files (must be writeable by the web server). Leave empty for default font folder. - * @param $platid (int) Platform ID for CMAP table to extract (when building a Unicode font for Windows this value should be 3, for Macintosh should be 1). - * @param $encid (int) Encoding ID for CMAP table to extract (when building a Unicode font for Windows this value should be 1, for Macintosh should be 0). When Platform ID is 3, legal values for Encoding ID are: 0=Symbol, 1=Unicode, 2=ShiftJIS, 3=PRC, 4=Big5, 5=Wansung, 6=Johab, 7=Reserved, 8=Reserved, 9=Reserved, 10=UCS-4. - * @param $addcbbox (boolean) If true includes the character bounding box information on the php font file. - * @param $link (boolean) If true link to system font instead of copying the font data (not transportable) - Note: do not work with Type1 fonts. - * @return (string) TCPDF font name or boolean false in case of error. - * @author Nicola Asuni - * @since 5.9.123 (2010-09-30) - * @public static - */ - public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false, $link=false) { - if (!file_exists($fontfile)) { - // Could not find file - return false; - } - // font metrics - $fmetric = array(); - // build new font name for TCPDF compatibility - $font_path_parts = pathinfo($fontfile); - if (!isset($font_path_parts['filename'])) { - $font_path_parts['filename'] = substr($font_path_parts['basename'], 0, -(strlen($font_path_parts['extension']) + 1)); - } - $font_name = strtolower($font_path_parts['filename']); - $font_name = preg_replace('/[^a-z0-9_]/', '', $font_name); - $search = array('bold', 'oblique', 'italic', 'regular'); - $replace = array('b', 'i', 'i', ''); - $font_name = str_replace($search, $replace, $font_name); - if (empty($font_name)) { - // set generic name - $font_name = 'tcpdffont'; - } - // set output path - if (empty($outpath)) { - $outpath = self::_getfontpath(); - } - // check if this font already exist - if (@file_exists($outpath.$font_name.'.php')) { - // this font already exist (delete it from fonts folder to rebuild it) - return $font_name; - } - $fmetric['file'] = $font_name; - $fmetric['ctg'] = $font_name.'.ctg.z'; - // get font data - $font = file_get_contents($fontfile); - $fmetric['originalsize'] = strlen($font); - // autodetect font type - if (empty($fonttype)) { - if (TCPDF_STATIC::_getULONG($font, 0) == 0x10000) { - // True Type (Unicode or not) - $fonttype = 'TrueTypeUnicode'; - } elseif (substr($font, 0, 4) == 'OTTO') { - // Open Type (Unicode or not) - //Unsupported font format: OpenType with CFF data - return false; - } else { - // Type 1 - $fonttype = 'Type1'; - } - } - // set font type - switch ($fonttype) { - case 'CID0CT': - case 'CID0CS': - case 'CID0KR': - case 'CID0JP': { - $fmetric['type'] = 'cidfont0'; - break; - } - case 'Type1': { - $fmetric['type'] = 'Type1'; - if (empty($enc) AND (($flags & 4) == 0)) { - $enc = 'cp1252'; - } - break; - } - case 'TrueType': { - $fmetric['type'] = 'TrueType'; - break; - } - case 'TrueTypeUnicode': - default: { - $fmetric['type'] = 'TrueTypeUnicode'; - break; - } - } - // set encoding maps (if any) - $fmetric['enc'] = preg_replace('/[^A-Za-z0-9_\-]/', '', $enc); - $fmetric['diff'] = ''; - if (($fmetric['type'] == 'TrueType') OR ($fmetric['type'] == 'Type1')) { - if (!empty($enc) AND ($enc != 'cp1252') AND isset(TCPDF_FONT_DATA::$encmap[$enc])) { - // build differences from reference encoding - $enc_ref = TCPDF_FONT_DATA::$encmap['cp1252']; - $enc_target = TCPDF_FONT_DATA::$encmap[$enc]; - $last = 0; - for ($i = 32; $i <= 255; ++$i) { - if ($enc_target[$i] != $enc_ref[$i]) { - if ($i != ($last + 1)) { - $fmetric['diff'] .= $i.' '; - } - $last = $i; - $fmetric['diff'] .= '/'.$enc_target[$i].' '; - } - } - } - } - // parse the font by type - if ($fmetric['type'] == 'Type1') { - // ---------- TYPE 1 ---------- - // read first segment - $a = unpack('Cmarker/Ctype/Vsize', substr($font, 0, 6)); - if ($a['marker'] != 128) { - // Font file is not a valid binary Type1 - return false; - } - $fmetric['size1'] = $a['size']; - $data = substr($font, 6, $fmetric['size1']); - // read second segment - $a = unpack('Cmarker/Ctype/Vsize', substr($font, (6 + $fmetric['size1']), 6)); - if ($a['marker'] != 128) { - // Font file is not a valid binary Type1 - return false; - } - $fmetric['size2'] = $a['size']; - $encrypted = substr($font, (12 + $fmetric['size1']), $fmetric['size2']); - $data .= $encrypted; - // store compressed font - $fmetric['file'] .= '.z'; - $fp = TCPDF_STATIC::fopenLocal($outpath.$fmetric['file'], 'wb'); - fwrite($fp, gzcompress($data)); - fclose($fp); - // get font info - $fmetric['Flags'] = $flags; - preg_match ('#/FullName[\s]*\(([^\)]*)#', $font, $matches); - $fmetric['name'] = preg_replace('/[^a-zA-Z0-9_\-]/', '', $matches[1]); - preg_match('#/FontBBox[\s]*{([^}]*)#', $font, $matches); - $fmetric['bbox'] = trim($matches[1]); - $bv = explode(' ', $fmetric['bbox']); - $fmetric['Ascent'] = intval($bv[3]); - $fmetric['Descent'] = intval($bv[1]); - preg_match('#/ItalicAngle[\s]*([0-9\+\-]*)#', $font, $matches); - $fmetric['italicAngle'] = intval($matches[1]); - if ($fmetric['italicAngle'] != 0) { - $fmetric['Flags'] |= 64; - } - preg_match('#/UnderlinePosition[\s]*([0-9\+\-]*)#', $font, $matches); - $fmetric['underlinePosition'] = intval($matches[1]); - preg_match('#/UnderlineThickness[\s]*([0-9\+\-]*)#', $font, $matches); - $fmetric['underlineThickness'] = intval($matches[1]); - preg_match('#/isFixedPitch[\s]*([^\s]*)#', $font, $matches); - if ($matches[1] == 'true') { - $fmetric['Flags'] |= 1; - } - // get internal map - $imap = array(); - if (preg_match_all('#dup[\s]([0-9]+)[\s]*/([^\s]*)[\s]put#sU', $font, $fmap, PREG_SET_ORDER) > 0) { - foreach ($fmap as $v) { - $imap[$v[2]] = $v[1]; - } - } - // decrypt eexec encrypted part - $r = 55665; // eexec encryption constant - $c1 = 52845; - $c2 = 22719; - $elen = strlen($encrypted); - $eplain = ''; - for ($i = 0; $i < $elen; ++$i) { - $chr = ord($encrypted[$i]); - $eplain .= chr($chr ^ ($r >> 8)); - $r = ((($chr + $r) * $c1 + $c2) % 65536); - } - if (preg_match('#/ForceBold[\s]*([^\s]*)#', $eplain, $matches) > 0) { - if ($matches[1] == 'true') { - $fmetric['Flags'] |= 0x40000; - } - } - if (preg_match('#/StdVW[\s]*\[([^\]]*)#', $eplain, $matches) > 0) { - $fmetric['StemV'] = intval($matches[1]); - } else { - $fmetric['StemV'] = 70; - } - if (preg_match('#/StdHW[\s]*\[([^\]]*)#', $eplain, $matches) > 0) { - $fmetric['StemH'] = intval($matches[1]); - } else { - $fmetric['StemH'] = 30; - } - if (preg_match('#/BlueValues[\s]*\[([^\]]*)#', $eplain, $matches) > 0) { - $bv = explode(' ', $matches[1]); - if (count($bv) >= 6) { - $v1 = intval($bv[2]); - $v2 = intval($bv[4]); - if ($v1 <= $v2) { - $fmetric['XHeight'] = $v1; - $fmetric['CapHeight'] = $v2; - } else { - $fmetric['XHeight'] = $v2; - $fmetric['CapHeight'] = $v1; - } - } else { - $fmetric['XHeight'] = 450; - $fmetric['CapHeight'] = 700; - } - } else { - $fmetric['XHeight'] = 450; - $fmetric['CapHeight'] = 700; - } - // get the number of random bytes at the beginning of charstrings - if (preg_match('#/lenIV[\s]*([0-9]*)#', $eplain, $matches) > 0) { - $lenIV = intval($matches[1]); - } else { - $lenIV = 4; - } - $fmetric['Leading'] = 0; - // get charstring data - $eplain = substr($eplain, (strpos($eplain, '/CharStrings') + 1)); - preg_match_all('#/([A-Za-z0-9\.]*)[\s][0-9]+[\s]RD[\s](.*)[\s]ND#sU', $eplain, $matches, PREG_SET_ORDER); - if (!empty($enc) AND isset(TCPDF_FONT_DATA::$encmap[$enc])) { - $enc_map = TCPDF_FONT_DATA::$encmap[$enc]; - } else { - $enc_map = false; - } - $fmetric['cw'] = ''; - $fmetric['MaxWidth'] = 0; - $cwidths = array(); - foreach ($matches as $k => $v) { - $cid = 0; - if (isset($imap[$v[1]])) { - $cid = $imap[$v[1]]; - } elseif ($enc_map !== false) { - $cid = array_search($v[1], $enc_map); - if ($cid === false) { - $cid = 0; - } elseif ($cid > 1000) { - $cid -= 1000; - } - } - // decrypt charstring encrypted part - $r = 4330; // charstring encryption constant - $c1 = 52845; - $c2 = 22719; - $cd = $v[2]; - $clen = strlen($cd); - $ccom = array(); - for ($i = 0; $i < $clen; ++$i) { - $chr = ord($cd[$i]); - $ccom[] = ($chr ^ ($r >> 8)); - $r = ((($chr + $r) * $c1 + $c2) % 65536); - } - // decode numbers - $cdec = array(); - $ck = 0; - $i = $lenIV; - while ($i < $clen) { - if ($ccom[$i] < 32) { - $cdec[$ck] = $ccom[$i]; - if (($ck > 0) AND ($cdec[$ck] == 13)) { - // hsbw command: update width - $cwidths[$cid] = $cdec[($ck - 1)]; - } - ++$i; - } elseif (($ccom[$i] >= 32) AND ($ccom[$i] <= 246)) { - $cdec[$ck] = ($ccom[$i] - 139); - ++$i; - } elseif (($ccom[$i] >= 247) AND ($ccom[$i] <= 250)) { - $cdec[$ck] = ((($ccom[$i] - 247) * 256) + $ccom[($i + 1)] + 108); - $i += 2; - } elseif (($ccom[$i] >= 251) AND ($ccom[$i] <= 254)) { - $cdec[$ck] = ((-($ccom[$i] - 251) * 256) - $ccom[($i + 1)] - 108); - $i += 2; - } elseif ($ccom[$i] == 255) { - $sval = chr($ccom[($i + 1)]).chr($ccom[($i + 2)]).chr($ccom[($i + 3)]).chr($ccom[($i + 4)]); - $vsval = unpack('li', $sval); - $cdec[$ck] = $vsval['i']; - $i += 5; - } - ++$ck; - } - } // end for each matches - $fmetric['MissingWidth'] = $cwidths[0]; - $fmetric['MaxWidth'] = $fmetric['MissingWidth']; - $fmetric['AvgWidth'] = 0; - // set chars widths - for ($cid = 0; $cid <= 255; ++$cid) { - if (isset($cwidths[$cid])) { - if ($cwidths[$cid] > $fmetric['MaxWidth']) { - $fmetric['MaxWidth'] = $cwidths[$cid]; - } - $fmetric['AvgWidth'] += $cwidths[$cid]; - $fmetric['cw'] .= ','.$cid.'=>'.$cwidths[$cid]; - } else { - $fmetric['cw'] .= ','.$cid.'=>'.$fmetric['MissingWidth']; - } - } - $fmetric['AvgWidth'] = round($fmetric['AvgWidth'] / count($cwidths)); - } else { - // ---------- TRUE TYPE ---------- - $offset = 0; // offset position of the font data - if (TCPDF_STATIC::_getULONG($font, $offset) != 0x10000) { - // sfnt version must be 0x00010000 for TrueType version 1.0. - return false; - } - if ($fmetric['type'] != 'cidfont0') { - if ($link) { - // creates a symbolic link to the existing font - symlink($fontfile, $outpath.$fmetric['file']); - } else { - // store compressed font - $fmetric['file'] .= '.z'; - $fp = TCPDF_STATIC::fopenLocal($outpath.$fmetric['file'], 'wb'); - fwrite($fp, gzcompress($font)); - fclose($fp); - } - } - $offset += 4; - // get number of tables - $numTables = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - // skip searchRange, entrySelector and rangeShift - $offset += 6; - // tables array - $table = array(); - // ---------- get tables ---------- - for ($i = 0; $i < $numTables; ++$i) { - // get table info - $tag = substr($font, $offset, 4); - $offset += 4; - $table[$tag] = array(); - $table[$tag]['checkSum'] = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $table[$tag]['offset'] = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $table[$tag]['length'] = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - } - // check magicNumber - $offset = $table['head']['offset'] + 12; - if (TCPDF_STATIC::_getULONG($font, $offset) != 0x5F0F3CF5) { - // magicNumber must be 0x5F0F3CF5 - return false; - } - $offset += 4; - $offset += 2; // skip flags - // get FUnits - $fmetric['unitsPerEm'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - // units ratio constant - $urk = (1000 / $fmetric['unitsPerEm']); - $offset += 16; // skip created, modified - $xMin = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); - $offset += 2; - $yMin = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); - $offset += 2; - $xMax = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); - $offset += 2; - $yMax = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); - $offset += 2; - $fmetric['bbox'] = ''.$xMin.' '.$yMin.' '.$xMax.' '.$yMax.''; - $macStyle = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - // PDF font flags - $fmetric['Flags'] = $flags; - if (($macStyle & 2) == 2) { - // italic flag - $fmetric['Flags'] |= 64; - } - // get offset mode (indexToLocFormat : 0 = short, 1 = long) - $offset = $table['head']['offset'] + 50; - $short_offset = (TCPDF_STATIC::_getSHORT($font, $offset) == 0); - $offset += 2; - // get the offsets to the locations of the glyphs in the font, relative to the beginning of the glyphData table - $indexToLoc = array(); - $offset = $table['loca']['offset']; - if ($short_offset) { - // short version - $tot_num_glyphs = floor($table['loca']['length'] / 2); // numGlyphs + 1 - for ($i = 0; $i < $tot_num_glyphs; ++$i) { - $indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2; - if (isset($indexToLoc[($i - 1)]) && ($indexToLoc[$i] == $indexToLoc[($i - 1)])) { - // the last glyph didn't have an outline - unset($indexToLoc[($i - 1)]); - } - $offset += 2; - } - } else { - // long version - $tot_num_glyphs = floor($table['loca']['length'] / 4); // numGlyphs + 1 - for ($i = 0; $i < $tot_num_glyphs; ++$i) { - $indexToLoc[$i] = TCPDF_STATIC::_getULONG($font, $offset); - if (isset($indexToLoc[($i - 1)]) && ($indexToLoc[$i] == $indexToLoc[($i - 1)])) { - // the last glyph didn't have an outline - unset($indexToLoc[($i - 1)]); - } - $offset += 4; - } - } - // get glyphs indexes of chars from cmap table - $offset = $table['cmap']['offset'] + 2; - $numEncodingTables = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $encodingTables = array(); - for ($i = 0; $i < $numEncodingTables; ++$i) { - $encodingTables[$i]['platformID'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $encodingTables[$i]['encodingID'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $encodingTables[$i]['offset'] = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - } - // ---------- get os/2 metrics ---------- - $offset = $table['OS/2']['offset']; - $offset += 2; // skip version - // xAvgCharWidth - $fmetric['AvgWidth'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); - $offset += 2; - // usWeightClass - $usWeightClass = round(TCPDF_STATIC::_getUFWORD($font, $offset) * $urk); - // estimate StemV and StemH (400 = usWeightClass for Normal - Regular font) - $fmetric['StemV'] = round((70 * $usWeightClass) / 400); - $fmetric['StemH'] = round((30 * $usWeightClass) / 400); - $offset += 2; - $offset += 2; // usWidthClass - $fsType = TCPDF_STATIC::_getSHORT($font, $offset); - $offset += 2; - if ($fsType == 2) { - // This Font cannot be modified, embedded or exchanged in any manner without first obtaining permission of the legal owner. - return false; - } - // ---------- get font name ---------- - $fmetric['name'] = ''; - $offset = $table['name']['offset']; - $offset += 2; // skip Format selector (=0). - // Number of NameRecords that follow n. - $numNameRecords = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - // Offset to start of string storage (from start of table). - $stringStorageOffset = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - for ($i = 0; $i < $numNameRecords; ++$i) { - $offset += 6; // skip Platform ID, Platform-specific encoding ID, Language ID. - // Name ID. - $nameID = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - if ($nameID == 6) { - // String length (in bytes). - $stringLength = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - // String offset from start of storage area (in bytes). - $stringOffset = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $offset = ($table['name']['offset'] + $stringStorageOffset + $stringOffset); - $fmetric['name'] = substr($font, $offset, $stringLength); - $fmetric['name'] = preg_replace('/[^a-zA-Z0-9_\-]/', '', $fmetric['name']); - break; - } else { - $offset += 4; // skip String length, String offset - } - } - if (empty($fmetric['name'])) { - $fmetric['name'] = $font_name; - } - // ---------- get post data ---------- - $offset = $table['post']['offset']; - $offset += 4; // skip Format Type - $fmetric['italicAngle'] = TCPDF_STATIC::_getFIXED($font, $offset); - $offset += 4; - $fmetric['underlinePosition'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); - $offset += 2; - $fmetric['underlineThickness'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); - $offset += 2; - $isFixedPitch = (TCPDF_STATIC::_getULONG($font, $offset) == 0) ? false : true; - $offset += 2; - if ($isFixedPitch) { - $fmetric['Flags'] |= 1; - } - // ---------- get hhea data ---------- - $offset = $table['hhea']['offset']; - $offset += 4; // skip Table version number - // Ascender - $fmetric['Ascent'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); - $offset += 2; - // Descender - $fmetric['Descent'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); - $offset += 2; - // LineGap - $fmetric['Leading'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); - $offset += 2; - // advanceWidthMax - $fmetric['MaxWidth'] = round(TCPDF_STATIC::_getUFWORD($font, $offset) * $urk); - $offset += 2; - $offset += 22; // skip some values - // get the number of hMetric entries in hmtx table - $numberOfHMetrics = TCPDF_STATIC::_getUSHORT($font, $offset); - // ---------- get maxp data ---------- - $offset = $table['maxp']['offset']; - $offset += 4; // skip Table version number - // get the the number of glyphs in the font. - $numGlyphs = TCPDF_STATIC::_getUSHORT($font, $offset); - // ---------- get CIDToGIDMap ---------- - $ctg = array(); - foreach ($encodingTables as $enctable) { - // get only specified Platform ID and Encoding ID - if (($enctable['platformID'] == $platid) AND ($enctable['encodingID'] == $encid)) { - $offset = $table['cmap']['offset'] + $enctable['offset']; - $format = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - switch ($format) { - case 0: { // Format 0: Byte encoding table - $offset += 4; // skip length and version/language - for ($c = 0; $c < 256; ++$c) { - $g = TCPDF_STATIC::_getBYTE($font, $offset); - $ctg[$c] = $g; - ++$offset; - } - break; - } - case 2: { // Format 2: High-byte mapping through table - $offset += 4; // skip length and version/language - $numSubHeaders = 0; - for ($i = 0; $i < 256; ++$i) { - // Array that maps high bytes to subHeaders: value is subHeader index * 8. - $subHeaderKeys[$i] = (TCPDF_STATIC::_getUSHORT($font, $offset) / 8); - $offset += 2; - if ($numSubHeaders < $subHeaderKeys[$i]) { - $numSubHeaders = $subHeaderKeys[$i]; - } - } - // the number of subHeaders is equal to the max of subHeaderKeys + 1 - ++$numSubHeaders; - // read subHeader structures - $subHeaders = array(); - $numGlyphIndexArray = 0; - for ($k = 0; $k < $numSubHeaders; ++$k) { - $subHeaders[$k]['firstCode'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $subHeaders[$k]['entryCount'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $subHeaders[$k]['idDelta'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $subHeaders[$k]['idRangeOffset'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $subHeaders[$k]['idRangeOffset'] -= (2 + (($numSubHeaders - $k - 1) * 8)); - $subHeaders[$k]['idRangeOffset'] /= 2; - $numGlyphIndexArray += $subHeaders[$k]['entryCount']; - } - for ($k = 0; $k < $numGlyphIndexArray; ++$k) { - $glyphIndexArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - for ($i = 0; $i < 256; ++$i) { - $k = $subHeaderKeys[$i]; - if ($k == 0) { - // one byte code - $c = $i; - $g = $glyphIndexArray[0]; - $ctg[$c] = $g; - } else { - // two bytes code - $start_byte = $subHeaders[$k]['firstCode']; - $end_byte = $start_byte + $subHeaders[$k]['entryCount']; - for ($j = $start_byte; $j < $end_byte; ++$j) { - // combine high and low bytes - $c = (($i << 8) + $j); - $idRangeOffset = ($subHeaders[$k]['idRangeOffset'] + $j - $subHeaders[$k]['firstCode']); - $g = ($glyphIndexArray[$idRangeOffset] + $subHeaders[$k]['idDelta']) % 65536; - if ($g < 0) { - $g = 0; - } - $ctg[$c] = $g; - } - } - } - break; - } - case 4: { // Format 4: Segment mapping to delta values - $length = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $offset += 2; // skip version/language - $segCount = floor(TCPDF_STATIC::_getUSHORT($font, $offset) / 2); - $offset += 2; - $offset += 6; // skip searchRange, entrySelector, rangeShift - $endCount = array(); // array of end character codes for each segment - for ($k = 0; $k < $segCount; ++$k) { - $endCount[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - $offset += 2; // skip reservedPad - $startCount = array(); // array of start character codes for each segment - for ($k = 0; $k < $segCount; ++$k) { - $startCount[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - $idDelta = array(); // delta for all character codes in segment - for ($k = 0; $k < $segCount; ++$k) { - $idDelta[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - $idRangeOffset = array(); // Offsets into glyphIdArray or 0 - for ($k = 0; $k < $segCount; ++$k) { - $idRangeOffset[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - $gidlen = (floor($length / 2) - 8 - (4 * $segCount)); - $glyphIdArray = array(); // glyph index array - for ($k = 0; $k < $gidlen; ++$k) { - $glyphIdArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - for ($k = 0; $k < $segCount; ++$k) { - for ($c = $startCount[$k]; $c <= $endCount[$k]; ++$c) { - if ($idRangeOffset[$k] == 0) { - $g = ($idDelta[$k] + $c) % 65536; - } else { - $gid = (floor($idRangeOffset[$k] / 2) + ($c - $startCount[$k]) - ($segCount - $k)); - $g = ($glyphIdArray[$gid] + $idDelta[$k]) % 65536; - } - if ($g < 0) { - $g = 0; - } - $ctg[$c] = $g; - } - } - break; - } - case 6: { // Format 6: Trimmed table mapping - $offset += 4; // skip length and version/language - $firstCode = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $entryCount = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - for ($k = 0; $k < $entryCount; ++$k) { - $c = ($k + $firstCode); - $g = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $ctg[$c] = $g; - } - break; - } - case 8: { // Format 8: Mixed 16-bit and 32-bit coverage - $offset += 10; // skip reserved, length and version/language - for ($k = 0; $k < 8192; ++$k) { - $is32[$k] = TCPDF_STATIC::_getBYTE($font, $offset); - ++$offset; - } - $nGroups = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - for ($i = 0; $i < $nGroups; ++$i) { - $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $endCharCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $startGlyphID = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - for ($k = $startCharCode; $k <= $endCharCode; ++$k) { - $is32idx = floor($c / 8); - if ((isset($is32[$is32idx])) AND (($is32[$is32idx] & (1 << (7 - ($c % 8)))) == 0)) { - $c = $k; - } else { - // 32 bit format - // convert to decimal (http://www.unicode.org/faq//utf_bom.html#utf16-4) - //LEAD_OFFSET = (0xD800 - (0x10000 >> 10)) = 55232 - //SURROGATE_OFFSET = (0x10000 - (0xD800 << 10) - 0xDC00) = -56613888 - $c = ((55232 + ($k >> 10)) << 10) + (0xDC00 + ($k & 0x3FF)) -56613888; - } - $ctg[$c] = 0; - ++$startGlyphID; - } - } - break; - } - case 10: { // Format 10: Trimmed array - $offset += 10; // skip reserved, length and version/language - $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $numChars = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - for ($k = 0; $k < $numChars; ++$k) { - $c = ($k + $startCharCode); - $g = TCPDF_STATIC::_getUSHORT($font, $offset); - $ctg[$c] = $g; - $offset += 2; - } - break; - } - case 12: { // Format 12: Segmented coverage - $offset += 10; // skip length and version/language - $nGroups = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - for ($k = 0; $k < $nGroups; ++$k) { - $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $endCharCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $startGlyphCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - for ($c = $startCharCode; $c <= $endCharCode; ++$c) { - $ctg[$c] = $startGlyphCode; - ++$startGlyphCode; - } - } - break; - } - case 13: { // Format 13: Many-to-one range mappings - // to be implemented ... - break; - } - case 14: { // Format 14: Unicode Variation Sequences - // to be implemented ... - break; - } - } - } - } - if (!isset($ctg[0])) { - $ctg[0] = 0; - } - // get xHeight (height of x) - $offset = ($table['glyf']['offset'] + $indexToLoc[$ctg[120]] + 4); - $yMin = TCPDF_STATIC::_getFWORD($font, $offset); - $offset += 4; - $yMax = TCPDF_STATIC::_getFWORD($font, $offset); - $offset += 2; - $fmetric['XHeight'] = round(($yMax - $yMin) * $urk); - // get CapHeight (height of H) - $offset = ($table['glyf']['offset'] + $indexToLoc[$ctg[72]] + 4); - $yMin = TCPDF_STATIC::_getFWORD($font, $offset); - $offset += 4; - $yMax = TCPDF_STATIC::_getFWORD($font, $offset); - $offset += 2; - $fmetric['CapHeight'] = round(($yMax - $yMin) * $urk); - // ceate widths array - $cw = array(); - $offset = $table['hmtx']['offset']; - for ($i = 0 ; $i < $numberOfHMetrics; ++$i) { - $cw[$i] = round(TCPDF_STATIC::_getUFWORD($font, $offset) * $urk); - $offset += 4; // skip lsb - } - if ($numberOfHMetrics < $numGlyphs) { - // fill missing widths with the last value - $cw = array_pad($cw, $numGlyphs, $cw[($numberOfHMetrics - 1)]); - } - $fmetric['MissingWidth'] = $cw[0]; - $fmetric['cw'] = ''; - $fmetric['cbbox'] = ''; - for ($cid = 0; $cid <= 65535; ++$cid) { - if (isset($ctg[$cid])) { - if (isset($cw[$ctg[$cid]])) { - $fmetric['cw'] .= ','.$cid.'=>'.$cw[$ctg[$cid]]; - } - if ($addcbbox AND isset($indexToLoc[$ctg[$cid]])) { - $offset = ($table['glyf']['offset'] + $indexToLoc[$ctg[$cid]]); - $xMin = round(TCPDF_STATIC::_getFWORD($font, $offset + 2) * $urk); - $yMin = round(TCPDF_STATIC::_getFWORD($font, $offset + 4) * $urk); - $xMax = round(TCPDF_STATIC::_getFWORD($font, $offset + 6) * $urk); - $yMax = round(TCPDF_STATIC::_getFWORD($font, $offset + 8) * $urk); - $fmetric['cbbox'] .= ','.$cid.'=>array('.$xMin.','.$yMin.','.$xMax.','.$yMax.')'; - } - } - } - } // end of true type - if (($fmetric['type'] == 'TrueTypeUnicode') AND (count($ctg) == 256)) { - $fmetric['type'] = 'TrueType'; - } - // ---------- create php font file ---------- - $pfile = '<'.'?'.'php'."\n"; - $pfile .= '// TCPDF FONT FILE DESCRIPTION'."\n"; - $pfile .= '$type=\''.$fmetric['type'].'\';'."\n"; - $pfile .= '$name=\''.$fmetric['name'].'\';'."\n"; - $pfile .= '$up='.$fmetric['underlinePosition'].';'."\n"; - $pfile .= '$ut='.$fmetric['underlineThickness'].';'."\n"; - if ($fmetric['MissingWidth'] > 0) { - $pfile .= '$dw='.$fmetric['MissingWidth'].';'."\n"; - } else { - $pfile .= '$dw='.$fmetric['AvgWidth'].';'."\n"; - } - $pfile .= '$diff=\''.$fmetric['diff'].'\';'."\n"; - if ($fmetric['type'] == 'Type1') { - // Type 1 - $pfile .= '$enc=\''.$fmetric['enc'].'\';'."\n"; - $pfile .= '$file=\''.$fmetric['file'].'\';'."\n"; - $pfile .= '$size1='.$fmetric['size1'].';'."\n"; - $pfile .= '$size2='.$fmetric['size2'].';'."\n"; - } else { - $pfile .= '$originalsize='.$fmetric['originalsize'].';'."\n"; - if ($fmetric['type'] == 'cidfont0') { - // CID-0 - switch ($fonttype) { - case 'CID0JP': { - $pfile .= '// Japanese'."\n"; - $pfile .= '$enc=\'UniJIS-UTF16-H\';'."\n"; - $pfile .= '$cidinfo=array(\'Registry\'=>\'Adobe\', \'Ordering\'=>\'Japan1\',\'Supplement\'=>5);'."\n"; - $pfile .= 'include(dirname(__FILE__).\'/uni2cid_aj16.php\');'."\n"; - break; - } - case 'CID0KR': { - $pfile .= '// Korean'."\n"; - $pfile .= '$enc=\'UniKS-UTF16-H\';'."\n"; - $pfile .= '$cidinfo=array(\'Registry\'=>\'Adobe\', \'Ordering\'=>\'Korea1\',\'Supplement\'=>0);'."\n"; - $pfile .= 'include(dirname(__FILE__).\'/uni2cid_ak12.php\');'."\n"; - break; - } - case 'CID0CS': { - $pfile .= '// Chinese Simplified'."\n"; - $pfile .= '$enc=\'UniGB-UTF16-H\';'."\n"; - $pfile .= '$cidinfo=array(\'Registry\'=>\'Adobe\', \'Ordering\'=>\'GB1\',\'Supplement\'=>2);'."\n"; - $pfile .= 'include(dirname(__FILE__).\'/uni2cid_ag15.php\');'."\n"; - break; - } - case 'CID0CT': - default: { - $pfile .= '// Chinese Traditional'."\n"; - $pfile .= '$enc=\'UniCNS-UTF16-H\';'."\n"; - $pfile .= '$cidinfo=array(\'Registry\'=>\'Adobe\', \'Ordering\'=>\'CNS1\',\'Supplement\'=>0);'."\n"; - $pfile .= 'include(dirname(__FILE__).\'/uni2cid_aj16.php\');'."\n"; - break; - } - } - } else { - // TrueType - $pfile .= '$enc=\''.$fmetric['enc'].'\';'."\n"; - $pfile .= '$file=\''.$fmetric['file'].'\';'."\n"; - $pfile .= '$ctg=\''.$fmetric['ctg'].'\';'."\n"; - // create CIDToGIDMap - $cidtogidmap = str_pad('', 131072, "\x00"); // (256 * 256 * 2) = 131072 - foreach ($ctg as $cid => $gid) { - $cidtogidmap = self::updateCIDtoGIDmap($cidtogidmap, $cid, $ctg[$cid]); - } - // store compressed CIDToGIDMap - $fp = TCPDF_STATIC::fopenLocal($outpath.$fmetric['ctg'], 'wb'); - fwrite($fp, gzcompress($cidtogidmap)); - fclose($fp); - } - } - $pfile .= '$desc=array('; - $pfile .= '\'Flags\'=>'.$fmetric['Flags'].','; - $pfile .= '\'FontBBox\'=>\'['.$fmetric['bbox'].']\','; - $pfile .= '\'ItalicAngle\'=>'.$fmetric['italicAngle'].','; - $pfile .= '\'Ascent\'=>'.$fmetric['Ascent'].','; - $pfile .= '\'Descent\'=>'.$fmetric['Descent'].','; - $pfile .= '\'Leading\'=>'.$fmetric['Leading'].','; - $pfile .= '\'CapHeight\'=>'.$fmetric['CapHeight'].','; - $pfile .= '\'XHeight\'=>'.$fmetric['XHeight'].','; - $pfile .= '\'StemV\'=>'.$fmetric['StemV'].','; - $pfile .= '\'StemH\'=>'.$fmetric['StemH'].','; - $pfile .= '\'AvgWidth\'=>'.$fmetric['AvgWidth'].','; - $pfile .= '\'MaxWidth\'=>'.$fmetric['MaxWidth'].','; - $pfile .= '\'MissingWidth\'=>'.$fmetric['MissingWidth'].''; - $pfile .= ');'."\n"; - if (!empty($fmetric['cbbox'])) { - $pfile .= '$cbbox=array('.substr($fmetric['cbbox'], 1).');'."\n"; - } - $pfile .= '$cw=array('.substr($fmetric['cw'], 1).');'."\n"; - $pfile .= '// --- EOF ---'."\n"; - // store file - $fp = TCPDF_STATIC::fopenLocal($outpath.$font_name.'.php', 'w'); - fwrite($fp, $pfile); - fclose($fp); - // return TCPDF font name - return $font_name; - } - - /** - * Returs the checksum of a TTF table. - * @param $table (string) table to check - * @param $length (int) length of table in bytes - * @return int checksum - * @author Nicola Asuni - * @since 5.2.000 (2010-06-02) - * @public static - */ - public static function _getTTFtableChecksum($table, $length) { - $sum = 0; - $tlen = ($length / 4); - $offset = 0; - for ($i = 0; $i < $tlen; ++$i) { - $v = unpack('Ni', substr($table, $offset, 4)); - $sum += $v['i']; - $offset += 4; - } - $sum = unpack('Ni', pack('N', $sum)); - return $sum['i']; - } - - /** - * Returns a subset of the TrueType font data without the unused glyphs. - * @param $font (string) TrueType font data. - * @param $subsetchars (array) Array of used characters (the glyphs to keep). - * @return (string) A subset of TrueType font data without the unused glyphs. - * @author Nicola Asuni - * @since 5.2.000 (2010-06-02) - * @public static - */ - public static function _getTrueTypeFontSubset($font, $subsetchars) { - ksort($subsetchars); - $offset = 0; // offset position of the font data - if (TCPDF_STATIC::_getULONG($font, $offset) != 0x10000) { - // sfnt version must be 0x00010000 for TrueType version 1.0. - return $font; - } - $offset += 4; - // get number of tables - $numTables = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - // skip searchRange, entrySelector and rangeShift - $offset += 6; - // tables array - $table = array(); - // for each table - for ($i = 0; $i < $numTables; ++$i) { - // get table info - $tag = substr($font, $offset, 4); - $offset += 4; - $table[$tag] = array(); - $table[$tag]['checkSum'] = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $table[$tag]['offset'] = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $table[$tag]['length'] = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - } - // check magicNumber - $offset = $table['head']['offset'] + 12; - if (TCPDF_STATIC::_getULONG($font, $offset) != 0x5F0F3CF5) { - // magicNumber must be 0x5F0F3CF5 - return $font; - } - $offset += 4; - // get offset mode (indexToLocFormat : 0 = short, 1 = long) - $offset = $table['head']['offset'] + 50; - $short_offset = (TCPDF_STATIC::_getSHORT($font, $offset) == 0); - $offset += 2; - // get the offsets to the locations of the glyphs in the font, relative to the beginning of the glyphData table - $indexToLoc = array(); - $offset = $table['loca']['offset']; - if ($short_offset) { - // short version - $tot_num_glyphs = floor($table['loca']['length'] / 2); // numGlyphs + 1 - for ($i = 0; $i < $tot_num_glyphs; ++$i) { - $indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2; - $offset += 2; - } - } else { - // long version - $tot_num_glyphs = ($table['loca']['length'] / 4); // numGlyphs + 1 - for ($i = 0; $i < $tot_num_glyphs; ++$i) { - $indexToLoc[$i] = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - } - } - // get glyphs indexes of chars from cmap table - $subsetglyphs = array(); // glyph IDs on key - $subsetglyphs[0] = true; // character codes that do not correspond to any glyph in the font should be mapped to glyph index 0 - $offset = $table['cmap']['offset'] + 2; - $numEncodingTables = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $encodingTables = array(); - for ($i = 0; $i < $numEncodingTables; ++$i) { - $encodingTables[$i]['platformID'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $encodingTables[$i]['encodingID'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $encodingTables[$i]['offset'] = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - } - foreach ($encodingTables as $enctable) { - // get all platforms and encodings - $offset = $table['cmap']['offset'] + $enctable['offset']; - $format = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - switch ($format) { - case 0: { // Format 0: Byte encoding table - $offset += 4; // skip length and version/language - for ($c = 0; $c < 256; ++$c) { - if (isset($subsetchars[$c])) { - $g = TCPDF_STATIC::_getBYTE($font, $offset); - $subsetglyphs[$g] = true; - } - ++$offset; - } - break; - } - case 2: { // Format 2: High-byte mapping through table - $offset += 4; // skip length and version/language - $numSubHeaders = 0; - for ($i = 0; $i < 256; ++$i) { - // Array that maps high bytes to subHeaders: value is subHeader index * 8. - $subHeaderKeys[$i] = (TCPDF_STATIC::_getUSHORT($font, $offset) / 8); - $offset += 2; - if ($numSubHeaders < $subHeaderKeys[$i]) { - $numSubHeaders = $subHeaderKeys[$i]; - } - } - // the number of subHeaders is equal to the max of subHeaderKeys + 1 - ++$numSubHeaders; - // read subHeader structures - $subHeaders = array(); - $numGlyphIndexArray = 0; - for ($k = 0; $k < $numSubHeaders; ++$k) { - $subHeaders[$k]['firstCode'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $subHeaders[$k]['entryCount'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $subHeaders[$k]['idDelta'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $subHeaders[$k]['idRangeOffset'] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $subHeaders[$k]['idRangeOffset'] -= (2 + (($numSubHeaders - $k - 1) * 8)); - $subHeaders[$k]['idRangeOffset'] /= 2; - $numGlyphIndexArray += $subHeaders[$k]['entryCount']; - } - for ($k = 0; $k < $numGlyphIndexArray; ++$k) { - $glyphIndexArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - for ($i = 0; $i < 256; ++$i) { - $k = $subHeaderKeys[$i]; - if ($k == 0) { - // one byte code - $c = $i; - if (isset($subsetchars[$c])) { - $g = $glyphIndexArray[0]; - $subsetglyphs[$g] = true; - } - } else { - // two bytes code - $start_byte = $subHeaders[$k]['firstCode']; - $end_byte = $start_byte + $subHeaders[$k]['entryCount']; - for ($j = $start_byte; $j < $end_byte; ++$j) { - // combine high and low bytes - $c = (($i << 8) + $j); - if (isset($subsetchars[$c])) { - $idRangeOffset = ($subHeaders[$k]['idRangeOffset'] + $j - $subHeaders[$k]['firstCode']); - $g = ($glyphIndexArray[$idRangeOffset] + $subHeaders[$k]['idDelta']) % 65536; - if ($g < 0) { - $g = 0; - } - $subsetglyphs[$g] = true; - } - } - } - } - break; - } - case 4: { // Format 4: Segment mapping to delta values - $length = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $offset += 2; // skip version/language - $segCount = floor(TCPDF_STATIC::_getUSHORT($font, $offset) / 2); - $offset += 2; - $offset += 6; // skip searchRange, entrySelector, rangeShift - $endCount = array(); // array of end character codes for each segment - for ($k = 0; $k < $segCount; ++$k) { - $endCount[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - $offset += 2; // skip reservedPad - $startCount = array(); // array of start character codes for each segment - for ($k = 0; $k < $segCount; ++$k) { - $startCount[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - $idDelta = array(); // delta for all character codes in segment - for ($k = 0; $k < $segCount; ++$k) { - $idDelta[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - $idRangeOffset = array(); // Offsets into glyphIdArray or 0 - for ($k = 0; $k < $segCount; ++$k) { - $idRangeOffset[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - $gidlen = (floor($length / 2) - 8 - (4 * $segCount)); - $glyphIdArray = array(); // glyph index array - for ($k = 0; $k < $gidlen; ++$k) { - $glyphIdArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - } - for ($k = 0; $k < $segCount; ++$k) { - for ($c = $startCount[$k]; $c <= $endCount[$k]; ++$c) { - if (isset($subsetchars[$c])) { - if ($idRangeOffset[$k] == 0) { - $g = ($idDelta[$k] + $c) % 65536; - } else { - $gid = (floor($idRangeOffset[$k] / 2) + ($c - $startCount[$k]) - ($segCount - $k)); - $g = ($glyphIdArray[$gid] + $idDelta[$k]) % 65536; - } - if ($g < 0) { - $g = 0; - } - $subsetglyphs[$g] = true; - } - } - } - break; - } - case 6: { // Format 6: Trimmed table mapping - $offset += 4; // skip length and version/language - $firstCode = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $entryCount = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - for ($k = 0; $k < $entryCount; ++$k) { - $c = ($k + $firstCode); - if (isset($subsetchars[$c])) { - $g = TCPDF_STATIC::_getUSHORT($font, $offset); - $subsetglyphs[$g] = true; - } - $offset += 2; - } - break; - } - case 8: { // Format 8: Mixed 16-bit and 32-bit coverage - $offset += 10; // skip reserved, length and version/language - for ($k = 0; $k < 8192; ++$k) { - $is32[$k] = TCPDF_STATIC::_getBYTE($font, $offset); - ++$offset; - } - $nGroups = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - for ($i = 0; $i < $nGroups; ++$i) { - $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $endCharCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $startGlyphID = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - for ($k = $startCharCode; $k <= $endCharCode; ++$k) { - $is32idx = floor($c / 8); - if ((isset($is32[$is32idx])) AND (($is32[$is32idx] & (1 << (7 - ($c % 8)))) == 0)) { - $c = $k; - } else { - // 32 bit format - // convert to decimal (http://www.unicode.org/faq//utf_bom.html#utf16-4) - //LEAD_OFFSET = (0xD800 - (0x10000 >> 10)) = 55232 - //SURROGATE_OFFSET = (0x10000 - (0xD800 << 10) - 0xDC00) = -56613888 - $c = ((55232 + ($k >> 10)) << 10) + (0xDC00 + ($k & 0x3FF)) -56613888; - } - if (isset($subsetchars[$c])) { - $subsetglyphs[$startGlyphID] = true; - } - ++$startGlyphID; - } - } - break; - } - case 10: { // Format 10: Trimmed array - $offset += 10; // skip reserved, length and version/language - $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $numChars = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - for ($k = 0; $k < $numChars; ++$k) { - $c = ($k + $startCharCode); - if (isset($subsetchars[$c])) { - $g = TCPDF_STATIC::_getUSHORT($font, $offset); - $subsetglyphs[$g] = true; - } - $offset += 2; - } - break; - } - case 12: { // Format 12: Segmented coverage - $offset += 10; // skip length and version/language - $nGroups = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - for ($k = 0; $k < $nGroups; ++$k) { - $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $endCharCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - $startGlyphCode = TCPDF_STATIC::_getULONG($font, $offset); - $offset += 4; - for ($c = $startCharCode; $c <= $endCharCode; ++$c) { - if (isset($subsetchars[$c])) { - $subsetglyphs[$startGlyphCode] = true; - } - ++$startGlyphCode; - } - } - break; - } - case 13: { // Format 13: Many-to-one range mappings - // to be implemented ... - break; - } - case 14: { // Format 14: Unicode Variation Sequences - // to be implemented ... - break; - } - } - } - // include all parts of composite glyphs - $new_sga = $subsetglyphs; - while (!empty($new_sga)) { - $sga = $new_sga; - $new_sga = array(); - foreach ($sga as $key => $val) { - if (isset($indexToLoc[$key])) { - $offset = ($table['glyf']['offset'] + $indexToLoc[$key]); - $numberOfContours = TCPDF_STATIC::_getSHORT($font, $offset); - $offset += 2; - if ($numberOfContours < 0) { // composite glyph - $offset += 8; // skip xMin, yMin, xMax, yMax - do { - $flags = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - $glyphIndex = TCPDF_STATIC::_getUSHORT($font, $offset); - $offset += 2; - if (!isset($subsetglyphs[$glyphIndex])) { - // add missing glyphs - $new_sga[$glyphIndex] = true; - } - // skip some bytes by case - if ($flags & 1) { - $offset += 4; - } else { - $offset += 2; - } - if ($flags & 8) { - $offset += 2; - } elseif ($flags & 64) { - $offset += 4; - } elseif ($flags & 128) { - $offset += 8; - } - } while ($flags & 32); - } - } - } - $subsetglyphs += $new_sga; - } - // sort glyphs by key (and remove duplicates) - ksort($subsetglyphs); - // build new glyf and loca tables - $glyf = ''; - $loca = ''; - $offset = 0; - $glyf_offset = $table['glyf']['offset']; - for ($i = 0; $i < $tot_num_glyphs; ++$i) { - if (isset($subsetglyphs[$i])) { - $length = ($indexToLoc[($i + 1)] - $indexToLoc[$i]); - $glyf .= substr($font, ($glyf_offset + $indexToLoc[$i]), $length); - } else { - $length = 0; - } - if ($short_offset) { - $loca .= pack('n', floor($offset / 2)); - } else { - $loca .= pack('N', $offset); - } - $offset += $length; - } - // array of table names to preserve (loca and glyf tables will be added later) - // the cmap table is not needed and shall not be present, since the mapping from character codes to glyph descriptions is provided separately - $table_names = array ('head', 'hhea', 'hmtx', 'maxp', 'cvt ', 'fpgm', 'prep'); // minimum required table names - // get the tables to preserve - $offset = 12; - foreach ($table as $tag => $val) { - if (in_array($tag, $table_names)) { - $table[$tag]['data'] = substr($font, $table[$tag]['offset'], $table[$tag]['length']); - if ($tag == 'head') { - // set the checkSumAdjustment to 0 - $table[$tag]['data'] = substr($table[$tag]['data'], 0, 8)."\x0\x0\x0\x0".substr($table[$tag]['data'], 12); - } - $pad = 4 - ($table[$tag]['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table[$tag]['length'] += $pad; - $table[$tag]['data'] .= str_repeat("\x0", $pad); - } - $table[$tag]['offset'] = $offset; - $offset += $table[$tag]['length']; - // check sum is not changed (so keep the following line commented) - //$table[$tag]['checkSum'] = self::_getTTFtableChecksum($table[$tag]['data'], $table[$tag]['length']); - } else { - unset($table[$tag]); - } - } - // add loca - $table['loca']['data'] = $loca; - $table['loca']['length'] = strlen($loca); - $pad = 4 - ($table['loca']['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table['loca']['length'] += $pad; - $table['loca']['data'] .= str_repeat("\x0", $pad); - } - $table['loca']['offset'] = $offset; - $table['loca']['checkSum'] = self::_getTTFtableChecksum($table['loca']['data'], $table['loca']['length']); - $offset += $table['loca']['length']; - // add glyf - $table['glyf']['data'] = $glyf; - $table['glyf']['length'] = strlen($glyf); - $pad = 4 - ($table['glyf']['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table['glyf']['length'] += $pad; - $table['glyf']['data'] .= str_repeat("\x0", $pad); - } - $table['glyf']['offset'] = $offset; - $table['glyf']['checkSum'] = self::_getTTFtableChecksum($table['glyf']['data'], $table['glyf']['length']); - // rebuild font - $font = ''; - $font .= pack('N', 0x10000); // sfnt version - $numTables = count($table); - $font .= pack('n', $numTables); // numTables - $entrySelector = floor(log($numTables, 2)); - $searchRange = pow(2, $entrySelector) * 16; - $rangeShift = ($numTables * 16) - $searchRange; - $font .= pack('n', $searchRange); // searchRange - $font .= pack('n', $entrySelector); // entrySelector - $font .= pack('n', $rangeShift); // rangeShift - $offset = ($numTables * 16); - foreach ($table as $tag => $data) { - $font .= $tag; // tag - $font .= pack('N', $data['checkSum']); // checkSum - $font .= pack('N', ($data['offset'] + $offset)); // offset - $font .= pack('N', $data['length']); // length - } - foreach ($table as $data) { - $font .= $data['data']; - } - // set checkSumAdjustment on head table - $checkSumAdjustment = 0xB1B0AFBA - self::_getTTFtableChecksum($font, strlen($font)); - $font = substr($font, 0, $table['head']['offset'] + 8).pack('N', $checkSumAdjustment).substr($font, $table['head']['offset'] + 12); - return $font; - } - - /** - * Outputs font widths - * @param $font (array) font data - * @param $cidoffset (int) offset for CID values - * @return PDF command string for font widths - * @author Nicola Asuni - * @since 4.4.000 (2008-12-07) - * @public static - */ - public static function _putfontwidths($font, $cidoffset=0) { - ksort($font['cw']); - $rangeid = 0; - $range = array(); - $prevcid = -2; - $prevwidth = -1; - $interval = false; - // for each character - foreach ($font['cw'] as $cid => $width) { - $cid -= $cidoffset; - if ($font['subset'] AND (!isset($font['subsetchars'][$cid]))) { - // ignore the unused characters (font subsetting) - continue; - } - if ($width != $font['dw']) { - if ($cid == ($prevcid + 1)) { - // consecutive CID - if ($width == $prevwidth) { - if ($width == $range[$rangeid][0]) { - $range[$rangeid][] = $width; - } else { - array_pop($range[$rangeid]); - // new range - $rangeid = $prevcid; - $range[$rangeid] = array(); - $range[$rangeid][] = $prevwidth; - $range[$rangeid][] = $width; - } - $interval = true; - $range[$rangeid]['interval'] = true; - } else { - if ($interval) { - // new range - $rangeid = $cid; - $range[$rangeid] = array(); - $range[$rangeid][] = $width; - } else { - $range[$rangeid][] = $width; - } - $interval = false; - } - } else { - // new range - $rangeid = $cid; - $range[$rangeid] = array(); - $range[$rangeid][] = $width; - $interval = false; - } - $prevcid = $cid; - $prevwidth = $width; - } - } - // optimize ranges - $prevk = -1; - $nextk = -1; - $prevint = false; - foreach ($range as $k => $ws) { - $cws = count($ws); - if (($k == $nextk) AND (!$prevint) AND ((!isset($ws['interval'])) OR ($cws < 4))) { - if (isset($range[$k]['interval'])) { - unset($range[$k]['interval']); - } - $range[$prevk] = array_merge($range[$prevk], $range[$k]); - unset($range[$k]); - } else { - $prevk = $k; - } - $nextk = $k + $cws; - if (isset($ws['interval'])) { - if ($cws > 3) { - $prevint = true; - } else { - $prevint = false; - } - if (isset($range[$k]['interval'])) { - unset($range[$k]['interval']); - } - --$nextk; - } else { - $prevint = false; - } - } - // output data - $w = ''; - foreach ($range as $k => $ws) { - if (count(array_count_values($ws)) == 1) { - // interval mode is more compact - $w .= ' '.$k.' '.($k + count($ws) - 1).' '.$ws[0]; - } else { - // range mode - $w .= ' '.$k.' [ '.implode(' ', $ws).' ]'; - } - } - return '/W ['.$w.' ]'; - } - - - - - /** - * Update the CIDToGIDMap string with a new value. - * @param $map (string) CIDToGIDMap. - * @param $cid (int) CID value. - * @param $gid (int) GID value. - * @return (string) CIDToGIDMap. - * @author Nicola Asuni - * @since 5.9.123 (2011-09-29) - * @public static - */ - public static function updateCIDtoGIDmap($map, $cid, $gid) { - if (($cid >= 0) AND ($cid <= 0xFFFF) AND ($gid >= 0)) { - if ($gid > 0xFFFF) { - $gid -= 0x10000; - } - $map[($cid * 2)] = chr($gid >> 8); - $map[(($cid * 2) + 1)] = chr($gid & 0xFF); - } - return $map; - } - - /** - * Return fonts path - * @return string - * @public static - */ - public static function _getfontpath() { - if (!defined('K_PATH_FONTS') AND is_dir($fdir = realpath(dirname(__FILE__).'/../fonts'))) { - if (substr($fdir, -1) != '/') { - $fdir .= '/'; - } - define('K_PATH_FONTS', $fdir); - } - return defined('K_PATH_FONTS') ? K_PATH_FONTS : ''; - } - - - - /** - * Return font full path - * @param $file (string) Font file name. - * @param $fontdir (string) Font directory (set to false fto search on default directories) - * @return string Font full path or empty string - * @author Nicola Asuni - * @since 6.0.025 - * @public static - */ - public static function getFontFullPath($file, $fontdir=false) { - $fontfile = ''; - // search files on various directories - if (($fontdir !== false) AND @file_exists($fontdir.$file)) { - $fontfile = $fontdir.$file; - } elseif (@file_exists(self::_getfontpath().$file)) { - $fontfile = self::_getfontpath().$file; - } elseif (@file_exists($file)) { - $fontfile = $file; - } - return $fontfile; - } - - - - - /** - * Get a reference font size. - * @param $size (string) String containing font size value. - * @param $refsize (float) Reference font size in points. - * @return float value in points - * @public static - */ - public static function getFontRefSize($size, $refsize=12) { - switch ($size) { - case 'xx-small': { - $size = ($refsize - 4); - break; - } - case 'x-small': { - $size = ($refsize - 3); - break; - } - case 'small': { - $size = ($refsize - 2); - break; - } - case 'medium': { - $size = $refsize; - break; - } - case 'large': { - $size = ($refsize + 2); - break; - } - case 'x-large': { - $size = ($refsize + 4); - break; - } - case 'xx-large': { - $size = ($refsize + 6); - break; - } - case 'smaller': { - $size = ($refsize - 3); - break; - } - case 'larger': { - $size = ($refsize + 3); - break; - } - } - return $size; - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// ==================================================================================================================== -// REIMPLEMENTED -// ==================================================================================================================== - - - - - - - - - /** - * Returns the unicode caracter specified by the value - * @param $c (int) UTF-8 value - * @param $unicode (boolean) True if we are in unicode mode, false otherwise. - * @return Returns the specified character. - * @since 2.3.000 (2008-03-05) - * @public static - */ - public static function unichr($c, $unicode=true) { - if (!$unicode) { - return chr($c); - } elseif ($c <= 0x7F) { - // one byte - return chr($c); - } elseif ($c <= 0x7FF) { - // two bytes - return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); - } elseif ($c <= 0xFFFF) { - // three bytes - return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); - } elseif ($c <= 0x10FFFF) { - // four bytes - return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); - } else { - return ''; - } - } - - /** - * Returns the unicode caracter specified by UTF-8 value - * @param $c (int) UTF-8 value - * @return Returns the specified character. - * @public static - */ - public static function unichrUnicode($c) { - return self::unichr($c, true); - } - - /** - * Returns the unicode caracter specified by ASCII value - * @param $c (int) UTF-8 value - * @return Returns the specified character. - * @public static - */ - public static function unichrASCII($c) { - return self::unichr($c, false); - } - - /** - * Converts array of UTF-8 characters to UTF16-BE string.
    - * Based on: http://www.faqs.org/rfcs/rfc2781.html - *
    -	 *   Encoding UTF-16:
    -	 *
    -	 *   Encoding of a single character from an ISO 10646 character value to
    -	 *    UTF-16 proceeds as follows. Let U be the character number, no greater
    -	 *    than 0x10FFFF.
    -	 *
    -	 *    1) If U < 0x10000, encode U as a 16-bit unsigned integer and
    -	 *       terminate.
    -	 *
    -	 *    2) Let U' = U - 0x10000. Because U is less than or equal to 0x10FFFF,
    -	 *       U' must be less than or equal to 0xFFFFF. That is, U' can be
    -	 *       represented in 20 bits.
    -	 *
    -	 *    3) Initialize two 16-bit unsigned integers, W1 and W2, to 0xD800 and
    -	 *       0xDC00, respectively. These integers each have 10 bits free to
    -	 *       encode the character value, for a total of 20 bits.
    -	 *
    -	 *    4) Assign the 10 high-order bits of the 20-bit U' to the 10 low-order
    -	 *       bits of W1 and the 10 low-order bits of U' to the 10 low-order
    -	 *       bits of W2. Terminate.
    -	 *
    -	 *    Graphically, steps 2 through 4 look like:
    -	 *    U' = yyyyyyyyyyxxxxxxxxxx
    -	 *    W1 = 110110yyyyyyyyyy
    -	 *    W2 = 110111xxxxxxxxxx
    -	 * 
    - * @param $unicode (array) array containing UTF-8 unicode values - * @param $setbom (boolean) if true set the Byte Order Mark (BOM = 0xFEFF) - * @return string - * @protected - * @author Nicola Asuni - * @since 2.1.000 (2008-01-08) - * @public static - */ - public static function arrUTF8ToUTF16BE($unicode, $setbom=false) { - $outstr = ''; // string to be returned - if ($setbom) { - $outstr .= "\xFE\xFF"; // Byte Order Mark (BOM) - } - foreach ($unicode as $char) { - if ($char == 0x200b) { - // skip Unicode Character 'ZERO WIDTH SPACE' (DEC:8203, U+200B) - } elseif ($char == 0xFFFD) { - $outstr .= "\xFF\xFD"; // replacement character - } elseif ($char < 0x10000) { - $outstr .= chr($char >> 0x08); - $outstr .= chr($char & 0xFF); - } else { - $char -= 0x10000; - $w1 = 0xD800 | ($char >> 0x0a); - $w2 = 0xDC00 | ($char & 0x3FF); - $outstr .= chr($w1 >> 0x08); - $outstr .= chr($w1 & 0xFF); - $outstr .= chr($w2 >> 0x08); - $outstr .= chr($w2 & 0xFF); - } - } - return $outstr; - } - - /** - * Convert an array of UTF8 values to array of unicode characters - * @param $ta (array) The input array of UTF8 values. - * @param $isunicode (boolean) True for Unicode mode, false otherwise. - * @return Return array of unicode characters - * @since 4.5.037 (2009-04-07) - * @public static - */ - public static function UTF8ArrayToUniArray($ta, $isunicode=true) { - if ($isunicode) { - return array_map(array('TCPDF_FONTS', 'unichrUnicode'), $ta); - } - return array_map(array('TCPDF_FONTS', 'unichrASCII'), $ta); - } - - /** - * Extract a slice of the $strarr array and return it as string. - * @param $strarr (string) The input array of characters. - * @param $start (int) the starting element of $strarr. - * @param $end (int) first element that will not be returned. - * @param $unicode (boolean) True if we are in unicode mode, false otherwise. - * @return Return part of a string - * @public static - */ - public static function UTF8ArrSubString($strarr, $start='', $end='', $unicode=true) { - if (strlen($start) == 0) { - $start = 0; - } - if (strlen($end) == 0) { - $end = count($strarr); - } - $string = ''; - for ($i = $start; $i < $end; ++$i) { - $string .= self::unichr($strarr[$i], $unicode); - } - return $string; - } - - /** - * Extract a slice of the $uniarr array and return it as string. - * @param $uniarr (string) The input array of characters. - * @param $start (int) the starting element of $strarr. - * @param $end (int) first element that will not be returned. - * @return Return part of a string - * @since 4.5.037 (2009-04-07) - * @public static - */ - public static function UniArrSubString($uniarr, $start='', $end='') { - if (strlen($start) == 0) { - $start = 0; - } - if (strlen($end) == 0) { - $end = count($uniarr); - } - $string = ''; - for ($i=$start; $i < $end; ++$i) { - $string .= $uniarr[$i]; - } - return $string; - } - - /** - * Converts UTF-8 characters array to array of Latin1 characters array
    - * @param $unicode (array) array containing UTF-8 unicode values - * @return array - * @author Nicola Asuni - * @since 4.8.023 (2010-01-15) - * @public static - */ - public static function UTF8ArrToLatin1Arr($unicode) { - $outarr = array(); // array to be returned - foreach ($unicode as $char) { - if ($char < 256) { - $outarr[] = $char; - } elseif (array_key_exists($char, TCPDF_FONT_DATA::$uni_utf8tolatin)) { - // map from UTF-8 - $outarr[] = TCPDF_FONT_DATA::$uni_utf8tolatin[$char]; - } elseif ($char == 0xFFFD) { - // skip - } else { - $outarr[] = 63; // '?' character - } - } - return $outarr; - } - - /** - * Converts UTF-8 characters array to array of Latin1 string
    - * @param $unicode (array) array containing UTF-8 unicode values - * @return array - * @author Nicola Asuni - * @since 4.8.023 (2010-01-15) - * @public static - */ - public static function UTF8ArrToLatin1($unicode) { - $outstr = ''; // string to be returned - foreach ($unicode as $char) { - if ($char < 256) { - $outstr .= chr($char); - } elseif (array_key_exists($char, TCPDF_FONT_DATA::$uni_utf8tolatin)) { - // map from UTF-8 - $outstr .= chr(TCPDF_FONT_DATA::$uni_utf8tolatin[$char]); - } elseif ($char == 0xFFFD) { - // skip - } else { - $outstr .= '?'; - } - } - return $outstr; - } - - /** - * Converts UTF-8 character to integer value.
    - * Uses the getUniord() method if the value is not cached. - * @param $uch (string) character string to process. - * @return integer Unicode value - * @public static - */ - public static function uniord($uch) { - if (!isset(self::$cache_uniord[$uch])) { - self::$cache_uniord[$uch] = self::getUniord($uch); - } - return self::$cache_uniord[$uch]; - } - - /** - * Converts UTF-8 character to integer value.
    - * Invalid byte sequences will be replaced with 0xFFFD (replacement character)
    - * Based on: http://www.faqs.org/rfcs/rfc3629.html - *
    -	 *    Char. number range  |        UTF-8 octet sequence
    -	 *       (hexadecimal)    |              (binary)
    -	 *    --------------------+-----------------------------------------------
    -	 *    0000 0000-0000 007F | 0xxxxxxx
    -	 *    0000 0080-0000 07FF | 110xxxxx 10xxxxxx
    -	 *    0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
    -	 *    0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
    -	 *    ---------------------------------------------------------------------
    -	 *
    -	 *   ABFN notation:
    -	 *   ---------------------------------------------------------------------
    -	 *   UTF8-octets = *( UTF8-char )
    -	 *   UTF8-char   = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4
    -	 *   UTF8-1      = %x00-7F
    -	 *   UTF8-2      = %xC2-DF UTF8-tail
    -	 *
    -	 *   UTF8-3      = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
    -	 *                 %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
    -	 *   UTF8-4      = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
    -	 *                 %xF4 %x80-8F 2( UTF8-tail )
    -	 *   UTF8-tail   = %x80-BF
    -	 *   ---------------------------------------------------------------------
    -	 * 
    - * @param $uch (string) character string to process. - * @return integer Unicode value - * @author Nicola Asuni - * @public static - */ - public static function getUniord($uch) { - if (function_exists('mb_convert_encoding')) { - list(, $char) = @unpack('N', mb_convert_encoding($uch, 'UCS-4BE', 'UTF-8')); - if ($char >= 0) { - return $char; - } - } - $bytes = array(); // array containing single character byte sequences - $countbytes = 0; - $numbytes = 1; // number of octetc needed to represent the UTF-8 character - $length = strlen($uch); - for ($i = 0; $i < $length; ++$i) { - $char = ord($uch[$i]); // get one string character at time - if ($countbytes == 0) { // get starting octect - if ($char <= 0x7F) { - return $char; // use the character "as is" because is ASCII - } elseif (($char >> 0x05) == 0x06) { // 2 bytes character (0x06 = 110 BIN) - $bytes[] = ($char - 0xC0) << 0x06; - ++$countbytes; - $numbytes = 2; - } elseif (($char >> 0x04) == 0x0E) { // 3 bytes character (0x0E = 1110 BIN) - $bytes[] = ($char - 0xE0) << 0x0C; - ++$countbytes; - $numbytes = 3; - } elseif (($char >> 0x03) == 0x1E) { // 4 bytes character (0x1E = 11110 BIN) - $bytes[] = ($char - 0xF0) << 0x12; - ++$countbytes; - $numbytes = 4; - } else { - // use replacement character for other invalid sequences - return 0xFFFD; - } - } elseif (($char >> 0x06) == 0x02) { // bytes 2, 3 and 4 must start with 0x02 = 10 BIN - $bytes[] = $char - 0x80; - ++$countbytes; - if ($countbytes == $numbytes) { - // compose UTF-8 bytes to a single unicode value - $char = $bytes[0]; - for ($j = 1; $j < $numbytes; ++$j) { - $char += ($bytes[$j] << (($numbytes - $j - 1) * 0x06)); - } - if ((($char >= 0xD800) AND ($char <= 0xDFFF)) OR ($char >= 0x10FFFF)) { - // The definition of UTF-8 prohibits encoding character numbers between - // U+D800 and U+DFFF, which are reserved for use with the UTF-16 - // encoding form (as surrogate pairs) and do not directly represent - // characters. - return 0xFFFD; // use replacement character - } else { - return $char; - } - } - } else { - // use replacement character for other invalid sequences - return 0xFFFD; - } - } - return 0xFFFD; - } - - /** - * Converts UTF-8 strings to codepoints array.
    - * Invalid byte sequences will be replaced with 0xFFFD (replacement character)
    - * @param $str (string) string to process. - * @param $isunicode (boolean) True when the documetn is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. - * @return array containing codepoints (UTF-8 characters values) - * @author Nicola Asuni - * @public static - */ - public static function UTF8StringToArray($str, $isunicode=true, &$currentfont) { - if ($isunicode) { - // requires PCRE unicode support turned on - $chars = TCPDF_STATIC::pregSplit('//','u', $str, -1, PREG_SPLIT_NO_EMPTY); - $carr = array_map(array('TCPDF_FONTS', 'uniord'), $chars); - } else { - $chars = str_split($str); - $carr = array_map('ord', $chars); - } - $currentfont['subsetchars'] += array_fill_keys($carr, true); - return $carr; - } - - /** - * Converts UTF-8 strings to Latin1 when using the standard 14 core fonts.
    - * @param $str (string) string to process. - * @param $isunicode (boolean) True when the documetn is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. - * @return string - * @since 3.2.000 (2008-06-23) - * @public static - */ - public static function UTF8ToLatin1($str, $isunicode=true, &$currentfont) { - $unicode = self::UTF8StringToArray($str, $isunicode, $currentfont); // array containing UTF-8 unicode values - return self::UTF8ArrToLatin1($unicode); - } - - /** - * Converts UTF-8 strings to UTF16-BE.
    - * @param $str (string) string to process. - * @param $setbom (boolean) if true set the Byte Order Mark (BOM = 0xFEFF) - * @param $isunicode (boolean) True when the documetn is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. - * @return string - * @author Nicola Asuni - * @since 1.53.0.TC005 (2005-01-05) - * @public static - */ - public static function UTF8ToUTF16BE($str, $setbom=false, $isunicode=true, &$currentfont) { - if (!$isunicode) { - return $str; // string is not in unicode - } - $unicode = self::UTF8StringToArray($str, $isunicode, $currentfont); // array containing UTF-8 unicode values - return self::arrUTF8ToUTF16BE($unicode, $setbom); - } - - /** - * Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). - * @param $str (string) string to manipulate. - * @param $setbom (bool) if true set the Byte Order Mark (BOM = 0xFEFF) - * @param $forcertl (bool) if true forces RTL text direction - * @param $isunicode (boolean) True if the document is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. - * @return string - * @author Nicola Asuni - * @since 2.1.000 (2008-01-08) - * @public static - */ - public static function utf8StrRev($str, $setbom=false, $forcertl=false, $isunicode=true, &$currentfont) { - return self::utf8StrArrRev(self::UTF8StringToArray($str, $isunicode, $currentfont), $str, $setbom, $forcertl, $isunicode, $currentfont); - } - - /** - * Reverse the RLT substrings array using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). - * @param $arr (array) array of unicode values. - * @param $str (string) string to manipulate (or empty value). - * @param $setbom (bool) if true set the Byte Order Mark (BOM = 0xFEFF) - * @param $forcertl (bool) if true forces RTL text direction - * @param $isunicode (boolean) True if the document is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. - * @return string - * @author Nicola Asuni - * @since 4.9.000 (2010-03-27) - * @public static - */ - public static function utf8StrArrRev($arr, $str='', $setbom=false, $forcertl=false, $isunicode=true, &$currentfont) { - return self::arrUTF8ToUTF16BE(self::utf8Bidi($arr, $str, $forcertl, $isunicode, $currentfont), $setbom); - } - - /** - * Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). - * @param $ta (array) array of characters composing the string. - * @param $str (string) string to process - * @param $forcertl (bool) if 'R' forces RTL, if 'L' forces LTR - * @param $isunicode (boolean) True if the document is in Unicode mode, false otherwise. - * @param $currentfont (array) Reference to current font array. - * @return array of unicode chars - * @author Nicola Asuni - * @since 2.4.000 (2008-03-06) - * @public static - */ - public static function utf8Bidi($ta, $str='', $forcertl=false, $isunicode=true, &$currentfont) { - // paragraph embedding level - $pel = 0; - // max level - $maxlevel = 0; - if (TCPDF_STATIC::empty_string($str)) { - // create string from array - $str = self::UTF8ArrSubString($ta, '', '', $isunicode); - } - // check if string contains arabic text - if (preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_ARABIC, $str)) { - $arabic = true; - } else { - $arabic = false; - } - // check if string contains RTL text - if (!($forcertl OR $arabic OR preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_RTL, $str))) { - return $ta; - } - - // get number of chars - $numchars = count($ta); - - if ($forcertl == 'R') { - $pel = 1; - } elseif ($forcertl == 'L') { - $pel = 0; - } else { - // P2. In each paragraph, find the first character of type L, AL, or R. - // P3. If a character is found in P2 and it is of type AL or R, then set the paragraph embedding level to one; otherwise, set it to zero. - for ($i=0; $i < $numchars; ++$i) { - $type = TCPDF_FONT_DATA::$uni_type[$ta[$i]]; - if ($type == 'L') { - $pel = 0; - break; - } elseif (($type == 'AL') OR ($type == 'R')) { - $pel = 1; - break; - } - } - } - - // Current Embedding Level - $cel = $pel; - // directional override status - $dos = 'N'; - $remember = array(); - // start-of-level-run - $sor = $pel % 2 ? 'R' : 'L'; - $eor = $sor; - - // Array of characters data - $chardata = Array(); - - // X1. Begin by setting the current embedding level to the paragraph embedding level. Set the directional override status to neutral. Process each character iteratively, applying rules X2 through X9. Only embedding levels from 0 to 61 are valid in this phase. - // In the resolution of levels in rules I1 and I2, the maximum embedding level of 62 can be reached. - for ($i=0; $i < $numchars; ++$i) { - if ($ta[$i] == TCPDF_FONT_DATA::$uni_RLE) { - // X2. With each RLE, compute the least greater odd embedding level. - // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to neutral. - // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. - $next_level = $cel + ($cel % 2) + 1; - if ($next_level < 62) { - $remember[] = array('num' => TCPDF_FONT_DATA::$uni_RLE, 'cel' => $cel, 'dos' => $dos); - $cel = $next_level; - $dos = 'N'; - $sor = $eor; - $eor = $cel % 2 ? 'R' : 'L'; - } - } elseif ($ta[$i] == TCPDF_FONT_DATA::$uni_LRE) { - // X3. With each LRE, compute the least greater even embedding level. - // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to neutral. - // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. - $next_level = $cel + 2 - ($cel % 2); - if ( $next_level < 62 ) { - $remember[] = array('num' => TCPDF_FONT_DATA::$uni_LRE, 'cel' => $cel, 'dos' => $dos); - $cel = $next_level; - $dos = 'N'; - $sor = $eor; - $eor = $cel % 2 ? 'R' : 'L'; - } - } elseif ($ta[$i] == TCPDF_FONT_DATA::$uni_RLO) { - // X4. With each RLO, compute the least greater odd embedding level. - // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to right-to-left. - // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. - $next_level = $cel + ($cel % 2) + 1; - if ($next_level < 62) { - $remember[] = array('num' => TCPDF_FONT_DATA::$uni_RLO, 'cel' => $cel, 'dos' => $dos); - $cel = $next_level; - $dos = 'R'; - $sor = $eor; - $eor = $cel % 2 ? 'R' : 'L'; - } - } elseif ($ta[$i] == TCPDF_FONT_DATA::$uni_LRO) { - // X5. With each LRO, compute the least greater even embedding level. - // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to left-to-right. - // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. - $next_level = $cel + 2 - ($cel % 2); - if ( $next_level < 62 ) { - $remember[] = array('num' => TCPDF_FONT_DATA::$uni_LRO, 'cel' => $cel, 'dos' => $dos); - $cel = $next_level; - $dos = 'L'; - $sor = $eor; - $eor = $cel % 2 ? 'R' : 'L'; - } - } elseif ($ta[$i] == TCPDF_FONT_DATA::$uni_PDF) { - // X7. With each PDF, determine the matching embedding or override code. If there was a valid matching code, restore (pop) the last remembered (pushed) embedding level and directional override. - if (count($remember)) { - $last = count($remember ) - 1; - if (($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_RLE) OR - ($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_LRE) OR - ($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_RLO) OR - ($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_LRO)) { - $match = array_pop($remember); - $cel = $match['cel']; - $dos = $match['dos']; - $sor = $eor; - $eor = ($cel > $match['cel'] ? $cel : $match['cel']) % 2 ? 'R' : 'L'; - } - } - } elseif (($ta[$i] != TCPDF_FONT_DATA::$uni_RLE) AND - ($ta[$i] != TCPDF_FONT_DATA::$uni_LRE) AND - ($ta[$i] != TCPDF_FONT_DATA::$uni_RLO) AND - ($ta[$i] != TCPDF_FONT_DATA::$uni_LRO) AND - ($ta[$i] != TCPDF_FONT_DATA::$uni_PDF)) { - // X6. For all types besides RLE, LRE, RLO, LRO, and PDF: - // a. Set the level of the current character to the current embedding level. - // b. Whenever the directional override status is not neutral, reset the current character type to the directional override status. - if ($dos != 'N') { - $chardir = $dos; - } else { - if (isset(TCPDF_FONT_DATA::$uni_type[$ta[$i]])) { - $chardir = TCPDF_FONT_DATA::$uni_type[$ta[$i]]; - } else { - $chardir = 'L'; - } - } - // stores string characters and other information - $chardata[] = array('char' => $ta[$i], 'level' => $cel, 'type' => $chardir, 'sor' => $sor, 'eor' => $eor); - } - } // end for each char - - // X8. All explicit directional embeddings and overrides are completely terminated at the end of each paragraph. Paragraph separators are not included in the embedding. - // X9. Remove all RLE, LRE, RLO, LRO, PDF, and BN codes. - // X10. The remaining rules are applied to each run of characters at the same level. For each run, determine the start-of-level-run (sor) and end-of-level-run (eor) type, either L or R. This depends on the higher of the two levels on either side of the boundary (at the start or end of the paragraph, the level of the 'other' run is the base embedding level). If the higher level is odd, the type is R; otherwise, it is L. - - // 3.3.3 Resolving Weak Types - // Weak types are now resolved one level run at a time. At level run boundaries where the type of the character on the other side of the boundary is required, the type assigned to sor or eor is used. - // Nonspacing marks are now resolved based on the previous characters. - $numchars = count($chardata); - - // W1. Examine each nonspacing mark (NSM) in the level run, and change the type of the NSM to the type of the previous character. If the NSM is at the start of the level run, it will get the type of sor. - $prevlevel = -1; // track level changes - $levcount = 0; // counts consecutive chars at the same level - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['type'] == 'NSM') { - if ($levcount) { - $chardata[$i]['type'] = $chardata[$i]['sor']; - } elseif ($i > 0) { - $chardata[$i]['type'] = $chardata[($i-1)]['type']; - } - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // W2. Search backward from each instance of a European number until the first strong type (R, L, AL, or sor) is found. If an AL is found, change the type of the European number to Arabic number. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['char'] == 'EN') { - for ($j=$levcount; $j >= 0; $j--) { - if ($chardata[$j]['type'] == 'AL') { - $chardata[$i]['type'] = 'AN'; - } elseif (($chardata[$j]['type'] == 'L') OR ($chardata[$j]['type'] == 'R')) { - break; - } - } - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // W3. Change all ALs to R. - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['type'] == 'AL') { - $chardata[$i]['type'] = 'R'; - } - } - - // W4. A single European separator between two European numbers changes to a European number. A single common separator between two numbers of the same type changes to that type. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if (($levcount > 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { - if (($chardata[$i]['type'] == 'ES') AND ($chardata[($i-1)]['type'] == 'EN') AND ($chardata[($i+1)]['type'] == 'EN')) { - $chardata[$i]['type'] = 'EN'; - } elseif (($chardata[$i]['type'] == 'CS') AND ($chardata[($i-1)]['type'] == 'EN') AND ($chardata[($i+1)]['type'] == 'EN')) { - $chardata[$i]['type'] = 'EN'; - } elseif (($chardata[$i]['type'] == 'CS') AND ($chardata[($i-1)]['type'] == 'AN') AND ($chardata[($i+1)]['type'] == 'AN')) { - $chardata[$i]['type'] = 'AN'; - } - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // W5. A sequence of European terminators adjacent to European numbers changes to all European numbers. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['type'] == 'ET') { - if (($levcount > 0) AND ($chardata[($i-1)]['type'] == 'EN')) { - $chardata[$i]['type'] = 'EN'; - } else { - $j = $i+1; - while (($j < $numchars) AND ($chardata[$j]['level'] == $prevlevel)) { - if ($chardata[$j]['type'] == 'EN') { - $chardata[$i]['type'] = 'EN'; - break; - } elseif ($chardata[$j]['type'] != 'ET') { - break; - } - ++$j; - } - } - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // W6. Otherwise, separators and terminators change to Other Neutral. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if (($chardata[$i]['type'] == 'ET') OR ($chardata[$i]['type'] == 'ES') OR ($chardata[$i]['type'] == 'CS')) { - $chardata[$i]['type'] = 'ON'; - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - //W7. Search backward from each instance of a European number until the first strong type (R, L, or sor) is found. If an L is found, then change the type of the European number to L. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['char'] == 'EN') { - for ($j=$levcount; $j >= 0; $j--) { - if ($chardata[$j]['type'] == 'L') { - $chardata[$i]['type'] = 'L'; - } elseif ($chardata[$j]['type'] == 'R') { - break; - } - } - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // N1. A sequence of neutrals takes the direction of the surrounding strong text if the text on both sides has the same direction. European and Arabic numbers act as if they were R in terms of their influence on neutrals. Start-of-level-run (sor) and end-of-level-run (eor) are used at level run boundaries. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if (($levcount > 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { - if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) { - $chardata[$i]['type'] = 'L'; - } elseif (($chardata[$i]['type'] == 'N') AND - (($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND - (($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) { - $chardata[$i]['type'] = 'R'; - } elseif ($chardata[$i]['type'] == 'N') { - // N2. Any remaining neutrals take the embedding direction - $chardata[$i]['type'] = $chardata[$i]['sor']; - } - } elseif (($levcount == 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { - // first char - if (($chardata[$i]['type'] == 'N') AND ($chardata[$i]['sor'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) { - $chardata[$i]['type'] = 'L'; - } elseif (($chardata[$i]['type'] == 'N') AND - (($chardata[$i]['sor'] == 'R') OR ($chardata[$i]['sor'] == 'EN') OR ($chardata[$i]['sor'] == 'AN')) AND - (($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) { - $chardata[$i]['type'] = 'R'; - } elseif ($chardata[$i]['type'] == 'N') { - // N2. Any remaining neutrals take the embedding direction - $chardata[$i]['type'] = $chardata[$i]['sor']; - } - } elseif (($levcount > 0) AND ((($i+1) == $numchars) OR (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] != $prevlevel))) { - //last char - if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[$i]['eor'] == 'L')) { - $chardata[$i]['type'] = 'L'; - } elseif (($chardata[$i]['type'] == 'N') AND - (($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND - (($chardata[$i]['eor'] == 'R') OR ($chardata[$i]['eor'] == 'EN') OR ($chardata[$i]['eor'] == 'AN'))) { - $chardata[$i]['type'] = 'R'; - } elseif ($chardata[$i]['type'] == 'N') { - // N2. Any remaining neutrals take the embedding direction - $chardata[$i]['type'] = $chardata[$i]['sor']; - } - } elseif ($chardata[$i]['type'] == 'N') { - // N2. Any remaining neutrals take the embedding direction - $chardata[$i]['type'] = $chardata[$i]['sor']; - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // I1. For all characters with an even (left-to-right) embedding direction, those of type R go up one level and those of type AN or EN go up two levels. - // I2. For all characters with an odd (right-to-left) embedding direction, those of type L, EN or AN go up one level. - for ($i=0; $i < $numchars; ++$i) { - $odd = $chardata[$i]['level'] % 2; - if ($odd) { - if (($chardata[$i]['type'] == 'L') OR ($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')) { - $chardata[$i]['level'] += 1; - } - } else { - if ($chardata[$i]['type'] == 'R') { - $chardata[$i]['level'] += 1; - } elseif (($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')) { - $chardata[$i]['level'] += 2; - } - } - $maxlevel = max($chardata[$i]['level'],$maxlevel); - } - - // L1. On each line, reset the embedding level of the following characters to the paragraph embedding level: - // 1. Segment separators, - // 2. Paragraph separators, - // 3. Any sequence of whitespace characters preceding a segment separator or paragraph separator, and - // 4. Any sequence of white space characters at the end of the line. - for ($i=0; $i < $numchars; ++$i) { - if (($chardata[$i]['type'] == 'B') OR ($chardata[$i]['type'] == 'S')) { - $chardata[$i]['level'] = $pel; - } elseif ($chardata[$i]['type'] == 'WS') { - $j = $i+1; - while ($j < $numchars) { - if ((($chardata[$j]['type'] == 'B') OR ($chardata[$j]['type'] == 'S')) OR - (($j == ($numchars-1)) AND ($chardata[$j]['type'] == 'WS'))) { - $chardata[$i]['level'] = $pel; - break; - } elseif ($chardata[$j]['type'] != 'WS') { - break; - } - ++$j; - } - } - } - - // Arabic Shaping - // Cursively connected scripts, such as Arabic or Syriac, require the selection of positional character shapes that depend on adjacent characters. Shaping is logically applied after the Bidirectional Algorithm is used and is limited to characters within the same directional run. - if ($arabic) { - $endedletter = array(1569,1570,1571,1572,1573,1575,1577,1583,1584,1585,1586,1608,1688); - $alfletter = array(1570,1571,1573,1575); - $chardata2 = $chardata; - $laaletter = false; - $charAL = array(); - $x = 0; - for ($i=0; $i < $numchars; ++$i) { - if ((TCPDF_FONT_DATA::$uni_type[$chardata[$i]['char']] == 'AL') OR ($chardata[$i]['char'] == 32) OR ($chardata[$i]['char'] == 8204)) { - $charAL[$x] = $chardata[$i]; - $charAL[$x]['i'] = $i; - $chardata[$i]['x'] = $x; - ++$x; - } - } - $numAL = $x; - for ($i=0; $i < $numchars; ++$i) { - $thischar = $chardata[$i]; - if ($i > 0) { - $prevchar = $chardata[($i-1)]; - } else { - $prevchar = false; - } - if (($i+1) < $numchars) { - $nextchar = $chardata[($i+1)]; - } else { - $nextchar = false; - } - if (TCPDF_FONT_DATA::$uni_type[$thischar['char']] == 'AL') { - $x = $thischar['x']; - if ($x > 0) { - $prevchar = $charAL[($x-1)]; - } else { - $prevchar = false; - } - if (($x+1) < $numAL) { - $nextchar = $charAL[($x+1)]; - } else { - $nextchar = false; - } - // if laa letter - if (($prevchar !== false) AND ($prevchar['char'] == 1604) AND (in_array($thischar['char'], $alfletter))) { - $arabicarr = TCPDF_FONT_DATA::$uni_laa_array; - $laaletter = true; - if ($x > 1) { - $prevchar = $charAL[($x-2)]; - } else { - $prevchar = false; - } - } else { - $arabicarr = TCPDF_FONT_DATA::$uni_arabicsubst; - $laaletter = false; - } - if (($prevchar !== false) AND ($nextchar !== false) AND - ((TCPDF_FONT_DATA::$uni_type[$prevchar['char']] == 'AL') OR (TCPDF_FONT_DATA::$uni_type[$prevchar['char']] == 'NSM')) AND - ((TCPDF_FONT_DATA::$uni_type[$nextchar['char']] == 'AL') OR (TCPDF_FONT_DATA::$uni_type[$nextchar['char']] == 'NSM')) AND - ($prevchar['type'] == $thischar['type']) AND - ($nextchar['type'] == $thischar['type']) AND - ($nextchar['char'] != 1567)) { - if (in_array($prevchar['char'], $endedletter)) { - if (isset($arabicarr[$thischar['char']][2])) { - // initial - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][2]; - } - } else { - if (isset($arabicarr[$thischar['char']][3])) { - // medial - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][3]; - } - } - } elseif (($nextchar !== false) AND - ((TCPDF_FONT_DATA::$uni_type[$nextchar['char']] == 'AL') OR (TCPDF_FONT_DATA::$uni_type[$nextchar['char']] == 'NSM')) AND - ($nextchar['type'] == $thischar['type']) AND - ($nextchar['char'] != 1567)) { - if (isset($arabicarr[$chardata[$i]['char']][2])) { - // initial - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][2]; - } - } elseif ((($prevchar !== false) AND - ((TCPDF_FONT_DATA::$uni_type[$prevchar['char']] == 'AL') OR (TCPDF_FONT_DATA::$uni_type[$prevchar['char']] == 'NSM')) AND - ($prevchar['type'] == $thischar['type'])) OR - (($nextchar !== false) AND ($nextchar['char'] == 1567))) { - // final - if (($i > 1) AND ($thischar['char'] == 1607) AND - ($chardata[$i-1]['char'] == 1604) AND - ($chardata[$i-2]['char'] == 1604)) { - //Allah Word - // mark characters to delete with false - $chardata2[$i-2]['char'] = false; - $chardata2[$i-1]['char'] = false; - $chardata2[$i]['char'] = 65010; - } else { - if (($prevchar !== false) AND in_array($prevchar['char'], $endedletter)) { - if (isset($arabicarr[$thischar['char']][0])) { - // isolated - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][0]; - } - } else { - if (isset($arabicarr[$thischar['char']][1])) { - // final - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][1]; - } - } - } - } elseif (isset($arabicarr[$thischar['char']][0])) { - // isolated - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][0]; - } - // if laa letter - if ($laaletter) { - // mark characters to delete with false - $chardata2[($charAL[($x-1)]['i'])]['char'] = false; - } - } // end if AL (Arabic Letter) - } // end for each char - /* - * Combining characters that can occur with Arabic Shadda (0651 HEX, 1617 DEC) are replaced. - * Putting the combining mark and shadda in the same glyph allows us to avoid the two marks overlapping each other in an illegible manner. - */ - for ($i = 0; $i < ($numchars-1); ++$i) { - if (($chardata2[$i]['char'] == 1617) AND (isset(TCPDF_FONT_DATA::$uni_diacritics[($chardata2[$i+1]['char'])]))) { - // check if the subtitution font is defined on current font - if (isset($currentfont['cw'][(TCPDF_FONT_DATA::$uni_diacritics[($chardata2[$i+1]['char'])])])) { - $chardata2[$i]['char'] = false; - $chardata2[$i+1]['char'] = TCPDF_FONT_DATA::$uni_diacritics[($chardata2[$i+1]['char'])]; - } - } - } - // remove marked characters - foreach ($chardata2 as $key => $value) { - if ($value['char'] === false) { - unset($chardata2[$key]); - } - } - $chardata = array_values($chardata2); - $numchars = count($chardata); - unset($chardata2); - unset($arabicarr); - unset($laaletter); - unset($charAL); - } - - // L2. From the highest level found in the text to the lowest odd level on each line, including intermediate levels not actually present in the text, reverse any contiguous sequence of characters that are at that level or higher. - for ($j=$maxlevel; $j > 0; $j--) { - $ordarray = Array(); - $revarr = Array(); - $onlevel = false; - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['level'] >= $j) { - $onlevel = true; - if (isset(TCPDF_FONT_DATA::$uni_mirror[$chardata[$i]['char']])) { - // L4. A character is depicted by a mirrored glyph if and only if (a) the resolved directionality of that character is R, and (b) the Bidi_Mirrored property value of that character is true. - $chardata[$i]['char'] = TCPDF_FONT_DATA::$uni_mirror[$chardata[$i]['char']]; - } - $revarr[] = $chardata[$i]; - } else { - if ($onlevel) { - $revarr = array_reverse($revarr); - $ordarray = array_merge($ordarray, $revarr); - $revarr = Array(); - $onlevel = false; - } - $ordarray[] = $chardata[$i]; - } - } - if ($onlevel) { - $revarr = array_reverse($revarr); - $ordarray = array_merge($ordarray, $revarr); - } - $chardata = $ordarray; - } - $ordarray = array(); - foreach ($chardata as $cd) { - $ordarray[] = $cd['char']; - // store char values for subsetting - $currentfont['subsetchars'][$cd['char']] = true; - } - return $ordarray; - } - -} // END OF TCPDF_FONTS CLASS - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/#pma/libraries/tcpdf/include/tcpdf_images.php b/#pma/libraries/tcpdf/include/tcpdf_images.php deleted file mode 100644 index c2e3c36f..00000000 --- a/#pma/libraries/tcpdf/include/tcpdf_images.php +++ /dev/null @@ -1,364 +0,0 @@ -. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : -// Static image methods used by the TCPDF class. -// -//============================================================+ - -/** - * @file - * This is a PHP class that contains static image methods for the TCPDF class.
    - * @package com.tecnick.tcpdf - * @author Nicola Asuni - * @version 1.0.005 - */ - -/** - * @class TCPDF_IMAGES - * Static image methods used by the TCPDF class. - * @package com.tecnick.tcpdf - * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 1.0.005 - * @author Nicola Asuni - info@tecnick.com - */ -class TCPDF_IMAGES { - - /** - * Array of hinheritable SVG properties. - * @since 5.0.000 (2010-05-02) - * @public static - */ - public static $svginheritprop = array('clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cursor', 'direction', 'display', 'fill', 'fill-opacity', 'fill-rule', 'font', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'image-rendering', 'kerning', 'letter-spacing', 'marker', 'marker-end', 'marker-mid', 'marker-start', 'pointer-events', 'shape-rendering', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-rendering', 'visibility', 'word-spacing', 'writing-mode'); - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * Return the image type given the file name or array returned by getimagesize() function. - * @param $imgfile (string) image file name - * @param $iminfo (array) array of image information returned by getimagesize() function. - * @return string image type - * @since 4.8.017 (2009-11-27) - * @public static - */ - public static function getImageFileType($imgfile, $iminfo=array()) { - $type = ''; - if (isset($iminfo['mime']) AND !empty($iminfo['mime'])) { - $mime = explode('/', $iminfo['mime']); - if ((count($mime) > 1) AND ($mime[0] == 'image') AND (!empty($mime[1]))) { - $type = strtolower(trim($mime[1])); - } - } - if (empty($type)) { - $fileinfo = pathinfo($imgfile); - if (isset($fileinfo['extension']) AND (!TCPDF_STATIC::empty_string($fileinfo['extension']))) { - $type = strtolower(trim($fileinfo['extension'])); - } - } - if ($type == 'jpg') { - $type = 'jpeg'; - } - return $type; - } - - /** - * Set the transparency for the given GD image. - * @param $new_image (image) GD image object - * @param $image (image) GD image object. - * return GD image object. - * @since 4.9.016 (2010-04-20) - * @public static - */ - public static function setGDImageTransparency($new_image, $image) { - // default transparency color (white) - $tcol = array('red' => 255, 'green' => 255, 'blue' => 255); - // transparency index - $tid = imagecolortransparent($image); - $palletsize = imagecolorstotal($image); - if (($tid >= 0) AND ($tid < $palletsize)) { - // get the colors for the transparency index - $tcol = imagecolorsforindex($image, $tid); - } - $tid = imagecolorallocate($new_image, $tcol['red'], $tcol['green'], $tcol['blue']); - imagefill($new_image, 0, 0, $tid); - imagecolortransparent($new_image, $tid); - return $new_image; - } - - /** - * Convert the loaded image to a PNG and then return a structure for the PDF creator. - * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. - * @param $image (image) Image object. - * @param $tempfile (string) Temporary file name. - * return image PNG image object. - * @since 4.9.016 (2010-04-20) - * @public static - */ - public static function _toPNG($image, $tempfile) { - // turn off interlaced mode - imageinterlace($image, 0); - // create temporary PNG image - imagepng($image, $tempfile); - // remove image from memory - imagedestroy($image); - // get PNG image data - $retvars = self::_parsepng($tempfile); - // tidy up by removing temporary image - unlink($tempfile); - return $retvars; - } - - /** - * Convert the loaded image to a JPEG and then return a structure for the PDF creator. - * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. - * @param $image (image) Image object. - * @param $quality (int) JPEG quality. - * @param $tempfile (string) Temporary file name. - * return image JPEG image object. - * @public static - */ - public static function _toJPEG($image, $quality, $tempfile) { - imagejpeg($image, $tempfile, $quality); - imagedestroy($image); - $retvars = self::_parsejpeg($tempfile); - // tidy up by removing temporary image - unlink($tempfile); - return $retvars; - } - - /** - * Extract info from a JPEG file without using the GD library. - * @param $file (string) image file to parse - * @return array structure containing the image data - * @public static - */ - public static function _parsejpeg($file) { - // check if is a local file - if (!@file_exists($file)) { - // try to encode spaces on filename - $tfile = str_replace(' ', '%20', $file); - if (@file_exists($tfile)) { - $file = $tfile; - } - } - $a = getimagesize($file); - if (empty($a)) { - //Missing or incorrect image file - return false; - } - if ($a[2] != 2) { - // Not a JPEG file - return false; - } - // bits per pixel - $bpc = isset($a['bits']) ? intval($a['bits']) : 8; - // number of image channels - if (!isset($a['channels'])) { - $channels = 3; - } else { - $channels = intval($a['channels']); - } - // default colour space - switch ($channels) { - case 1: { - $colspace = 'DeviceGray'; - break; - } - case 3: { - $colspace = 'DeviceRGB'; - break; - } - case 4: { - $colspace = 'DeviceCMYK'; - break; - } - default: { - $channels = 3; - $colspace = 'DeviceRGB'; - break; - } - } - // get file content - $data = file_get_contents($file); - // check for embedded ICC profile - $icc = array(); - $offset = 0; - while (($pos = strpos($data, "ICC_PROFILE\0", $offset)) !== false) { - // get ICC sequence length - $length = (TCPDF_STATIC::_getUSHORT($data, ($pos - 2)) - 16); - // marker sequence number - $msn = max(1, ord($data[($pos + 12)])); - // number of markers (total of APP2 used) - $nom = max(1, ord($data[($pos + 13)])); - // get sequence segment - $icc[($msn - 1)] = substr($data, ($pos + 14), $length); - // move forward to next sequence - $offset = ($pos + 14 + $length); - } - // order and compact ICC segments - if (count($icc) > 0) { - ksort($icc); - $icc = implode('', $icc); - if ((ord($icc[36]) != 0x61) OR (ord($icc[37]) != 0x63) OR (ord($icc[38]) != 0x73) OR (ord($icc[39]) != 0x70)) { - // invalid ICC profile - $icc = false; - } - } else { - $icc = false; - } - return array('w' => $a[0], 'h' => $a[1], 'ch' => $channels, 'icc' => $icc, 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'DCTDecode', 'data' => $data); - } - - /** - * Extract info from a PNG file without using the GD library. - * @param $file (string) image file to parse - * @return array structure containing the image data - * @public static - */ - public static function _parsepng($file) { - $f = @fopen($file, 'rb'); - if ($f === false) { - // Can't open image file - return false; - } - //Check signature - if (fread($f, 8) != chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) { - // Not a PNG file - return false; - } - //Read header chunk - fread($f, 4); - if (fread($f, 4) != 'IHDR') { - //Incorrect PNG file - return false; - } - $w = TCPDF_STATIC::_freadint($f); - $h = TCPDF_STATIC::_freadint($f); - $bpc = ord(fread($f, 1)); - $ct = ord(fread($f, 1)); - if ($ct == 0) { - $colspace = 'DeviceGray'; - } elseif ($ct == 2) { - $colspace = 'DeviceRGB'; - } elseif ($ct == 3) { - $colspace = 'Indexed'; - } else { - // alpha channel - fclose($f); - return 'pngalpha'; - } - if (ord(fread($f, 1)) != 0) { - // Unknown compression method - fclose($f); - return false; - } - if (ord(fread($f, 1)) != 0) { - // Unknown filter method - fclose($f); - return false; - } - if (ord(fread($f, 1)) != 0) { - // Interlacing not supported - fclose($f); - return false; - } - fread($f, 4); - $channels = ($ct == 2 ? 3 : 1); - $parms = '/DecodeParms << /Predictor 15 /Colors '.$channels.' /BitsPerComponent '.$bpc.' /Columns '.$w.' >>'; - //Scan chunks looking for palette, transparency and image data - $pal = ''; - $trns = ''; - $data = ''; - $icc = false; - $n = TCPDF_STATIC::_freadint($f); - do { - $type = fread($f, 4); - if ($type == 'PLTE') { - // read palette - $pal = TCPDF_STATIC::rfread($f, $n); - fread($f, 4); - } elseif ($type == 'tRNS') { - // read transparency info - $t = TCPDF_STATIC::rfread($f, $n); - if ($ct == 0) { // DeviceGray - $trns = array(ord($t[1])); - } elseif ($ct == 2) { // DeviceRGB - $trns = array(ord($t[1]), ord($t[3]), ord($t[5])); - } else { // Indexed - if ($n > 0) { - $trns = array(); - for ($i = 0; $i < $n; ++ $i) { - $trns[] = ord($t{$i}); - } - } - } - fread($f, 4); - } elseif ($type == 'IDAT') { - // read image data block - $data .= TCPDF_STATIC::rfread($f, $n); - fread($f, 4); - } elseif ($type == 'iCCP') { - // skip profile name - $len = 0; - while ((ord(fread($f, 1)) != 0) AND ($len < 80)) { - ++$len; - } - // get compression method - if (ord(fread($f, 1)) != 0) { - // Unknown filter method - fclose($f); - return false; - } - // read ICC Color Profile - $icc = TCPDF_STATIC::rfread($f, ($n - $len - 2)); - // decompress profile - $icc = gzuncompress($icc); - fread($f, 4); - } elseif ($type == 'IEND') { - break; - } else { - TCPDF_STATIC::rfread($f, $n + 4); - } - $n = TCPDF_STATIC::_freadint($f); - } while ($n); - if (($colspace == 'Indexed') AND (empty($pal))) { - // Missing palette - fclose($f); - return false; - } - fclose($f); - return array('w' => $w, 'h' => $h, 'ch' => $channels, 'icc' => $icc, 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'FlateDecode', 'parms' => $parms, 'pal' => $pal, 'trns' => $trns, 'data' => $data); - } - -} // END OF TCPDF_IMAGES CLASS - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/#pma/libraries/tcpdf/include/tcpdf_static.php b/#pma/libraries/tcpdf/include/tcpdf_static.php deleted file mode 100644 index f6d4d2b9..00000000 --- a/#pma/libraries/tcpdf/include/tcpdf_static.php +++ /dev/null @@ -1,2606 +0,0 @@ -. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : -// Static methods used by the TCPDF class. -// -//============================================================+ - -/** - * @file - * This is a PHP class that contains static methods for the TCPDF class.
    - * @package com.tecnick.tcpdf - * @author Nicola Asuni - * @version 1.1.2 - */ - -/** - * @class TCPDF_STATIC - * Static methods used by the TCPDF class. - * @package com.tecnick.tcpdf - * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 1.1.1 - * @author Nicola Asuni - info@tecnick.com - */ -class TCPDF_STATIC { - - /** - * Current TCPDF version. - * @private static - */ - private static $tcpdf_version = '6.2.12'; - - /** - * String alias for total number of pages. - * @public static - */ - public static $alias_tot_pages = '{:ptp:}'; - - /** - * String alias for page number. - * @public static - */ - public static $alias_num_page = '{:pnp:}'; - - /** - * String alias for total number of pages in a single group. - * @public static - */ - public static $alias_group_tot_pages = '{:ptg:}'; - - /** - * String alias for group page number. - * @public static - */ - public static $alias_group_num_page = '{:png:}'; - - /** - * String alias for right shift compensation used to correctly align page numbers on the right. - * @public static - */ - public static $alias_right_shift = '{rsc:'; - - /** - * Encryption padding string. - * @public static - */ - public static $enc_padding = "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A"; - - /** - * ByteRange placemark used during digital signature process. - * @since 4.6.028 (2009-08-25) - * @public static - */ - public static $byterange_string = '/ByteRange[0 ********** ********** **********]'; - - /** - * Array page boxes names - * @public static - */ - public static $pageboxes = array('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'); - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * Return the current TCPDF version. - * @return TCPDF version string - * @since 5.9.012 (2010-11-10) - * @public static - */ - public static function getTCPDFVersion() { - return self::$tcpdf_version; - } - - /** - * Return the current TCPDF producer. - * @return TCPDF producer string - * @since 6.0.000 (2013-03-16) - * @public static - */ - public static function getTCPDFProducer() { - return "\x54\x43\x50\x44\x46\x20".self::getTCPDFVersion()."\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29"; - } - - /** - * Sets the current active configuration setting of magic_quotes_runtime (if the set_magic_quotes_runtime function exist) - * @param $mqr (boolean) FALSE for off, TRUE for on. - * @since 4.6.025 (2009-08-17) - * @public static - */ - public static function set_mqr($mqr) { - if (!defined('PHP_VERSION_ID')) { - $version = PHP_VERSION; - define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4])); - } - if (PHP_VERSION_ID < 50300) { - @set_magic_quotes_runtime($mqr); - } - } - - /** - * Gets the current active configuration setting of magic_quotes_runtime (if the get_magic_quotes_runtime function exist) - * @return Returns 0 if magic quotes runtime is off or get_magic_quotes_runtime doesn't exist, 1 otherwise. - * @since 4.6.025 (2009-08-17) - * @public static - */ - public static function get_mqr() { - if (!defined('PHP_VERSION_ID')) { - $version = PHP_VERSION; - define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4])); - } - if (PHP_VERSION_ID < 50300) { - return @get_magic_quotes_runtime(); - } - return 0; - } - - /** - * Check if the URL exist. - * @param $url (string) URL to check. - * @return Boolean true if the URl exist, false otherwise. - * @since 5.9.204 (2013-01-28) - * @public static - */ - public static function isValidURL($url) { - $headers = @get_headers($url); - return (strpos($headers[0], '200') !== false); - } - - /** - * Removes SHY characters from text. - * Unicode Data:
      - *
    • Name : SOFT HYPHEN, commonly abbreviated as SHY
    • - *
    • HTML Entity (decimal): "&#173;"
    • - *
    • HTML Entity (hex): "&#xad;"
    • - *
    • HTML Entity (named): "&shy;"
    • - *
    • How to type in Microsoft Windows: [Alt +00AD] or [Alt 0173]
    • - *
    • UTF-8 (hex): 0xC2 0xAD (c2ad)
    • - *
    • UTF-8 character: chr(194).chr(173)
    • - *
    - * @param $txt (string) input string - * @param $unicode (boolean) True if we are in unicode mode, false otherwise. - * @return string without SHY characters. - * @since (4.5.019) 2009-02-28 - * @public static - */ - public static function removeSHY($txt='', $unicode=true) { - $txt = preg_replace('/([\\xc2]{1}[\\xad]{1})/', '', $txt); - if (!$unicode) { - $txt = preg_replace('/([\\xad]{1})/', '', $txt); - } - return $txt; - } - - - /** - * Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages) - * @param $brd (mixed) Indicates if borders must be drawn around the cell block. The value can be a number:
    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param $position (string) multicell position: 'start', 'middle', 'end' - * @param $opencell (boolean) True when the cell is left open at the page bottom, false otherwise. - * @return border mode array - * @since 4.4.002 (2008-12-09) - * @public static - */ - public static function getBorderMode($brd, $position='start', $opencell=true) { - if ((!$opencell) OR empty($brd)) { - return $brd; - } - if ($brd == 1) { - $brd = 'LTRB'; - } - if (is_string($brd)) { - // convert string to array - $slen = strlen($brd); - $newbrd = array(); - for ($i = 0; $i < $slen; ++$i) { - $newbrd[$brd[$i]] = array('cap' => 'square', 'join' => 'miter'); - } - $brd = $newbrd; - } - foreach ($brd as $border => $style) { - switch ($position) { - case 'start': { - if (strpos($border, 'B') !== false) { - // remove bottom line - $newkey = str_replace('B', '', $border); - if (strlen($newkey) > 0) { - $brd[$newkey] = $style; - } - unset($brd[$border]); - } - break; - } - case 'middle': { - if (strpos($border, 'B') !== false) { - // remove bottom line - $newkey = str_replace('B', '', $border); - if (strlen($newkey) > 0) { - $brd[$newkey] = $style; - } - unset($brd[$border]); - $border = $newkey; - } - if (strpos($border, 'T') !== false) { - // remove bottom line - $newkey = str_replace('T', '', $border); - if (strlen($newkey) > 0) { - $brd[$newkey] = $style; - } - unset($brd[$border]); - } - break; - } - case 'end': { - if (strpos($border, 'T') !== false) { - // remove bottom line - $newkey = str_replace('T', '', $border); - if (strlen($newkey) > 0) { - $brd[$newkey] = $style; - } - unset($brd[$border]); - } - break; - } - } - } - return $brd; - } - - /** - * Determine whether a string is empty. - * @param $str (string) string to be checked - * @return boolean true if string is empty - * @since 4.5.044 (2009-04-16) - * @public static - */ - public static function empty_string($str) { - return (is_null($str) OR (is_string($str) AND (strlen($str) == 0))); - } - - /** - * Returns a temporary filename for caching object on filesystem. - * @param $type (string) Type of file (name of the subdir on the tcpdf cache folder). - * @param $file_id (string) TCPDF file_id. - * @return string filename. - * @since 4.5.000 (2008-12-31) - * @public static - */ - public static function getObjFilename($type='tmp', $file_id='') { - return tempnam(K_PATH_CACHE, '__tcpdf_'.$file_id.'_'.$type.'_'.md5(TCPDF_STATIC::getRandomSeed()).'_'); - } - - /** - * Add "\" before "\", "(" and ")" - * @param $s (string) string to escape. - * @return string escaped string. - * @public static - */ - public static function _escape($s) { - // the chr(13) substitution fixes the Bugs item #1421290. - return strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\', chr(13) => '\r')); - } - - /** - * Escape some special characters (< > &) for XML output. - * @param $str (string) Input string to convert. - * @return converted string - * @since 5.9.121 (2011-09-28) - * @public static - */ - public static function _escapeXML($str) { - $replaceTable = array("\0" => '', '&' => '&', '<' => '<', '>' => '>'); - $str = strtr($str, $replaceTable); - return $str; - } - - /** - * Creates a copy of a class object - * @param $object (object) class object to be cloned - * @return cloned object - * @since 4.5.029 (2009-03-19) - * @public static - */ - public static function objclone($object) { - if (($object instanceof Imagick) AND (version_compare(phpversion('imagick'), '3.0.1') !== 1)) { - // on the versions after 3.0.1 the clone() method was deprecated in favour of clone keyword - return @$object->clone(); - } - return @clone($object); - } - - /** - * Output input data and compress it if possible. - * @param $data (string) Data to output. - * @param $length (int) Data length in bytes. - * @since 5.9.086 - * @public static - */ - public static function sendOutputData($data, $length) { - if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']) OR empty($_SERVER['HTTP_ACCEPT_ENCODING'])) { - // the content length may vary if the server is using compression - header('Content-Length: '.$length); - } - echo $data; - } - - /** - * Replace page number aliases with number. - * @param $page (string) Page content. - * @param $replace (array) Array of replacements (array keys are replacement strings, values are alias arrays). - * @param $diff (int) If passed, this will be set to the total char number difference between alias and replacements. - * @return replaced page content and updated $diff parameter as array. - * @public static - */ - public static function replacePageNumAliases($page, $replace, $diff=0) { - foreach ($replace as $rep) { - foreach ($rep[3] as $a) { - if (strpos($page, $a) !== false) { - $page = str_replace($a, $rep[0], $page); - $diff += ($rep[2] - $rep[1]); - } - } - } - return array($page, $diff); - } - - /** - * Returns timestamp in seconds from formatted date-time. - * @param $date (string) Formatted date-time. - * @return int seconds. - * @since 5.9.152 (2012-03-23) - * @public static - */ - public static function getTimestamp($date) { - if (($date[0] == 'D') AND ($date[1] == ':')) { - // remove date prefix if present - $date = substr($date, 2); - } - return strtotime($date); - } - - /** - * Returns a formatted date-time. - * @param $time (int) Time in seconds. - * @return string escaped date string. - * @since 5.9.152 (2012-03-23) - * @public static - */ - public static function getFormattedDate($time) { - return substr_replace(date('YmdHisO', intval($time)), '\'', (0 - 2), 0).'\''; - } - - /** - * Returns a string containing random data to be used as a seed for encryption methods. - * @param $seed (string) starting seed value - * @return string containing random data - * @author Nicola Asuni - * @since 5.9.006 (2010-10-19) - * @public static - */ - public static function getRandomSeed($seed='') { - $rnd = uniqid(rand().microtime(true), true); - if (function_exists('posix_getpid')) { - $rnd .= posix_getpid(); - } - if (function_exists('openssl_random_pseudo_bytes') AND (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')) { - // this is not used on windows systems because it is very slow for a know bug - $rnd .= openssl_random_pseudo_bytes(512); - } else { - for ($i = 0; $i < 23; ++$i) { - $rnd .= uniqid('', true); - } - } - return $rnd.$seed.__FILE__.serialize($_SERVER).microtime(true); - } - - /** - * Encrypts a string using MD5 and returns it's value as a binary string. - * @param $str (string) input string - * @return String MD5 encrypted binary string - * @since 2.0.000 (2008-01-02) - * @public static - */ - public static function _md5_16($str) { - return pack('H*', md5($str)); - } - - /** - * Returns the input text exrypted using AES algorithm and the specified key. - * This method requires openssl or mcrypt. Text is padded to 16bytes blocks - * @param $key (string) encryption key - * @param $text (String) input text to be encrypted - * @return String encrypted text - * @author Nicola Asuni - * @since 5.0.005 (2010-05-11) - * @public static - */ - public static function _AES($key, $text) { - // padding (RFC 2898, PKCS #5: Password-Based Cryptography Specification Version 2.0) - $padding = 16 - (strlen($text) % 16); - $text .= str_repeat(chr($padding), $padding); - if (extension_loaded('openssl')) { - $iv = openssl_random_pseudo_bytes (openssl_cipher_iv_length('aes-256-cbc')); - $text = openssl_encrypt($text, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv); - return $iv.substr($text, 0, -16); - } - $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND); - $text = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_CBC, $iv); - $text = $iv.$text; - return $text; - } - - /** - * Returns the input text exrypted using AES algorithm and the specified key. - * This method requires openssl or mcrypt. Text is not padded - * @param $key (string) encryption key - * @param $text (String) input text to be encrypted - * @return String encrypted text - * @author Nicola Asuni - * @since TODO - * @public static - */ - public static function _AESnopad($key, $text) { - if (extension_loaded('openssl')) { - $iv = str_repeat("\x00", openssl_cipher_iv_length('aes-256-cbc')); - $text = openssl_encrypt($text, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv); - return substr($text, 0, -16); - } - $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); - $text = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_CBC, $iv); - return $text; - } - - /** - * Returns the input text encrypted using RC4 algorithm and the specified key. - * RC4 is the standard encryption algorithm used in PDF format - * @param $key (string) Encryption key. - * @param $text (String) Input text to be encrypted. - * @param $last_enc_key (String) Reference to last RC4 key encrypted. - * @param $last_enc_key_c (String) Reference to last RC4 computed key. - * @return String encrypted text - * @since 2.0.000 (2008-01-02) - * @author Klemen Vodopivec, Nicola Asuni - * @public static - */ - public static function _RC4($key, $text, &$last_enc_key, &$last_enc_key_c) { - if (function_exists('mcrypt_encrypt') AND ($out = @mcrypt_encrypt(MCRYPT_ARCFOUR, $key, $text, MCRYPT_MODE_STREAM, ''))) { - // try to use mcrypt function if exist - return $out; - } - if ($last_enc_key != $key) { - $k = str_repeat($key, ((256 / strlen($key)) + 1)); - $rc4 = range(0, 255); - $j = 0; - for ($i = 0; $i < 256; ++$i) { - $t = $rc4[$i]; - $j = ($j + $t + ord($k[$i])) % 256; - $rc4[$i] = $rc4[$j]; - $rc4[$j] = $t; - } - $last_enc_key = $key; - $last_enc_key_c = $rc4; - } else { - $rc4 = $last_enc_key_c; - } - $len = strlen($text); - $a = 0; - $b = 0; - $out = ''; - for ($i = 0; $i < $len; ++$i) { - $a = ($a + 1) % 256; - $t = $rc4[$a]; - $b = ($b + $t) % 256; - $rc4[$a] = $rc4[$b]; - $rc4[$b] = $t; - $k = $rc4[($rc4[$a] + $rc4[$b]) % 256]; - $out .= chr(ord($text[$i]) ^ $k); - } - return $out; - } - - /** - * Return the permission code used on encryption (P value). - * @param $permissions (Array) the set of permissions (specify the ones you want to block). - * @param $mode (int) encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit. - * @since 5.0.005 (2010-05-12) - * @author Nicola Asuni - * @public static - */ - public static function getUserPermissionCode($permissions, $mode=0) { - $options = array( - 'owner' => 2, // bit 2 -- inverted logic: cleared by default - 'print' => 4, // bit 3 - 'modify' => 8, // bit 4 - 'copy' => 16, // bit 5 - 'annot-forms' => 32, // bit 6 - 'fill-forms' => 256, // bit 9 - 'extract' => 512, // bit 10 - 'assemble' => 1024,// bit 11 - 'print-high' => 2048 // bit 12 - ); - $protection = 2147422012; // 32 bit: (01111111 11111111 00001111 00111100) - foreach ($permissions as $permission) { - if (isset($options[$permission])) { - if (($mode > 0) OR ($options[$permission] <= 32)) { - // set only valid permissions - if ($options[$permission] == 2) { - // the logic for bit 2 is inverted (cleared by default) - $protection += $options[$permission]; - } else { - $protection -= $options[$permission]; - } - } - } - } - return $protection; - } - - /** - * Convert hexadecimal string to string - * @param $bs (string) byte-string to convert - * @return String - * @since 5.0.005 (2010-05-12) - * @author Nicola Asuni - * @public static - */ - public static function convertHexStringToString($bs) { - $string = ''; // string to be returned - $bslength = strlen($bs); - if (($bslength % 2) != 0) { - // padding - $bs .= '0'; - ++$bslength; - } - for ($i = 0; $i < $bslength; $i += 2) { - $string .= chr(hexdec($bs[$i].$bs[($i + 1)])); - } - return $string; - } - - /** - * Convert string to hexadecimal string (byte string) - * @param $s (string) string to convert - * @return byte string - * @since 5.0.010 (2010-05-17) - * @author Nicola Asuni - * @public static - */ - public static function convertStringToHexString($s) { - $bs = ''; - $chars = preg_split('//', $s, -1, PREG_SPLIT_NO_EMPTY); - foreach ($chars as $c) { - $bs .= sprintf('%02s', dechex(ord($c))); - } - return $bs; - } - - /** - * Convert encryption P value to a string of bytes, low-order byte first. - * @param $protection (string) 32bit encryption permission value (P value) - * @return String - * @since 5.0.005 (2010-05-12) - * @author Nicola Asuni - * @public static - */ - public static function getEncPermissionsString($protection) { - $binprot = sprintf('%032b', $protection); - $str = chr(bindec(substr($binprot, 24, 8))); - $str .= chr(bindec(substr($binprot, 16, 8))); - $str .= chr(bindec(substr($binprot, 8, 8))); - $str .= chr(bindec(substr($binprot, 0, 8))); - return $str; - } - - /** - * Encode a name object. - * @param $name (string) Name object to encode. - * @return (string) Encoded name object. - * @author Nicola Asuni - * @since 5.9.097 (2011-06-23) - * @public static - */ - public static function encodeNameObject($name) { - $escname = ''; - $length = strlen($name); - for ($i = 0; $i < $length; ++$i) { - $chr = $name[$i]; - if (preg_match('/[0-9a-zA-Z#_=-]/', $chr) == 1) { - $escname .= $chr; - } else { - $escname .= sprintf('#%02X', ord($chr)); - } - } - return $escname; - } - - /** - * Convert JavaScript form fields properties array to Annotation Properties array. - * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param $spot_colors (array) Reference to spot colors array. - * @param $rtl (boolean) True if in Right-To-Left text direction mode, false otherwise. - * @return array of annotation properties - * @author Nicola Asuni - * @since 4.8.000 (2009-09-06) - * @public static - */ - public static function getAnnotOptFromJSProp($prop, &$spot_colors, $rtl=false) { - if (isset($prop['aopt']) AND is_array($prop['aopt'])) { - // the annotation options area lready defined - return $prop['aopt']; - } - $opt = array(); // value to be returned - // alignment: Controls how the text is laid out within the text field. - if (isset($prop['alignment'])) { - switch ($prop['alignment']) { - case 'left': { - $opt['q'] = 0; - break; - } - case 'center': { - $opt['q'] = 1; - break; - } - case 'right': { - $opt['q'] = 2; - break; - } - default: { - $opt['q'] = ($rtl)?2:0; - break; - } - } - } - // lineWidth: Specifies the thickness of the border when stroking the perimeter of a field's rectangle. - if (isset($prop['lineWidth'])) { - $linewidth = intval($prop['lineWidth']); - } else { - $linewidth = 1; - } - // borderStyle: The border style for a field. - if (isset($prop['borderStyle'])) { - switch ($prop['borderStyle']) { - case 'border.d': - case 'dashed': { - $opt['border'] = array(0, 0, $linewidth, array(3, 2)); - $opt['bs'] = array('w'=>$linewidth, 's'=>'D', 'd'=>array(3, 2)); - break; - } - case 'border.b': - case 'beveled': { - $opt['border'] = array(0, 0, $linewidth); - $opt['bs'] = array('w'=>$linewidth, 's'=>'B'); - break; - } - case 'border.i': - case 'inset': { - $opt['border'] = array(0, 0, $linewidth); - $opt['bs'] = array('w'=>$linewidth, 's'=>'I'); - break; - } - case 'border.u': - case 'underline': { - $opt['border'] = array(0, 0, $linewidth); - $opt['bs'] = array('w'=>$linewidth, 's'=>'U'); - break; - } - case 'border.s': - case 'solid': { - $opt['border'] = array(0, 0, $linewidth); - $opt['bs'] = array('w'=>$linewidth, 's'=>'S'); - break; - } - default: { - break; - } - } - } - if (isset($prop['border']) AND is_array($prop['border'])) { - $opt['border'] = $prop['border']; - } - if (!isset($opt['mk'])) { - $opt['mk'] = array(); - } - if (!isset($opt['mk']['if'])) { - $opt['mk']['if'] = array(); - } - $opt['mk']['if']['a'] = array(0.5, 0.5); - // buttonAlignX: Controls how space is distributed from the left of the button face with respect to the icon. - if (isset($prop['buttonAlignX'])) { - $opt['mk']['if']['a'][0] = $prop['buttonAlignX']; - } - // buttonAlignY: Controls how unused space is distributed from the bottom of the button face with respect to the icon. - if (isset($prop['buttonAlignY'])) { - $opt['mk']['if']['a'][1] = $prop['buttonAlignY']; - } - // buttonFitBounds: If true, the extent to which the icon may be scaled is set to the bounds of the button field. - if (isset($prop['buttonFitBounds']) AND ($prop['buttonFitBounds'] == 'true')) { - $opt['mk']['if']['fb'] = true; - } - // buttonScaleHow: Controls how the icon is scaled (if necessary) to fit inside the button face. - if (isset($prop['buttonScaleHow'])) { - switch ($prop['buttonScaleHow']) { - case 'scaleHow.proportional': { - $opt['mk']['if']['s'] = 'P'; - break; - } - case 'scaleHow.anamorphic': { - $opt['mk']['if']['s'] = 'A'; - break; - } - } - } - // buttonScaleWhen: Controls when an icon is scaled to fit inside the button face. - if (isset($prop['buttonScaleWhen'])) { - switch ($prop['buttonScaleWhen']) { - case 'scaleWhen.always': { - $opt['mk']['if']['sw'] = 'A'; - break; - } - case 'scaleWhen.never': { - $opt['mk']['if']['sw'] = 'N'; - break; - } - case 'scaleWhen.tooBig': { - $opt['mk']['if']['sw'] = 'B'; - break; - } - case 'scaleWhen.tooSmall': { - $opt['mk']['if']['sw'] = 'S'; - break; - } - } - } - // buttonPosition: Controls how the text and the icon of the button are positioned with respect to each other within the button face. - if (isset($prop['buttonPosition'])) { - switch ($prop['buttonPosition']) { - case 0: - case 'position.textOnly': { - $opt['mk']['tp'] = 0; - break; - } - case 1: - case 'position.iconOnly': { - $opt['mk']['tp'] = 1; - break; - } - case 2: - case 'position.iconTextV': { - $opt['mk']['tp'] = 2; - break; - } - case 3: - case 'position.textIconV': { - $opt['mk']['tp'] = 3; - break; - } - case 4: - case 'position.iconTextH': { - $opt['mk']['tp'] = 4; - break; - } - case 5: - case 'position.textIconH': { - $opt['mk']['tp'] = 5; - break; - } - case 6: - case 'position.overlay': { - $opt['mk']['tp'] = 6; - break; - } - } - } - // fillColor: Specifies the background color for a field. - if (isset($prop['fillColor'])) { - if (is_array($prop['fillColor'])) { - $opt['mk']['bg'] = $prop['fillColor']; - } else { - $opt['mk']['bg'] = TCPDF_COLORS::convertHTMLColorToDec($prop['fillColor'], $spot_colors); - } - } - // strokeColor: Specifies the stroke color for a field that is used to stroke the rectangle of the field with a line as large as the line width. - if (isset($prop['strokeColor'])) { - if (is_array($prop['strokeColor'])) { - $opt['mk']['bc'] = $prop['strokeColor']; - } else { - $opt['mk']['bc'] = TCPDF_COLORS::convertHTMLColorToDec($prop['strokeColor'], $spot_colors); - } - } - // rotation: The rotation of a widget in counterclockwise increments. - if (isset($prop['rotation'])) { - $opt['mk']['r'] = $prop['rotation']; - } - // charLimit: Limits the number of characters that a user can type into a text field. - if (isset($prop['charLimit'])) { - $opt['maxlen'] = intval($prop['charLimit']); - } - if (!isset($ff)) { - $ff = 0; // default value - } - // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. - if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) { - $ff += 1 << 0; - } - // required: Specifies whether a field requires a value. - if (isset($prop['required']) AND ($prop['required'] == 'true')) { - $ff += 1 << 1; - } - // multiline: Controls how text is wrapped within the field. - if (isset($prop['multiline']) AND ($prop['multiline'] == 'true')) { - $ff += 1 << 12; - } - // password: Specifies whether the field should display asterisks when data is entered in the field. - if (isset($prop['password']) AND ($prop['password'] == 'true')) { - $ff += 1 << 13; - } - // NoToggleToOff: If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. - if (isset($prop['NoToggleToOff']) AND ($prop['NoToggleToOff'] == 'true')) { - $ff += 1 << 14; - } - // Radio: If set, the field is a set of radio buttons. - if (isset($prop['Radio']) AND ($prop['Radio'] == 'true')) { - $ff += 1 << 15; - } - // Pushbutton: If set, the field is a pushbutton that does not retain a permanent value. - if (isset($prop['Pushbutton']) AND ($prop['Pushbutton'] == 'true')) { - $ff += 1 << 16; - } - // Combo: If set, the field is a combo box; if clear, the field is a list box. - if (isset($prop['Combo']) AND ($prop['Combo'] == 'true')) { - $ff += 1 << 17; - } - // editable: Controls whether a combo box is editable. - if (isset($prop['editable']) AND ($prop['editable'] == 'true')) { - $ff += 1 << 18; - } - // Sort: If set, the field's option items shall be sorted alphabetically. - if (isset($prop['Sort']) AND ($prop['Sort'] == 'true')) { - $ff += 1 << 19; - } - // fileSelect: If true, sets the file-select flag in the Options tab of the text field (Field is Used for File Selection). - if (isset($prop['fileSelect']) AND ($prop['fileSelect'] == 'true')) { - $ff += 1 << 20; - } - // multipleSelection: If true, indicates that a list box allows a multiple selection of items. - if (isset($prop['multipleSelection']) AND ($prop['multipleSelection'] == 'true')) { - $ff += 1 << 21; - } - // doNotSpellCheck: If true, spell checking is not performed on this editable text field. - if (isset($prop['doNotSpellCheck']) AND ($prop['doNotSpellCheck'] == 'true')) { - $ff += 1 << 22; - } - // doNotScroll: If true, the text field does not scroll and the user, therefore, is limited by the rectangular region designed for the field. - if (isset($prop['doNotScroll']) AND ($prop['doNotScroll'] == 'true')) { - $ff += 1 << 23; - } - // comb: If set to true, the field background is drawn as series of boxes (one for each character in the value of the field) and each character of the content is drawn within those boxes. The number of boxes drawn is determined from the charLimit property. It applies only to text fields. The setter will also raise if any of the following field properties are also set multiline, password, and fileSelect. A side-effect of setting this property is that the doNotScroll property is also set. - if (isset($prop['comb']) AND ($prop['comb'] == 'true')) { - $ff += 1 << 24; - } - // radiosInUnison: If false, even if a group of radio buttons have the same name and export value, they behave in a mutually exclusive fashion, like HTML radio buttons. - if (isset($prop['radiosInUnison']) AND ($prop['radiosInUnison'] == 'true')) { - $ff += 1 << 25; - } - // richText: If true, the field allows rich text formatting. - if (isset($prop['richText']) AND ($prop['richText'] == 'true')) { - $ff += 1 << 25; - } - // commitOnSelChange: Controls whether a field value is committed after a selection change. - if (isset($prop['commitOnSelChange']) AND ($prop['commitOnSelChange'] == 'true')) { - $ff += 1 << 26; - } - $opt['ff'] = $ff; - // defaultValue: The default value of a field - that is, the value that the field is set to when the form is reset. - if (isset($prop['defaultValue'])) { - $opt['dv'] = $prop['defaultValue']; - } - $f = 4; // default value for annotation flags - // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. - if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) { - $f += 1 << 6; - } - // display: Controls whether the field is hidden or visible on screen and in print. - if (isset($prop['display'])) { - if ($prop['display'] == 'display.visible') { - // - } elseif ($prop['display'] == 'display.hidden') { - $f += 1 << 1; - } elseif ($prop['display'] == 'display.noPrint') { - $f -= 1 << 2; - } elseif ($prop['display'] == 'display.noView') { - $f += 1 << 5; - } - } - $opt['f'] = $f; - // currentValueIndices: Reads and writes single or multiple values of a list box or combo box. - if (isset($prop['currentValueIndices']) AND is_array($prop['currentValueIndices'])) { - $opt['i'] = $prop['currentValueIndices']; - } - // value: The value of the field data that the user has entered. - if (isset($prop['value'])) { - if (is_array($prop['value'])) { - $opt['opt'] = array(); - foreach ($prop['value'] AS $key => $optval) { - // exportValues: An array of strings representing the export values for the field. - if (isset($prop['exportValues'][$key])) { - $opt['opt'][$key] = array($prop['exportValues'][$key], $prop['value'][$key]); - } else { - $opt['opt'][$key] = $prop['value'][$key]; - } - } - } else { - $opt['v'] = $prop['value']; - } - } - // richValue: This property specifies the text contents and formatting of a rich text field. - if (isset($prop['richValue'])) { - $opt['rv'] = $prop['richValue']; - } - // submitName: If nonempty, used during form submission instead of name. Only applicable if submitting in HTML format (that is, URL-encoded). - if (isset($prop['submitName'])) { - $opt['tm'] = $prop['submitName']; - } - // name: Fully qualified field name. - if (isset($prop['name'])) { - $opt['t'] = $prop['name']; - } - // userName: The user name (short description string) of the field. - if (isset($prop['userName'])) { - $opt['tu'] = $prop['userName']; - } - // highlight: Defines how a button reacts when a user clicks it. - if (isset($prop['highlight'])) { - switch ($prop['highlight']) { - case 'none': - case 'highlight.n': { - $opt['h'] = 'N'; - break; - } - case 'invert': - case 'highlight.i': { - $opt['h'] = 'i'; - break; - } - case 'push': - case 'highlight.p': { - $opt['h'] = 'P'; - break; - } - case 'outline': - case 'highlight.o': { - $opt['h'] = 'O'; - break; - } - } - } - // Unsupported options: - // - calcOrderIndex: Changes the calculation order of fields in the document. - // - delay: Delays the redrawing of a field's appearance. - // - defaultStyle: This property defines the default style attributes for the form field. - // - style: Allows the user to set the glyph style of a check box or radio button. - // - textColor, textFont, textSize - return $opt; - } - - /** - * Format the page numbers. - * This method can be overriden for custom formats. - * @param $num (int) page number - * @since 4.2.005 (2008-11-06) - * @public static - */ - public static function formatPageNumber($num) { - return number_format((float)$num, 0, '', '.'); - } - - /** - * Format the page numbers on the Table Of Content. - * This method can be overriden for custom formats. - * @param $num (int) page number - * @since 4.5.001 (2009-01-04) - * @see addTOC(), addHTMLTOC() - * @public static - */ - public static function formatTOCPageNumber($num) { - return number_format((float)$num, 0, '', '.'); - } - - /** - * Extracts the CSS properties from a CSS string. - * @param $cssdata (string) string containing CSS definitions. - * @return An array where the keys are the CSS selectors and the values are the CSS properties. - * @author Nicola Asuni - * @since 5.1.000 (2010-05-25) - * @public static - */ - public static function extractCSSproperties($cssdata) { - if (empty($cssdata)) { - return array(); - } - // remove comments - $cssdata = preg_replace('/\/\*[^\*]*\*\//', '', $cssdata); - // remove newlines and multiple spaces - $cssdata = preg_replace('/[\s]+/', ' ', $cssdata); - // remove some spaces - $cssdata = preg_replace('/[\s]*([;:\{\}]{1})[\s]*/', '\\1', $cssdata); - // remove empty blocks - $cssdata = preg_replace('/([^\}\{]+)\{\}/', '', $cssdata); - // replace media type parenthesis - $cssdata = preg_replace('/@media[\s]+([^\{]*)\{/i', '@media \\1§', $cssdata); - $cssdata = preg_replace('/\}\}/si', '}§', $cssdata); - // trim string - $cssdata = trim($cssdata); - // find media blocks (all, braille, embossed, handheld, print, projection, screen, speech, tty, tv) - $cssblocks = array(); - $matches = array(); - if (preg_match_all('/@media[\s]+([^\§]*)§([^§]*)§/i', $cssdata, $matches) > 0) { - foreach ($matches[1] as $key => $type) { - $cssblocks[$type] = $matches[2][$key]; - } - // remove media blocks - $cssdata = preg_replace('/@media[\s]+([^\§]*)§([^§]*)§/i', '', $cssdata); - } - // keep 'all' and 'print' media, other media types are discarded - if (isset($cssblocks['all']) AND !empty($cssblocks['all'])) { - $cssdata .= $cssblocks['all']; - } - if (isset($cssblocks['print']) AND !empty($cssblocks['print'])) { - $cssdata .= $cssblocks['print']; - } - // reset css blocks array - $cssblocks = array(); - $matches = array(); - // explode css data string into array - if (substr($cssdata, -1) == '}') { - // remove last parethesis - $cssdata = substr($cssdata, 0, -1); - } - $matches = explode('}', $cssdata); - foreach ($matches as $key => $block) { - // index 0 contains the CSS selector, index 1 contains CSS properties - $cssblocks[$key] = explode('{', $block); - if (!isset($cssblocks[$key][1])) { - // remove empty definitions - unset($cssblocks[$key]); - } - } - // split groups of selectors (comma-separated list of selectors) - foreach ($cssblocks as $key => $block) { - if (strpos($block[0], ',') > 0) { - $selectors = explode(',', $block[0]); - foreach ($selectors as $sel) { - $cssblocks[] = array(0 => trim($sel), 1 => $block[1]); - } - unset($cssblocks[$key]); - } - } - // covert array to selector => properties - $cssdata = array(); - foreach ($cssblocks as $block) { - $selector = $block[0]; - // calculate selector's specificity - $matches = array(); - $a = 0; // the declaration is not from is a 'style' attribute - $b = intval(preg_match_all('/[\#]/', $selector, $matches)); // number of ID attributes - $c = intval(preg_match_all('/[\[\.]/', $selector, $matches)); // number of other attributes - $c += intval(preg_match_all('/[\:]link|visited|hover|active|focus|target|lang|enabled|disabled|checked|indeterminate|root|nth|first|last|only|empty|contains|not/i', $selector, $matches)); // number of pseudo-classes - $d = intval(preg_match_all('/[\>\+\~\s]{1}[a-zA-Z0-9]+/', ' '.$selector, $matches)); // number of element names - $d += intval(preg_match_all('/[\:][\:]/', $selector, $matches)); // number of pseudo-elements - $specificity = $a.$b.$c.$d; - // add specificity to the beginning of the selector - $cssdata[$specificity.' '.$selector] = $block[1]; - } - // sort selectors alphabetically to account for specificity - ksort($cssdata, SORT_STRING); - // return array - return $cssdata; - } - - /** - * Cleanup HTML code (requires HTML Tidy library). - * @param $html (string) htmlcode to fix - * @param $default_css (string) CSS commands to add - * @param $tagvs (array) parameters for setHtmlVSpace method - * @param $tidy_options (array) options for tidy_parse_string function - * @param $tagvspaces (array) Array of vertical spaces for tags. - * @return string XHTML code cleaned up - * @author Nicola Asuni - * @since 5.9.017 (2010-11-16) - * @see setHtmlVSpace() - * @public static - */ - public static function fixHTMLCode($html, $default_css='', $tagvs='', $tidy_options='', &$tagvspaces) { - // configure parameters for HTML Tidy - if ($tidy_options === '') { - $tidy_options = array ( - 'clean' => 1, - 'drop-empty-paras' => 0, - 'drop-proprietary-attributes' => 1, - 'fix-backslash' => 1, - 'hide-comments' => 1, - 'join-styles' => 1, - 'lower-literals' => 1, - 'merge-divs' => 1, - 'merge-spans' => 1, - 'output-xhtml' => 1, - 'word-2000' => 1, - 'wrap' => 0, - 'output-bom' => 0, - //'char-encoding' => 'utf8', - //'input-encoding' => 'utf8', - //'output-encoding' => 'utf8' - ); - } - // clean up the HTML code - $tidy = tidy_parse_string($html, $tidy_options); - // fix the HTML - $tidy->cleanRepair(); - // get the CSS part - $tidy_head = tidy_get_head($tidy); - $css = $tidy_head->value; - $css = preg_replace('/]+)>/ims', ''; - // get the body part - $tidy_body = tidy_get_body($tidy); - $html = $tidy_body->value; - // fix some self-closing tags - $html = str_replace('
    ', '
    ', $html); - // remove some empty tag blocks - $html = preg_replace('/]*)><\/div>/', '', $html); - $html = preg_replace('/]*)><\/p>/', '', $html); - if ($tagvs !== '') { - // set vertical space for some XHTML tags - $tagvspaces = $tagvs; - } - // return the cleaned XHTML code + CSS - return $css.$html; - } - - /** - * Returns true if the CSS selector is valid for the selected HTML tag - * @param $dom (array) array of HTML tags and properties - * @param $key (int) key of the current HTML tag - * @param $selector (string) CSS selector string - * @return true if the selector is valid, false otherwise - * @since 5.1.000 (2010-05-25) - * @public static - */ - public static function isValidCSSSelectorForTag($dom, $key, $selector) { - $valid = false; // value to be returned - $tag = $dom[$key]['value']; - $class = array(); - if (isset($dom[$key]['attribute']['class']) AND !empty($dom[$key]['attribute']['class'])) { - $class = explode(' ', strtolower($dom[$key]['attribute']['class'])); - } - $id = ''; - if (isset($dom[$key]['attribute']['id']) AND !empty($dom[$key]['attribute']['id'])) { - $id = strtolower($dom[$key]['attribute']['id']); - } - $selector = preg_replace('/([\>\+\~\s]{1})([\.]{1})([^\>\+\~\s]*)/si', '\\1*.\\3', $selector); - $matches = array(); - if (preg_match_all('/([\>\+\~\s]{1})([a-zA-Z0-9\*]+)([^\>\+\~\s]*)/si', $selector, $matches, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) > 0) { - $parentop = array_pop($matches[1]); - $operator = $parentop[0]; - $offset = $parentop[1]; - $lasttag = array_pop($matches[2]); - $lasttag = strtolower(trim($lasttag[0])); - if (($lasttag == '*') OR ($lasttag == $tag)) { - // the last element on selector is our tag or 'any tag' - $attrib = array_pop($matches[3]); - $attrib = strtolower(trim($attrib[0])); - if (!empty($attrib)) { - // check if matches class, id, attribute, pseudo-class or pseudo-element - switch ($attrib[0]) { - case '.': { // class - if (in_array(substr($attrib, 1), $class)) { - $valid = true; - } - break; - } - case '#': { // ID - if (substr($attrib, 1) == $id) { - $valid = true; - } - break; - } - case '[': { // attribute - $attrmatch = array(); - if (preg_match('/\[([a-zA-Z0-9]*)[\s]*([\~\^\$\*\|\=]*)[\s]*["]?([^"\]]*)["]?\]/i', $attrib, $attrmatch) > 0) { - $att = strtolower($attrmatch[1]); - $val = $attrmatch[3]; - if (isset($dom[$key]['attribute'][$att])) { - switch ($attrmatch[2]) { - case '=': { - if ($dom[$key]['attribute'][$att] == $val) { - $valid = true; - } - break; - } - case '~=': { - if (in_array($val, explode(' ', $dom[$key]['attribute'][$att]))) { - $valid = true; - } - break; - } - case '^=': { - if ($val == substr($dom[$key]['attribute'][$att], 0, strlen($val))) { - $valid = true; - } - break; - } - case '$=': { - if ($val == substr($dom[$key]['attribute'][$att], -strlen($val))) { - $valid = true; - } - break; - } - case '*=': { - if (strpos($dom[$key]['attribute'][$att], $val) !== false) { - $valid = true; - } - break; - } - case '|=': { - if ($dom[$key]['attribute'][$att] == $val) { - $valid = true; - } elseif (preg_match('/'.$val.'[\-]{1}/i', $dom[$key]['attribute'][$att]) > 0) { - $valid = true; - } - break; - } - default: { - $valid = true; - } - } - } - } - break; - } - case ':': { // pseudo-class or pseudo-element - if ($attrib[1] == ':') { // pseudo-element - // pseudo-elements are not supported! - // (::first-line, ::first-letter, ::before, ::after) - } else { // pseudo-class - // pseudo-classes are not supported! - // (:root, :nth-child(n), :nth-last-child(n), :nth-of-type(n), :nth-last-of-type(n), :first-child, :last-child, :first-of-type, :last-of-type, :only-child, :only-of-type, :empty, :link, :visited, :active, :hover, :focus, :target, :lang(fr), :enabled, :disabled, :checked) - } - break; - } - } // end of switch - } else { - $valid = true; - } - if ($valid AND ($offset > 0)) { - $valid = false; - // check remaining selector part - $selector = substr($selector, 0, $offset); - switch ($operator) { - case ' ': { // descendant of an element - while ($dom[$key]['parent'] > 0) { - if (self::isValidCSSSelectorForTag($dom, $dom[$key]['parent'], $selector)) { - $valid = true; - break; - } else { - $key = $dom[$key]['parent']; - } - } - break; - } - case '>': { // child of an element - $valid = self::isValidCSSSelectorForTag($dom, $dom[$key]['parent'], $selector); - break; - } - case '+': { // immediately preceded by an element - for ($i = ($key - 1); $i > $dom[$key]['parent']; --$i) { - if ($dom[$i]['tag'] AND $dom[$i]['opening']) { - $valid = self::isValidCSSSelectorForTag($dom, $i, $selector); - break; - } - } - break; - } - case '~': { // preceded by an element - for ($i = ($key - 1); $i > $dom[$key]['parent']; --$i) { - if ($dom[$i]['tag'] AND $dom[$i]['opening']) { - if (self::isValidCSSSelectorForTag($dom, $i, $selector)) { - break; - } - } - } - break; - } - } - } - } - } - return $valid; - } - - /** - * Returns the styles array that apply for the selected HTML tag. - * @param $dom (array) array of HTML tags and properties - * @param $key (int) key of the current HTML tag - * @param $css (array) array of CSS properties - * @return array containing CSS properties - * @since 5.1.000 (2010-05-25) - * @public static - */ - public static function getCSSdataArray($dom, $key, $css) { - $cssarray = array(); // style to be returned - // get parent CSS selectors - $selectors = array(); - if (isset($dom[($dom[$key]['parent'])]['csssel'])) { - $selectors = $dom[($dom[$key]['parent'])]['csssel']; - } - // get all styles that apply - foreach($css as $selector => $style) { - $pos = strpos($selector, ' '); - // get specificity - $specificity = substr($selector, 0, $pos); - // remove specificity - $selector = substr($selector, $pos); - // check if this selector apply to current tag - if (self::isValidCSSSelectorForTag($dom, $key, $selector)) { - if (!in_array($selector, $selectors)) { - // add style if not already added on parent selector - $cssarray[] = array('k' => $selector, 's' => $specificity, 'c' => $style); - $selectors[] = $selector; - } - } - } - if (isset($dom[$key]['attribute']['style'])) { - // attach inline style (latest properties have high priority) - $cssarray[] = array('k' => '', 's' => '1000', 'c' => $dom[$key]['attribute']['style']); - } - // order the css array to account for specificity - $cssordered = array(); - foreach ($cssarray as $key => $val) { - $skey = sprintf('%04d', $key); - $cssordered[$val['s'].'_'.$skey] = $val; - } - // sort selectors alphabetically to account for specificity - ksort($cssordered, SORT_STRING); - return array($selectors, $cssordered); - } - - /** - * Compact CSS data array into single string. - * @param $css (array) array of CSS properties - * @return string containing merged CSS properties - * @since 5.9.070 (2011-04-19) - * @public static - */ - public static function getTagStyleFromCSSarray($css) { - $tagstyle = ''; // value to be returned - foreach ($css as $style) { - // split single css commands - $csscmds = explode(';', $style['c']); - foreach ($csscmds as $cmd) { - if (!empty($cmd)) { - $pos = strpos($cmd, ':'); - if ($pos !== false) { - $cmd = substr($cmd, 0, ($pos + 1)); - if (strpos($tagstyle, $cmd) !== false) { - // remove duplicate commands (last commands have high priority) - $tagstyle = preg_replace('/'.$cmd.'[^;]+/i', '', $tagstyle); - } - } - } - } - $tagstyle .= ';'.$style['c']; - } - // remove multiple semicolons - $tagstyle = preg_replace('/[;]+/', ';', $tagstyle); - return $tagstyle; - } - - /** - * Returns the Roman representation of an integer number - * @param $number (int) number to convert - * @return string roman representation of the specified number - * @since 4.4.004 (2008-12-10) - * @public static - */ - public static function intToRoman($number) { - $roman = ''; - while ($number >= 1000) { - $roman .= 'M'; - $number -= 1000; - } - while ($number >= 900) { - $roman .= 'CM'; - $number -= 900; - } - while ($number >= 500) { - $roman .= 'D'; - $number -= 500; - } - while ($number >= 400) { - $roman .= 'CD'; - $number -= 400; - } - while ($number >= 100) { - $roman .= 'C'; - $number -= 100; - } - while ($number >= 90) { - $roman .= 'XC'; - $number -= 90; - } - while ($number >= 50) { - $roman .= 'L'; - $number -= 50; - } - while ($number >= 40) { - $roman .= 'XL'; - $number -= 40; - } - while ($number >= 10) { - $roman .= 'X'; - $number -= 10; - } - while ($number >= 9) { - $roman .= 'IX'; - $number -= 9; - } - while ($number >= 5) { - $roman .= 'V'; - $number -= 5; - } - while ($number >= 4) { - $roman .= 'IV'; - $number -= 4; - } - while ($number >= 1) { - $roman .= 'I'; - --$number; - } - return $roman; - } - - /** - * Find position of last occurrence of a substring in a string - * @param $haystack (string) The string to search in. - * @param $needle (string) substring to search. - * @param $offset (int) May be specified to begin searching an arbitrary number of characters into the string. - * @return Returns the position where the needle exists. Returns FALSE if the needle was not found. - * @since 4.8.038 (2010-03-13) - * @public static - */ - public static function revstrpos($haystack, $needle, $offset = 0) { - $length = strlen($haystack); - $offset = ($offset > 0)?($length - $offset):abs($offset); - $pos = strpos(strrev($haystack), strrev($needle), $offset); - return ($pos === false)?false:($length - $pos - strlen($needle)); - } - - /** - * Returns an array of hyphenation patterns. - * @param $file (string) TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ - * @return array of hyphenation patterns - * @author Nicola Asuni - * @since 4.9.012 (2010-04-12) - * @public static - */ - public static function getHyphenPatternsFromTEX($file) { - // TEX patterns are available at: - // http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ - $data = file_get_contents($file); - $patterns = array(); - // remove comments - $data = preg_replace('/\%[^\n]*/', '', $data); - // extract the patterns part - preg_match('/\\\\patterns\{([^\}]*)\}/i', $data, $matches); - $data = trim(substr($matches[0], 10, -1)); - // extract each pattern - $patterns_array = preg_split('/[\s]+/', $data); - // create new language array of patterns - $patterns = array(); - foreach($patterns_array as $val) { - if (!TCPDF_STATIC::empty_string($val)) { - $val = trim($val); - $val = str_replace('\'', '\\\'', $val); - $key = preg_replace('/[0-9]+/', '', $val); - $patterns[$key] = $val; - } - } - return $patterns; - } - - /** - * Get the Path-Painting Operators. - * @param $style (string) Style of rendering. Possible values are: - *
      - *
    • S or D: Stroke the path.
    • - *
    • s or d: Close and stroke the path.
    • - *
    • f or F: Fill the path, using the nonzero winding number rule to determine the region to fill.
    • - *
    • f* or F*: Fill the path, using the even-odd rule to determine the region to fill.
    • - *
    • B or FD or DF: Fill and then stroke the path, using the nonzero winding number rule to determine the region to fill.
    • - *
    • B* or F*D or DF*: Fill and then stroke the path, using the even-odd rule to determine the region to fill.
    • - *
    • b or fd or df: Close, fill, and then stroke the path, using the nonzero winding number rule to determine the region to fill.
    • - *
    • b or f*d or df*: Close, fill, and then stroke the path, using the even-odd rule to determine the region to fill.
    • - *
    • CNZ: Clipping mode using the even-odd rule to determine which regions lie inside the clipping path.
    • - *
    • CEO: Clipping mode using the nonzero winding number rule to determine which regions lie inside the clipping path
    • - *
    • n: End the path object without filling or stroking it.
    • - *
    - * @param $default (string) default style - * @author Nicola Asuni - * @since 5.0.000 (2010-04-30) - * @public static - */ - public static function getPathPaintOperator($style, $default='S') { - $op = ''; - switch($style) { - case 'S': - case 'D': { - $op = 'S'; - break; - } - case 's': - case 'd': { - $op = 's'; - break; - } - case 'f': - case 'F': { - $op = 'f'; - break; - } - case 'f*': - case 'F*': { - $op = 'f*'; - break; - } - case 'B': - case 'FD': - case 'DF': { - $op = 'B'; - break; - } - case 'B*': - case 'F*D': - case 'DF*': { - $op = 'B*'; - break; - } - case 'b': - case 'fd': - case 'df': { - $op = 'b'; - break; - } - case 'b*': - case 'f*d': - case 'df*': { - $op = 'b*'; - break; - } - case 'CNZ': { - $op = 'W n'; - break; - } - case 'CEO': { - $op = 'W* n'; - break; - } - case 'n': { - $op = 'n'; - break; - } - default: { - if (!empty($default)) { - $op = self::getPathPaintOperator($default, ''); - } else { - $op = ''; - } - } - } - return $op; - } - - /** - * Get the product of two SVG tranformation matrices - * @param $ta (array) first SVG tranformation matrix - * @param $tb (array) second SVG tranformation matrix - * @return transformation array - * @author Nicola Asuni - * @since 5.0.000 (2010-05-02) - * @public static - */ - public static function getTransformationMatrixProduct($ta, $tb) { - $tm = array(); - $tm[0] = ($ta[0] * $tb[0]) + ($ta[2] * $tb[1]); - $tm[1] = ($ta[1] * $tb[0]) + ($ta[3] * $tb[1]); - $tm[2] = ($ta[0] * $tb[2]) + ($ta[2] * $tb[3]); - $tm[3] = ($ta[1] * $tb[2]) + ($ta[3] * $tb[3]); - $tm[4] = ($ta[0] * $tb[4]) + ($ta[2] * $tb[5]) + $ta[4]; - $tm[5] = ($ta[1] * $tb[4]) + ($ta[3] * $tb[5]) + $ta[5]; - return $tm; - } - - /** - * Get the tranformation matrix from SVG transform attribute - * @param $attribute (string) transformation - * @return array of transformations - * @author Nicola Asuni - * @since 5.0.000 (2010-05-02) - * @public static - */ - public static function getSVGTransformMatrix($attribute) { - // identity matrix - $tm = array(1, 0, 0, 1, 0, 0); - $transform = array(); - if (preg_match_all('/(matrix|translate|scale|rotate|skewX|skewY)[\s]*\(([^\)]+)\)/si', $attribute, $transform, PREG_SET_ORDER) > 0) { - foreach ($transform as $key => $data) { - if (!empty($data[2])) { - $a = 1; - $b = 0; - $c = 0; - $d = 1; - $e = 0; - $f = 0; - $regs = array(); - switch ($data[1]) { - case 'matrix': { - if (preg_match('/([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $a = $regs[1]; - $b = $regs[2]; - $c = $regs[3]; - $d = $regs[4]; - $e = $regs[5]; - $f = $regs[6]; - } - break; - } - case 'translate': { - if (preg_match('/([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $e = $regs[1]; - $f = $regs[2]; - } elseif (preg_match('/([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $e = $regs[1]; - } - break; - } - case 'scale': { - if (preg_match('/([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $a = $regs[1]; - $d = $regs[2]; - } elseif (preg_match('/([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $a = $regs[1]; - $d = $a; - } - break; - } - case 'rotate': { - if (preg_match('/([0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $ang = deg2rad($regs[1]); - $x = $regs[2]; - $y = $regs[3]; - $a = cos($ang); - $b = sin($ang); - $c = -$b; - $d = $a; - $e = ($x * (1 - $a)) - ($y * $c); - $f = ($y * (1 - $d)) - ($x * $b); - } elseif (preg_match('/([0-9\-\.]+)/si', $data[2], $regs)) { - $ang = deg2rad($regs[1]); - $a = cos($ang); - $b = sin($ang); - $c = -$b; - $d = $a; - $e = 0; - $f = 0; - } - break; - } - case 'skewX': { - if (preg_match('/([0-9\-\.]+)/si', $data[2], $regs)) { - $c = tan(deg2rad($regs[1])); - } - break; - } - case 'skewY': { - if (preg_match('/([0-9\-\.]+)/si', $data[2], $regs)) { - $b = tan(deg2rad($regs[1])); - } - break; - } - } - $tm = self::getTransformationMatrixProduct($tm, array($a, $b, $c, $d, $e, $f)); - } - } - } - return $tm; - } - - /** - * Returns the angle in radiants between two vectors - * @param $x1 (int) X coordinate of first vector point - * @param $y1 (int) Y coordinate of first vector point - * @param $x2 (int) X coordinate of second vector point - * @param $y2 (int) Y coordinate of second vector point - * @author Nicola Asuni - * @since 5.0.000 (2010-05-04) - * @public static - */ - public static function getVectorsAngle($x1, $y1, $x2, $y2) { - $dprod = ($x1 * $x2) + ($y1 * $y2); - $dist1 = sqrt(($x1 * $x1) + ($y1 * $y1)); - $dist2 = sqrt(($x2 * $x2) + ($y2 * $y2)); - $angle = acos($dprod / ($dist1 * $dist2)); - if (is_nan($angle)) { - $angle = M_PI; - } - if ((($x1 * $y2) - ($x2 * $y1)) < 0) { - $angle *= -1; - } - return $angle; - } - - - - - - - - - - - - - - - - - -// ==================================================================================================================== -// REIMPLEMENTED -// ==================================================================================================================== - - - - - - - - - - - - - - - /** - * Split string by a regular expression. - * This is a wrapper for the preg_split function to avoid the bug: https://bugs.php.net/bug.php?id=45850 - * @param $pattern (string) The regular expression pattern to search for without the modifiers, as a string. - * @param $modifiers (string) The modifiers part of the pattern, - * @param $subject (string) The input string. - * @param $limit (int) If specified, then only substrings up to limit are returned with the rest of the string being placed in the last substring. A limit of -1, 0 or NULL means "no limit" and, as is standard across PHP, you can use NULL to skip to the flags parameter. - * @param $flags (int) The flags as specified on the preg_split PHP function. - * @return Returns an array containing substrings of subject split along boundaries matched by pattern.modifier - * @author Nicola Asuni - * @since 6.0.023 - * @public static - */ - public static function pregSplit($pattern, $modifiers, $subject, $limit=NULL, $flags=NULL) { - // the bug only happens on PHP 5.2 when using the u modifier - if ((strpos($modifiers, 'u') === FALSE) OR (count(preg_split('//u', "\n\t", -1, PREG_SPLIT_NO_EMPTY)) == 2)) { - return preg_split($pattern.$modifiers, $subject, $limit, $flags); - } - // preg_split is bugged - try alternative solution - $ret = array(); - while (($nl = strpos($subject, "\n")) !== FALSE) { - $ret = array_merge($ret, preg_split($pattern.$modifiers, substr($subject, 0, $nl), $limit, $flags)); - $ret[] = "\n"; - $subject = substr($subject, ($nl + 1)); - } - if (strlen($subject) > 0) { - $ret = array_merge($ret, preg_split($pattern.$modifiers, $subject, $limit, $flags)); - } - return $ret; - } - - /** - * Wrapper to use fopen only with local files - * @param filename (string) Name of the file to open - * @param $mode (string) - * @return Returns a file pointer resource on success, or FALSE on error. - * @public static - */ - public static function fopenLocal($filename, $mode) { - if (strpos($filename, '://') === false) { - $filename = 'file://'.$filename; - } elseif (stream_is_local($filename) !== true) { - return false; - } - return fopen($filename, $mode); - } - - /** - * Reads entire file into a string. - * The file can be also an URL. - * @param $file (string) Name of the file or URL to read. - * @return The function returns the read data or FALSE on failure. - * @author Nicola Asuni - * @since 6.0.025 - * @public static - */ - public static function fileGetContents($file) { - $alt = array($file); - // - if ((strlen($file) > 1) - && ($file[0] === '/') - && ($file[1] !== '/') - && !empty($_SERVER['DOCUMENT_ROOT']) - && ($_SERVER['DOCUMENT_ROOT'] !== '/') - ) { - $findroot = strpos($file, $_SERVER['DOCUMENT_ROOT']); - if (($findroot === false) || ($findroot > 1)) { - $alt[] = htmlspecialchars_decode(urldecode($_SERVER['DOCUMENT_ROOT'].$file)); - } - } - // - $protocol = 'http'; - if (!empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) { - $protocol .= 's'; - } - // - $url = $file; - if (preg_match('%^//%', $url) && !empty($_SERVER['HTTP_HOST'])) { - $url = $protocol.':'.str_replace(' ', '%20', $url); - } - $url = htmlspecialchars_decode($url); - $alt[] = $url; - // - if (preg_match('%^(https?)://%', $url) - && empty($_SERVER['HTTP_HOST']) - && empty($_SERVER['DOCUMENT_ROOT']) - ) { - $urldata = parse_url($url); - if (empty($urldata['query'])) { - $host = $protocol.'://'.$_SERVER['HTTP_HOST']; - if (strpos($url, $host) === 0) { - // convert URL to full server path - $tmp = str_replace($host, $_SERVER['DOCUMENT_ROOT'], $url); - $alt[] = htmlspecialchars_decode(urldecode($tmp)); - } - } - } - // - if (isset($_SERVER['SCRIPT_URI']) - && !preg_match('%^(https?|ftp)://%', $file) - && !preg_match('%^//%', $file) - ) { - $urldata = @parse_url($_SERVER['SCRIPT_URI']); - return $urldata['scheme'].'://'.$urldata['host'].(($file[0] == '/') ? '' : '/').$file; - } - // - $alt = array_unique($alt); - //var_dump($alt);exit;//DEBUG - foreach ($alt as $path) { - $ret = @file_get_contents($path); - if ($ret !== false) { - return $ret; - } - // try to use CURL for URLs - if (!ini_get('allow_url_fopen') - && function_exists('curl_init') - && preg_match('%^(https?|ftp)://%', $path) - ) { - // try to get remote file data using cURL - $crs = curl_init(); - curl_setopt($crs, CURLOPT_URL, $path); - curl_setopt($crs, CURLOPT_BINARYTRANSFER, true); - curl_setopt($crs, CURLOPT_FAILONERROR, true); - curl_setopt($crs, CURLOPT_RETURNTRANSFER, true); - if ((ini_get('open_basedir') == '') && (!ini_get('safe_mode'))) { - curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true); - } - curl_setopt($crs, CURLOPT_CONNECTTIMEOUT, 5); - curl_setopt($crs, CURLOPT_TIMEOUT, 30); - curl_setopt($crs, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($crs, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($crs, CURLOPT_USERAGENT, 'tc-lib-file'); - $ret = curl_exec($crs); - curl_close($crs); - if ($ret !== false) { - return $ret; - } - } - } - return false; - } - - - - /** - * Get ULONG from string (Big Endian 32-bit unsigned integer). - * @param $str (string) string from where to extract value - * @param $offset (int) point from where to read the data - * @return int 32 bit value - * @author Nicola Asuni - * @since 5.2.000 (2010-06-02) - * @public static - */ - public static function _getULONG($str, $offset) { - $v = unpack('Ni', substr($str, $offset, 4)); - return $v['i']; - } - - /** - * Get USHORT from string (Big Endian 16-bit unsigned integer). - * @param $str (string) string from where to extract value - * @param $offset (int) point from where to read the data - * @return int 16 bit value - * @author Nicola Asuni - * @since 5.2.000 (2010-06-02) - * @public static - */ - public static function _getUSHORT($str, $offset) { - $v = unpack('ni', substr($str, $offset, 2)); - return $v['i']; - } - - /** - * Get SHORT from string (Big Endian 16-bit signed integer). - * @param $str (string) String from where to extract value. - * @param $offset (int) Point from where to read the data. - * @return int 16 bit value - * @author Nicola Asuni - * @since 5.2.000 (2010-06-02) - * @public static - */ - public static function _getSHORT($str, $offset) { - $v = unpack('si', substr($str, $offset, 2)); - return $v['i']; - } - - /** - * Get FWORD from string (Big Endian 16-bit signed integer). - * @param $str (string) String from where to extract value. - * @param $offset (int) Point from where to read the data. - * @return int 16 bit value - * @author Nicola Asuni - * @since 5.9.123 (2011-09-30) - * @public static - */ - public static function _getFWORD($str, $offset) { - $v = self::_getUSHORT($str, $offset); - if ($v > 0x7fff) { - $v -= 0x10000; - } - return $v; - } - - /** - * Get UFWORD from string (Big Endian 16-bit unsigned integer). - * @param $str (string) string from where to extract value - * @param $offset (int) point from where to read the data - * @return int 16 bit value - * @author Nicola Asuni - * @since 5.9.123 (2011-09-30) - * @public static - */ - public static function _getUFWORD($str, $offset) { - $v = self::_getUSHORT($str, $offset); - return $v; - } - - /** - * Get FIXED from string (32-bit signed fixed-point number (16.16). - * @param $str (string) string from where to extract value - * @param $offset (int) point from where to read the data - * @return int 16 bit value - * @author Nicola Asuni - * @since 5.9.123 (2011-09-30) - * @public static - */ - public static function _getFIXED($str, $offset) { - // mantissa - $m = self::_getFWORD($str, $offset); - // fraction - $f = self::_getUSHORT($str, ($offset + 2)); - $v = floatval(''.$m.'.'.$f.''); - return $v; - } - - /** - * Get BYTE from string (8-bit unsigned integer). - * @param $str (string) String from where to extract value. - * @param $offset (int) Point from where to read the data. - * @return int 8 bit value - * @author Nicola Asuni - * @since 5.2.000 (2010-06-02) - * @public static - */ - public static function _getBYTE($str, $offset) { - $v = unpack('Ci', substr($str, $offset, 1)); - return $v['i']; - } - /** - * Binary-safe and URL-safe file read. - * Reads up to length bytes from the file pointer referenced by handle. Reading stops as soon as one of the following conditions is met: length bytes have been read; EOF (end of file) is reached. - * @param $handle (resource) - * @param $length (int) - * @return Returns the read string or FALSE in case of error. - * @author Nicola Asuni - * @since 4.5.027 (2009-03-16) - * @public static - */ - public static function rfread($handle, $length) { - $data = fread($handle, $length); - if ($data === false) { - return false; - } - $rest = ($length - strlen($data)); - if (($rest > 0) && !feof($handle)) { - $data .= self::rfread($handle, $rest); - } - return $data; - } - - /** - * Read a 4-byte (32 bit) integer from file. - * @param $f (string) file name. - * @return 4-byte integer - * @public static - */ - public static function _freadint($f) { - $a = unpack('Ni', fread($f, 4)); - return $a['i']; - } - - - /** - * Array of page formats - * measures are calculated in this way: (inches * 72) or (millimeters * 72 / 25.4) - * @public static - */ - public static $page_formats = array( - // ISO 216 A Series + 2 SIS 014711 extensions - 'A0' => array( 2383.937, 3370.394), // = ( 841 x 1189 ) mm = ( 33.11 x 46.81 ) in - 'A1' => array( 1683.780, 2383.937), // = ( 594 x 841 ) mm = ( 23.39 x 33.11 ) in - 'A2' => array( 1190.551, 1683.780), // = ( 420 x 594 ) mm = ( 16.54 x 23.39 ) in - 'A3' => array( 841.890, 1190.551), // = ( 297 x 420 ) mm = ( 11.69 x 16.54 ) in - 'A4' => array( 595.276, 841.890), // = ( 210 x 297 ) mm = ( 8.27 x 11.69 ) in - 'A5' => array( 419.528, 595.276), // = ( 148 x 210 ) mm = ( 5.83 x 8.27 ) in - 'A6' => array( 297.638, 419.528), // = ( 105 x 148 ) mm = ( 4.13 x 5.83 ) in - 'A7' => array( 209.764, 297.638), // = ( 74 x 105 ) mm = ( 2.91 x 4.13 ) in - 'A8' => array( 147.402, 209.764), // = ( 52 x 74 ) mm = ( 2.05 x 2.91 ) in - 'A9' => array( 104.882, 147.402), // = ( 37 x 52 ) mm = ( 1.46 x 2.05 ) in - 'A10' => array( 73.701, 104.882), // = ( 26 x 37 ) mm = ( 1.02 x 1.46 ) in - 'A11' => array( 51.024, 73.701), // = ( 18 x 26 ) mm = ( 0.71 x 1.02 ) in - 'A12' => array( 36.850, 51.024), // = ( 13 x 18 ) mm = ( 0.51 x 0.71 ) in - // ISO 216 B Series + 2 SIS 014711 extensions - 'B0' => array( 2834.646, 4008.189), // = ( 1000 x 1414 ) mm = ( 39.37 x 55.67 ) in - 'B1' => array( 2004.094, 2834.646), // = ( 707 x 1000 ) mm = ( 27.83 x 39.37 ) in - 'B2' => array( 1417.323, 2004.094), // = ( 500 x 707 ) mm = ( 19.69 x 27.83 ) in - 'B3' => array( 1000.630, 1417.323), // = ( 353 x 500 ) mm = ( 13.90 x 19.69 ) in - 'B4' => array( 708.661, 1000.630), // = ( 250 x 353 ) mm = ( 9.84 x 13.90 ) in - 'B5' => array( 498.898, 708.661), // = ( 176 x 250 ) mm = ( 6.93 x 9.84 ) in - 'B6' => array( 354.331, 498.898), // = ( 125 x 176 ) mm = ( 4.92 x 6.93 ) in - 'B7' => array( 249.449, 354.331), // = ( 88 x 125 ) mm = ( 3.46 x 4.92 ) in - 'B8' => array( 175.748, 249.449), // = ( 62 x 88 ) mm = ( 2.44 x 3.46 ) in - 'B9' => array( 124.724, 175.748), // = ( 44 x 62 ) mm = ( 1.73 x 2.44 ) in - 'B10' => array( 87.874, 124.724), // = ( 31 x 44 ) mm = ( 1.22 x 1.73 ) in - 'B11' => array( 62.362, 87.874), // = ( 22 x 31 ) mm = ( 0.87 x 1.22 ) in - 'B12' => array( 42.520, 62.362), // = ( 15 x 22 ) mm = ( 0.59 x 0.87 ) in - // ISO 216 C Series + 2 SIS 014711 extensions + 5 EXTENSION - 'C0' => array( 2599.370, 3676.535), // = ( 917 x 1297 ) mm = ( 36.10 x 51.06 ) in - 'C1' => array( 1836.850, 2599.370), // = ( 648 x 917 ) mm = ( 25.51 x 36.10 ) in - 'C2' => array( 1298.268, 1836.850), // = ( 458 x 648 ) mm = ( 18.03 x 25.51 ) in - 'C3' => array( 918.425, 1298.268), // = ( 324 x 458 ) mm = ( 12.76 x 18.03 ) in - 'C4' => array( 649.134, 918.425), // = ( 229 x 324 ) mm = ( 9.02 x 12.76 ) in - 'C5' => array( 459.213, 649.134), // = ( 162 x 229 ) mm = ( 6.38 x 9.02 ) in - 'C6' => array( 323.150, 459.213), // = ( 114 x 162 ) mm = ( 4.49 x 6.38 ) in - 'C7' => array( 229.606, 323.150), // = ( 81 x 114 ) mm = ( 3.19 x 4.49 ) in - 'C8' => array( 161.575, 229.606), // = ( 57 x 81 ) mm = ( 2.24 x 3.19 ) in - 'C9' => array( 113.386, 161.575), // = ( 40 x 57 ) mm = ( 1.57 x 2.24 ) in - 'C10' => array( 79.370, 113.386), // = ( 28 x 40 ) mm = ( 1.10 x 1.57 ) in - 'C11' => array( 56.693, 79.370), // = ( 20 x 28 ) mm = ( 0.79 x 1.10 ) in - 'C12' => array( 39.685, 56.693), // = ( 14 x 20 ) mm = ( 0.55 x 0.79 ) in - 'C76' => array( 229.606, 459.213), // = ( 81 x 162 ) mm = ( 3.19 x 6.38 ) in - 'DL' => array( 311.811, 623.622), // = ( 110 x 220 ) mm = ( 4.33 x 8.66 ) in - 'DLE' => array( 323.150, 637.795), // = ( 114 x 225 ) mm = ( 4.49 x 8.86 ) in - 'DLX' => array( 340.158, 666.142), // = ( 120 x 235 ) mm = ( 4.72 x 9.25 ) in - 'DLP' => array( 280.630, 595.276), // = ( 99 x 210 ) mm = ( 3.90 x 8.27 ) in (1/3 A4) - // SIS 014711 E Series - 'E0' => array( 2491.654, 3517.795), // = ( 879 x 1241 ) mm = ( 34.61 x 48.86 ) in - 'E1' => array( 1757.480, 2491.654), // = ( 620 x 879 ) mm = ( 24.41 x 34.61 ) in - 'E2' => array( 1247.244, 1757.480), // = ( 440 x 620 ) mm = ( 17.32 x 24.41 ) in - 'E3' => array( 878.740, 1247.244), // = ( 310 x 440 ) mm = ( 12.20 x 17.32 ) in - 'E4' => array( 623.622, 878.740), // = ( 220 x 310 ) mm = ( 8.66 x 12.20 ) in - 'E5' => array( 439.370, 623.622), // = ( 155 x 220 ) mm = ( 6.10 x 8.66 ) in - 'E6' => array( 311.811, 439.370), // = ( 110 x 155 ) mm = ( 4.33 x 6.10 ) in - 'E7' => array( 221.102, 311.811), // = ( 78 x 110 ) mm = ( 3.07 x 4.33 ) in - 'E8' => array( 155.906, 221.102), // = ( 55 x 78 ) mm = ( 2.17 x 3.07 ) in - 'E9' => array( 110.551, 155.906), // = ( 39 x 55 ) mm = ( 1.54 x 2.17 ) in - 'E10' => array( 76.535, 110.551), // = ( 27 x 39 ) mm = ( 1.06 x 1.54 ) in - 'E11' => array( 53.858, 76.535), // = ( 19 x 27 ) mm = ( 0.75 x 1.06 ) in - 'E12' => array( 36.850, 53.858), // = ( 13 x 19 ) mm = ( 0.51 x 0.75 ) in - // SIS 014711 G Series - 'G0' => array( 2715.591, 3838.110), // = ( 958 x 1354 ) mm = ( 37.72 x 53.31 ) in - 'G1' => array( 1919.055, 2715.591), // = ( 677 x 958 ) mm = ( 26.65 x 37.72 ) in - 'G2' => array( 1357.795, 1919.055), // = ( 479 x 677 ) mm = ( 18.86 x 26.65 ) in - 'G3' => array( 958.110, 1357.795), // = ( 338 x 479 ) mm = ( 13.31 x 18.86 ) in - 'G4' => array( 677.480, 958.110), // = ( 239 x 338 ) mm = ( 9.41 x 13.31 ) in - 'G5' => array( 479.055, 677.480), // = ( 169 x 239 ) mm = ( 6.65 x 9.41 ) in - 'G6' => array( 337.323, 479.055), // = ( 119 x 169 ) mm = ( 4.69 x 6.65 ) in - 'G7' => array( 238.110, 337.323), // = ( 84 x 119 ) mm = ( 3.31 x 4.69 ) in - 'G8' => array( 167.244, 238.110), // = ( 59 x 84 ) mm = ( 2.32 x 3.31 ) in - 'G9' => array( 119.055, 167.244), // = ( 42 x 59 ) mm = ( 1.65 x 2.32 ) in - 'G10' => array( 82.205, 119.055), // = ( 29 x 42 ) mm = ( 1.14 x 1.65 ) in - 'G11' => array( 59.528, 82.205), // = ( 21 x 29 ) mm = ( 0.83 x 1.14 ) in - 'G12' => array( 39.685, 59.528), // = ( 14 x 21 ) mm = ( 0.55 x 0.83 ) in - // ISO Press - 'RA0' => array( 2437.795, 3458.268), // = ( 860 x 1220 ) mm = ( 33.86 x 48.03 ) in - 'RA1' => array( 1729.134, 2437.795), // = ( 610 x 860 ) mm = ( 24.02 x 33.86 ) in - 'RA2' => array( 1218.898, 1729.134), // = ( 430 x 610 ) mm = ( 16.93 x 24.02 ) in - 'RA3' => array( 864.567, 1218.898), // = ( 305 x 430 ) mm = ( 12.01 x 16.93 ) in - 'RA4' => array( 609.449, 864.567), // = ( 215 x 305 ) mm = ( 8.46 x 12.01 ) in - 'SRA0' => array( 2551.181, 3628.346), // = ( 900 x 1280 ) mm = ( 35.43 x 50.39 ) in - 'SRA1' => array( 1814.173, 2551.181), // = ( 640 x 900 ) mm = ( 25.20 x 35.43 ) in - 'SRA2' => array( 1275.591, 1814.173), // = ( 450 x 640 ) mm = ( 17.72 x 25.20 ) in - 'SRA3' => array( 907.087, 1275.591), // = ( 320 x 450 ) mm = ( 12.60 x 17.72 ) in - 'SRA4' => array( 637.795, 907.087), // = ( 225 x 320 ) mm = ( 8.86 x 12.60 ) in - // German DIN 476 - '4A0' => array( 4767.874, 6740.787), // = ( 1682 x 2378 ) mm = ( 66.22 x 93.62 ) in - '2A0' => array( 3370.394, 4767.874), // = ( 1189 x 1682 ) mm = ( 46.81 x 66.22 ) in - // Variations on the ISO Standard - 'A2_EXTRA' => array( 1261.417, 1754.646), // = ( 445 x 619 ) mm = ( 17.52 x 24.37 ) in - 'A3+' => array( 932.598, 1369.134), // = ( 329 x 483 ) mm = ( 12.95 x 19.02 ) in - 'A3_EXTRA' => array( 912.756, 1261.417), // = ( 322 x 445 ) mm = ( 12.68 x 17.52 ) in - 'A3_SUPER' => array( 864.567, 1440.000), // = ( 305 x 508 ) mm = ( 12.01 x 20.00 ) in - 'SUPER_A3' => array( 864.567, 1380.472), // = ( 305 x 487 ) mm = ( 12.01 x 19.17 ) in - 'A4_EXTRA' => array( 666.142, 912.756), // = ( 235 x 322 ) mm = ( 9.25 x 12.68 ) in - 'A4_SUPER' => array( 649.134, 912.756), // = ( 229 x 322 ) mm = ( 9.02 x 12.68 ) in - 'SUPER_A4' => array( 643.465, 1009.134), // = ( 227 x 356 ) mm = ( 8.94 x 14.02 ) in - 'A4_LONG' => array( 595.276, 986.457), // = ( 210 x 348 ) mm = ( 8.27 x 13.70 ) in - 'F4' => array( 595.276, 935.433), // = ( 210 x 330 ) mm = ( 8.27 x 12.99 ) in - 'SO_B5_EXTRA' => array( 572.598, 782.362), // = ( 202 x 276 ) mm = ( 7.95 x 10.87 ) in - 'A5_EXTRA' => array( 490.394, 666.142), // = ( 173 x 235 ) mm = ( 6.81 x 9.25 ) in - // ANSI Series - 'ANSI_E' => array( 2448.000, 3168.000), // = ( 864 x 1118 ) mm = ( 34.00 x 44.00 ) in - 'ANSI_D' => array( 1584.000, 2448.000), // = ( 559 x 864 ) mm = ( 22.00 x 34.00 ) in - 'ANSI_C' => array( 1224.000, 1584.000), // = ( 432 x 559 ) mm = ( 17.00 x 22.00 ) in - 'ANSI_B' => array( 792.000, 1224.000), // = ( 279 x 432 ) mm = ( 11.00 x 17.00 ) in - 'ANSI_A' => array( 612.000, 792.000), // = ( 216 x 279 ) mm = ( 8.50 x 11.00 ) in - // Traditional 'Loose' North American Paper Sizes - 'USLEDGER' => array( 1224.000, 792.000), // = ( 432 x 279 ) mm = ( 17.00 x 11.00 ) in - 'LEDGER' => array( 1224.000, 792.000), // = ( 432 x 279 ) mm = ( 17.00 x 11.00 ) in - 'ORGANIZERK' => array( 792.000, 1224.000), // = ( 279 x 432 ) mm = ( 11.00 x 17.00 ) in - 'BIBLE' => array( 792.000, 1224.000), // = ( 279 x 432 ) mm = ( 11.00 x 17.00 ) in - 'USTABLOID' => array( 792.000, 1224.000), // = ( 279 x 432 ) mm = ( 11.00 x 17.00 ) in - 'TABLOID' => array( 792.000, 1224.000), // = ( 279 x 432 ) mm = ( 11.00 x 17.00 ) in - 'ORGANIZERM' => array( 612.000, 792.000), // = ( 216 x 279 ) mm = ( 8.50 x 11.00 ) in - 'USLETTER' => array( 612.000, 792.000), // = ( 216 x 279 ) mm = ( 8.50 x 11.00 ) in - 'LETTER' => array( 612.000, 792.000), // = ( 216 x 279 ) mm = ( 8.50 x 11.00 ) in - 'USLEGAL' => array( 612.000, 1008.000), // = ( 216 x 356 ) mm = ( 8.50 x 14.00 ) in - 'LEGAL' => array( 612.000, 1008.000), // = ( 216 x 356 ) mm = ( 8.50 x 14.00 ) in - 'GOVERNMENTLETTER' => array( 576.000, 756.000), // = ( 203 x 267 ) mm = ( 8.00 x 10.50 ) in - 'GLETTER' => array( 576.000, 756.000), // = ( 203 x 267 ) mm = ( 8.00 x 10.50 ) in - 'JUNIORLEGAL' => array( 576.000, 360.000), // = ( 203 x 127 ) mm = ( 8.00 x 5.00 ) in - 'JLEGAL' => array( 576.000, 360.000), // = ( 203 x 127 ) mm = ( 8.00 x 5.00 ) in - // Other North American Paper Sizes - 'QUADDEMY' => array( 2520.000, 3240.000), // = ( 889 x 1143 ) mm = ( 35.00 x 45.00 ) in - 'SUPER_B' => array( 936.000, 1368.000), // = ( 330 x 483 ) mm = ( 13.00 x 19.00 ) in - 'QUARTO' => array( 648.000, 792.000), // = ( 229 x 279 ) mm = ( 9.00 x 11.00 ) in - 'GOVERNMENTLEGAL' => array( 612.000, 936.000), // = ( 216 x 330 ) mm = ( 8.50 x 13.00 ) in - 'FOLIO' => array( 612.000, 936.000), // = ( 216 x 330 ) mm = ( 8.50 x 13.00 ) in - 'MONARCH' => array( 522.000, 756.000), // = ( 184 x 267 ) mm = ( 7.25 x 10.50 ) in - 'EXECUTIVE' => array( 522.000, 756.000), // = ( 184 x 267 ) mm = ( 7.25 x 10.50 ) in - 'ORGANIZERL' => array( 396.000, 612.000), // = ( 140 x 216 ) mm = ( 5.50 x 8.50 ) in - 'STATEMENT' => array( 396.000, 612.000), // = ( 140 x 216 ) mm = ( 5.50 x 8.50 ) in - 'MEMO' => array( 396.000, 612.000), // = ( 140 x 216 ) mm = ( 5.50 x 8.50 ) in - 'FOOLSCAP' => array( 595.440, 936.000), // = ( 210 x 330 ) mm = ( 8.27 x 13.00 ) in - 'COMPACT' => array( 306.000, 486.000), // = ( 108 x 171 ) mm = ( 4.25 x 6.75 ) in - 'ORGANIZERJ' => array( 198.000, 360.000), // = ( 70 x 127 ) mm = ( 2.75 x 5.00 ) in - // Canadian standard CAN 2-9.60M - 'P1' => array( 1587.402, 2437.795), // = ( 560 x 860 ) mm = ( 22.05 x 33.86 ) in - 'P2' => array( 1218.898, 1587.402), // = ( 430 x 560 ) mm = ( 16.93 x 22.05 ) in - 'P3' => array( 793.701, 1218.898), // = ( 280 x 430 ) mm = ( 11.02 x 16.93 ) in - 'P4' => array( 609.449, 793.701), // = ( 215 x 280 ) mm = ( 8.46 x 11.02 ) in - 'P5' => array( 396.850, 609.449), // = ( 140 x 215 ) mm = ( 5.51 x 8.46 ) in - 'P6' => array( 303.307, 396.850), // = ( 107 x 140 ) mm = ( 4.21 x 5.51 ) in - // North American Architectural Sizes - 'ARCH_E' => array( 2592.000, 3456.000), // = ( 914 x 1219 ) mm = ( 36.00 x 48.00 ) in - 'ARCH_E1' => array( 2160.000, 3024.000), // = ( 762 x 1067 ) mm = ( 30.00 x 42.00 ) in - 'ARCH_D' => array( 1728.000, 2592.000), // = ( 610 x 914 ) mm = ( 24.00 x 36.00 ) in - 'BROADSHEET' => array( 1296.000, 1728.000), // = ( 457 x 610 ) mm = ( 18.00 x 24.00 ) in - 'ARCH_C' => array( 1296.000, 1728.000), // = ( 457 x 610 ) mm = ( 18.00 x 24.00 ) in - 'ARCH_B' => array( 864.000, 1296.000), // = ( 305 x 457 ) mm = ( 12.00 x 18.00 ) in - 'ARCH_A' => array( 648.000, 864.000), // = ( 229 x 305 ) mm = ( 9.00 x 12.00 ) in - // -- North American Envelope Sizes - // - Announcement Envelopes - 'ANNENV_A2' => array( 314.640, 414.000), // = ( 111 x 146 ) mm = ( 4.37 x 5.75 ) in - 'ANNENV_A6' => array( 342.000, 468.000), // = ( 121 x 165 ) mm = ( 4.75 x 6.50 ) in - 'ANNENV_A7' => array( 378.000, 522.000), // = ( 133 x 184 ) mm = ( 5.25 x 7.25 ) in - 'ANNENV_A8' => array( 396.000, 584.640), // = ( 140 x 206 ) mm = ( 5.50 x 8.12 ) in - 'ANNENV_A10' => array( 450.000, 692.640), // = ( 159 x 244 ) mm = ( 6.25 x 9.62 ) in - 'ANNENV_SLIM' => array( 278.640, 638.640), // = ( 98 x 225 ) mm = ( 3.87 x 8.87 ) in - // - Commercial Envelopes - 'COMMENV_N6_1/4' => array( 252.000, 432.000), // = ( 89 x 152 ) mm = ( 3.50 x 6.00 ) in - 'COMMENV_N6_3/4' => array( 260.640, 468.000), // = ( 92 x 165 ) mm = ( 3.62 x 6.50 ) in - 'COMMENV_N8' => array( 278.640, 540.000), // = ( 98 x 191 ) mm = ( 3.87 x 7.50 ) in - 'COMMENV_N9' => array( 278.640, 638.640), // = ( 98 x 225 ) mm = ( 3.87 x 8.87 ) in - 'COMMENV_N10' => array( 296.640, 684.000), // = ( 105 x 241 ) mm = ( 4.12 x 9.50 ) in - 'COMMENV_N11' => array( 324.000, 746.640), // = ( 114 x 263 ) mm = ( 4.50 x 10.37 ) in - 'COMMENV_N12' => array( 342.000, 792.000), // = ( 121 x 279 ) mm = ( 4.75 x 11.00 ) in - 'COMMENV_N14' => array( 360.000, 828.000), // = ( 127 x 292 ) mm = ( 5.00 x 11.50 ) in - // - Catalogue Envelopes - 'CATENV_N1' => array( 432.000, 648.000), // = ( 152 x 229 ) mm = ( 6.00 x 9.00 ) in - 'CATENV_N1_3/4' => array( 468.000, 684.000), // = ( 165 x 241 ) mm = ( 6.50 x 9.50 ) in - 'CATENV_N2' => array( 468.000, 720.000), // = ( 165 x 254 ) mm = ( 6.50 x 10.00 ) in - 'CATENV_N3' => array( 504.000, 720.000), // = ( 178 x 254 ) mm = ( 7.00 x 10.00 ) in - 'CATENV_N6' => array( 540.000, 756.000), // = ( 191 x 267 ) mm = ( 7.50 x 10.50 ) in - 'CATENV_N7' => array( 576.000, 792.000), // = ( 203 x 279 ) mm = ( 8.00 x 11.00 ) in - 'CATENV_N8' => array( 594.000, 810.000), // = ( 210 x 286 ) mm = ( 8.25 x 11.25 ) in - 'CATENV_N9_1/2' => array( 612.000, 756.000), // = ( 216 x 267 ) mm = ( 8.50 x 10.50 ) in - 'CATENV_N9_3/4' => array( 630.000, 810.000), // = ( 222 x 286 ) mm = ( 8.75 x 11.25 ) in - 'CATENV_N10_1/2' => array( 648.000, 864.000), // = ( 229 x 305 ) mm = ( 9.00 x 12.00 ) in - 'CATENV_N12_1/2' => array( 684.000, 900.000), // = ( 241 x 318 ) mm = ( 9.50 x 12.50 ) in - 'CATENV_N13_1/2' => array( 720.000, 936.000), // = ( 254 x 330 ) mm = ( 10.00 x 13.00 ) in - 'CATENV_N14_1/4' => array( 810.000, 882.000), // = ( 286 x 311 ) mm = ( 11.25 x 12.25 ) in - 'CATENV_N14_1/2' => array( 828.000, 1044.000), // = ( 292 x 368 ) mm = ( 11.50 x 14.50 ) in - // Japanese (JIS P 0138-61) Standard B-Series - 'JIS_B0' => array( 2919.685, 4127.244), // = ( 1030 x 1456 ) mm = ( 40.55 x 57.32 ) in - 'JIS_B1' => array( 2063.622, 2919.685), // = ( 728 x 1030 ) mm = ( 28.66 x 40.55 ) in - 'JIS_B2' => array( 1459.843, 2063.622), // = ( 515 x 728 ) mm = ( 20.28 x 28.66 ) in - 'JIS_B3' => array( 1031.811, 1459.843), // = ( 364 x 515 ) mm = ( 14.33 x 20.28 ) in - 'JIS_B4' => array( 728.504, 1031.811), // = ( 257 x 364 ) mm = ( 10.12 x 14.33 ) in - 'JIS_B5' => array( 515.906, 728.504), // = ( 182 x 257 ) mm = ( 7.17 x 10.12 ) in - 'JIS_B6' => array( 362.835, 515.906), // = ( 128 x 182 ) mm = ( 5.04 x 7.17 ) in - 'JIS_B7' => array( 257.953, 362.835), // = ( 91 x 128 ) mm = ( 3.58 x 5.04 ) in - 'JIS_B8' => array( 181.417, 257.953), // = ( 64 x 91 ) mm = ( 2.52 x 3.58 ) in - 'JIS_B9' => array( 127.559, 181.417), // = ( 45 x 64 ) mm = ( 1.77 x 2.52 ) in - 'JIS_B10' => array( 90.709, 127.559), // = ( 32 x 45 ) mm = ( 1.26 x 1.77 ) in - 'JIS_B11' => array( 62.362, 90.709), // = ( 22 x 32 ) mm = ( 0.87 x 1.26 ) in - 'JIS_B12' => array( 45.354, 62.362), // = ( 16 x 22 ) mm = ( 0.63 x 0.87 ) in - // PA Series - 'PA0' => array( 2381.102, 3174.803), // = ( 840 x 1120 ) mm = ( 33.07 x 44.09 ) in - 'PA1' => array( 1587.402, 2381.102), // = ( 560 x 840 ) mm = ( 22.05 x 33.07 ) in - 'PA2' => array( 1190.551, 1587.402), // = ( 420 x 560 ) mm = ( 16.54 x 22.05 ) in - 'PA3' => array( 793.701, 1190.551), // = ( 280 x 420 ) mm = ( 11.02 x 16.54 ) in - 'PA4' => array( 595.276, 793.701), // = ( 210 x 280 ) mm = ( 8.27 x 11.02 ) in - 'PA5' => array( 396.850, 595.276), // = ( 140 x 210 ) mm = ( 5.51 x 8.27 ) in - 'PA6' => array( 297.638, 396.850), // = ( 105 x 140 ) mm = ( 4.13 x 5.51 ) in - 'PA7' => array( 198.425, 297.638), // = ( 70 x 105 ) mm = ( 2.76 x 4.13 ) in - 'PA8' => array( 147.402, 198.425), // = ( 52 x 70 ) mm = ( 2.05 x 2.76 ) in - 'PA9' => array( 99.213, 147.402), // = ( 35 x 52 ) mm = ( 1.38 x 2.05 ) in - 'PA10' => array( 73.701, 99.213), // = ( 26 x 35 ) mm = ( 1.02 x 1.38 ) in - // Standard Photographic Print Sizes - 'PASSPORT_PHOTO' => array( 99.213, 127.559), // = ( 35 x 45 ) mm = ( 1.38 x 1.77 ) in - 'E' => array( 233.858, 340.157), // = ( 82 x 120 ) mm = ( 3.25 x 4.72 ) in - 'L' => array( 252.283, 360.000), // = ( 89 x 127 ) mm = ( 3.50 x 5.00 ) in - '3R' => array( 252.283, 360.000), // = ( 89 x 127 ) mm = ( 3.50 x 5.00 ) in - 'KG' => array( 289.134, 430.866), // = ( 102 x 152 ) mm = ( 4.02 x 5.98 ) in - '4R' => array( 289.134, 430.866), // = ( 102 x 152 ) mm = ( 4.02 x 5.98 ) in - '4D' => array( 340.157, 430.866), // = ( 120 x 152 ) mm = ( 4.72 x 5.98 ) in - '2L' => array( 360.000, 504.567), // = ( 127 x 178 ) mm = ( 5.00 x 7.01 ) in - '5R' => array( 360.000, 504.567), // = ( 127 x 178 ) mm = ( 5.00 x 7.01 ) in - '8P' => array( 430.866, 575.433), // = ( 152 x 203 ) mm = ( 5.98 x 7.99 ) in - '6R' => array( 430.866, 575.433), // = ( 152 x 203 ) mm = ( 5.98 x 7.99 ) in - '6P' => array( 575.433, 720.000), // = ( 203 x 254 ) mm = ( 7.99 x 10.00 ) in - '8R' => array( 575.433, 720.000), // = ( 203 x 254 ) mm = ( 7.99 x 10.00 ) in - '6PW' => array( 575.433, 864.567), // = ( 203 x 305 ) mm = ( 7.99 x 12.01 ) in - 'S8R' => array( 575.433, 864.567), // = ( 203 x 305 ) mm = ( 7.99 x 12.01 ) in - '4P' => array( 720.000, 864.567), // = ( 254 x 305 ) mm = ( 10.00 x 12.01 ) in - '10R' => array( 720.000, 864.567), // = ( 254 x 305 ) mm = ( 10.00 x 12.01 ) in - '4PW' => array( 720.000, 1080.000), // = ( 254 x 381 ) mm = ( 10.00 x 15.00 ) in - 'S10R' => array( 720.000, 1080.000), // = ( 254 x 381 ) mm = ( 10.00 x 15.00 ) in - '11R' => array( 790.866, 1009.134), // = ( 279 x 356 ) mm = ( 10.98 x 14.02 ) in - 'S11R' => array( 790.866, 1224.567), // = ( 279 x 432 ) mm = ( 10.98 x 17.01 ) in - '12R' => array( 864.567, 1080.000), // = ( 305 x 381 ) mm = ( 12.01 x 15.00 ) in - 'S12R' => array( 864.567, 1292.598), // = ( 305 x 456 ) mm = ( 12.01 x 17.95 ) in - // Common Newspaper Sizes - 'NEWSPAPER_BROADSHEET' => array( 2125.984, 1700.787), // = ( 750 x 600 ) mm = ( 29.53 x 23.62 ) in - 'NEWSPAPER_BERLINER' => array( 1332.283, 892.913), // = ( 470 x 315 ) mm = ( 18.50 x 12.40 ) in - 'NEWSPAPER_TABLOID' => array( 1218.898, 793.701), // = ( 430 x 280 ) mm = ( 16.93 x 11.02 ) in - 'NEWSPAPER_COMPACT' => array( 1218.898, 793.701), // = ( 430 x 280 ) mm = ( 16.93 x 11.02 ) in - // Business Cards - 'CREDIT_CARD' => array( 153.014, 242.646), // = ( 54 x 86 ) mm = ( 2.13 x 3.37 ) in - 'BUSINESS_CARD' => array( 153.014, 242.646), // = ( 54 x 86 ) mm = ( 2.13 x 3.37 ) in - 'BUSINESS_CARD_ISO7810' => array( 153.014, 242.646), // = ( 54 x 86 ) mm = ( 2.13 x 3.37 ) in - 'BUSINESS_CARD_ISO216' => array( 147.402, 209.764), // = ( 52 x 74 ) mm = ( 2.05 x 2.91 ) in - 'BUSINESS_CARD_IT' => array( 155.906, 240.945), // = ( 55 x 85 ) mm = ( 2.17 x 3.35 ) in - 'BUSINESS_CARD_UK' => array( 155.906, 240.945), // = ( 55 x 85 ) mm = ( 2.17 x 3.35 ) in - 'BUSINESS_CARD_FR' => array( 155.906, 240.945), // = ( 55 x 85 ) mm = ( 2.17 x 3.35 ) in - 'BUSINESS_CARD_DE' => array( 155.906, 240.945), // = ( 55 x 85 ) mm = ( 2.17 x 3.35 ) in - 'BUSINESS_CARD_ES' => array( 155.906, 240.945), // = ( 55 x 85 ) mm = ( 2.17 x 3.35 ) in - 'BUSINESS_CARD_CA' => array( 144.567, 252.283), // = ( 51 x 89 ) mm = ( 2.01 x 3.50 ) in - 'BUSINESS_CARD_US' => array( 144.567, 252.283), // = ( 51 x 89 ) mm = ( 2.01 x 3.50 ) in - 'BUSINESS_CARD_JP' => array( 155.906, 257.953), // = ( 55 x 91 ) mm = ( 2.17 x 3.58 ) in - 'BUSINESS_CARD_HK' => array( 153.071, 255.118), // = ( 54 x 90 ) mm = ( 2.13 x 3.54 ) in - 'BUSINESS_CARD_AU' => array( 155.906, 255.118), // = ( 55 x 90 ) mm = ( 2.17 x 3.54 ) in - 'BUSINESS_CARD_DK' => array( 155.906, 255.118), // = ( 55 x 90 ) mm = ( 2.17 x 3.54 ) in - 'BUSINESS_CARD_SE' => array( 155.906, 255.118), // = ( 55 x 90 ) mm = ( 2.17 x 3.54 ) in - 'BUSINESS_CARD_RU' => array( 141.732, 255.118), // = ( 50 x 90 ) mm = ( 1.97 x 3.54 ) in - 'BUSINESS_CARD_CZ' => array( 141.732, 255.118), // = ( 50 x 90 ) mm = ( 1.97 x 3.54 ) in - 'BUSINESS_CARD_FI' => array( 141.732, 255.118), // = ( 50 x 90 ) mm = ( 1.97 x 3.54 ) in - 'BUSINESS_CARD_HU' => array( 141.732, 255.118), // = ( 50 x 90 ) mm = ( 1.97 x 3.54 ) in - 'BUSINESS_CARD_IL' => array( 141.732, 255.118), // = ( 50 x 90 ) mm = ( 1.97 x 3.54 ) in - // Billboards - '4SHEET' => array( 2880.000, 4320.000), // = ( 1016 x 1524 ) mm = ( 40.00 x 60.00 ) in - '6SHEET' => array( 3401.575, 5102.362), // = ( 1200 x 1800 ) mm = ( 47.24 x 70.87 ) in - '12SHEET' => array( 8640.000, 4320.000), // = ( 3048 x 1524 ) mm = (120.00 x 60.00 ) in - '16SHEET' => array( 5760.000, 8640.000), // = ( 2032 x 3048 ) mm = ( 80.00 x 120.00) in - '32SHEET' => array(11520.000, 8640.000), // = ( 4064 x 3048 ) mm = (160.00 x 120.00) in - '48SHEET' => array(17280.000, 8640.000), // = ( 6096 x 3048 ) mm = (240.00 x 120.00) in - '64SHEET' => array(23040.000, 8640.000), // = ( 8128 x 3048 ) mm = (320.00 x 120.00) in - '96SHEET' => array(34560.000, 8640.000), // = (12192 x 3048 ) mm = (480.00 x 120.00) in - // -- Old European Sizes - // - Old Imperial English Sizes - 'EN_EMPEROR' => array( 3456.000, 5184.000), // = ( 1219 x 1829 ) mm = ( 48.00 x 72.00 ) in - 'EN_ANTIQUARIAN' => array( 2232.000, 3816.000), // = ( 787 x 1346 ) mm = ( 31.00 x 53.00 ) in - 'EN_GRAND_EAGLE' => array( 2070.000, 3024.000), // = ( 730 x 1067 ) mm = ( 28.75 x 42.00 ) in - 'EN_DOUBLE_ELEPHANT' => array( 1926.000, 2880.000), // = ( 679 x 1016 ) mm = ( 26.75 x 40.00 ) in - 'EN_ATLAS' => array( 1872.000, 2448.000), // = ( 660 x 864 ) mm = ( 26.00 x 34.00 ) in - 'EN_COLOMBIER' => array( 1692.000, 2484.000), // = ( 597 x 876 ) mm = ( 23.50 x 34.50 ) in - 'EN_ELEPHANT' => array( 1656.000, 2016.000), // = ( 584 x 711 ) mm = ( 23.00 x 28.00 ) in - 'EN_DOUBLE_DEMY' => array( 1620.000, 2556.000), // = ( 572 x 902 ) mm = ( 22.50 x 35.50 ) in - 'EN_IMPERIAL' => array( 1584.000, 2160.000), // = ( 559 x 762 ) mm = ( 22.00 x 30.00 ) in - 'EN_PRINCESS' => array( 1548.000, 2016.000), // = ( 546 x 711 ) mm = ( 21.50 x 28.00 ) in - 'EN_CARTRIDGE' => array( 1512.000, 1872.000), // = ( 533 x 660 ) mm = ( 21.00 x 26.00 ) in - 'EN_DOUBLE_LARGE_POST' => array( 1512.000, 2376.000), // = ( 533 x 838 ) mm = ( 21.00 x 33.00 ) in - 'EN_ROYAL' => array( 1440.000, 1800.000), // = ( 508 x 635 ) mm = ( 20.00 x 25.00 ) in - 'EN_SHEET' => array( 1404.000, 1692.000), // = ( 495 x 597 ) mm = ( 19.50 x 23.50 ) in - 'EN_HALF_POST' => array( 1404.000, 1692.000), // = ( 495 x 597 ) mm = ( 19.50 x 23.50 ) in - 'EN_SUPER_ROYAL' => array( 1368.000, 1944.000), // = ( 483 x 686 ) mm = ( 19.00 x 27.00 ) in - 'EN_DOUBLE_POST' => array( 1368.000, 2196.000), // = ( 483 x 775 ) mm = ( 19.00 x 30.50 ) in - 'EN_MEDIUM' => array( 1260.000, 1656.000), // = ( 445 x 584 ) mm = ( 17.50 x 23.00 ) in - 'EN_DEMY' => array( 1260.000, 1620.000), // = ( 445 x 572 ) mm = ( 17.50 x 22.50 ) in - 'EN_LARGE_POST' => array( 1188.000, 1512.000), // = ( 419 x 533 ) mm = ( 16.50 x 21.00 ) in - 'EN_COPY_DRAUGHT' => array( 1152.000, 1440.000), // = ( 406 x 508 ) mm = ( 16.00 x 20.00 ) in - 'EN_POST' => array( 1116.000, 1386.000), // = ( 394 x 489 ) mm = ( 15.50 x 19.25 ) in - 'EN_CROWN' => array( 1080.000, 1440.000), // = ( 381 x 508 ) mm = ( 15.00 x 20.00 ) in - 'EN_PINCHED_POST' => array( 1062.000, 1332.000), // = ( 375 x 470 ) mm = ( 14.75 x 18.50 ) in - 'EN_BRIEF' => array( 972.000, 1152.000), // = ( 343 x 406 ) mm = ( 13.50 x 16.00 ) in - 'EN_FOOLSCAP' => array( 972.000, 1224.000), // = ( 343 x 432 ) mm = ( 13.50 x 17.00 ) in - 'EN_SMALL_FOOLSCAP' => array( 954.000, 1188.000), // = ( 337 x 419 ) mm = ( 13.25 x 16.50 ) in - 'EN_POTT' => array( 900.000, 1080.000), // = ( 318 x 381 ) mm = ( 12.50 x 15.00 ) in - // - Old Imperial Belgian Sizes - 'BE_GRAND_AIGLE' => array( 1984.252, 2948.031), // = ( 700 x 1040 ) mm = ( 27.56 x 40.94 ) in - 'BE_COLOMBIER' => array( 1757.480, 2409.449), // = ( 620 x 850 ) mm = ( 24.41 x 33.46 ) in - 'BE_DOUBLE_CARRE' => array( 1757.480, 2607.874), // = ( 620 x 920 ) mm = ( 24.41 x 36.22 ) in - 'BE_ELEPHANT' => array( 1746.142, 2182.677), // = ( 616 x 770 ) mm = ( 24.25 x 30.31 ) in - 'BE_PETIT_AIGLE' => array( 1700.787, 2381.102), // = ( 600 x 840 ) mm = ( 23.62 x 33.07 ) in - 'BE_GRAND_JESUS' => array( 1559.055, 2069.291), // = ( 550 x 730 ) mm = ( 21.65 x 28.74 ) in - 'BE_JESUS' => array( 1530.709, 2069.291), // = ( 540 x 730 ) mm = ( 21.26 x 28.74 ) in - 'BE_RAISIN' => array( 1417.323, 1842.520), // = ( 500 x 650 ) mm = ( 19.69 x 25.59 ) in - 'BE_GRAND_MEDIAN' => array( 1303.937, 1714.961), // = ( 460 x 605 ) mm = ( 18.11 x 23.82 ) in - 'BE_DOUBLE_POSTE' => array( 1233.071, 1601.575), // = ( 435 x 565 ) mm = ( 17.13 x 22.24 ) in - 'BE_COQUILLE' => array( 1218.898, 1587.402), // = ( 430 x 560 ) mm = ( 16.93 x 22.05 ) in - 'BE_PETIT_MEDIAN' => array( 1176.378, 1502.362), // = ( 415 x 530 ) mm = ( 16.34 x 20.87 ) in - 'BE_RUCHE' => array( 1020.472, 1303.937), // = ( 360 x 460 ) mm = ( 14.17 x 18.11 ) in - 'BE_PROPATRIA' => array( 977.953, 1218.898), // = ( 345 x 430 ) mm = ( 13.58 x 16.93 ) in - 'BE_LYS' => array( 898.583, 1125.354), // = ( 317 x 397 ) mm = ( 12.48 x 15.63 ) in - 'BE_POT' => array( 870.236, 1088.504), // = ( 307 x 384 ) mm = ( 12.09 x 15.12 ) in - 'BE_ROSETTE' => array( 765.354, 983.622), // = ( 270 x 347 ) mm = ( 10.63 x 13.66 ) in - // - Old Imperial French Sizes - 'FR_UNIVERS' => array( 2834.646, 3685.039), // = ( 1000 x 1300 ) mm = ( 39.37 x 51.18 ) in - 'FR_DOUBLE_COLOMBIER' => array( 2551.181, 3571.654), // = ( 900 x 1260 ) mm = ( 35.43 x 49.61 ) in - 'FR_GRANDE_MONDE' => array( 2551.181, 3571.654), // = ( 900 x 1260 ) mm = ( 35.43 x 49.61 ) in - 'FR_DOUBLE_SOLEIL' => array( 2267.717, 3401.575), // = ( 800 x 1200 ) mm = ( 31.50 x 47.24 ) in - 'FR_DOUBLE_JESUS' => array( 2154.331, 3174.803), // = ( 760 x 1120 ) mm = ( 29.92 x 44.09 ) in - 'FR_GRAND_AIGLE' => array( 2125.984, 3004.724), // = ( 750 x 1060 ) mm = ( 29.53 x 41.73 ) in - 'FR_PETIT_AIGLE' => array( 1984.252, 2664.567), // = ( 700 x 940 ) mm = ( 27.56 x 37.01 ) in - 'FR_DOUBLE_RAISIN' => array( 1842.520, 2834.646), // = ( 650 x 1000 ) mm = ( 25.59 x 39.37 ) in - 'FR_JOURNAL' => array( 1842.520, 2664.567), // = ( 650 x 940 ) mm = ( 25.59 x 37.01 ) in - 'FR_COLOMBIER_AFFICHE' => array( 1785.827, 2551.181), // = ( 630 x 900 ) mm = ( 24.80 x 35.43 ) in - 'FR_DOUBLE_CAVALIER' => array( 1757.480, 2607.874), // = ( 620 x 920 ) mm = ( 24.41 x 36.22 ) in - 'FR_CLOCHE' => array( 1700.787, 2267.717), // = ( 600 x 800 ) mm = ( 23.62 x 31.50 ) in - 'FR_SOLEIL' => array( 1700.787, 2267.717), // = ( 600 x 800 ) mm = ( 23.62 x 31.50 ) in - 'FR_DOUBLE_CARRE' => array( 1587.402, 2551.181), // = ( 560 x 900 ) mm = ( 22.05 x 35.43 ) in - 'FR_DOUBLE_COQUILLE' => array( 1587.402, 2494.488), // = ( 560 x 880 ) mm = ( 22.05 x 34.65 ) in - 'FR_JESUS' => array( 1587.402, 2154.331), // = ( 560 x 760 ) mm = ( 22.05 x 29.92 ) in - 'FR_RAISIN' => array( 1417.323, 1842.520), // = ( 500 x 650 ) mm = ( 19.69 x 25.59 ) in - 'FR_CAVALIER' => array( 1303.937, 1757.480), // = ( 460 x 620 ) mm = ( 18.11 x 24.41 ) in - 'FR_DOUBLE_COURONNE' => array( 1303.937, 2040.945), // = ( 460 x 720 ) mm = ( 18.11 x 28.35 ) in - 'FR_CARRE' => array( 1275.591, 1587.402), // = ( 450 x 560 ) mm = ( 17.72 x 22.05 ) in - 'FR_COQUILLE' => array( 1247.244, 1587.402), // = ( 440 x 560 ) mm = ( 17.32 x 22.05 ) in - 'FR_DOUBLE_TELLIERE' => array( 1247.244, 1927.559), // = ( 440 x 680 ) mm = ( 17.32 x 26.77 ) in - 'FR_DOUBLE_CLOCHE' => array( 1133.858, 1700.787), // = ( 400 x 600 ) mm = ( 15.75 x 23.62 ) in - 'FR_DOUBLE_POT' => array( 1133.858, 1757.480), // = ( 400 x 620 ) mm = ( 15.75 x 24.41 ) in - 'FR_ECU' => array( 1133.858, 1474.016), // = ( 400 x 520 ) mm = ( 15.75 x 20.47 ) in - 'FR_COURONNE' => array( 1020.472, 1303.937), // = ( 360 x 460 ) mm = ( 14.17 x 18.11 ) in - 'FR_TELLIERE' => array( 963.780, 1247.244), // = ( 340 x 440 ) mm = ( 13.39 x 17.32 ) in - 'FR_POT' => array( 878.740, 1133.858), // = ( 310 x 400 ) mm = ( 12.20 x 15.75 ) in - ); - - - /** - * Get page dimensions from format name. - * @param $format (mixed) The format name @see self::$page_format
    -
    -
    -

    - -
    - -
    - -
    - - -
    -
    - - -
    - - - -
    -
    -
    - display(); - ?> -
    -
    -
    - '; - ?> -
    -
    -
    -

    -
    - -

    - -
    -
    -
    -
    -
  • - -isAjax()) { - $response->addJSON('_disableNaviSettings', true); -} else { - define('PMA_DISABLE_NAVI_SETTINGS', true); -} diff --git a/#pma/print.css b/#pma/print.css deleted file mode 100644 index 1aa2f982..00000000 --- a/#pma/print.css +++ /dev/null @@ -1,92 +0,0 @@ -.nowrap { - white-space: nowrap; -} - -.hide { - display: none; -} - -body, table, th, td { - color: #000; - background-color: #fff; -} - -img { - border: 0; -} - -table, th, td { - border: .1em solid #000; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - -th, td { - padding: 0.2em; -} - -th { - font-weight: bold; - background-color: #e5e5e5; -} - -th.vtop, td.vtop { - vertical-align: top; -} - -th.vbottom, td.vbottom { - vertical-align: bottom; -} - -@media print { - .print_ignore { - display: none; - } - - .nowrap { - white-space: nowrap; - } - - .hide { - display: none; - } - - body, table, th, td { - color: #000; - background-color: #fff; - } - - img { - border: 0; - } - - table, th, td { - border: .1em solid #000; - } - - table { - border-collapse: collapse; - border-spacing: 0; - } - - th, td { - padding: 0.2em; - } - - th { - font-weight: bold; - background-color: #e5e5e5; - } - - th.vtop, td.vtop { - vertical-align: top; - } - - th.vbottom, td.vbottom { - vertical-align: bottom; - } -} - diff --git a/#pma/robots.txt b/#pma/robots.txt deleted file mode 100644 index 1f53798b..00000000 --- a/#pma/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-agent: * -Disallow: / diff --git a/#pma/schema_export.php b/#pma/schema_export.php deleted file mode 100644 index 9aebd9a2..00000000 --- a/#pma/schema_export.php +++ /dev/null @@ -1,69 +0,0 @@ -selectDb($GLOBALS['db']); - $export_plugin->exportSchema($GLOBALS['db']); -} diff --git a/#pma/server_binlog.php b/#pma/server_binlog.php deleted file mode 100644 index 811e4bc8..00000000 --- a/#pma/server_binlog.php +++ /dev/null @@ -1,32 +0,0 @@ -factory( - 'PMA\libraries\controllers\server\ServerBinlogController' -); -$container->alias( - 'ServerBinlogController', - 'PMA\libraries\controllers\server\ServerBinlogController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/** @var ServerBinlogController $controller */ -$controller = $container->get( - 'ServerBinlogController', array() -); -$controller->indexAction(); diff --git a/#pma/server_collations.php b/#pma/server_collations.php deleted file mode 100644 index adbd9536..00000000 --- a/#pma/server_collations.php +++ /dev/null @@ -1,32 +0,0 @@ -factory( - 'PMA\libraries\controllers\server\ServerCollationsController' -); -$container->alias( - 'ServerCollationsController', - 'PMA\libraries\controllers\server\ServerCollationsController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/** @var ServerCollationsController $controller */ -$controller = $container->get( - 'ServerCollationsController', array() -); -$controller->indexAction(); diff --git a/#pma/server_databases.php b/#pma/server_databases.php deleted file mode 100644 index 9dcd589e..00000000 --- a/#pma/server_databases.php +++ /dev/null @@ -1,32 +0,0 @@ -factory( - 'PMA\libraries\controllers\server\ServerDatabasesController' -); -$container->alias( - 'ServerDatabasesController', - 'PMA\libraries\controllers\server\ServerDatabasesController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/** @var ServerDatabasesController $controller */ -$controller = $container->get( - 'ServerDatabasesController', array() -); -$controller->indexAction(); diff --git a/#pma/server_engines.php b/#pma/server_engines.php deleted file mode 100644 index f935279a..00000000 --- a/#pma/server_engines.php +++ /dev/null @@ -1,32 +0,0 @@ -factory( - 'PMA\libraries\controllers\server\ServerEnginesController' -); -$container->alias( - 'ServerEnginesController', - 'PMA\libraries\controllers\server\ServerEnginesController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/** @var ServerEnginesController $controller */ -$controller = $container->get( - 'ServerEnginesController', array() -); -$controller->indexAction(); diff --git a/#pma/server_export.php b/#pma/server_export.php deleted file mode 100644 index 13337b49..00000000 --- a/#pma/server_export.php +++ /dev/null @@ -1,49 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('export.js'); - -$export_page_title = __('View dump (schema) of databases') . "\n"; - -$select_item = isset($tmp_select)? $tmp_select : ''; -$multi_values = PMA_getHtmlForExportSelectOptions($select_item); - -require_once 'libraries/display_export.lib.php'; - -if (! isset($sql_query)) { - $sql_query = ''; -} -if (! isset($num_tables)) { - $num_tables = 0; -} -if (! isset($unlim_num_rows)) { - $unlim_num_rows = 0; -} -$response = Response::getInstance(); -$response->addHTML( - PMA_getExportDisplay( - 'server', $db, $table, $sql_query, $num_tables, - $unlim_num_rows, $multi_values - ) -); diff --git a/#pma/server_import.php b/#pma/server_import.php deleted file mode 100644 index a9e5f2ec..00000000 --- a/#pma/server_import.php +++ /dev/null @@ -1,36 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('import.js'); - -/** - * Does the common work - */ -require 'libraries/server_common.inc.php'; - -require 'libraries/display_import.lib.php'; -$response = Response::getInstance(); -$response->addHTML( - PMA_getImportDisplay( - 'server', $db, $table, $max_upload_size - ) -); diff --git a/#pma/server_plugins.php b/#pma/server_plugins.php deleted file mode 100644 index 4392eed8..00000000 --- a/#pma/server_plugins.php +++ /dev/null @@ -1,32 +0,0 @@ -factory( - 'PMA\libraries\controllers\server\ServerPluginsController' -); -$container->alias( - 'ServerPluginsController', - 'PMA\libraries\controllers\server\ServerPluginsController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/** @var ServerPluginsController $controller */ -$controller = $container->get( - 'ServerPluginsController', array() -); -$controller->indexAction(); diff --git a/#pma/server_privileges.php b/#pma/server_privileges.php deleted file mode 100644 index c7b1c4f7..00000000 --- a/#pma/server_privileges.php +++ /dev/null @@ -1,456 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('server_privileges.js'); - -if ((isset($_REQUEST['viewing_mode']) - && $_REQUEST['viewing_mode'] == 'server') - && $GLOBALS['cfgRelation']['menuswork'] -) { - include_once 'libraries/server_users.lib.php'; - $response->addHTML('
    '); - $response->addHTML(PMA_getHtmlForSubMenusOnUsersPage('server_privileges.php')); -} - -/** - * Sets globals from $_POST patterns, for privileges and max_* vars - */ - -$post_patterns = array( - '/_priv$/i', - '/^max_/i' -); - -PMA_setPostAsGlobal($post_patterns); - -require 'libraries/server_common.inc.php'; - -/** - * Messages are built using the message name - */ -$strPrivDescAllPrivileges = __('Includes all privileges except GRANT.'); -$strPrivDescAlter = __('Allows altering the structure of existing tables.'); -$strPrivDescAlterRoutine = __('Allows altering and dropping stored routines.'); -$strPrivDescCreateDb = __('Allows creating new databases and tables.'); -$strPrivDescCreateRoutine = __('Allows creating stored routines.'); -$strPrivDescCreateTbl = __('Allows creating new tables.'); -$strPrivDescCreateTmpTable = __('Allows creating temporary tables.'); -$strPrivDescCreateUser = __('Allows creating, dropping and renaming user accounts.'); -$strPrivDescCreateView = __('Allows creating new views.'); -$strPrivDescDelete = __('Allows deleting data.'); -$strPrivDescDropDb = __('Allows dropping databases and tables.'); -$strPrivDescDropTbl = __('Allows dropping tables.'); -$strPrivDescEvent = __('Allows to set up events for the event scheduler.'); -$strPrivDescExecute = __('Allows executing stored routines.'); -$strPrivDescFile = __('Allows importing data from and exporting data into files.'); -$strPrivDescGrantTbl = __( - 'Allows user to give to other users or remove from other users the privileges ' - . 'that user possess yourself.' -); -$strPrivDescIndex = __('Allows creating and dropping indexes.'); -$strPrivDescInsert = __('Allows inserting and replacing data.'); -$strPrivDescLockTables = __('Allows locking tables for the current thread.'); -$strPrivDescMaxConnections = __( - 'Limits the number of new connections the user may open per hour.' -); -$strPrivDescMaxQuestions = __( - 'Limits the number of queries the user may send to the server per hour.' -); -$strPrivDescMaxUpdates = __( - 'Limits the number of commands that change any table or database ' - . 'the user may execute per hour.' -); -$strPrivDescMaxUserConnections = __( - 'Limits the number of simultaneous connections the user may have.' -); -$strPrivDescProcess = __('Allows viewing processes of all users.'); -$strPrivDescReferences = __('Has no effect in this MySQL version.'); -$strPrivDescReload = __( - 'Allows reloading server settings and flushing the server\'s caches.' -); -$strPrivDescReplClient = __( - 'Allows the user to ask where the slaves / masters are.' -); -$strPrivDescReplSlave = __('Needed for the replication slaves.'); -$strPrivDescSelect = __('Allows reading data.'); -$strPrivDescShowDb = __('Gives access to the complete list of databases.'); -$strPrivDescShowView = __('Allows performing SHOW CREATE VIEW queries.'); -$strPrivDescShutdown = __('Allows shutting down the server.'); -$strPrivDescSuper = __( - 'Allows connecting, even if maximum number of connections is reached; ' - . 'required for most administrative operations like setting global variables ' - . 'or killing threads of other users.' -); -$strPrivDescTrigger = __('Allows creating and dropping triggers.'); -$strPrivDescUpdate = __('Allows changing data.'); -$strPrivDescUsage = __('No privileges.'); - -$_add_user_error = false; -/** - * Get DB information: username, hostname, dbname, - * tablename, db_and_table, dbname_is_wildcard - */ -list( - $username, $hostname, $dbname, $tablename, $routinename, - $db_and_table, $dbname_is_wildcard -) = PMA_getDataForDBInfo(); - -/** - * Checks if the user is allowed to do what he tries to... - */ -if (!$GLOBALS['is_superuser'] && !$GLOBALS['is_grantuser'] - && !$GLOBALS['is_createuser'] -) { - $response->addHTML(PMA_getHtmlForSubPageHeader('privileges', '', false)); - $response->addHTML( - PMA\libraries\Message::error(__('No Privileges')) - ->getDisplay() - ); - exit; -} - -/** - * Checks if the user is using "Change Login Information / Copy User" dialog - * only to update the password - */ -if (isset($_REQUEST['change_copy']) && $username == $_REQUEST['old_username'] - && $hostname == $_REQUEST['old_hostname'] -) { - $response->addHTML( - PMA\libraries\Message::error( - __( - "Username and hostname didn't change. " - . "If you only want to change the password, " - . "'Change password' tab should be used." - ) - )->getDisplay() - ); - $response->setRequestStatus(false); - exit; -} - -/** - * Changes / copies a user, part I - */ -list($queries, $password) = PMA_getDataForChangeOrCopyUser(); - -/** - * Adds a user - * (Changes / copies a user, part II) - */ -list($ret_message, $ret_queries, $queries_for_display, $sql_query, $_add_user_error) - = PMA_addUser( - isset($dbname)? $dbname : null, - isset($username)? $username : null, - isset($hostname)? $hostname : null, - isset($password)? $password : null, - $cfgRelation['menuswork'] - ); -//update the old variables -if (isset($ret_queries)) { - $queries = $ret_queries; - unset($ret_queries); -} -if (isset($ret_message)) { - $message = $ret_message; - unset($ret_message); -} - -/** - * Changes / copies a user, part III - */ -if (isset($_REQUEST['change_copy'])) { - $queries = PMA_getDbSpecificPrivsQueriesForChangeOrCopyUser( - $queries, $username, $hostname - ); -} - -$itemType = ''; -if (! empty($routinename)) { - $itemType = PMA_getRoutineType($dbname, $routinename); -} - -/** - * Updates privileges - */ -if (! empty($_POST['update_privs'])) { - if (is_array($dbname)) { - foreach ($dbname as $key => $db_name) { - list($sql_query[$key], $message) = PMA_updatePrivileges( - (isset($username) ? $username : ''), - (isset($hostname) ? $hostname : ''), - (isset($tablename) - ? $tablename - : (isset($routinename) ? $routinename : '')), - (isset($db_name) ? $db_name : ''), - $itemType - ); - } - - $sql_query = implode("\n", $sql_query); - } else { - list($sql_query, $message) = PMA_updatePrivileges( - (isset($username) ? $username : ''), - (isset($hostname) ? $hostname : ''), - (isset($tablename) - ? $tablename - : (isset($routinename) ? $routinename : '')), - (isset($dbname) ? $dbname : ''), - $itemType - ); - } -} - -/** - * Assign users to user groups - */ -if (! empty($_REQUEST['changeUserGroup']) && $cfgRelation['menuswork'] - && $GLOBALS['is_superuser'] && $GLOBALS['is_createuser'] -) { - PMA_setUserGroup($username, $_REQUEST['userGroup']); - $message = PMA\libraries\Message::success(); -} - -/** - * Revokes Privileges - */ -if (isset($_REQUEST['revokeall'])) { - list ($message, $sql_query) = PMA_getMessageAndSqlQueryForPrivilegesRevoke( - (isset($dbname) ? $dbname : ''), - (isset($tablename) - ? $tablename - : (isset($routinename) ? $routinename : '')), - $username, - $hostname, - $itemType - ); -} - -/** - * Updates the password - */ -if (isset($_REQUEST['change_pw'])) { - $message = PMA_updatePassword( - $err_url, $username, $hostname - ); -} - -/** - * Deletes users - * (Changes / copies a user, part IV) - */ -if (isset($_REQUEST['delete']) - || (isset($_REQUEST['change_copy']) && $_REQUEST['mode'] < 4) -) { - include_once 'libraries/relation_cleanup.lib.php'; - $queries = PMA_getDataForDeleteUsers($queries); - if (empty($_REQUEST['change_copy'])) { - list($sql_query, $message) = PMA_deleteUser($queries); - } -} - -/** - * Changes / copies a user, part V - */ -if (isset($_REQUEST['change_copy'])) { - $queries = PMA_getDataForQueries($queries, $queries_for_display); - $message = PMA\libraries\Message::success(); - $sql_query = join("\n", $queries); -} - -/** - * Reloads the privilege tables into memory - */ -$message_ret = PMA_updateMessageForReload(); -if (isset($message_ret)) { - $message = $message_ret; - unset($message_ret); -} - -/** - * If we are in an Ajax request for Create User/Edit User/Revoke User/ - * Flush Privileges, show $message and exit. - */ -if ($GLOBALS['is_ajax_request'] - && empty($_REQUEST['ajax_page_request']) - && ! isset($_REQUEST['export']) - && (! isset($_REQUEST['submit_mult']) || $_REQUEST['submit_mult'] != 'export') - && ((! isset($_REQUEST['initial']) || $_REQUEST['initial'] === null - || $_REQUEST['initial'] === '') - || (isset($_REQUEST['delete']) && $_REQUEST['delete'] === __('Go'))) - && ! isset($_REQUEST['showall']) - && ! isset($_REQUEST['edit_user_group_dialog']) - && ! isset($_REQUEST['db_specific']) -) { - $extra_data = PMA_getExtraDataForAjaxBehavior( - (isset($password) ? $password : ''), - (isset($sql_query) ? $sql_query : ''), - (isset($hostname) ? $hostname : ''), - (isset($username) ? $username : '') - ); - - if (! empty($message) && $message instanceof PMA\libraries\Message) { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus($message->isSuccess()); - $response->addJSON('message', $message); - $response->addJSON($extra_data); - exit; - } -} - -/** - * Displays the links - */ -if (isset($_REQUEST['viewing_mode']) && $_REQUEST['viewing_mode'] == 'db') { - $GLOBALS['db'] = $_REQUEST['db'] = $_REQUEST['checkprivsdb']; - - $url_query .= '&goto=db_operations.php'; - - // Gets the database structure - $sub_part = '_structure'; - ob_start(); - - list( - $tables, - $num_tables, - $total_num_tables, - $sub_part, - $is_show_stats, - $db_is_system_schema, - $tooltip_truename, - $tooltip_aliasname, - $pos - ) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); - - $content = ob_get_contents(); - ob_end_clean(); - $response->addHTML($content . "\n"); -} else { - if (! empty($GLOBALS['message'])) { - $response->addHTML(PMA\libraries\Util::getMessage($GLOBALS['message'])); - unset($GLOBALS['message']); - } -} - -/** - * Displays the page - */ -$response->addHTML( - PMA_getHtmlForUserGroupDialog( - isset($username)? $username : null, - $cfgRelation['menuswork'] - ) -); - -// export user definition -if (isset($_REQUEST['export']) - || (isset($_REQUEST['submit_mult']) && $_REQUEST['submit_mult'] == 'export') -) { - list($title, $export) = PMA_getListForExportUserDefinition( - isset($username) ? $username : null, - isset($hostname) ? $hostname : null - ); - - unset($username, $hostname, $grants, $one_grant); - - $response = PMA\libraries\Response::getInstance(); - if ($GLOBALS['is_ajax_request']) { - $response->addJSON('message', $export); - $response->addJSON('title', $title); - exit; - } else { - $response->addHTML("

    $title

    $export"); - } -} - -if (isset($_REQUEST['adduser'])) { - // Add user - $response->addHTML( - PMA_getHtmlForAddUser((isset($dbname) ? $dbname : '')) - ); -} elseif (isset($_REQUEST['checkprivsdb'])) { - if (isset($_REQUEST['checkprivstable'])) { - // check the privileges for a particular table. - $response->addHTML( - PMA_getHtmlForSpecificTablePrivileges( - $_REQUEST['checkprivsdb'], $_REQUEST['checkprivstable'] - ) - ); - } else { - // check the privileges for a particular database. - $response->addHTML( - PMA_getHtmlForSpecificDbPrivileges($_REQUEST['checkprivsdb']) - ); - } -} else { - if (isset($dbname) && ! is_array($dbname)) { - $url_dbname = urlencode( - str_replace( - array('\_', '\%'), - array('_', '%'), - $_REQUEST['dbname'] - ) - ); - } - - if (! isset($username)) { - // No username is given --> display the overview - $response->addHTML( - PMA_getHtmlForUserOverview($pmaThemeImage, $text_dir) - ); - } else if (!empty($routinename)) { - $response->addHTML( - PMA_getHtmlForRoutineSpecificPrivilges( - $username, $hostname, $dbname, $routinename, - (isset($url_dbname) ? $url_dbname : '') - ) - ); - } else { - // A user was selected -> display the user's properties - // In an Ajax request, prevent cached values from showing - if ($GLOBALS['is_ajax_request'] == true) { - header('Cache-Control: no-cache'); - } - - $response->addHTML( - PMA_getHtmlForUserProperties( - (isset($dbname_is_wildcard) ? $dbname_is_wildcard : ''), - (isset($url_dbname) ? $url_dbname : ''), - $username, $hostname, - (isset($dbname) ? $dbname : ''), - (isset($tablename) ? $tablename : '') - ) - ); - } -} - -if ((isset($_REQUEST['viewing_mode']) && $_REQUEST['viewing_mode'] == 'server') - && $GLOBALS['cfgRelation']['menuswork'] -) { - $response->addHTML('
    '); -} diff --git a/#pma/server_replication.php b/#pma/server_replication.php deleted file mode 100644 index e5a5f080..00000000 --- a/#pma/server_replication.php +++ /dev/null @@ -1,84 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('server_privileges.js'); -$scripts->addFile('replication.js'); - -/** - * Checks if the user is allowed to do what he tries to... - */ -if (! $is_superuser) { - $html = PMA_getHtmlForSubPageHeader('replication'); - $html .= PMA\libraries\Message::error(__('No Privileges'))->getDisplay(); - $response->addHTML($html); - exit; -} - -// change $GLOBALS['url_params'] with $_REQUEST['url_params'] -// only if it is an array -if (isset($_REQUEST['url_params']) && is_array($_REQUEST['url_params'])) { - $GLOBALS['url_params'] = $_REQUEST['url_params']; -} - -/** - * Handling control requests - */ -PMA_handleControlRequest(); - -/** - * start output - */ -$response->addHTML('
    '); -$response->addHTML(PMA_getHtmlForSubPageHeader('replication')); - -// Display error messages -$response->addHTML(PMA_getHtmlForErrorMessage()); - -if ($GLOBALS['replication_info']['master']['status']) { - $response->addHTML(PMA_getHtmlForMasterReplication()); -} elseif (! isset($_REQUEST['mr_configure']) - && ! isset($_REQUEST['repl_clear_scr']) -) { - $response->addHTML(PMA_getHtmlForNotServerReplication()); -} - -if (isset($_REQUEST['mr_configure'])) { - // Render the 'Master configuration' section - $response->addHTML(PMA_getHtmlForMasterConfiguration()); - exit; -} - -$response->addHTML('
    '); - -if (! isset($_REQUEST['repl_clear_scr'])) { - // Render the 'Slave configuration' section - $response->addHTML( - PMA_getHtmlForSlaveConfiguration( - $GLOBALS['replication_info']['slave']['status'], - $server_slave_replication - ) - ); -} -if (isset($_REQUEST['sl_configure'])) { - $response->addHTML(PMA_getHtmlForReplicationChangeMaster("slave_changemaster")); -} diff --git a/#pma/server_sql.php b/#pma/server_sql.php deleted file mode 100644 index 8072dd4a..00000000 --- a/#pma/server_sql.php +++ /dev/null @@ -1,36 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('makegrid.js'); -$scripts->addFile('jquery/jquery.uitablefilter.js'); -$scripts->addFile('sql.js'); - -require_once 'libraries/server_common.inc.php'; -require_once 'libraries/sql_query_form.lib.php'; - -/** - * Query box, bookmark, insert data from textfile - */ -$response->addHTML(PMA_getHtmlForSqlQueryForm()); diff --git a/#pma/server_status.php b/#pma/server_status.php deleted file mode 100644 index d04a5779..00000000 --- a/#pma/server_status.php +++ /dev/null @@ -1,40 +0,0 @@ -addHTML('
    '); - -$serverStatusData = new ServerStatusData(); -$response->addHTML($serverStatusData->getMenuHtml()); -if ($serverStatusData->dataLoaded) { - $response->addHTML(PMA_getHtmlForServerStatus($serverStatusData)); -} else { - $response->addHTML( - Message::error( - __('Not enough privilege to view server status.') - )->getDisplay() - ); -} -$response->addHTML('
    '); -exit; diff --git a/#pma/server_status_advisor.php b/#pma/server_status_advisor.php deleted file mode 100644 index ca7a7511..00000000 --- a/#pma/server_status_advisor.php +++ /dev/null @@ -1,39 +0,0 @@ -getHeader()->getScripts(); -$scripts->addFile('server_status_advisor.js'); - -/** - * Output - */ -$response->addHTML('
    '); -$response->addHTML($serverStatusData->getMenuHtml()); -if ($serverStatusData->dataLoaded) { - $response->addHTML(PMA_getHtmlForAdvisor()); -} else { - $response->addHTML( - Message::error( - __('Not enough privilege to view the advisor.') - )->getDisplay() - ); -} -$response->addHTML('
    '); - -exit; diff --git a/#pma/server_status_monitor.php b/#pma/server_status_monitor.php deleted file mode 100644 index dc88e8f3..00000000 --- a/#pma/server_status_monitor.php +++ /dev/null @@ -1,100 +0,0 @@ -addJSON('message', $ret); - exit; - } - } - - if (isset($_REQUEST['log_data'])) { - - $start = intval($_REQUEST['time_start']); - $end = intval($_REQUEST['time_end']); - - if ($_REQUEST['type'] == 'slow') { - $return = PMA_getJsonForLogDataTypeSlow($start, $end); - PMA\libraries\Response::getInstance()->addJSON('message', $return); - exit; - } - - if ($_REQUEST['type'] == 'general') { - $return = PMA_getJsonForLogDataTypeGeneral($start, $end); - PMA\libraries\Response::getInstance()->addJSON('message', $return); - exit; - } - } - - if (isset($_REQUEST['logging_vars'])) { - $loggingVars = PMA_getJsonForLoggingVars(); - PMA\libraries\Response::getInstance()->addJSON('message', $loggingVars); - exit; - } - - if (isset($_REQUEST['query_analyzer'])) { - $return = PMA_getJsonForQueryAnalyzer(); - PMA\libraries\Response::getInstance()->addJSON('message', $return); - exit; - } -} - -/** - * JS Includes - */ -$header = $response->getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('jquery/jquery.tablesorter.js'); -$scripts->addFile('jquery/jquery.sortableTable.js'); -$scripts->addFile('jquery/jquery-ui-timepicker-addon.js'); -// for charting -$scripts->addFile('jqplot/jquery.jqplot.js'); -$scripts->addFile('jqplot/plugins/jqplot.pieRenderer.js'); -$scripts->addFile('jqplot/plugins/jqplot.canvasTextRenderer.js'); -$scripts->addFile('jqplot/plugins/jqplot.canvasAxisLabelRenderer.js'); -$scripts->addFile('jqplot/plugins/jqplot.dateAxisRenderer.js'); -$scripts->addFile('jqplot/plugins/jqplot.highlighter.js'); -$scripts->addFile('jqplot/plugins/jqplot.cursor.js'); -$scripts->addFile('jqplot/plugins/jqplot.byteFormatter.js'); - -$scripts->addFile('server_status_monitor.js'); -$scripts->addFile('server_status_sorter.js'); - - -/** - * start output - */ -$ServerStatusData = new ServerStatusData(); - -/** - * Output - */ -$response->addHTML('
    '); -$response->addHTML($ServerStatusData->getMenuHtml()); -$response->addHTML(PMA_getHtmlForMonitor($ServerStatusData)); -$response->addHTML(PMA_getHtmlForClientSideDataAndLinks($ServerStatusData)); -$response->addHTML('
    '); -exit; diff --git a/#pma/server_status_processes.php b/#pma/server_status_processes.php deleted file mode 100644 index 2533ac31..00000000 --- a/#pma/server_status_processes.php +++ /dev/null @@ -1,62 +0,0 @@ - processes list - * - * @package PhpMyAdmin - */ - -use PMA\libraries\ServerStatusData; - -require_once 'libraries/common.inc.php'; -require_once 'libraries/server_common.inc.php'; -require_once 'libraries/server_status_processes.lib.php'; - -/** - * Replication library - */ -require_once 'libraries/replication.inc.php'; -require_once 'libraries/replication_gui.lib.php'; - -$ServerStatusData = new ServerStatusData(); -$response = PMA\libraries\Response::getInstance(); - -/** - * Kills a selected process - * on ajax request - */ -if ($response->isAjax() && !empty($_REQUEST['kill'])) { - $kill = intval($_REQUEST['kill']); - $query = $GLOBALS['dbi']->getKillQuery($kill); - if ($GLOBALS['dbi']->tryQuery($query)) { - $message = PMA\libraries\Message::success( - __('Thread %s was successfully killed.') - ); - $response->setRequestStatus(true); - } else { - $message = PMA\libraries\Message::error( - __( - 'phpMyAdmin was unable to kill thread %s.' - . ' It probably has already been closed.' - ) - ); - $response->setRequestStatus(false); - } - $message->addParam($kill); - $response->addJSON('message', $message); -} elseif ($response->isAjax() && !empty($_REQUEST['refresh'])) { - // Only sends the process list table - $response->addHTML(PMA_getHtmlForServerProcessList()); -} else { - // Load the full page - $header = $response->getHeader(); - $scripts = $header->getScripts(); - $scripts->addFile('server_status_processes.js'); - $response->addHTML('
    '); - $response->addHTML($ServerStatusData->getMenuHtml()); - $response->addHTML(PMA_getHtmlForProcessListFilter()); - $response->addHTML(PMA_getHtmlForServerProcesslist()); - $response->addHTML(PMA_getHtmlForProcessListAutoRefresh()); - $response->addHTML('
    '); -} -exit; diff --git a/#pma/server_status_queries.php b/#pma/server_status_queries.php deleted file mode 100644 index be539fb2..00000000 --- a/#pma/server_status_queries.php +++ /dev/null @@ -1,47 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('server_status_queries.js'); - -// for charting -$scripts->addFile('chart.js'); -$scripts->addFile('jqplot/jquery.jqplot.js'); -$scripts->addFile('jqplot/plugins/jqplot.pieRenderer.js'); -$scripts->addFile('jqplot/plugins/jqplot.highlighter.js'); -$scripts->addFile('jquery/jquery.tablesorter.js'); -$scripts->addFile('server_status_sorter.js'); - -// Add the html content to the response -$response->addHTML('
    '); -$response->addHTML($serverStatusData->getMenuHtml()); -if ($serverStatusData->dataLoaded) { - $response->addHTML(PMA_getHtmlForQueryStatistics($serverStatusData)); -} else { - $response->addHTML( - Message::error( - __('Not enough privilege to view query statistics.') - )->getDisplay() - ); -} -$response->addHTML('
    '); -exit; diff --git a/#pma/server_status_variables.php b/#pma/server_status_variables.php deleted file mode 100644 index 331c0857..00000000 --- a/#pma/server_status_variables.php +++ /dev/null @@ -1,58 +0,0 @@ -query('FLUSH ' . $_REQUEST['flush'] . ';'); - } - unset($_flush_commands); -} - -$serverStatusData = new ServerStatusData(); - -$response = PMA\libraries\Response::getInstance(); -$header = $response->getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('server_status_variables.js'); -$scripts->addFile('jquery/jquery.tablesorter.js'); -$scripts->addFile('server_status_sorter.js'); - -$response->addHTML('
    '); -$response->addHTML($serverStatusData->getMenuHtml()); -if ($serverStatusData->dataLoaded) { - $response->addHTML(PMA_getHtmlForFilter($serverStatusData)); - $response->addHTML(PMA_getHtmlForLinkSuggestions($serverStatusData)); - $response->addHTML(PMA_getHtmlForVariablesList($serverStatusData)); -} else { - $response->addHTML( - Message::error( - __('Not enough privilege to view status variables.') - )->getDisplay() - ); -} -$response->addHTML('
    '); - -exit; diff --git a/#pma/server_user_groups.php b/#pma/server_user_groups.php deleted file mode 100644 index 72f4ff2a..00000000 --- a/#pma/server_user_groups.php +++ /dev/null @@ -1,74 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('server_user_groups.js'); - -/** - * Only allowed to superuser - */ -if (! $GLOBALS['is_superuser']) { - $response->addHTML( - PMA\libraries\Message::error(__('No Privileges')) - ->getDisplay() - ); - exit; -} - -$response->addHTML('
    '); -$response->addHTML(PMA_getHtmlForSubMenusOnUsersPage('server_user_groups.php')); - -/** - * Delete user group - */ -if (! empty($_REQUEST['deleteUserGroup'])) { - PMA_deleteUserGroup($_REQUEST['userGroup']); -} - -/** - * Add a new user group - */ -if (! empty($_REQUEST['addUserGroupSubmit'])) { - PMA_editUserGroup($_REQUEST['userGroup'], true); -} - -/** - * Update a user group - */ -if (! empty($_REQUEST['editUserGroupSubmit'])) { - PMA_editUserGroup($_REQUEST['userGroup']); -} - -if (isset($_REQUEST['viewUsers'])) { - // Display users belonging to a user group - $response->addHTML(PMA_getHtmlForListingUsersofAGroup($_REQUEST['userGroup'])); -} - -if (isset($_REQUEST['addUserGroup'])) { - // Display add user group dialog - $response->addHTML(PMA_getHtmlToEditUserGroup()); -} elseif (isset($_REQUEST['editUserGroup'])) { - // Display edit user group dialog - $response->addHTML(PMA_getHtmlToEditUserGroup($_REQUEST['userGroup'])); -} else { - // Display user groups table - $response->addHTML(PMA_getHtmlForUserGroupsTable()); -} - -$response->addHTML('
    '); diff --git a/#pma/server_variables.php b/#pma/server_variables.php deleted file mode 100644 index a5c35ff6..00000000 --- a/#pma/server_variables.php +++ /dev/null @@ -1,32 +0,0 @@ -factory( - 'PMA\libraries\controllers\server\ServerVariablesController' -); -$container->alias( - 'ServerVariablesController', - 'PMA\libraries\controllers\server\ServerVariablesController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/** @var ServerVariablesController $controller */ -$controller = $container->get( - 'ServerVariablesController', array() -); -$controller->indexAction(); diff --git a/#pma/setup/ajax.js b/#pma/setup/ajax.js deleted file mode 100644 index 98d985a4..00000000 --- a/#pma/setup/ajax.js +++ /dev/null @@ -1,11 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * Dummy implementation of the ajax page loader - */ -var AJAX = { - registerOnload: function (idx, func) { - $(document).ready(func); - }, - registerTeardown: function (idx, func) { - } -}; diff --git a/#pma/setup/config.php b/#pma/setup/config.php deleted file mode 100644 index db9e7c90..00000000 --- a/#pma/setup/config.php +++ /dev/null @@ -1,102 +0,0 @@ -registerForm('_config.php', $forms['_config.php']); -$form_display->save('_config.php'); -$config_file_path = $GLOBALS['ConfigFile']->getFilePath(); - -if (isset($_POST['eol'])) { - $_SESSION['eol'] = ($_POST['eol'] == 'unix') ? 'unix' : 'win'; -} - -if (PMA_ifSetOr($_POST['submit_clear'], '')) { - // - // Clear current config and return to main page - // - $GLOBALS['ConfigFile']->resetConfigData(); - // drop post data - header('HTTP/1.1 303 See Other'); - header('Location: index.php' . PMA_URL_getCommon()); - exit; -} elseif (PMA_ifSetOr($_POST['submit_download'], '')) { - // - // Output generated config file - // - PMA_downloadHeader('config.inc.php', 'text/plain'); - echo ConfigGenerator::getConfigFile($GLOBALS['ConfigFile']); - exit; -} elseif (PMA_ifSetOr($_POST['submit_save'], '')) { - // - // Save generated config file on the server - // - $result = @file_put_contents( - $config_file_path, - ConfigGenerator::getConfigFile($GLOBALS['ConfigFile']) - ); - if ($result === false) { - $state = 'config_not_saved'; - } else { - $state = 'config_saved'; - } - header('HTTP/1.1 303 See Other'); - header('Location: index.php' . PMA_URL_getCommon() . '&action_done=' . $state); - exit; -} elseif (PMA_ifSetOr($_POST['submit_load'], '')) { - // - // Load config file from the server - // - $GLOBALS['ConfigFile']->setConfigData( - loadConfig($config_file_path) - ); - header('HTTP/1.1 303 See Other'); - header('Location: index.php' . PMA_URL_getCommon()); - exit; -} elseif (PMA_ifSetOr($_POST['submit_delete'], '')) { - // - // Delete config file on the server - // - @unlink($config_file_path); - header('HTTP/1.1 303 See Other'); - header('Location: index.php' . PMA_URL_getCommon()); - exit; -} else { - // - // Show generated config file in a '; -echo ''; -echo ''; -echo ''; -echo ''; -echo ''; -echo ''; -echo ''; -echo ''; - -echo PMA_displayFieldsetBottomSimple(); -echo PMA_displayFormBottom(); diff --git a/#pma/setup/frames/form.inc.php b/#pma/setup/frames/form.inc.php deleted file mode 100644 index 3ab5c0fd..00000000 --- a/#pma/setup/frames/form.inc.php +++ /dev/null @@ -1,35 +0,0 @@ -' , $GLOBALS['strConfigFormset_' . $formset_id] , ''; -} -$form_display = new FormDisplay($GLOBALS['ConfigFile']); -foreach ($forms[$formset_id] as $form_name => $form) { - $form_display->registerForm($form_name, $form); -} -PMA_Process_formset($form_display); diff --git a/#pma/setup/frames/index.inc.php b/#pma/setup/frames/index.inc.php deleted file mode 100644 index 370bf748..00000000 --- a/#pma/setup/frames/index.inc.php +++ /dev/null @@ -1,326 +0,0 @@ -sortedLanguages(); - -/** @var ConfigFile $cf */ -$cf = $GLOBALS['ConfigFile']; -$separator = PMA_URL_getArgSeparator('html'); - -// message handling -PMA_messagesBegin(); - -// -// Check phpMyAdmin version -// -if (isset($_GET['version_check'])) { - PMA_versionCheck(); -} - -// -// Perform various security, compatibility and consistency checks -// -$configChecker = new ServerConfigChecks($GLOBALS['ConfigFile']); -$configChecker->performConfigChecks(); - -// -// Check whether we can read/write configuration -// -$config_readable = false; -$config_writable = false; -$config_exists = false; -PMA_checkConfigRw($config_readable, $config_writable, $config_exists); -if (!$config_writable || !$config_readable) { - PMA_messagesSet( - 'error', 'config_rw', __('Cannot load or save configuration'), - PMA_sanitize( - __( - 'Please create web server writable folder [em]config[/em] in ' - . 'phpMyAdmin top level directory as described in ' - . '[doc@setup_script]documentation[/doc]. Otherwise you will be ' - . 'only able to download or display it.' - ) - ) - ); -} -// -// Check https connection -// -$is_https = !empty($_SERVER['HTTPS']) - && mb_strtolower($_SERVER['HTTPS']) == 'on'; -if (!$is_https) { - $text = __( - 'You are not using a secure connection; all data (including potentially ' - . 'sensitive information, like passwords) is transferred unencrypted!' - ); - - $text .= ' '; - - // Temporary workaround to use tranlated message in older releases - $text .= str_replace( - array('[a@%s]', '[/a]'), - array('', ''), - __( - 'If your server is also configured to accept HTTPS requests ' - . 'follow [a@%s]this link[/a] to use a secure connection.' - ) - ); - $text .= ''; - PMA_messagesSet('notice', 'no_https', __('Insecure connection'), $text); -} - -echo '
    '; -echo PMA_URL_getHiddenInputs(); -echo '
    '; -echo ''; -echo '
    '; - -// Check for done action info and set notice message if present -switch ($action_done) { -case 'config_saved': - /* Use uniqid to display this message every time configuration is saved */ - PMA_messagesSet( - 'notice', uniqid('config_saved'), __('Configuration saved.'), - PMA_sanitize( - __( - 'Configuration saved to file config/config.inc.php in phpMyAdmin ' - . 'top level directory, copy it to top level one and delete ' - . 'directory config to use it.' - ) - ) - ); - break; -case 'config_not_saved': - /* Use uniqid to display this message every time configuration is saved */ - PMA_messagesSet( - 'notice', uniqid('config_not_saved'), __('Configuration not saved!'), - PMA_sanitize( - __( - 'Please create web server writable folder [em]config[/em] in ' - . 'phpMyAdmin top level directory as described in ' - . '[doc@setup_script]documentation[/doc]. Otherwise you will be ' - . 'only able to download or display it.' - ) - ) - ); - break; -default: - break; -} - -echo '

    ' , __('Overview') , '

    '; - -// message handling -PMA_messagesEnd(); -PMA_messagesShowHtml(); - -echo ''; - -echo '
    '; -echo __('Servers'); -echo ''; - -// -// Display server list -// -echo PMA_displayFormTop( - 'index.php', 'get', - array( - 'page' => 'servers', - 'mode' => 'add' - ) -); -echo '
    '; -if ($cf->getServerCount() > 0) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - foreach ($cf->getServers() as $id => $server) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - echo '
    #' , __('Name') , '' , __('Authentication type') , 'DSN
    ' , $id , '' , htmlspecialchars($cf->getServerName($id)) , '' - , htmlspecialchars($cf->getValue("Servers/$id/auth_type")) - , '' , htmlspecialchars($cf->getServerDSN($id)) , ''; - echo ''; - echo '' - , __('Edit') , ''; - echo ' | '; - echo '' - , __('Delete') , ''; - echo ''; - echo '
    '; -} else { - echo ''; - echo ''; - echo ''; - echo ''; - echo '
    '; - echo '' , __('There are no configured servers') , ''; - echo '
    '; -} - -echo ''; -echo ''; -echo ''; -echo ''; -echo '
    '; -echo ''; -echo '
    '; -echo '
    '; - -echo PMA_displayFormBottom(); - -echo '
    '; - -echo '
    ' , __('Configuration file') , ''; - -// -// Display config file settings and load/save form -// -$form_display = new FormDisplay($cf); - -echo PMA_displayFormTop('config.php'); -echo ''; - -// Display language list -$opts = array( - 'doc' => $form_display->getDocLink('DefaultLang'), - 'values' => array(), - 'values_escaped' => true); -foreach ($all_languages as $each_lang) { - $opts['values'][$each_lang->getCode()] = $each_lang->getName(); -} -echo PMA_displayInput( - 'DefaultLang', __('Default language'), 'select', - $cf->getValue('DefaultLang'), '', true, $opts -); - -// Display server list -$opts = array( - 'doc' => $form_display->getDocLink('ServerDefault'), - 'values' => array(), - 'values_disabled' => array()); -if ($cf->getServerCount() > 0) { - $opts['values']['0'] = __('let the user choose'); - $opts['values']['-'] = '------------------------------'; - if ($cf->getServerCount() == 1) { - $opts['values_disabled'][] = '0'; - } - $opts['values_disabled'][] = '-'; - - foreach ($cf->getServers() as $id => $server) { - $opts['values'][(string)$id] = $cf->getServerName($id) . " [$id]"; - } -} else { - $opts['values']['1'] = __('- none -'); - $opts['values_escaped'] = true; -} -echo PMA_displayInput( - 'ServerDefault', __('Default server'), 'select', - $cf->getValue('ServerDefault'), '', true, $opts -); - -// Display EOL list -$opts = array( - 'values' => array( - 'unix' => 'UNIX / Linux (\n)', - 'win' => 'Windows (\r\n)'), - 'values_escaped' => true); -$eol = PMA_ifSetOr($_SESSION['eol'], (PMA_IS_WINDOWS ? 'win' : 'unix')); -echo PMA_displayInput( - 'eol', __('End of line'), 'select', - $eol, '', true, $opts -); - -echo ''; -echo ''; -echo ''; -echo '
    '; -echo ''; -echo ''; -echo '   '; - -echo ''; - -echo ''; - -echo ''; - -echo '   '; -echo ''; -echo '
    '; - -echo PMA_displayFormBottom(); - -echo '
    '; -echo ''; diff --git a/#pma/setup/frames/menu.inc.php b/#pma/setup/frames/menu.inc.php deleted file mode 100644 index 7771afc7..00000000 --- a/#pma/setup/frames/menu.inc.php +++ /dev/null @@ -1,37 +0,0 @@ -'; -echo '
  • ' , __('Overview') , '
  • '; - -$formsets = array( - 'Features' => __('Features'), - 'Sql_queries' => __('SQL queries'), - 'Navi_panel' => __('Navigation panel'), - 'Main_panel' => __('Main panel'), - 'Import' => __('Import'), - 'Export' => __('Export') -); - -foreach ($formsets as $formset => $label) { - echo '
  • ' , $label , '
  • '; -} - -echo ''; diff --git a/#pma/setup/frames/servers.inc.php b/#pma/setup/frames/servers.inc.php deleted file mode 100644 index 0e6669bc..00000000 --- a/#pma/setup/frames/servers.inc.php +++ /dev/null @@ -1,51 +0,0 @@ -get("Servers/$id") !== null; - -if ($mode == 'edit' && $server_exists) { - $page_title = __('Edit server') - . ' ' . $id - . ' (' . htmlspecialchars($cf->getServerDSN($id)) . ')'; -} elseif ($mode == 'remove' && $server_exists) { - $cf->removeServer($id); - header('Location: index.php' . PMA_URL_getCommon()); - exit; -} elseif ($mode == 'revert' && $server_exists) { - // handled by process_formset() -} else { - $page_title = __('Add a new server'); - $id = 0; -} -if (isset($page_title)) { - echo '

    ' , $page_title . '

    '; -} -$form_display = new FormDisplay($cf); -foreach ($forms['Servers'] as $form_name => $form) { - $form_display->registerForm($form_name, $form, $id); -} -PMA_Process_formset($form_display); diff --git a/#pma/setup/index.php b/#pma/setup/index.php deleted file mode 100644 index 9720a2f2..00000000 --- a/#pma/setup/index.php +++ /dev/null @@ -1,61 +0,0 @@ - - - - - -phpMyAdmin setup - - - - - - - - - - - -

    phpMyAdmin setup

    - -
    - -
    - - diff --git a/#pma/setup/lib/ConfigGenerator.php b/#pma/setup/lib/ConfigGenerator.php deleted file mode 100644 index 48ba56d6..00000000 --- a/#pma/setup/lib/ConfigGenerator.php +++ /dev/null @@ -1,182 +0,0 @@ -getConfig(); - - // header - $ret = 'get('PMA_VERSION') - . ' setup script' . $crlf - . ' * Date: ' . gmdate(DATE_RFC1123) . $crlf - . ' */' . $crlf . $crlf; - - //servers - if (! empty($conf['Servers'])) { - $ret .= self::getServerPart($cf, $crlf, $conf['Servers']); - unset($conf['Servers']); - } - - // other settings - $persistKeys = $cf->getPersistKeysMap(); - - foreach ($conf as $k => $v) { - $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k); - $ret .= self::_getVarExport($k, $v, $crlf); - if (isset($persistKeys[$k])) { - unset($persistKeys[$k]); - } - } - // keep 1d array keys which are present in $persist_keys (config.values.php) - foreach (array_keys($persistKeys) as $k) { - if (mb_strpos($k, '/') === false) { - $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k); - $ret .= self::_getVarExport($k, $cf->getDefault($k), $crlf); - } - } - $ret .= '?' . '>'; - - return $ret; - } - - /** - * Returns exported configuration variable - * - * @param string $var_name configuration name - * @param mixed $var_value configuration value(s) - * @param string $crlf line ending - * - * @return string - */ - private static function _getVarExport($var_name, $var_value, $crlf) - { - if (!is_array($var_value) || empty($var_value)) { - return "\$cfg['$var_name'] = " - . var_export($var_value, true) . ';' . $crlf; - } - $ret = ''; - if (self::_isZeroBasedArray($var_value)) { - $ret = "\$cfg['$var_name'] = " - . self::_exportZeroBasedArray($var_value, $crlf) - . ';' . $crlf; - } else { - // string keys: $cfg[key][subkey] = value - foreach ($var_value as $k => $v) { - $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k); - $ret .= "\$cfg['$var_name']['$k'] = " - . var_export($v, true) . ';' . $crlf; - } - } - return $ret; - } - - /** - * Check whether $array is a continuous 0-based array - * - * @param array $array Array to check - * - * @return boolean - */ - private static function _isZeroBasedArray(array $array) - { - for ($i = 0, $nb = count($array); $i < $nb; $i++) { - if (! isset($array[$i])) { - return false; - } - } - return true; - } - - /** - * Exports continuous 0-based array - * - * @param array $array Array to export - * @param string $crlf Newline string - * - * @return string - */ - private static function _exportZeroBasedArray(array $array, $crlf) - { - $retv = array(); - foreach ($array as $v) { - $retv[] = var_export($v, true); - } - $ret = "array("; - if (count($retv) <= 4) { - // up to 4 values - one line - $ret .= implode(', ', $retv); - } else { - // more than 4 values - value per line - $imax = count($retv); - for ($i = 0; $i < $imax; $i++) { - $ret .= ($i > 0 ? ',' : '') . $crlf . ' ' . $retv[$i]; - } - } - $ret .= ')'; - return $ret; - } - - /** - * Generate server part of config file - * - * @param ConfigFile $cf Config file - * @param string $crlf Carriage return char - * @param array $servers Servers list - * - * @return string - */ - protected static function getServerPart(ConfigFile $cf, $crlf, $servers) - { - if ($cf->getServerCount() === 0) { - return null; - } - - $ret = "/* Servers configuration */$crlf\$i = 0;" . $crlf . $crlf; - foreach ($servers as $id => $server) { - $ret .= '/* Server: ' - . strtr($cf->getServerName($id) . " [$id] ", '*/', '-') - . "*/" . $crlf - . '$i++;' . $crlf; - foreach ($server as $k => $v) { - $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k); - $ret .= "\$cfg['Servers'][\$i]['$k'] = " - . (is_array($v) && self::_isZeroBasedArray($v) - ? self::_exportZeroBasedArray($v, $crlf) - : var_export($v, true)) - . ';' . $crlf; - } - $ret .= $crlf; - } - $ret .= '/* End of servers configuration */' . $crlf . $crlf; - return $ret; - } -} diff --git a/#pma/setup/lib/common.inc.php b/#pma/setup/lib/common.inc.php deleted file mode 100644 index 0a1df376..00000000 --- a/#pma/setup/lib/common.inc.php +++ /dev/null @@ -1,54 +0,0 @@ -setCookie('pma_lang', $GLOBALS['lang']); - -$GLOBALS['ConfigFile'] = new ConfigFile(); -$GLOBALS['ConfigFile']->setPersistKeys( - array( - 'DefaultLang', - 'ServerDefault', - 'UploadDir', - 'SaveDir', - 'Servers/1/verbose', - 'Servers/1/host', - 'Servers/1/port', - 'Servers/1/socket', - 'Servers/1/connect_type', - 'Servers/1/auth_type', - 'Servers/1/user', - 'Servers/1/password' - ) -); - -// allows for redirection even after sending some data -ob_start(); - diff --git a/#pma/setup/lib/form_processing.lib.php b/#pma/setup/lib/form_processing.lib.php deleted file mode 100644 index 9a6b9fff..00000000 --- a/#pma/setup/lib/form_processing.lib.php +++ /dev/null @@ -1,81 +0,0 @@ -fixErrors(); - PMA_generateHeader303(); - } - - if (!$form_display->process(false)) { - // handle form view and failed POST - echo $form_display->getDisplay(true, true); - return; - } - - // check for form errors - if (!$form_display->hasErrors()) { - PMA_generateHeader303(); - return; - } - - // form has errors, show warning - $separator = PMA_URL_getArgSeparator('html'); - $page = isset($_GET['page']) ? htmlspecialchars($_GET['page']) : null; - $formset = isset($_GET['formset']) ? htmlspecialchars($_GET['formset']) : null; - $formset = $formset ? "{$separator}formset=$formset" : ''; - $formId = PMA_isValid($_GET['id'], 'numeric') ? $_GET['id'] : null; - if ($formId === null && $page == 'servers') { - // we've just added a new server, get its id - $formId = $form_display->getConfigFile()->getServerCount(); - } - $formId = $formId ? "{$separator}id=$formId" : ''; - ?> -
    -

    -
    - - - -
    - displayErrors() ?> - - - -   - - - - array(), 'notice' => array()); - } else { - // reset message states - foreach ($_SESSION['messages'] as &$messages) { - foreach ($messages as &$msg) { - $msg['fresh'] = false; - $msg['active'] = false; - } - } - } -} - -/** - * Adds a new message to message list - * - * @param string $type one of: notice, error - * @param string $msgId unique message identifier - * @param string $title language string id (in $str array) - * @param string $message message text - * - * @return void - */ -function PMA_messagesSet($type, $msgId, $title, $message) -{ - $fresh = ! isset($_SESSION['messages'][$type][$msgId]); - $_SESSION['messages'][$type][$msgId] = array( - 'fresh' => $fresh, - 'active' => true, - 'title' => $title, - 'message' => $message); -} - -/** - * Cleans up message list - * - * @return void - */ -function PMA_messagesEnd() -{ - foreach ($_SESSION['messages'] as &$messages) { - $remove_ids = array(); - foreach ($messages as $id => &$msg) { - if ($msg['active'] == false) { - $remove_ids[] = $id; - } - } - foreach ($remove_ids as $id) { - unset($messages[$id]); - } - } -} - -/** - * Prints message list, must be called after PMA_messagesEnd() - * - * @return void - */ -function PMA_messagesShowHtml() -{ - $old_ids = array(); - foreach ($_SESSION['messages'] as $type => $messages) { - foreach ($messages as $id => $msg) { - echo '
    ' - , '

    ' , $msg['title'] , '

    ' - , $msg['message'] , '
    '; - if (!$msg['fresh'] && $type != 'error') { - $old_ids[] = $id; - } - } - } - - echo "\n" , '\n"; -} - -/** - * Checks for newest phpMyAdmin version and sets result as a new notice - * - * @return void - */ -function PMA_versionCheck() -{ - // version check messages should always be visible so let's make - // a unique message id each time we run it - $message_id = uniqid('version_check'); - - // Fetch data - $versionInformation = new VersionInformation(); - $version_data = $versionInformation->getLatestVersion(); - - if (empty($version_data)) { - PMA_messagesSet( - 'error', - $message_id, - __('Version check'), - __( - 'Reading of version failed. ' - . 'Maybe you\'re offline or the upgrade server does not respond.' - ) - ); - return; - } - - $releases = $version_data->releases; - $latestCompatible = $versionInformation->getLatestCompatibleVersion($releases); - if ($latestCompatible != null) { - $version = $latestCompatible['version']; - $date = $latestCompatible['date']; - } else { - return; - } - - $version_upstream = $versionInformation->versionToInt($version); - if ($version_upstream === false) { - PMA_messagesSet( - 'error', - $message_id, - __('Version check'), - __('Got invalid version string from server') - ); - return; - } - - $version_local = $versionInformation->versionToInt( - $GLOBALS['PMA_Config']->get('PMA_VERSION') - ); - if ($version_local === false) { - PMA_messagesSet( - 'error', - $message_id, - __('Version check'), - __('Unparsable version string') - ); - return; - } - - if ($version_upstream > $version_local) { - $version = htmlspecialchars($version); - $date = htmlspecialchars($date); - PMA_messagesSet( - 'notice', - $message_id, - __('Version check'), - sprintf(__('A newer version of phpMyAdmin is available and you should consider upgrading. The newest version is %s, released on %s.'), $version, $date) - ); - } else { - if ($version_local % 100 == 0) { - PMA_messagesSet( - 'notice', - $message_id, - __('Version check'), - PMA_sanitize(sprintf(__('You are using Git version, run [kbd]git pull[/kbd] :-)[br]The latest stable version is %s, released on %s.'), $version, $date)) - ); - } else { - PMA_messagesSet( - 'notice', - $message_id, - __('Version check'), - __('No newer stable version is available') - ); - } - } -} - -/** - * Checks whether config file is readable/writable - * - * @param bool &$is_readable whether the file is readable - * @param bool &$is_writable whether the file is writable - * @param bool &$file_exists whether the file exists - * - * @return void - */ -function PMA_checkConfigRw(&$is_readable, &$is_writable, &$file_exists) -{ - $file_path = $GLOBALS['ConfigFile']->getFilePath(); - $file_dir = dirname($file_path); - $is_readable = true; - $is_writable = @is_dir($file_dir); - if (SETUP_DIR_WRITABLE) { - $is_writable = $is_writable && @is_writable($file_dir); - } - $file_exists = file_exists($file_path); - if ($file_exists) { - $is_readable = is_readable($file_path); - $is_writable = $is_writable && @is_writable($file_path); - } -} diff --git a/#pma/setup/scripts.js b/#pma/setup/scripts.js deleted file mode 100644 index e912bec0..00000000 --- a/#pma/setup/scripts.js +++ /dev/null @@ -1,215 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * Functions used in Setup configuration forms - */ - -// show this window in top frame -if (top != self) { - window.top.location.href = location; -} - -// ------------------------------------------------------------------ -// Messages -// - -// stores hidden message ids -var hiddenMessages = []; - -$(function () { - var hidden = hiddenMessages.length; - for (var i = 0; i < hidden; i++) { - $('#' + hiddenMessages[i]).css('display', 'none'); - } - if (hidden > 0) { - var link = $('#show_hidden_messages'); - link.click(function (e) { - e.preventDefault(); - for (var i = 0; i < hidden; i++) { - $('#' + hiddenMessages[i]).show(500); - } - $(this).remove(); - }); - link.html(link.html().replace('#MSG_COUNT', hidden)); - link.css('display', ''); - } -}); - -//set document width -$(document).ready(function(){ - width = 0; - $('ul.tabs li').each(function(){ - width += $(this).width() + 10; - }); - var contentWidth = width; - width += 250; - $('body').css('min-width', width); - $('.tabs_contents').css('min-width', contentWidth); -}); - -// -// END: Messages -// ------------------------------------------------------------------ - -// ------------------------------------------------------------------ -// Form validation and field operations -// - -/** - * Calls server-side validation procedures - * - * @param {Element} parent input field in
    or
    - * @param {String} id validator id - * @param {Object} values values hash {element1_id: value, ...} - */ -function ajaxValidate(parent, id, values) -{ - parent = $(parent); - // ensure that parent is a fieldset - if (parent.attr('tagName') != 'FIELDSET') { - parent = parent.closest('fieldset'); - if (parent.length === 0) { - return false; - } - } - - if (parent.data('ajax') !== null) { - parent.data('ajax').abort(); - } - - parent.data('ajax', $.ajax({ - url: 'validate.php', - cache: false, - type: 'POST', - data: { - token: parent.closest('form').find('input[name=token]').val(), - id: id, - values: JSON.stringify(values) - }, - success: function (response) { - if (response === null) { - return; - } - - var error = {}; - if (typeof response != 'object') { - error[parent.id] = [response]; - } else if (typeof response.error != 'undefined') { - error[parent.id] = [response.error]; - } else { - for (var key in response) { - var value = response[key]; - error[key] = jQuery.isArray(value) ? value : [value]; - } - } - displayErrors(error); - }, - complete: function () { - parent.removeData('ajax'); - } - })); - - return true; -} - -/** - * Automatic form submission on change. - */ -$(document).on('change', '.autosubmit', function (e) { - e.target.form.submit(); -}); - -$.extend(true, validators, { - // field validators - _field: { - /** - * hide_db field - * - * @param {boolean} isKeyUp - */ - hide_db: function (isKeyUp) { - if (!isKeyUp && this.value !== '') { - var data = {}; - data[this.id] = this.value; - ajaxValidate(this, 'Servers/1/hide_db', data); - } - return true; - }, - /** - * TrustedProxies field - * - * @param {boolean} isKeyUp - */ - TrustedProxies: function (isKeyUp) { - if (!isKeyUp && this.value !== '') { - var data = {}; - data[this.id] = this.value; - ajaxValidate(this, 'TrustedProxies', data); - } - return true; - } - }, - // fieldset validators - _fieldset: { - /** - * Validates Server fieldset - * - * @param {boolean} isKeyUp - */ - Server: function (isKeyUp) { - if (!isKeyUp) { - ajaxValidate(this, 'Server', getAllValues()); - } - return true; - }, - /** - * Validates Server_login_options fieldset - * - * @param {boolean} isKeyUp - */ - Server_login_options: function (isKeyUp) { - return validators._fieldset.Server.apply(this, [isKeyUp]); - }, - /** - * Validates Server_pmadb fieldset - * - * @param {boolean} isKeyUp - */ - Server_pmadb: function (isKeyUp) { - if (isKeyUp) { - return true; - } - - var prefix = getIdPrefix($(this).find('input')); - if ($('#' + prefix + 'pmadb').val() !== '') { - ajaxValidate(this, 'Server_pmadb', getAllValues()); - } - - return true; - } - } -}); - -// -// END: Form validation and field operations -// ------------------------------------------------------------------ - -// ------------------------------------------------------------------ -// User preferences allow/disallow UI -// - -$(function () { - $('.userprefs-allow').click(function (e) { - if (this != e.target) { - return; - } - var el = $(this).find('input'); - if (el.prop('disabled')) { - return; - } - el.prop('checked', !el.prop('checked')); - }); -}); - -// -// END: User preferences allow/disallow UI -// ------------------------------------------------------------------ diff --git a/#pma/setup/styles.css b/#pma/setup/styles.css deleted file mode 100644 index 1b82725d..00000000 --- a/#pma/setup/styles.css +++ /dev/null @@ -1,608 +0,0 @@ -/* global styles */ - -body { - margin-right: auto; - min-width: 960px; - padding-bottom: 1em; - color: #444; - font: .8em sans-serif; - background: url(../themes/pmahomme/img/left_nav_bg.png) repeat-y 80px 0 #f3f3f3; -} - -input, -button, -select, -textarea, -th, -td { - font: 1em sans-serif; -} - -img { - border: 0; -} - -a, -a:link, -a:visited, -a:active { - text-decoration: none; - color: #235a81; - cursor: pointer; - outline: none; - -} - -a:hover { - text-decoration: underline; - color: #235a81; -} - -h1 { - font-size: 1.5em; -} - -/* language selection box */ - -#select_lang { - position: absolute; - right: 1em; - top: 1em; -} - -/* menu */ - -#menu { - float: left; - width: 220px; - font-size: 1.1em; -} - -#menu ul { - margin: 1em 1em 1em .5em; - padding: 0; - list-style: none; -} - -#menu li a { - padding: .5em .6em; - margin-right: .6em; - display: block; - color: #333; - text-decoration: none; - zoom: 1; /* IE fix */ -} - -#menu li a:hover, #menu li a:active, #menu li a.active { - background-color: #e4e4e4; -} - -/* page contents and footer layout */ - -#page { - margin-left: 220px; - margin-right: 25px; -} - -#footer { - margin-top: 1em; -} - -#footer a { - margin-right: 0.5em; - text-decoration: none; - font-size: small; -} - -/* phpMyAdmin logo colors */ - -.blue { - color: #666699; -} - -.orange { - color: #FF9900; -} - -.red { - color: #C00; -} - -/* main page messages */ - -/* message boxes: error, confirmation */ -.success h4, -.notice h4, -div.error h4 { - border-bottom: 1px solid; - font-weight: bold; - margin: 0 0 .2em 0; -} - -div.success, -div.notice, -div.error { - margin: .5em 0 1.3em 0; - border: 1px solid; - background: no-repeat 10px 10px; - padding: 10px 10px 10px 25px; - - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - - -moz-box-shadow: 0 1px 1px #fff inset; - -webkit-box-shadow: 0 1px 1px #fff inset; - box-shadow: 0 1px 1px #fff inset; -} - -.success a, -.notice a, -.error a { - text-decoration: underline; -} - -.success { - color: #000; - background-color: #ebf8a4; -} - -h1.success, -div.success { - border-color: #a2d246; - background: url(../themes/pmahomme/img/s_success.png) no-repeat 5px 10px; -} -.success h4 { - border-color: #00FF00; -} - -.notice { - color: #000; - background-color: #e8eef1; -} - -h1.notice, -div.notice { - border-color: #3a6c7e; - background: url(../themes/pmahomme/img/s_notice.png) no-repeat 5px 10px; -} - -.notice h4 { - border-color: #ffb10a; -} - -.error { - border: 1px solid maroon !important; - color: #000; - background: pink; -} - -h1.error, -div.error { - border-color: #333; - background: url(../themes/pmahomme/img/s_error.png) no-repeat 5px 10px; -} - -div.error h4 { - border-color: #ff0000; -} - -div.notice[id^=version_check] { - border-color: #002DFF; - background-color: #EEF; -} - -div.notice[id^=version_check] h4 { - border-color: #002DFF; -} - - - -/* form tabs */ - -ul.tabs { - margin: 1.1em 2px 0; - padding: 0 0 3px 0; - list-style: none; - font-weight: bold; -} - -ul.tabs li { - float: left; - margin-bottom: -1px; -} - -ul.tabs li a { - display: block; - margin: 1px .2em 0; - white-space: nowrap; - text-decoration: none; - border: 1px solid #D5D5D5; - border-bottom: 1px solid #aaa; -} - -ul.tabs li a { - padding: 7px 10px; - -webkit-border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; - background: #f2f2f2; - color: #555; - text-shadow: 0 1px 0 #fff; -} - -ul.tabs li a:hover, -ul.tabs li a:active { - background: #e5e5e5; -} - -ul.tabs li.active a { - background-color: #fff; - margin-top: 1px; - color: #000; - text-shadow: none; - border-color: #aaa; - border-bottom: 1px solid #fff; -} - -.tabs_contents { - margin-top: 13px; -} - -.tabs_contents fieldset { - margin-top: 0; -} - -.tabs_contents legend { - display: none; -} - -/* "restore default value" and "set value: foo" buttons */ - -.restore-default img, .set-value img { - margin-bottom: -3px; -} - -.userprefs-comment { - cursor: help; - float: right; -} - -/* forms */ - -fieldset { - margin-top: 1em; - border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - -webkit-border-radius: 4px 4px 0 0; - border: #aaa solid 1px; - padding: 1.5em; - background: #eee; - text-shadow: 0 1px 0 #fff; - -moz-box-shadow: 1px 1px 2px #fff inset; - -webkit-box-shadow: 1px 1px 2px #fff inset; - box-shadow: 1px 1px 2px #fff inset; -} - -fieldset.optbox { - padding: 0; -} - -fieldset fieldset { - margin: .8em; - border: 1px solid #aaa; - background: #E8E8E8; -} - -fieldset legend { - font-weight: bold; - color: #444; - padding: 5px 10px; - border-radius: 2px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border: 1px solid #aaa; - background-color: #fff; - -moz-box-shadow: 3px 3px 15px #bbb; - -webkit-box-shadow: 3px 3px 15px #bbb; - box-shadow: 3px 3px 15px #bbb; -} - -.form { - border: 2px #DEE1FF solid; -} - -fieldset p { - margin: 0; - padding: .5em; - background: #fff; - border-top: 0; -} - -fieldset .errors { /* form error list */ - margin: 0 -2px 1em -2px; - padding: 0.5em 1.5em; - background: #FBEAD9; - border: 1px #C83838 solid; - border-width: 1px 0; - list-style: none; - font-family: sans-serif; - font-size: small; -} - -fieldset .inline_errors { /* field error list */ - margin: 0.3em 0.3em 0.3em 0; - padding: 0; - list-style: none; - color: #9A0000; - font-size: small; -} - -table caption, table th, table td { - text-shadow: 0 1px 0 #FFFFFF; -} - -fieldset th { - width: 40%; - min-width: 350px; - padding: 0.3em 0.3em 0.3em 0.5em; - text-align: left; - font-weight: bold; - vertical-align: top; -} - -fieldset.simple th { - width: auto; - min-width: 0; -} - -fieldset .doc { - margin-left: 1em; -} - -fieldset td { - padding-top: 0.3em; - vertical-align: top; -} - -fieldset td.userprefs-allow { - padding: 0; - vertical-align: middle; - text-align: center; - width: 3em; -} - -fieldset td.userprefs-allow:hover { - cursor: pointer; - background-color: #EEE; -} - -fieldset th small { - display: block; - font-weight: normal; - font-family: sans-serif; - font-size: x-small; - color: #666; -} - -fieldset th, fieldset td, .form .lastrow { - border-top: 1px solid #D5D5D5; -} - -fieldset .group-header th { - background: #EAEDFF; - border: none; -} - -fieldset .group-field-1 th, fieldset .group-header-2 th { - padding-left: 1em; -} - -fieldset .group-field-2 th, fieldset .group-header-3 th { - padding-left: 2em; -} - -fieldset .group-field-3 th { - padding-left: 3em; -} - -fieldset .lastrow, .form .lastrow { - border-top: 1px #000 solid; - background: #D3DCE3; - padding: .5em; - text-align: center; -} - -input[type=text], -input[type=password], -input[type=number] { - border-radius: 2px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - - box-shadow: 0 1px 2px #ddd; - -moz-box-shadow: 0 1px 2px #ddd; - -webkit-box-shadow: 0 1px 2px #ddd; - - background: white; - border: 1px solid #aaa; - color: #555; - padding: 4px; - margin: 6px; -} - -input[type=submit], -button[type=submit]:not(.mult_submit) { - font-weight: bold !important; -} - -input[type=submit], -button[type=submit]:not(.mult_submit), -input[type=reset], -input[name=submit_reset], -input.button { - margin-left: 14px; - border: 1px solid #aaa; - padding: 3px 7px; - color: #111; - text-decoration: none; - background: #ddd; - - border-radius: 12px; - -webkit-border-radius: 12px; - -moz-border-radius: 12px; - - text-shadow: 0 1px 0 #fff; - - background-image: url(../themes/svg_gradient.php?from=ffffff&to=cccccc); - background-size: 100% 100%; - background: -webkit-linear-gradient(top, #ffffff, #cccccc); - background: -moz-linear-gradient(top, #ffffff, #cccccc); - background: -ms-linear-gradient(top, #ffffff, #cccccc); - background: -o-linear-gradient(top, #ffffff, #cccccc); -} - -input[type=submit]:hover, -button[type=submit]:not(.mult_submit):hover, -input[type=reset]:hover, -input[name=submit_reset]:hover, -input.button:hover { - position: relative; - background-image: url(../themes/svg_gradient.php?from=cccccc&to=dddddd); - background-size: 100% 100%; - background: -webkit-linear-gradient(top, #cccccc, #dddddd); - background: -moz-linear-gradient(top, #cccccc, #dddddd); - background: -ms-linear-gradient(top, #cccccc, #dddddd); - background: -o-linear-gradient(top, #cccccc, #dddddd); - cursor: pointer; -} - -input[type=submit]:active, -button[type=submit]:not(.mult_submit):active, -input[type=reset]:active, -input[name=submit_reset]:active, -input.button:active { - position: relative; - top: 1px; - left: 1px; -} - -input[type="checkbox"], -input[type="radio"] { - vertical-align: -11%; -} - - -select { - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; - - -moz-box-shadow: 0 1px 2px #ddd; - -webkit-box-shadow: 0 1px 2px #ddd; - box-shadow: 0 1px 2px #ddd; - - border: 1px solid #aaa; - color: #333; - padding: 3px; - background: white; - margin: 6px; -} - -fieldset.simple th, fieldset.simple td { - border-top: none; - border-bottom: 1px #555 dotted; -} - -fieldset.simple .lastrow { - border: 0; -} - -/* form elements */ - -span.checkbox { - padding: 2px; - display: inline-block; -} - -.custom { /* customized field */ - background: #FFC; -} - -.checkbox.custom { - padding: 1px; - border: 1px #EDEC90 solid; -} - -.field-error { - border-color: #C11 !important; -} - -.field-comment { - - position: relative; -} - -.field-comment-mark { - cursor: help; - padding: 0 0.2em; - font-weight: bold; - font-style: italic; -} - -.field-comment-warning { - color: #A00; -} - -.green { /* default form button */ - color: #080 !important; -} - -table.datatable { - margin: 0.5em 0 1em; -} - -table.datatable th { - padding: 0 1em 0 0.5em; - border-bottom: 1px #999 solid; - text-align: left; -} - -table.datatable td { - padding: 1px 0.5em; - border-bottom: 1px #DEE1FF solid; -} - -/* textarea with config file's contents */ - -#textconfig { - width: 100%; - border: 0; -} - -/* error list */ - -dd { - margin-left: 0.5em; -} - -dd:before { - content: "\25B8 "; -} - -/* links on failed validation page, when saving a form */ - -a.btn { - padding: 1px 5px; - text-decoration: none; - background: #E2E8FF; - border: 1px #A6C8FF solid; - border-top-color: #AFD0FF; - border-left-color: #AFD0FF; - font-weight: bold; -} - -a.btn:hover, a.btn:active { - background: #E6F5FF; - color: #004C96; -} diff --git a/#pma/setup/validate.php b/#pma/setup/validate.php deleted file mode 100644 index c53c0e73..00000000 --- a/#pma/setup/validate.php +++ /dev/null @@ -1,34 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('jquery/jquery-ui-timepicker-addon.js'); -$scripts->addFile('jquery/jquery.uitablefilter.js'); -$scripts->addFile('tbl_change.js'); -$scripts->addFile('indexes.js'); -$scripts->addFile('gis_data_editor.js'); -$scripts->addFile('multi_column_sort.js'); - -/** - * Set ajax_reload in the response if it was already set - */ -if (isset($ajax_reload) && $ajax_reload['reload'] === true) { - $response->addJSON('ajax_reload', $ajax_reload); -} - - -/** - * Defines the url to return to in case of error in a sql statement - */ -$is_gotofile = true; -if (empty($goto)) { - if (empty($table)) { - $goto = Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabDatabase'], 'database' - ); - } else { - $goto = Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ); - } -} // end if - -if (! isset($err_url)) { - $err_url = (! empty($back) ? $back : $goto) - . '?' . PMA_URL_getCommon(array('db' => $GLOBALS['db'])) - . ((mb_strpos(' ' . $goto, 'db_') != 1 - && mb_strlen($table)) - ? '&table=' . urlencode($table) - : '' - ); -} // end if - -// Coming from a bookmark dialog -if (isset($_POST['bkm_fields']['bkm_sql_query'])) { - $sql_query = $_POST['bkm_fields']['bkm_sql_query']; -} elseif (isset($_GET['sql_query'])) { - $sql_query = $_GET['sql_query']; -} - -// This one is just to fill $db -if (isset($_POST['bkm_fields']['bkm_database'])) { - $db = $_POST['bkm_fields']['bkm_database']; -} - - -// During grid edit, if we have a relational field, show the dropdown for it. -if (isset($_REQUEST['get_relational_values']) - && $_REQUEST['get_relational_values'] == true -) { - PMA_getRelationalValues($db, $table); - // script has exited at this point -} - -// Just like above, find possible values for enum fields during grid edit. -if (isset($_REQUEST['get_enum_values']) && $_REQUEST['get_enum_values'] == true) { - PMA_getEnumOrSetValues($db, $table, "enum"); - // script has exited at this point -} - - -// Find possible values for set fields during grid edit. -if (isset($_REQUEST['get_set_values']) && $_REQUEST['get_set_values'] == true) { - PMA_getEnumOrSetValues($db, $table, "set"); - // script has exited at this point -} - -if (isset($_REQUEST['get_default_fk_check_value']) - && $_REQUEST['get_default_fk_check_value'] == true -) { - $response = Response::getInstance(); - $response->addJSON( - 'default_fk_check_value', Util::isForeignKeyCheck() - ); - exit; -} - -/** - * Check ajax request to set the column order and visibility - */ -if (isset($_REQUEST['set_col_prefs']) && $_REQUEST['set_col_prefs'] == true) { - PMA_setColumnOrderOrVisibility($table, $db); - // script has exited at this point -} - -// Default to browse if no query set and we have table -// (needed for browsing from DefaultTabTable) -$tableLength = mb_strlen($table); -$dbLength = mb_strlen($db); -if (empty($sql_query) && $tableLength && $dbLength) { - $sql_query = PMA_getDefaultSqlQueryForBrowse($db, $table); - - // set $goto to what will be displayed if query returns 0 rows - $goto = ''; -} else { - // Now we can check the parameters - Util::checkParameters(array('sql_query')); -} - -/** - * Parse and analyze the query - */ -require_once 'libraries/parse_analyze.lib.php'; -list( - $analyzed_sql_results, - $db, - $table_from_sql -) = PMA_parseAnalyze($sql_query, $db); -// @todo: possibly refactor -extract($analyzed_sql_results); - -if ($table != $table_from_sql && !empty($table_from_sql)) { - $table = $table_from_sql; -} - - -/** - * Check rights in case of DROP DATABASE - * - * This test may be bypassed if $is_js_confirmed = 1 (already checked with js) - * but since a malicious user may pass this variable by url/form, we don't take - * into account this case. - */ -if (PMA_hasNoRightsToDropDatabase( - $analyzed_sql_results, $cfg['AllowUserDropDatabase'], $is_superuser -)) { - Util::mysqlDie( - __('"DROP DATABASE" statements are disabled.'), - '', - false, - $err_url - ); -} // end if - -/** - * Need to find the real end of rows? - */ -if (isset($find_real_end) && $find_real_end) { - $unlim_num_rows = PMA_findRealEndOfRows($db, $table); -} - - -/** - * Bookmark add - */ -if (isset($_POST['store_bkm'])) { - PMA_addBookmark($goto); - // script has exited at this point -} // end if - - -/** - * Sets or modifies the $goto variable if required - */ -if ($goto == 'sql.php') { - $is_gotofile = false; - $goto = 'sql.php' . PMA_URL_getCommon( - array( - 'db' => $db, - 'table' => $table, - 'sql_query' => $sql_query - ) - ); -} // end if - -PMA_executeQueryAndSendQueryResponse( - $analyzed_sql_results, // analyzed_sql_results - $is_gotofile, // is_gotofile - $db, // db - $table, // table - isset($find_real_end) ? $find_real_end : null, // find_real_end - isset($import_text) ? $import_text : null, // sql_query_for_bookmark - isset($extra_data) ? $extra_data : null, // extra_data - isset($message_to_show) ? $message_to_show : null, // message_to_show - isset($message) ? $message : null, // message - isset($sql_data) ? $sql_data : null, // sql_data - $goto, // goto - $pmaThemeImage, // pmaThemeImage - isset($disp_query) ? $display_query : null, // disp_query - isset($disp_message) ? $disp_message : null, // disp_message - isset($query_type) ? $query_type : null, // query_type - $sql_query, // sql_query - isset($selected) ? $selected : null, // selectedTables - isset($complete_query) ? $complete_query : null // complete_query -); diff --git a/#pma/sql/create_tables.sql b/#pma/sql/create_tables.sql deleted file mode 100644 index f906115f..00000000 --- a/#pma/sql/create_tables.sql +++ /dev/null @@ -1,355 +0,0 @@ --- -------------------------------------------------------- --- SQL Commands to set up the pmadb as described in the documentation. --- --- This file is meant for use with MySQL 5 and above! --- --- This script expects the user pma to already be existing. If we would put a --- line here to create him too many users might just use this script and end --- up with having the same password for the controluser. --- --- This user "pma" must be defined in config.inc.php (controluser/controlpass) --- --- Please don't forget to set up the tablenames in config.inc.php --- - --- -------------------------------------------------------- - --- --- Database : `phpmyadmin` --- -CREATE DATABASE IF NOT EXISTS `phpmyadmin` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; -USE phpmyadmin; - --- -------------------------------------------------------- - --- --- Privileges --- --- (activate this statement if necessary) --- GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON `phpmyadmin`.* TO --- 'pma'@localhost; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__bookmark` --- - -CREATE TABLE IF NOT EXISTS `pma__bookmark` ( - `id` int(11) NOT NULL auto_increment, - `dbase` varchar(255) NOT NULL default '', - `user` varchar(255) NOT NULL default '', - `label` varchar(255) COLLATE utf8_general_ci NOT NULL default '', - `query` text NOT NULL, - PRIMARY KEY (`id`) -) - COMMENT='Bookmarks' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__column_info` --- - -CREATE TABLE IF NOT EXISTS `pma__column_info` ( - `id` int(5) unsigned NOT NULL auto_increment, - `db_name` varchar(64) NOT NULL default '', - `table_name` varchar(64) NOT NULL default '', - `column_name` varchar(64) NOT NULL default '', - `comment` varchar(255) COLLATE utf8_general_ci NOT NULL default '', - `mimetype` varchar(255) COLLATE utf8_general_ci NOT NULL default '', - `transformation` varchar(255) NOT NULL default '', - `transformation_options` varchar(255) NOT NULL default '', - `input_transformation` varchar(255) NOT NULL default '', - `input_transformation_options` varchar(255) NOT NULL default '', - PRIMARY KEY (`id`), - UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`) -) - COMMENT='Column information for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__history` --- - -CREATE TABLE IF NOT EXISTS `pma__history` ( - `id` bigint(20) unsigned NOT NULL auto_increment, - `username` varchar(64) NOT NULL default '', - `db` varchar(64) NOT NULL default '', - `table` varchar(64) NOT NULL default '', - `timevalue` timestamp NOT NULL default CURRENT_TIMESTAMP, - `sqlquery` text NOT NULL, - PRIMARY KEY (`id`), - KEY `username` (`username`,`db`,`table`,`timevalue`) -) - COMMENT='SQL history for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__pdf_pages` --- - -CREATE TABLE IF NOT EXISTS `pma__pdf_pages` ( - `db_name` varchar(64) NOT NULL default '', - `page_nr` int(10) unsigned NOT NULL auto_increment, - `page_descr` varchar(50) COLLATE utf8_general_ci NOT NULL default '', - PRIMARY KEY (`page_nr`), - KEY `db_name` (`db_name`) -) - COMMENT='PDF relation pages for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__recent` --- - -CREATE TABLE IF NOT EXISTS `pma__recent` ( - `username` varchar(64) NOT NULL, - `tables` text NOT NULL, - PRIMARY KEY (`username`) -) - COMMENT='Recently accessed tables' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__favorite` --- - -CREATE TABLE IF NOT EXISTS `pma__favorite` ( - `username` varchar(64) NOT NULL, - `tables` text NOT NULL, - PRIMARY KEY (`username`) -) - COMMENT='Favorite tables' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__table_uiprefs` --- - -CREATE TABLE IF NOT EXISTS `pma__table_uiprefs` ( - `username` varchar(64) NOT NULL, - `db_name` varchar(64) NOT NULL, - `table_name` varchar(64) NOT NULL, - `prefs` text NOT NULL, - `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`username`,`db_name`,`table_name`) -) - COMMENT='Tables'' UI preferences' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__relation` --- - -CREATE TABLE IF NOT EXISTS `pma__relation` ( - `master_db` varchar(64) NOT NULL default '', - `master_table` varchar(64) NOT NULL default '', - `master_field` varchar(64) NOT NULL default '', - `foreign_db` varchar(64) NOT NULL default '', - `foreign_table` varchar(64) NOT NULL default '', - `foreign_field` varchar(64) NOT NULL default '', - PRIMARY KEY (`master_db`,`master_table`,`master_field`), - KEY `foreign_field` (`foreign_db`,`foreign_table`) -) - COMMENT='Relation table' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__table_coords` --- - -CREATE TABLE IF NOT EXISTS `pma__table_coords` ( - `db_name` varchar(64) NOT NULL default '', - `table_name` varchar(64) NOT NULL default '', - `pdf_page_number` int(11) NOT NULL default '0', - `x` float unsigned NOT NULL default '0', - `y` float unsigned NOT NULL default '0', - PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`) -) - COMMENT='Table coordinates for phpMyAdmin PDF output' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__table_info` --- - -CREATE TABLE IF NOT EXISTS `pma__table_info` ( - `db_name` varchar(64) NOT NULL default '', - `table_name` varchar(64) NOT NULL default '', - `display_field` varchar(64) NOT NULL default '', - PRIMARY KEY (`db_name`,`table_name`) -) - COMMENT='Table information for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__tracking` --- - -CREATE TABLE IF NOT EXISTS `pma__tracking` ( - `db_name` varchar(64) NOT NULL, - `table_name` varchar(64) NOT NULL, - `version` int(10) unsigned NOT NULL, - `date_created` datetime NOT NULL, - `date_updated` datetime NOT NULL, - `schema_snapshot` text NOT NULL, - `schema_sql` text, - `data_sql` longtext, - `tracking` set('UPDATE','REPLACE','INSERT','DELETE','TRUNCATE','CREATE DATABASE','ALTER DATABASE','DROP DATABASE','CREATE TABLE','ALTER TABLE','RENAME TABLE','DROP TABLE','CREATE INDEX','DROP INDEX','CREATE VIEW','ALTER VIEW','DROP VIEW') default NULL, - `tracking_active` int(1) unsigned NOT NULL default '1', - PRIMARY KEY (`db_name`,`table_name`,`version`) -) - COMMENT='Database changes tracking for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__userconfig` --- - -CREATE TABLE IF NOT EXISTS `pma__userconfig` ( - `username` varchar(64) NOT NULL, - `timevalue` timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `config_data` text NOT NULL, - PRIMARY KEY (`username`) -) - COMMENT='User preferences storage for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__users` --- - -CREATE TABLE IF NOT EXISTS `pma__users` ( - `username` varchar(64) NOT NULL, - `usergroup` varchar(64) NOT NULL, - PRIMARY KEY (`username`,`usergroup`) -) - COMMENT='Users and their assignments to user groups' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__usergroups` --- - -CREATE TABLE IF NOT EXISTS `pma__usergroups` ( - `usergroup` varchar(64) NOT NULL, - `tab` varchar(64) NOT NULL, - `allowed` enum('Y','N') NOT NULL DEFAULT 'N', - PRIMARY KEY (`usergroup`,`tab`,`allowed`) -) - COMMENT='User groups with configured menu items' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__navigationhiding` --- - -CREATE TABLE IF NOT EXISTS `pma__navigationhiding` ( - `username` varchar(64) NOT NULL, - `item_name` varchar(64) NOT NULL, - `item_type` varchar(64) NOT NULL, - `db_name` varchar(64) NOT NULL, - `table_name` varchar(64) NOT NULL, - PRIMARY KEY (`username`,`item_name`,`item_type`,`db_name`,`table_name`) -) - COMMENT='Hidden items of navigation tree' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__savedsearches` --- - -CREATE TABLE IF NOT EXISTS `pma__savedsearches` ( - `id` int(5) unsigned NOT NULL auto_increment, - `username` varchar(64) NOT NULL default '', - `db_name` varchar(64) NOT NULL default '', - `search_name` varchar(64) NOT NULL default '', - `search_data` text NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `u_savedsearches_username_dbname` (`username`,`db_name`,`search_name`) -) - COMMENT='Saved searches' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__central_columns` --- - -CREATE TABLE IF NOT EXISTS `pma__central_columns` ( - `db_name` varchar(64) NOT NULL, - `col_name` varchar(64) NOT NULL, - `col_type` varchar(64) NOT NULL, - `col_length` text, - `col_collation` varchar(64) NOT NULL, - `col_isNull` boolean NOT NULL, - `col_extra` varchar(255) default '', - `col_default` text, - PRIMARY KEY (`db_name`,`col_name`) -) - COMMENT='Central list of columns' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__designer_settings` --- - -CREATE TABLE IF NOT EXISTS `pma__designer_settings` ( - `username` varchar(64) NOT NULL, - `settings_data` text NOT NULL, - PRIMARY KEY (`username`) -) - COMMENT='Settings related to Designer' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__export_templates` --- - -CREATE TABLE IF NOT EXISTS `pma__export_templates` ( - `id` int(5) unsigned NOT NULL AUTO_INCREMENT, - `username` varchar(64) NOT NULL, - `export_type` varchar(10) NOT NULL, - `template_name` varchar(64) NOT NULL, - `template_data` text NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `u_user_type_template` (`username`,`export_type`,`template_name`) -) - COMMENT='Saved export templates' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; diff --git a/#pma/sql/upgrade_column_info_4_3_0+.sql b/#pma/sql/upgrade_column_info_4_3_0+.sql deleted file mode 100644 index b5bdc0c1..00000000 --- a/#pma/sql/upgrade_column_info_4_3_0+.sql +++ /dev/null @@ -1,47 +0,0 @@ --- ------------------------------------------------------------- --- SQL Commands to upgrade pmadb.pma__column_info table --- for normal phpMyAdmin operation --- --- This file is meant for use with phpMyAdmin 4.3.0 and above! --- For older releases, please use create_tables.sql --- --- Please don't forget to set up the table names in config.inc.php --- - --- -------------------------------------------------------- - --- --- Database : `phpmyadmin` --- -USE `phpmyadmin`; - --- -------------------------------------------------------- - --- --- Update table structure for table `pma__column_info` --- -UPDATE `pma__column_info` - SET `mimetype` = REPLACE(`mimetype`, 'octet-stream', 'octetstream'); -UPDATE `pma__column_info` - SET `transformation` = REPLACE(REPLACE(`transformation`, '__', '_'), 'inc.php', 'class.php'); -UPDATE `pma__column_info` - SET `transformation` = '' - WHERE `transformation` = '_'; -UPDATE `pma__column_info` - SET `transformation` = CONCAT('output/', `transformation`) - WHERE `transformation` IN ( - 'application_octetstream_download.class.php', - 'application_octetstream_hex.class.php', - 'image_jpeg_inline.class.php', - 'image_jpeg_link.class.php', - 'image_png_inline.class.php', - 'text_plain_bool2text.class.php', - 'text_plain_dateformat.class.php', - 'text_plain_external.class.php', - 'text_plain_formatted.class.php', - 'text_plain_imagelink.class.php', - 'text_plain_sql.class.php' - ); -ALTER TABLE `pma__column_info` - ADD `input_transformation` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - ADD `input_transformation_options` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; diff --git a/#pma/sql/upgrade_tables_mysql_4_1_2+.sql b/#pma/sql/upgrade_tables_mysql_4_1_2+.sql deleted file mode 100644 index df4046a4..00000000 --- a/#pma/sql/upgrade_tables_mysql_4_1_2+.sql +++ /dev/null @@ -1,144 +0,0 @@ --- ------------------------------------------------------------- --- SQL Commands to upgrade pmadb for normal phpMyAdmin operation --- with MySQL 4.1.2 and above. --- --- This file is meant for use with MySQL 4.1.2 and above! --- For older MySQL releases, please use create_tables.sql --- --- If you are running one MySQL 4.1.0 or 4.1.1, please create the tables using --- create_tables.sql, then use this script. --- --- Please don't forget to set up the tablenames in config.inc.php --- - --- -------------------------------------------------------- - --- --- Database : `phpmyadmin` --- -ALTER DATABASE `phpmyadmin` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; -USE phpmyadmin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__bookmark` --- -ALTER TABLE `pma__bookmark` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma__bookmark` - CHANGE `dbase` `dbase` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__bookmark` - CHANGE `user` `user` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__bookmark` - CHANGE `label` `label` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''; -ALTER TABLE `pma__bookmark` - CHANGE `query` `query` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__column_info` --- - -ALTER TABLE `pma__column_info` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma__column_info` - CHANGE `db_name` `db_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__column_info` - CHANGE `table_name` `table_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__column_info` - CHANGE `column_name` `column_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__column_info` - CHANGE `comment` `comment` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''; -ALTER TABLE `pma__column_info` - CHANGE `mimetype` `mimetype` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''; -ALTER TABLE `pma__column_info` - CHANGE `transformation` `transformation` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__column_info` - CHANGE `transformation_options` `transformation_options` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__history` --- -ALTER TABLE `pma__history` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma__history` - CHANGE `username` `username` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__history` - CHANGE `db` `db` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__history` - CHANGE `table` `table` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__history` - CHANGE `sqlquery` `sqlquery` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__pdf_pages` --- - -ALTER TABLE `pma__pdf_pages` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma__pdf_pages` - CHANGE `db_name` `db_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__pdf_pages` - CHANGE `page_descr` `page_descr` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default ''; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__relation` --- -ALTER TABLE `pma__relation` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma__relation` - CHANGE `master_db` `master_db` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__relation` - CHANGE `master_table` `master_table` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__relation` - CHANGE `master_field` `master_field` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__relation` - CHANGE `foreign_db` `foreign_db` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__relation` - CHANGE `foreign_table` `foreign_table` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__relation` - CHANGE `foreign_field` `foreign_field` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__table_coords` --- - -ALTER TABLE `pma__table_coords` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma__table_coords` - CHANGE `db_name` `db_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__table_coords` - CHANGE `table_name` `table_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; - --- -------------------------------------------------------- - --- --- Table structure for table `pma__table_info` --- - -ALTER TABLE `pma__table_info` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma__table_info` - CHANGE `db_name` `db_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__table_info` - CHANGE `table_name` `table_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma__table_info` - CHANGE `display_field` `display_field` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; diff --git a/#pma/tbl_addfield.php b/#pma/tbl_addfield.php deleted file mode 100644 index 90424f57..00000000 --- a/#pma/tbl_addfield.php +++ /dev/null @@ -1,131 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('tbl_structure.js'); - -// Check parameters -PMA\libraries\Util::checkParameters(array('db', 'table')); - - -/** - * Defines the url to return to in case of error in a sql statement - */ -$err_url = 'tbl_sql.php' . PMA_URL_getCommon( - array( - 'db' => $db, 'table' => $table - ) -); - -/** - * The form used to define the field to add has been submitted - */ -$abort = false; - -// check number of fields to be created -if (isset($_REQUEST['submit_num_fields'])) { - if (isset($_REQUEST['orig_after_field'])) { - $_REQUEST['after_field'] = $_REQUEST['orig_after_field']; - } - if (isset($_REQUEST['orig_field_where'])) { - $_REQUEST['field_where'] = $_REQUEST['orig_field_where']; - } - $num_fields = min( - intval($_REQUEST['orig_num_fields']) + intval($_REQUEST['added_fields']), - 4096 - ); - $regenerate = true; -} elseif (isset($_REQUEST['num_fields']) && intval($_REQUEST['num_fields']) > 0) { - $num_fields = min(4096, intval($_REQUEST['num_fields'])); -} else { - $num_fields = 1; -} - -if (isset($_REQUEST['do_save_data'])) { - //avoid an incorrect calling of PMA_updateColumns() via - //tbl_structure.php below - unset($_REQUEST['do_save_data']); - - include_once 'libraries/create_addfield.lib.php'; - - list($result, $sql_query) = PMA_tryColumnCreationQuery($db, $table, $err_url); - - if ($result === true) { - // If comments were sent, enable relation stuff - include_once 'libraries/transformations.lib.php'; - - // Update comment table for mime types [MIME] - if (isset($_REQUEST['field_mimetype']) - && is_array($_REQUEST['field_mimetype']) - && $cfg['BrowseMIME'] - ) { - foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) { - if (isset($_REQUEST['field_name'][$fieldindex]) - && mb_strlen($_REQUEST['field_name'][$fieldindex]) - ) { - PMA_setMIME( - $db, $table, - $_REQUEST['field_name'][$fieldindex], - $mimetype, - $_REQUEST['field_transformation'][$fieldindex], - $_REQUEST['field_transformation_options'][$fieldindex], - $_REQUEST['field_input_transformation'][$fieldindex], - $_REQUEST['field_input_transformation_options'][$fieldindex] - ); - } - } - } - - // Go back to the structure sub-page - $message = PMA\libraries\Message::success( - __('Table %1$s has been altered successfully.') - ); - $message->addParam($table); - $response->addJSON( - 'message', - PMA\libraries\Util::getMessage($message, $sql_query, 'success') - ); - exit; - } else { - $error_message_html = PMA\libraries\Util::mysqlDie( - '', - '', - false, - $err_url, - false - ); - $response->addHTML($error_message_html); - $response->setRequestStatus(false); - exit; - } -} // end do alter table - -/** - * Displays the form used to define the new field - */ -if ($abort == false) { - /** - * Gets tables information - */ - include_once 'libraries/tbl_common.inc.php'; - include_once 'libraries/tbl_info.inc.php'; - - $active_page = 'tbl_structure.php'; - /** - * Display the form - */ - $action = 'tbl_addfield.php'; - include_once 'libraries/tbl_columns_definition_form.inc.php'; -} diff --git a/#pma/tbl_change.php b/#pma/tbl_change.php deleted file mode 100644 index 2022abd4..00000000 --- a/#pma/tbl_change.php +++ /dev/null @@ -1,236 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('sql.js'); -$scripts->addFile('tbl_change.js'); -$scripts->addFile('big_ints.js'); -$scripts->addFile('jquery/jquery-ui-timepicker-addon.js'); -$scripts->addFile('jquery/jquery.validate.js'); -$scripts->addFile('jquery/additional-methods.js'); -$scripts->addFile('gis_data_editor.js'); - -/** - * Displays the query submitted and its result - * - * $disp_message come from tbl_replace.php - */ -if (! empty($disp_message)) { - $response->addHTML(Util::getMessage($disp_message, null)); -} - -$table_columns = PMA_getTableColumns($db, $table); - -// retrieve keys into foreign fields, if any -$foreigners = PMA_getForeigners($db, $table); - -// Retrieve form parameters for insert/edit form -$_form_params = PMA_getFormParametersForInsertForm( - $db, $table, $where_clauses, $where_clause_array, $err_url -); - -/** - * Displays the form - */ -// autocomplete feature of IE kills the "onchange" event handler and it -// must be replaced by the "onpropertychange" one in this case -$chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' - && PMA_USR_BROWSER_VER >= 5 - && PMA_USR_BROWSER_VER < 7 -) - ? 'onpropertychange' - : 'onchange'; -// Had to put the URI because when hosted on an https server, -// some browsers send wrongly this form to the http server. - -$html_output = ''; -// Set if we passed the first timestamp field -$timestamp_seen = false; -$columns_cnt = count($table_columns); - -$tabindex = 0; -$tabindex_for_function = +3000; -$tabindex_for_null = +6000; -$tabindex_for_value = 0; -$o_rows = 0; -$biggest_max_file_size = 0; - -$url_params['db'] = $db; -$url_params['table'] = $table; -$url_params = PMA_urlParamsInEditMode( - $url_params, $where_clause_array, $where_clause -); - -$has_blob_field = false; -foreach ($table_columns as $column) { - if (PMA_isColumn( - $column, - array('blob', 'tinyblob', 'mediumblob', 'longblob') - )) { - $has_blob_field = true; - break; - } -} - -//Insert/Edit form -//If table has blob fields we have to disable ajax. -$html_output .= PMA_getHtmlForInsertEditFormHeader($has_blob_field, $is_upload); - -$html_output .= PMA_URL_getHiddenInputs($_form_params); - -$titles['Browse'] = Util::getIcon('b_browse.png', __('Browse foreign values')); - -// user can toggle the display of Function column and column types -// (currently does not work for multi-edits) -if (! $cfg['ShowFunctionFields'] || ! $cfg['ShowFieldTypesInDataEditView']) { - $html_output .= __('Show'); -} - -if (! $cfg['ShowFunctionFields']) { - $html_output .= PMA_showTypeOrFunction('function', $url_params, false); -} - -if (! $cfg['ShowFieldTypesInDataEditView']) { - $html_output .= PMA_showTypeOrFunction('type', $url_params, false); -} - -$GLOBALS['plugin_scripts'] = array(); -foreach ($rows as $row_id => $current_row) { - if (empty($current_row)) { - $current_row = array(); - } - - $jsvkey = $row_id; - $vkey = '[multi_edit][' . $jsvkey . ']'; - - $current_result = (isset($result) && is_array($result) && isset($result[$row_id]) - ? $result[$row_id] - : $result); - $repopulate = array(); - $checked = true; - if (isset($unsaved_values[$row_id])) { - $repopulate = $unsaved_values[$row_id]; - $checked = false; - } - if ($insert_mode && $row_id > 0) { - $html_output .= PMA_getHtmlForIgnoreOption($row_id, $checked); - } - - $html_output .= PMA_getHtmlForInsertEditRow( - $url_params, $table_columns, $comments_map, $timestamp_seen, - $current_result, $chg_evt_handler, $jsvkey, $vkey, $insert_mode, - $current_row, $o_rows, $tabindex, $columns_cnt, - $is_upload, $tabindex_for_function, $foreigners, $tabindex_for_null, - $tabindex_for_value, $table, $db, $row_id, $titles, - $biggest_max_file_size, $text_dir, $repopulate, $where_clause_array - ); -} // end foreach on multi-edit -$scripts->addFiles($GLOBALS['plugin_scripts']); -unset($unsaved_values, $checked, $repopulate, $GLOBALS['plugin_scripts']); - -if (! isset($after_insert)) { - $after_insert = 'back'; -} - -//action panel -$html_output .= PMA_getActionsPanel( - $where_clause, $after_insert, $tabindex, - $tabindex_for_value, $found_unique_key -); - -if ($biggest_max_file_size > 0) { - $html_output .= ' ' - . Util::generateHiddenMaxFileSize( - $biggest_max_file_size - ) . "\n"; -} -$html_output .= ''; - -$html_output .= PMA_getHtmlForGisEditor(); -// end Insert/Edit form - -if ($insert_mode) { - //Continue insertion form - $html_output .= PMA_getContinueInsertionForm( - $table, $db, $where_clause_array, $err_url - ); -} - -$response->addHTML($html_output); diff --git a/#pma/tbl_chart.php b/#pma/tbl_chart.php deleted file mode 100644 index 1de35d8a..00000000 --- a/#pma/tbl_chart.php +++ /dev/null @@ -1,33 +0,0 @@ -factory('PMA\libraries\controllers\table\TableChartController'); -$container->alias( - 'TableChartController', 'PMA\libraries\controllers\table\TableChartController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/* Define dependencies for the concerned controller */ -$dependency_definitions = array( - "sql_query" => &$GLOBALS['sql_query'], - "url_query" => &$GLOBALS['url_query'], - "cfg" => &$GLOBALS['cfg'] -); - -/** @var TableChartController $controller */ -$controller = $container->get('TableChartController', $dependency_definitions); -$controller->indexAction(); diff --git a/#pma/tbl_create.php b/#pma/tbl_create.php deleted file mode 100644 index c465c28c..00000000 --- a/#pma/tbl_create.php +++ /dev/null @@ -1,103 +0,0 @@ -selectDb($db)) { - PMA\libraries\Util::mysqlDie( - sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($db)), - '', - false, - 'index.php' - ); -} - -if ($GLOBALS['dbi']->getColumns($db, $table)) { - // table exists already - PMA\libraries\Util::mysqlDie( - sprintf(__('Table %s already exists!'), htmlspecialchars($table)), - '', - false, - 'db_structure.php' . PMA_URL_getCommon(array('db' => $db)) - ); -} - -// for libraries/tbl_columns_definition_form.inc.php -// check number of fields to be created -$num_fields = PMA_getNumberOfFieldsFromRequest(); - -$action = 'tbl_create.php'; - -/** - * The form used to define the structure of the table has been submitted - */ -if (isset($_REQUEST['do_save_data'])) { - $sql_query = PMA_getTableCreationQuery($db, $table); - - // If there is a request for SQL previewing. - if (isset($_REQUEST['preview_sql'])) { - PMA_previewSQL($sql_query); - } - // Executes the query - $result = $GLOBALS['dbi']->tryQuery($sql_query); - - if ($result) { - // If comments were sent, enable relation stuff - include_once 'libraries/transformations.lib.php'; - // Update comment table for mime types [MIME] - if (isset($_REQUEST['field_mimetype']) - && is_array($_REQUEST['field_mimetype']) - && $cfg['BrowseMIME'] - ) { - foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) { - if (isset($_REQUEST['field_name'][$fieldindex]) - && mb_strlen($_REQUEST['field_name'][$fieldindex]) - ) { - PMA_setMIME( - $db, $table, - $_REQUEST['field_name'][$fieldindex], $mimetype, - $_REQUEST['field_transformation'][$fieldindex], - $_REQUEST['field_transformation_options'][$fieldindex], - $_REQUEST['field_input_transformation'][$fieldindex], - $_REQUEST['field_input_transformation_options'][$fieldindex] - ); - } - } - } - } else { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus(false); - $response->addJSON('message', $GLOBALS['dbi']->getError()); - } - exit; -} // end do create table - -//This global variable needs to be reset for the headerclass to function properly -$GLOBAL['table'] = ''; - -/** - * Displays the form used to define the structure of the table - */ -require 'libraries/tbl_columns_definition_form.inc.php'; diff --git a/#pma/tbl_export.php b/#pma/tbl_export.php deleted file mode 100644 index 740e2249..00000000 --- a/#pma/tbl_export.php +++ /dev/null @@ -1,145 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('export.js'); - -// Get the relation settings -$cfgRelation = PMA_getRelationsParam(); - -// handling export template actions -if (isset($_REQUEST['templateAction']) && $cfgRelation['exporttemplateswork']) { - PMA_handleExportTemplateActions($cfgRelation); - exit; -} - -/** - * Gets tables information and displays top links - */ -require_once 'libraries/tbl_common.inc.php'; -$url_query .= '&goto=tbl_export.php&back=tbl_export.php'; -require_once 'libraries/tbl_info.inc.php'; - -// Dump of a table - -$export_page_title = __('View dump (schema) of table'); - -// When we have some query, we need to remove LIMIT from that and possibly -// generate WHERE clause (if we are asked to export specific rows) - -if (! empty($sql_query)) { - $parser = new SqlParser\Parser($sql_query); - - if ((!empty($parser->statements[0])) - && ($parser->statements[0] instanceof SqlParser\Statements\SelectStatement) - ) { - - // Finding aliases and removing them, but we keep track of them to be - // able to replace them in select expression too. - $aliases = array(); - foreach ($parser->statements[0]->from as $from) { - if ((!empty($from->table)) && (!empty($from->alias))) { - $aliases[$from->alias] = $from->table; - // We remove the alias of the table because they are going to - // be replaced anyway. - $from->alias = null; - $from->expr = null; // Force rebuild. - } - } - - // Rebuilding the SELECT and FROM clauses. - if (count($parser->statements[0]->from) > 0 - && count($parser->statements[0]->union) === 0 - ) { - $replaces = array( - array( - 'FROM', 'FROM ' . SqlParser\Components\ExpressionArray::build( - $parser->statements[0]->from - ), - ), - ); - } - - // Checking if the WHERE clause has to be replaced. - if ((!empty($where_clause)) && (is_array($where_clause))) { - $replaces[] = array( - 'WHERE', 'WHERE (' . implode(') OR (', $where_clause) . ')' - ); - } - - // Preparing to remove the LIMIT clause. - $replaces[] = array('LIMIT', ''); - - // Replacing the clauses. - $sql_query = SqlParser\Utils\Query::replaceClauses( - $parser->statements[0], - $parser->list, - $replaces - ); - - // Removing the aliases by finding the alias followed by a dot. - $tokens = SqlParser\Lexer::getTokens($sql_query); - foreach ($aliases as $alias => $table) { - $tokens = SqlParser\Utils\Tokens::replaceTokens( - $tokens, - array( - array( - 'value_str' => $alias, - ), - array( - 'type' => SqlParser\Token::TYPE_OPERATOR, - 'value_str' => '.', - ) - ), - array( - new SqlParser\Token($table), - new SqlParser\Token('.',SqlParser\Token::TYPE_OPERATOR) - ) - ); - } - $sql_query = SqlParser\TokensList::build($tokens); - } - - echo PMA\libraries\Util::getMessage(PMA\libraries\Message::success()); -} - -require_once 'libraries/display_export.lib.php'; - -if (! isset($sql_query)) { - $sql_query = ''; -} -if (! isset($num_tables)) { - $num_tables = 0; -} -if (! isset($unlim_num_rows)) { - $unlim_num_rows = 0; -} -if (! isset($multi_values)) { - $multi_values = ''; -} -$response = Response::getInstance(); -$response->addHTML( - PMA_getExportDisplay( - 'table', $db, $table, $sql_query, $num_tables, - $unlim_num_rows, $multi_values - ) -); diff --git a/#pma/tbl_find_replace.php b/#pma/tbl_find_replace.php deleted file mode 100644 index d3ec712b..00000000 --- a/#pma/tbl_find_replace.php +++ /dev/null @@ -1,33 +0,0 @@ -factory('PMA\libraries\controllers\table\TableSearchController'); -$container->alias( - 'TableSearchController', 'PMA\libraries\controllers\table\TableSearchController' -); -$container->set('PMA\libraries\Response', PMA\libraries\Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -$dependency_definitions = array( - 'searchType' => 'replace', - 'url_query' => &$url_query -); - -/** @var PMA\libraries\controllers\table\TableSearchController $controller */ -$controller = $container->get('TableSearchController', $dependency_definitions); -$controller->indexAction(); diff --git a/#pma/tbl_get_field.php b/#pma/tbl_get_field.php deleted file mode 100644 index 95f8b67b..00000000 --- a/#pma/tbl_get_field.php +++ /dev/null @@ -1,57 +0,0 @@ -selectDb($db)) { - PMA\libraries\Util::mysqlDie( - sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($db)), - '', false - ); -} - -/* Check if table exists */ -if (!$GLOBALS['dbi']->getColumns($db, $table)) { - PMA\libraries\Util::mysqlDie(__('Invalid table name')); -} - -/* Grab data */ -$sql = 'SELECT ' . PMA\libraries\Util::backquote($_GET['transform_key']) - . ' FROM ' . PMA\libraries\Util::backquote($table) - . ' WHERE ' . $_GET['where_clause'] . ';'; -$result = $GLOBALS['dbi']->fetchValue($sql); - -/* Check return code */ -if ($result === false) { - PMA\libraries\Util::mysqlDie( - __('MySQL returned an empty result set (i.e. zero rows).'), $sql - ); -} - -/* Avoid corrupting data */ -@ini_set('url_rewriter.tags', ''); - -PMA_downloadHeader( - $table . '-' . $_GET['transform_key'] . '.bin', - PMA_detectMIME($result), - strlen($result) -); -echo $result; diff --git a/#pma/tbl_gis_visualization.php b/#pma/tbl_gis_visualization.php deleted file mode 100644 index 72feb468..00000000 --- a/#pma/tbl_gis_visualization.php +++ /dev/null @@ -1,43 +0,0 @@ -factory( - 'PMA\libraries\controllers\table\TableGisVisualizationController' -); -$container->alias( - 'TableGisVisualizationController', - 'PMA\libraries\controllers\table\TableGisVisualizationController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/* Define dependencies for the concerned controller */ -$dependency_definitions = array( - "sql_query" => &$GLOBALS['sql_query'], - "url_params" => &$GLOBALS['url_params'], - "goto" => Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabDatabase'], 'database' - ), - "back" => 'sql.php', - "visualizationSettings" => array() -); - -/** @var TableGisVisualizationController $controller */ -$controller = $container->get( - 'TableGisVisualizationController', $dependency_definitions -); -$controller->indexAction(); diff --git a/#pma/tbl_import.php b/#pma/tbl_import.php deleted file mode 100644 index 342e212a..00000000 --- a/#pma/tbl_import.php +++ /dev/null @@ -1,38 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('import.js'); - -/** - * Gets tables information and displays top links - */ -require_once 'libraries/tbl_common.inc.php'; -$url_query .= '&goto=tbl_import.php&back=tbl_import.php'; - -require_once 'libraries/tbl_info.inc.php'; - -require 'libraries/display_import.lib.php'; -$response = PMA\libraries\Response::getInstance(); -$response->addHTML( - PMA_getImportDisplay( - 'table', $db, $table, $max_upload_size - ) -); diff --git a/#pma/tbl_indexes.php b/#pma/tbl_indexes.php deleted file mode 100644 index 467e6289..00000000 --- a/#pma/tbl_indexes.php +++ /dev/null @@ -1,51 +0,0 @@ -factory('PMA\libraries\controllers\table\TableIndexesController'); -$container->alias( - 'TableIndexesController', - 'PMA\libraries\controllers\table\TableIndexesController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/* Define dependencies for the concerned controller */ -$db = $container->get('db'); -$table = $container->get('table'); -$dbi = $container->get('dbi'); - -if (!isset($_REQUEST['create_edit_table'])) { - include_once 'libraries/tbl_common.inc.php'; -} -if (isset($_REQUEST['index'])) { - if (is_array($_REQUEST['index'])) { - // coming already from form - $index = new Index($_REQUEST['index']); - } else { - $index = $dbi->getTable($db, $table)->getIndex($_REQUEST['index']); - } -} else { - $index = new Index; -} - -$dependency_definitions = array( - "index" => $index -); - -/** @var TableIndexesController $controller */ -$controller = $container->get('TableIndexesController', $dependency_definitions); -$controller->indexAction(); diff --git a/#pma/tbl_operations.php b/#pma/tbl_operations.php deleted file mode 100644 index 3c3754d7..00000000 --- a/#pma/tbl_operations.php +++ /dev/null @@ -1,450 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('tbl_operations.js'); - -/** - * Runs common work - */ -require 'libraries/tbl_common.inc.php'; -$url_query .= '&goto=tbl_operations.php&back=tbl_operations.php'; -$url_params['goto'] = $url_params['back'] = 'tbl_operations.php'; - -/** - * Gets relation settings - */ -$cfgRelation = PMA_getRelationsParam(); - -/** - * Gets available MySQL charsets and storage engines - */ -require_once 'libraries/mysql_charsets.inc.php'; - -// reselect current db (needed in some cases probably due to -// the calling of relation.lib.php) -$GLOBALS['dbi']->selectDb($GLOBALS['db']); - -/** - * Gets tables information - */ -require 'libraries/tbl_info.inc.php'; - -// set initial value of these variables, based on the current table engine -list($is_myisam_or_aria, $is_innodb, $is_isam, - $is_berkeleydb, $is_aria, $is_pbxt -) = PMA_setGlobalVariablesForEngine($tbl_storage_engine); - -if ($is_aria) { - // the value for transactional can be implicit - // (no create option found, in this case it means 1) - // or explicit (option found with a value of 0 or 1) - // ($create_options['transactional'] may have been set by libraries/tbl_info.inc.php, - // from the $create_options) - $create_options['transactional'] = (isset($create_options['transactional']) && $create_options['transactional'] == '0') - ? '0' - : '1'; - $create_options['page_checksum'] = (isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : ''; -} - -$reread_info = false; -$table_alters = array(); - -/** - * If the table has to be moved to some other database - */ -if (isset($_REQUEST['submit_move']) || isset($_REQUEST['submit_copy'])) { - //$_message = ''; - PMA_moveOrCopyTable($db, $table); - // This was ended in an Ajax call - exit; -} -/** - * If the table has to be maintained - */ -if (isset($_REQUEST['table_maintenance'])) { - include_once 'sql.php'; - unset($result); -} -/** - * Updates table comment, type and options if required - */ -if (isset($_REQUEST['submitoptions'])) { - $_message = ''; - $warning_messages = array(); - - if (isset($_REQUEST['new_name'])) { - // Get original names before rename operation - $oldTable = $pma_table->getName(); - $oldDb = $pma_table->getDbName(); - - if ($pma_table->rename($_REQUEST['new_name'])) { - if (isset($_REQUEST['adjust_privileges']) - && ! empty($_REQUEST['adjust_privileges']) - ) { - PMA_AdjustPrivileges_renameOrMoveTable( - $oldDb, $oldTable, $_REQUEST['db'], $_REQUEST['new_name'] - ); - } - - // Reselect the original DB - $GLOBALS['db'] = $oldDb; - $GLOBALS['dbi']->selectDb($oldDb); - - $_message .= $pma_table->getLastMessage(); - $result = true; - $GLOBALS['table'] = $pma_table->getName(); - $reread_info = true; - $reload = true; - } else { - $_message .= $pma_table->getLastError(); - $result = false; - } - } - - if (! empty($_REQUEST['new_tbl_storage_engine']) - && mb_strtoupper($_REQUEST['new_tbl_storage_engine']) !== $tbl_storage_engine - ) { - $new_tbl_storage_engine = mb_strtoupper($_REQUEST['new_tbl_storage_engine']); - // reset the globals for the new engine - list($is_myisam_or_aria, $is_innodb, $is_isam, - $is_berkeleydb, $is_aria, $is_pbxt - ) = PMA_setGlobalVariablesForEngine($new_tbl_storage_engine); - - if ($is_aria) { - $create_options['transactional'] = (isset($create_options['transactional']) && $create_options['transactional'] == '0') - ? '0' - : '1'; - $create_options['page_checksum'] = (isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : ''; - } - } else { - $new_tbl_storage_engine = ''; - } - - $table_alters = PMA_getTableAltersArray( - $is_myisam_or_aria, $is_isam, $create_options['pack_keys'], - (empty($create_options['checksum']) ? '0' : '1'), - $is_aria, - ((isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : ''), - (empty($create_options['delay_key_write']) ? '0' : '1'), - $is_innodb, $is_pbxt, $create_options['row_format'], - $new_tbl_storage_engine, - ((isset($create_options['transactional']) && $create_options['transactional'] == '0') ? '0' : '1'), - $tbl_collation - ); - - if (count($table_alters) > 0) { - $sql_query = 'ALTER TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']); - $sql_query .= "\r\n" . implode("\r\n", $table_alters); - $sql_query .= ';'; - $result .= $GLOBALS['dbi']->query($sql_query) ? true : false; - $reread_info = true; - unset($table_alters); - $warning_messages = PMA_getWarningMessagesArray(); - } - - if (isset($_REQUEST['tbl_collation']) - && ! empty($_REQUEST['tbl_collation']) - && isset($_REQUEST['change_all_collations']) - && ! empty($_REQUEST['change_all_collations']) - ) { - PMA_changeAllColumnsCollation( - $GLOBALS['db'], $GLOBALS['table'], $_REQUEST['tbl_collation'] - ); - } -} -/** - * Reordering the table has been requested by the user - */ -if (isset($_REQUEST['submitorderby']) && ! empty($_REQUEST['order_field'])) { - list($sql_query, $result) = PMA_getQueryAndResultForReorderingTable(); -} // end if - -/** - * A partition operation has been requested by the user - */ -if (isset($_REQUEST['submit_partition']) - && ! empty($_REQUEST['partition_operation']) -) { - list($sql_query, $result) = PMA_getQueryAndResultForPartition(); -} // end if - -if ($reread_info) { - // to avoid showing the old value (for example the AUTO_INCREMENT) after - // a change, clear the cache - $GLOBALS['dbi']->clearTableCache(); - include 'libraries/tbl_info.inc.php'; -} -unset($reread_info); - -if (isset($result) && empty($message_to_show)) { - if (empty($_message)) { - if (empty($sql_query)) { - $_message = PMA\libraries\Message::success(__('No change')); - } else { - $_message = $result - ? PMA\libraries\Message::success() - : PMA\libraries\Message::error(); - } - - if (isset($GLOBALS['ajax_request']) - && $GLOBALS['ajax_request'] == true - ) { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus($_message->isSuccess()); - $response->addJSON('message', $_message); - if (!empty($sql_query)) { - $response->addJSON( - 'sql_query', PMA\libraries\Util::getMessage(null, $sql_query) - ); - } - exit; - } - } else { - $_message = $result - ? PMA\libraries\Message::success($_message) - : PMA\libraries\Message::error($_message); - } - - if (! empty($warning_messages)) { - $_message = new PMA\libraries\Message; - $_message->addMessages($warning_messages); - $_message->isError(true); - if (isset($GLOBALS['ajax_request']) - && $GLOBALS['ajax_request'] == true - ) { - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus(false); - $response->addJSON('message', $_message); - if (!empty($sql_query)) { - $response->addJSON( - 'sql_query', PMA\libraries\Util::getMessage(null, $sql_query) - ); - } - exit; - } - unset($warning_messages); - } - - if (empty($sql_query)) { - $response->addHTML( - $_message->getDisplay() - ); - } else { - $response->addHTML( - PMA\libraries\Util::getMessage($_message, $sql_query) - ); - } - unset($_message); -} - -$url_params['goto'] - = $url_params['back'] - = 'tbl_operations.php'; - -/** - * Get columns names - */ -$columns = $GLOBALS['dbi']->getColumns($GLOBALS['db'], $GLOBALS['table']); - -/** - * Displays the page - */ -$response->addHTML('
    '); - -/** - * Order the table - */ -$hideOrderTable = false; -// `ALTER TABLE ORDER BY` does not make sense for InnoDB tables that contain -// a user-defined clustered index (PRIMARY KEY or NOT NULL UNIQUE index). -// InnoDB always orders table rows according to such an index if one is present. -if ($tbl_storage_engine == 'INNODB') { - $indexes = PMA\libraries\Index::getFromTable($GLOBALS['table'], $GLOBALS['db']); - foreach ($indexes as $name => $idx) { - if ($name == 'PRIMARY') { - $hideOrderTable = true; - break; - } elseif (! $idx->getNonUnique()) { - $notNull = true; - foreach ($idx->getColumns() as $column) { - if ($column->getNull()) { - $notNull = false; - break; - } - } - if ($notNull) { - $hideOrderTable = true; - break; - } - } - } -} -if (! $hideOrderTable) { - $response->addHTML(PMA_getHtmlForOrderTheTable($columns)); -} - -/** - * Move table - */ -$response->addHTML(PMA_getHtmlForMoveTable()); - -if (mb_strstr($show_comment, '; InnoDB free') === false) { - if (mb_strstr($show_comment, 'InnoDB free') === false) { - // only user entered comment - $comment = $show_comment; - } else { - // here we have just InnoDB generated part - $comment = ''; - } -} else { - // remove InnoDB comment from end, just the minimal part (*? is non greedy) - $comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment); -} - -// PACK_KEYS: MyISAM or ISAM -// DELAY_KEY_WRITE, CHECKSUM, : MyISAM only -// AUTO_INCREMENT: MyISAM and InnoDB since 5.0.3, PBXT - -// Here should be version check for InnoDB, however it is supported -// in >5.0.4, >4.1.12 and >4.0.11, so I decided not to -// check for version - -$response->addHTML( - PMA_getTableOptionDiv( - $comment, $tbl_collation, $tbl_storage_engine, - $is_myisam_or_aria, $is_isam, $create_options['pack_keys'], - $auto_increment, - (empty($create_options['delay_key_write']) ? '0' : '1'), - ((isset($create_options['transactional']) && $create_options['transactional'] == '0') ? '0' : '1'), - ((isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : ''), - $is_innodb, $is_pbxt, $is_aria, (empty($create_options['checksum']) ? '0' : '1') - ) -); - -/** - * Copy table - */ -$response->addHTML(PMA_getHtmlForCopytable()); - -/** - * Table maintenance - */ -$response->addHTML( - PMA_getHtmlForTableMaintenance( - $is_myisam_or_aria, - $is_innodb, - $is_berkeleydb, - $url_params - ) -); - -if (! (isset($db_is_system_schema) && $db_is_system_schema)) { - $truncate_table_url_params = array(); - $drop_table_url_params = array(); - - if (! $tbl_is_view - && ! (isset($db_is_system_schema) && $db_is_system_schema) - ) { - $this_sql_query = 'TRUNCATE TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']); - $truncate_table_url_params = array_merge( - $url_params, - array( - 'sql_query' => $this_sql_query, - 'goto' => 'tbl_structure.php', - 'reload' => '1', - 'message_to_show' => sprintf( - __('Table %s has been emptied.'), - htmlspecialchars($table) - ), - ) - ); - } - if (! (isset($db_is_system_schema) && $db_is_system_schema)) { - $this_sql_query = 'DROP TABLE ' - . PMA\libraries\Util::backquote($GLOBALS['table']); - $drop_table_url_params = array_merge( - $url_params, - array( - 'sql_query' => $this_sql_query, - 'goto' => 'db_operations.php', - 'reload' => '1', - 'purge' => '1', - 'message_to_show' => sprintf( - ($tbl_is_view - ? __('View %s has been dropped.') - : __('Table %s has been dropped.') - ), - htmlspecialchars($table) - ), - // table name is needed to avoid running - // PMA_relationsCleanupDatabase() on the whole db later - 'table' => $GLOBALS['table'], - ) - ); - } - $response->addHTML( - PMA_getHtmlForDeleteDataOrTable( - $truncate_table_url_params, - $drop_table_url_params - ) - ); -} - -if (Partition::havePartitioning()) { - $partition_names = Partition::getPartitionNames($db, $table); - // show the Partition maintenance section only if we detect a partition - if (! is_null($partition_names[0])) { - $response->addHTML( - PMA_getHtmlForPartitionMaintenance($partition_names, $url_params) - ); - } // end if -} // end if -unset($partition_names); - -// Referential integrity check -// The Referential integrity check was intended for the non-InnoDB -// tables for which the relations are defined in pmadb -// so I assume that if the current table is InnoDB, I don't display -// this choice (InnoDB maintains integrity by itself) - -if ($cfgRelation['relwork'] && ! $is_innodb) { - $GLOBALS['dbi']->selectDb($GLOBALS['db']); - $foreign = PMA_getForeigners($GLOBALS['db'], $GLOBALS['table'], '', 'internal'); - - if (! empty($foreign)) { - $response->addHTML( - PMA_getHtmlForReferentialIntegrityCheck($foreign, $url_params) - ); - } // end if ($foreign) - -} // end if (!empty($cfg['Server']['relation'])) - -$response->addHTML('
    '); diff --git a/#pma/tbl_recent_favorite.php b/#pma/tbl_recent_favorite.php deleted file mode 100644 index ba292a4a..00000000 --- a/#pma/tbl_recent_favorite.php +++ /dev/null @@ -1,19 +0,0 @@ -removeIfInvalid($_REQUEST['db'], $_REQUEST['table']); - -RecentFavoriteTable::getInstance('favorite') - ->removeIfInvalid($_REQUEST['db'], $_REQUEST['table']); - -require 'sql.php'; diff --git a/#pma/tbl_relation.php b/#pma/tbl_relation.php deleted file mode 100644 index f2f1a3bd..00000000 --- a/#pma/tbl_relation.php +++ /dev/null @@ -1,78 +0,0 @@ -factory('PMA\libraries\controllers\table\TableRelationController'); -$container->alias( - 'TableRelationController', - 'PMA\libraries\controllers\table\TableRelationController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/* Define dependencies for the concerned controller */ -$db = $container->get('db'); -$table = $container->get('table'); -$dbi = $container->get('dbi'); -$options_array = array( - 'CASCADE' => 'CASCADE', - 'SET_NULL' => 'SET NULL', - 'NO_ACTION' => 'NO ACTION', - 'RESTRICT' => 'RESTRICT', -); -$cfgRelation = PMA_getRelationsParam(); -$tbl_storage_engine = mb_strtoupper( - $dbi->getTable($db, $table)->getStatusInfo('Engine') -); -$upd_query = new Table($table, $db, $dbi); - -$dependency_definitions = array( - "options_array" => $options_array, - "cfgRelation" => $cfgRelation, - "tbl_storage_engine" => $tbl_storage_engine, - "upd_query" => $upd_query -); -if ($cfgRelation['relwork']) { - $dependency_definitions['existrel'] = PMA_getForeigners( - $db, $table, '', 'internal' - ); -} -if (Util::isForeignKeySupported($tbl_storage_engine)) { - $dependency_definitions['existrel_foreign'] = PMA_getForeigners( - $db, $table, '', 'foreign' - ); -} -if ($cfgRelation['displaywork']) { - $dependency_definitions['disp'] = PMA_getDisplayField($db, $table); -} else { - $dependency_definitions['disp'] = 'asas'; -} - -/** @var TableRelationController $controller */ -$controller = $container->get('TableRelationController', $dependency_definitions); -$controller->indexAction(); diff --git a/#pma/tbl_replace.php b/#pma/tbl_replace.php deleted file mode 100644 index 668d2c3b..00000000 --- a/#pma/tbl_replace.php +++ /dev/null @@ -1,474 +0,0 @@ -selectDb($GLOBALS['db']); - -/** - * Initializes some variables - */ -$goto_include = false; - -$response = PMA\libraries\Response::getInstance(); -$header = $response->getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('makegrid.js'); -// Needed for generation of Inline Edit anchors -$scripts->addFile('sql.js'); -$scripts->addFile('indexes.js'); -$scripts->addFile('gis_data_editor.js'); - -// check whether insert row mode, if so include tbl_change.php -PMA_isInsertRow(); - -$after_insert_actions = array('new_insert', 'same_insert', 'edit_next'); -if (isset($_REQUEST['after_insert']) - && in_array($_REQUEST['after_insert'], $after_insert_actions) -) { - $url_params['after_insert'] = $_REQUEST['after_insert']; - if (isset($_REQUEST['where_clause'])) { - foreach ($_REQUEST['where_clause'] as $one_where_clause) { - if ($_REQUEST['after_insert'] == 'same_insert') { - $url_params['where_clause'][] = $one_where_clause; - } elseif ($_REQUEST['after_insert'] == 'edit_next') { - PMA_setSessionForEditNext($one_where_clause); - } - } - } -} -//get $goto_include for different cases -$goto_include = PMA_getGotoInclude($goto_include); - -// Defines the url to return in case of failure of the query -$err_url = PMA_getErrorUrl($url_params); - -/** - * Prepares the update/insert of a row - */ -list($loop_array, $using_key, $is_insert, $is_insertignore) - = PMA_getParamsForUpdateOrInsert(); - -$query = array(); -$value_sets = array(); -$func_no_param = array( - 'CONNECTION_ID', - 'CURRENT_USER', - 'CURDATE', - 'CURTIME', - 'CURRENT_DATE', - 'CURRENT_TIME', - 'DATABASE', - 'LAST_INSERT_ID', - 'NOW', - 'PI', - 'RAND', - 'SYSDATE', - 'UNIX_TIMESTAMP', - 'USER', - 'UTC_DATE', - 'UTC_TIME', - 'UTC_TIMESTAMP', - 'UUID', - 'UUID_SHORT', - 'VERSION', -); -$func_optional_param = array( - 'RAND', - 'UNIX_TIMESTAMP', -); - -$gis_from_text_functions = array( - 'GeomFromText', - 'GeomCollFromText', - 'LineFromText', - 'MLineFromText', - 'PointFromText', - 'MPointFromText', - 'PolyFromText', - 'MPolyFromText', -); - -$gis_from_wkb_functions = array( - 'GeomFromWKB', - 'GeomCollFromWKB', - 'LineFromWKB', - 'MLineFromWKB', - 'PointFromWKB', - 'MPointFromWKB', - 'PolyFromWKB', - 'MPolyFromWKB', -); - -//if some posted fields need to be transformed. -$mime_map = PMA_getMIME($GLOBALS['db'], $GLOBALS['table']); -if ($mime_map === false) { - $mime_map = array(); -} - -$query_fields = array(); -$insert_errors = array(); -$row_skipped = false; -$unsaved_values = array(); -foreach ($loop_array as $rownumber => $where_clause) { - // skip fields to be ignored - if (! $using_key && isset($_REQUEST['insert_ignore_' . $where_clause])) { - continue; - } - - // Defines the SET part of the sql query - $query_values = array(); - - // Map multi-edit keys to single-level arrays, dependent on how we got the fields - $multi_edit_columns - = isset($_REQUEST['fields']['multi_edit'][$rownumber]) - ? $_REQUEST['fields']['multi_edit'][$rownumber] - : array(); - $multi_edit_columns_name - = isset($_REQUEST['fields_name']['multi_edit'][$rownumber]) - ? $_REQUEST['fields_name']['multi_edit'][$rownumber] - : array(); - $multi_edit_columns_prev - = isset($_REQUEST['fields_prev']['multi_edit'][$rownumber]) - ? $_REQUEST['fields_prev']['multi_edit'][$rownumber] - : null; - $multi_edit_funcs - = isset($_REQUEST['funcs']['multi_edit'][$rownumber]) - ? $_REQUEST['funcs']['multi_edit'][$rownumber] - : null; - $multi_edit_salt - = isset($_REQUEST['salt']['multi_edit'][$rownumber]) - ? $_REQUEST['salt']['multi_edit'][$rownumber] - :null; - $multi_edit_columns_type - = isset($_REQUEST['fields_type']['multi_edit'][$rownumber]) - ? $_REQUEST['fields_type']['multi_edit'][$rownumber] - : null; - $multi_edit_columns_null - = isset($_REQUEST['fields_null']['multi_edit'][$rownumber]) - ? $_REQUEST['fields_null']['multi_edit'][$rownumber] - : null; - $multi_edit_columns_null_prev - = isset($_REQUEST['fields_null_prev']['multi_edit'][$rownumber]) - ? $_REQUEST['fields_null_prev']['multi_edit'][$rownumber] - : null; - $multi_edit_auto_increment - = isset($_REQUEST['auto_increment']['multi_edit'][$rownumber]) - ? $_REQUEST['auto_increment']['multi_edit'][$rownumber] - : null; - $multi_edit_virtual - = isset($_REQUEST['virtual']['multi_edit'][$rownumber]) - ? $_REQUEST['virtual']['multi_edit'][$rownumber] - : null; - - // When a select field is nullified, it's not present in $_REQUEST - // so initialize it; this way, the foreach($multi_edit_columns) will process it - foreach ($multi_edit_columns_name as $key => $val) { - if (! isset($multi_edit_columns[$key])) { - $multi_edit_columns[$key] = ''; - } - } - - // Iterate in the order of $multi_edit_columns_name, - // not $multi_edit_columns, to avoid problems - // when inserting multiple entries - $insert_fail = false; - foreach ($multi_edit_columns_name as $key => $column_name) { - $current_value = $multi_edit_columns[$key]; - // Note: $key is an md5 of the fieldname. The actual fieldname is - // available in $multi_edit_columns_name[$key] - - $file_to_insert = new PMA\libraries\File(); - $file_to_insert->checkTblChangeForm($key, $rownumber); - - $possibly_uploaded_val = $file_to_insert->getContent(); - if ($possibly_uploaded_val !== false) { - $current_value = $possibly_uploaded_val; - } - // Apply Input Transformation if defined - if (!empty($mime_map[$column_name]) - && !empty($mime_map[$column_name]['input_transformation']) - ) { - $filename = 'libraries/plugins/transformations/' - . $mime_map[$column_name]['input_transformation']; - if (is_file($filename)) { - include_once $filename; - $classname = PMA_getTransformationClassName($filename); - /** @var IOTransformationsPlugin $transformation_plugin */ - $transformation_plugin = new $classname(); - $transformation_options = PMA_Transformation_getOptions( - $mime_map[$column_name]['input_transformation_options'] - ); - $current_value = $transformation_plugin->applyTransformation( - $current_value, $transformation_options - ); - // check if transformation was successful or not - // and accordingly set error messages & insert_fail - if (method_exists($transformation_plugin, 'isSuccess') - && !$transformation_plugin->isSuccess() - ) { - $insert_fail = true; - $row_skipped = true; - $insert_errors[] = sprintf( - __('Row: %1$s, Column: %2$s, Error: %3$s'), - $rownumber, $column_name, - $transformation_plugin->getError() - ); - } - } - } - - if ($file_to_insert->isError()) { - $insert_errors[] = $file_to_insert->getError(); - } - // delete $file_to_insert temporary variable - $file_to_insert->cleanUp(); - - $current_value = PMA_getCurrentValueForDifferentTypes( - $possibly_uploaded_val, $key, $multi_edit_columns_type, - $current_value, $multi_edit_auto_increment, - $rownumber, $multi_edit_columns_name, $multi_edit_columns_null, - $multi_edit_columns_null_prev, $is_insert, - $using_key, $where_clause, $table, $multi_edit_funcs - ); - - $current_value_as_an_array = PMA_getCurrentValueAsAnArrayForMultipleEdit( - $multi_edit_funcs, - $multi_edit_salt, $gis_from_text_functions, $current_value, - $gis_from_wkb_functions, $func_optional_param, $func_no_param, $key - ); - - if (! isset($multi_edit_virtual) || ! isset($multi_edit_virtual[$key])) { - list($query_values, $query_fields) - = PMA_getQueryValuesForInsertAndUpdateInMultipleEdit( - $multi_edit_columns_name, $multi_edit_columns_null, $current_value, - $multi_edit_columns_prev, $multi_edit_funcs, $is_insert, - $query_values, $query_fields, $current_value_as_an_array, - $value_sets, $key, $multi_edit_columns_null_prev - ); - } - if (isset($multi_edit_columns_null[$key])) { - $multi_edit_columns[$key] = null; - } - } //end of foreach - - // temporarily store rows not inserted - // so that they can be populated again. - if ($insert_fail) { - $unsaved_values[$rownumber] = $multi_edit_columns; - } - if (!$insert_fail && count($query_values) > 0) { - if ($is_insert) { - $value_sets[] = implode(', ', $query_values); - } else { - // build update query - $query[] = 'UPDATE ' . PMA\libraries\Util::backquote($GLOBALS['table']) - . ' SET ' . implode(', ', $query_values) - . ' WHERE ' . $where_clause - . ($_REQUEST['clause_is_unique'] ? '' : ' LIMIT 1'); - } - } -} // end foreach ($loop_array as $where_clause) -unset( - $multi_edit_columns_name, $multi_edit_columns_prev, $multi_edit_funcs, - $multi_edit_columns_type, $multi_edit_columns_null, $func_no_param, - $multi_edit_auto_increment, $current_value_as_an_array, $key, $current_value, - $loop_array, $where_clause, $using_key, $multi_edit_columns_null_prev, - $insert_fail -); - -// Builds the sql query -if ($is_insert && count($value_sets) > 0) { - $query = PMA_buildSqlQuery($is_insertignore, $query_fields, $value_sets); -} elseif (empty($query) && ! isset($_REQUEST['preview_sql']) && !$row_skipped) { - // No change -> move back to the calling script - // - // Note: logic passes here for inline edit - $message = PMA\libraries\Message::success(__('No change')); - $active_page = $goto_include; - include '' . PMA_securePath($goto_include); - exit; -} -unset($multi_edit_columns, $is_insertignore); - -// If there is a request for SQL previewing. -if (isset($_REQUEST['preview_sql'])) { - PMA_previewSQL($query); -} - -/** - * Executes the sql query and get the result, then move back to the calling - * page - */ -list ($url_params, $total_affected_rows, $last_messages, $warning_messages, - $error_messages, $return_to_sql_query) - = PMA_executeSqlQuery($url_params, $query); - -if ($is_insert && (count($value_sets) > 0 || $row_skipped)) { - $message = PMA\libraries\Message::getMessageForInsertedRows( - $total_affected_rows - ); - $unsaved_values = array_values($unsaved_values); -} else { - $message = PMA\libraries\Message::getMessageForAffectedRows( - $total_affected_rows - ); -} -if ($row_skipped) { - $goto_include = 'tbl_change.php'; - $message->addMessages($insert_errors, '
    '); - $message->isError(true); -} - -$message->addMessages($last_messages, '
    '); - -if (! empty($warning_messages)) { - $message->addMessages($warning_messages, '
    '); - $message->isError(true); -} -if (! empty($error_messages)) { - $message->addMessages($error_messages); - $message->isError(true); -} -unset( - $error_messages, $warning_messages, $total_affected_rows, - $last_messages, $last_message, $row_skipped, $insert_errors -); - -/** - * The following section only applies to grid editing. - * However, verifying isAjax() is not enough to ensure we are coming from - * grid editing. If we are coming from the Edit or Copy link in Browse mode, - * ajax_page_request is present in the POST parameters. - */ -if ($response->isAjax() && ! isset($_POST['ajax_page_request'])) { - /** - * If we are in grid editing, we need to process the relational and - * transformed fields, if they were edited. After that, output the correct - * link/transformed value and exit - * - * Logic taken from libraries/DisplayResults.php - */ - - if (isset($_REQUEST['rel_fields_list']) && $_REQUEST['rel_fields_list'] != '') { - - $map = PMA_getForeigners($db, $table, '', 'both'); - - $relation_fields = array(); - parse_str($_REQUEST['rel_fields_list'], $relation_fields); - - // loop for each relation cell - /** @var array $relation_fields */ - foreach ($relation_fields as $cell_index => $curr_rel_field) { - foreach ($curr_rel_field as $relation_field => $relation_field_value) { - $where_comparison = "='" . $relation_field_value . "'"; - $dispval = PMA_getDisplayValueForForeignTableColumn( - $where_comparison, $map, $relation_field - ); - - $extra_data['relations'][$cell_index] - = PMA_getLinkForRelationalDisplayField( - $map, $relation_field, $where_comparison, - $dispval, $relation_field_value - ); - } - } // end of loop for each relation cell - } - if (isset($_REQUEST['do_transformations']) - && $_REQUEST['do_transformations'] == true - ) { - $edited_values = array(); - parse_str($_REQUEST['transform_fields_list'], $edited_values); - - if (! isset($extra_data)) { - $extra_data = array(); - } - $transformation_types = array( - "input_transformation", - "transformation" - ); - foreach ($mime_map as $transformation) { - $column_name = $transformation['column_name']; - foreach ($transformation_types as $type) { - $file = PMA_securePath($transformation[$type]); - $extra_data = PMA_transformEditedValues( - $db, $table, $transformation, $edited_values, $file, - $column_name, $extra_data, $type - ); - } - } // end of loop for each $mime_map - } - - // Need to check the inline edited value can be truncated by MySQL - // without informing while saving - $column_name = $_REQUEST['fields_name']['multi_edit'][0][0]; - - PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData( - $db, $table, $column_name, $extra_data - ); - - /**Get the total row count of the table*/ - $_table = new Table($_REQUEST['table'], $_REQUEST['db']); - $extra_data['row_count'] = $_table->countRecords(); - - $extra_data['sql_query'] - = PMA\libraries\Util::getMessage($message, $GLOBALS['display_query']); - - $response = PMA\libraries\Response::getInstance(); - $response->setRequestStatus($message->isSuccess()); - $response->addJSON('message', $message); - $response->addJSON($extra_data); - exit; -} - -if (! empty($return_to_sql_query)) { - $disp_query = $GLOBALS['sql_query']; - $disp_message = $message; - unset($message); - $GLOBALS['sql_query'] = $return_to_sql_query; -} - -$scripts->addFile('tbl_change.js'); -$scripts->addFile('big_ints.js'); - -$active_page = $goto_include; - -/** - * If user asked for "and then Insert another new row" we have to remove - * WHERE clause information so that tbl_change.php does not go back - * to the current record - */ -if (isset($_REQUEST['after_insert']) && 'new_insert' == $_REQUEST['after_insert']) { - unset($_REQUEST['where_clause']); -} - -/** - * Load target page. - */ -require '' . PMA_securePath($goto_include); -exit; diff --git a/#pma/tbl_row_action.php b/#pma/tbl_row_action.php deleted file mode 100644 index 6deca0ef..00000000 --- a/#pma/tbl_row_action.php +++ /dev/null @@ -1,174 +0,0 @@ -setRequestStatus(false); - $response->addJSON('message', __('No row selected.')); - } - - switch($submit_mult) { - /** @noinspection PhpMissingBreakStatementInspection */ - case 'row_copy': - $_REQUEST['default_action'] = 'insert'; - // no break to allow for fallthough - case 'row_edit': - // As we got the rows to be edited from the - // 'rows_to_delete' checkbox, we use the index of it as the - // indicating WHERE clause. Then we build the array which is used - // for the tbl_change.php script. - $where_clause = array(); - if (isset($_REQUEST['rows_to_delete']) - && is_array($_REQUEST['rows_to_delete']) - ) { - foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) { - $where_clause[] = $i_where_clause; - } - } - $active_page = 'tbl_change.php'; - include 'tbl_change.php'; - break; - - case 'row_export': - // Needed to allow SQL export - $single_table = true; - - // As we got the rows to be exported from the - // 'rows_to_delete' checkbox, we use the index of it as the - // indicating WHERE clause. Then we build the array which is used - // for the tbl_change.php script. - $where_clause = array(); - if (isset($_REQUEST['rows_to_delete']) - && is_array($_REQUEST['rows_to_delete']) - ) { - foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) { - $where_clause[] = $i_where_clause; - } - } - $active_page = 'tbl_export.php'; - include 'tbl_export.php'; - break; - - case 'row_delete': - default: - $action = 'tbl_row_action.php'; - $err_url = 'tbl_row_action.php' - . PMA_URL_getCommon($GLOBALS['url_params']); - if (! isset($_REQUEST['mult_btn'])) { - $original_sql_query = $sql_query; - if (! empty($url_query)) { - $original_url_query = $url_query; - } - } - include 'libraries/mult_submits.inc.php'; - $_url_params = $GLOBALS['url_params']; - $_url_params['goto'] = 'tbl_sql.php'; - $url_query = PMA_URL_getCommon($_url_params); - - - /** - * Show result of multi submit operation - */ - // sql_query is not set when user does not confirm multi-delete - if ((! empty($submit_mult) || isset($_REQUEST['mult_btn'])) - && ! empty($sql_query) - ) { - $disp_message = __('Your SQL query has been executed successfully.'); - $disp_query = $sql_query; - } - - if (isset($original_sql_query)) { - $sql_query = $original_sql_query; - } - - if (isset($original_url_query)) { - $url_query = $original_url_query; - } - - $active_page = 'sql.php'; - PMA_executeQueryAndSendQueryResponse( - null, // analyzed_sql_results - false, // is_gotofile - $db, // db - $table, // table - null, // find_real_end - null, // sql_query_for_bookmark - null, // extra_data - null, // message_to_show - null, // message - null, // sql_data - $goto, // goto - $pmaThemeImage, // pmaThemeImage - null, // disp_query - null, // disp_message - null, // query_type - $sql_query, // sql_query - null, // selectedTables - null // complete_query - ); - } -} diff --git a/#pma/tbl_select.php b/#pma/tbl_select.php deleted file mode 100644 index 0c55d77a..00000000 --- a/#pma/tbl_select.php +++ /dev/null @@ -1,37 +0,0 @@ -factory('PMA\libraries\controllers\table\TableSearchController'); -$container->alias( - 'TableSearchController', 'PMA\libraries\controllers\table\TableSearchController' -); -$container->set('PMA\libraries\Response', PMA\libraries\Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/* Define dependencies for the concerned controller */ -$dependency_definitions = array( - 'searchType' => 'normal', - 'url_query' => &$url_query -); - -/** @var TableSearchController $controller */ -$controller = $container->get('TableSearchController', $dependency_definitions); -$controller->indexAction(); diff --git a/#pma/tbl_sql.php b/#pma/tbl_sql.php deleted file mode 100644 index 764cf72d..00000000 --- a/#pma/tbl_sql.php +++ /dev/null @@ -1,55 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('makegrid.js'); -$scripts->addFile('jquery/jquery.uitablefilter.js'); -$scripts->addFile('sql.js'); - -require 'libraries/tbl_common.inc.php'; -$url_query .= '&goto=tbl_sql.php&back=tbl_sql.php'; - -require_once 'libraries/sql_query_form.lib.php'; - -$err_url = 'tbl_sql.php' . $err_url; -// After a syntax error, we return to this script -// with the typed query in the textarea. -$goto = 'tbl_sql.php'; -$back = 'tbl_sql.php'; - -/** - * Get table information - */ -require_once 'libraries/tbl_info.inc.php'; - -/** - * Query box, bookmark, insert data from textfile - */ -$response->addHTML( - PMA_getHtmlForSqlQueryForm( - true, false, - isset($_REQUEST['delimiter']) - ? htmlspecialchars($_REQUEST['delimiter']) - : ';' - ) -); diff --git a/#pma/tbl_structure.php b/#pma/tbl_structure.php deleted file mode 100644 index 7932cc09..00000000 --- a/#pma/tbl_structure.php +++ /dev/null @@ -1,49 +0,0 @@ -factory('PMA\libraries\controllers\table\TableStructureController'); -$container->alias( - 'TableStructureController', - 'PMA\libraries\controllers\table\TableStructureController' -); -$container->set('PMA\libraries\Response', Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -global $db, $table, $db_is_system_schema, $tbl_is_view, $tbl_storage_engine, - $table_info_num_rows, $tbl_collation, $showtable; -/* Define dependencies for the concerned controller */ -$dependency_definitions = array( - 'db' => $db, - 'table' => $table, - 'url_query' => &$GLOBALS['url_query'], - 'db_is_system_schema' => $db_is_system_schema, - 'tbl_is_view' => $tbl_is_view, - 'tbl_storage_engine' => $tbl_storage_engine, - 'table_info_num_rows' => $table_info_num_rows, - 'tbl_collation' => $tbl_collation, - 'showtable' => $showtable -); - -/** @var TableStructureController $controller */ -$controller = $container->get('TableStructureController', $dependency_definitions); -$controller->indexAction(); diff --git a/#pma/tbl_tracking.php b/#pma/tbl_tracking.php deleted file mode 100644 index f4e23c42..00000000 --- a/#pma/tbl_tracking.php +++ /dev/null @@ -1,210 +0,0 @@ -getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('jquery/jquery.tablesorter.js'); -$scripts->addFile('tbl_tracking.js'); - -define('TABLE_MAY_BE_ABSENT', true); -require './libraries/tbl_common.inc.php'; - -if (Tracker::isActive() - && Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"]) - && ! (isset($_REQUEST['toggle_activation']) - && $_REQUEST['toggle_activation'] == 'deactivate_now') - && ! (isset($_REQUEST['report_export']) - && $_REQUEST['export_type'] == 'sqldumpfile') -) { - $msg = PMA\libraries\Message::notice( - sprintf( - __('Tracking of %s is activated.'), - htmlspecialchars($GLOBALS["db"] . '.' . $GLOBALS["table"]) - ) - ); - PMA\libraries\Response::getInstance()->addHTML($msg->getDisplay()); -} - -$url_query .= '&goto=tbl_tracking.php&back=tbl_tracking.php'; -$url_params['goto'] = 'tbl_tracking.php'; -$url_params['back'] = 'tbl_tracking.php'; - -// Init vars for tracking report -if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) { - $data = Tracker::getTrackedData( - $_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version'] - ); - - $selection_schema = false; - $selection_data = false; - $selection_both = false; - - if (! isset($_REQUEST['logtype'])) { - $_REQUEST['logtype'] = 'schema_and_data'; - } - if ($_REQUEST['logtype'] == 'schema') { - $selection_schema = true; - } elseif ($_REQUEST['logtype'] == 'data') { - $selection_data = true; - } else { - $selection_both = true; - } - if (! isset($_REQUEST['date_from'])) { - $_REQUEST['date_from'] = $data['date_from']; - } - if (! isset($_REQUEST['date_to'])) { - $_REQUEST['date_to'] = $data['date_to']; - } - if (! isset($_REQUEST['users'])) { - $_REQUEST['users'] = '*'; - } - $filter_ts_from = strtotime($_REQUEST['date_from']); - $filter_ts_to = strtotime($_REQUEST['date_to']); - $filter_users = array_map('trim', explode(',', $_REQUEST['users'])); -} - -// Prepare export -if (isset($_REQUEST['report_export'])) { - $entries = PMA_getEntries($data, $filter_ts_from, $filter_ts_to, $filter_users); -} - -// Export as file download -if (isset($_REQUEST['report_export']) - && $_REQUEST['export_type'] == 'sqldumpfile' -) { - PMA_exportAsFileDownload($entries); -} - -$html = '
    '; - -/** - * Actions - */ -if (isset($_REQUEST['submit_mult'])) { - if (! empty($_REQUEST['selected_versions'])) { - if ($_REQUEST['submit_mult'] == 'delete_version') { - foreach ($_REQUEST['selected_versions'] as $version) { - PMA_deleteTrackingVersion($version); - } - $html .= PMA\libraries\Message::success( - __('Tracking versions deleted successfully.') - )->getDisplay(); - } - } else { - $html .= PMA\libraries\Message::notice( - __('No versions selected.') - )->getDisplay(); - } -} - -if (isset($_REQUEST['submit_delete_version'])) { - $html .= PMA_deleteTrackingVersion($_REQUEST['version']); -} - -// Create tracking version -if (isset($_REQUEST['submit_create_version'])) { - $html .= PMA_createTrackingVersion(); -} - -// Deactivate tracking -if (isset($_REQUEST['toggle_activation']) - && $_REQUEST['toggle_activation'] == 'deactivate_now' -) { - $html .= PMA_changeTracking('deactivate'); -} - -// Activate tracking -if (isset($_REQUEST['toggle_activation']) - && $_REQUEST['toggle_activation'] == 'activate_now' -) { - $html .= PMA_changeTracking('activate'); -} - -// Export as SQL execution -if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'execution') { - $sql_result = PMA_exportAsSQLExecution($entries); - $msg = PMA\libraries\Message::success(__('SQL statements executed.')); - $html .= $msg->getDisplay(); -} - -// Export as SQL dump -if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'sqldump') { - $html .= PMA_exportAsSQLDump($entries); -} - -/* - * Schema snapshot - */ -if (isset($_REQUEST['snapshot'])) { - $html .= PMA_getHtmlForSchemaSnapshot($url_query); -} -// end of snapshot report - -/* - * Tracking report - */ -if (isset($_REQUEST['report']) - && (isset($_REQUEST['delete_ddlog']) || isset($_REQUEST['delete_dmlog'])) -) { - $html .= PMA_deleteTrackingReportRows($data); -} - -if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) { - $html .= PMA_getHtmlForTrackingReport( - $url_query, $data, $url_params, $selection_schema, $selection_data, - $selection_both, $filter_ts_to, $filter_ts_from, $filter_users - ); -} // end of report - - -/* - * List selectable tables - */ -$selectable_tables_sql_result = PMA_getSQLResultForSelectableTables(); -if ($GLOBALS['dbi']->numRows($selectable_tables_sql_result) > 0) { - $html .= PMA_getHtmlForSelectableTables( - $selectable_tables_sql_result, $url_query - ); -} -$html .= '
    '; - -/* - * List versions of current table - */ -$sql_result = PMA_getListOfVersionsOfTable(); -$last_version = PMA_getTableLastVersionNumber($sql_result); -if ($last_version > 0) { - $html .= PMA_getHtmlForTableVersionDetails( - $sql_result, $last_version, $url_params, - $url_query, $pmaThemeImage, $text_dir - ); -} - -$type = $GLOBALS['dbi']->getTable($GLOBALS['db'], $GLOBALS['table']) - ->isView() ? 'view' : 'table'; -$html .= PMA_getHtmlForDataDefinitionAndManipulationStatements( - 'tbl_tracking.php' . $url_query, - $last_version, - $GLOBALS['db'], - array($GLOBALS['table']), - $type -); - -$html .= '
    '; - -$response = PMA\libraries\Response::getInstance(); -$response->addHTML($html); diff --git a/#pma/tbl_triggers.php b/#pma/tbl_triggers.php deleted file mode 100644 index d96c922b..00000000 --- a/#pma/tbl_triggers.php +++ /dev/null @@ -1,9 +0,0 @@ -factory('PMA\libraries\controllers\table\TableSearchController'); -$container->alias( - 'TableSearchController', 'PMA\libraries\controllers\table\TableSearchController' -); -$container->set('PMA\libraries\Response', PMA\libraries\Response::getInstance()); -$container->alias('response', 'PMA\libraries\Response'); - -/* Define dependencies for the concerned controller */ -$dependency_definitions = array( - 'searchType' => 'zoom', - 'url_query' => &$url_query -); - -/** @var PMA\libraries\controllers\table\TableSearchController $controller */ -$controller = $container->get('TableSearchController', $dependency_definitions); -$controller->indexAction(); diff --git a/#pma/templates/columns_definitions/column_adjust_privileges.phtml b/#pma/templates/columns_definitions/column_adjust_privileges.phtml deleted file mode 100644 index 265fe9e2..00000000 --- a/#pma/templates/columns_definitions/column_adjust_privileges.phtml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_attribute.phtml b/#pma/templates/columns_definitions/column_attribute.phtml deleted file mode 100644 index 9bad584b..00000000 --- a/#pma/templates/columns_definitions/column_attribute.phtml +++ /dev/null @@ -1,28 +0,0 @@ -getAttributes(); -$cnt_attribute_types = count($attribute_types); - -$attribute = ''; -if (isset($submit_attribute) && $submit_attribute != false) { - $attribute = $submit_attribute; -} elseif (isset($columnMeta['Extra']) - && $columnMeta['Extra'] == 'on update CURRENT_TIMESTAMP') { - $attribute = 'on update CURRENT_TIMESTAMP'; -} elseif (isset($extracted_columnspec['attribute'])) { - $attribute = $extracted_columnspec['attribute']; -} - -$attribute = mb_strtoupper($attribute); -?> - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_attributes.phtml b/#pma/templates/columns_definitions/column_attributes.phtml deleted file mode 100644 index 7fc1f14c..00000000 --- a/#pma/templates/columns_definitions/column_attributes.phtml +++ /dev/null @@ -1,231 +0,0 @@ - - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'columnMeta' => isset($columnMeta) ? $columnMeta : null, - 'cfgRelation' => $cfgRelation - )); ?> - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'type_upper' => $type_upper, - 'columnMeta' => isset($columnMeta) ? $columnMeta : null - )); ?> - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'length_values_input_size' => $length_values_input_size, - 'length_to_display' => $length - )); ?> - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'type_upper' => isset($type_upper) ? $type_upper : null, - 'columnMeta' => isset($columnMeta) ? $columnMeta : null - )); ?> - - - - - - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'extracted_columnspec' => isset($extracted_columnspec) ? $extracted_columnspec : null, - 'columnMeta' => isset($columnMeta) ? $columnMeta : null, - 'submit_attribute' => isset($submit_attribute) ? $submit_attribute : null, - )); ?> - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'columnMeta' => isset($columnMeta) ? $columnMeta : null - )); ?> - - - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'privs_available' => $privs_available - )); ?> - - - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'columnMeta' => $columnMeta - )); ?> - - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'columnMeta' => $columnMeta - )); ?> - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'columnMeta' => isset($columnMeta) ? $columnMeta : null, - 'comments_map' => $comments_map - )); ?> - - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'columnMeta' => isset($columnMeta) ? $columnMeta : null - )); ?> - - - - - name == $columnMeta['Field']) { - $current_index = $mi; - break; - } - } ?> - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'columnMeta' => $columnMeta, - 'move_columns' => $move_columns, - 'current_index' => $current_index - )); ?> - - - - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'available_mime' => $available_mime, - 'columnMeta' => $columnMeta, - 'mime_map' => $mime_map - )); ?> - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'available_mime' => $available_mime, - 'columnMeta' => $columnMeta, - 'mime_map' => $mime_map, - 'type' => 'transformation' - )); ?> - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'columnMeta' => $columnMeta, - 'mime_map' => $mime_map, - 'type_prefix' => '', - )); ?> - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'available_mime' => $available_mime, - 'columnMeta' => $columnMeta, - 'mime_map' => $mime_map, - 'type' => 'input_transformation' - )); ?> - - - - render(array( - 'columnNumber' => $columnNumber, - 'ci' => $ci++, - 'ci_offset' => $ci_offset, - 'columnMeta' => $columnMeta, - 'mime_map' => $mime_map, - 'type_prefix' => 'input_', - )); ?> - - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_auto_increment.phtml b/#pma/templates/columns_definitions/column_auto_increment.phtml deleted file mode 100644 index e688ff6e..00000000 --- a/#pma/templates/columns_definitions/column_auto_increment.phtml +++ /dev/null @@ -1,8 +0,0 @@ - - checked="checked" - - type="checkbox" - value="AUTO_INCREMENT" /> \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_comment.phtml b/#pma/templates/columns_definitions/column_comment.phtml deleted file mode 100644 index 3233c4e0..00000000 --- a/#pma/templates/columns_definitions/column_comment.phtml +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_default.phtml b/#pma/templates/columns_definitions/column_default.phtml deleted file mode 100644 index 2ef2fd9a..00000000 --- a/#pma/templates/columns_definitions/column_default.phtml +++ /dev/null @@ -1,51 +0,0 @@ - _pgettext('for default', 'None'), - 'USER_DEFINED' => __('As defined:'), - 'NULL' => 'NULL', - 'CURRENT_TIMESTAMP' => 'CURRENT_TIMESTAMP', -); - -// for a TIMESTAMP, do not show the string "CURRENT_TIMESTAMP" as a default -// value -$defaultValue = ''; -if (isset($columnMeta['DefaultValue'])) { - $defaultValue = $columnMeta['DefaultValue']; -} -if ($type_upper == 'BIT') { - $defaultValue = PMA\libraries\Util::convertBitDefaultValue($columnMeta['DefaultValue']); -} elseif ($type_upper == 'BINARY' || $type_upper == 'VARBINARY') { - $defaultValue = bin2hex($columnMeta['DefaultValue']); -} -?> - - -
    - - - - - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_definitions_form.phtml b/#pma/templates/columns_definitions/column_definitions_form.phtml deleted file mode 100644 index f9e86f3a..00000000 --- a/#pma/templates/columns_definitions/column_definitions_form.phtml +++ /dev/null @@ -1,170 +0,0 @@ - -
    - - - - - - - - - - - -
    - - - - - -
    :  - - - - - - -
    -
    - - - render(array( - 'is_backup' => $is_backup, - 'fields_meta' => $fields_meta, - 'mimework' => $mimework, - 'content_cells' => $content_cells - )); ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -   - -   - - -   - - -
    - -   - -   - -   - -
    - -   - -
    - -
    -
    - -
    - - -
    -
    -
    -
    \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_extra.phtml b/#pma/templates/columns_definitions/column_extra.phtml deleted file mode 100644 index d39268f5..00000000 --- a/#pma/templates/columns_definitions/column_extra.phtml +++ /dev/null @@ -1,7 +0,0 @@ - - checked="checked" - - type="checkbox" - value="auto_increment" /> \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_indexes.phtml b/#pma/templates/columns_definitions/column_indexes.phtml deleted file mode 100644 index 94cf03aa..00000000 --- a/#pma/templates/columns_definitions/column_indexes.phtml +++ /dev/null @@ -1,30 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_length.phtml b/#pma/templates/columns_definitions/column_length.phtml deleted file mode 100644 index dafd5d7b..00000000 --- a/#pma/templates/columns_definitions/column_length.phtml +++ /dev/null @@ -1,11 +0,0 @@ - -

    - - - -

    \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_name.phtml b/#pma/templates/columns_definitions/column_name.phtml deleted file mode 100644 index 9659679f..00000000 --- a/#pma/templates/columns_definitions/column_name.phtml +++ /dev/null @@ -1,46 +0,0 @@ - - - disabled="disabled" - - type="text" - name="field_name[]" - maxlength="64" - class="textfield" - title="" - size="10" - value="" /> - - -

    - - - -

    - diff --git a/#pma/templates/columns_definitions/column_null.phtml b/#pma/templates/columns_definitions/column_null.phtml deleted file mode 100644 index 72134ed3..00000000 --- a/#pma/templates/columns_definitions/column_null.phtml +++ /dev/null @@ -1,8 +0,0 @@ - - checked="checked" - - type="checkbox" - value="NULL" - class="allow_null"/> \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_type.phtml b/#pma/templates/columns_definitions/column_type.phtml deleted file mode 100644 index ae2527ea..00000000 --- a/#pma/templates/columns_definitions/column_type.phtml +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/column_virtuality.phtml b/#pma/templates/columns_definitions/column_virtuality.phtml deleted file mode 100644 index 2255257a..00000000 --- a/#pma/templates/columns_definitions/column_virtuality.phtml +++ /dev/null @@ -1,48 +0,0 @@ - '', - 'VIRTUAL' => 'VIRTUAL', -); -$serverType = PMA\libraries\Util::getServerType(); -if ($serverType == 'MariaDB') { - $options['PERSISTENT'] = 'PERSISTENT'; -} else { - $options['STORED'] = 'STORED'; -} - -$expression = ''; -if (isset($columnMeta['Expression'])) { - $expression = $columnMeta['Expression']; -} -?> - - -
    - - - - - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/mime_type.phtml b/#pma/templates/columns_definitions/mime_type.phtml deleted file mode 100644 index d0a6e9f8..00000000 --- a/#pma/templates/columns_definitions/mime_type.phtml +++ /dev/null @@ -1,17 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/move_column.phtml b/#pma/templates/columns_definitions/move_column.phtml deleted file mode 100644 index a4e07676..00000000 --- a/#pma/templates/columns_definitions/move_column.phtml +++ /dev/null @@ -1,15 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/partitions.phtml b/#pma/templates/columns_definitions/partitions.phtml deleted file mode 100644 index e0dedddb..00000000 --- a/#pma/templates/columns_definitions/partitions.phtml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - -
    - - ( - - )
    - -
    - - ( - - )
    - -
    - - 1): ?> - - - - - - - 1): ?> - - - - - - - - - - - - - - - - - - - - - - - - - - 1): ?> - - - - - - - - - - - - - - -
    - - - - -
    - - - - - - - - - - - - - - - - - - -
    - \ No newline at end of file diff --git a/#pma/templates/columns_definitions/table_fields_definitions.phtml b/#pma/templates/columns_definitions/table_fields_definitions.phtml deleted file mode 100644 index 057c8bc0..00000000 --- a/#pma/templates/columns_definitions/table_fields_definitions.phtml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - render($content_row); ?> - - -
    - - -
    - - - - - If you ever need to put' - . ' a backslash ("\") or a single quote ("\'") amongst those' - . ' values, precede it with a backslash (for example \'\\\\xyz\'' - . ' or \'a\\\'b\').' - ) - ); ?> - - - - - - - - - - - - - - A_I - - - - - - - - - - - - - - - If you ever need to put' - . ' a backslash ("\") or a single quote ("\'") amongst those' - . ' values, precede it with a backslash (for example \'\\\\xyz\'' - . ' or \'a\\\'b\').' - ) - ); ?> - - - - - - - If you ever need to put' - . ' a backslash ("\") or a single quote ("\'") amongst those' - . ' values, precede it with a backslash (for example \'\\\\xyz\'' - . ' or \'a\\\'b\').' - ) - ); ?> -
    -
    \ No newline at end of file diff --git a/#pma/templates/columns_definitions/transformation.phtml b/#pma/templates/columns_definitions/transformation.phtml deleted file mode 100644 index 96467007..00000000 --- a/#pma/templates/columns_definitions/transformation.phtml +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/#pma/templates/columns_definitions/transformation_option.phtml b/#pma/templates/columns_definitions/transformation_option.phtml deleted file mode 100644 index bb19e3f0..00000000 --- a/#pma/templates/columns_definitions/transformation_option.phtml +++ /dev/null @@ -1,9 +0,0 @@ - - diff --git a/#pma/templates/components/error_message.phtml b/#pma/templates/components/error_message.phtml deleted file mode 100644 index 2a67ea5a..00000000 --- a/#pma/templates/components/error_message.phtml +++ /dev/null @@ -1,4 +0,0 @@ -
    - - -
    \ No newline at end of file diff --git a/#pma/templates/database/create_table.phtml b/#pma/templates/database/create_table.phtml deleted file mode 100644 index 45995385..00000000 --- a/#pma/templates/database/create_table.phtml +++ /dev/null @@ -1,23 +0,0 @@ -
    -
    - - -   - - - - -
    - : - -
    -
    - : - -
    -
    -
    -
    - -
    -
    \ No newline at end of file diff --git a/#pma/templates/database/designer/aggregate_query_panel.phtml b/#pma/templates/database/designer/aggregate_query_panel.phtml deleted file mode 100644 index ec00ee91..00000000 --- a/#pma/templates/database/designer/aggregate_query_panel.phtml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/database/designer/canvas.phtml b/#pma/templates/database/designer/canvas.phtml deleted file mode 100644 index 5110ccc0..00000000 --- a/#pma/templates/database/designer/canvas.phtml +++ /dev/null @@ -1,3 +0,0 @@ -
    - -
    \ No newline at end of file diff --git a/#pma/templates/database/designer/database_tables.phtml b/#pma/templates/database/designer/database_tables.phtml deleted file mode 100644 index 03161efd..00000000 --- a/#pma/templates/database/designer/database_tables.phtml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - px; top:px; display:; z-index: 1;"> - - - - - - - - - - - - - - "> - - ." - - onmouseover="old_class = this.className; this.className = 'tab_field_2';" - onmouseout="this.className = old_class;" - click_field_param=""> - - - - - - - - - - -
    - - - " - onmouseover="this.className='small_tab_pref2 small_tab_pref_1';" - onmouseout="this.className='small_tab_pref small_tab_pref_1';" > - - - - - - - -
    - " - type="checkbox" - id="select_._" - style="margin: 0;" - title="select_" - store_column_param=",,"> - "> -
    - - * - - * - - -
    -
    - -
    - diff --git a/#pma/templates/database/designer/delete_relation_panel.phtml b/#pma/templates/database/designer/delete_relation_panel.phtml deleted file mode 100644 index cc905015..00000000 --- a/#pma/templates/database/designer/delete_relation_panel.phtml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/database/designer/edit_delete_pages.phtml b/#pma/templates/database/designer/edit_delete_pages.phtml deleted file mode 100644 index 9d39e499..00000000 --- a/#pma/templates/database/designer/edit_delete_pages.phtml +++ /dev/null @@ -1,11 +0,0 @@ - -
    - -
    - - - -
    -
    \ No newline at end of file diff --git a/#pma/templates/database/designer/having_query_panel.phtml b/#pma/templates/database/designer/having_query_panel.phtml deleted file mode 100644 index 2b268e8a..00000000 --- a/#pma/templates/database/designer/having_query_panel.phtml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/database/designer/js_fields.phtml b/#pma/templates/database/designer/js_fields.phtml deleted file mode 100644 index 5e633883..00000000 --- a/#pma/templates/database/designer/js_fields.phtml +++ /dev/null @@ -1,10 +0,0 @@ - - -
    -
    -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/#pma/templates/database/designer/new_relation_panel.phtml b/#pma/templates/database/designer/new_relation_panel.phtml deleted file mode 100644 index bc449a0e..00000000 --- a/#pma/templates/database/designer/new_relation_panel.phtml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/database/designer/options_panel.phtml b/#pma/templates/database/designer/options_panel.phtml deleted file mode 100644 index cfe9cbb5..00000000 --- a/#pma/templates/database/designer/options_panel.phtml +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/database/designer/page_save_as.phtml b/#pma/templates/database/designer/page_save_as.phtml deleted file mode 100644 index 6bd5c59a..00000000 --- a/#pma/templates/database/designer/page_save_as.phtml +++ /dev/null @@ -1,33 +0,0 @@ - __('Save to selected page'), - 'new' => __('Create a page and save to it') -); -?> -
    - -
    - - - - - - - - - - - - -
    - - -
    - -
    - - -
    -
    -
    \ No newline at end of file diff --git a/#pma/templates/database/designer/page_selector.phtml b/#pma/templates/database/designer/page_selector.phtml deleted file mode 100644 index 67863d2d..00000000 --- a/#pma/templates/database/designer/page_selector.phtml +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/database/designer/query_details.phtml b/#pma/templates/database/designer/query_details.phtml deleted file mode 100644 index a461bb23..00000000 --- a/#pma/templates/database/designer/query_details.phtml +++ /dev/null @@ -1,19 +0,0 @@ -
    -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    - - - -
    -
    \ No newline at end of file diff --git a/#pma/templates/database/designer/rename_to_panel.phtml b/#pma/templates/database/designer/rename_to_panel.phtml deleted file mode 100644 index 42f4dba0..00000000 --- a/#pma/templates/database/designer/rename_to_panel.phtml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/database/designer/schema_export.phtml b/#pma/templates/database/designer/schema_export.phtml deleted file mode 100644 index c01f6a7d..00000000 --- a/#pma/templates/database/designer/schema_export.phtml +++ /dev/null @@ -1,11 +0,0 @@ -
    -
    - -
    - - - -
    -
    diff --git a/#pma/templates/database/designer/side_menu.phtml b/#pma/templates/database/designer/side_menu.phtml deleted file mode 100644 index de50373d..00000000 --- a/#pma/templates/database/designer/side_menu.phtml +++ /dev/null @@ -1,189 +0,0 @@ -getImgPath($path); -} -?> - -
    - - - - - - -
    - - \ No newline at end of file diff --git a/#pma/templates/database/designer/table_list.phtml b/#pma/templates/database/designer/table_list.phtml deleted file mode 100644 index b4a15587..00000000 --- a/#pma/templates/database/designer/table_list.phtml +++ /dev/null @@ -1,69 +0,0 @@ - - \ No newline at end of file diff --git a/#pma/templates/database/designer/where_query_panel.phtml b/#pma/templates/database/designer/where_query_panel.phtml deleted file mode 100644 index e588f411..00000000 --- a/#pma/templates/database/designer/where_query_panel.phtml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/database/structure/body_for_table_summary.phtml b/#pma/templates/database/structure/body_for_table_summary.phtml deleted file mode 100644 index 715bebd0..00000000 --- a/#pma/templates/database/structure/body_for_table_summary.phtml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - true, - 'db' => $GLOBALS['db'], - 'real_row_count' => 'true', - 'real_row_count_all' => 'true' - ); -} -$cell_text = ($approx_rows) - ? '' . '~' . $row_count_sum . '' - : $row_count_sum; -?> - - 1)): ?> - fetchValue( - "SELECT @@storage_engine;" - ); - if (empty($default_engine)) { - // MySQL >= 5.5.3 - $default_engine = $GLOBALS['dbi']->fetchValue( - "SELECT @@default_storage_engine;" - ); - } - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/database/structure/browse_table.phtml b/#pma/templates/database/structure/browse_table.phtml deleted file mode 100644 index afdfd1a3..00000000 --- a/#pma/templates/database/structure/browse_table.phtml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/#pma/templates/database/structure/browse_table_label.phtml b/#pma/templates/database/structure/browse_table_label.phtml deleted file mode 100644 index 53b1b286..00000000 --- a/#pma/templates/database/structure/browse_table_label.phtml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/#pma/templates/database/structure/check_all_tables.phtml b/#pma/templates/database/structure/check_all_tables.phtml deleted file mode 100644 index fea011f8..00000000 --- a/#pma/templates/database/structure/check_all_tables.phtml +++ /dev/null @@ -1,42 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/database/structure/empty_table.phtml b/#pma/templates/database/structure/empty_table.phtml deleted file mode 100644 index 00a58c6b..00000000 --- a/#pma/templates/database/structure/empty_table.phtml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/#pma/templates/database/structure/favorite_anchor.phtml b/#pma/templates/database/structure/favorite_anchor.phtml deleted file mode 100644 index 83b99edf..00000000 --- a/#pma/templates/database/structure/favorite_anchor.phtml +++ /dev/null @@ -1,15 +0,0 @@ - $db, - 'ajax_request' => true, - 'favorite_table' => $current_table['TABLE_NAME'], - (($already_favorite ? 'remove' : 'add') . '_favorite') => true -); -?> -" - data-favtargets="" > - - \ No newline at end of file diff --git a/#pma/templates/database/structure/print_view_data_dictionary_link.phtml b/#pma/templates/database/structure/print_view_data_dictionary_link.phtml deleted file mode 100644 index d1830b1e..00000000 --- a/#pma/templates/database/structure/print_view_data_dictionary_link.phtml +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/database/structure/search_table.phtml b/#pma/templates/database/structure/search_table.phtml deleted file mode 100644 index 043f92ba..00000000 --- a/#pma/templates/database/structure/search_table.phtml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/#pma/templates/database/structure/show_create.phtml b/#pma/templates/database/structure/show_create.phtml deleted file mode 100644 index 670220d3..00000000 --- a/#pma/templates/database/structure/show_create.phtml +++ /dev/null @@ -1,35 +0,0 @@ -
    -

    - getTable($db, $object)->isView()) { - $views [] = $object; - } else { - $tables [] = $object; - } - } - ?> - - render( - array( - 'db' => $db, - 'title' => __('Tables'), - 'raw_title' => 'Table', - 'db_objects' => $tables - ) - ) ?> - - - - render( - array( - 'db' => $db, - 'title' => __('Views'), - 'raw_title' => 'View', - 'db_objects' => $views - ) - ) ?> - -
    \ No newline at end of file diff --git a/#pma/templates/database/structure/show_create_row.phtml b/#pma/templates/database/structure/show_create_row.phtml deleted file mode 100644 index 9abba307..00000000 --- a/#pma/templates/database/structure/show_create_row.phtml +++ /dev/null @@ -1,22 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - -
    Create
    getTable($db, $object)->showCreate()); ?>
    -
    \ No newline at end of file diff --git a/#pma/templates/database/structure/sortable_header.phtml b/#pma/templates/database/structure/sortable_header.phtml deleted file mode 100644 index 43c655f2..00000000 --- a/#pma/templates/database/structure/sortable_header.phtml +++ /dev/null @@ -1,70 +0,0 @@ - 'sort_arrow', 'title' => '') - ); - $order_img .= ' ' . PMA\libraries\Util::getImage( - 's_desc.png', - __('Descending'), - array('class' => 'sort_arrow hide', 'title' => '') - ); - // but on mouse over, show the reverse order (DESC) - $order_link_params['onmouseover'] = "$('.sort_arrow').toggle();"; - // on mouse out, show current sort order (ASC) - $order_link_params['onmouseout'] = "$('.sort_arrow').toggle();"; - } else { - $future_sort_order = 'ASC'; - // current sort order is DESC - $order_img = ' ' . PMA\libraries\Util::getImage( - 's_asc.png', - __('Ascending'), - array('class' => 'sort_arrow hide', 'title' => '') - ); - $order_img .= ' ' . PMA\libraries\Util::getImage( - 's_desc.png', - __('Descending'), - array('class' => 'sort_arrow', 'title' => '') - ); - // but on mouse over, show the reverse order (ASC) - $order_link_params['onmouseover'] = "$('.sort_arrow').toggle();"; - // on mouse out, show current sort order (DESC) - $order_link_params['onmouseout'] = "$('.sort_arrow').toggle();"; - } -} -$_url_params = array( - 'db' => $_REQUEST['db'], - 'pos' => 0, // We set the position back to 0 every time they sort. - 'sort' => $sort, - 'sort_order' => $future_sort_order, -); - -if (PMA_isValid($_REQUEST['tbl_type'], array('view', 'table'))) { - $_url_params['tbl_type'] = $_REQUEST['tbl_type']; -} -if (! empty($_REQUEST['tbl_group'])) { - $_url_params['tbl_group'] = $_REQUEST['tbl_group']; -} - -$url = 'db_structure.php' . PMA_URL_getCommon($_url_params); - -echo PMA\libraries\Util::linkOrButton( - $url, $title . $order_img, $order_link_params -); diff --git a/#pma/templates/database/structure/structure_table_row.phtml b/#pma/templates/database/structure/structure_table_row.phtml deleted file mode 100644 index 5c2165c2..00000000 --- a/#pma/templates/database/structure/structure_table_row.phtml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - 0): ?> - - render( - array( - 'db' => $db, - 'current_table' => $current_table, - 'titles' => $titles, - 'already_favorite' => $already_favorite - ) - ); ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ~ - - - - - - - - - 1)): ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $GLOBALS['cfg']['LimitChars']): ?> - - - ... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/database/structure/table_header.phtml b/#pma/templates/database/structure/table_header.phtml deleted file mode 100644 index 15aa81a9..00000000 --- a/#pma/templates/database/structure/table_header.phtml +++ /dev/null @@ -1,126 +0,0 @@ - 0) { - $action_colspan++; -} -?> -
    - - - - - - - - - - - - - 1)): ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/database/structure/tracking_icon.phtml b/#pma/templates/database/structure/tracking_icon.phtml deleted file mode 100644 index fea22c47..00000000 --- a/#pma/templates/database/structure/tracking_icon.phtml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/#pma/templates/error/report_form.phtml b/#pma/templates/error/report_form.phtml deleted file mode 100644 index aaf1eca6..00000000 --- a/#pma/templates/error/report_form.phtml +++ /dev/null @@ -1,34 +0,0 @@ - -
    - -

    - -

    - -
    -
    - - -
    -
    - - - - -
    - - - - \ No newline at end of file diff --git a/#pma/templates/header_location.phtml b/#pma/templates/header_location.phtml deleted file mode 100644 index 3362e015..00000000 --- a/#pma/templates/header_location.phtml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/#pma/templates/javascript/display.phtml b/#pma/templates/javascript/display.phtml deleted file mode 100644 index d037e42b..00000000 --- a/#pma/templates/javascript/display.phtml +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/list/item.phtml b/#pma/templates/list/item.phtml deleted file mode 100644 index c3efdde8..00000000 --- a/#pma/templates/list/item.phtml +++ /dev/null @@ -1,45 +0,0 @@ - -
  • - > - - - - - - - - > - - - - - - - - -
  • diff --git a/#pma/templates/list/unordered.phtml b/#pma/templates/list/unordered.phtml deleted file mode 100644 index c65a549a..00000000 --- a/#pma/templates/list/unordered.phtml +++ /dev/null @@ -1,27 +0,0 @@ - - - > - - - - - $item) ?> - - render($item) - ?> - - - - - \ No newline at end of file diff --git a/#pma/templates/navigation/logo.phtml b/#pma/templates/navigation/logo.phtml deleted file mode 100644 index c7e15614..00000000 --- a/#pma/templates/navigation/logo.phtml +++ /dev/null @@ -1,45 +0,0 @@ -'; - if (@file_exists($GLOBALS['pmaThemeImage'] . 'logo_left.png')) { - $logo = sprintf($imgTag, 'logo_left.png'); - } elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) { - $logo = sprintf($imgTag, 'pma_logo2.png'); - } - } -} -?> - - - - - - \ No newline at end of file diff --git a/#pma/templates/prefs_autoload.phtml b/#pma/templates/prefs_autoload.phtml deleted file mode 100644 index 37863e95..00000000 --- a/#pma/templates/prefs_autoload.phtml +++ /dev/null @@ -1,15 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/preview_sql.phtml b/#pma/templates/preview_sql.phtml deleted file mode 100644 index 263957d1..00000000 --- a/#pma/templates/preview_sql.phtml +++ /dev/null @@ -1,11 +0,0 @@ -
    - - - - - - - - - -
    \ No newline at end of file diff --git a/#pma/templates/privileges/add_privileges_database.phtml b/#pma/templates/privileges/add_privileges_database.phtml deleted file mode 100644 index 9e035314..00000000 --- a/#pma/templates/privileges/add_privileges_database.phtml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/privileges/add_privileges_routine.phtml b/#pma/templates/privileges/add_privileges_routine.phtml deleted file mode 100644 index e8e6abe8..00000000 --- a/#pma/templates/privileges/add_privileges_routine.phtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/privileges/add_privileges_table.phtml b/#pma/templates/privileges/add_privileges_table.phtml deleted file mode 100644 index e515215f..00000000 --- a/#pma/templates/privileges/add_privileges_table.phtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/privileges/edit_routine_privileges.phtml b/#pma/templates/privileges/edit_routine_privileges.phtml deleted file mode 100644 index a4689789..00000000 --- a/#pma/templates/privileges/edit_routine_privileges.phtml +++ /dev/null @@ -1,26 +0,0 @@ -
    - - - - - - - - -
    - - - -

    - - - -

    - -
    - - -
    \ No newline at end of file diff --git a/#pma/templates/privileges/privileges_summary.phtml b/#pma/templates/privileges/privileges_summary.phtml deleted file mode 100644 index cc764cd3..00000000 --- a/#pma/templates/privileges/privileges_summary.phtml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - -
    - - - - -
    render( - array( - 'title' => __('Table'), - 'sort' => 'table', - 'initial_sort_order' => 'ASC' - ) - ); ?> - - - render( - array( - 'title' => __('Rows'), - 'sort' => 'records', - 'initial_sort_order' => 'DESC' - ) - ); ?> - - render( - array( - 'title' => __('Type'), - 'sort' => 'type', - 'initial_sort_order' => 'ASC' - ) - ); $cnt++; ?>render( - array( - 'title' => __('Collation'), - 'sort' => 'collation', - 'initial_sort_order' => 'ASC' - ) - ); $cnt++; ?>render( - array( - 'title' => __('Size'), - 'sort' => 'size', - 'initial_sort_order' => 'DESC' - ) - ); $cnt++; ?>render( - array( - 'title' => __('Overhead'), - 'sort' => 'overhead', - 'initial_sort_order' => 'DESC' - ) - ); $cnt++; ?>render( - array( - 'title' => __('Comment'), - 'sort' => 'comment', - 'initial_sort_order' => 'ASC' - ) - ); $cnt++; ?>render( - array( - 'title' => __('Creation'), - 'sort' => 'creation', - 'initial_sort_order' => 'DESC' - ) - ); $cnt++; ?>render( - array( - 'title' => __('Last update'), - 'sort' => 'last_update', - 'initial_sort_order' => 'DESC' - ) - ); $cnt++; ?>render( - array( - 'title' => __('Last check'), - 'sort' => 'last_check', - 'initial_sort_order' => 'DESC' - ) - ); $cnt++; ?>
    - - - - - - - - - - - - - - - - - - - - - - - - render( - array_merge( - $privilege, - array( - 'odd' => $odd, - 'type' => $type, - ) - ) - ); ?> - - - - -
    - - - render(array('databases' => $databases)); ?> - - render(array('database' => $database, 'tables' => $tables)); ?> - - render(array('database' => $database, 'routines' => $routines)); ?> - - -
    - -
    - -
    - \ No newline at end of file diff --git a/#pma/templates/privileges/privileges_summary_row.phtml b/#pma/templates/privileges/privileges_summary_row.phtml deleted file mode 100644 index 11eb252c..00000000 --- a/#pma/templates/privileges/privileges_summary_row.phtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/secondary_tabs.phtml b/#pma/templates/secondary_tabs.phtml deleted file mode 100644 index 40c51343..00000000 --- a/#pma/templates/secondary_tabs.phtml +++ /dev/null @@ -1,6 +0,0 @@ -
      - - - -
    -
    \ No newline at end of file diff --git a/#pma/templates/server/binlog/log_row.phtml b/#pma/templates/server/binlog/log_row.phtml deleted file mode 100644 index a83768f6..00000000 --- a/#pma/templates/server/binlog/log_row.phtml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/server/binlog/log_selector.phtml b/#pma/templates/server/binlog/log_selector.phtml deleted file mode 100644 index 0f8ad9ed..00000000 --- a/#pma/templates/server/binlog/log_selector.phtml +++ /dev/null @@ -1,27 +0,0 @@ -
    - -
    - - - - - - - 0): ?> - - -
    -
    - -
    -
    diff --git a/#pma/templates/server/collations/charsets.phtml b/#pma/templates/server/collations/charsets.phtml deleted file mode 100644 index 0e7382f8..00000000 --- a/#pma/templates/server/collations/charsets.phtml +++ /dev/null @@ -1,30 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - -
    - - - () - -
    -
    \ No newline at end of file diff --git a/#pma/templates/server/databases/create.phtml b/#pma/templates/server/databases/create.phtml deleted file mode 100644 index a8b71d7f..00000000 --- a/#pma/templates/server/databases/create.phtml +++ /dev/null @@ -1,36 +0,0 @@ -
      -
    • - -
      - -   - -
      - - - - - - - - - - -
      - - - -   - -
      - - - 2, 'border' => 0, 'align' => 'middle')) , ' ' , __('No Privileges'); ?> - - -
    • -
    diff --git a/#pma/templates/server/databases/table_footer.phtml b/#pma/templates/server/databases/table_footer.phtml deleted file mode 100644 index fdaccc9d..00000000 --- a/#pma/templates/server/databases/table_footer.phtml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - : - - $stat): - if (! array_key_exists($stat_name, $first_database)) { - continue; - } - if ($stat['format'] === 'byte') { - list($value, $unit) = \PMA\libraries\Util::formatByteDown($stat['footer'], 3, 1); - } elseif ($stat['format'] === 'number') { - $value = \PMA\libraries\Util::formatNumber($stat['footer'], 0); - } else { - $value = htmlentities($stat['footer'], 0); - } ?> - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/server/databases/table_header.phtml b/#pma/templates/server/databases/table_header.phtml deleted file mode 100644 index ed8fbf21..00000000 --- a/#pma/templates/server/databases/table_header.phtml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - $stat): - if (! array_key_exists($stat_name, $first_database)) { - continue; - } - $_url_params['sort_by'] = $stat_name; - $_url_params['sort_order'] = ($sort_by == $stat_name && $sort_order == 'desc') ? 'asc' : 'desc'; ?> - - colspan="2"> - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/server/databases/table_row.phtml b/#pma/templates/server/databases/table_row.phtml deleted file mode 100644 index 20259f48..00000000 --- a/#pma/templates/server/databases/table_row.phtml +++ /dev/null @@ -1,65 +0,0 @@ -> - - - isSystemSchema($current['SCHEMA_NAME'], true)): ?> - disabled="disabled"; - - /> - - - - - - - - $stat): - if (! array_key_exists($stat_name, $current)) { - continue; - } - - if ($stat['format'] === 'byte') { - list($value, $unit) = \PMA\libraries\Util::formatByteDown($current[$stat_name], 3, 1); - } elseif ($stat['format'] === 'number') { - $value = \PMA\libraries\Util::formatNumber($current[$stat_name], 0); - } else { - $value = htmlentities($current[$stat_name], 0); - } ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "> - - - - diff --git a/#pma/templates/server/engines/engine.phtml b/#pma/templates/server/engines/engine.phtml deleted file mode 100644 index 3c055295..00000000 --- a/#pma/templates/server/engines/engine.phtml +++ /dev/null @@ -1,42 +0,0 @@ -

    - -

    -

    - - - -

    - -

    - [ - - - - - - - - $label): ?> - | - - - - - - - - - ] -

    - - - - - -

    - -

    - - \ No newline at end of file diff --git a/#pma/templates/server/engines/engines.phtml b/#pma/templates/server/engines/engines.phtml deleted file mode 100644 index db92474b..00000000 --- a/#pma/templates/server/engines/engines.phtml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - $details): ?> - - - - - - - -
    - - - -
    \ No newline at end of file diff --git a/#pma/templates/server/plugins/section.phtml b/#pma/templates/server/plugins/section.phtml deleted file mode 100644 index c9d4d8b0..00000000 --- a/#pma/templates/server/plugins/section.phtml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - -
    \ No newline at end of file diff --git a/#pma/templates/server/plugins/section_links.phtml b/#pma/templates/server/plugins/section_links.phtml deleted file mode 100644 index 4c3d3768..00000000 --- a/#pma/templates/server/plugins/section_links.phtml +++ /dev/null @@ -1,8 +0,0 @@ - -
    \ No newline at end of file diff --git a/#pma/templates/server/variables/link_template.phtml b/#pma/templates/server/variables/link_template.phtml deleted file mode 100644 index b2e68aab..00000000 --- a/#pma/templates/server/variables/link_template.phtml +++ /dev/null @@ -1,11 +0,0 @@ - - - 'display:none', 'id' => 'docImage') -) ?> \ No newline at end of file diff --git a/#pma/templates/server/variables/session_variable_row.phtml b/#pma/templates/server/variables/session_variable_row.phtml deleted file mode 100644 index b98afa85..00000000 --- a/#pma/templates/server/variables/session_variable_row.phtml +++ /dev/null @@ -1,5 +0,0 @@ - - - ( ) -   - \ No newline at end of file diff --git a/#pma/templates/server/variables/variable_filter.phtml b/#pma/templates/server/variables/variable_filter.phtml deleted file mode 100644 index 1f897e10..00000000 --- a/#pma/templates/server/variables/variable_filter.phtml +++ /dev/null @@ -1,9 +0,0 @@ -
    - -
    - - -
    -
    \ No newline at end of file diff --git a/#pma/templates/server/variables/variable_row.phtml b/#pma/templates/server/variables/variable_row.phtml deleted file mode 100644 index 8da5826e..00000000 --- a/#pma/templates/server/variables/variable_row.phtml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - ' - ?> - - - - - -   - diff --git a/#pma/templates/server/variables/variable_table_head.phtml b/#pma/templates/server/variables/variable_table_head.phtml deleted file mode 100644 index a1ac15ba..00000000 --- a/#pma/templates/server/variables/variable_table_head.phtml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - / - - \ No newline at end of file diff --git a/#pma/templates/startAndNumberOfRowsPanel.phtml b/#pma/templates/startAndNumberOfRowsPanel.phtml deleted file mode 100644 index d50474db..00000000 --- a/#pma/templates/startAndNumberOfRowsPanel.phtml +++ /dev/null @@ -1,20 +0,0 @@ -
    -
    - - 0) : ?> - max="" - - value="" /> - - - - - - -
    -
    \ No newline at end of file diff --git a/#pma/templates/table/chart/tbl_chart.phtml b/#pma/templates/table/chart/tbl_chart.phtml deleted file mode 100644 index 673f9a71..00000000 --- a/#pma/templates/table/chart/tbl_chart.phtml +++ /dev/null @@ -1,162 +0,0 @@ - - - -
    -
    - -
    - - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    - - - -

    - -

    - - -
    - -
    - - -
    - - - - -
    -
    - - -
    - - -
    -
    -

     

    -
    - - -
    - - - - -
    - -

     

    -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/#pma/templates/table/gis_visualization/gis_visualization.phtml b/#pma/templates/table/gis_visualization/gis_visualization.phtml deleted file mode 100644 index b6b956be..00000000 --- a/#pma/templates/table/gis_visualization/gis_visualization.phtml +++ /dev/null @@ -1,80 +0,0 @@ -
    -
    - -
    -
    - - - - - - - - - - checked="checked" - /> - - - - -
    - -
    -
    - - - - -
    -
    -
    - -
     
    - -
    - -
    -
    - - -
    -
    diff --git a/#pma/templates/table/index_form.phtml b/#pma/templates/table/index_form.phtml deleted file mode 100644 index f0f28483..00000000 --- a/#pma/templates/table/index_form.phtml +++ /dev/null @@ -1,245 +0,0 @@ -
    - - - -
    -
    -
    -
    - - be the name of and only of a primary key!' - ) - ) - ); ?> - - -
    - - -
    - -
    -
    - - - -
    - - generateIndexChoiceSelector(isset($_REQUEST['create_edit_table'])); ?> -
    - - - -
    - -
    - - - -
    - - -
    - -
    - -
    - - - -
    - - generateIndexTypeSelector(); ?> -
    - -
    -
    - - - -
    - - -
    - -
    -
    - - - -
    - - -
    -
    - - -
    - - - - - - - - - - - - - getColumns() as $column): ?> - - - - - - - - - - - - - - - - - -
    - - - -
    - - - - - -
    - - - - - -
    -
    - -
    -
    - -
    -
    -
    -
    - - -
    -
    \ No newline at end of file diff --git a/#pma/templates/table/relation/common_form.phtml b/#pma/templates/table/relation/common_form.phtml deleted file mode 100644 index d475fd7d..00000000 --- a/#pma/templates/table/relation/common_form.phtml +++ /dev/null @@ -1,138 +0,0 @@ -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - $one_key): ?> - render( - array( - 'one_key' => $one_key, - 'odd_row' => $odd_row, - 'columns' => $columns, - 'i' => $i++, - 'options_array' => $options_array, - 'tbl_storage_engine' => $tbl_storage_engine, - 'db' => $db - ) - ); - $odd_row = ! $odd_row;?> - - - render( - array( - 'one_key' => array(), - 'odd_row' => $odd_row, - 'columns' => $columns, - 'i' => $i++, - 'options_array' => $options_array, - 'tbl_storage_engine' => $tbl_storage_engine, - 'db' => $db - ) - ); ?> - - - -
    - - - () -
    - - -
    -
    - - - - -
    - - - - -
    - - - - - - - - render( - array( - 'save_row' => $save_row, - 'i' => $i, - 'odd_row' => $odd_row, - 'existrel' => $existrel, - 'db' => $db - ) - ); - $odd_row = ! $odd_row; ?> - -
    - - - -
    -
    - -
    - - - - - - -
    - - -
    - - -
    - - -
    - \ No newline at end of file diff --git a/#pma/templates/table/relation/dropdown_generate.phtml b/#pma/templates/table/relation/dropdown_generate.phtml deleted file mode 100644 index d9536dec..00000000 --- a/#pma/templates/table/relation/dropdown_generate.phtml +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/table/relation/foreign_key_row.phtml b/#pma/templates/table/relation/foreign_key_row.phtml deleted file mode 100644 index f54990d8..00000000 --- a/#pma/templates/table/relation/foreign_key_row.phtml +++ /dev/null @@ -1,200 +0,0 @@ -query( - 'SHOW TABLE STATUS FROM ' . Util::backquote($foreign_db), - null, - DatabaseInterface::QUERY_STORE - ); - while ($row = $GLOBALS['dbi']->fetchRow($tables_rs)) { - if (isset($row[1]) - && mb_strtoupper($row[1]) == $tbl_storage_engine - ) { - $tables[] = $row[0]; - } - } -} -?> - - - - - - - - - - - - - - -
    - - render( - array( - 'dropdown_question' => 'ON DELETE', - 'select_name' => 'on_delete[' . $i . ']', - 'choices' => $options_array, - 'selected_value' => $on_delete - ) - ); ?> - - - render( - array( - 'dropdown_question' => 'ON UPDATE', - 'select_name' => 'on_update[' . $i . ']', - 'choices' => $options_array, - 'selected_value' => $on_update - ) - ); ?> - -
    - - - - $column): ?> - - render( - array( - 'dropdown_question' => '', - 'select_name' => 'foreign_key_fields_name[' . $i . '][]', - 'choices' => $column_array, - 'selected_value' => $column - ) - ); ?> - - - - - render( - array( - 'dropdown_question' => '', - 'select_name' => 'foreign_key_fields_name[' . $i . '][]', - 'choices' => $column_array, - 'selected_value' => '' - ) - ); ?> - - - - - - - - - render( - array( - 'name' => 'destination_foreign_db[' . $i . ']', - 'title' => __('Database'), - 'values' => $GLOBALS['dblist']->databases, - 'foreign' => $foreign_db - ) - ); ?> - - - - render( - array( - 'name' => 'destination_foreign_table[' . $i . ']', - 'title' => __('Table'), - 'values' => $tables, - 'foreign' => $foreign_table - ) - ); ?> - - - - - - getUniqueColumns(false, false); - ?> - - render( - array( - 'name' => 'destination_foreign_column[' . $i . '][]', - 'title' => __('Column'), - 'values' => $columns, - 'foreign' => $foreign_column - ) - ); ?> - - - - - render( - array( - 'name' => 'destination_foreign_column[' . $i . '][]', - 'title' => __('Column'), - 'values' => array(), - 'foreign' => '' - ) - ); ?> - - - - \ No newline at end of file diff --git a/#pma/templates/table/relation/internal_relational_row.phtml b/#pma/templates/table/relation/internal_relational_row.phtml deleted file mode 100644 index b5b7a50c..00000000 --- a/#pma/templates/table/relation/internal_relational_row.phtml +++ /dev/null @@ -1,79 +0,0 @@ -query( - 'SHOW TABLES FROM ' . PMA\libraries\Util::backquote($foreign_db), - null, - PMA\libraries\DatabaseInterface::QUERY_STORE - ); - while ($row = $GLOBALS['dbi']->fetchRow($tables_rs)) { - $tables[] = $row[0]; - } -} - -// column dropdown -$columns = array(); -if ($foreign_db && $foreign_table) { - if (isset($existrel[$myfield])) { - $foreign_column = $existrel[$myfield]['foreign_field']; - } - $table_obj = new Table($foreign_table, $foreign_db); - $columns = $table_obj->getUniqueColumns(false, false); -} -?> - - - - - - - - render( - array( - 'name' => 'destination_db[' . $myfield_md5 . ']', - 'title' => __('Database'), - 'values' => $GLOBALS['dblist']->databases, - 'foreign' => $foreign_db - ) - ); ?> - render( - array( - 'name' => 'destination_table[' . $myfield_md5 . ']', - 'title' => __('Table'), - 'values' => $tables, - 'foreign' => $foreign_table - ) - ); ?> - render( - array( - 'name' => 'destination_column[' . $myfield_md5 . ']', - 'title' => __('Column'), - 'values' => $columns, - 'foreign' => $foreign_column - ) - ); ?> - - \ No newline at end of file diff --git a/#pma/templates/table/relation/relational_dropdown.phtml b/#pma/templates/table/relation/relational_dropdown.phtml deleted file mode 100644 index c2e6f4b4..00000000 --- a/#pma/templates/table/relation/relational_dropdown.phtml +++ /dev/null @@ -1,18 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/table/search/column_comparison_operators.phtml b/#pma/templates/table/search/column_comparison_operators.phtml deleted file mode 100644 index 176691ca..00000000 --- a/#pma/templates/table/search/column_comparison_operators.phtml +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/table/search/fields_table.phtml b/#pma/templates/table/search/fields_table.phtml deleted file mode 100644 index d084aa25..00000000 --- a/#pma/templates/table/search/fields_table.phtml +++ /dev/null @@ -1,26 +0,0 @@ - - id="tableFieldsId" - > - render(array( - 'geomColumnFlag' => $geomColumnFlag - )); ?> - - - render(array( - 'self' => $self, - 'columnNames' => $columnNames - )) ?> - - render(array( - 'self' => $self, - 'geomColumnFlag' => $geomColumnFlag, - 'columnNames' => $columnNames, - 'columnTypes' => $columnTypes, - 'columnCollations' => $columnCollations - )) ?> - - -
    \ No newline at end of file diff --git a/#pma/templates/table/search/form_tag.phtml b/#pma/templates/table/search/form_tag.phtml deleted file mode 100644 index dfe730e7..00000000 --- a/#pma/templates/table/search/form_tag.phtml +++ /dev/null @@ -1,22 +0,0 @@ - -
    - - - \ No newline at end of file diff --git a/#pma/templates/table/search/geom_func.phtml b/#pma/templates/table/search/geom_func.phtml deleted file mode 100644 index 55642e77..00000000 --- a/#pma/templates/table/search/geom_func.phtml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - -   - - \ No newline at end of file diff --git a/#pma/templates/table/search/input_box.phtml b/#pma/templates/table/search/input_box.phtml deleted file mode 100644 index 9898135b..00000000 --- a/#pma/templates/table/search/input_box.phtml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - value="" - /> - - - - - - - - - - - - - - - - - - - - dropdown - * Enum in search mode --> multiselect - * Set in edit mode --> multiselect - * Set in search mode --> input (skipped here, so the 'else' - * section would handle it) - */ - ?> - - - - - - - - - - - - - - - - - - - - - value="" - /> - - diff --git a/#pma/templates/table/search/options.phtml b/#pma/templates/table/search/options.phtml deleted file mode 100644 index 89908c0e..00000000 --- a/#pma/templates/table/search/options.phtml +++ /dev/null @@ -1,78 +0,0 @@ - - - -
    - - - - - - -
    - - -
    - - - - - - -
    - - -
    - - -
    - - -
    - - - - __('Ascending'), - 'DESC' => __('Descending') - ), - 'ASC', - false, - true, - "formelement" - ); ?> - -
    -
    diff --git a/#pma/templates/table/search/options_zoom.phtml b/#pma/templates/table/search/options_zoom.phtml deleted file mode 100644 index d288db04..00000000 --- a/#pma/templates/table/search/options_zoom.phtml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - -
    - - - -
    - - - -
    diff --git a/#pma/templates/table/search/replace_preview.phtml b/#pma/templates/table/search/replace_preview.phtml deleted file mode 100644 index 785ee201..00000000 --- a/#pma/templates/table/search/replace_preview.phtml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    - -
    -
    \ No newline at end of file diff --git a/#pma/templates/table/search/rows_normal.phtml b/#pma/templates/table/search/rows_normal.phtml deleted file mode 100644 index e3e3d2b0..00000000 --- a/#pma/templates/table/search/rows_normal.phtml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - render(array( - 'column_index' => $column_index, - 'columnTypes' => $columnTypes, - )); ?> - - - - - - getColumnProperties($column_index, $column_index); ?> - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/table/search/rows_zoom.phtml b/#pma/templates/table/search/rows_zoom.phtml deleted file mode 100644 index a3f393a6..00000000 --- a/#pma/templates/table/search/rows_zoom.phtml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - getColumnProperties($i, $key); - $type[$i] = $properties['type']; - $collation[$i] = $properties['collation']; - $func[$i] = $properties['func']; - $value[$i] = $properties['value']; - } ?> - - - - - - - - - - - - - - - - - - - - - - value="" - /> - - - - diff --git a/#pma/templates/table/search/search_and_replace.phtml b/#pma/templates/table/search/search_and_replace.phtml deleted file mode 100644 index fe766fe3..00000000 --- a/#pma/templates/table/search/search_and_replace.phtml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - -
    - \ No newline at end of file diff --git a/#pma/templates/table/search/selection_form.phtml b/#pma/templates/table/search/selection_form.phtml deleted file mode 100644 index bb53545a..00000000 --- a/#pma/templates/table/search/selection_form.phtml +++ /dev/null @@ -1,81 +0,0 @@ -render(array( - 'searchType' => $searchType, - 'db' => $db, - 'table' => $table, - 'goto' => $goto - )) ?> - - - - - -
    -
    - - - - render(array( - 'columnNames' => $columnNames, - 'columnTypes' => $columnTypes - )); ?> -
    -
    - - - -
    - - id="inputFormSubmitId" - - value="" /> -
    - -
    \ No newline at end of file diff --git a/#pma/templates/table/search/table_header.phtml b/#pma/templates/table/search/table_header.phtml deleted file mode 100644 index 5841167f..00000000 --- a/#pma/templates/table/search/table_header.phtml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/table/search/zoom_result_form.phtml b/#pma/templates/table/search/zoom_result_form.phtml deleted file mode 100644 index 83dd332a..00000000 --- a/#pma/templates/table/search/zoom_result_form.phtml +++ /dev/null @@ -1,99 +0,0 @@ -
    - - - - -
    - - - -
    - -
    -
    - - - -
    - -
    - -
    - -
    - - - - - diff --git a/#pma/templates/table/secondary_tabs.phtml b/#pma/templates/table/secondary_tabs.phtml deleted file mode 100644 index 35a418b2..00000000 --- a/#pma/templates/table/secondary_tabs.phtml +++ /dev/null @@ -1,19 +0,0 @@ - - -
      - 'b_props', - 'link' => 'tbl_structure.php', - 'text' => __('Table structure'), - 'id' => 'table_strucuture_id' - ), $url_params); ?> - 'b_relations', - 'link' => 'tbl_relation.php', - 'text' => __('Relation view'), - 'id' => 'table_relation_id' - ), $url_params); ?> -
    -
    - \ No newline at end of file diff --git a/#pma/templates/table/structure/action_row_in_structure_table.phtml b/#pma/templates/table/structure/action_row_in_structure_table.phtml deleted file mode 100644 index d5dc69bf..00000000 --- a/#pma/templates/table/structure/action_row_in_structure_table.phtml +++ /dev/null @@ -1,28 +0,0 @@ -
  • - - - - - add_index_anchor" - - add_unique_anchor" - - add_spatial_anchor" - - " - href="tbl_structure.php&add_key=1&sql_query=&message_to_show=" > - - - -
  • \ No newline at end of file diff --git a/#pma/templates/table/structure/actions_in_table_structure.phtml b/#pma/templates/table/structure/actions_in_table_structure.phtml deleted file mode 100644 index e6ea36e8..00000000 --- a/#pma/templates/table/structure/actions_in_table_structure.phtml +++ /dev/null @@ -1,141 +0,0 @@ -
      - - - - render( - array( - 'type' => $type, - 'tbl_storage_engine' => $tbl_storage_engine, - 'class' => 'primary nowrap', - 'hasField' => ($primary && $primary->hasColumn($field_name)), - 'hasLinkClass' => true, - 'url_query' => $url_query, - 'primary' => $primary, - 'syntax' => 'ADD PRIMARY KEY', - 'message' => __('A primary key has been added on %s.'), - 'action' => 'Primary', - 'titles' => $titles, - 'row' => $row, - 'isPrimary' => true - ) - ) - ?> - - render( - array( - 'type' => $type, - 'tbl_storage_engine' => $tbl_storage_engine, - 'class' => 'add_unique unique nowrap', - 'hasField' => in_array($field_name, $columns_with_unique_index), - 'hasLinkClass' => false, - 'url_query' => $url_query, - 'primary' => $primary, - 'syntax' => 'ADD UNIQUE', - 'message' => __('An index has been added on %s.'), - 'action' => 'Unique', - 'titles' => $titles, - 'row' => $row, - 'isPrimary' => false - ) - ) - ?> - - render( - array( - 'type' => $type, - 'tbl_storage_engine' => $tbl_storage_engine, - 'class' => 'add_index nowrap', - 'hasField' => false, - 'hasLinkClass' => false, - 'url_query' => $url_query, - 'primary' => $primary, - 'syntax' => 'ADD INDEX', - 'message' => __('An index has been added on %s.'), - 'action' => 'Index', - 'titles' => $titles, - 'row' => $row, - 'isPrimary' => false - ) - ) - ?> - - - - render( - array( - 'type' => $type, - 'tbl_storage_engine' => $tbl_storage_engine, - 'class' => 'spatial nowrap', - 'hasField' => ! (in_array($type, $spatial_types) && ('MYISAM' == $tbl_storage_engine || PMA_MYSQL_INT_VERSION >= 50705)), - 'hasLinkClass' => false, - 'url_query' => $url_query, - 'primary' => $primary, - 'syntax' => 'ADD SPATIAL', - 'message' => __('An index has been added on %s.'), - 'action' => 'Spatial', - 'titles' => $titles, - 'row' => $row, - 'isPrimary' => false - ) - ) - ?> - -
    • - = 50604)) - && (mb_strpos($type, 'text') !== false - || mb_strpos($type, 'char') !== false) - ): ?> - - - - - - -
    • - -
    • - - - -
    • - -
    • - - - - - - - -
    • - -
    \ No newline at end of file diff --git a/#pma/templates/table/structure/add_column.phtml b/#pma/templates/table/structure/add_column.phtml deleted file mode 100644 index 18348868..00000000 --- a/#pma/templates/table/structure/add_column.phtml +++ /dev/null @@ -1,26 +0,0 @@ -
    - - -   - - '; ?> - -   - - - -
    \ No newline at end of file diff --git a/#pma/templates/table/structure/check_all_table_column.phtml b/#pma/templates/table/structure/check_all_table_column.phtml deleted file mode 100644 index 701ed206..00000000 --- a/#pma/templates/table/structure/check_all_table_column.phtml +++ /dev/null @@ -1,56 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/table/structure/display_partitions.phtml b/#pma/templates/table/structure/display_partitions.phtml deleted file mode 100644 index e22edfca..00000000 --- a/#pma/templates/table/structure/display_partitions.phtml +++ /dev/null @@ -1,142 +0,0 @@ - -
    -
    - - - - getDisplay(); ?> - -

    - - -

    - -

    - - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $icon): ?> - - - - - getSubPartitions() as $subParition): ?> - - - - - - - - - - - - - - - - - - - -
    # - -
    getOrdinal(); ?>getOrdinal(); ?>getName()); ?> - - getExpression()) - , ($partition->getMethod() == 'LIST' ? ' IN (' : ' < ') - , htmlspecialchars($partition->getDescription()) - , ($partition->getMethod() == 'LIST' ? ')' : ''); - ?> - - getRows(); ?>getDataLength(), 3, 1 - ); - ?> - - - getIndexLength(), 3, 1 - ); - ?> - - - getComment()); ?> - getName() - ) ?>" - id="partition_action_" - name="partition_action_" - class="ajax" - > - - -
    getOrdinal(); ?>getName()); ?>getRows(); ?>getDataLength(), 3, 1 - ); - ?> - - - getIndexLength(), 3, 1 - ); - ?> - - - getComment()); ?>
    - -

    - -
    diff --git a/#pma/templates/table/structure/display_structure.phtml b/#pma/templates/table/structure/display_structure.phtml deleted file mode 100644 index 26d612b4..00000000 --- a/#pma/templates/table/structure/display_structure.phtml +++ /dev/null @@ -1,227 +0,0 @@ - -
    - - - "information_schema" /> - - "view" /> - - "table" /> - - - - render( - array( - 'db_is_system_schema' => $db_is_system_schema, - 'tbl_is_view' => $tbl_is_view - ) - ); ?> - - - - NULL'; - } - } else { - $row['Default'] = htmlspecialchars($row['Default']); - } - - $field_name = htmlspecialchars($row['Field']); - $displayed_field_name = $field_name; - $comments = ''; //For column comments - // underline commented fields and display a hover-title (CSS only) - - if (isset($comments_map[$row['Field']])) { - $displayed_field_name = '' - . $field_name . ''; - $comments = htmlspecialchars($comments_map[$row['Field']]); - } - - if ($primary && $primary->hasColumn($field_name)) { - $displayed_field_name .= Util::getImage( - 'b_primary.png', __('Primary') - ); - } - if (in_array($field_name, $columns_with_index)) { - $displayed_field_name .= Util::getImage( - 'bd_primary.png', __('Index') - ); - } - ?> - - - render( - array( - 'row' => $row, - 'rownum' => $rownum, - 'displayed_field_name' => $displayed_field_name, - 'type_nowrap' => Util::getClassForType($extracted_columnspec['type']), - 'extracted_columnspec' => $extracted_columnspec, - 'attribute' => $attribute, - 'tbl_is_view' => $tbl_is_view, - 'db_is_system_schema' => $db_is_system_schema, - 'url_query' => $url_query, - 'field_encoded' => urlencode($row['Field']), - 'titles' => $titles, - 'table' => $table, - 'tbl_storage_engine' => $tbl_storage_engine, - 'field_charset' => $field_charset, - 'comments' => $comments - ) - ); ?> - - render( - array( - 'extracted_columnspec' => $extracted_columnspec, - 'type' => (!empty($extracted_columnspec['print_type'])) ? $extracted_columnspec['print_type'] : ' ', - 'tbl_storage_engine' => $tbl_storage_engine, - 'primary' => $primary, - 'field_name' => $field_name, - 'url_query' => $url_query, - 'titles' => $titles, - 'row' => $row, - 'rownum' => $rownum, - 'columns_with_unique_index' => $columns_with_unique_index, - 'isInCentralColumns' => in_array($row['Field'], $central_list) ? true : false - ) - ); ?> - - - - -
    - render( - array( - 'pmaThemeImage' => $GLOBALS['pmaThemeImage'], - 'text_dir' => $GLOBALS['text_dir'], - 'tbl_is_view' => $tbl_is_view, - 'db_is_system_schema' => $db_is_system_schema, - 'tbl_storage_engine' => $tbl_storage_engine - ) - ); ?> -
    - -render(); ?> - - - -
    - render( - array('columns_list' => $columns_list) - ); ?> - - - - - - - - -getMethod() == 'RANGE' - || $firstPartition->getMethod() == 'RANGE COLUMNS' - || $firstPartition->getMethod() == 'LIST' - || $firstPartition->getMethod() == 'LIST COLUMNS'; - $subParitions = $firstPartition->getSubPartitions(); - $hasSubPartitions = $firstPartition->hasSubPartitions(); - if ($hasSubPartitions) { - $firstSubPartition = $subParitions[0]; - } - - $actionIcons = array( - 'ANALYZE' => Util::getIcon('b_search.png', __('Analyze')), - 'CHECK' => Util::getIcon('eye.png', __('Check')), - 'OPTIMIZE' => Util::getIcon('normalize.png', __('Optimize')), - 'REBUILD' => Util::getIcon('s_tbl.png', __('Rebuild')), - 'REPAIR' => Util::getIcon('b_tblops.png', __('Repair')), - 'TRUNCATE' => Util::getIcon('b_empty.png', __('Truncate')), - ); - if ($rangeOrList) { - $actionIcons['DROP'] = Util::getIcon('b_drop.png', __('Drop')); - } - - echo Util::getDivForSliderEffect( - 'partitions', __('Partitions') - ); - - $tmp_partition_description = $firstPartition->getDescription(); - - $removeSQL = "ALTER TABLE " . Util::backquote($table) . " REMOVE PARTITIONING"; - $removeUrl = 'sql.php' . $url_query . '&sql_query=' . urlencode($removeSQL); - - echo Template::get('table/structure/display_partitions')->render( - array( - 'db' => $db, - 'table' => $table, - 'url_query' => $url_query, - 'partitions' => $partitions, - 'partitionMethod' => $firstPartition->getMethod(), - 'partitionExpression' => $firstPartition->getExpression(), - 'hasDescription' => ! empty($tmp_partition_description), - 'hasSubPartitions' => $hasSubPartitions, - 'subPartitionMethod' => $hasSubPartitions ? $firstSubPartition->getMethod() : null, - 'subPartitionExpression' => $hasSubPartitions ? $firstSubPartition->getExpression() : null, - 'actionIcons' => $actionIcons, - 'rangeOrList' => $rangeOrList, - 'removeUrl' => $removeUrl, - ) - ); - else: - echo Template::get('table/structure/display_partitions')->render( - array( - 'db' => $db, - 'table' => $table, - ) - ); - endif; - ?> - -
    - - - - - - -
    diff --git a/#pma/templates/table/structure/display_table_stats.phtml b/#pma/templates/table/structure/display_table_stats.phtml deleted file mode 100644 index 79fa0a96..00000000 --- a/#pma/templates/table/structure/display_table_stats.phtml +++ /dev/null @@ -1,79 +0,0 @@ -
    - -
    - -

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - render( - array( - 'showtable' => $showtable, - 'tbl_collation' => $tbl_collation, - 'is_innodb' => $is_innodb, - 'mergetable' => $mergetable, - 'avg_size' => (isset ($avg_size) ? $avg_size : ''), - 'avg_unit' => (isset ($avg_unit) ? $avg_unit : '') - ) - ) - ?> -
    -
    diff --git a/#pma/templates/table/structure/move_columns_dialog.phtml b/#pma/templates/table/structure/move_columns_dialog.phtml deleted file mode 100644 index 8e6d5c65..00000000 --- a/#pma/templates/table/structure/move_columns_dialog.phtml +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/#pma/templates/table/structure/optional_action_links.phtml b/#pma/templates/table/structure/optional_action_links.phtml deleted file mode 100644 index b88dbb74..00000000 --- a/#pma/templates/table/structure/optional_action_links.phtml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/table/structure/partition_definition_form.phtml b/#pma/templates/table/structure/partition_definition_form.phtml deleted file mode 100644 index 22a44b77..00000000 --- a/#pma/templates/table/structure/partition_definition_form.phtml +++ /dev/null @@ -1,13 +0,0 @@ -
    - - - - -
    - - -
    -
    - -
    -
    \ No newline at end of file diff --git a/#pma/templates/table/structure/row_stats_table.phtml b/#pma/templates/table/structure/row_stats_table.phtml deleted file mode 100644 index 248ff09f..00000000 --- a/#pma/templates/table/structure/row_stats_table.phtml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - ): ?> - - - - - - - - - 0 - && $mergetable == false): ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    \ No newline at end of file diff --git a/#pma/templates/table/structure/table_structure_header.phtml b/#pma/templates/table/structure/table_structure_header.phtml deleted file mode 100644 index 835ea97a..00000000 --- a/#pma/templates/table/structure/table_structure_header.phtml +++ /dev/null @@ -1,28 +0,0 @@ - - - - # - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/table/structure/table_structure_row.phtml b/#pma/templates/table/structure/table_structure_row.phtml deleted file mode 100644 index 4a35201d..00000000 --- a/#pma/templates/table/structure/table_structure_row.phtml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - -> - - -
    MIME: - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/#pma/templates/test/add_data.phtml b/#pma/templates/test/add_data.phtml deleted file mode 100644 index 1df76706..00000000 --- a/#pma/templates/test/add_data.phtml +++ /dev/null @@ -1,2 +0,0 @@ - -hello($variable); \ No newline at end of file diff --git a/#pma/templates/test/static.phtml b/#pma/templates/test/static.phtml deleted file mode 100644 index 703390d1..00000000 --- a/#pma/templates/test/static.phtml +++ /dev/null @@ -1 +0,0 @@ -static content \ No newline at end of file diff --git a/#pma/templates/test/trim.phtml b/#pma/templates/test/trim.phtml deleted file mode 100644 index 56b4ac49..00000000 --- a/#pma/templates/test/trim.phtml +++ /dev/null @@ -1 +0,0 @@ -outer value value \ No newline at end of file diff --git a/#pma/test/.htaccess b/#pma/test/.htaccess deleted file mode 100644 index 0970a23a..00000000 --- a/#pma/test/.htaccess +++ /dev/null @@ -1,6 +0,0 @@ -# This folder does NOT need to be accessible over HTTP -# In most cases the tests included here will be run from a command line interface. - -# (the following directive denies access by default) -# For more information see: https://httpd.apache.org/docs/current/mod/mod_authz_host.html#allow -Order allow,deny diff --git a/#pma/test/AllSeleniumTests.php b/#pma/test/AllSeleniumTests.php deleted file mode 100644 index dcafe1f9..00000000 --- a/#pma/test/AllSeleniumTests.php +++ /dev/null @@ -1,54 +0,0 @@ -addTestSuite('PmaSeleniumLoginTest'); - $suite->addTestSuite('PmaSeleniumXssTest'); - $suite->addTestSuite('PmaSeleniumPrivilegesTest'); - $suite->addTestSuite('PmaSeleniumCreateDropDatabaseTest'); - $suite->addTestSuite('PmaSeleniumCreateRemoveUserTest'); - return $suite; - } -} diff --git a/#pma/test/Environment_test.php b/#pma/test/Environment_test.php deleted file mode 100644 index f3782862..00000000 --- a/#pma/test/Environment_test.php +++ /dev/null @@ -1,70 +0,0 @@ -assertTrue( - version_compare('5.5', phpversion(), '<='), - 'phpMyAdmin requires PHP 5.5 or above' - ); - } - - /** - * Tests MySQL connection - * - * @return void - */ - public function testMySQL() - { - try { - $pdo = new PDO( - "mysql:host=" . $GLOBALS['TESTSUITE_SERVER'], - $GLOBALS['TESTSUITE_USER'], - $GLOBALS['TESTSUITE_PASSWORD'] - ); - $this->assertNull( - $pdo->errorCode(), - "Error when trying to connect to database" - ); - - $pdo->exec("SHOW DATABASES;"); - $this->assertEquals( - 0, - $pdo->errorCode(), - 'Error trying to show tables for database' - ); - } catch (Exception $e) { - $this->markTestSkipped("Error: " . $e->getMessage()); - } - - // Check id MySQL server is 5 version - preg_match( - "/^(\d+)?\.(\d+)?\.(\*|\d+)/", - $pdo->getAttribute(constant("PDO::ATTR_SERVER_VERSION")), - $version_parts - ); - $this->assertEquals(5, $version_parts[1]); - } -} diff --git a/#pma/test/PMATestCase.php b/#pma/test/PMATestCase.php deleted file mode 100644 index 66d56f7a..00000000 --- a/#pma/test/PMATestCase.php +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - diff --git a/#pma/test/bootstrap-dist.php b/#pma/test/bootstrap-dist.php deleted file mode 100644 index 0188e49b..00000000 --- a/#pma/test/bootstrap-dist.php +++ /dev/null @@ -1,177 +0,0 @@ - 'localhost', - 'TESTSUITE_USER' => 'root', - 'TESTSUITE_PASSWORD' => '', - 'TESTSUITE_DATABASE' => 'test', - 'TESTSUITE_URL' => 'http://localhost/phpmyadmin/', - 'TESTSUITE_SELENIUM_HOST' => '', - 'TESTSUITE_SELENIUM_PORT' => '4444', - 'TESTSUITE_SELENIUM_BROWSER' => 'firefox', - 'TESTSUITE_SELENIUM_COVERAGE' => '', - 'TESTSUITE_BROWSERSTACK_USER' => '', - 'TESTSUITE_BROWSERSTACK_KEY' => '', - 'TESTSUITE_FULL' => '', -); -foreach ($test_defaults as $varname => $defvalue) { - $envvar = getenv($varname); - if ($envvar) { - $GLOBALS[$varname] = $envvar; - } else { - $GLOBALS[$varname] = $defvalue; - } -} - -require_once 'libraries/vendor_config.php'; -require_once 'libraries/autoloader.php'; -require_once 'libraries/core.lib.php'; -$CFG = new PMA\libraries\Config(); -// Initialize PMA_VERSION variable -define('PMA_VERSION', $CFG->get('PMA_VERSION')); -unset($CFG); -require_once 'libraries/sql-parser/autoload.php'; - -/* Ensure default langauge is active */ -require_once 'libraries/php-gettext/gettext.inc'; -PMA\libraries\LanguageManager::getInstance()->getLanguage('en')->activate(); - -// Set proxy information from env, if available -$http_proxy = getenv('http_proxy'); -if ($http_proxy && ($url_info = parse_url($http_proxy))) { - define('PROXY_URL', $url_info['host'] . ':' . $url_info['port']); - define('PROXY_USER', empty($url_info['user']) ? '' : $url_info['user']); - define('PROXY_PASS', empty($url_info['pass']) ? '' : $url_info['pass']); -} else { - define('PROXY_URL', ''); - define('PROXY_USER', ''); - define('PROXY_PASS', ''); -} - -// Ensure we have session started -session_start(); - -// Standard environment for tests -$_SESSION[' PMA_token '] = 'token'; -$_SESSION['tmpval']['pftext'] = 'F'; -$GLOBALS['lang'] = 'en'; -$GLOBALS['is_ajax_request'] = false; -$GLOBALS['cell_align_left'] = 'left'; - -// Check whether we have runkit extension -define('PMA_HAS_RUNKIT', function_exists('runkit_constant_redefine')); -$GLOBALS['runkit_internal_override'] = ini_get('runkit.internal_override'); - - -/** - * Function to emulate headers() function by storing headers in GLOBAL array - * - * @param string $string header string - * @param boolean $replace . - * @param integer $http_response_code . - * - * @return void - */ -function test_header($string, $replace = true, $http_response_code = 200) -{ - if (! isset($GLOBALS['header'])) { - $GLOBALS['header'] = array(); - } - - $GLOBALS['header'][] = $string; -} - -/** - * Function to emulate headers_send. - * - * @return boolean false - */ -function test_headers_sent() -{ - return false; -} - -/** - * Function to emulate date() function - * - * @param string $date_format arg - * - * @return string dummy date - */ -function test_date($date_format) -{ - return '0000-00-00 00:00:00'; -} - -if (PMA_HAS_RUNKIT && $GLOBALS['runkit_internal_override']) { - echo "Enabling headers testing using runkit...\n"; - runkit_function_rename('header', 'test_header_override'); - runkit_function_rename('headers_sent', 'test_headers_sent_override'); - runkit_function_rename('test_header', 'header'); - runkit_function_rename('test_headers_sent', 'headers_sent'); - define('PMA_TEST_HEADERS', true); -} else { - echo "No headers testing.\n"; - echo "Please install runkit and enable runkit.internal_override!\n"; -} - -/** - * Overrides date function - * - * @return boolean whether function was overridden or not - */ -function setupForTestsUsingDate() -{ - if (PMA_HAS_RUNKIT && $GLOBALS['runkit_internal_override']) { - runkit_function_rename('date', 'test_date_override'); - runkit_function_rename('test_date', 'date'); - return true; - } else { - return false; - } -} - -/** - * Restores date function - * - * @return void - */ -function tearDownForTestsUsingDate() -{ - if (PMA_HAS_RUNKIT && $GLOBALS['runkit_internal_override']) { - runkit_function_rename('date', 'test_date'); - runkit_function_rename('test_date_override', 'date'); - } -} diff --git a/#pma/test/classes/AdvisorTest.php b/#pma/test/classes/AdvisorTest.php deleted file mode 100644 index 83fbd3c3..00000000 --- a/#pma/test/classes/AdvisorTest.php +++ /dev/null @@ -1,275 +0,0 @@ -assertEquals(Advisor::escapePercent($text), $expected); - } - - /** - * return of escape Strings - * - * @return array - */ - public function escapeStrings() - { - return array( - array('80%', '80%%'), - array('%s%', '%s%%'), - array('80% foo', '80%% foo'), - array('%s% foo', '%s%% foo'), - ); - } - - /** - * test for parseRulesFile - * - * @return void - */ - public function testParse() - { - $advisor = new Advisor(); - $parseResult = $advisor->parseRulesFile(); - $this->assertEquals($parseResult['errors'], array()); - } - - /** - * test for ADVISOR_bytime - * - * @return void - */ - public function testAdvisorBytime() - { - $result = ADVISOR_bytime(10, 2); - $this->assertEquals("10 per second", $result); - - $result = ADVISOR_bytime(0.02, 2); - $this->assertEquals("1.2 per minute", $result); - - $result = ADVISOR_bytime(0.003, 2); - $this->assertEquals("10.8 per hour", $result); - } - - /** - * test for ADVISOR_timespanFormat - * - * @return void - */ - public function testAdvisorTimespanFormat() - { - $result = ADVISOR_timespanFormat(1200); - $this->assertEquals("0 days, 0 hours, 20 minutes and 0 seconds", $result); - - $result = ADVISOR_timespanFormat(100); - $this->assertEquals("0 days, 0 hours, 1 minutes and 40 seconds", $result); - } - - /** - * Test for adding rule - * - * @param array $rule Rule to test - * @param array $expected Expected rendered rule in fired/errors list - * @param string $error Expected error string (null if none error expected) - * - * @return void - * - * @depends testParse - * @dataProvider rulesProvider - */ - public function testAddRule($rule, $expected, $error) - { - $advisor = new Advisor(); - $parseResult = $advisor->parseRulesFile(); - $this->assertEquals($parseResult['errors'], array()); - $advisor->setVariable('value', 0); - $advisor->addRule('fired', $rule); - $runResult = $advisor->getRunResult(); - if (isset($runResult['errors']) || !is_null($error)) { - $this->assertEquals(array($error), $runResult['errors']); - } - if (isset($runResult['fired']) || $expected != array()) { - $this->assertEquals(array($expected), $runResult['fired']); - } - } - - /** - * rules Provider - * - * @return array - */ - public function rulesProvider() - { - return array( - array( - array( - 'justification' => 'foo', - 'name' => 'Basic', - 'issue' => 'issue', - 'recommendation' => 'Recommend' - ), - array( - 'justification' => 'foo', - 'id' => 'Basic', - 'name' => 'Basic', - 'issue' => 'issue', - 'recommendation' => 'Recommend' - ), - null, - ), - array( - array( - 'justification' => 'foo', - 'name' => 'Variable', - 'issue' => 'issue', - 'recommendation' => 'Recommend {status_var}' - ), - array( - 'justification' => 'foo', - 'id' => 'Variable', - 'name' => 'Variable', - 'issue' => 'issue', - 'recommendation' => 'Recommend status_var' - ), - null, - ), - array( - array( - 'justification' => '%s foo | value', - 'name' => 'Format', - 'issue' => 'issue', - 'recommendation' => 'Recommend' - ), - array( - 'justification' => '0 foo', - 'id' => 'Format', - 'name' => 'Format', - 'issue' => 'issue', - 'recommendation' => 'Recommend' - ), - null, - ), - array( - array( - 'justification' => '%s% foo | value', - 'name' => 'Percent', - 'issue' => 'issue', - 'recommendation' => 'Recommend' - ), - array( - 'justification' => '0% foo', - 'id' => 'Percent', - 'name' => 'Percent', - 'issue' => 'issue', - 'recommendation' => 'Recommend' - ), - null, - ), - array( - array( - 'justification' => '%s% %d foo | value, value', - 'name' => 'Double', - 'issue' => 'issue', - 'recommendation' => 'Recommend' - ), - array( - 'justification' => '0% 0 foo', - 'id' => 'Double', - 'name' => 'Double', - 'issue' => 'issue', - 'recommendation' => 'Recommend' - ), - null, - ), - array( - array( - 'justification' => '"\'foo', - 'name' => 'Quotes', - 'issue' => 'issue', - 'recommendation' => 'Recommend"\'' - ), - array( - 'justification' => '"\'foo', - 'id' => 'Quotes', - 'name' => 'Quotes', - 'issue' => 'issue', - 'recommendation' => 'Recommend"\'' - ), - null, - ), - array( - array( - 'justification' => 'foo | fsafdsa', - 'name' => 'Failure', - 'issue' => 'issue', - 'recommendation' => 'Recommend' - ), - array(), - 'Failed formatting string for rule \'Failure\'. PHP threw ' . - 'following error: Use of undefined constant fsafdsa - ' . - 'assumed \'fsafdsa\'
    Executed code: $value = array(fsafdsa);', - ), - array( - array( - 'justification' => 'Version string (%s) | value', - 'name' => 'Distribution', - 'issue' => 'official MySQL binaries.', - 'recommendation' => 'See web', - ), - array( - 'justification' => 'Version string (0)', - 'name' => 'Distribution', - 'issue' => 'official MySQL binaries.', - 'recommendation' => 'See web', - 'id' => 'Distribution' - ), - null, - ), - ); - } -} diff --git a/#pma/test/classes/ConfigGeneratorTest.php b/#pma/test/classes/ConfigGeneratorTest.php deleted file mode 100644 index 59c42fe9..00000000 --- a/#pma/test/classes/ConfigGeneratorTest.php +++ /dev/null @@ -1,205 +0,0 @@ -setPersistKeys(array("1/", 2)); - - $result = ConfigGenerator::getConfigFile($cf); - - $this->assertContains( - "get('PMA_VERSION') . " setup script\n", - $result - ); - - $this->assertContains( - "/* Servers configuration */\n" . - '$i = 0;' . "\n\n" . - "/* Server: localhost [0] */\n" . - '$i++;' . "\n" . - '$cfg[\'Servers\'][$i][\'0\'] = 1;' . "\n" . - '$cfg[\'Servers\'][$i][\'1\'] = 2;' . "\n" . - '$cfg[\'Servers\'][$i][\'2\'] = 3;' . "\n\n" . - "/* End of servers configuration */\n\n", - $result - ); - - $this->assertContains( - '?>', - $result - ); - } - - /** - * Test for ConfigGenerator::_getVarExport - * - * @return void - */ - public function testGetVarExport() - { - $reflection = new \ReflectionClass('PMA\setup\lib\ConfigGenerator'); - $method = $reflection->getMethod('_getVarExport'); - $method->setAccessible(true); - - $this->assertEquals( - '$cfg[\'var_name\'] = 1;' . "\n", - $method->invoke(null, 'var_name', 1, "\n") - ); - - $this->assertEquals( - '$cfg[\'var_name\'] = array (' . - "\n);\n", - $method->invoke(null, 'var_name', array(), "\n") - ); - - $this->assertEquals( - '$cfg[\'var_name\'] = array(1, 2, 3);' . "\n", - $method->invoke( - null, - 'var_name', - array(1, 2, 3), - "\n" - ) - ); - - $this->assertEquals( - '$cfg[\'var_name\'][\'1a\'] = \'foo\';' . "\n" . - '$cfg[\'var_name\'][\'b\'] = \'bar\';' . "\n", - $method->invoke( - null, - 'var_name', - array( - '1a' => 'foo', - 'b' => 'bar' - ), - "\n" - ) - ); - } - - /** - * Test for ConfigGenerator::_isZeroBasedArray - * - * @return void - */ - public function testIsZeroBasedArray() - { - $reflection = new \ReflectionClass('PMA\setup\lib\ConfigGenerator'); - $method = $reflection->getMethod('_isZeroBasedArray'); - $method->setAccessible(true); - - $this->assertFalse( - $method->invoke( - null, - array( - 'a' => 1, - 'b' => 2 - ) - ) - ); - - $this->assertFalse( - $method->invoke( - null, - array( - 0 => 1, - 1 => 2, - 3 => 3, - ) - ) - ); - - $this->assertTrue( - $method->invoke( - null, - array() - ) - ); - - $this->assertTrue( - $method->invoke( - null, - array(1, 2, 3) - ) - ); - } - - /** - * Test for ConfigGenerator::_exportZeroBasedArray - * - * @return void - */ - public function testExportZeroBasedArray() - { - $reflection = new \ReflectionClass('PMA\setup\lib\ConfigGenerator'); - $method = $reflection->getMethod('_exportZeroBasedArray'); - $method->setAccessible(true); - - $arr = array(1, 2, 3, 4); - - $result = $method->invoke(null, $arr, "\n"); - - $this->assertEquals( - 'array(1, 2, 3, 4)', - $result - ); - - $arr = array(1, 2, 3, 4, 7, 'foo'); - - $result = $method->invoke(null, $arr, "\n"); - - $this->assertEquals( - 'array(' . "\n" . - ' 1,' . "\n" . - ' 2,' . "\n" . - ' 3,' . "\n" . - ' 4,' . "\n" . - ' 7,' . "\n" . - ' \'foo\')', - $result - ); - } -} diff --git a/#pma/test/classes/ConfigTest.php b/#pma/test/classes/ConfigTest.php deleted file mode 100644 index 729efb57..00000000 --- a/#pma/test/classes/ConfigTest.php +++ /dev/null @@ -1,970 +0,0 @@ -object = new PMA\libraries\Config; - $GLOBALS['server'] = 0; - $_SESSION['is_git_revision'] = true; - $GLOBALS['PMA_Config'] = new PMA\libraries\Config(CONFIG_FILE); - $GLOBALS['cfg']['ProxyUrl'] = ''; - - //for testing file permissions - $this->permTestObj = new PMA\libraries\Config("./config.sample.inc.php"); - } - - /** - * Tears down the fixture, for example, closes a network connection. - * This method is called after a test is executed. - * - * @return void - */ - protected function tearDown() - { - unset($this->object); - unset($this->permTestObj); - } - - /** - * Test for CheckSystem - * - * @return void - * @group medium - */ - public function testCheckSystem() - { - $this->object->checkSystem(); - - $this->assertNotNull($this->object->get('PMA_VERSION')); - $this->assertNotEmpty($this->object->get('PMA_THEME_VERSION')); - $this->assertNotEmpty($this->object->get('PMA_THEME_GENERATION')); - } - - /** - * Test for GetFontsizeForm - * - * @return void - */ - public function testGetFontsizeForm() - { - $this->assertContains( - '
    assertContains( - '